| author | |
| committer | |
| log | 2a88a6a456bebcf6c28d7110a5cd60213f43508e |
| tree | 05c944a0fb7837d2db65aacee07abea80b4a2e24 |
| parent | a73f246b2963de0024b9b7070448862e855d5a04 |
| parent | 5f763b7dc581d1f9078edbb668a48af40283a120 |
| signature |
compiler: update aro and translate-c to latest; delete clang translate-c156 files changed, 46118 insertions(+), 55657 deletions(-)
CMakeLists.txt-4| ... | ... | @@ -197,7 +197,6 @@ set(ZIG_CPP_SOURCES |
| 197 | 197 | # These are planned to stay even when we are self-hosted. |
| 198 | 198 | src/zig_llvm.cpp |
| 199 | 199 | src/zig_llvm-ar.cpp |
| 200 | src/zig_clang.cpp | |
| 201 | 200 | src/zig_clang_driver.cpp |
| 202 | 201 | src/zig_clang_cc1_main.cpp |
| 203 | 202 | src/zig_clang_cc1as_main.cpp |
| ... | ... | @@ -502,7 +501,6 @@ set(ZIG_STAGE2_SOURCES |
| 502 | 501 | lib/std/zig/Server.zig |
| 503 | 502 | lib/std/zig/WindowsSdk.zig |
| 504 | 503 | lib/std/zig/Zir.zig |
| 505 | lib/std/zig/c_builtins.zig | |
| 506 | 504 | lib/std/zig/string_literal.zig |
| 507 | 505 | lib/std/zig/system.zig |
| 508 | 506 | lib/std/zig/system/NativePaths.zig |
| ... | ... | @@ -537,7 +535,6 @@ set(ZIG_STAGE2_SOURCES |
| 537 | 535 | src/Value.zig |
| 538 | 536 | src/Zcu.zig |
| 539 | 537 | src/Zcu/PerThread.zig |
| 540 | src/clang.zig | |
| 541 | 538 | src/clang_options.zig |
| 542 | 539 | src/clang_options_data.zig |
| 543 | 540 | src/codegen.zig |
| ... | ... | @@ -641,7 +638,6 @@ set(ZIG_STAGE2_SOURCES |
| 641 | 638 | src/register_manager.zig |
| 642 | 639 | src/target.zig |
| 643 | 640 | src/tracy.zig |
| 644 | src/translate_c.zig | |
| 645 | 641 | src/libs/wasi_libc.zig |
| 646 | 642 | ) |
| 647 | 643 |
build.zig+1-36| ... | ... | @@ -90,8 +90,6 @@ pub fn build(b: *std.Build) !void { |
| 90 | 90 | const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false; |
| 91 | 91 | const skip_single_threaded = b.option(bool, "skip-single-threaded", "Main test suite skips tests that are single-threaded") orelse false; |
| 92 | 92 | const skip_compile_errors = b.option(bool, "skip-compile-errors", "Main test suite skips compile error tests") orelse false; |
| 93 | const skip_translate_c = b.option(bool, "skip-translate-c", "Main test suite skips translate-c tests") orelse false; | |
| 94 | const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse skip_translate_c; | |
| 95 | 93 | const skip_freebsd = b.option(bool, "skip-freebsd", "Main test suite skips targets with freebsd OS") orelse false; |
| 96 | 94 | const skip_netbsd = b.option(bool, "skip-netbsd", "Main test suite skips targets with netbsd OS") orelse false; |
| 97 | 95 | const skip_windows = b.option(bool, "skip-windows", "Main test suite skips targets with windows OS") orelse false; |
| ... | ... | @@ -416,7 +414,7 @@ pub fn build(b: *std.Build) !void { |
| 416 | 414 | test_step.dependOn(check_fmt); |
| 417 | 415 | |
| 418 | 416 | const test_cases_step = b.step("test-cases", "Run the main compiler test cases"); |
| 419 | try tests.addCases(b, test_cases_step, target, .{ | |
| 417 | try tests.addCases(b, test_cases_step, .{ | |
| 420 | 418 | .test_filters = test_filters, |
| 421 | 419 | .test_target_filters = test_target_filters, |
| 422 | 420 | .skip_compile_errors = skip_compile_errors, |
| ... | ... | @@ -428,9 +426,6 @@ pub fn build(b: *std.Build) !void { |
| 428 | 426 | .skip_linux = skip_linux, |
| 429 | 427 | .skip_llvm = skip_llvm, |
| 430 | 428 | .skip_libc = skip_libc, |
| 431 | }, .{ | |
| 432 | .skip_translate_c = skip_translate_c, | |
| 433 | .skip_run_translated_c = skip_run_translated_c, | |
| 434 | 429 | }, .{ |
| 435 | 430 | .enable_llvm = enable_llvm, |
| 436 | 431 | .llvm_has_m68k = llvm_has_m68k, |
| ... | ... | @@ -465,28 +460,6 @@ pub fn build(b: *std.Build) !void { |
| 465 | 460 | .max_rss = 4000000000, |
| 466 | 461 | })); |
| 467 | 462 | |
| 468 | if (!skip_translate_c) { | |
| 469 | test_modules_step.dependOn(tests.addModuleTests(b, .{ | |
| 470 | .test_filters = test_filters, | |
| 471 | .test_target_filters = test_target_filters, | |
| 472 | .test_extra_targets = test_extra_targets, | |
| 473 | .root_src = "test/c_import.zig", | |
| 474 | .name = "c-import", | |
| 475 | .desc = "Run the @cImport tests", | |
| 476 | .optimize_modes = optimization_modes, | |
| 477 | .include_paths = &.{"test/c_import"}, | |
| 478 | .skip_single_threaded = true, | |
| 479 | .skip_non_native = skip_non_native, | |
| 480 | .skip_freebsd = skip_freebsd, | |
| 481 | .skip_netbsd = skip_netbsd, | |
| 482 | .skip_windows = skip_windows, | |
| 483 | .skip_macos = skip_macos, | |
| 484 | .skip_linux = skip_linux, | |
| 485 | .skip_llvm = skip_llvm, | |
| 486 | .skip_libc = skip_libc, | |
| 487 | })); | |
| 488 | } | |
| 489 | ||
| 490 | 463 | test_modules_step.dependOn(tests.addModuleTests(b, .{ |
| 491 | 464 | .test_filters = test_filters, |
| 492 | 465 | .test_target_filters = test_target_filters, |
| ... | ... | @@ -577,7 +550,6 @@ pub fn build(b: *std.Build) !void { |
| 577 | 550 | enable_macos_sdk, |
| 578 | 551 | enable_ios_sdk, |
| 579 | 552 | enable_symlinks_windows, |
| 580 | skip_translate_c, | |
| 581 | 553 | )); |
| 582 | 554 | test_step.dependOn(tests.addCAbiTests(b, .{ |
| 583 | 555 | .test_target_filters = test_target_filters, |
| ... | ... | @@ -732,13 +704,7 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu |
| 732 | 704 | .root_source_file = b.path("lib/compiler/aro/aro.zig"), |
| 733 | 705 | }); |
| 734 | 706 | |
| 735 | const aro_translate_c_mod = b.createModule(.{ | |
| 736 | .root_source_file = b.path("lib/compiler/aro_translate_c.zig"), | |
| 737 | }); | |
| 738 | ||
| 739 | aro_translate_c_mod.addImport("aro", aro_mod); | |
| 740 | 707 | compiler_mod.addImport("aro", aro_mod); |
| 741 | compiler_mod.addImport("aro_translate_c", aro_translate_c_mod); | |
| 742 | 708 | |
| 743 | 709 | return compiler_mod; |
| 744 | 710 | } |
| ... | ... | @@ -1158,7 +1124,6 @@ fn toNativePathSep(b: *std.Build, s: []const u8) []u8 { |
| 1158 | 1124 | const zig_cpp_sources = [_][]const u8{ |
| 1159 | 1125 | // These are planned to stay even when we are self-hosted. |
| 1160 | 1126 | "src/zig_llvm.cpp", |
| 1161 | "src/zig_clang.cpp", | |
| 1162 | 1127 | "src/zig_llvm-ar.cpp", |
| 1163 | 1128 | "src/zig_clang_driver.cpp", |
| 1164 | 1129 | "src/zig_clang_cc1_main.cpp", |
lib/compiler/aro/README.md deleted-26| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | <img src="https://aro.vexu.eu/aro-logo.svg" alt="Aro" width="120px"/> | |
| 2 | ||
| 3 | # Aro | |
| 4 | ||
| 5 | A C compiler with the goal of providing fast compilation and low memory usage with good diagnostics. | |
| 6 | ||
| 7 | Aro is included as an alternative C frontend in the [Zig compiler](https://github.com/ziglang/zig) | |
| 8 | for `translate-c` and eventually compiling C files by translating them to Zig first. | |
| 9 | Aro is developed in https://github.com/Vexu/arocc and the Zig dependency is | |
| 10 | updated from there when needed. | |
| 11 | ||
| 12 | Currently most of standard C is supported up to C23 and as are many of the common | |
| 13 | extensions from GNU, MSVC, and Clang | |
| 14 | ||
| 15 | Basic code generation is supported for x86-64 linux and can produce a valid hello world: | |
| 16 | ```sh-session | |
| 17 | $ cat hello.c | |
| 18 | extern int printf(const char *restrict fmt, ...); | |
| 19 | int main(void) { | |
| 20 | printf("Hello, world!\n"); | |
| 21 | return 0; | |
| 22 | } | |
| 23 | $ zig build && ./zig-out/bin/arocc hello.c -o hello | |
| 24 | $ ./hello | |
| 25 | Hello, world! | |
| 26 | ``` |
lib/compiler/aro/aro.zig+6-4| ... | ... | @@ -5,12 +5,14 @@ pub const Driver = @import("aro/Driver.zig"); |
| 5 | 5 | pub const Parser = @import("aro/Parser.zig"); |
| 6 | 6 | pub const Preprocessor = @import("aro/Preprocessor.zig"); |
| 7 | 7 | pub const Source = @import("aro/Source.zig"); |
| 8 | pub const StringInterner = @import("aro/StringInterner.zig"); | |
| 9 | pub const target_util = @import("aro/target.zig"); | |
| 8 | 10 | pub const Tokenizer = @import("aro/Tokenizer.zig"); |
| 9 | 11 | pub const Toolchain = @import("aro/Toolchain.zig"); |
| 10 | 12 | pub const Tree = @import("aro/Tree.zig"); |
| 11 | pub const Type = @import("aro/Type.zig"); | |
| 12 | pub const TypeMapper = @import("aro/StringInterner.zig").TypeMapper; | |
| 13 | pub const target_util = @import("aro/target.zig"); | |
| 13 | pub const TypeStore = @import("aro/TypeStore.zig"); | |
| 14 | pub const QualType = TypeStore.QualType; | |
| 15 | pub const Type = TypeStore.Type; | |
| 14 | 16 | pub const Value = @import("aro/Value.zig"); |
| 15 | 17 | |
| 16 | 18 | const backend = @import("backend.zig"); |
| ... | ... | @@ -18,6 +20,7 @@ pub const Interner = backend.Interner; |
| 18 | 20 | pub const Ir = backend.Ir; |
| 19 | 21 | pub const Object = backend.Object; |
| 20 | 22 | pub const CallingConvention = backend.CallingConvention; |
| 23 | pub const Assembly = backend.Assembly; | |
| 21 | 24 | |
| 22 | 25 | pub const version_str = backend.version_str; |
| 23 | 26 | pub const version = backend.version; |
| ... | ... | @@ -34,6 +37,5 @@ test { |
| 34 | 37 | _ = @import("aro/Preprocessor.zig"); |
| 35 | 38 | _ = @import("aro/target.zig"); |
| 36 | 39 | _ = @import("aro/Tokenizer.zig"); |
| 37 | _ = @import("aro/toolchains/Linux.zig"); | |
| 38 | 40 | _ = @import("aro/Value.zig"); |
| 39 | 41 | } |
lib/compiler/aro/aro/Attribute.zig+467-285| ... | ... | @@ -6,9 +6,8 @@ const Compilation = @import("Compilation.zig"); |
| 6 | 6 | const Diagnostics = @import("Diagnostics.zig"); |
| 7 | 7 | const Parser = @import("Parser.zig"); |
| 8 | 8 | const Tree = @import("Tree.zig"); |
| 9 | const NodeIndex = Tree.NodeIndex; | |
| 10 | 9 | const TokenIndex = Tree.TokenIndex; |
| 11 | const Type = @import("Type.zig"); | |
| 10 | const QualType = @import("TypeStore.zig").QualType; | |
| 12 | 11 | const Value = @import("Value.zig"); |
| 13 | 12 | |
| 14 | 13 | const Attribute = @This(); |
| ... | ... | @@ -39,79 +38,53 @@ pub const Kind = enum { |
| 39 | 38 | }; |
| 40 | 39 | |
| 41 | 40 | pub const Iterator = struct { |
| 42 | source: union(enum) { | |
| 43 | ty: Type, | |
| 44 | slice: []const Attribute, | |
| 41 | source: ?struct { | |
| 42 | qt: QualType, | |
| 43 | comp: *const Compilation, | |
| 45 | 44 | }, |
| 45 | slice: []const Attribute, | |
| 46 | 46 | index: usize, |
| 47 | 47 | |
| 48 | pub fn initSlice(slice: ?[]const Attribute) Iterator { | |
| 49 | return .{ .source = .{ .slice = slice orelse &.{} }, .index = 0 }; | |
| 48 | pub fn initSlice(slice: []const Attribute) Iterator { | |
| 49 | return .{ .source = null, .slice = slice, .index = 0 }; | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | pub fn initType(ty: Type) Iterator { | |
| 53 | return .{ .source = .{ .ty = ty }, .index = 0 }; | |
| 52 | pub fn initType(qt: QualType, comp: *const Compilation) Iterator { | |
| 53 | return .{ .source = .{ .qt = qt, .comp = comp }, .slice = &.{}, .index = 0 }; | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /// returns the next attribute as well as its index within the slice or current type |
| 57 | 57 | /// The index can be used to determine when a nested type has been recursed into |
| 58 | 58 | pub fn next(self: *Iterator) ?struct { Attribute, usize } { |
| 59 | switch (self.source) { | |
| 60 | .slice => |slice| { | |
| 61 | if (self.index < slice.len) { | |
| 62 | defer self.index += 1; | |
| 63 | return .{ slice[self.index], self.index }; | |
| 64 | } | |
| 65 | }, | |
| 66 | .ty => |ty| { | |
| 67 | switch (ty.specifier) { | |
| 68 | .typeof_type => { | |
| 69 | self.* = .{ .source = .{ .ty = ty.data.sub_type.* }, .index = 0 }; | |
| 70 | return self.next(); | |
| 71 | }, | |
| 72 | .typeof_expr => { | |
| 73 | self.* = .{ .source = .{ .ty = ty.data.expr.ty }, .index = 0 }; | |
| 74 | return self.next(); | |
| 75 | }, | |
| 76 | .attributed => { | |
| 77 | if (self.index < ty.data.attributed.attributes.len) { | |
| 78 | defer self.index += 1; | |
| 79 | return .{ ty.data.attributed.attributes[self.index], self.index }; | |
| 80 | } | |
| 81 | self.* = .{ .source = .{ .ty = ty.data.attributed.base }, .index = 0 }; | |
| 82 | return self.next(); | |
| 83 | }, | |
| 84 | else => {}, | |
| 85 | } | |
| 86 | }, | |
| 59 | if (self.index < self.slice.len) { | |
| 60 | defer self.index += 1; | |
| 61 | return .{ self.slice[self.index], self.index }; | |
| 62 | } | |
| 63 | if (self.source) |*source| { | |
| 64 | var cur = source.qt; | |
| 65 | if (cur.isInvalid()) { | |
| 66 | self.source = null; | |
| 67 | return null; | |
| 68 | } | |
| 69 | while (true) switch (cur.type(source.comp)) { | |
| 70 | .typeof => |typeof| cur = typeof.base, | |
| 71 | .attributed => |attributed| { | |
| 72 | self.slice = attributed.attributes; | |
| 73 | self.index = 1; | |
| 74 | source.qt = attributed.base; | |
| 75 | return .{ self.slice[0], 0 }; | |
| 76 | }, | |
| 77 | .typedef => |typedef| cur = typedef.base, | |
| 78 | else => { | |
| 79 | self.source = null; | |
| 80 | break; | |
| 81 | }, | |
| 82 | }; | |
| 87 | 83 | } |
| 88 | 84 | return null; |
| 89 | 85 | } |
| 90 | 86 | }; |
| 91 | 87 | |
| 92 | pub const ArgumentType = enum { | |
| 93 | string, | |
| 94 | identifier, | |
| 95 | int, | |
| 96 | alignment, | |
| 97 | float, | |
| 98 | complex_float, | |
| 99 | expression, | |
| 100 | nullptr_t, | |
| 101 | ||
| 102 | pub fn toString(self: ArgumentType) []const u8 { | |
| 103 | return switch (self) { | |
| 104 | .string => "a string", | |
| 105 | .identifier => "an identifier", | |
| 106 | .int, .alignment => "an integer constant", | |
| 107 | .nullptr_t => "nullptr", | |
| 108 | .float => "a floating point number", | |
| 109 | .complex_float => "a complex floating point number", | |
| 110 | .expression => "an expression", | |
| 111 | }; | |
| 112 | } | |
| 113 | }; | |
| 114 | ||
| 115 | 88 | /// number of required arguments |
| 116 | 89 | pub fn requiredArgCount(attr: Tag) u32 { |
| 117 | 90 | switch (attr) { |
| ... | ... | @@ -211,21 +184,20 @@ pub fn wantsIdentEnum(attr: Tag) bool { |
| 211 | 184 | } |
| 212 | 185 | } |
| 213 | 186 | |
| 214 | pub fn diagnoseIdent(attr: Tag, arguments: *Arguments, ident: []const u8) ?Diagnostics.Message { | |
| 187 | pub fn diagnoseIdent(attr: Tag, arguments: *Arguments, ident: TokenIndex, p: *Parser) !bool { | |
| 215 | 188 | switch (attr) { |
| 216 | 189 | inline else => |tag| { |
| 217 | 190 | const fields = @typeInfo(@field(attributes, @tagName(tag))).@"struct".fields; |
| 218 | 191 | if (fields.len == 0) unreachable; |
| 219 | 192 | const Unwrapped = UnwrapOptional(fields[0].type); |
| 220 | 193 | if (@typeInfo(Unwrapped) != .@"enum") unreachable; |
| 221 | if (std.meta.stringToEnum(Unwrapped, normalize(ident))) |enum_val| { | |
| 194 | if (std.meta.stringToEnum(Unwrapped, normalize(p.tokSlice(ident)))) |enum_val| { | |
| 222 | 195 | @field(@field(arguments, @tagName(tag)), fields[0].name) = enum_val; |
| 223 | return null; | |
| 196 | return false; | |
| 224 | 197 | } |
| 225 | return Diagnostics.Message{ | |
| 226 | .tag = .unknown_attr_enum, | |
| 227 | .extra = .{ .attr_enum = .{ .tag = attr } }, | |
| 228 | }; | |
| 198 | ||
| 199 | try p.err(ident, .unknown_attr_enum, .{ @tagName(attr), Formatting.choices(attr) }); | |
| 200 | return true; | |
| 229 | 201 | }, |
| 230 | 202 | } |
| 231 | 203 | } |
| ... | ... | @@ -244,7 +216,7 @@ pub fn wantsAlignment(attr: Tag, idx: usize) bool { |
| 244 | 216 | } |
| 245 | 217 | } |
| 246 | 218 | |
| 247 | pub fn diagnoseAlignment(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, p: *Parser) !?Diagnostics.Message { | |
| 219 | pub fn diagnoseAlignment(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, arg_start: TokenIndex, p: *Parser) !bool { | |
| 248 | 220 | switch (attr) { |
| 249 | 221 | inline else => |tag| { |
| 250 | 222 | 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 |
| 254 | 226 | inline 0...arg_fields.len - 1 => |arg_i| { |
| 255 | 227 | if (UnwrapOptional(arg_fields[arg_i].type) != Alignment) unreachable; |
| 256 | 228 | |
| 257 | if (!res.val.is(.int, p.comp)) return Diagnostics.Message{ .tag = .alignas_unavailable }; | |
| 229 | if (!res.val.is(.int, p.comp)) { | |
| 230 | try p.err(arg_start, .alignas_unavailable, .{}); | |
| 231 | return true; | |
| 232 | } | |
| 258 | 233 | if (res.val.compare(.lt, Value.zero, p.comp)) { |
| 259 | return Diagnostics.Message{ .tag = .negative_alignment, .extra = .{ .str = try res.str(p) } }; | |
| 234 | try p.err(arg_start, .negative_alignment, .{res}); | |
| 235 | return true; | |
| 260 | 236 | } |
| 261 | 237 | const requested = res.val.toInt(u29, p.comp) orelse { |
| 262 | return Diagnostics.Message{ .tag = .maximum_alignment, .extra = .{ .str = try res.str(p) } }; | |
| 238 | try p.err(arg_start, .maximum_alignment, .{res}); | |
| 239 | return true; | |
| 263 | 240 | }; |
| 264 | if (!std.mem.isValidAlign(requested)) return Diagnostics.Message{ .tag = .non_pow2_align }; | |
| 241 | if (!std.mem.isValidAlign(requested)) { | |
| 242 | try p.err(arg_start, .non_pow2_align, .{}); | |
| 243 | return true; | |
| 244 | } | |
| 265 | 245 | |
| 266 | @field(@field(arguments, @tagName(tag)), arg_fields[arg_i].name) = Alignment{ .requested = requested }; | |
| 267 | return null; | |
| 246 | @field(@field(arguments, @tagName(tag)), arg_fields[arg_i].name) = .{ .requested = requested }; | |
| 247 | return false; | |
| 268 | 248 | }, |
| 269 | 249 | else => unreachable, |
| 270 | 250 | } |
| ... | ... | @@ -278,102 +258,106 @@ fn diagnoseField( |
| 278 | 258 | comptime Wanted: type, |
| 279 | 259 | arguments: *Arguments, |
| 280 | 260 | res: Parser.Result, |
| 261 | arg_start: TokenIndex, | |
| 281 | 262 | node: Tree.Node, |
| 282 | 263 | p: *Parser, |
| 283 | ) !?Diagnostics.Message { | |
| 264 | ) !bool { | |
| 265 | const string = "a string"; | |
| 266 | const identifier = "an identifier"; | |
| 267 | const int = "an integer constant"; | |
| 268 | const alignment = "an integer constant"; | |
| 269 | const nullptr_t = "nullptr"; | |
| 270 | const float = "a floating point number"; | |
| 271 | const complex_float = "a complex floating point number"; | |
| 272 | const expression = "an expression"; | |
| 273 | ||
| 274 | const expected: []const u8 = switch (Wanted) { | |
| 275 | Value => string, | |
| 276 | Identifier => identifier, | |
| 277 | u32 => int, | |
| 278 | Alignment => alignment, | |
| 279 | CallingConvention => identifier, | |
| 280 | else => switch (@typeInfo(Wanted)) { | |
| 281 | .@"enum" => if (Wanted.opts.enum_kind == .string) string else identifier, | |
| 282 | else => unreachable, | |
| 283 | }, | |
| 284 | }; | |
| 285 | ||
| 284 | 286 | if (res.val.opt_ref == .none) { |
| 285 | if (Wanted == Identifier and node.tag == .decl_ref_expr) { | |
| 286 | @field(@field(arguments, decl.name), field.name) = Identifier{ .tok = node.data.decl_ref }; | |
| 287 | return null; | |
| 287 | if (Wanted == Identifier and node == .decl_ref_expr) { | |
| 288 | @field(@field(arguments, decl.name), field.name) = .{ .tok = node.decl_ref_expr.name_tok }; | |
| 289 | return false; | |
| 288 | 290 | } |
| 289 | return invalidArgMsg(Wanted, .expression); | |
| 291 | ||
| 292 | try p.err(arg_start, .attribute_arg_invalid, .{ expected, expression }); | |
| 293 | return true; | |
| 290 | 294 | } |
| 291 | 295 | const key = p.comp.interner.get(res.val.ref()); |
| 292 | 296 | switch (key) { |
| 293 | 297 | .int => { |
| 294 | 298 | if (@typeInfo(Wanted) == .int) { |
| 295 | @field(@field(arguments, decl.name), field.name) = res.val.toInt(Wanted, p.comp) orelse return .{ | |
| 296 | .tag = .attribute_int_out_of_range, | |
| 297 | .extra = .{ .str = try res.str(p) }, | |
| 299 | @field(@field(arguments, decl.name), field.name) = res.val.toInt(Wanted, p.comp) orelse { | |
| 300 | try p.err(arg_start, .attribute_int_out_of_range, .{res}); | |
| 301 | return true; | |
| 298 | 302 | }; |
| 299 | return null; | |
| 303 | ||
| 304 | return false; | |
| 300 | 305 | } |
| 301 | 306 | }, |
| 302 | 307 | .bytes => |bytes| { |
| 303 | 308 | if (Wanted == Value) { |
| 304 | if (node.tag != .string_literal_expr or (!node.ty.elemType().is(.char) and !node.ty.elemType().is(.uchar))) { | |
| 305 | return .{ | |
| 306 | .tag = .attribute_requires_string, | |
| 307 | .extra = .{ .str = decl.name }, | |
| 308 | }; | |
| 309 | validate: { | |
| 310 | if (node != .string_literal_expr) break :validate; | |
| 311 | switch (node.string_literal_expr.qt.childType(p.comp).get(p.comp, .int).?) { | |
| 312 | .char, .uchar, .schar => {}, | |
| 313 | else => break :validate, | |
| 314 | } | |
| 315 | @field(@field(arguments, decl.name), field.name) = try p.removeNull(res.val); | |
| 316 | return false; | |
| 309 | 317 | } |
| 310 | @field(@field(arguments, decl.name), field.name) = try p.removeNull(res.val); | |
| 311 | return null; | |
| 318 | ||
| 319 | try p.err(arg_start, .attribute_requires_string, .{decl.name}); | |
| 320 | return true; | |
| 312 | 321 | } else if (@typeInfo(Wanted) == .@"enum" and @hasDecl(Wanted, "opts") and Wanted.opts.enum_kind == .string) { |
| 313 | 322 | const str = bytes[0 .. bytes.len - 1]; |
| 314 | 323 | if (std.meta.stringToEnum(Wanted, str)) |enum_val| { |
| 315 | 324 | @field(@field(arguments, decl.name), field.name) = enum_val; |
| 316 | return null; | |
| 317 | } else { | |
| 318 | return .{ | |
| 319 | .tag = .unknown_attr_enum, | |
| 320 | .extra = .{ .attr_enum = .{ .tag = std.meta.stringToEnum(Tag, decl.name).? } }, | |
| 321 | }; | |
| 325 | return false; | |
| 322 | 326 | } |
| 327 | ||
| 328 | try p.err(arg_start, .unknown_attr_enum, .{ decl.name, Formatting.choices(@field(Tag, decl.name)) }); | |
| 329 | return true; | |
| 323 | 330 | } |
| 324 | 331 | }, |
| 325 | 332 | else => {}, |
| 326 | 333 | } |
| 327 | return invalidArgMsg(Wanted, switch (key) { | |
| 328 | .int => .int, | |
| 329 | .bytes => .string, | |
| 330 | .float => .float, | |
| 331 | .complex => .complex_float, | |
| 332 | .null => .nullptr_t, | |
| 333 | .int_ty, | |
| 334 | .float_ty, | |
| 335 | .complex_ty, | |
| 336 | .ptr_ty, | |
| 337 | .noreturn_ty, | |
| 338 | .void_ty, | |
| 339 | .func_ty, | |
| 340 | .array_ty, | |
| 341 | .vector_ty, | |
| 342 | .record_ty, | |
| 343 | => unreachable, | |
| 344 | }); | |
| 345 | } | |
| 346 | 334 | |
| 347 | fn invalidArgMsg(comptime Expected: type, actual: ArgumentType) Diagnostics.Message { | |
| 348 | return .{ | |
| 349 | .tag = .attribute_arg_invalid, | |
| 350 | .extra = .{ .attr_arg_type = .{ .expected = switch (Expected) { | |
| 351 | Value => .string, | |
| 352 | Identifier => .identifier, | |
| 353 | u32 => .int, | |
| 354 | Alignment => .alignment, | |
| 355 | CallingConvention => .identifier, | |
| 356 | else => switch (@typeInfo(Expected)) { | |
| 357 | .@"enum" => if (Expected.opts.enum_kind == .string) .string else .identifier, | |
| 358 | else => unreachable, | |
| 359 | }, | |
| 360 | }, .actual = actual } }, | |
| 361 | }; | |
| 335 | try p.err(arg_start, .attribute_arg_invalid, .{ expected, switch (key) { | |
| 336 | .int => int, | |
| 337 | .bytes => string, | |
| 338 | .float => float, | |
| 339 | .complex => complex_float, | |
| 340 | .null => nullptr_t, | |
| 341 | else => unreachable, | |
| 342 | } }); | |
| 343 | return true; | |
| 362 | 344 | } |
| 363 | 345 | |
| 364 | pub fn diagnose(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, node: Tree.Node, p: *Parser) !?Diagnostics.Message { | |
| 346 | pub fn diagnose(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, arg_start: TokenIndex, node: Tree.Node, p: *Parser) !bool { | |
| 365 | 347 | switch (attr) { |
| 348 | .nonnull => return false, | |
| 366 | 349 | inline else => |tag| { |
| 367 | 350 | const decl = @typeInfo(attributes).@"struct".decls[@intFromEnum(tag)]; |
| 368 | 351 | const max_arg_count = comptime maxArgCount(tag); |
| 369 | if (arg_idx >= max_arg_count) return Diagnostics.Message{ | |
| 370 | .tag = .attribute_too_many_args, | |
| 371 | .extra = .{ .attr_arg_count = .{ .attribute = attr, .expected = max_arg_count } }, | |
| 372 | }; | |
| 352 | if (arg_idx >= max_arg_count) { | |
| 353 | try p.err(arg_start, .attribute_too_many_args, .{ @tagName(attr), max_arg_count }); | |
| 354 | return true; | |
| 355 | } | |
| 356 | ||
| 373 | 357 | const arg_fields = @typeInfo(@field(attributes, decl.name)).@"struct".fields; |
| 374 | 358 | switch (arg_idx) { |
| 375 | 359 | inline 0...arg_fields.len - 1 => |arg_i| { |
| 376 | return diagnoseField(decl, arg_fields[arg_i], UnwrapOptional(arg_fields[arg_i].type), arguments, res, node, p); | |
| 360 | return diagnoseField(decl, arg_fields[arg_i], UnwrapOptional(arg_fields[arg_i].type), arguments, res, arg_start, node, p); | |
| 377 | 361 | }, |
| 378 | 362 | else => unreachable, |
| 379 | 363 | } |
| ... | ... | @@ -386,8 +370,8 @@ const EnumTypes = enum { |
| 386 | 370 | identifier, |
| 387 | 371 | }; |
| 388 | 372 | pub const Alignment = struct { |
| 389 | node: NodeIndex = .none, | |
| 390 | requested: u29, | |
| 373 | node: Tree.Node.OptIndex = .null, | |
| 374 | requested: u32, | |
| 391 | 375 | }; |
| 392 | 376 | pub const Identifier = struct { |
| 393 | 377 | tok: TokenIndex = 0, |
| ... | ... | @@ -549,13 +533,11 @@ const attributes = struct { |
| 549 | 533 | pub const @"noinline" = struct {}; |
| 550 | 534 | pub const noipa = struct {}; |
| 551 | 535 | // TODO: arbitrary number of arguments |
| 552 | // const nonnull = struct { | |
| 553 | // // arg_index: []const u32, | |
| 554 | // }; | |
| 555 | // }; | |
| 536 | pub const nonnull = struct {}; | |
| 556 | 537 | pub const nonstring = struct {}; |
| 557 | 538 | pub const noplt = struct {}; |
| 558 | 539 | pub const @"noreturn" = struct {}; |
| 540 | pub const nothrow = struct {}; | |
| 559 | 541 | // TODO: union args ? |
| 560 | 542 | // const optimize = struct { |
| 561 | 543 | // // optimize, // u32 | []const u8 -- optimize? |
| ... | ... | @@ -697,6 +679,39 @@ const attributes = struct { |
| 697 | 679 | pub const calling_convention = struct { |
| 698 | 680 | cc: CallingConvention, |
| 699 | 681 | }; |
| 682 | pub const nullability = struct { | |
| 683 | kind: enum { | |
| 684 | nonnull, | |
| 685 | nullable, | |
| 686 | nullable_result, | |
| 687 | unspecified, | |
| 688 | ||
| 689 | const opts = struct { | |
| 690 | const enum_kind = .identifier; | |
| 691 | }; | |
| 692 | }, | |
| 693 | }; | |
| 694 | pub const unaligned = struct {}; | |
| 695 | pub const pcs = struct { | |
| 696 | kind: enum { | |
| 697 | aapcs, | |
| 698 | @"aapcs-vfp", | |
| 699 | ||
| 700 | const opts = struct { | |
| 701 | const enum_kind = .string; | |
| 702 | }; | |
| 703 | }, | |
| 704 | }; | |
| 705 | pub const riscv_vector_cc = struct {}; | |
| 706 | pub const aarch64_sve_pcs = struct {}; | |
| 707 | pub const aarch64_vector_pcs = struct {}; | |
| 708 | pub const fastcall = struct {}; | |
| 709 | pub const stdcall = struct {}; | |
| 710 | pub const vectorcall = struct {}; | |
| 711 | pub const cdecl = struct {}; | |
| 712 | pub const thiscall = struct {}; | |
| 713 | pub const sysv_abi = struct {}; | |
| 714 | pub const ms_abi = struct {}; | |
| 700 | 715 | }; |
| 701 | 716 | |
| 702 | 717 | pub const Tag = std.meta.DeclEnum(attributes); |
| ... | ... | @@ -777,117 +792,140 @@ pub fn normalize(name: []const u8) []const u8 { |
| 777 | 792 | } |
| 778 | 793 | |
| 779 | 794 | fn ignoredAttrErr(p: *Parser, tok: TokenIndex, attr: Attribute.Tag, context: []const u8) !void { |
| 780 | const strings_top = p.strings.items.len; | |
| 781 | defer p.strings.items.len = strings_top; | |
| 795 | try p.err(tok, .ignored_attribute, .{ @tagName(attr), context }); | |
| 796 | } | |
| 782 | 797 | |
| 783 | try p.strings.print("attribute '{s}' ignored on {s}", .{ @tagName(attr), context }); | |
| 784 | const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 785 | try p.errStr(.ignored_attribute, tok, str); | |
| 798 | pub fn applyParameterAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic) !QualType { | |
| 799 | return applyVariableOrParameterAttributes(p, qt, attr_buf_start, diagnostic, .parameter); | |
| 786 | 800 | } |
| 787 | 801 | |
| 788 | pub const applyParameterAttributes = applyVariableAttributes; | |
| 789 | pub fn applyVariableAttributes(p: *Parser, ty: Type, attr_buf_start: usize, tag: ?Diagnostics.Tag) !Type { | |
| 802 | pub fn applyVariableAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic) !QualType { | |
| 803 | return applyVariableOrParameterAttributes(p, qt, attr_buf_start, diagnostic, .variable); | |
| 804 | } | |
| 805 | ||
| 806 | fn applyVariableOrParameterAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic, context: enum { parameter, variable }) !QualType { | |
| 807 | const gpa = p.comp.gpa; | |
| 790 | 808 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 791 | 809 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 792 | 810 | p.attr_application_buf.items.len = 0; |
| 793 | var base_ty = ty; | |
| 811 | var base_qt = qt; | |
| 794 | 812 | var common = false; |
| 795 | 813 | var nocommon = false; |
| 796 | 814 | for (attrs, toks) |attr, tok| switch (attr.tag) { |
| 797 | 815 | // zig fmt: off |
| 798 | 816 | .alias, .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .weak, .used, |
| 799 | .noinit, .retain, .persistent, .section, .mode, .asm_label, | |
| 800 | => try p.attr_application_buf.append(p.gpa, attr), | |
| 817 | .noinit, .retain, .persistent, .section, .mode, .asm_label, .nullability, .unaligned, | |
| 818 | => try p.attr_application_buf.append(gpa, attr), | |
| 801 | 819 | // zig fmt: on |
| 802 | 820 | .common => if (nocommon) { |
| 803 | try p.errTok(.ignore_common, tok); | |
| 821 | try p.err(tok, .ignore_common, .{}); | |
| 804 | 822 | } else { |
| 805 | try p.attr_application_buf.append(p.gpa, attr); | |
| 823 | try p.attr_application_buf.append(gpa, attr); | |
| 806 | 824 | common = true; |
| 807 | 825 | }, |
| 808 | 826 | .nocommon => if (common) { |
| 809 | try p.errTok(.ignore_nocommon, tok); | |
| 827 | try p.err(tok, .ignore_nocommon, .{}); | |
| 810 | 828 | } else { |
| 811 | try p.attr_application_buf.append(p.gpa, attr); | |
| 829 | try p.attr_application_buf.append(gpa, attr); | |
| 812 | 830 | nocommon = true; |
| 813 | 831 | }, |
| 814 | .vector_size => try attr.applyVectorSize(p, tok, &base_ty), | |
| 815 | .aligned => try attr.applyAligned(p, base_ty, tag), | |
| 816 | .nonstring => if (!base_ty.isArray() or !(base_ty.is(.char) or base_ty.is(.uchar) or base_ty.is(.schar))) { | |
| 817 | try p.errStr(.non_string_ignored, tok, try p.typeStr(ty)); | |
| 818 | } else { | |
| 819 | try p.attr_application_buf.append(p.gpa, attr); | |
| 832 | .vector_size => try attr.applyVectorSize(p, tok, &base_qt), | |
| 833 | .aligned => try attr.applyAligned(p, base_qt, diagnostic), | |
| 834 | .nonnull => { | |
| 835 | switch (context) { | |
| 836 | .parameter => try p.err(tok, .attribute_todo, .{ "nonnull", "parameters" }), | |
| 837 | .variable => try p.err(tok, .nonnull_not_applicable, .{}), | |
| 838 | } | |
| 820 | 839 | }, |
| 821 | .uninitialized => if (p.func.ty == null) { | |
| 822 | try p.errStr(.local_variable_attribute, tok, "uninitialized"); | |
| 840 | .nonstring => { | |
| 841 | if (base_qt.get(p.comp, .array)) |array_ty| { | |
| 842 | if (array_ty.elem.get(p.comp, .int)) |int_ty| switch (int_ty) { | |
| 843 | .char, .uchar, .schar => { | |
| 844 | try p.attr_application_buf.append(gpa, attr); | |
| 845 | continue; | |
| 846 | }, | |
| 847 | else => {}, | |
| 848 | }; | |
| 849 | } | |
| 850 | try p.err(tok, .non_string_ignored, .{qt}); | |
| 851 | }, | |
| 852 | .uninitialized => if (p.func.qt == null) { | |
| 853 | try p.err(tok, .local_variable_attribute, .{"uninitialized"}); | |
| 823 | 854 | } else { |
| 824 | try p.attr_application_buf.append(p.gpa, attr); | |
| 855 | try p.attr_application_buf.append(gpa, attr); | |
| 825 | 856 | }, |
| 826 | .cleanup => if (p.func.ty == null) { | |
| 827 | try p.errStr(.local_variable_attribute, tok, "cleanup"); | |
| 857 | .cleanup => if (p.func.qt == null) { | |
| 858 | try p.err(tok, .local_variable_attribute, .{"cleanup"}); | |
| 828 | 859 | } else { |
| 829 | try p.attr_application_buf.append(p.gpa, attr); | |
| 860 | try p.attr_application_buf.append(gpa, attr); | |
| 830 | 861 | }, |
| 862 | .calling_convention => try applyCallingConvention(attr, p, tok, base_qt), | |
| 831 | 863 | .alloc_size, |
| 832 | 864 | .copy, |
| 833 | 865 | .tls_model, |
| 834 | 866 | .visibility, |
| 835 | => |t| try p.errExtra(.attribute_todo, tok, .{ .attribute_todo = .{ .tag = t, .kind = .variables } }), | |
| 867 | => |t| try p.err(tok, .attribute_todo, .{ @tagName(t), "variables" }), | |
| 868 | // There is already an error in Parser for _Noreturn keyword | |
| 869 | .noreturn => if (attr.syntax != .keyword) try ignoredAttrErr(p, tok, attr.tag, "variables"), | |
| 836 | 870 | else => try ignoredAttrErr(p, tok, attr.tag, "variables"), |
| 837 | 871 | }; |
| 838 | return base_ty.withAttributes(p.arena, p.attr_application_buf.items); | |
| 872 | return applySelected(base_qt, p); | |
| 839 | 873 | } |
| 840 | 874 | |
| 841 | pub fn applyFieldAttributes(p: *Parser, field_ty: *Type, attr_buf_start: usize) ![]const Attribute { | |
| 875 | pub fn applyFieldAttributes(p: *Parser, field_qt: *QualType, attr_buf_start: usize) ![]const Attribute { | |
| 842 | 876 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 843 | 877 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 844 | 878 | p.attr_application_buf.items.len = 0; |
| 845 | 879 | for (attrs, toks) |attr, tok| switch (attr.tag) { |
| 846 | 880 | // zig fmt: off |
| 847 | .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .mode, .warn_unused_result, .nodiscard, | |
| 848 | => try p.attr_application_buf.append(p.gpa, attr), | |
| 881 | .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, | |
| 882 | .mode, .warn_unused_result, .nodiscard, .nullability, .unaligned, | |
| 883 | => try p.attr_application_buf.append(p.comp.gpa, attr), | |
| 849 | 884 | // zig fmt: on |
| 850 | .vector_size => try attr.applyVectorSize(p, tok, field_ty), | |
| 851 | .aligned => try attr.applyAligned(p, field_ty.*, null), | |
| 885 | .vector_size => try attr.applyVectorSize(p, tok, field_qt), | |
| 886 | .aligned => try attr.applyAligned(p, field_qt.*, null), | |
| 887 | .calling_convention => try applyCallingConvention(attr, p, tok, field_qt.*), | |
| 852 | 888 | else => try ignoredAttrErr(p, tok, attr.tag, "fields"), |
| 853 | 889 | }; |
| 854 | if (p.attr_application_buf.items.len == 0) return &[0]Attribute{}; | |
| 855 | return p.arena.dupe(Attribute, p.attr_application_buf.items); | |
| 890 | return p.attr_application_buf.items; | |
| 856 | 891 | } |
| 857 | 892 | |
| 858 | pub fn applyTypeAttributes(p: *Parser, ty: Type, attr_buf_start: usize, tag: ?Diagnostics.Tag) !Type { | |
| 893 | pub fn applyTypeAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic) !QualType { | |
| 894 | const gpa = p.comp.gpa; | |
| 859 | 895 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 860 | 896 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 861 | 897 | p.attr_application_buf.items.len = 0; |
| 862 | var base_ty = ty; | |
| 898 | var base_qt = qt; | |
| 863 | 899 | for (attrs, toks) |attr, tok| switch (attr.tag) { |
| 864 | 900 | // zig fmt: off |
| 865 | .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .mode, | |
| 866 | => try p.attr_application_buf.append(p.gpa, attr), | |
| 901 | .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .mode, .nullability, .unaligned, | |
| 902 | => try p.attr_application_buf.append(gpa, attr), | |
| 867 | 903 | // zig fmt: on |
| 868 | .transparent_union => try attr.applyTransparentUnion(p, tok, base_ty), | |
| 869 | .vector_size => try attr.applyVectorSize(p, tok, &base_ty), | |
| 870 | .aligned => try attr.applyAligned(p, base_ty, tag), | |
| 871 | .designated_init => if (base_ty.is(.@"struct")) { | |
| 872 | try p.attr_application_buf.append(p.gpa, attr); | |
| 904 | .transparent_union => try attr.applyTransparentUnion(p, tok, base_qt), | |
| 905 | .vector_size => try attr.applyVectorSize(p, tok, &base_qt), | |
| 906 | .aligned => try attr.applyAligned(p, base_qt, diagnostic), | |
| 907 | .designated_init => if (base_qt.is(p.comp, .@"struct")) { | |
| 908 | try p.attr_application_buf.append(gpa, attr); | |
| 873 | 909 | } else { |
| 874 | try p.errTok(.designated_init_invalid, tok); | |
| 910 | try p.err(tok, .designated_init_invalid, .{}); | |
| 875 | 911 | }, |
| 912 | .calling_convention => try applyCallingConvention(attr, p, tok, base_qt), | |
| 876 | 913 | .alloc_size, |
| 877 | 914 | .copy, |
| 878 | 915 | .scalar_storage_order, |
| 879 | 916 | .nonstring, |
| 880 | => |t| try p.errExtra(.attribute_todo, tok, .{ .attribute_todo = .{ .tag = t, .kind = .types } }), | |
| 917 | => |t| try p.err(tok, .attribute_todo, .{ @tagName(t), "types" }), | |
| 881 | 918 | else => try ignoredAttrErr(p, tok, attr.tag, "types"), |
| 882 | 919 | }; |
| 883 | return base_ty.withAttributes(p.arena, p.attr_application_buf.items); | |
| 920 | return applySelected(base_qt, p); | |
| 884 | 921 | } |
| 885 | 922 | |
| 886 | pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Type { | |
| 923 | pub fn applyFunctionAttributes(p: *Parser, qt: QualType, attr_buf_start: usize) !QualType { | |
| 924 | const gpa = p.comp.gpa; | |
| 887 | 925 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 888 | 926 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 889 | 927 | p.attr_application_buf.items.len = 0; |
| 890 | var base_ty = ty; | |
| 928 | var base_qt = qt; | |
| 891 | 929 | var hot = false; |
| 892 | 930 | var cold = false; |
| 893 | 931 | var @"noinline" = false; |
| ... | ... | @@ -897,55 +935,153 @@ pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Typ |
| 897 | 935 | .noreturn, .unused, .used, .warning, .deprecated, .unavailable, .weak, .pure, .leaf, |
| 898 | 936 | .@"const", .warn_unused_result, .section, .returns_nonnull, .returns_twice, .@"error", |
| 899 | 937 | .externally_visible, .retain, .flatten, .gnu_inline, .alias, .asm_label, .nodiscard, |
| 900 | .reproducible, .unsequenced, | |
| 901 | => try p.attr_application_buf.append(p.gpa, attr), | |
| 938 | .reproducible, .unsequenced, .nothrow, .nullability, .unaligned, | |
| 939 | => try p.attr_application_buf.append(gpa, attr), | |
| 902 | 940 | // zig fmt: on |
| 903 | 941 | .hot => if (cold) { |
| 904 | try p.errTok(.ignore_hot, tok); | |
| 942 | try p.err(tok, .ignore_hot, .{}); | |
| 905 | 943 | } else { |
| 906 | try p.attr_application_buf.append(p.gpa, attr); | |
| 944 | try p.attr_application_buf.append(gpa, attr); | |
| 907 | 945 | hot = true; |
| 908 | 946 | }, |
| 909 | 947 | .cold => if (hot) { |
| 910 | try p.errTok(.ignore_cold, tok); | |
| 948 | try p.err(tok, .ignore_cold, .{}); | |
| 911 | 949 | } else { |
| 912 | try p.attr_application_buf.append(p.gpa, attr); | |
| 950 | try p.attr_application_buf.append(gpa, attr); | |
| 913 | 951 | cold = true; |
| 914 | 952 | }, |
| 915 | 953 | .always_inline => if (@"noinline") { |
| 916 | try p.errTok(.ignore_always_inline, tok); | |
| 954 | try p.err(tok, .ignore_always_inline, .{}); | |
| 917 | 955 | } else { |
| 918 | try p.attr_application_buf.append(p.gpa, attr); | |
| 956 | try p.attr_application_buf.append(gpa, attr); | |
| 919 | 957 | always_inline = true; |
| 920 | 958 | }, |
| 921 | 959 | .@"noinline" => if (always_inline) { |
| 922 | try p.errTok(.ignore_noinline, tok); | |
| 960 | try p.err(tok, .ignore_noinline, .{}); | |
| 923 | 961 | } else { |
| 924 | try p.attr_application_buf.append(p.gpa, attr); | |
| 962 | try p.attr_application_buf.append(gpa, attr); | |
| 925 | 963 | @"noinline" = true; |
| 926 | 964 | }, |
| 927 | .aligned => try attr.applyAligned(p, base_ty, null), | |
| 928 | .format => try attr.applyFormat(p, base_ty), | |
| 929 | .calling_convention => switch (attr.args.calling_convention.cc) { | |
| 930 | .C => continue, | |
| 931 | .stdcall, .thiscall => switch (p.comp.target.cpu.arch) { | |
| 932 | .x86 => try p.attr_application_buf.append(p.gpa, attr), | |
| 933 | else => try p.errStr(.callconv_not_supported, tok, p.tok_ids[tok].lexeme().?), | |
| 934 | }, | |
| 935 | .vectorcall => switch (p.comp.target.cpu.arch) { | |
| 936 | .x86, .aarch64, .aarch64_be => try p.attr_application_buf.append(p.gpa, attr), | |
| 937 | else => try p.errStr(.callconv_not_supported, tok, p.tok_ids[tok].lexeme().?), | |
| 938 | }, | |
| 965 | .aligned => try attr.applyAligned(p, base_qt, null), | |
| 966 | .format => try attr.applyFormat(p, base_qt), | |
| 967 | .calling_convention => try applyCallingConvention(attr, p, tok, base_qt), | |
| 968 | .fastcall => if (p.comp.target.cpu.arch == .x86) { | |
| 969 | try p.attr_application_buf.append(gpa, .{ | |
| 970 | .tag = .calling_convention, | |
| 971 | .args = .{ .calling_convention = .{ .cc = .fastcall } }, | |
| 972 | .syntax = attr.syntax, | |
| 973 | }); | |
| 974 | } else { | |
| 975 | try p.err(tok, .callconv_not_supported, .{"fastcall"}); | |
| 976 | }, | |
| 977 | .stdcall => if (p.comp.target.cpu.arch == .x86) { | |
| 978 | try p.attr_application_buf.append(gpa, .{ | |
| 979 | .tag = .calling_convention, | |
| 980 | .args = .{ .calling_convention = .{ .cc = .stdcall } }, | |
| 981 | .syntax = attr.syntax, | |
| 982 | }); | |
| 983 | } else { | |
| 984 | try p.err(tok, .callconv_not_supported, .{"stdcall"}); | |
| 985 | }, | |
| 986 | .thiscall => if (p.comp.target.cpu.arch == .x86) { | |
| 987 | try p.attr_application_buf.append(gpa, .{ | |
| 988 | .tag = .calling_convention, | |
| 989 | .args = .{ .calling_convention = .{ .cc = .thiscall } }, | |
| 990 | .syntax = attr.syntax, | |
| 991 | }); | |
| 992 | } else { | |
| 993 | try p.err(tok, .callconv_not_supported, .{"thiscall"}); | |
| 994 | }, | |
| 995 | .vectorcall => if (p.comp.target.cpu.arch == .x86 or p.comp.target.cpu.arch.isAARCH64()) { | |
| 996 | try p.attr_application_buf.append(gpa, .{ | |
| 997 | .tag = .calling_convention, | |
| 998 | .args = .{ .calling_convention = .{ .cc = .vectorcall } }, | |
| 999 | .syntax = attr.syntax, | |
| 1000 | }); | |
| 1001 | } else { | |
| 1002 | try p.err(tok, .callconv_not_supported, .{"vectorcall"}); | |
| 1003 | }, | |
| 1004 | .cdecl => {}, | |
| 1005 | .pcs => if (p.comp.target.cpu.arch.isArm()) { | |
| 1006 | try p.attr_application_buf.append(gpa, .{ | |
| 1007 | .tag = .calling_convention, | |
| 1008 | .args = .{ .calling_convention = .{ .cc = switch (attr.args.pcs.kind) { | |
| 1009 | .aapcs => .arm_aapcs, | |
| 1010 | .@"aapcs-vfp" => .arm_aapcs_vfp, | |
| 1011 | } } }, | |
| 1012 | .syntax = attr.syntax, | |
| 1013 | }); | |
| 1014 | } else { | |
| 1015 | try p.err(tok, .callconv_not_supported, .{"pcs"}); | |
| 1016 | }, | |
| 1017 | .riscv_vector_cc => if (p.comp.target.cpu.arch.isRISCV()) { | |
| 1018 | try p.attr_application_buf.append(gpa, .{ | |
| 1019 | .tag = .calling_convention, | |
| 1020 | .args = .{ .calling_convention = .{ .cc = .riscv_vector } }, | |
| 1021 | .syntax = attr.syntax, | |
| 1022 | }); | |
| 1023 | } else { | |
| 1024 | try p.err(tok, .callconv_not_supported, .{"pcs"}); | |
| 1025 | }, | |
| 1026 | .aarch64_sve_pcs => if (p.comp.target.cpu.arch.isAARCH64()) { | |
| 1027 | try p.attr_application_buf.append(gpa, .{ | |
| 1028 | .tag = .calling_convention, | |
| 1029 | .args = .{ .calling_convention = .{ .cc = .aarch64_sve_pcs } }, | |
| 1030 | .syntax = attr.syntax, | |
| 1031 | }); | |
| 1032 | } else { | |
| 1033 | try p.err(tok, .callconv_not_supported, .{"pcs"}); | |
| 1034 | }, | |
| 1035 | .aarch64_vector_pcs => if (p.comp.target.cpu.arch.isAARCH64()) { | |
| 1036 | try p.attr_application_buf.append(gpa, .{ | |
| 1037 | .tag = .calling_convention, | |
| 1038 | .args = .{ .calling_convention = .{ .cc = .aarch64_vector_pcs } }, | |
| 1039 | .syntax = attr.syntax, | |
| 1040 | }); | |
| 1041 | } else { | |
| 1042 | try p.err(tok, .callconv_not_supported, .{"pcs"}); | |
| 1043 | }, | |
| 1044 | .sysv_abi => if (p.comp.target.cpu.arch == .x86_64 and p.comp.target.os.tag == .windows) { | |
| 1045 | try p.attr_application_buf.append(gpa, .{ | |
| 1046 | .tag = .calling_convention, | |
| 1047 | .args = .{ .calling_convention = .{ .cc = .x86_64_sysv } }, | |
| 1048 | .syntax = attr.syntax, | |
| 1049 | }); | |
| 1050 | }, | |
| 1051 | .ms_abi => if (p.comp.target.cpu.arch == .x86_64 and p.comp.target.os.tag != .windows) { | |
| 1052 | try p.attr_application_buf.append(gpa, .{ | |
| 1053 | .tag = .calling_convention, | |
| 1054 | .args = .{ .calling_convention = .{ .cc = .x86_64_win } }, | |
| 1055 | .syntax = attr.syntax, | |
| 1056 | }); | |
| 939 | 1057 | }, |
| 940 | 1058 | .malloc => { |
| 941 | if (base_ty.returnType().isPtr()) { | |
| 942 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1059 | if (base_qt.get(p.comp, .func).?.return_type.isPointer(p.comp)) { | |
| 1060 | try p.attr_application_buf.append(gpa, attr); | |
| 943 | 1061 | } else { |
| 944 | 1062 | try ignoredAttrErr(p, tok, attr.tag, "functions that do not return pointers"); |
| 945 | 1063 | } |
| 946 | 1064 | }, |
| 1065 | .alloc_align => { | |
| 1066 | const func_ty = base_qt.get(p.comp, .func).?; | |
| 1067 | if (func_ty.return_type.isPointer(p.comp)) { | |
| 1068 | if (attr.args.alloc_align.position == 0 or attr.args.alloc_align.position > func_ty.params.len) { | |
| 1069 | try p.err(tok, .attribute_param_out_of_bounds, .{ "alloc_align", 1 }); | |
| 1070 | } else { | |
| 1071 | const arg_qt = func_ty.params[attr.args.alloc_align.position - 1].qt; | |
| 1072 | if (arg_qt.isInvalid()) continue; | |
| 1073 | const arg_sk = arg_qt.scalarKind(p.comp); | |
| 1074 | if (!arg_sk.isInt() or !arg_sk.isReal()) { | |
| 1075 | try p.err(tok, .alloc_align_required_int_param, .{}); | |
| 1076 | } else { | |
| 1077 | try p.attr_application_buf.append(gpa, attr); | |
| 1078 | } | |
| 1079 | } | |
| 1080 | } else { | |
| 1081 | try p.err(tok, .alloc_align_requires_ptr_return, .{}); | |
| 1082 | } | |
| 1083 | }, | |
| 947 | 1084 | .access, |
| 948 | .alloc_align, | |
| 949 | 1085 | .alloc_size, |
| 950 | 1086 | .artificial, |
| 951 | 1087 | .assume_aligned, |
| ... | ... | @@ -971,7 +1107,7 @@ pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Typ |
| 971 | 1107 | .no_stack_protector, |
| 972 | 1108 | .noclone, |
| 973 | 1109 | .noipa, |
| 974 | // .nonnull, | |
| 1110 | .nonnull, | |
| 975 | 1111 | .noplt, |
| 976 | 1112 | // .optimize, |
| 977 | 1113 | .patchable_function_entry, |
| ... | ... | @@ -984,137 +1120,183 @@ pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Typ |
| 984 | 1120 | .visibility, |
| 985 | 1121 | .weakref, |
| 986 | 1122 | .zero_call_used_regs, |
| 987 | => |t| try p.errExtra(.attribute_todo, tok, .{ .attribute_todo = .{ .tag = t, .kind = .functions } }), | |
| 1123 | => |t| try p.err(tok, .attribute_todo, .{ @tagName(t), "functions" }), | |
| 988 | 1124 | else => try ignoredAttrErr(p, tok, attr.tag, "functions"), |
| 989 | 1125 | }; |
| 990 | return ty.withAttributes(p.arena, p.attr_application_buf.items); | |
| 1126 | return applySelected(qt, p); | |
| 991 | 1127 | } |
| 992 | 1128 | |
| 993 | pub fn applyLabelAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Type { | |
| 1129 | pub fn applyLabelAttributes(p: *Parser, attr_buf_start: usize) !QualType { | |
| 1130 | const gpa = p.comp.gpa; | |
| 994 | 1131 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 995 | 1132 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 996 | 1133 | p.attr_application_buf.items.len = 0; |
| 997 | 1134 | var hot = false; |
| 998 | 1135 | var cold = false; |
| 999 | 1136 | for (attrs, toks) |attr, tok| switch (attr.tag) { |
| 1000 | .unused => try p.attr_application_buf.append(p.gpa, attr), | |
| 1137 | .unused => try p.attr_application_buf.append(gpa, attr), | |
| 1001 | 1138 | .hot => if (cold) { |
| 1002 | try p.errTok(.ignore_hot, tok); | |
| 1139 | try p.err(tok, .ignore_hot, .{}); | |
| 1003 | 1140 | } else { |
| 1004 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1141 | try p.attr_application_buf.append(gpa, attr); | |
| 1005 | 1142 | hot = true; |
| 1006 | 1143 | }, |
| 1007 | 1144 | .cold => if (hot) { |
| 1008 | try p.errTok(.ignore_cold, tok); | |
| 1145 | try p.err(tok, .ignore_cold, .{}); | |
| 1009 | 1146 | } else { |
| 1010 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1147 | try p.attr_application_buf.append(gpa, attr); | |
| 1011 | 1148 | cold = true; |
| 1012 | 1149 | }, |
| 1013 | 1150 | else => try ignoredAttrErr(p, tok, attr.tag, "labels"), |
| 1014 | 1151 | }; |
| 1015 | return ty.withAttributes(p.arena, p.attr_application_buf.items); | |
| 1152 | return applySelected(.void, p); | |
| 1016 | 1153 | } |
| 1017 | 1154 | |
| 1018 | pub fn applyStatementAttributes(p: *Parser, ty: Type, expr_start: TokenIndex, attr_buf_start: usize) !Type { | |
| 1155 | pub fn applyStatementAttributes(p: *Parser, expr_start: TokenIndex, attr_buf_start: usize) !QualType { | |
| 1019 | 1156 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 1020 | 1157 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 1021 | 1158 | p.attr_application_buf.items.len = 0; |
| 1022 | 1159 | for (attrs, toks) |attr, tok| switch (attr.tag) { |
| 1023 | .fallthrough => if (p.tok_ids[p.tok_i] != .keyword_case and p.tok_ids[p.tok_i] != .keyword_default) { | |
| 1024 | // TODO: this condition is not completely correct; the last statement of a compound | |
| 1025 | // statement is also valid if it precedes a switch label (so intervening '}' are ok, | |
| 1026 | // but only if they close a compound statement) | |
| 1027 | try p.errTok(.invalid_fallthrough, expr_start); | |
| 1028 | } else { | |
| 1029 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1160 | .fallthrough => { | |
| 1161 | for (p.tok_ids[p.tok_i..]) |tok_id| { | |
| 1162 | switch (tok_id) { | |
| 1163 | .keyword_case, .keyword_default, .eof => { | |
| 1164 | try p.attr_application_buf.append(p.comp.gpa, attr); | |
| 1165 | break; | |
| 1166 | }, | |
| 1167 | .r_brace => {}, | |
| 1168 | else => { | |
| 1169 | try p.err(expr_start, .invalid_fallthrough, .{}); | |
| 1170 | break; | |
| 1171 | }, | |
| 1172 | } | |
| 1173 | } | |
| 1030 | 1174 | }, |
| 1031 | else => try p.errStr(.cannot_apply_attribute_to_statement, tok, @tagName(attr.tag)), | |
| 1175 | else => try p.err(tok, .cannot_apply_attribute_to_statement, .{@tagName(attr.tag)}), | |
| 1032 | 1176 | }; |
| 1033 | return ty.withAttributes(p.arena, p.attr_application_buf.items); | |
| 1177 | return applySelected(.void, p); | |
| 1034 | 1178 | } |
| 1035 | 1179 | |
| 1036 | pub fn applyEnumeratorAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Type { | |
| 1180 | pub fn applyEnumeratorAttributes(p: *Parser, qt: QualType, attr_buf_start: usize) !QualType { | |
| 1037 | 1181 | const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; |
| 1038 | 1182 | const toks = p.attr_buf.items(.tok)[attr_buf_start..]; |
| 1039 | 1183 | p.attr_application_buf.items.len = 0; |
| 1040 | 1184 | for (attrs, toks) |attr, tok| switch (attr.tag) { |
| 1041 | .deprecated, .unavailable => try p.attr_application_buf.append(p.gpa, attr), | |
| 1185 | .deprecated, .unavailable => try p.attr_application_buf.append(p.comp.gpa, attr), | |
| 1042 | 1186 | else => try ignoredAttrErr(p, tok, attr.tag, "enums"), |
| 1043 | 1187 | }; |
| 1044 | return ty.withAttributes(p.arena, p.attr_application_buf.items); | |
| 1188 | return applySelected(qt, p); | |
| 1045 | 1189 | } |
| 1046 | 1190 | |
| 1047 | fn applyAligned(attr: Attribute, p: *Parser, ty: Type, tag: ?Diagnostics.Tag) !void { | |
| 1048 | const base = ty.canonicalize(.standard); | |
| 1191 | fn applyAligned(attr: Attribute, p: *Parser, qt: QualType, diagnostic: ?Parser.Diagnostic) !void { | |
| 1049 | 1192 | if (attr.args.aligned.alignment) |alignment| alignas: { |
| 1050 | 1193 | if (attr.syntax != .keyword) break :alignas; |
| 1051 | 1194 | |
| 1052 | 1195 | const align_tok = attr.args.aligned.__name_tok; |
| 1053 | if (tag) |t| try p.errTok(t, align_tok); | |
| 1196 | if (diagnostic) |d| try p.err(align_tok, d, .{}); | |
| 1054 | 1197 | |
| 1055 | const default_align = base.alignof(p.comp); | |
| 1056 | if (ty.isFunc()) { | |
| 1057 | try p.errTok(.alignas_on_func, align_tok); | |
| 1198 | if (qt.isInvalid()) return; | |
| 1199 | const default_align = qt.base(p.comp).qt.alignof(p.comp); | |
| 1200 | if (qt.is(p.comp, .func)) { | |
| 1201 | try p.err(align_tok, .alignas_on_func, .{}); | |
| 1058 | 1202 | } else if (alignment.requested < default_align) { |
| 1059 | try p.errExtra(.minimum_alignment, align_tok, .{ .unsigned = default_align }); | |
| 1203 | try p.err(align_tok, .minimum_alignment, .{default_align}); | |
| 1060 | 1204 | } |
| 1061 | 1205 | } |
| 1062 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1206 | try p.attr_application_buf.append(p.comp.gpa, attr); | |
| 1063 | 1207 | } |
| 1064 | 1208 | |
| 1065 | fn applyTransparentUnion(attr: Attribute, p: *Parser, tok: TokenIndex, ty: Type) !void { | |
| 1066 | const union_ty = ty.get(.@"union") orelse { | |
| 1067 | return p.errTok(.transparent_union_wrong_type, tok); | |
| 1209 | fn applyTransparentUnion(attr: Attribute, p: *Parser, tok: TokenIndex, qt: QualType) !void { | |
| 1210 | const union_ty = qt.get(p.comp, .@"union") orelse { | |
| 1211 | return p.err(tok, .transparent_union_wrong_type, .{}); | |
| 1068 | 1212 | }; |
| 1069 | 1213 | // TODO validate union defined at end |
| 1070 | if (union_ty.data.record.isIncomplete()) return; | |
| 1071 | const fields = union_ty.data.record.fields; | |
| 1072 | if (fields.len == 0) { | |
| 1073 | return p.errTok(.transparent_union_one_field, tok); | |
| 1214 | if (union_ty.layout == null) return; | |
| 1215 | if (union_ty.fields.len == 0) { | |
| 1216 | return p.err(tok, .transparent_union_one_field, .{}); | |
| 1074 | 1217 | } |
| 1075 | const first_field_size = fields[0].ty.bitSizeof(p.comp).?; | |
| 1076 | for (fields[1..]) |field| { | |
| 1077 | const field_size = field.ty.bitSizeof(p.comp).?; | |
| 1218 | const first_field_size = union_ty.fields[0].qt.bitSizeof(p.comp); | |
| 1219 | for (union_ty.fields[1..]) |field| { | |
| 1220 | const field_size = field.qt.bitSizeof(p.comp); | |
| 1078 | 1221 | if (field_size == first_field_size) continue; |
| 1079 | const mapper = p.comp.string_interner.getSlowTypeMapper(); | |
| 1080 | const str = try std.fmt.allocPrint( | |
| 1081 | p.comp.diagnostics.arena.allocator(), | |
| 1082 | "'{s}' ({d}", | |
| 1083 | .{ mapper.lookup(field.name), field_size }, | |
| 1084 | ); | |
| 1085 | try p.errStr(.transparent_union_size, field.name_tok, str); | |
| 1086 | return p.errExtra(.transparent_union_size_note, fields[0].name_tok, .{ .unsigned = first_field_size }); | |
| 1222 | ||
| 1223 | try p.err(field.name_tok, .transparent_union_size, .{ field.name.lookup(p.comp), field_size }); | |
| 1224 | return p.err(union_ty.fields[0].name_tok, .transparent_union_size_note, .{first_field_size}); | |
| 1087 | 1225 | } |
| 1088 | 1226 | |
| 1089 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1227 | try p.attr_application_buf.append(p.comp.gpa, attr); | |
| 1090 | 1228 | } |
| 1091 | 1229 | |
| 1092 | fn applyVectorSize(attr: Attribute, p: *Parser, tok: TokenIndex, ty: *Type) !void { | |
| 1093 | const base = ty.base(); | |
| 1094 | const is_enum = ty.is(.@"enum"); | |
| 1095 | if (!(ty.isInt() or ty.isFloat()) or !ty.isReal() or (is_enum and p.comp.langopts.emulate == .gcc)) { | |
| 1096 | try p.errStr(.invalid_vec_elem_ty, tok, try p.typeStr(ty.*)); | |
| 1230 | fn applyVectorSize(attr: Attribute, p: *Parser, tok: TokenIndex, qt: *QualType) !void { | |
| 1231 | if (qt.isInvalid()) return; | |
| 1232 | const scalar_kind = qt.scalarKind(p.comp); | |
| 1233 | if (scalar_kind != .int and scalar_kind != .float) { | |
| 1234 | if (qt.get(p.comp, .@"enum")) |enum_ty| { | |
| 1235 | if (p.comp.langopts.emulate == .clang and enum_ty.incomplete) { | |
| 1236 | return; // Clang silently ignores vector_size on incomplete enums. | |
| 1237 | } | |
| 1238 | } | |
| 1239 | try p.err(tok, .invalid_vec_elem_ty, .{qt.*}); | |
| 1097 | 1240 | return error.ParsingFailed; |
| 1098 | 1241 | } |
| 1099 | if (is_enum) return; | |
| 1242 | if (qt.get(p.comp, .bit_int)) |bit_int| { | |
| 1243 | if (bit_int.bits < 8) { | |
| 1244 | try p.err(tok, .bit_int_vec_too_small, .{}); | |
| 1245 | return error.ParsingFailed; | |
| 1246 | } else if (!std.math.isPowerOfTwo(bit_int.bits)) { | |
| 1247 | try p.err(tok, .bit_int_vec_not_pow2, .{}); | |
| 1248 | return error.ParsingFailed; | |
| 1249 | } | |
| 1250 | } | |
| 1100 | 1251 | |
| 1101 | 1252 | const vec_bytes = attr.args.vector_size.bytes; |
| 1102 | const ty_size = ty.sizeof(p.comp).?; | |
| 1103 | if (vec_bytes % ty_size != 0) { | |
| 1104 | return p.errTok(.vec_size_not_multiple, tok); | |
| 1253 | const elem_size = qt.sizeof(p.comp); | |
| 1254 | if (vec_bytes % elem_size != 0) { | |
| 1255 | return p.err(tok, .vec_size_not_multiple, .{}); | |
| 1105 | 1256 | } |
| 1106 | const vec_size = vec_bytes / ty_size; | |
| 1107 | 1257 | |
| 1108 | const arr_ty = try p.arena.create(Type.Array); | |
| 1109 | arr_ty.* = .{ .elem = ty.*, .len = vec_size }; | |
| 1110 | base.* = .{ | |
| 1111 | .specifier = .vector, | |
| 1112 | .data = .{ .array = arr_ty }, | |
| 1113 | }; | |
| 1258 | qt.* = try p.comp.type_store.put(p.comp.gpa, .{ .vector = .{ | |
| 1259 | .elem = qt.*, | |
| 1260 | .len = @intCast(vec_bytes / elem_size), | |
| 1261 | } }); | |
| 1114 | 1262 | } |
| 1115 | 1263 | |
| 1116 | fn applyFormat(attr: Attribute, p: *Parser, ty: Type) !void { | |
| 1264 | fn applyFormat(attr: Attribute, p: *Parser, qt: QualType) !void { | |
| 1117 | 1265 | // TODO validate |
| 1118 | _ = ty; | |
| 1119 | try p.attr_application_buf.append(p.gpa, attr); | |
| 1266 | _ = qt; | |
| 1267 | try p.attr_application_buf.append(p.comp.gpa, attr); | |
| 1268 | } | |
| 1269 | ||
| 1270 | fn applyCallingConvention(attr: Attribute, p: *Parser, tok: TokenIndex, qt: QualType) !void { | |
| 1271 | if (!qt.is(p.comp, .func)) { | |
| 1272 | return p.err(tok, .callconv_non_func, .{ p.tok_ids[tok].symbol(), qt }); | |
| 1273 | } | |
| 1274 | switch (attr.args.calling_convention.cc) { | |
| 1275 | .c => {}, | |
| 1276 | .stdcall, .thiscall, .fastcall, .regcall => switch (p.comp.target.cpu.arch) { | |
| 1277 | .x86 => try p.attr_application_buf.append(p.comp.gpa, attr), | |
| 1278 | else => try p.err(tok, .callconv_not_supported, .{p.tok_ids[tok].symbol()}), | |
| 1279 | }, | |
| 1280 | .vectorcall => switch (p.comp.target.cpu.arch) { | |
| 1281 | .x86, .aarch64, .aarch64_be => try p.attr_application_buf.append(p.comp.gpa, attr), | |
| 1282 | else => try p.err(tok, .callconv_not_supported, .{p.tok_ids[tok].symbol()}), | |
| 1283 | }, | |
| 1284 | .riscv_vector, | |
| 1285 | .aarch64_sve_pcs, | |
| 1286 | .aarch64_vector_pcs, | |
| 1287 | .arm_aapcs, | |
| 1288 | .arm_aapcs_vfp, | |
| 1289 | .x86_64_sysv, | |
| 1290 | .x86_64_win, | |
| 1291 | => unreachable, // These can't come from keyword syntax | |
| 1292 | } | |
| 1293 | } | |
| 1294 | ||
| 1295 | fn applySelected(qt: QualType, p: *Parser) !QualType { | |
| 1296 | if (p.attr_application_buf.items.len == 0) return qt; | |
| 1297 | if (qt.isInvalid()) return qt; | |
| 1298 | return (try p.comp.type_store.put(p.comp.gpa, .{ .attributed = .{ | |
| 1299 | .base = qt, | |
| 1300 | .attributes = p.attr_application_buf.items, | |
| 1301 | } })).withQualifiers(qt); | |
| 1120 | 1302 | } |
lib/compiler/aro/aro/Attribute/names.zig+891-807| ... | ... | @@ -11,7 +11,123 @@ properties: Properties, |
| 11 | 11 | |
| 12 | 12 | /// Integer starting at 0 derived from the unique index, |
| 13 | 13 | /// corresponds with the data array index. |
| 14 | pub const Tag = enum(u16) { _ }; | |
| 14 | pub const Tag = enum(u16) { aarch64_sve_pcs, | |
| 15 | aarch64_vector_pcs, | |
| 16 | access, | |
| 17 | alias, | |
| 18 | @"align", | |
| 19 | aligned, | |
| 20 | alloc_align, | |
| 21 | alloc_size, | |
| 22 | allocate, | |
| 23 | allocator, | |
| 24 | always_inline, | |
| 25 | appdomain, | |
| 26 | artificial, | |
| 27 | assume_aligned, | |
| 28 | cdecl, | |
| 29 | cleanup, | |
| 30 | code_seg, | |
| 31 | cold, | |
| 32 | common, | |
| 33 | @"const", | |
| 34 | constructor, | |
| 35 | copy, | |
| 36 | deprecated, | |
| 37 | designated_init, | |
| 38 | destructor, | |
| 39 | dllexport, | |
| 40 | dllimport, | |
| 41 | @"error", | |
| 42 | externally_visible, | |
| 43 | fallthrough, | |
| 44 | fastcall, | |
| 45 | flatten, | |
| 46 | format, | |
| 47 | format_arg, | |
| 48 | gnu_inline, | |
| 49 | hot, | |
| 50 | ifunc, | |
| 51 | interrupt, | |
| 52 | interrupt_handler, | |
| 53 | jitintrinsic, | |
| 54 | leaf, | |
| 55 | malloc, | |
| 56 | may_alias, | |
| 57 | maybe_unused, | |
| 58 | mode, | |
| 59 | ms_abi, | |
| 60 | naked, | |
| 61 | no_address_safety_analysis, | |
| 62 | no_icf, | |
| 63 | no_instrument_function, | |
| 64 | no_profile_instrument_function, | |
| 65 | no_reorder, | |
| 66 | no_sanitize, | |
| 67 | no_sanitize_address, | |
| 68 | no_sanitize_coverage, | |
| 69 | no_sanitize_thread, | |
| 70 | no_sanitize_undefined, | |
| 71 | no_split_stack, | |
| 72 | no_stack_limit, | |
| 73 | no_stack_protector, | |
| 74 | @"noalias", | |
| 75 | noclone, | |
| 76 | nocommon, | |
| 77 | nodiscard, | |
| 78 | noinit, | |
| 79 | @"noinline", | |
| 80 | noipa, | |
| 81 | nonnull, | |
| 82 | nonstring, | |
| 83 | noplt, | |
| 84 | @"noreturn", | |
| 85 | nothrow, | |
| 86 | @"packed", | |
| 87 | patchable_function_entry, | |
| 88 | pcs, | |
| 89 | persistent, | |
| 90 | process, | |
| 91 | pure, | |
| 92 | reproducible, | |
| 93 | restrict, | |
| 94 | retain, | |
| 95 | returns_nonnull, | |
| 96 | returns_twice, | |
| 97 | riscv_vector_cc, | |
| 98 | safebuffers, | |
| 99 | scalar_storage_order, | |
| 100 | section, | |
| 101 | selectany, | |
| 102 | sentinel, | |
| 103 | simd, | |
| 104 | spectre, | |
| 105 | stack_protect, | |
| 106 | stdcall, | |
| 107 | symver, | |
| 108 | sysv_abi, | |
| 109 | target, | |
| 110 | target_clones, | |
| 111 | thiscall, | |
| 112 | thread, | |
| 113 | tls_model, | |
| 114 | transparent_union, | |
| 115 | unavailable, | |
| 116 | uninitialized, | |
| 117 | unsequenced, | |
| 118 | unused, | |
| 119 | used, | |
| 120 | uuid, | |
| 121 | vector_size, | |
| 122 | vectorcall, | |
| 123 | visibility, | |
| 124 | warn_if_not_aligned, | |
| 125 | warn_unused_result, | |
| 126 | warning, | |
| 127 | weak, | |
| 128 | weakref, | |
| 129 | zero_call_used_regs, | |
| 130 | }; | |
| 15 | 131 | |
| 16 | 132 | const Self = @This(); |
| 17 | 133 | |
| ... | ... | @@ -69,7 +185,7 @@ pub const longest_name = 30; |
| 69 | 185 | /// If found, returns the index of the node within the `dafsa` array. |
| 70 | 186 | /// Otherwise, returns `null`. |
| 71 | 187 | pub fn findInList(first_child_index: u16, char: u8) ?u16 { |
| 72 | @setEvalBranchQuota(206); | |
| 188 | @setEvalBranchQuota(232); | |
| 73 | 189 | var index = first_child_index; |
| 74 | 190 | while (true) { |
| 75 | 191 | if (dafsa[index].char == char) return index; |
| ... | ... | @@ -117,7 +233,7 @@ pub fn nameFromUniqueIndex(index: u16, buf: []u8) []u8 { |
| 117 | 233 | |
| 118 | 234 | var node_index: u16 = 0; |
| 119 | 235 | var count: u16 = index; |
| 120 | var w: std.Io.Writer = .fixed(buf); | |
| 236 | var w = std.Io.Writer.fixed(buf); | |
| 121 | 237 | |
| 122 | 238 | while (true) { |
| 123 | 239 | var sibling_index = dafsa[node_index].child_index; |
| ... | ... | @@ -164,837 +280,805 @@ const Node = packed struct(u32) { |
| 164 | 280 | |
| 165 | 281 | const dafsa = [_]Node{ |
| 166 | 282 | .{ .char = 0, .end_of_word = false, .end_of_list = true, .number = 0, .child_index = 1 }, |
| 167 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 21 }, | |
| 168 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 26 }, | |
| 169 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 28 }, | |
| 170 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 30 }, | |
| 171 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 32 }, | |
| 172 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 35 }, | |
| 173 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 36 }, | |
| 174 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 37 }, | |
| 175 | .{ .char = 'j', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 39 }, | |
| 176 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 40 }, | |
| 177 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 41 }, | |
| 178 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 43 }, | |
| 179 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 45 }, | |
| 180 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 49 }, | |
| 181 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 50 }, | |
| 182 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 57 }, | |
| 183 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 61 }, | |
| 184 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 64 }, | |
| 185 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 66 }, | |
| 186 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 68 }, | |
| 187 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 69 }, | |
| 188 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 70 }, | |
| 189 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 73 }, | |
| 190 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 74 }, | |
| 191 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 75 }, | |
| 192 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 76 }, | |
| 193 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 77 }, | |
| 194 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 82 }, | |
| 195 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 84 }, | |
| 196 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 85 }, | |
| 197 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 86 }, | |
| 198 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 87 }, | |
| 199 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 88 }, | |
| 200 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 89 }, | |
| 201 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 90 }, | |
| 202 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, | |
| 203 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 92 }, | |
| 204 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 93 }, | |
| 205 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 94 }, | |
| 206 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 95 }, | |
| 207 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 96 }, | |
| 208 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 98 }, | |
| 209 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 99 }, | |
| 210 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 23, .child_index = 100 }, | |
| 211 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 108 }, | |
| 212 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 110 }, | |
| 213 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 111 }, | |
| 214 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 112 }, | |
| 215 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 113 }, | |
| 216 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 116 }, | |
| 217 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 117 }, | |
| 218 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 118 }, | |
| 219 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 121 }, | |
| 220 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 122 }, | |
| 221 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 123 }, | |
| 222 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 124 }, | |
| 223 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 125 }, | |
| 224 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 126 }, | |
| 225 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 127 }, | |
| 226 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 128 }, | |
| 227 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 129 }, | |
| 228 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 133 }, | |
| 229 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 134 }, | |
| 230 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 135 }, | |
| 231 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 136 }, | |
| 232 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 137 }, | |
| 233 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 138 }, | |
| 234 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 139 }, | |
| 235 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 140 }, | |
| 236 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 141 }, | |
| 237 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 143 }, | |
| 238 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 144 }, | |
| 239 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 145 }, | |
| 240 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 146 }, | |
| 241 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 147 }, | |
| 242 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 243 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 149 }, | |
| 244 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 150 }, | |
| 245 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 151 }, | |
| 246 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 152 }, | |
| 247 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, | |
| 248 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 154 }, | |
| 249 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 155 }, | |
| 250 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 157 }, | |
| 251 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 159 }, | |
| 252 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 160 }, | |
| 253 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 161 }, | |
| 254 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 162 }, | |
| 255 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 163 }, | |
| 256 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 164 }, | |
| 283 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 21 }, | |
| 284 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 27 }, | |
| 285 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 30 }, | |
| 286 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 32 }, | |
| 287 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 34 }, | |
| 288 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 37 }, | |
| 289 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 38 }, | |
| 290 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 39 }, | |
| 291 | .{ .char = 'j', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 41 }, | |
| 292 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 42 }, | |
| 293 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 43 }, | |
| 294 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 46 }, | |
| 295 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 48 }, | |
| 296 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 53 }, | |
| 297 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 55 }, | |
| 298 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 62 }, | |
| 299 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 66 }, | |
| 300 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 69 }, | |
| 301 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 71 }, | |
| 302 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 73 }, | |
| 303 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 74 }, | |
| 304 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 75 }, | |
| 305 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 76 }, | |
| 306 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 79 }, | |
| 307 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 80 }, | |
| 308 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 81 }, | |
| 309 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 82 }, | |
| 310 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 83 }, | |
| 311 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 84 }, | |
| 312 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 89 }, | |
| 313 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 91 }, | |
| 314 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 92 }, | |
| 315 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 93 }, | |
| 316 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 94 }, | |
| 317 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 96 }, | |
| 318 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 97 }, | |
| 319 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 98 }, | |
| 320 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, | |
| 321 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 100 }, | |
| 322 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 101 }, | |
| 323 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 102 }, | |
| 324 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 103 }, | |
| 325 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 104 }, | |
| 326 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 106 }, | |
| 327 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 107 }, | |
| 328 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 108 }, | |
| 329 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 109 }, | |
| 330 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 118 }, | |
| 331 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 120 }, | |
| 332 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 121 }, | |
| 333 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 122 }, | |
| 334 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 123 }, | |
| 335 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 124 }, | |
| 336 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 127 }, | |
| 337 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 128 }, | |
| 338 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 129 }, | |
| 339 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 130 }, | |
| 340 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 133 }, | |
| 341 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 134 }, | |
| 342 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 135 }, | |
| 343 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 137 }, | |
| 344 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 139 }, | |
| 345 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 140 }, | |
| 346 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 142 }, | |
| 347 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 143 }, | |
| 348 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 144 }, | |
| 349 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 148 }, | |
| 350 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 149 }, | |
| 351 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 150 }, | |
| 352 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 151 }, | |
| 353 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 152 }, | |
| 354 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 153 }, | |
| 355 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 154 }, | |
| 356 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 155 }, | |
| 357 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 156 }, | |
| 358 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 157 }, | |
| 359 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 159 }, | |
| 360 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 160 }, | |
| 361 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 161 }, | |
| 362 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 162 }, | |
| 363 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 163 }, | |
| 364 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 164 }, | |
| 365 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 165 }, | |
| 366 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 166 }, | |
| 367 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 167 }, | |
| 368 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 168 }, | |
| 369 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 169 }, | |
| 370 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, | |
| 371 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 171 }, | |
| 372 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 172 }, | |
| 373 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 174 }, | |
| 374 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 176 }, | |
| 375 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 177 }, | |
| 376 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 178 }, | |
| 377 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 179 }, | |
| 378 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 180 }, | |
| 379 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 181 }, | |
| 380 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 182 }, | |
| 257 | 381 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 258 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 165 }, | |
| 259 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 166 }, | |
| 260 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 261 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 168 }, | |
| 262 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 169 }, | |
| 263 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 170 }, | |
| 264 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 265 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, | |
| 266 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 173 }, | |
| 267 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 178 }, | |
| 268 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 179 }, | |
| 269 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 181 }, | |
| 270 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 182 }, | |
| 271 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 184 }, | |
| 272 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 185 }, | |
| 273 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 186 }, | |
| 274 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 99 }, | |
| 275 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 187 }, | |
| 276 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 188 }, | |
| 277 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 69 }, | |
| 278 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 279 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 189 }, | |
| 280 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 190 }, | |
| 281 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 191 }, | |
| 282 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 193 }, | |
| 283 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 194 }, | |
| 284 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 195 }, | |
| 285 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 196 }, | |
| 286 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 197 }, | |
| 287 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, | |
| 288 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 198 }, | |
| 289 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 199 }, | |
| 290 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 200 }, | |
| 291 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 201 }, | |
| 292 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 202 }, | |
| 293 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 203 }, | |
| 294 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 204 }, | |
| 295 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 205 }, | |
| 296 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 206 }, | |
| 297 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 207 }, | |
| 298 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 208 }, | |
| 299 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, | |
| 300 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, | |
| 301 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 209 }, | |
| 302 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 210 }, | |
| 303 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 211 }, | |
| 304 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 212 }, | |
| 305 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 213 }, | |
| 306 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 214 }, | |
| 307 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 215 }, | |
| 308 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 216 }, | |
| 309 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 217 }, | |
| 310 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 218 }, | |
| 311 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 219 }, | |
| 312 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 220 }, | |
| 313 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 221 }, | |
| 314 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, | |
| 315 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 223 }, | |
| 382 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 183 }, | |
| 383 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 184 }, | |
| 384 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 185 }, | |
| 385 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 186 }, | |
| 386 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 187 }, | |
| 387 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 188 }, | |
| 388 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 389 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 191 }, | |
| 390 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 391 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 192 }, | |
| 392 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 197 }, | |
| 393 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 198 }, | |
| 394 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 200 }, | |
| 395 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 201 }, | |
| 396 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 203 }, | |
| 397 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 205 }, | |
| 398 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 206 }, | |
| 399 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 207 }, | |
| 400 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 108 }, | |
| 401 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 208 }, | |
| 402 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 403 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 209 }, | |
| 404 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 75 }, | |
| 405 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 406 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 210 }, | |
| 407 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 211 }, | |
| 408 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 212 }, | |
| 409 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 214 }, | |
| 410 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 411 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 216 }, | |
| 412 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 217 }, | |
| 413 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 218 }, | |
| 414 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 219 }, | |
| 415 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 416 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 220 }, | |
| 417 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 221 }, | |
| 418 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, | |
| 419 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 223 }, | |
| 420 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 224 }, | |
| 421 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 225 }, | |
| 422 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 226 }, | |
| 423 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 227 }, | |
| 424 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 228 }, | |
| 425 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 229 }, | |
| 426 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 230 }, | |
| 427 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 231 }, | |
| 428 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 232 }, | |
| 429 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 233 }, | |
| 430 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 431 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 432 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 234 }, | |
| 433 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 235 }, | |
| 434 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 236 }, | |
| 435 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 237 }, | |
| 436 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 238 }, | |
| 437 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 239 }, | |
| 438 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 240 }, | |
| 439 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 120 }, | |
| 440 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 241 }, | |
| 441 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 242 }, | |
| 442 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 243 }, | |
| 443 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 244 }, | |
| 444 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 245 }, | |
| 445 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 246 }, | |
| 446 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, | |
| 447 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 248 }, | |
| 448 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 249 }, | |
| 316 | 449 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 317 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 224 }, | |
| 318 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 225 }, | |
| 450 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 250 }, | |
| 451 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 251 }, | |
| 319 | 452 | .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 320 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 226 }, | |
| 321 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 227 }, | |
| 322 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 228 }, | |
| 323 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 229 }, | |
| 324 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 230 }, | |
| 325 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 231 }, | |
| 326 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 232 }, | |
| 327 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 233 }, | |
| 328 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 234 }, | |
| 329 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 235 }, | |
| 330 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 236 }, | |
| 331 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 237 }, | |
| 332 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 238 }, | |
| 333 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 239 }, | |
| 453 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 252 }, | |
| 454 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 253 }, | |
| 455 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 254 }, | |
| 456 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 255 }, | |
| 457 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 256 }, | |
| 458 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, | |
| 459 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 258 }, | |
| 460 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 259 }, | |
| 461 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, | |
| 462 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 260 }, | |
| 463 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 261 }, | |
| 464 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 262 }, | |
| 465 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, | |
| 466 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 264 }, | |
| 467 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 265 }, | |
| 334 | 468 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 335 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 240 }, | |
| 336 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 241 }, | |
| 337 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 242 }, | |
| 469 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 266 }, | |
| 470 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 267 }, | |
| 471 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 268 }, | |
| 338 | 472 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 339 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 243 }, | |
| 340 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 244 }, | |
| 341 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 246 }, | |
| 342 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 247 }, | |
| 343 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 248 }, | |
| 344 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 251 }, | |
| 345 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 252 }, | |
| 346 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 253 }, | |
| 347 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 254 }, | |
| 348 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 255 }, | |
| 349 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, | |
| 350 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 258 }, | |
| 351 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, | |
| 352 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 259 }, | |
| 353 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 260 }, | |
| 354 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 261 }, | |
| 355 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 262 }, | |
| 356 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, | |
| 357 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 264 }, | |
| 358 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 265 }, | |
| 359 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 266 }, | |
| 360 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 267 }, | |
| 361 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 268 }, | |
| 362 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 269 }, | |
| 363 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 270 }, | |
| 364 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 271 }, | |
| 365 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 272 }, | |
| 366 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 273 }, | |
| 367 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 274 }, | |
| 368 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 275 }, | |
| 369 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 276 }, | |
| 370 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 277 }, | |
| 371 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 278 }, | |
| 372 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 279 }, | |
| 373 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 280 }, | |
| 374 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, | |
| 375 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 281 }, | |
| 376 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 282 }, | |
| 377 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 283 }, | |
| 378 | .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 285 }, | |
| 379 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 286 }, | |
| 380 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 381 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 382 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 287 }, | |
| 383 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 288 }, | |
| 384 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 290 }, | |
| 385 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, | |
| 386 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 292 }, | |
| 387 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 293 }, | |
| 388 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 294 }, | |
| 389 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 295 }, | |
| 390 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, | |
| 391 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 297 }, | |
| 392 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 298 }, | |
| 393 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 299 }, | |
| 394 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 300 }, | |
| 395 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 301 }, | |
| 396 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 301 }, | |
| 473 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 269 }, | |
| 474 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 270 }, | |
| 475 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 271 }, | |
| 476 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 273 }, | |
| 477 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 274 }, | |
| 478 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 275 }, | |
| 479 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 278 }, | |
| 480 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 279 }, | |
| 481 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 280 }, | |
| 482 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 281 }, | |
| 483 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 282 }, | |
| 484 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 284 }, | |
| 485 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 285 }, | |
| 486 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 286 }, | |
| 487 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, | |
| 488 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 287 }, | |
| 489 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 288 }, | |
| 490 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 289 }, | |
| 491 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 290 }, | |
| 492 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, | |
| 493 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 292 }, | |
| 494 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 293 }, | |
| 495 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 294 }, | |
| 496 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 295 }, | |
| 497 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, | |
| 498 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 297 }, | |
| 499 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 298 }, | |
| 500 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 299 }, | |
| 501 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 300 }, | |
| 502 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 301 }, | |
| 503 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 302 }, | |
| 504 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 303 }, | |
| 505 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, | |
| 506 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 107 }, | |
| 507 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 305 }, | |
| 508 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, | |
| 509 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 306 }, | |
| 510 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 307 }, | |
| 511 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 308 }, | |
| 512 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 309 }, | |
| 513 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 310 }, | |
| 514 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, | |
| 515 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 516 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 312 }, | |
| 517 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 313 }, | |
| 518 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 314 }, | |
| 519 | .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 316 }, | |
| 520 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 317 }, | |
| 521 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 318 }, | |
| 522 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 523 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 319 }, | |
| 524 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 320 }, | |
| 525 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 322 }, | |
| 526 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, | |
| 527 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 324 }, | |
| 528 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 325 }, | |
| 529 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 530 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 326 }, | |
| 531 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 327 }, | |
| 532 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, | |
| 533 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 329 }, | |
| 534 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 330 }, | |
| 535 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 331 }, | |
| 536 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, | |
| 537 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 333 }, | |
| 538 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 333 }, | |
| 397 | 539 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 398 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 302 }, | |
| 399 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 303 }, | |
| 400 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, | |
| 401 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 305 }, | |
| 402 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 306 }, | |
| 540 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 334 }, | |
| 541 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 335 }, | |
| 542 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 336 }, | |
| 543 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 337 }, | |
| 544 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 338 }, | |
| 403 | 545 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 404 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 307 }, | |
| 405 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 308 }, | |
| 406 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 237 }, | |
| 407 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 178 }, | |
| 408 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 309 }, | |
| 409 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 310 }, | |
| 410 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 168 }, | |
| 411 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, | |
| 412 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 312 }, | |
| 413 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 313 }, | |
| 414 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 314 }, | |
| 415 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 315 }, | |
| 416 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 316 }, | |
| 417 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 317 }, | |
| 418 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 318 }, | |
| 419 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 151 }, | |
| 420 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 319 }, | |
| 421 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 91 }, | |
| 422 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 320 }, | |
| 423 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 424 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 321 }, | |
| 425 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 322 }, | |
| 426 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, | |
| 427 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 324 }, | |
| 428 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 325 }, | |
| 429 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 326 }, | |
| 430 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, | |
| 431 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 327 }, | |
| 432 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, | |
| 433 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 329 }, | |
| 434 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 224 }, | |
| 435 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 330 }, | |
| 436 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 331 }, | |
| 437 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 112 }, | |
| 438 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, | |
| 439 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 231 }, | |
| 440 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 333 }, | |
| 441 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, | |
| 442 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 334 }, | |
| 443 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 335 }, | |
| 444 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 336 }, | |
| 445 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 337 }, | |
| 446 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 338 }, | |
| 447 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 339 }, | |
| 448 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 340 }, | |
| 449 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 341 }, | |
| 450 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 343 }, | |
| 451 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, | |
| 452 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 345 }, | |
| 453 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, | |
| 454 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 346 }, | |
| 455 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 348 }, | |
| 456 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 164 }, | |
| 457 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 349 }, | |
| 546 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 339 }, | |
| 547 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 340 }, | |
| 548 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, | |
| 549 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 197 }, | |
| 550 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 341 }, | |
| 551 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 342 }, | |
| 552 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 343 }, | |
| 553 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 186 }, | |
| 554 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, | |
| 555 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 345 }, | |
| 556 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 346 }, | |
| 557 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 347 }, | |
| 558 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 348 }, | |
| 559 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 349 }, | |
| 458 | 560 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 350 }, |
| 459 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, | |
| 460 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 352 }, | |
| 461 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 353 }, | |
| 462 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 463 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 300 }, | |
| 464 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 354 }, | |
| 465 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 355 }, | |
| 466 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 356 }, | |
| 467 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 357 }, | |
| 468 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 358 }, | |
| 469 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 359 }, | |
| 470 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, | |
| 471 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 360 }, | |
| 472 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 361 }, | |
| 561 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, | |
| 562 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 168 }, | |
| 563 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 352 }, | |
| 564 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 99 }, | |
| 565 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 353 }, | |
| 566 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 567 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 354 }, | |
| 568 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 355 }, | |
| 569 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 356 }, | |
| 570 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 357 }, | |
| 571 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 358 }, | |
| 572 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 359 }, | |
| 573 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 360 }, | |
| 574 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 361 }, | |
| 575 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, | |
| 473 | 576 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 362 }, |
| 474 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 363 }, | |
| 475 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 364 }, | |
| 476 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 365 }, | |
| 477 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 366 }, | |
| 478 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 367 }, | |
| 479 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 368 }, | |
| 480 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 369 }, | |
| 481 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 370 }, | |
| 482 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 371 }, | |
| 483 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 484 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 485 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 372 }, | |
| 486 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 318 }, | |
| 487 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 373 }, | |
| 488 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 374 }, | |
| 489 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 375 }, | |
| 490 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 376 }, | |
| 491 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 377 }, | |
| 492 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 378 }, | |
| 493 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 379 }, | |
| 494 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 380 }, | |
| 495 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 381 }, | |
| 496 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 382 }, | |
| 497 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 383 }, | |
| 498 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 384 }, | |
| 499 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 385 }, | |
| 500 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 386 }, | |
| 501 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 387 }, | |
| 502 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 388 }, | |
| 503 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 389 }, | |
| 504 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 390 }, | |
| 505 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 391 }, | |
| 506 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 392 }, | |
| 507 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 393 }, | |
| 508 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 394 }, | |
| 577 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 363 }, | |
| 578 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 364 }, | |
| 579 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 365 }, | |
| 580 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 250 }, | |
| 581 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 366 }, | |
| 582 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 367 }, | |
| 583 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 123 }, | |
| 584 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 368 }, | |
| 585 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 354 }, | |
| 586 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, | |
| 587 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 369 }, | |
| 588 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 589 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 370 }, | |
| 590 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 371 }, | |
| 591 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 372 }, | |
| 592 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 373 }, | |
| 593 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 374 }, | |
| 594 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 375 }, | |
| 595 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 376 }, | |
| 596 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 377 }, | |
| 597 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 379 }, | |
| 598 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 380 }, | |
| 599 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 381 }, | |
| 600 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 382 }, | |
| 601 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 602 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 383 }, | |
| 603 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 385 }, | |
| 604 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 182 }, | |
| 605 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 386 }, | |
| 606 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 387 }, | |
| 607 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 388 }, | |
| 608 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 389 }, | |
| 609 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 390 }, | |
| 610 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 611 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, | |
| 612 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 391 }, | |
| 613 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 392 }, | |
| 614 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 393 }, | |
| 615 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 394 }, | |
| 509 | 616 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 395 }, |
| 510 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 168 }, | |
| 511 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 396 }, | |
| 512 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 397 }, | |
| 513 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 398 }, | |
| 514 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 399 }, | |
| 515 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 264 }, | |
| 516 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 401 }, | |
| 517 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 402 }, | |
| 617 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 396 }, | |
| 618 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, | |
| 619 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 397 }, | |
| 620 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 398 }, | |
| 621 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 399 }, | |
| 622 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 400 }, | |
| 623 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 401 }, | |
| 624 | .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 625 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 402 }, | |
| 626 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 403 }, | |
| 627 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 404 }, | |
| 628 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 405 }, | |
| 629 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 406 }, | |
| 630 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 407 }, | |
| 631 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 408 }, | |
| 632 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 633 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 634 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 409 }, | |
| 635 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, | |
| 636 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, | |
| 637 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 410 }, | |
| 638 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 411 }, | |
| 639 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, | |
| 640 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 413 }, | |
| 641 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 414 }, | |
| 642 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 415 }, | |
| 643 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 416 }, | |
| 644 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 417 }, | |
| 645 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 418 }, | |
| 646 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 419 }, | |
| 647 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 420 }, | |
| 648 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 421 }, | |
| 649 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 422 }, | |
| 650 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 423 }, | |
| 651 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 424 }, | |
| 652 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 425 }, | |
| 653 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 426 }, | |
| 654 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 427 }, | |
| 655 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, | |
| 656 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 429 }, | |
| 657 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 430 }, | |
| 658 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 432 }, | |
| 659 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 433 }, | |
| 660 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 434 }, | |
| 661 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, | |
| 662 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 186 }, | |
| 663 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 436 }, | |
| 664 | .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 437 }, | |
| 665 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 438 }, | |
| 666 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 439 }, | |
| 667 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 440 }, | |
| 668 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 293 }, | |
| 669 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 442 }, | |
| 670 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 443 }, | |
| 518 | 671 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 519 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 395 }, | |
| 520 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 403 }, | |
| 521 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 404 }, | |
| 522 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 405 }, | |
| 523 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 406 }, | |
| 524 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 407 }, | |
| 525 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 408 }, | |
| 526 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 409 }, | |
| 527 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 320 }, | |
| 528 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 410 }, | |
| 529 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 411 }, | |
| 530 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, | |
| 531 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 413 }, | |
| 532 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 414 }, | |
| 533 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 415 }, | |
| 534 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 416 }, | |
| 535 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 417 }, | |
| 536 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 418 }, | |
| 537 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 419 }, | |
| 538 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 420 }, | |
| 539 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 343 }, | |
| 540 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, | |
| 541 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 421 }, | |
| 542 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 422 }, | |
| 543 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 423 }, | |
| 544 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, | |
| 545 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 424 }, | |
| 546 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 425 }, | |
| 547 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 426 }, | |
| 548 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 427 }, | |
| 549 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, | |
| 550 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 429 }, | |
| 551 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 430 }, | |
| 552 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 383 }, | |
| 553 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 431 }, | |
| 554 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 432 }, | |
| 555 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 433 }, | |
| 556 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 434 }, | |
| 557 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, | |
| 558 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 436 }, | |
| 559 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 437 }, | |
| 560 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 438 }, | |
| 561 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 562 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 439 }, | |
| 563 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 440 }, | |
| 564 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 441 }, | |
| 565 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, | |
| 566 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 231 }, | |
| 567 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 442 }, | |
| 568 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 443 }, | |
| 569 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, | |
| 570 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 444 }, | |
| 571 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 159 }, | |
| 572 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, | |
| 573 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 445 }, | |
| 574 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 446 }, | |
| 575 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 447 }, | |
| 576 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 448 }, | |
| 577 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 449 }, | |
| 578 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, | |
| 579 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, | |
| 672 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, | |
| 673 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 444 }, | |
| 674 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 445 }, | |
| 675 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 446 }, | |
| 676 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 447 }, | |
| 677 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 448 }, | |
| 678 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 449 }, | |
| 679 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, | |
| 680 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 353 }, | |
| 681 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 451 }, | |
| 580 | 682 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 452 }, |
| 581 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 453 }, | |
| 582 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 273 }, | |
| 583 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 454 }, | |
| 683 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 453 }, | |
| 684 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 454 }, | |
| 584 | 685 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 455 }, |
| 585 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 456 }, | |
| 586 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, | |
| 587 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, | |
| 588 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, | |
| 589 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, | |
| 590 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 460 }, | |
| 591 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 462 }, | |
| 592 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, | |
| 593 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, | |
| 594 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 595 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 464 }, | |
| 596 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 465 }, | |
| 597 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 466 }, | |
| 598 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 467 }, | |
| 599 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 468 }, | |
| 600 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 469 }, | |
| 601 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 398 }, | |
| 602 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 470 }, | |
| 686 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 456 }, | |
| 687 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, | |
| 688 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 458 }, | |
| 689 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, | |
| 690 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 460 }, | |
| 691 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 461 }, | |
| 692 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 379 }, | |
| 693 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, | |
| 694 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 695 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 462 }, | |
| 696 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, | |
| 697 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 464 }, | |
| 698 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, | |
| 699 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 465 }, | |
| 700 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 466 }, | |
| 701 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 467 }, | |
| 702 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 468 }, | |
| 703 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 469 }, | |
| 704 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, | |
| 705 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 470 }, | |
| 603 | 706 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 471 }, |
| 604 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 472 }, | |
| 707 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 422 }, | |
| 708 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 472 }, | |
| 605 | 709 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 473 }, |
| 606 | 710 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 474 }, |
| 607 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 608 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, | |
| 609 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 475 }, | |
| 610 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 476 }, | |
| 711 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 475 }, | |
| 712 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 476 }, | |
| 713 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 303 }, | |
| 611 | 714 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 477 }, |
| 612 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 478 }, | |
| 613 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 395 }, | |
| 614 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 479 }, | |
| 615 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 480 }, | |
| 616 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 208 }, | |
| 617 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 481 }, | |
| 618 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 482 }, | |
| 715 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 478 }, | |
| 716 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 479 }, | |
| 717 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 718 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 480 }, | |
| 719 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 481 }, | |
| 619 | 720 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 483 }, |
| 620 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 484 }, | |
| 621 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 485 }, | |
| 622 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 486 }, | |
| 623 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 488 }, | |
| 624 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, | |
| 625 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 467 }, | |
| 626 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 489 }, | |
| 627 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 490 }, | |
| 628 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 491 }, | |
| 629 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 492 }, | |
| 630 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 493 }, | |
| 631 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 494 }, | |
| 632 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 495 }, | |
| 633 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, | |
| 634 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 497 }, | |
| 635 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, | |
| 636 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, | |
| 637 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 498 }, | |
| 638 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 499 }, | |
| 721 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 484 }, | |
| 722 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, | |
| 723 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, | |
| 724 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 485 }, | |
| 725 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 486 }, | |
| 726 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 727 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 487 }, | |
| 728 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 176 }, | |
| 729 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, | |
| 730 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 488 }, | |
| 731 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 489 }, | |
| 732 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 490 }, | |
| 733 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 491 }, | |
| 734 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 492 }, | |
| 735 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 493 }, | |
| 736 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 494 }, | |
| 737 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 495 }, | |
| 738 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, | |
| 739 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, | |
| 740 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 497 }, | |
| 741 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 498 }, | |
| 742 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 499 }, | |
| 743 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, | |
| 639 | 744 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 500 }, |
| 640 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, | |
| 641 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 501 }, | |
| 642 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 502 }, | |
| 643 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 503 }, | |
| 644 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 504 }, | |
| 645 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 505 }, | |
| 646 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 506 }, | |
| 745 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 501 }, | |
| 746 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 502 }, | |
| 747 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 503 }, | |
| 748 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 505 }, | |
| 749 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 506 }, | |
| 647 | 750 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 507 }, |
| 648 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 508 }, | |
| 649 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 509 }, | |
| 650 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 510 }, | |
| 651 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 511 }, | |
| 652 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 512 }, | |
| 653 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 513 }, | |
| 654 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 514 }, | |
| 655 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 515 }, | |
| 656 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 516 }, | |
| 657 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 658 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 517 }, | |
| 659 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 518 }, | |
| 660 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, | |
| 661 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 520 }, | |
| 662 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 663 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, | |
| 664 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 522 }, | |
| 665 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 523 }, | |
| 666 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 524 }, | |
| 667 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 525 }, | |
| 668 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 526 }, | |
| 669 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 527 }, | |
| 670 | .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 671 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 528 }, | |
| 672 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 237 }, | |
| 673 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 529 }, | |
| 674 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 530 }, | |
| 751 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, | |
| 752 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 508 }, | |
| 753 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 509 }, | |
| 754 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 510 }, | |
| 755 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 511 }, | |
| 756 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 512 }, | |
| 757 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 513 }, | |
| 758 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 439 }, | |
| 759 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 514 }, | |
| 760 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 515 }, | |
| 761 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 516 }, | |
| 762 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 517 }, | |
| 763 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 518 }, | |
| 764 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, | |
| 765 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 520 }, | |
| 766 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 767 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, | |
| 768 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, | |
| 769 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 522 }, | |
| 770 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 523 }, | |
| 771 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 524 }, | |
| 772 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, | |
| 773 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 525 }, | |
| 774 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 526 }, | |
| 775 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 233 }, | |
| 776 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 527 }, | |
| 777 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 528 }, | |
| 778 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 529 }, | |
| 779 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 530 }, | |
| 675 | 780 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 531 }, |
| 676 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 532 }, | |
| 677 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 533 }, | |
| 678 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 534 }, | |
| 679 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 535 }, | |
| 680 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 536 }, | |
| 681 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 537 }, | |
| 682 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 538 }, | |
| 683 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 539 }, | |
| 684 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 378 }, | |
| 685 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 540 }, | |
| 686 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 541 }, | |
| 687 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, | |
| 688 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, | |
| 689 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 542 }, | |
| 690 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 543 }, | |
| 691 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, | |
| 692 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 544 }, | |
| 693 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 545 }, | |
| 694 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 546 }, | |
| 695 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 547 }, | |
| 696 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 548 }, | |
| 697 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 549 }, | |
| 698 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 550 }, | |
| 699 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 554 }, | |
| 700 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 555 }, | |
| 701 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 556 }, | |
| 702 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 557 }, | |
| 703 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 558 }, | |
| 704 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 705 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 559 }, | |
| 706 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 707 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 560 }, | |
| 708 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 561 }, | |
| 709 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 562 }, | |
| 710 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 555 }, | |
| 711 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 563 }, | |
| 712 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 564 }, | |
| 713 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 565 }, | |
| 781 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 532 }, | |
| 782 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 534 }, | |
| 783 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, | |
| 784 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 511 }, | |
| 785 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 535 }, | |
| 786 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 536 }, | |
| 787 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 537 }, | |
| 788 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 538 }, | |
| 789 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 539 }, | |
| 790 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 540 }, | |
| 791 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 541 }, | |
| 792 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 542 }, | |
| 793 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 543 }, | |
| 794 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 544 }, | |
| 795 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 796 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, | |
| 797 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 545 }, | |
| 798 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 546 }, | |
| 799 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 547 }, | |
| 800 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 548 }, | |
| 801 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 549 }, | |
| 802 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, | |
| 803 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 550 }, | |
| 804 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 551 }, | |
| 805 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 552 }, | |
| 806 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 553 }, | |
| 807 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 554 }, | |
| 808 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 555 }, | |
| 809 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 556 }, | |
| 810 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 557 }, | |
| 811 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 558 }, | |
| 812 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 559 }, | |
| 813 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 560 }, | |
| 814 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 561 }, | |
| 815 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 562 }, | |
| 816 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 563 }, | |
| 817 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 564 }, | |
| 818 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 565 }, | |
| 714 | 819 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 566 }, |
| 715 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, | |
| 716 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 567 }, | |
| 717 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 568 }, | |
| 718 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, | |
| 719 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 570 }, | |
| 720 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 571 }, | |
| 721 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, | |
| 722 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, | |
| 723 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 573 }, | |
| 724 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 574 }, | |
| 725 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 575 }, | |
| 726 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 576 }, | |
| 727 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 577 }, | |
| 728 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 578 }, | |
| 729 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, | |
| 730 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, | |
| 731 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, | |
| 820 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 821 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 567 }, | |
| 822 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, | |
| 823 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, | |
| 824 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 570 }, | |
| 825 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 826 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 571 }, | |
| 827 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, | |
| 828 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 573 }, | |
| 829 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 574 }, | |
| 830 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 575 }, | |
| 831 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 576 }, | |
| 832 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 577 }, | |
| 833 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 578 }, | |
| 834 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, | |
| 835 | .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 836 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, | |
| 837 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, | |
| 732 | 838 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 581 }, |
| 733 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 582 }, | |
| 734 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 583 }, | |
| 735 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 126 }, | |
| 736 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 584 }, | |
| 737 | .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 738 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 356 }, | |
| 739 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, | |
| 740 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, | |
| 741 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 586 }, | |
| 742 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 268 }, | |
| 743 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 587 }, | |
| 744 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 588 }, | |
| 745 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 273 }, | |
| 746 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 589 }, | |
| 747 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 590 }, | |
| 748 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 591 }, | |
| 749 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 592 }, | |
| 750 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 593 }, | |
| 839 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 582 }, | |
| 840 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 583 }, | |
| 841 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 584 }, | |
| 842 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, | |
| 843 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 586 }, | |
| 844 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 587 }, | |
| 845 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 588 }, | |
| 846 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 589 }, | |
| 847 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 590 }, | |
| 848 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 591 }, | |
| 849 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 592 }, | |
| 850 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 416 }, | |
| 851 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 593 }, | |
| 751 | 852 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 594 }, |
| 752 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 313 }, | |
| 753 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 595 }, | |
| 754 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 596 }, | |
| 755 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 597 }, | |
| 756 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 598 }, | |
| 757 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 140 }, | |
| 758 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 599 }, | |
| 759 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 600 }, | |
| 760 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 601 }, | |
| 761 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 185 }, | |
| 762 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 602 }, | |
| 763 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 603 }, | |
| 764 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 604 }, | |
| 765 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 605 }, | |
| 766 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 606 }, | |
| 767 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 607 }, | |
| 768 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 608 }, | |
| 769 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 609 }, | |
| 770 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 195 }, | |
| 771 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 610 }, | |
| 772 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 525 }, | |
| 773 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 611 }, | |
| 774 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 775 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 612 }, | |
| 776 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, | |
| 777 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 613 }, | |
| 778 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 614 }, | |
| 779 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 615 }, | |
| 780 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 616 }, | |
| 781 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 617 }, | |
| 782 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 618 }, | |
| 783 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 619 }, | |
| 784 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 620 }, | |
| 785 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, | |
| 786 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 621 }, | |
| 787 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, | |
| 853 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 854 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 388 }, | |
| 855 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 595 }, | |
| 856 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 596 }, | |
| 857 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 597 }, | |
| 858 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 598 }, | |
| 859 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, | |
| 860 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 599 }, | |
| 861 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 600 }, | |
| 862 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 601 }, | |
| 863 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 602 }, | |
| 864 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 603 }, | |
| 865 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 604 }, | |
| 866 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 605 }, | |
| 867 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 609 }, | |
| 868 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 610 }, | |
| 869 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 611 }, | |
| 870 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 612 }, | |
| 871 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 285 }, | |
| 872 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 873 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 613 }, | |
| 874 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 614 }, | |
| 875 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 876 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 615 }, | |
| 877 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 616 }, | |
| 878 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 617 }, | |
| 879 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 618 }, | |
| 880 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 619 }, | |
| 881 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 610 }, | |
| 882 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 620 }, | |
| 883 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 621 }, | |
| 884 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 622 }, | |
| 885 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 623 }, | |
| 886 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, | |
| 887 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 624 }, | |
| 888 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 625 }, | |
| 889 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 626 }, | |
| 890 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 627 }, | |
| 891 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 628 }, | |
| 892 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, | |
| 893 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 629 }, | |
| 894 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 630 }, | |
| 895 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 631 }, | |
| 896 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 632 }, | |
| 897 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 633 }, | |
| 898 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 634 }, | |
| 899 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 635 }, | |
| 900 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 901 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 575 }, | |
| 902 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 502 }, | |
| 903 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 636 }, | |
| 904 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 637 }, | |
| 905 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 638 }, | |
| 906 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 639 }, | |
| 907 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 640 }, | |
| 908 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 641 }, | |
| 909 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 642 }, | |
| 910 | .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, | |
| 911 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 393 }, | |
| 912 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 643 }, | |
| 913 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, | |
| 914 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 644 }, | |
| 915 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 298 }, | |
| 916 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 645 }, | |
| 917 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 646 }, | |
| 918 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, | |
| 919 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 647 }, | |
| 920 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 648 }, | |
| 921 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, | |
| 922 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 650 }, | |
| 923 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 227 }, | |
| 924 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 651 }, | |
| 925 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 652 }, | |
| 926 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 346 }, | |
| 927 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 653 }, | |
| 928 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, | |
| 929 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, | |
| 930 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 656 }, | |
| 931 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 156 }, | |
| 932 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 657 }, | |
| 933 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 658 }, | |
| 934 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 659 }, | |
| 935 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 205 }, | |
| 936 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 660 }, | |
| 937 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 661 }, | |
| 938 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 662 }, | |
| 939 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 663 }, | |
| 940 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, | |
| 941 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 665 }, | |
| 942 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 666 }, | |
| 943 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 667 }, | |
| 944 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 217 }, | |
| 945 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 668 }, | |
| 946 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 577 }, | |
| 947 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 669 }, | |
| 948 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 949 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 670 }, | |
| 950 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, | |
| 951 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 671 }, | |
| 952 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 672 }, | |
| 953 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 673 }, | |
| 954 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 674 }, | |
| 955 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 675 }, | |
| 956 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 676 }, | |
| 957 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 677 }, | |
| 958 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 678 }, | |
| 959 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, | |
| 960 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 679 }, | |
| 961 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, | |
| 788 | 962 | }; |
| 789 | 963 | pub const data = blk: { |
| 790 | @setEvalBranchQuota(721); | |
| 964 | @setEvalBranchQuota(812); | |
| 791 | 965 | break :blk [_]@This(){ |
| 792 | // access | |
| 793 | .{ .tag = @enumFromInt(0), .properties = .{ .tag = .access, .gnu = true } }, | |
| 794 | // alias | |
| 795 | .{ .tag = @enumFromInt(1), .properties = .{ .tag = .alias, .gnu = true } }, | |
| 796 | // align | |
| 797 | .{ .tag = @enumFromInt(2), .properties = .{ .tag = .aligned, .declspec = true } }, | |
| 798 | // aligned | |
| 799 | .{ .tag = @enumFromInt(3), .properties = .{ .tag = .aligned, .gnu = true } }, | |
| 800 | // alloc_align | |
| 801 | .{ .tag = @enumFromInt(4), .properties = .{ .tag = .alloc_align, .gnu = true } }, | |
| 802 | // alloc_size | |
| 803 | .{ .tag = @enumFromInt(5), .properties = .{ .tag = .alloc_size, .gnu = true } }, | |
| 804 | // allocate | |
| 805 | .{ .tag = @enumFromInt(6), .properties = .{ .tag = .allocate, .declspec = true } }, | |
| 806 | // allocator | |
| 807 | .{ .tag = @enumFromInt(7), .properties = .{ .tag = .allocator, .declspec = true } }, | |
| 808 | // always_inline | |
| 809 | .{ .tag = @enumFromInt(8), .properties = .{ .tag = .always_inline, .gnu = true } }, | |
| 810 | // appdomain | |
| 811 | .{ .tag = @enumFromInt(9), .properties = .{ .tag = .appdomain, .declspec = true } }, | |
| 812 | // artificial | |
| 813 | .{ .tag = @enumFromInt(10), .properties = .{ .tag = .artificial, .gnu = true } }, | |
| 814 | // assume_aligned | |
| 815 | .{ .tag = @enumFromInt(11), .properties = .{ .tag = .assume_aligned, .gnu = true } }, | |
| 816 | // cleanup | |
| 817 | .{ .tag = @enumFromInt(12), .properties = .{ .tag = .cleanup, .gnu = true } }, | |
| 818 | // code_seg | |
| 819 | .{ .tag = @enumFromInt(13), .properties = .{ .tag = .code_seg, .declspec = true } }, | |
| 820 | // cold | |
| 821 | .{ .tag = @enumFromInt(14), .properties = .{ .tag = .cold, .gnu = true } }, | |
| 822 | // common | |
| 823 | .{ .tag = @enumFromInt(15), .properties = .{ .tag = .common, .gnu = true } }, | |
| 824 | // const | |
| 825 | .{ .tag = @enumFromInt(16), .properties = .{ .tag = .@"const", .gnu = true } }, | |
| 826 | // constructor | |
| 827 | .{ .tag = @enumFromInt(17), .properties = .{ .tag = .constructor, .gnu = true } }, | |
| 828 | // copy | |
| 829 | .{ .tag = @enumFromInt(18), .properties = .{ .tag = .copy, .gnu = true } }, | |
| 830 | // deprecated | |
| 831 | .{ .tag = @enumFromInt(19), .properties = .{ .tag = .deprecated, .c23 = true, .gnu = true, .declspec = true } }, | |
| 832 | // designated_init | |
| 833 | .{ .tag = @enumFromInt(20), .properties = .{ .tag = .designated_init, .gnu = true } }, | |
| 834 | // destructor | |
| 835 | .{ .tag = @enumFromInt(21), .properties = .{ .tag = .destructor, .gnu = true } }, | |
| 836 | // dllexport | |
| 837 | .{ .tag = @enumFromInt(22), .properties = .{ .tag = .dllexport, .declspec = true } }, | |
| 838 | // dllimport | |
| 839 | .{ .tag = @enumFromInt(23), .properties = .{ .tag = .dllimport, .declspec = true } }, | |
| 840 | // error | |
| 841 | .{ .tag = @enumFromInt(24), .properties = .{ .tag = .@"error", .gnu = true } }, | |
| 842 | // externally_visible | |
| 843 | .{ .tag = @enumFromInt(25), .properties = .{ .tag = .externally_visible, .gnu = true } }, | |
| 844 | // fallthrough | |
| 845 | .{ .tag = @enumFromInt(26), .properties = .{ .tag = .fallthrough, .c23 = true, .gnu = true } }, | |
| 846 | // flatten | |
| 847 | .{ .tag = @enumFromInt(27), .properties = .{ .tag = .flatten, .gnu = true } }, | |
| 848 | // format | |
| 849 | .{ .tag = @enumFromInt(28), .properties = .{ .tag = .format, .gnu = true } }, | |
| 850 | // format_arg | |
| 851 | .{ .tag = @enumFromInt(29), .properties = .{ .tag = .format_arg, .gnu = true } }, | |
| 852 | // gnu_inline | |
| 853 | .{ .tag = @enumFromInt(30), .properties = .{ .tag = .gnu_inline, .gnu = true } }, | |
| 854 | // hot | |
| 855 | .{ .tag = @enumFromInt(31), .properties = .{ .tag = .hot, .gnu = true } }, | |
| 856 | // ifunc | |
| 857 | .{ .tag = @enumFromInt(32), .properties = .{ .tag = .ifunc, .gnu = true } }, | |
| 858 | // interrupt | |
| 859 | .{ .tag = @enumFromInt(33), .properties = .{ .tag = .interrupt, .gnu = true } }, | |
| 860 | // interrupt_handler | |
| 861 | .{ .tag = @enumFromInt(34), .properties = .{ .tag = .interrupt_handler, .gnu = true } }, | |
| 862 | // jitintrinsic | |
| 863 | .{ .tag = @enumFromInt(35), .properties = .{ .tag = .jitintrinsic, .declspec = true } }, | |
| 864 | // leaf | |
| 865 | .{ .tag = @enumFromInt(36), .properties = .{ .tag = .leaf, .gnu = true } }, | |
| 866 | // malloc | |
| 867 | .{ .tag = @enumFromInt(37), .properties = .{ .tag = .malloc, .gnu = true } }, | |
| 868 | // may_alias | |
| 869 | .{ .tag = @enumFromInt(38), .properties = .{ .tag = .may_alias, .gnu = true } }, | |
| 870 | // maybe_unused | |
| 871 | .{ .tag = @enumFromInt(39), .properties = .{ .tag = .unused, .c23 = true } }, | |
| 872 | // mode | |
| 873 | .{ .tag = @enumFromInt(40), .properties = .{ .tag = .mode, .gnu = true } }, | |
| 874 | // naked | |
| 875 | .{ .tag = @enumFromInt(41), .properties = .{ .tag = .naked, .declspec = true } }, | |
| 876 | // no_address_safety_analysis | |
| 877 | .{ .tag = @enumFromInt(42), .properties = .{ .tag = .no_address_safety_analysis, .gnu = true } }, | |
| 878 | // no_icf | |
| 879 | .{ .tag = @enumFromInt(43), .properties = .{ .tag = .no_icf, .gnu = true } }, | |
| 880 | // no_instrument_function | |
| 881 | .{ .tag = @enumFromInt(44), .properties = .{ .tag = .no_instrument_function, .gnu = true } }, | |
| 882 | // no_profile_instrument_function | |
| 883 | .{ .tag = @enumFromInt(45), .properties = .{ .tag = .no_profile_instrument_function, .gnu = true } }, | |
| 884 | // no_reorder | |
| 885 | .{ .tag = @enumFromInt(46), .properties = .{ .tag = .no_reorder, .gnu = true } }, | |
| 886 | // no_sanitize | |
| 887 | .{ .tag = @enumFromInt(47), .properties = .{ .tag = .no_sanitize, .gnu = true } }, | |
| 888 | // no_sanitize_address | |
| 889 | .{ .tag = @enumFromInt(48), .properties = .{ .tag = .no_sanitize_address, .gnu = true, .declspec = true } }, | |
| 890 | // no_sanitize_coverage | |
| 891 | .{ .tag = @enumFromInt(49), .properties = .{ .tag = .no_sanitize_coverage, .gnu = true } }, | |
| 892 | // no_sanitize_thread | |
| 893 | .{ .tag = @enumFromInt(50), .properties = .{ .tag = .no_sanitize_thread, .gnu = true } }, | |
| 894 | // no_sanitize_undefined | |
| 895 | .{ .tag = @enumFromInt(51), .properties = .{ .tag = .no_sanitize_undefined, .gnu = true } }, | |
| 896 | // no_split_stack | |
| 897 | .{ .tag = @enumFromInt(52), .properties = .{ .tag = .no_split_stack, .gnu = true } }, | |
| 898 | // no_stack_limit | |
| 899 | .{ .tag = @enumFromInt(53), .properties = .{ .tag = .no_stack_limit, .gnu = true } }, | |
| 900 | // no_stack_protector | |
| 901 | .{ .tag = @enumFromInt(54), .properties = .{ .tag = .no_stack_protector, .gnu = true } }, | |
| 902 | // noalias | |
| 903 | .{ .tag = @enumFromInt(55), .properties = .{ .tag = .@"noalias", .declspec = true } }, | |
| 904 | // noclone | |
| 905 | .{ .tag = @enumFromInt(56), .properties = .{ .tag = .noclone, .gnu = true } }, | |
| 906 | // nocommon | |
| 907 | .{ .tag = @enumFromInt(57), .properties = .{ .tag = .nocommon, .gnu = true } }, | |
| 908 | // nodiscard | |
| 909 | .{ .tag = @enumFromInt(58), .properties = .{ .tag = .nodiscard, .c23 = true } }, | |
| 910 | // noinit | |
| 911 | .{ .tag = @enumFromInt(59), .properties = .{ .tag = .noinit, .gnu = true } }, | |
| 912 | // noinline | |
| 913 | .{ .tag = @enumFromInt(60), .properties = .{ .tag = .@"noinline", .gnu = true, .declspec = true } }, | |
| 914 | // noipa | |
| 915 | .{ .tag = @enumFromInt(61), .properties = .{ .tag = .noipa, .gnu = true } }, | |
| 916 | // nonstring | |
| 917 | .{ .tag = @enumFromInt(62), .properties = .{ .tag = .nonstring, .gnu = true } }, | |
| 918 | // noplt | |
| 919 | .{ .tag = @enumFromInt(63), .properties = .{ .tag = .noplt, .gnu = true } }, | |
| 920 | // noreturn | |
| 921 | .{ .tag = @enumFromInt(64), .properties = .{ .tag = .@"noreturn", .c23 = true, .gnu = true, .declspec = true } }, | |
| 922 | // packed | |
| 923 | .{ .tag = @enumFromInt(65), .properties = .{ .tag = .@"packed", .gnu = true } }, | |
| 924 | // patchable_function_entry | |
| 925 | .{ .tag = @enumFromInt(66), .properties = .{ .tag = .patchable_function_entry, .gnu = true } }, | |
| 926 | // persistent | |
| 927 | .{ .tag = @enumFromInt(67), .properties = .{ .tag = .persistent, .gnu = true } }, | |
| 928 | // process | |
| 929 | .{ .tag = @enumFromInt(68), .properties = .{ .tag = .process, .declspec = true } }, | |
| 930 | // pure | |
| 931 | .{ .tag = @enumFromInt(69), .properties = .{ .tag = .pure, .gnu = true } }, | |
| 932 | // reproducible | |
| 933 | .{ .tag = @enumFromInt(70), .properties = .{ .tag = .reproducible, .c23 = true } }, | |
| 934 | // restrict | |
| 935 | .{ .tag = @enumFromInt(71), .properties = .{ .tag = .restrict, .declspec = true } }, | |
| 936 | // retain | |
| 937 | .{ .tag = @enumFromInt(72), .properties = .{ .tag = .retain, .gnu = true } }, | |
| 938 | // returns_nonnull | |
| 939 | .{ .tag = @enumFromInt(73), .properties = .{ .tag = .returns_nonnull, .gnu = true } }, | |
| 940 | // returns_twice | |
| 941 | .{ .tag = @enumFromInt(74), .properties = .{ .tag = .returns_twice, .gnu = true } }, | |
| 942 | // safebuffers | |
| 943 | .{ .tag = @enumFromInt(75), .properties = .{ .tag = .safebuffers, .declspec = true } }, | |
| 944 | // scalar_storage_order | |
| 945 | .{ .tag = @enumFromInt(76), .properties = .{ .tag = .scalar_storage_order, .gnu = true } }, | |
| 946 | // section | |
| 947 | .{ .tag = @enumFromInt(77), .properties = .{ .tag = .section, .gnu = true } }, | |
| 948 | // selectany | |
| 949 | .{ .tag = @enumFromInt(78), .properties = .{ .tag = .selectany, .declspec = true } }, | |
| 950 | // sentinel | |
| 951 | .{ .tag = @enumFromInt(79), .properties = .{ .tag = .sentinel, .gnu = true } }, | |
| 952 | // simd | |
| 953 | .{ .tag = @enumFromInt(80), .properties = .{ .tag = .simd, .gnu = true } }, | |
| 954 | // spectre | |
| 955 | .{ .tag = @enumFromInt(81), .properties = .{ .tag = .spectre, .declspec = true } }, | |
| 956 | // stack_protect | |
| 957 | .{ .tag = @enumFromInt(82), .properties = .{ .tag = .stack_protect, .gnu = true } }, | |
| 958 | // symver | |
| 959 | .{ .tag = @enumFromInt(83), .properties = .{ .tag = .symver, .gnu = true } }, | |
| 960 | // target | |
| 961 | .{ .tag = @enumFromInt(84), .properties = .{ .tag = .target, .gnu = true } }, | |
| 962 | // target_clones | |
| 963 | .{ .tag = @enumFromInt(85), .properties = .{ .tag = .target_clones, .gnu = true } }, | |
| 964 | // thread | |
| 965 | .{ .tag = @enumFromInt(86), .properties = .{ .tag = .thread, .declspec = true } }, | |
| 966 | // tls_model | |
| 967 | .{ .tag = @enumFromInt(87), .properties = .{ .tag = .tls_model, .gnu = true } }, | |
| 968 | // transparent_union | |
| 969 | .{ .tag = @enumFromInt(88), .properties = .{ .tag = .transparent_union, .gnu = true } }, | |
| 970 | // unavailable | |
| 971 | .{ .tag = @enumFromInt(89), .properties = .{ .tag = .unavailable, .gnu = true } }, | |
| 972 | // uninitialized | |
| 973 | .{ .tag = @enumFromInt(90), .properties = .{ .tag = .uninitialized, .gnu = true } }, | |
| 974 | // unsequenced | |
| 975 | .{ .tag = @enumFromInt(91), .properties = .{ .tag = .unsequenced, .c23 = true } }, | |
| 976 | // unused | |
| 977 | .{ .tag = @enumFromInt(92), .properties = .{ .tag = .unused, .gnu = true } }, | |
| 978 | // used | |
| 979 | .{ .tag = @enumFromInt(93), .properties = .{ .tag = .used, .gnu = true } }, | |
| 980 | // uuid | |
| 981 | .{ .tag = @enumFromInt(94), .properties = .{ .tag = .uuid, .declspec = true } }, | |
| 982 | // vector_size | |
| 983 | .{ .tag = @enumFromInt(95), .properties = .{ .tag = .vector_size, .gnu = true } }, | |
| 984 | // visibility | |
| 985 | .{ .tag = @enumFromInt(96), .properties = .{ .tag = .visibility, .gnu = true } }, | |
| 986 | // warn_if_not_aligned | |
| 987 | .{ .tag = @enumFromInt(97), .properties = .{ .tag = .warn_if_not_aligned, .gnu = true } }, | |
| 988 | // warn_unused_result | |
| 989 | .{ .tag = @enumFromInt(98), .properties = .{ .tag = .warn_unused_result, .gnu = true } }, | |
| 990 | // warning | |
| 991 | .{ .tag = @enumFromInt(99), .properties = .{ .tag = .warning, .gnu = true } }, | |
| 992 | // weak | |
| 993 | .{ .tag = @enumFromInt(100), .properties = .{ .tag = .weak, .gnu = true } }, | |
| 994 | // weakref | |
| 995 | .{ .tag = @enumFromInt(101), .properties = .{ .tag = .weakref, .gnu = true } }, | |
| 996 | // zero_call_used_regs | |
| 997 | .{ .tag = @enumFromInt(102), .properties = .{ .tag = .zero_call_used_regs, .gnu = true } }, | |
| 966 | .{ .tag = .aarch64_sve_pcs, .properties = .{ .tag = .aarch64_sve_pcs, .gnu = true } }, | |
| 967 | .{ .tag = .aarch64_vector_pcs, .properties = .{ .tag = .aarch64_vector_pcs, .gnu = true } }, | |
| 968 | .{ .tag = .access, .properties = .{ .tag = .access, .gnu = true } }, | |
| 969 | .{ .tag = .alias, .properties = .{ .tag = .alias, .gnu = true } }, | |
| 970 | .{ .tag = .@"align", .properties = .{ .tag = .aligned, .declspec = true } }, | |
| 971 | .{ .tag = .aligned, .properties = .{ .tag = .aligned, .gnu = true } }, | |
| 972 | .{ .tag = .alloc_align, .properties = .{ .tag = .alloc_align, .gnu = true } }, | |
| 973 | .{ .tag = .alloc_size, .properties = .{ .tag = .alloc_size, .gnu = true } }, | |
| 974 | .{ .tag = .allocate, .properties = .{ .tag = .allocate, .declspec = true } }, | |
| 975 | .{ .tag = .allocator, .properties = .{ .tag = .allocator, .declspec = true } }, | |
| 976 | .{ .tag = .always_inline, .properties = .{ .tag = .always_inline, .gnu = true } }, | |
| 977 | .{ .tag = .appdomain, .properties = .{ .tag = .appdomain, .declspec = true } }, | |
| 978 | .{ .tag = .artificial, .properties = .{ .tag = .artificial, .gnu = true } }, | |
| 979 | .{ .tag = .assume_aligned, .properties = .{ .tag = .assume_aligned, .gnu = true } }, | |
| 980 | .{ .tag = .cdecl, .properties = .{ .tag = .cdecl, .gnu = true } }, | |
| 981 | .{ .tag = .cleanup, .properties = .{ .tag = .cleanup, .gnu = true } }, | |
| 982 | .{ .tag = .code_seg, .properties = .{ .tag = .code_seg, .declspec = true } }, | |
| 983 | .{ .tag = .cold, .properties = .{ .tag = .cold, .gnu = true } }, | |
| 984 | .{ .tag = .common, .properties = .{ .tag = .common, .gnu = true } }, | |
| 985 | .{ .tag = .@"const", .properties = .{ .tag = .@"const", .gnu = true } }, | |
| 986 | .{ .tag = .constructor, .properties = .{ .tag = .constructor, .gnu = true } }, | |
| 987 | .{ .tag = .copy, .properties = .{ .tag = .copy, .gnu = true } }, | |
| 988 | .{ .tag = .deprecated, .properties = .{ .tag = .deprecated, .c23 = true, .gnu = true, .declspec = true } }, | |
| 989 | .{ .tag = .designated_init, .properties = .{ .tag = .designated_init, .gnu = true } }, | |
| 990 | .{ .tag = .destructor, .properties = .{ .tag = .destructor, .gnu = true } }, | |
| 991 | .{ .tag = .dllexport, .properties = .{ .tag = .dllexport, .declspec = true } }, | |
| 992 | .{ .tag = .dllimport, .properties = .{ .tag = .dllimport, .declspec = true } }, | |
| 993 | .{ .tag = .@"error", .properties = .{ .tag = .@"error", .gnu = true } }, | |
| 994 | .{ .tag = .externally_visible, .properties = .{ .tag = .externally_visible, .gnu = true } }, | |
| 995 | .{ .tag = .fallthrough, .properties = .{ .tag = .fallthrough, .c23 = true, .gnu = true } }, | |
| 996 | .{ .tag = .fastcall, .properties = .{ .tag = .fastcall, .gnu = true } }, | |
| 997 | .{ .tag = .flatten, .properties = .{ .tag = .flatten, .gnu = true } }, | |
| 998 | .{ .tag = .format, .properties = .{ .tag = .format, .gnu = true } }, | |
| 999 | .{ .tag = .format_arg, .properties = .{ .tag = .format_arg, .gnu = true } }, | |
| 1000 | .{ .tag = .gnu_inline, .properties = .{ .tag = .gnu_inline, .gnu = true } }, | |
| 1001 | .{ .tag = .hot, .properties = .{ .tag = .hot, .gnu = true } }, | |
| 1002 | .{ .tag = .ifunc, .properties = .{ .tag = .ifunc, .gnu = true } }, | |
| 1003 | .{ .tag = .interrupt, .properties = .{ .tag = .interrupt, .gnu = true } }, | |
| 1004 | .{ .tag = .interrupt_handler, .properties = .{ .tag = .interrupt_handler, .gnu = true } }, | |
| 1005 | .{ .tag = .jitintrinsic, .properties = .{ .tag = .jitintrinsic, .declspec = true } }, | |
| 1006 | .{ .tag = .leaf, .properties = .{ .tag = .leaf, .gnu = true } }, | |
| 1007 | .{ .tag = .malloc, .properties = .{ .tag = .malloc, .gnu = true } }, | |
| 1008 | .{ .tag = .may_alias, .properties = .{ .tag = .may_alias, .gnu = true } }, | |
| 1009 | .{ .tag = .maybe_unused, .properties = .{ .tag = .unused, .c23 = true } }, | |
| 1010 | .{ .tag = .mode, .properties = .{ .tag = .mode, .gnu = true } }, | |
| 1011 | .{ .tag = .ms_abi, .properties = .{ .tag = .ms_abi, .gnu = true } }, | |
| 1012 | .{ .tag = .naked, .properties = .{ .tag = .naked, .declspec = true } }, | |
| 1013 | .{ .tag = .no_address_safety_analysis, .properties = .{ .tag = .no_address_safety_analysis, .gnu = true } }, | |
| 1014 | .{ .tag = .no_icf, .properties = .{ .tag = .no_icf, .gnu = true } }, | |
| 1015 | .{ .tag = .no_instrument_function, .properties = .{ .tag = .no_instrument_function, .gnu = true } }, | |
| 1016 | .{ .tag = .no_profile_instrument_function, .properties = .{ .tag = .no_profile_instrument_function, .gnu = true } }, | |
| 1017 | .{ .tag = .no_reorder, .properties = .{ .tag = .no_reorder, .gnu = true } }, | |
| 1018 | .{ .tag = .no_sanitize, .properties = .{ .tag = .no_sanitize, .gnu = true } }, | |
| 1019 | .{ .tag = .no_sanitize_address, .properties = .{ .tag = .no_sanitize_address, .gnu = true, .declspec = true } }, | |
| 1020 | .{ .tag = .no_sanitize_coverage, .properties = .{ .tag = .no_sanitize_coverage, .gnu = true } }, | |
| 1021 | .{ .tag = .no_sanitize_thread, .properties = .{ .tag = .no_sanitize_thread, .gnu = true } }, | |
| 1022 | .{ .tag = .no_sanitize_undefined, .properties = .{ .tag = .no_sanitize_undefined, .gnu = true } }, | |
| 1023 | .{ .tag = .no_split_stack, .properties = .{ .tag = .no_split_stack, .gnu = true } }, | |
| 1024 | .{ .tag = .no_stack_limit, .properties = .{ .tag = .no_stack_limit, .gnu = true } }, | |
| 1025 | .{ .tag = .no_stack_protector, .properties = .{ .tag = .no_stack_protector, .gnu = true } }, | |
| 1026 | .{ .tag = .@"noalias", .properties = .{ .tag = .@"noalias", .declspec = true } }, | |
| 1027 | .{ .tag = .noclone, .properties = .{ .tag = .noclone, .gnu = true } }, | |
| 1028 | .{ .tag = .nocommon, .properties = .{ .tag = .nocommon, .gnu = true } }, | |
| 1029 | .{ .tag = .nodiscard, .properties = .{ .tag = .nodiscard, .c23 = true } }, | |
| 1030 | .{ .tag = .noinit, .properties = .{ .tag = .noinit, .gnu = true } }, | |
| 1031 | .{ .tag = .@"noinline", .properties = .{ .tag = .@"noinline", .gnu = true, .declspec = true } }, | |
| 1032 | .{ .tag = .noipa, .properties = .{ .tag = .noipa, .gnu = true } }, | |
| 1033 | .{ .tag = .nonnull, .properties = .{ .tag = .nonnull, .gnu = true } }, | |
| 1034 | .{ .tag = .nonstring, .properties = .{ .tag = .nonstring, .gnu = true } }, | |
| 1035 | .{ .tag = .noplt, .properties = .{ .tag = .noplt, .gnu = true } }, | |
| 1036 | .{ .tag = .@"noreturn", .properties = .{ .tag = .@"noreturn", .c23 = true, .gnu = true, .declspec = true } }, | |
| 1037 | .{ .tag = .nothrow, .properties = .{ .tag = .nothrow, .gnu = true } }, | |
| 1038 | .{ .tag = .@"packed", .properties = .{ .tag = .@"packed", .gnu = true } }, | |
| 1039 | .{ .tag = .patchable_function_entry, .properties = .{ .tag = .patchable_function_entry, .gnu = true } }, | |
| 1040 | .{ .tag = .pcs, .properties = .{ .tag = .pcs, .gnu = true } }, | |
| 1041 | .{ .tag = .persistent, .properties = .{ .tag = .persistent, .gnu = true } }, | |
| 1042 | .{ .tag = .process, .properties = .{ .tag = .process, .declspec = true } }, | |
| 1043 | .{ .tag = .pure, .properties = .{ .tag = .pure, .gnu = true } }, | |
| 1044 | .{ .tag = .reproducible, .properties = .{ .tag = .reproducible, .c23 = true } }, | |
| 1045 | .{ .tag = .restrict, .properties = .{ .tag = .restrict, .declspec = true } }, | |
| 1046 | .{ .tag = .retain, .properties = .{ .tag = .retain, .gnu = true } }, | |
| 1047 | .{ .tag = .returns_nonnull, .properties = .{ .tag = .returns_nonnull, .gnu = true } }, | |
| 1048 | .{ .tag = .returns_twice, .properties = .{ .tag = .returns_twice, .gnu = true } }, | |
| 1049 | .{ .tag = .riscv_vector_cc, .properties = .{ .tag = .riscv_vector_cc, .gnu = true } }, | |
| 1050 | .{ .tag = .safebuffers, .properties = .{ .tag = .safebuffers, .declspec = true } }, | |
| 1051 | .{ .tag = .scalar_storage_order, .properties = .{ .tag = .scalar_storage_order, .gnu = true } }, | |
| 1052 | .{ .tag = .section, .properties = .{ .tag = .section, .gnu = true } }, | |
| 1053 | .{ .tag = .selectany, .properties = .{ .tag = .selectany, .declspec = true } }, | |
| 1054 | .{ .tag = .sentinel, .properties = .{ .tag = .sentinel, .gnu = true } }, | |
| 1055 | .{ .tag = .simd, .properties = .{ .tag = .simd, .gnu = true } }, | |
| 1056 | .{ .tag = .spectre, .properties = .{ .tag = .spectre, .declspec = true } }, | |
| 1057 | .{ .tag = .stack_protect, .properties = .{ .tag = .stack_protect, .gnu = true } }, | |
| 1058 | .{ .tag = .stdcall, .properties = .{ .tag = .stdcall, .gnu = true } }, | |
| 1059 | .{ .tag = .symver, .properties = .{ .tag = .symver, .gnu = true } }, | |
| 1060 | .{ .tag = .sysv_abi, .properties = .{ .tag = .sysv_abi, .gnu = true } }, | |
| 1061 | .{ .tag = .target, .properties = .{ .tag = .target, .gnu = true } }, | |
| 1062 | .{ .tag = .target_clones, .properties = .{ .tag = .target_clones, .gnu = true } }, | |
| 1063 | .{ .tag = .thiscall, .properties = .{ .tag = .thiscall, .gnu = true } }, | |
| 1064 | .{ .tag = .thread, .properties = .{ .tag = .thread, .declspec = true } }, | |
| 1065 | .{ .tag = .tls_model, .properties = .{ .tag = .tls_model, .gnu = true } }, | |
| 1066 | .{ .tag = .transparent_union, .properties = .{ .tag = .transparent_union, .gnu = true } }, | |
| 1067 | .{ .tag = .unavailable, .properties = .{ .tag = .unavailable, .gnu = true } }, | |
| 1068 | .{ .tag = .uninitialized, .properties = .{ .tag = .uninitialized, .gnu = true } }, | |
| 1069 | .{ .tag = .unsequenced, .properties = .{ .tag = .unsequenced, .c23 = true } }, | |
| 1070 | .{ .tag = .unused, .properties = .{ .tag = .unused, .gnu = true } }, | |
| 1071 | .{ .tag = .used, .properties = .{ .tag = .used, .gnu = true } }, | |
| 1072 | .{ .tag = .uuid, .properties = .{ .tag = .uuid, .declspec = true } }, | |
| 1073 | .{ .tag = .vector_size, .properties = .{ .tag = .vector_size, .gnu = true } }, | |
| 1074 | .{ .tag = .vectorcall, .properties = .{ .tag = .vectorcall, .gnu = true } }, | |
| 1075 | .{ .tag = .visibility, .properties = .{ .tag = .visibility, .gnu = true } }, | |
| 1076 | .{ .tag = .warn_if_not_aligned, .properties = .{ .tag = .warn_if_not_aligned, .gnu = true } }, | |
| 1077 | .{ .tag = .warn_unused_result, .properties = .{ .tag = .warn_unused_result, .gnu = true } }, | |
| 1078 | .{ .tag = .warning, .properties = .{ .tag = .warning, .gnu = true } }, | |
| 1079 | .{ .tag = .weak, .properties = .{ .tag = .weak, .gnu = true } }, | |
| 1080 | .{ .tag = .weakref, .properties = .{ .tag = .weakref, .gnu = true } }, | |
| 1081 | .{ .tag = .zero_call_used_regs, .properties = .{ .tag = .zero_call_used_regs, .gnu = true } }, | |
| 998 | 1082 | }; |
| 999 | 1083 | }; |
| 1000 | 1084 | }; |
lib/compiler/aro/aro/Builtins.zig+146-154| ... | ... | @@ -1,21 +1,23 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | ||
| 2 | 3 | const Compilation = @import("Compilation.zig"); |
| 3 | const Type = @import("Type.zig"); | |
| 4 | const TypeDescription = @import("Builtins/TypeDescription.zig"); | |
| 5 | const target_util = @import("target.zig"); | |
| 6 | const StringId = @import("StringInterner.zig").StringId; | |
| 7 | 4 | const LangOpts = @import("LangOpts.zig"); |
| 8 | 5 | const Parser = @import("Parser.zig"); |
| 6 | const target_util = @import("target.zig"); | |
| 7 | const TypeStore = @import("TypeStore.zig"); | |
| 8 | const QualType = TypeStore.QualType; | |
| 9 | const Builder = TypeStore.Builder; | |
| 10 | const TypeDescription = @import("Builtins/TypeDescription.zig"); | |
| 9 | 11 | |
| 10 | 12 | const Properties = @import("Builtins/Properties.zig"); |
| 11 | 13 | pub const Builtin = @import("Builtins/Builtin.zig").with(Properties); |
| 12 | 14 | |
| 13 | 15 | const Expanded = struct { |
| 14 | ty: Type, | |
| 16 | qt: QualType, | |
| 15 | 17 | builtin: Builtin, |
| 16 | 18 | }; |
| 17 | 19 | |
| 18 | const NameToTypeMap = std.StringHashMapUnmanaged(Type); | |
| 20 | const NameToTypeMap = std.StringHashMapUnmanaged(QualType); | |
| 19 | 21 | |
| 20 | 22 | const Builtins = @This(); |
| 21 | 23 | |
| ... | ... | @@ -25,38 +27,38 @@ pub fn deinit(b: *Builtins, gpa: std.mem.Allocator) void { |
| 25 | 27 | b._name_to_type_map.deinit(gpa); |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | fn specForSize(comp: *const Compilation, size_bits: u32) Type.Builder.Specifier { | |
| 29 | var ty = Type{ .specifier = .short }; | |
| 30 | if (ty.sizeof(comp).? * 8 == size_bits) return .short; | |
| 30 | fn specForSize(comp: *const Compilation, size_bits: u32) TypeStore.Builder.Specifier { | |
| 31 | var qt: QualType = .short; | |
| 32 | if (qt.bitSizeof(comp) == size_bits) return .short; | |
| 31 | 33 | |
| 32 | ty.specifier = .int; | |
| 33 | if (ty.sizeof(comp).? * 8 == size_bits) return .int; | |
| 34 | qt = .int; | |
| 35 | if (qt.bitSizeof(comp) == size_bits) return .int; | |
| 34 | 36 | |
| 35 | ty.specifier = .long; | |
| 36 | if (ty.sizeof(comp).? * 8 == size_bits) return .long; | |
| 37 | qt = .long; | |
| 38 | if (qt.bitSizeof(comp) == size_bits) return .long; | |
| 37 | 39 | |
| 38 | ty.specifier = .long_long; | |
| 39 | if (ty.sizeof(comp).? * 8 == size_bits) return .long_long; | |
| 40 | qt = .long_long; | |
| 41 | if (qt.bitSizeof(comp) == size_bits) return .long_long; | |
| 40 | 42 | |
| 41 | 43 | unreachable; |
| 42 | 44 | } |
| 43 | 45 | |
| 44 | fn createType(desc: TypeDescription, it: *TypeDescription.TypeIterator, comp: *const Compilation, allocator: std.mem.Allocator) !Type { | |
| 45 | var builder: Type.Builder = .{ .error_on_invalid = true }; | |
| 46 | fn createType(desc: TypeDescription, it: *TypeDescription.TypeIterator, comp: *Compilation) !QualType { | |
| 47 | var parser: Parser = undefined; | |
| 48 | parser.comp = comp; | |
| 49 | var builder: TypeStore.Builder = .{ .parser = &parser, .error_on_invalid = true }; | |
| 50 | ||
| 46 | 51 | var require_native_int32 = false; |
| 47 | 52 | var require_native_int64 = false; |
| 48 | 53 | for (desc.prefix) |prefix| { |
| 49 | 54 | switch (prefix) { |
| 50 | .L => builder.combine(undefined, .long, 0) catch unreachable, | |
| 51 | .LL => { | |
| 52 | builder.combine(undefined, .long, 0) catch unreachable; | |
| 53 | builder.combine(undefined, .long, 0) catch unreachable; | |
| 54 | }, | |
| 55 | .L => builder.combine(.long, 0) catch unreachable, | |
| 56 | .LL => builder.combine(.long_long, 0) catch unreachable, | |
| 55 | 57 | .LLL => { |
| 56 | switch (builder.specifier) { | |
| 57 | .none => builder.specifier = .int128, | |
| 58 | .signed => builder.specifier = .sint128, | |
| 59 | .unsigned => builder.specifier = .uint128, | |
| 58 | switch (builder.type) { | |
| 59 | .none => builder.type = .int128, | |
| 60 | .signed => builder.type = .sint128, | |
| 61 | .unsigned => builder.type = .uint128, | |
| 60 | 62 | else => unreachable, |
| 61 | 63 | } |
| 62 | 64 | }, |
| ... | ... | @@ -65,239 +67,226 @@ fn createType(desc: TypeDescription, it: *TypeDescription.TypeIterator, comp: *c |
| 65 | 67 | .N => { |
| 66 | 68 | std.debug.assert(desc.spec == .i); |
| 67 | 69 | if (!target_util.isLP64(comp.target)) { |
| 68 | builder.combine(undefined, .long, 0) catch unreachable; | |
| 70 | builder.combine(.long, 0) catch unreachable; | |
| 69 | 71 | } |
| 70 | 72 | }, |
| 71 | 73 | .O => { |
| 72 | builder.combine(undefined, .long, 0) catch unreachable; | |
| 74 | builder.combine(.long, 0) catch unreachable; | |
| 73 | 75 | if (comp.target.os.tag != .opencl) { |
| 74 | builder.combine(undefined, .long, 0) catch unreachable; | |
| 76 | builder.combine(.long, 0) catch unreachable; | |
| 75 | 77 | } |
| 76 | 78 | }, |
| 77 | .S => builder.combine(undefined, .signed, 0) catch unreachable, | |
| 78 | .U => builder.combine(undefined, .unsigned, 0) catch unreachable, | |
| 79 | .S => builder.combine(.signed, 0) catch unreachable, | |
| 80 | .U => builder.combine(.unsigned, 0) catch unreachable, | |
| 79 | 81 | .I => { |
| 80 | 82 | // Todo: compile-time constant integer |
| 81 | 83 | }, |
| 82 | 84 | } |
| 83 | 85 | } |
| 84 | 86 | switch (desc.spec) { |
| 85 | .v => builder.combine(undefined, .void, 0) catch unreachable, | |
| 86 | .b => builder.combine(undefined, .bool, 0) catch unreachable, | |
| 87 | .c => builder.combine(undefined, .char, 0) catch unreachable, | |
| 88 | .s => builder.combine(undefined, .short, 0) catch unreachable, | |
| 87 | .v => builder.combine(.void, 0) catch unreachable, | |
| 88 | .b => builder.combine(.bool, 0) catch unreachable, | |
| 89 | .c => builder.combine(.char, 0) catch unreachable, | |
| 90 | .s => builder.combine(.short, 0) catch unreachable, | |
| 89 | 91 | .i => { |
| 90 | 92 | if (require_native_int32) { |
| 91 | builder.specifier = specForSize(comp, 32); | |
| 93 | builder.type = specForSize(comp, 32); | |
| 92 | 94 | } else if (require_native_int64) { |
| 93 | builder.specifier = specForSize(comp, 64); | |
| 95 | builder.type = specForSize(comp, 64); | |
| 94 | 96 | } else { |
| 95 | switch (builder.specifier) { | |
| 97 | switch (builder.type) { | |
| 96 | 98 | .int128, .sint128, .uint128 => {}, |
| 97 | else => builder.combine(undefined, .int, 0) catch unreachable, | |
| 99 | else => builder.combine(.int, 0) catch unreachable, | |
| 98 | 100 | } |
| 99 | 101 | } |
| 100 | 102 | }, |
| 101 | .h => builder.combine(undefined, .fp16, 0) catch unreachable, | |
| 102 | .x => builder.combine(undefined, .float16, 0) catch unreachable, | |
| 103 | .h => builder.combine(.fp16, 0) catch unreachable, | |
| 104 | .x => builder.combine(.float16, 0) catch unreachable, | |
| 103 | 105 | .y => { |
| 104 | 106 | // Todo: __bf16 |
| 105 | return .{ .specifier = .invalid }; | |
| 107 | return .invalid; | |
| 106 | 108 | }, |
| 107 | .f => builder.combine(undefined, .float, 0) catch unreachable, | |
| 109 | .f => builder.combine(.float, 0) catch unreachable, | |
| 108 | 110 | .d => { |
| 109 | if (builder.specifier == .long_long) { | |
| 110 | builder.specifier = .float128; | |
| 111 | if (builder.type == .long_long) { | |
| 112 | builder.type = .float128; | |
| 111 | 113 | } else { |
| 112 | builder.combine(undefined, .double, 0) catch unreachable; | |
| 114 | builder.combine(.double, 0) catch unreachable; | |
| 113 | 115 | } |
| 114 | 116 | }, |
| 115 | 117 | .z => { |
| 116 | std.debug.assert(builder.specifier == .none); | |
| 117 | builder.specifier = Type.Builder.fromType(comp.types.size); | |
| 118 | std.debug.assert(builder.type == .none); | |
| 119 | builder.type = Builder.fromType(comp, comp.type_store.size); | |
| 118 | 120 | }, |
| 119 | 121 | .w => { |
| 120 | std.debug.assert(builder.specifier == .none); | |
| 121 | builder.specifier = Type.Builder.fromType(comp.types.wchar); | |
| 122 | std.debug.assert(builder.type == .none); | |
| 123 | builder.type = Builder.fromType(comp, comp.type_store.wchar); | |
| 122 | 124 | }, |
| 123 | 125 | .F => { |
| 124 | std.debug.assert(builder.specifier == .none); | |
| 125 | builder.specifier = Type.Builder.fromType(comp.types.ns_constant_string.ty); | |
| 126 | std.debug.assert(builder.type == .none); | |
| 127 | builder.type = Builder.fromType(comp, comp.type_store.ns_constant_string); | |
| 126 | 128 | }, |
| 127 | 129 | .G => { |
| 128 | 130 | // Todo: id |
| 129 | return .{ .specifier = .invalid }; | |
| 131 | return .invalid; | |
| 130 | 132 | }, |
| 131 | 133 | .H => { |
| 132 | 134 | // Todo: SEL |
| 133 | return .{ .specifier = .invalid }; | |
| 135 | return .invalid; | |
| 134 | 136 | }, |
| 135 | 137 | .M => { |
| 136 | 138 | // Todo: struct objc_super |
| 137 | return .{ .specifier = .invalid }; | |
| 139 | return .invalid; | |
| 138 | 140 | }, |
| 139 | 141 | .a => { |
| 140 | std.debug.assert(builder.specifier == .none); | |
| 142 | std.debug.assert(builder.type == .none); | |
| 141 | 143 | std.debug.assert(desc.suffix.len == 0); |
| 142 | builder.specifier = Type.Builder.fromType(comp.types.va_list); | |
| 144 | builder.type = Builder.fromType(comp, comp.type_store.va_list); | |
| 143 | 145 | }, |
| 144 | 146 | .A => { |
| 145 | std.debug.assert(builder.specifier == .none); | |
| 147 | std.debug.assert(builder.type == .none); | |
| 146 | 148 | std.debug.assert(desc.suffix.len == 0); |
| 147 | var va_list = comp.types.va_list; | |
| 148 | if (va_list.isArray()) va_list.decayArray(); | |
| 149 | builder.specifier = Type.Builder.fromType(va_list); | |
| 149 | var va_list = comp.type_store.va_list; | |
| 150 | std.debug.assert(!va_list.is(comp, .array)); | |
| 151 | builder.type = Builder.fromType(comp, va_list); | |
| 150 | 152 | }, |
| 151 | 153 | .V => |element_count| { |
| 152 | 154 | std.debug.assert(desc.suffix.len == 0); |
| 153 | 155 | const child_desc = it.next().?; |
| 154 | const child_ty = try createType(child_desc, undefined, comp, allocator); | |
| 155 | const arr_ty = try allocator.create(Type.Array); | |
| 156 | arr_ty.* = .{ | |
| 156 | const elem_qt = try createType(child_desc, undefined, comp); | |
| 157 | const vector_qt = try comp.type_store.put(comp.gpa, .{ .vector = .{ | |
| 158 | .elem = elem_qt, | |
| 157 | 159 | .len = element_count, |
| 158 | .elem = child_ty, | |
| 159 | }; | |
| 160 | const vector_ty: Type = .{ .specifier = .vector, .data = .{ .array = arr_ty } }; | |
| 161 | builder.specifier = Type.Builder.fromType(vector_ty); | |
| 160 | } }); | |
| 161 | builder.type = .{ .other = vector_qt }; | |
| 162 | 162 | }, |
| 163 | 163 | .q => { |
| 164 | 164 | // Todo: scalable vector |
| 165 | return .{ .specifier = .invalid }; | |
| 165 | return .invalid; | |
| 166 | 166 | }, |
| 167 | 167 | .E => { |
| 168 | 168 | // Todo: ext_vector (OpenCL vector) |
| 169 | return .{ .specifier = .invalid }; | |
| 169 | return .invalid; | |
| 170 | 170 | }, |
| 171 | 171 | .X => |child| { |
| 172 | builder.combine(undefined, .complex, 0) catch unreachable; | |
| 172 | builder.combine(.complex, 0) catch unreachable; | |
| 173 | 173 | switch (child) { |
| 174 | .float => builder.combine(undefined, .float, 0) catch unreachable, | |
| 175 | .double => builder.combine(undefined, .double, 0) catch unreachable, | |
| 174 | .float => builder.combine(.float, 0) catch unreachable, | |
| 175 | .double => builder.combine(.double, 0) catch unreachable, | |
| 176 | 176 | .longdouble => { |
| 177 | builder.combine(undefined, .long, 0) catch unreachable; | |
| 178 | builder.combine(undefined, .double, 0) catch unreachable; | |
| 177 | builder.combine(.long, 0) catch unreachable; | |
| 178 | builder.combine(.double, 0) catch unreachable; | |
| 179 | 179 | }, |
| 180 | 180 | } |
| 181 | 181 | }, |
| 182 | 182 | .Y => { |
| 183 | std.debug.assert(builder.specifier == .none); | |
| 183 | std.debug.assert(builder.type == .none); | |
| 184 | 184 | std.debug.assert(desc.suffix.len == 0); |
| 185 | builder.specifier = Type.Builder.fromType(comp.types.ptrdiff); | |
| 185 | builder.type = Builder.fromType(comp, comp.type_store.ptrdiff); | |
| 186 | 186 | }, |
| 187 | 187 | .P => { |
| 188 | std.debug.assert(builder.specifier == .none); | |
| 189 | if (comp.types.file.specifier == .invalid) { | |
| 190 | return comp.types.file; | |
| 188 | std.debug.assert(builder.type == .none); | |
| 189 | if (comp.type_store.file.isInvalid()) { | |
| 190 | return comp.type_store.file; | |
| 191 | 191 | } |
| 192 | builder.specifier = Type.Builder.fromType(comp.types.file); | |
| 192 | builder.type = Builder.fromType(comp, comp.type_store.file); | |
| 193 | 193 | }, |
| 194 | 194 | .J => { |
| 195 | std.debug.assert(builder.specifier == .none); | |
| 195 | std.debug.assert(builder.type == .none); | |
| 196 | 196 | std.debug.assert(desc.suffix.len == 0); |
| 197 | if (comp.types.jmp_buf.specifier == .invalid) { | |
| 198 | return comp.types.jmp_buf; | |
| 197 | if (comp.type_store.jmp_buf.isInvalid()) { | |
| 198 | return comp.type_store.jmp_buf; | |
| 199 | 199 | } |
| 200 | builder.specifier = Type.Builder.fromType(comp.types.jmp_buf); | |
| 200 | builder.type = Builder.fromType(comp, comp.type_store.jmp_buf); | |
| 201 | 201 | }, |
| 202 | 202 | .SJ => { |
| 203 | std.debug.assert(builder.specifier == .none); | |
| 203 | std.debug.assert(builder.type == .none); | |
| 204 | 204 | std.debug.assert(desc.suffix.len == 0); |
| 205 | if (comp.types.sigjmp_buf.specifier == .invalid) { | |
| 206 | return comp.types.sigjmp_buf; | |
| 205 | if (comp.type_store.sigjmp_buf.isInvalid()) { | |
| 206 | return comp.type_store.sigjmp_buf; | |
| 207 | 207 | } |
| 208 | builder.specifier = Type.Builder.fromType(comp.types.sigjmp_buf); | |
| 208 | builder.type = Builder.fromType(comp, comp.type_store.sigjmp_buf); | |
| 209 | 209 | }, |
| 210 | 210 | .K => { |
| 211 | std.debug.assert(builder.specifier == .none); | |
| 212 | if (comp.types.ucontext_t.specifier == .invalid) { | |
| 213 | return comp.types.ucontext_t; | |
| 211 | std.debug.assert(builder.type == .none); | |
| 212 | if (comp.type_store.ucontext_t.isInvalid()) { | |
| 213 | return comp.type_store.ucontext_t; | |
| 214 | 214 | } |
| 215 | builder.specifier = Type.Builder.fromType(comp.types.ucontext_t); | |
| 215 | builder.type = Builder.fromType(comp, comp.type_store.ucontext_t); | |
| 216 | 216 | }, |
| 217 | 217 | .p => { |
| 218 | std.debug.assert(builder.specifier == .none); | |
| 218 | std.debug.assert(builder.type == .none); | |
| 219 | 219 | std.debug.assert(desc.suffix.len == 0); |
| 220 | builder.specifier = Type.Builder.fromType(comp.types.pid_t); | |
| 220 | builder.type = Builder.fromType(comp, comp.type_store.pid_t); | |
| 221 | 221 | }, |
| 222 | .@"!" => return .{ .specifier = .invalid }, | |
| 222 | .@"!" => return .invalid, | |
| 223 | 223 | } |
| 224 | 224 | for (desc.suffix) |suffix| { |
| 225 | 225 | switch (suffix) { |
| 226 | 226 | .@"*" => |address_space| { |
| 227 | 227 | _ = address_space; // TODO: handle address space |
| 228 | const elem_ty = try allocator.create(Type); | |
| 229 | elem_ty.* = builder.finish(undefined) catch unreachable; | |
| 230 | const ty = Type{ | |
| 231 | .specifier = .pointer, | |
| 232 | .data = .{ .sub_type = elem_ty }, | |
| 233 | }; | |
| 234 | builder.qual = .{}; | |
| 235 | builder.specifier = Type.Builder.fromType(ty); | |
| 228 | const pointer_qt = try comp.type_store.put(comp.gpa, .{ .pointer = .{ | |
| 229 | .child = builder.finish() catch unreachable, | |
| 230 | .decayed = null, | |
| 231 | } }); | |
| 232 | ||
| 233 | builder.@"const" = null; | |
| 234 | builder.@"volatile" = null; | |
| 235 | builder.restrict = null; | |
| 236 | builder.type = .{ .other = pointer_qt }; | |
| 236 | 237 | }, |
| 237 | .C => builder.qual.@"const" = 0, | |
| 238 | .D => builder.qual.@"volatile" = 0, | |
| 239 | .R => builder.qual.restrict = 0, | |
| 238 | .C => builder.@"const" = 0, | |
| 239 | .D => builder.@"volatile" = 0, | |
| 240 | .R => builder.restrict = 0, | |
| 240 | 241 | } |
| 241 | 242 | } |
| 242 | return builder.finish(undefined) catch unreachable; | |
| 243 | return builder.finish() catch unreachable; | |
| 243 | 244 | } |
| 244 | 245 | |
| 245 | fn createBuiltin(comp: *const Compilation, builtin: Builtin, type_arena: std.mem.Allocator) !Type { | |
| 246 | fn createBuiltin(comp: *Compilation, builtin: Builtin) !QualType { | |
| 246 | 247 | var it = TypeDescription.TypeIterator.init(builtin.properties.param_str); |
| 247 | 248 | |
| 248 | 249 | const ret_ty_desc = it.next().?; |
| 249 | 250 | if (ret_ty_desc.spec == .@"!") { |
| 250 | 251 | // Todo: handle target-dependent definition |
| 251 | 252 | } |
| 252 | const ret_ty = try createType(ret_ty_desc, &it, comp, type_arena); | |
| 253 | const ret_ty = try createType(ret_ty_desc, &it, comp); | |
| 253 | 254 | var param_count: usize = 0; |
| 254 | var params: [Builtin.max_param_count]Type.Func.Param = undefined; | |
| 255 | var params: [Builtin.max_param_count]TypeStore.Type.Func.Param = undefined; | |
| 255 | 256 | while (it.next()) |desc| : (param_count += 1) { |
| 256 | params[param_count] = .{ .name_tok = 0, .ty = try createType(desc, &it, comp, type_arena), .name = .empty }; | |
| 257 | params[param_count] = .{ .name_tok = 0, .qt = try createType(desc, &it, comp), .name = .empty, .node = .null }; | |
| 257 | 258 | } |
| 258 | 259 | |
| 259 | const duped_params = try type_arena.dupe(Type.Func.Param, params[0..param_count]); | |
| 260 | const func = try type_arena.create(Type.Func); | |
| 261 | ||
| 262 | func.* = .{ | |
| 260 | return comp.type_store.put(comp.gpa, .{ .func = .{ | |
| 263 | 261 | .return_type = ret_ty, |
| 264 | .params = duped_params, | |
| 265 | }; | |
| 266 | return .{ | |
| 267 | .specifier = if (builtin.properties.isVarArgs()) .var_args_func else .func, | |
| 268 | .data = .{ .func = func }, | |
| 269 | }; | |
| 262 | .kind = if (builtin.properties.isVarArgs()) .variadic else .normal, | |
| 263 | .params = params[0..param_count], | |
| 264 | } }); | |
| 270 | 265 | } |
| 271 | 266 | |
| 272 | 267 | /// Asserts that the builtin has already been created |
| 273 | 268 | pub fn lookup(b: *const Builtins, name: []const u8) Expanded { |
| 274 | 269 | const builtin = Builtin.fromName(name).?; |
| 275 | const ty = b._name_to_type_map.get(name).?; | |
| 276 | return .{ | |
| 277 | .builtin = builtin, | |
| 278 | .ty = ty, | |
| 279 | }; | |
| 270 | const qt = b._name_to_type_map.get(name).?; | |
| 271 | return .{ .builtin = builtin, .qt = qt }; | |
| 280 | 272 | } |
| 281 | 273 | |
| 282 | pub fn getOrCreate(b: *Builtins, comp: *Compilation, name: []const u8, type_arena: std.mem.Allocator) !?Expanded { | |
| 283 | const ty = b._name_to_type_map.get(name) orelse { | |
| 274 | pub fn getOrCreate(b: *Builtins, comp: *Compilation, name: []const u8) !?Expanded { | |
| 275 | const qt = b._name_to_type_map.get(name) orelse { | |
| 284 | 276 | const builtin = Builtin.fromName(name) orelse return null; |
| 285 | 277 | if (!comp.hasBuiltinFunction(builtin)) return null; |
| 286 | 278 | |
| 287 | 279 | try b._name_to_type_map.ensureUnusedCapacity(comp.gpa, 1); |
| 288 | const ty = try createBuiltin(comp, builtin, type_arena); | |
| 289 | b._name_to_type_map.putAssumeCapacity(name, ty); | |
| 280 | const qt = try createBuiltin(comp, builtin); | |
| 281 | b._name_to_type_map.putAssumeCapacity(name, qt); | |
| 290 | 282 | |
| 291 | 283 | return .{ |
| 292 | 284 | .builtin = builtin, |
| 293 | .ty = ty, | |
| 285 | .qt = qt, | |
| 294 | 286 | }; |
| 295 | 287 | }; |
| 296 | 288 | const builtin = Builtin.fromName(name).?; |
| 297 | return .{ | |
| 298 | .builtin = builtin, | |
| 299 | .ty = ty, | |
| 300 | }; | |
| 289 | return .{ .builtin = builtin, .qt = qt }; | |
| 301 | 290 | } |
| 302 | 291 | |
| 303 | 292 | pub const Iterator = struct { |
| ... | ... | @@ -323,12 +312,13 @@ pub const Iterator = struct { |
| 323 | 312 | }; |
| 324 | 313 | |
| 325 | 314 | test Iterator { |
| 315 | const gpa = std.testing.allocator; | |
| 326 | 316 | var it = Iterator{}; |
| 327 | 317 | |
| 328 | var seen = std.StringHashMap(Builtin).init(std.testing.allocator); | |
| 329 | defer seen.deinit(); | |
| 318 | var seen: std.StringHashMapUnmanaged(Builtin) = .empty; | |
| 319 | defer seen.deinit(gpa); | |
| 330 | 320 | |
| 331 | var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator); | |
| 321 | var arena_state = std.heap.ArenaAllocator.init(gpa); | |
| 332 | 322 | defer arena_state.deinit(); |
| 333 | 323 | const arena = arena_state.allocator(); |
| 334 | 324 | |
| ... | ... | @@ -344,25 +334,27 @@ test Iterator { |
| 344 | 334 | std.debug.print("previous data: {}\n", .{seen.get(entry.name).?}); |
| 345 | 335 | return error.TestExpectedUniqueEntries; |
| 346 | 336 | } |
| 347 | try seen.put(try arena.dupe(u8, entry.name), entry.builtin); | |
| 337 | try seen.put(gpa, try arena.dupe(u8, entry.name), entry.builtin); | |
| 348 | 338 | } |
| 349 | 339 | try std.testing.expectEqual(@as(usize, Builtin.data.len), seen.count()); |
| 350 | 340 | } |
| 351 | 341 | |
| 352 | 342 | test "All builtins" { |
| 353 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 343 | var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 344 | defer arena_state.deinit(); | |
| 345 | const arena = arena_state.allocator(); | |
| 346 | ||
| 347 | var comp = Compilation.init(std.testing.allocator, arena, undefined, std.fs.cwd()); | |
| 354 | 348 | defer comp.deinit(); |
| 355 | _ = try comp.generateBuiltinMacros(.include_system_defines); | |
| 356 | var arena = std.heap.ArenaAllocator.init(std.testing.allocator); | |
| 357 | defer arena.deinit(); | |
| 358 | 349 | |
| 359 | const type_arena = arena.allocator(); | |
| 350 | try comp.type_store.initNamedTypes(&comp); | |
| 351 | comp.type_store.va_list = try comp.type_store.va_list.decay(&comp); | |
| 360 | 352 | |
| 361 | 353 | var builtin_it = Iterator{}; |
| 362 | 354 | while (builtin_it.next()) |entry| { |
| 363 | const name = try type_arena.dupe(u8, entry.name); | |
| 364 | if (try comp.builtins.getOrCreate(&comp, name, type_arena)) |func_ty| { | |
| 365 | const get_again = (try comp.builtins.getOrCreate(&comp, name, std.testing.failing_allocator)).?; | |
| 355 | const name = try arena.dupe(u8, entry.name); | |
| 356 | if (try comp.builtins.getOrCreate(&comp, name)) |func_ty| { | |
| 357 | const get_again = (try comp.builtins.getOrCreate(&comp, name)).?; | |
| 366 | 358 | const found_by_lookup = comp.builtins.lookup(name); |
| 367 | 359 | try std.testing.expectEqual(func_ty.builtin.tag, get_again.builtin.tag); |
| 368 | 360 | try std.testing.expectEqual(func_ty.builtin.tag, found_by_lookup.builtin.tag); |
| ... | ... | @@ -373,19 +365,19 @@ test "All builtins" { |
| 373 | 365 | test "Allocation failures" { |
| 374 | 366 | const Test = struct { |
| 375 | 367 | fn testOne(allocator: std.mem.Allocator) !void { |
| 376 | var comp = Compilation.init(allocator, std.fs.cwd()); | |
| 368 | var arena_state: std.heap.ArenaAllocator = .init(allocator); | |
| 369 | defer arena_state.deinit(); | |
| 370 | const arena = arena_state.allocator(); | |
| 371 | ||
| 372 | var comp = Compilation.init(allocator, arena, undefined, std.fs.cwd()); | |
| 377 | 373 | defer comp.deinit(); |
| 378 | 374 | _ = try comp.generateBuiltinMacros(.include_system_defines); |
| 379 | var arena = std.heap.ArenaAllocator.init(comp.gpa); | |
| 380 | defer arena.deinit(); | |
| 381 | ||
| 382 | const type_arena = arena.allocator(); | |
| 383 | 375 | |
| 384 | 376 | const num_builtins = 40; |
| 385 | 377 | var builtin_it = Iterator{}; |
| 386 | 378 | for (0..num_builtins) |_| { |
| 387 | 379 | const entry = builtin_it.next().?; |
| 388 | _ = try comp.builtins.getOrCreate(&comp, entry.name, type_arena); | |
| 380 | _ = try comp.builtins.getOrCreate(&comp, entry.name); | |
| 389 | 381 | } |
| 390 | 382 | } |
| 391 | 383 | }; |
lib/compiler/aro/aro/Builtins/Builtin.zig+11611-11565| ... | ... | @@ -13,7 +13,3998 @@ properties: Properties, |
| 13 | 13 | |
| 14 | 14 | /// Integer starting at 0 derived from the unique index, |
| 15 | 15 | /// corresponds with the data array index. |
| 16 | pub const Tag = enum(u16) { _ }; | |
| 16 | pub const Tag = enum(u16) { _Block_object_assign, | |
| 17 | _Block_object_dispose, | |
| 18 | _Exit, | |
| 19 | _InterlockedAnd, | |
| 20 | _InterlockedAnd16, | |
| 21 | _InterlockedAnd8, | |
| 22 | _InterlockedCompareExchange, | |
| 23 | _InterlockedCompareExchange16, | |
| 24 | _InterlockedCompareExchange64, | |
| 25 | _InterlockedCompareExchange8, | |
| 26 | _InterlockedCompareExchangePointer, | |
| 27 | _InterlockedCompareExchangePointer_nf, | |
| 28 | _InterlockedDecrement, | |
| 29 | _InterlockedDecrement16, | |
| 30 | _InterlockedExchange, | |
| 31 | _InterlockedExchange16, | |
| 32 | _InterlockedExchange8, | |
| 33 | _InterlockedExchangeAdd, | |
| 34 | _InterlockedExchangeAdd16, | |
| 35 | _InterlockedExchangeAdd8, | |
| 36 | _InterlockedExchangePointer, | |
| 37 | _InterlockedExchangeSub, | |
| 38 | _InterlockedExchangeSub16, | |
| 39 | _InterlockedExchangeSub8, | |
| 40 | _InterlockedIncrement, | |
| 41 | _InterlockedIncrement16, | |
| 42 | _InterlockedOr, | |
| 43 | _InterlockedOr16, | |
| 44 | _InterlockedOr8, | |
| 45 | _InterlockedXor, | |
| 46 | _InterlockedXor16, | |
| 47 | _InterlockedXor8, | |
| 48 | _MoveFromCoprocessor, | |
| 49 | _MoveFromCoprocessor2, | |
| 50 | _MoveToCoprocessor, | |
| 51 | _MoveToCoprocessor2, | |
| 52 | _ReturnAddress, | |
| 53 | __GetExceptionInfo, | |
| 54 | __abnormal_termination, | |
| 55 | __annotation, | |
| 56 | __arithmetic_fence, | |
| 57 | __assume, | |
| 58 | __atomic_add_fetch, | |
| 59 | __atomic_always_lock_free, | |
| 60 | __atomic_and_fetch, | |
| 61 | __atomic_clear, | |
| 62 | __atomic_compare_exchange, | |
| 63 | __atomic_compare_exchange_n, | |
| 64 | __atomic_exchange, | |
| 65 | __atomic_exchange_n, | |
| 66 | __atomic_fetch_add, | |
| 67 | __atomic_fetch_and, | |
| 68 | __atomic_fetch_max, | |
| 69 | __atomic_fetch_min, | |
| 70 | __atomic_fetch_nand, | |
| 71 | __atomic_fetch_or, | |
| 72 | __atomic_fetch_sub, | |
| 73 | __atomic_fetch_xor, | |
| 74 | __atomic_is_lock_free, | |
| 75 | __atomic_load, | |
| 76 | __atomic_load_n, | |
| 77 | __atomic_max_fetch, | |
| 78 | __atomic_min_fetch, | |
| 79 | __atomic_nand_fetch, | |
| 80 | __atomic_or_fetch, | |
| 81 | __atomic_signal_fence, | |
| 82 | __atomic_store, | |
| 83 | __atomic_store_n, | |
| 84 | __atomic_sub_fetch, | |
| 85 | __atomic_test_and_set, | |
| 86 | __atomic_thread_fence, | |
| 87 | __atomic_xor_fetch, | |
| 88 | __builtin___CFStringMakeConstantString, | |
| 89 | __builtin___NSStringMakeConstantString, | |
| 90 | __builtin___clear_cache, | |
| 91 | __builtin___fprintf_chk, | |
| 92 | __builtin___get_unsafe_stack_bottom, | |
| 93 | __builtin___get_unsafe_stack_ptr, | |
| 94 | __builtin___get_unsafe_stack_start, | |
| 95 | __builtin___get_unsafe_stack_top, | |
| 96 | __builtin___memccpy_chk, | |
| 97 | __builtin___memcpy_chk, | |
| 98 | __builtin___memmove_chk, | |
| 99 | __builtin___mempcpy_chk, | |
| 100 | __builtin___memset_chk, | |
| 101 | __builtin___printf_chk, | |
| 102 | __builtin___snprintf_chk, | |
| 103 | __builtin___sprintf_chk, | |
| 104 | __builtin___stpcpy_chk, | |
| 105 | __builtin___stpncpy_chk, | |
| 106 | __builtin___strcat_chk, | |
| 107 | __builtin___strcpy_chk, | |
| 108 | __builtin___strlcat_chk, | |
| 109 | __builtin___strlcpy_chk, | |
| 110 | __builtin___strncat_chk, | |
| 111 | __builtin___strncpy_chk, | |
| 112 | __builtin___vfprintf_chk, | |
| 113 | __builtin___vprintf_chk, | |
| 114 | __builtin___vsnprintf_chk, | |
| 115 | __builtin___vsprintf_chk, | |
| 116 | __builtin_abort, | |
| 117 | __builtin_abs, | |
| 118 | __builtin_acos, | |
| 119 | __builtin_acosf, | |
| 120 | __builtin_acosf128, | |
| 121 | __builtin_acosh, | |
| 122 | __builtin_acoshf, | |
| 123 | __builtin_acoshf128, | |
| 124 | __builtin_acoshl, | |
| 125 | __builtin_acosl, | |
| 126 | __builtin_add_overflow, | |
| 127 | __builtin_addc, | |
| 128 | __builtin_addcb, | |
| 129 | __builtin_addcl, | |
| 130 | __builtin_addcll, | |
| 131 | __builtin_addcs, | |
| 132 | __builtin_align_down, | |
| 133 | __builtin_align_up, | |
| 134 | __builtin_alloca, | |
| 135 | __builtin_alloca_uninitialized, | |
| 136 | __builtin_alloca_with_align, | |
| 137 | __builtin_alloca_with_align_uninitialized, | |
| 138 | __builtin_amdgcn_alignbit, | |
| 139 | __builtin_amdgcn_alignbyte, | |
| 140 | __builtin_amdgcn_atomic_dec32, | |
| 141 | __builtin_amdgcn_atomic_dec64, | |
| 142 | __builtin_amdgcn_atomic_inc32, | |
| 143 | __builtin_amdgcn_atomic_inc64, | |
| 144 | __builtin_amdgcn_buffer_wbinvl1, | |
| 145 | __builtin_amdgcn_class, | |
| 146 | __builtin_amdgcn_classf, | |
| 147 | __builtin_amdgcn_cosf, | |
| 148 | __builtin_amdgcn_cubeid, | |
| 149 | __builtin_amdgcn_cubema, | |
| 150 | __builtin_amdgcn_cubesc, | |
| 151 | __builtin_amdgcn_cubetc, | |
| 152 | __builtin_amdgcn_cvt_pk_i16, | |
| 153 | __builtin_amdgcn_cvt_pk_u16, | |
| 154 | __builtin_amdgcn_cvt_pk_u8_f32, | |
| 155 | __builtin_amdgcn_cvt_pknorm_i16, | |
| 156 | __builtin_amdgcn_cvt_pknorm_u16, | |
| 157 | __builtin_amdgcn_cvt_pkrtz, | |
| 158 | __builtin_amdgcn_dispatch_ptr, | |
| 159 | __builtin_amdgcn_div_fixup, | |
| 160 | __builtin_amdgcn_div_fixupf, | |
| 161 | __builtin_amdgcn_div_fmas, | |
| 162 | __builtin_amdgcn_div_fmasf, | |
| 163 | __builtin_amdgcn_div_scale, | |
| 164 | __builtin_amdgcn_div_scalef, | |
| 165 | __builtin_amdgcn_ds_append, | |
| 166 | __builtin_amdgcn_ds_bpermute, | |
| 167 | __builtin_amdgcn_ds_consume, | |
| 168 | __builtin_amdgcn_ds_faddf, | |
| 169 | __builtin_amdgcn_ds_fmaxf, | |
| 170 | __builtin_amdgcn_ds_fminf, | |
| 171 | __builtin_amdgcn_ds_permute, | |
| 172 | __builtin_amdgcn_ds_swizzle, | |
| 173 | __builtin_amdgcn_endpgm, | |
| 174 | __builtin_amdgcn_exp2f, | |
| 175 | __builtin_amdgcn_fcmp, | |
| 176 | __builtin_amdgcn_fcmpf, | |
| 177 | __builtin_amdgcn_fence, | |
| 178 | __builtin_amdgcn_fmed3f, | |
| 179 | __builtin_amdgcn_fract, | |
| 180 | __builtin_amdgcn_fractf, | |
| 181 | __builtin_amdgcn_frexp_exp, | |
| 182 | __builtin_amdgcn_frexp_expf, | |
| 183 | __builtin_amdgcn_frexp_mant, | |
| 184 | __builtin_amdgcn_frexp_mantf, | |
| 185 | __builtin_amdgcn_grid_size_x, | |
| 186 | __builtin_amdgcn_grid_size_y, | |
| 187 | __builtin_amdgcn_grid_size_z, | |
| 188 | __builtin_amdgcn_groupstaticsize, | |
| 189 | __builtin_amdgcn_iglp_opt, | |
| 190 | __builtin_amdgcn_implicitarg_ptr, | |
| 191 | __builtin_amdgcn_interp_mov, | |
| 192 | __builtin_amdgcn_interp_p1, | |
| 193 | __builtin_amdgcn_interp_p1_f16, | |
| 194 | __builtin_amdgcn_interp_p2, | |
| 195 | __builtin_amdgcn_interp_p2_f16, | |
| 196 | __builtin_amdgcn_is_private, | |
| 197 | __builtin_amdgcn_is_shared, | |
| 198 | __builtin_amdgcn_kernarg_segment_ptr, | |
| 199 | __builtin_amdgcn_ldexp, | |
| 200 | __builtin_amdgcn_ldexpf, | |
| 201 | __builtin_amdgcn_lerp, | |
| 202 | __builtin_amdgcn_log_clampf, | |
| 203 | __builtin_amdgcn_logf, | |
| 204 | __builtin_amdgcn_mbcnt_hi, | |
| 205 | __builtin_amdgcn_mbcnt_lo, | |
| 206 | __builtin_amdgcn_mqsad_pk_u16_u8, | |
| 207 | __builtin_amdgcn_mqsad_u32_u8, | |
| 208 | __builtin_amdgcn_msad_u8, | |
| 209 | __builtin_amdgcn_qsad_pk_u16_u8, | |
| 210 | __builtin_amdgcn_queue_ptr, | |
| 211 | __builtin_amdgcn_rcp, | |
| 212 | __builtin_amdgcn_rcpf, | |
| 213 | __builtin_amdgcn_read_exec, | |
| 214 | __builtin_amdgcn_read_exec_hi, | |
| 215 | __builtin_amdgcn_read_exec_lo, | |
| 216 | __builtin_amdgcn_readfirstlane, | |
| 217 | __builtin_amdgcn_readlane, | |
| 218 | __builtin_amdgcn_rsq, | |
| 219 | __builtin_amdgcn_rsq_clamp, | |
| 220 | __builtin_amdgcn_rsq_clampf, | |
| 221 | __builtin_amdgcn_rsqf, | |
| 222 | __builtin_amdgcn_s_barrier, | |
| 223 | __builtin_amdgcn_s_dcache_inv, | |
| 224 | __builtin_amdgcn_s_decperflevel, | |
| 225 | __builtin_amdgcn_s_getpc, | |
| 226 | __builtin_amdgcn_s_getreg, | |
| 227 | __builtin_amdgcn_s_incperflevel, | |
| 228 | __builtin_amdgcn_s_sendmsg, | |
| 229 | __builtin_amdgcn_s_sendmsghalt, | |
| 230 | __builtin_amdgcn_s_setprio, | |
| 231 | __builtin_amdgcn_s_setreg, | |
| 232 | __builtin_amdgcn_s_sleep, | |
| 233 | __builtin_amdgcn_s_waitcnt, | |
| 234 | __builtin_amdgcn_sad_hi_u8, | |
| 235 | __builtin_amdgcn_sad_u16, | |
| 236 | __builtin_amdgcn_sad_u8, | |
| 237 | __builtin_amdgcn_sbfe, | |
| 238 | __builtin_amdgcn_sched_barrier, | |
| 239 | __builtin_amdgcn_sched_group_barrier, | |
| 240 | __builtin_amdgcn_sicmp, | |
| 241 | __builtin_amdgcn_sicmpl, | |
| 242 | __builtin_amdgcn_sinf, | |
| 243 | __builtin_amdgcn_sqrt, | |
| 244 | __builtin_amdgcn_sqrtf, | |
| 245 | __builtin_amdgcn_trig_preop, | |
| 246 | __builtin_amdgcn_trig_preopf, | |
| 247 | __builtin_amdgcn_ubfe, | |
| 248 | __builtin_amdgcn_uicmp, | |
| 249 | __builtin_amdgcn_uicmpl, | |
| 250 | __builtin_amdgcn_wave_barrier, | |
| 251 | __builtin_amdgcn_workgroup_id_x, | |
| 252 | __builtin_amdgcn_workgroup_id_y, | |
| 253 | __builtin_amdgcn_workgroup_id_z, | |
| 254 | __builtin_amdgcn_workgroup_size_x, | |
| 255 | __builtin_amdgcn_workgroup_size_y, | |
| 256 | __builtin_amdgcn_workgroup_size_z, | |
| 257 | __builtin_amdgcn_workitem_id_x, | |
| 258 | __builtin_amdgcn_workitem_id_y, | |
| 259 | __builtin_amdgcn_workitem_id_z, | |
| 260 | __builtin_annotation, | |
| 261 | __builtin_arm_cdp, | |
| 262 | __builtin_arm_cdp2, | |
| 263 | __builtin_arm_clrex, | |
| 264 | __builtin_arm_cls, | |
| 265 | __builtin_arm_cls64, | |
| 266 | __builtin_arm_clz, | |
| 267 | __builtin_arm_clz64, | |
| 268 | __builtin_arm_cmse_TT, | |
| 269 | __builtin_arm_cmse_TTA, | |
| 270 | __builtin_arm_cmse_TTAT, | |
| 271 | __builtin_arm_cmse_TTT, | |
| 272 | __builtin_arm_dbg, | |
| 273 | __builtin_arm_dmb, | |
| 274 | __builtin_arm_dsb, | |
| 275 | __builtin_arm_get_fpscr, | |
| 276 | __builtin_arm_isb, | |
| 277 | __builtin_arm_ldaex, | |
| 278 | __builtin_arm_ldc, | |
| 279 | __builtin_arm_ldc2, | |
| 280 | __builtin_arm_ldc2l, | |
| 281 | __builtin_arm_ldcl, | |
| 282 | __builtin_arm_ldrex, | |
| 283 | __builtin_arm_ldrexd, | |
| 284 | __builtin_arm_mcr, | |
| 285 | __builtin_arm_mcr2, | |
| 286 | __builtin_arm_mcrr, | |
| 287 | __builtin_arm_mcrr2, | |
| 288 | __builtin_arm_mrc, | |
| 289 | __builtin_arm_mrc2, | |
| 290 | __builtin_arm_mrrc, | |
| 291 | __builtin_arm_mrrc2, | |
| 292 | __builtin_arm_nop, | |
| 293 | __builtin_arm_prefetch, | |
| 294 | __builtin_arm_qadd, | |
| 295 | __builtin_arm_qadd16, | |
| 296 | __builtin_arm_qadd8, | |
| 297 | __builtin_arm_qasx, | |
| 298 | __builtin_arm_qdbl, | |
| 299 | __builtin_arm_qsax, | |
| 300 | __builtin_arm_qsub, | |
| 301 | __builtin_arm_qsub16, | |
| 302 | __builtin_arm_qsub8, | |
| 303 | __builtin_arm_rbit, | |
| 304 | __builtin_arm_rbit64, | |
| 305 | __builtin_arm_rsr, | |
| 306 | __builtin_arm_rsr64, | |
| 307 | __builtin_arm_rsrp, | |
| 308 | __builtin_arm_sadd16, | |
| 309 | __builtin_arm_sadd8, | |
| 310 | __builtin_arm_sasx, | |
| 311 | __builtin_arm_sel, | |
| 312 | __builtin_arm_set_fpscr, | |
| 313 | __builtin_arm_sev, | |
| 314 | __builtin_arm_sevl, | |
| 315 | __builtin_arm_shadd16, | |
| 316 | __builtin_arm_shadd8, | |
| 317 | __builtin_arm_shasx, | |
| 318 | __builtin_arm_shsax, | |
| 319 | __builtin_arm_shsub16, | |
| 320 | __builtin_arm_shsub8, | |
| 321 | __builtin_arm_smlabb, | |
| 322 | __builtin_arm_smlabt, | |
| 323 | __builtin_arm_smlad, | |
| 324 | __builtin_arm_smladx, | |
| 325 | __builtin_arm_smlald, | |
| 326 | __builtin_arm_smlaldx, | |
| 327 | __builtin_arm_smlatb, | |
| 328 | __builtin_arm_smlatt, | |
| 329 | __builtin_arm_smlawb, | |
| 330 | __builtin_arm_smlawt, | |
| 331 | __builtin_arm_smlsd, | |
| 332 | __builtin_arm_smlsdx, | |
| 333 | __builtin_arm_smlsld, | |
| 334 | __builtin_arm_smlsldx, | |
| 335 | __builtin_arm_smuad, | |
| 336 | __builtin_arm_smuadx, | |
| 337 | __builtin_arm_smulbb, | |
| 338 | __builtin_arm_smulbt, | |
| 339 | __builtin_arm_smultb, | |
| 340 | __builtin_arm_smultt, | |
| 341 | __builtin_arm_smulwb, | |
| 342 | __builtin_arm_smulwt, | |
| 343 | __builtin_arm_smusd, | |
| 344 | __builtin_arm_smusdx, | |
| 345 | __builtin_arm_ssat, | |
| 346 | __builtin_arm_ssat16, | |
| 347 | __builtin_arm_ssax, | |
| 348 | __builtin_arm_ssub16, | |
| 349 | __builtin_arm_ssub8, | |
| 350 | __builtin_arm_stc, | |
| 351 | __builtin_arm_stc2, | |
| 352 | __builtin_arm_stc2l, | |
| 353 | __builtin_arm_stcl, | |
| 354 | __builtin_arm_stlex, | |
| 355 | __builtin_arm_strex, | |
| 356 | __builtin_arm_strexd, | |
| 357 | __builtin_arm_sxtab16, | |
| 358 | __builtin_arm_sxtb16, | |
| 359 | __builtin_arm_tcancel, | |
| 360 | __builtin_arm_tcommit, | |
| 361 | __builtin_arm_tstart, | |
| 362 | __builtin_arm_ttest, | |
| 363 | __builtin_arm_uadd16, | |
| 364 | __builtin_arm_uadd8, | |
| 365 | __builtin_arm_uasx, | |
| 366 | __builtin_arm_uhadd16, | |
| 367 | __builtin_arm_uhadd8, | |
| 368 | __builtin_arm_uhasx, | |
| 369 | __builtin_arm_uhsax, | |
| 370 | __builtin_arm_uhsub16, | |
| 371 | __builtin_arm_uhsub8, | |
| 372 | __builtin_arm_uqadd16, | |
| 373 | __builtin_arm_uqadd8, | |
| 374 | __builtin_arm_uqasx, | |
| 375 | __builtin_arm_uqsax, | |
| 376 | __builtin_arm_uqsub16, | |
| 377 | __builtin_arm_uqsub8, | |
| 378 | __builtin_arm_usad8, | |
| 379 | __builtin_arm_usada8, | |
| 380 | __builtin_arm_usat, | |
| 381 | __builtin_arm_usat16, | |
| 382 | __builtin_arm_usax, | |
| 383 | __builtin_arm_usub16, | |
| 384 | __builtin_arm_usub8, | |
| 385 | __builtin_arm_uxtab16, | |
| 386 | __builtin_arm_uxtb16, | |
| 387 | __builtin_arm_vcvtr_d, | |
| 388 | __builtin_arm_vcvtr_f, | |
| 389 | __builtin_arm_wfe, | |
| 390 | __builtin_arm_wfi, | |
| 391 | __builtin_arm_wsr, | |
| 392 | __builtin_arm_wsr64, | |
| 393 | __builtin_arm_wsrp, | |
| 394 | __builtin_arm_yield, | |
| 395 | __builtin_asin, | |
| 396 | __builtin_asinf, | |
| 397 | __builtin_asinf128, | |
| 398 | __builtin_asinh, | |
| 399 | __builtin_asinhf, | |
| 400 | __builtin_asinhf128, | |
| 401 | __builtin_asinhl, | |
| 402 | __builtin_asinl, | |
| 403 | __builtin_assume, | |
| 404 | __builtin_assume_aligned, | |
| 405 | __builtin_assume_separate_storage, | |
| 406 | __builtin_atan, | |
| 407 | __builtin_atan2, | |
| 408 | __builtin_atan2f, | |
| 409 | __builtin_atan2f128, | |
| 410 | __builtin_atan2l, | |
| 411 | __builtin_atanf, | |
| 412 | __builtin_atanf128, | |
| 413 | __builtin_atanh, | |
| 414 | __builtin_atanhf, | |
| 415 | __builtin_atanhf128, | |
| 416 | __builtin_atanhl, | |
| 417 | __builtin_atanl, | |
| 418 | __builtin_bcmp, | |
| 419 | __builtin_bcopy, | |
| 420 | __builtin_bitoffsetof, | |
| 421 | __builtin_bitrev, | |
| 422 | __builtin_bitreverse16, | |
| 423 | __builtin_bitreverse32, | |
| 424 | __builtin_bitreverse64, | |
| 425 | __builtin_bitreverse8, | |
| 426 | __builtin_bswap16, | |
| 427 | __builtin_bswap32, | |
| 428 | __builtin_bswap64, | |
| 429 | __builtin_bzero, | |
| 430 | __builtin_cabs, | |
| 431 | __builtin_cabsf, | |
| 432 | __builtin_cabsl, | |
| 433 | __builtin_cacos, | |
| 434 | __builtin_cacosf, | |
| 435 | __builtin_cacosh, | |
| 436 | __builtin_cacoshf, | |
| 437 | __builtin_cacoshl, | |
| 438 | __builtin_cacosl, | |
| 439 | __builtin_call_with_static_chain, | |
| 440 | __builtin_calloc, | |
| 441 | __builtin_canonicalize, | |
| 442 | __builtin_canonicalizef, | |
| 443 | __builtin_canonicalizef16, | |
| 444 | __builtin_canonicalizel, | |
| 445 | __builtin_carg, | |
| 446 | __builtin_cargf, | |
| 447 | __builtin_cargl, | |
| 448 | __builtin_casin, | |
| 449 | __builtin_casinf, | |
| 450 | __builtin_casinh, | |
| 451 | __builtin_casinhf, | |
| 452 | __builtin_casinhl, | |
| 453 | __builtin_casinl, | |
| 454 | __builtin_catan, | |
| 455 | __builtin_catanf, | |
| 456 | __builtin_catanh, | |
| 457 | __builtin_catanhf, | |
| 458 | __builtin_catanhl, | |
| 459 | __builtin_catanl, | |
| 460 | __builtin_cbrt, | |
| 461 | __builtin_cbrtf, | |
| 462 | __builtin_cbrtf128, | |
| 463 | __builtin_cbrtl, | |
| 464 | __builtin_ccos, | |
| 465 | __builtin_ccosf, | |
| 466 | __builtin_ccosh, | |
| 467 | __builtin_ccoshf, | |
| 468 | __builtin_ccoshl, | |
| 469 | __builtin_ccosl, | |
| 470 | __builtin_ceil, | |
| 471 | __builtin_ceilf, | |
| 472 | __builtin_ceilf128, | |
| 473 | __builtin_ceilf16, | |
| 474 | __builtin_ceill, | |
| 475 | __builtin_cexp, | |
| 476 | __builtin_cexpf, | |
| 477 | __builtin_cexpl, | |
| 478 | __builtin_char_memchr, | |
| 479 | __builtin_choose_expr, | |
| 480 | __builtin_cimag, | |
| 481 | __builtin_cimagf, | |
| 482 | __builtin_cimagl, | |
| 483 | __builtin_classify_type, | |
| 484 | __builtin_clog, | |
| 485 | __builtin_clogf, | |
| 486 | __builtin_clogl, | |
| 487 | __builtin_clrsb, | |
| 488 | __builtin_clrsbl, | |
| 489 | __builtin_clrsbll, | |
| 490 | __builtin_clz, | |
| 491 | __builtin_clzl, | |
| 492 | __builtin_clzll, | |
| 493 | __builtin_clzs, | |
| 494 | __builtin_complex, | |
| 495 | __builtin_conj, | |
| 496 | __builtin_conjf, | |
| 497 | __builtin_conjl, | |
| 498 | __builtin_constant_p, | |
| 499 | __builtin_convertvector, | |
| 500 | __builtin_copysign, | |
| 501 | __builtin_copysignf, | |
| 502 | __builtin_copysignf128, | |
| 503 | __builtin_copysignf16, | |
| 504 | __builtin_copysignl, | |
| 505 | __builtin_cos, | |
| 506 | __builtin_cosf, | |
| 507 | __builtin_cosf128, | |
| 508 | __builtin_cosf16, | |
| 509 | __builtin_cosh, | |
| 510 | __builtin_coshf, | |
| 511 | __builtin_coshf128, | |
| 512 | __builtin_coshl, | |
| 513 | __builtin_cosl, | |
| 514 | __builtin_cpow, | |
| 515 | __builtin_cpowf, | |
| 516 | __builtin_cpowl, | |
| 517 | __builtin_cproj, | |
| 518 | __builtin_cprojf, | |
| 519 | __builtin_cprojl, | |
| 520 | __builtin_cpu_init, | |
| 521 | __builtin_cpu_is, | |
| 522 | __builtin_cpu_supports, | |
| 523 | __builtin_creal, | |
| 524 | __builtin_crealf, | |
| 525 | __builtin_creall, | |
| 526 | __builtin_csin, | |
| 527 | __builtin_csinf, | |
| 528 | __builtin_csinh, | |
| 529 | __builtin_csinhf, | |
| 530 | __builtin_csinhl, | |
| 531 | __builtin_csinl, | |
| 532 | __builtin_csqrt, | |
| 533 | __builtin_csqrtf, | |
| 534 | __builtin_csqrtl, | |
| 535 | __builtin_ctan, | |
| 536 | __builtin_ctanf, | |
| 537 | __builtin_ctanh, | |
| 538 | __builtin_ctanhf, | |
| 539 | __builtin_ctanhl, | |
| 540 | __builtin_ctanl, | |
| 541 | __builtin_ctz, | |
| 542 | __builtin_ctzl, | |
| 543 | __builtin_ctzll, | |
| 544 | __builtin_ctzs, | |
| 545 | __builtin_dcbf, | |
| 546 | __builtin_debugtrap, | |
| 547 | __builtin_dump_struct, | |
| 548 | __builtin_dwarf_cfa, | |
| 549 | __builtin_dwarf_sp_column, | |
| 550 | __builtin_dynamic_object_size, | |
| 551 | __builtin_eh_return, | |
| 552 | __builtin_eh_return_data_regno, | |
| 553 | __builtin_elementwise_abs, | |
| 554 | __builtin_elementwise_add_sat, | |
| 555 | __builtin_elementwise_bitreverse, | |
| 556 | __builtin_elementwise_canonicalize, | |
| 557 | __builtin_elementwise_ceil, | |
| 558 | __builtin_elementwise_copysign, | |
| 559 | __builtin_elementwise_cos, | |
| 560 | __builtin_elementwise_exp, | |
| 561 | __builtin_elementwise_exp2, | |
| 562 | __builtin_elementwise_floor, | |
| 563 | __builtin_elementwise_fma, | |
| 564 | __builtin_elementwise_log, | |
| 565 | __builtin_elementwise_log10, | |
| 566 | __builtin_elementwise_log2, | |
| 567 | __builtin_elementwise_max, | |
| 568 | __builtin_elementwise_min, | |
| 569 | __builtin_elementwise_nearbyint, | |
| 570 | __builtin_elementwise_pow, | |
| 571 | __builtin_elementwise_rint, | |
| 572 | __builtin_elementwise_round, | |
| 573 | __builtin_elementwise_roundeven, | |
| 574 | __builtin_elementwise_sin, | |
| 575 | __builtin_elementwise_sqrt, | |
| 576 | __builtin_elementwise_sub_sat, | |
| 577 | __builtin_elementwise_trunc, | |
| 578 | __builtin_erf, | |
| 579 | __builtin_erfc, | |
| 580 | __builtin_erfcf, | |
| 581 | __builtin_erfcf128, | |
| 582 | __builtin_erfcl, | |
| 583 | __builtin_erff, | |
| 584 | __builtin_erff128, | |
| 585 | __builtin_erfl, | |
| 586 | __builtin_exp, | |
| 587 | __builtin_exp10, | |
| 588 | __builtin_exp10f, | |
| 589 | __builtin_exp10f128, | |
| 590 | __builtin_exp10f16, | |
| 591 | __builtin_exp10l, | |
| 592 | __builtin_exp2, | |
| 593 | __builtin_exp2f, | |
| 594 | __builtin_exp2f128, | |
| 595 | __builtin_exp2f16, | |
| 596 | __builtin_exp2l, | |
| 597 | __builtin_expect, | |
| 598 | __builtin_expect_with_probability, | |
| 599 | __builtin_expf, | |
| 600 | __builtin_expf128, | |
| 601 | __builtin_expf16, | |
| 602 | __builtin_expl, | |
| 603 | __builtin_expm1, | |
| 604 | __builtin_expm1f, | |
| 605 | __builtin_expm1f128, | |
| 606 | __builtin_expm1l, | |
| 607 | __builtin_extend_pointer, | |
| 608 | __builtin_extract_return_addr, | |
| 609 | __builtin_fabs, | |
| 610 | __builtin_fabsf, | |
| 611 | __builtin_fabsf128, | |
| 612 | __builtin_fabsf16, | |
| 613 | __builtin_fabsl, | |
| 614 | __builtin_fdim, | |
| 615 | __builtin_fdimf, | |
| 616 | __builtin_fdimf128, | |
| 617 | __builtin_fdiml, | |
| 618 | __builtin_ffs, | |
| 619 | __builtin_ffsl, | |
| 620 | __builtin_ffsll, | |
| 621 | __builtin_floor, | |
| 622 | __builtin_floorf, | |
| 623 | __builtin_floorf128, | |
| 624 | __builtin_floorf16, | |
| 625 | __builtin_floorl, | |
| 626 | __builtin_flt_rounds, | |
| 627 | __builtin_fma, | |
| 628 | __builtin_fmaf, | |
| 629 | __builtin_fmaf128, | |
| 630 | __builtin_fmaf16, | |
| 631 | __builtin_fmal, | |
| 632 | __builtin_fmax, | |
| 633 | __builtin_fmaxf, | |
| 634 | __builtin_fmaxf128, | |
| 635 | __builtin_fmaxf16, | |
| 636 | __builtin_fmaxl, | |
| 637 | __builtin_fmin, | |
| 638 | __builtin_fminf, | |
| 639 | __builtin_fminf128, | |
| 640 | __builtin_fminf16, | |
| 641 | __builtin_fminl, | |
| 642 | __builtin_fmod, | |
| 643 | __builtin_fmodf, | |
| 644 | __builtin_fmodf128, | |
| 645 | __builtin_fmodf16, | |
| 646 | __builtin_fmodl, | |
| 647 | __builtin_fpclassify, | |
| 648 | __builtin_fprintf, | |
| 649 | __builtin_frame_address, | |
| 650 | __builtin_free, | |
| 651 | __builtin_frexp, | |
| 652 | __builtin_frexpf, | |
| 653 | __builtin_frexpf128, | |
| 654 | __builtin_frexpf16, | |
| 655 | __builtin_frexpl, | |
| 656 | __builtin_frob_return_addr, | |
| 657 | __builtin_fscanf, | |
| 658 | __builtin_getid, | |
| 659 | __builtin_getps, | |
| 660 | __builtin_huge_val, | |
| 661 | __builtin_huge_valf, | |
| 662 | __builtin_huge_valf128, | |
| 663 | __builtin_huge_valf16, | |
| 664 | __builtin_huge_vall, | |
| 665 | __builtin_hypot, | |
| 666 | __builtin_hypotf, | |
| 667 | __builtin_hypotf128, | |
| 668 | __builtin_hypotl, | |
| 669 | __builtin_ia32_rdpmc, | |
| 670 | __builtin_ia32_rdtsc, | |
| 671 | __builtin_ia32_rdtscp, | |
| 672 | __builtin_ilogb, | |
| 673 | __builtin_ilogbf, | |
| 674 | __builtin_ilogbf128, | |
| 675 | __builtin_ilogbl, | |
| 676 | __builtin_index, | |
| 677 | __builtin_inf, | |
| 678 | __builtin_inff, | |
| 679 | __builtin_inff128, | |
| 680 | __builtin_inff16, | |
| 681 | __builtin_infl, | |
| 682 | __builtin_init_dwarf_reg_size_table, | |
| 683 | __builtin_is_aligned, | |
| 684 | __builtin_isfinite, | |
| 685 | __builtin_isfpclass, | |
| 686 | __builtin_isgreater, | |
| 687 | __builtin_isgreaterequal, | |
| 688 | __builtin_isinf, | |
| 689 | __builtin_isinf_sign, | |
| 690 | __builtin_isless, | |
| 691 | __builtin_islessequal, | |
| 692 | __builtin_islessgreater, | |
| 693 | __builtin_isnan, | |
| 694 | __builtin_isnormal, | |
| 695 | __builtin_isunordered, | |
| 696 | __builtin_labs, | |
| 697 | __builtin_launder, | |
| 698 | __builtin_ldexp, | |
| 699 | __builtin_ldexpf, | |
| 700 | __builtin_ldexpf128, | |
| 701 | __builtin_ldexpf16, | |
| 702 | __builtin_ldexpl, | |
| 703 | __builtin_lgamma, | |
| 704 | __builtin_lgammaf, | |
| 705 | __builtin_lgammaf128, | |
| 706 | __builtin_lgammal, | |
| 707 | __builtin_llabs, | |
| 708 | __builtin_llrint, | |
| 709 | __builtin_llrintf, | |
| 710 | __builtin_llrintf128, | |
| 711 | __builtin_llrintl, | |
| 712 | __builtin_llround, | |
| 713 | __builtin_llroundf, | |
| 714 | __builtin_llroundf128, | |
| 715 | __builtin_llroundl, | |
| 716 | __builtin_log, | |
| 717 | __builtin_log10, | |
| 718 | __builtin_log10f, | |
| 719 | __builtin_log10f128, | |
| 720 | __builtin_log10f16, | |
| 721 | __builtin_log10l, | |
| 722 | __builtin_log1p, | |
| 723 | __builtin_log1pf, | |
| 724 | __builtin_log1pf128, | |
| 725 | __builtin_log1pl, | |
| 726 | __builtin_log2, | |
| 727 | __builtin_log2f, | |
| 728 | __builtin_log2f128, | |
| 729 | __builtin_log2f16, | |
| 730 | __builtin_log2l, | |
| 731 | __builtin_logb, | |
| 732 | __builtin_logbf, | |
| 733 | __builtin_logbf128, | |
| 734 | __builtin_logbl, | |
| 735 | __builtin_logf, | |
| 736 | __builtin_logf128, | |
| 737 | __builtin_logf16, | |
| 738 | __builtin_logl, | |
| 739 | __builtin_longjmp, | |
| 740 | __builtin_lrint, | |
| 741 | __builtin_lrintf, | |
| 742 | __builtin_lrintf128, | |
| 743 | __builtin_lrintl, | |
| 744 | __builtin_lround, | |
| 745 | __builtin_lroundf, | |
| 746 | __builtin_lroundf128, | |
| 747 | __builtin_lroundl, | |
| 748 | __builtin_malloc, | |
| 749 | __builtin_matrix_column_major_load, | |
| 750 | __builtin_matrix_column_major_store, | |
| 751 | __builtin_matrix_transpose, | |
| 752 | __builtin_memchr, | |
| 753 | __builtin_memcmp, | |
| 754 | __builtin_memcpy, | |
| 755 | __builtin_memcpy_inline, | |
| 756 | __builtin_memmove, | |
| 757 | __builtin_mempcpy, | |
| 758 | __builtin_memset, | |
| 759 | __builtin_memset_inline, | |
| 760 | __builtin_mips_absq_s_ph, | |
| 761 | __builtin_mips_absq_s_qb, | |
| 762 | __builtin_mips_absq_s_w, | |
| 763 | __builtin_mips_addq_ph, | |
| 764 | __builtin_mips_addq_s_ph, | |
| 765 | __builtin_mips_addq_s_w, | |
| 766 | __builtin_mips_addqh_ph, | |
| 767 | __builtin_mips_addqh_r_ph, | |
| 768 | __builtin_mips_addqh_r_w, | |
| 769 | __builtin_mips_addqh_w, | |
| 770 | __builtin_mips_addsc, | |
| 771 | __builtin_mips_addu_ph, | |
| 772 | __builtin_mips_addu_qb, | |
| 773 | __builtin_mips_addu_s_ph, | |
| 774 | __builtin_mips_addu_s_qb, | |
| 775 | __builtin_mips_adduh_qb, | |
| 776 | __builtin_mips_adduh_r_qb, | |
| 777 | __builtin_mips_addwc, | |
| 778 | __builtin_mips_append, | |
| 779 | __builtin_mips_balign, | |
| 780 | __builtin_mips_bitrev, | |
| 781 | __builtin_mips_bposge32, | |
| 782 | __builtin_mips_cmp_eq_ph, | |
| 783 | __builtin_mips_cmp_le_ph, | |
| 784 | __builtin_mips_cmp_lt_ph, | |
| 785 | __builtin_mips_cmpgdu_eq_qb, | |
| 786 | __builtin_mips_cmpgdu_le_qb, | |
| 787 | __builtin_mips_cmpgdu_lt_qb, | |
| 788 | __builtin_mips_cmpgu_eq_qb, | |
| 789 | __builtin_mips_cmpgu_le_qb, | |
| 790 | __builtin_mips_cmpgu_lt_qb, | |
| 791 | __builtin_mips_cmpu_eq_qb, | |
| 792 | __builtin_mips_cmpu_le_qb, | |
| 793 | __builtin_mips_cmpu_lt_qb, | |
| 794 | __builtin_mips_dpa_w_ph, | |
| 795 | __builtin_mips_dpaq_s_w_ph, | |
| 796 | __builtin_mips_dpaq_sa_l_w, | |
| 797 | __builtin_mips_dpaqx_s_w_ph, | |
| 798 | __builtin_mips_dpaqx_sa_w_ph, | |
| 799 | __builtin_mips_dpau_h_qbl, | |
| 800 | __builtin_mips_dpau_h_qbr, | |
| 801 | __builtin_mips_dpax_w_ph, | |
| 802 | __builtin_mips_dps_w_ph, | |
| 803 | __builtin_mips_dpsq_s_w_ph, | |
| 804 | __builtin_mips_dpsq_sa_l_w, | |
| 805 | __builtin_mips_dpsqx_s_w_ph, | |
| 806 | __builtin_mips_dpsqx_sa_w_ph, | |
| 807 | __builtin_mips_dpsu_h_qbl, | |
| 808 | __builtin_mips_dpsu_h_qbr, | |
| 809 | __builtin_mips_dpsx_w_ph, | |
| 810 | __builtin_mips_extp, | |
| 811 | __builtin_mips_extpdp, | |
| 812 | __builtin_mips_extr_r_w, | |
| 813 | __builtin_mips_extr_rs_w, | |
| 814 | __builtin_mips_extr_s_h, | |
| 815 | __builtin_mips_extr_w, | |
| 816 | __builtin_mips_insv, | |
| 817 | __builtin_mips_lbux, | |
| 818 | __builtin_mips_lhx, | |
| 819 | __builtin_mips_lwx, | |
| 820 | __builtin_mips_madd, | |
| 821 | __builtin_mips_maddu, | |
| 822 | __builtin_mips_maq_s_w_phl, | |
| 823 | __builtin_mips_maq_s_w_phr, | |
| 824 | __builtin_mips_maq_sa_w_phl, | |
| 825 | __builtin_mips_maq_sa_w_phr, | |
| 826 | __builtin_mips_modsub, | |
| 827 | __builtin_mips_msub, | |
| 828 | __builtin_mips_msubu, | |
| 829 | __builtin_mips_mthlip, | |
| 830 | __builtin_mips_mul_ph, | |
| 831 | __builtin_mips_mul_s_ph, | |
| 832 | __builtin_mips_muleq_s_w_phl, | |
| 833 | __builtin_mips_muleq_s_w_phr, | |
| 834 | __builtin_mips_muleu_s_ph_qbl, | |
| 835 | __builtin_mips_muleu_s_ph_qbr, | |
| 836 | __builtin_mips_mulq_rs_ph, | |
| 837 | __builtin_mips_mulq_rs_w, | |
| 838 | __builtin_mips_mulq_s_ph, | |
| 839 | __builtin_mips_mulq_s_w, | |
| 840 | __builtin_mips_mulsa_w_ph, | |
| 841 | __builtin_mips_mulsaq_s_w_ph, | |
| 842 | __builtin_mips_mult, | |
| 843 | __builtin_mips_multu, | |
| 844 | __builtin_mips_packrl_ph, | |
| 845 | __builtin_mips_pick_ph, | |
| 846 | __builtin_mips_pick_qb, | |
| 847 | __builtin_mips_preceq_w_phl, | |
| 848 | __builtin_mips_preceq_w_phr, | |
| 849 | __builtin_mips_precequ_ph_qbl, | |
| 850 | __builtin_mips_precequ_ph_qbla, | |
| 851 | __builtin_mips_precequ_ph_qbr, | |
| 852 | __builtin_mips_precequ_ph_qbra, | |
| 853 | __builtin_mips_preceu_ph_qbl, | |
| 854 | __builtin_mips_preceu_ph_qbla, | |
| 855 | __builtin_mips_preceu_ph_qbr, | |
| 856 | __builtin_mips_preceu_ph_qbra, | |
| 857 | __builtin_mips_precr_qb_ph, | |
| 858 | __builtin_mips_precr_sra_ph_w, | |
| 859 | __builtin_mips_precr_sra_r_ph_w, | |
| 860 | __builtin_mips_precrq_ph_w, | |
| 861 | __builtin_mips_precrq_qb_ph, | |
| 862 | __builtin_mips_precrq_rs_ph_w, | |
| 863 | __builtin_mips_precrqu_s_qb_ph, | |
| 864 | __builtin_mips_prepend, | |
| 865 | __builtin_mips_raddu_w_qb, | |
| 866 | __builtin_mips_rddsp, | |
| 867 | __builtin_mips_repl_ph, | |
| 868 | __builtin_mips_repl_qb, | |
| 869 | __builtin_mips_shilo, | |
| 870 | __builtin_mips_shll_ph, | |
| 871 | __builtin_mips_shll_qb, | |
| 872 | __builtin_mips_shll_s_ph, | |
| 873 | __builtin_mips_shll_s_w, | |
| 874 | __builtin_mips_shra_ph, | |
| 875 | __builtin_mips_shra_qb, | |
| 876 | __builtin_mips_shra_r_ph, | |
| 877 | __builtin_mips_shra_r_qb, | |
| 878 | __builtin_mips_shra_r_w, | |
| 879 | __builtin_mips_shrl_ph, | |
| 880 | __builtin_mips_shrl_qb, | |
| 881 | __builtin_mips_subq_ph, | |
| 882 | __builtin_mips_subq_s_ph, | |
| 883 | __builtin_mips_subq_s_w, | |
| 884 | __builtin_mips_subqh_ph, | |
| 885 | __builtin_mips_subqh_r_ph, | |
| 886 | __builtin_mips_subqh_r_w, | |
| 887 | __builtin_mips_subqh_w, | |
| 888 | __builtin_mips_subu_ph, | |
| 889 | __builtin_mips_subu_qb, | |
| 890 | __builtin_mips_subu_s_ph, | |
| 891 | __builtin_mips_subu_s_qb, | |
| 892 | __builtin_mips_subuh_qb, | |
| 893 | __builtin_mips_subuh_r_qb, | |
| 894 | __builtin_mips_wrdsp, | |
| 895 | __builtin_modf, | |
| 896 | __builtin_modff, | |
| 897 | __builtin_modff128, | |
| 898 | __builtin_modfl, | |
| 899 | __builtin_msa_add_a_b, | |
| 900 | __builtin_msa_add_a_d, | |
| 901 | __builtin_msa_add_a_h, | |
| 902 | __builtin_msa_add_a_w, | |
| 903 | __builtin_msa_adds_a_b, | |
| 904 | __builtin_msa_adds_a_d, | |
| 905 | __builtin_msa_adds_a_h, | |
| 906 | __builtin_msa_adds_a_w, | |
| 907 | __builtin_msa_adds_s_b, | |
| 908 | __builtin_msa_adds_s_d, | |
| 909 | __builtin_msa_adds_s_h, | |
| 910 | __builtin_msa_adds_s_w, | |
| 911 | __builtin_msa_adds_u_b, | |
| 912 | __builtin_msa_adds_u_d, | |
| 913 | __builtin_msa_adds_u_h, | |
| 914 | __builtin_msa_adds_u_w, | |
| 915 | __builtin_msa_addv_b, | |
| 916 | __builtin_msa_addv_d, | |
| 917 | __builtin_msa_addv_h, | |
| 918 | __builtin_msa_addv_w, | |
| 919 | __builtin_msa_addvi_b, | |
| 920 | __builtin_msa_addvi_d, | |
| 921 | __builtin_msa_addvi_h, | |
| 922 | __builtin_msa_addvi_w, | |
| 923 | __builtin_msa_and_v, | |
| 924 | __builtin_msa_andi_b, | |
| 925 | __builtin_msa_asub_s_b, | |
| 926 | __builtin_msa_asub_s_d, | |
| 927 | __builtin_msa_asub_s_h, | |
| 928 | __builtin_msa_asub_s_w, | |
| 929 | __builtin_msa_asub_u_b, | |
| 930 | __builtin_msa_asub_u_d, | |
| 931 | __builtin_msa_asub_u_h, | |
| 932 | __builtin_msa_asub_u_w, | |
| 933 | __builtin_msa_ave_s_b, | |
| 934 | __builtin_msa_ave_s_d, | |
| 935 | __builtin_msa_ave_s_h, | |
| 936 | __builtin_msa_ave_s_w, | |
| 937 | __builtin_msa_ave_u_b, | |
| 938 | __builtin_msa_ave_u_d, | |
| 939 | __builtin_msa_ave_u_h, | |
| 940 | __builtin_msa_ave_u_w, | |
| 941 | __builtin_msa_aver_s_b, | |
| 942 | __builtin_msa_aver_s_d, | |
| 943 | __builtin_msa_aver_s_h, | |
| 944 | __builtin_msa_aver_s_w, | |
| 945 | __builtin_msa_aver_u_b, | |
| 946 | __builtin_msa_aver_u_d, | |
| 947 | __builtin_msa_aver_u_h, | |
| 948 | __builtin_msa_aver_u_w, | |
| 949 | __builtin_msa_bclr_b, | |
| 950 | __builtin_msa_bclr_d, | |
| 951 | __builtin_msa_bclr_h, | |
| 952 | __builtin_msa_bclr_w, | |
| 953 | __builtin_msa_bclri_b, | |
| 954 | __builtin_msa_bclri_d, | |
| 955 | __builtin_msa_bclri_h, | |
| 956 | __builtin_msa_bclri_w, | |
| 957 | __builtin_msa_binsl_b, | |
| 958 | __builtin_msa_binsl_d, | |
| 959 | __builtin_msa_binsl_h, | |
| 960 | __builtin_msa_binsl_w, | |
| 961 | __builtin_msa_binsli_b, | |
| 962 | __builtin_msa_binsli_d, | |
| 963 | __builtin_msa_binsli_h, | |
| 964 | __builtin_msa_binsli_w, | |
| 965 | __builtin_msa_binsr_b, | |
| 966 | __builtin_msa_binsr_d, | |
| 967 | __builtin_msa_binsr_h, | |
| 968 | __builtin_msa_binsr_w, | |
| 969 | __builtin_msa_binsri_b, | |
| 970 | __builtin_msa_binsri_d, | |
| 971 | __builtin_msa_binsri_h, | |
| 972 | __builtin_msa_binsri_w, | |
| 973 | __builtin_msa_bmnz_v, | |
| 974 | __builtin_msa_bmnzi_b, | |
| 975 | __builtin_msa_bmz_v, | |
| 976 | __builtin_msa_bmzi_b, | |
| 977 | __builtin_msa_bneg_b, | |
| 978 | __builtin_msa_bneg_d, | |
| 979 | __builtin_msa_bneg_h, | |
| 980 | __builtin_msa_bneg_w, | |
| 981 | __builtin_msa_bnegi_b, | |
| 982 | __builtin_msa_bnegi_d, | |
| 983 | __builtin_msa_bnegi_h, | |
| 984 | __builtin_msa_bnegi_w, | |
| 985 | __builtin_msa_bnz_b, | |
| 986 | __builtin_msa_bnz_d, | |
| 987 | __builtin_msa_bnz_h, | |
| 988 | __builtin_msa_bnz_v, | |
| 989 | __builtin_msa_bnz_w, | |
| 990 | __builtin_msa_bsel_v, | |
| 991 | __builtin_msa_bseli_b, | |
| 992 | __builtin_msa_bset_b, | |
| 993 | __builtin_msa_bset_d, | |
| 994 | __builtin_msa_bset_h, | |
| 995 | __builtin_msa_bset_w, | |
| 996 | __builtin_msa_bseti_b, | |
| 997 | __builtin_msa_bseti_d, | |
| 998 | __builtin_msa_bseti_h, | |
| 999 | __builtin_msa_bseti_w, | |
| 1000 | __builtin_msa_bz_b, | |
| 1001 | __builtin_msa_bz_d, | |
| 1002 | __builtin_msa_bz_h, | |
| 1003 | __builtin_msa_bz_v, | |
| 1004 | __builtin_msa_bz_w, | |
| 1005 | __builtin_msa_ceq_b, | |
| 1006 | __builtin_msa_ceq_d, | |
| 1007 | __builtin_msa_ceq_h, | |
| 1008 | __builtin_msa_ceq_w, | |
| 1009 | __builtin_msa_ceqi_b, | |
| 1010 | __builtin_msa_ceqi_d, | |
| 1011 | __builtin_msa_ceqi_h, | |
| 1012 | __builtin_msa_ceqi_w, | |
| 1013 | __builtin_msa_cfcmsa, | |
| 1014 | __builtin_msa_cle_s_b, | |
| 1015 | __builtin_msa_cle_s_d, | |
| 1016 | __builtin_msa_cle_s_h, | |
| 1017 | __builtin_msa_cle_s_w, | |
| 1018 | __builtin_msa_cle_u_b, | |
| 1019 | __builtin_msa_cle_u_d, | |
| 1020 | __builtin_msa_cle_u_h, | |
| 1021 | __builtin_msa_cle_u_w, | |
| 1022 | __builtin_msa_clei_s_b, | |
| 1023 | __builtin_msa_clei_s_d, | |
| 1024 | __builtin_msa_clei_s_h, | |
| 1025 | __builtin_msa_clei_s_w, | |
| 1026 | __builtin_msa_clei_u_b, | |
| 1027 | __builtin_msa_clei_u_d, | |
| 1028 | __builtin_msa_clei_u_h, | |
| 1029 | __builtin_msa_clei_u_w, | |
| 1030 | __builtin_msa_clt_s_b, | |
| 1031 | __builtin_msa_clt_s_d, | |
| 1032 | __builtin_msa_clt_s_h, | |
| 1033 | __builtin_msa_clt_s_w, | |
| 1034 | __builtin_msa_clt_u_b, | |
| 1035 | __builtin_msa_clt_u_d, | |
| 1036 | __builtin_msa_clt_u_h, | |
| 1037 | __builtin_msa_clt_u_w, | |
| 1038 | __builtin_msa_clti_s_b, | |
| 1039 | __builtin_msa_clti_s_d, | |
| 1040 | __builtin_msa_clti_s_h, | |
| 1041 | __builtin_msa_clti_s_w, | |
| 1042 | __builtin_msa_clti_u_b, | |
| 1043 | __builtin_msa_clti_u_d, | |
| 1044 | __builtin_msa_clti_u_h, | |
| 1045 | __builtin_msa_clti_u_w, | |
| 1046 | __builtin_msa_copy_s_b, | |
| 1047 | __builtin_msa_copy_s_d, | |
| 1048 | __builtin_msa_copy_s_h, | |
| 1049 | __builtin_msa_copy_s_w, | |
| 1050 | __builtin_msa_copy_u_b, | |
| 1051 | __builtin_msa_copy_u_d, | |
| 1052 | __builtin_msa_copy_u_h, | |
| 1053 | __builtin_msa_copy_u_w, | |
| 1054 | __builtin_msa_ctcmsa, | |
| 1055 | __builtin_msa_div_s_b, | |
| 1056 | __builtin_msa_div_s_d, | |
| 1057 | __builtin_msa_div_s_h, | |
| 1058 | __builtin_msa_div_s_w, | |
| 1059 | __builtin_msa_div_u_b, | |
| 1060 | __builtin_msa_div_u_d, | |
| 1061 | __builtin_msa_div_u_h, | |
| 1062 | __builtin_msa_div_u_w, | |
| 1063 | __builtin_msa_dotp_s_d, | |
| 1064 | __builtin_msa_dotp_s_h, | |
| 1065 | __builtin_msa_dotp_s_w, | |
| 1066 | __builtin_msa_dotp_u_d, | |
| 1067 | __builtin_msa_dotp_u_h, | |
| 1068 | __builtin_msa_dotp_u_w, | |
| 1069 | __builtin_msa_dpadd_s_d, | |
| 1070 | __builtin_msa_dpadd_s_h, | |
| 1071 | __builtin_msa_dpadd_s_w, | |
| 1072 | __builtin_msa_dpadd_u_d, | |
| 1073 | __builtin_msa_dpadd_u_h, | |
| 1074 | __builtin_msa_dpadd_u_w, | |
| 1075 | __builtin_msa_dpsub_s_d, | |
| 1076 | __builtin_msa_dpsub_s_h, | |
| 1077 | __builtin_msa_dpsub_s_w, | |
| 1078 | __builtin_msa_dpsub_u_d, | |
| 1079 | __builtin_msa_dpsub_u_h, | |
| 1080 | __builtin_msa_dpsub_u_w, | |
| 1081 | __builtin_msa_fadd_d, | |
| 1082 | __builtin_msa_fadd_w, | |
| 1083 | __builtin_msa_fcaf_d, | |
| 1084 | __builtin_msa_fcaf_w, | |
| 1085 | __builtin_msa_fceq_d, | |
| 1086 | __builtin_msa_fceq_w, | |
| 1087 | __builtin_msa_fclass_d, | |
| 1088 | __builtin_msa_fclass_w, | |
| 1089 | __builtin_msa_fcle_d, | |
| 1090 | __builtin_msa_fcle_w, | |
| 1091 | __builtin_msa_fclt_d, | |
| 1092 | __builtin_msa_fclt_w, | |
| 1093 | __builtin_msa_fcne_d, | |
| 1094 | __builtin_msa_fcne_w, | |
| 1095 | __builtin_msa_fcor_d, | |
| 1096 | __builtin_msa_fcor_w, | |
| 1097 | __builtin_msa_fcueq_d, | |
| 1098 | __builtin_msa_fcueq_w, | |
| 1099 | __builtin_msa_fcule_d, | |
| 1100 | __builtin_msa_fcule_w, | |
| 1101 | __builtin_msa_fcult_d, | |
| 1102 | __builtin_msa_fcult_w, | |
| 1103 | __builtin_msa_fcun_d, | |
| 1104 | __builtin_msa_fcun_w, | |
| 1105 | __builtin_msa_fcune_d, | |
| 1106 | __builtin_msa_fcune_w, | |
| 1107 | __builtin_msa_fdiv_d, | |
| 1108 | __builtin_msa_fdiv_w, | |
| 1109 | __builtin_msa_fexdo_h, | |
| 1110 | __builtin_msa_fexdo_w, | |
| 1111 | __builtin_msa_fexp2_d, | |
| 1112 | __builtin_msa_fexp2_w, | |
| 1113 | __builtin_msa_fexupl_d, | |
| 1114 | __builtin_msa_fexupl_w, | |
| 1115 | __builtin_msa_fexupr_d, | |
| 1116 | __builtin_msa_fexupr_w, | |
| 1117 | __builtin_msa_ffint_s_d, | |
| 1118 | __builtin_msa_ffint_s_w, | |
| 1119 | __builtin_msa_ffint_u_d, | |
| 1120 | __builtin_msa_ffint_u_w, | |
| 1121 | __builtin_msa_ffql_d, | |
| 1122 | __builtin_msa_ffql_w, | |
| 1123 | __builtin_msa_ffqr_d, | |
| 1124 | __builtin_msa_ffqr_w, | |
| 1125 | __builtin_msa_fill_b, | |
| 1126 | __builtin_msa_fill_d, | |
| 1127 | __builtin_msa_fill_h, | |
| 1128 | __builtin_msa_fill_w, | |
| 1129 | __builtin_msa_flog2_d, | |
| 1130 | __builtin_msa_flog2_w, | |
| 1131 | __builtin_msa_fmadd_d, | |
| 1132 | __builtin_msa_fmadd_w, | |
| 1133 | __builtin_msa_fmax_a_d, | |
| 1134 | __builtin_msa_fmax_a_w, | |
| 1135 | __builtin_msa_fmax_d, | |
| 1136 | __builtin_msa_fmax_w, | |
| 1137 | __builtin_msa_fmin_a_d, | |
| 1138 | __builtin_msa_fmin_a_w, | |
| 1139 | __builtin_msa_fmin_d, | |
| 1140 | __builtin_msa_fmin_w, | |
| 1141 | __builtin_msa_fmsub_d, | |
| 1142 | __builtin_msa_fmsub_w, | |
| 1143 | __builtin_msa_fmul_d, | |
| 1144 | __builtin_msa_fmul_w, | |
| 1145 | __builtin_msa_frcp_d, | |
| 1146 | __builtin_msa_frcp_w, | |
| 1147 | __builtin_msa_frint_d, | |
| 1148 | __builtin_msa_frint_w, | |
| 1149 | __builtin_msa_frsqrt_d, | |
| 1150 | __builtin_msa_frsqrt_w, | |
| 1151 | __builtin_msa_fsaf_d, | |
| 1152 | __builtin_msa_fsaf_w, | |
| 1153 | __builtin_msa_fseq_d, | |
| 1154 | __builtin_msa_fseq_w, | |
| 1155 | __builtin_msa_fsle_d, | |
| 1156 | __builtin_msa_fsle_w, | |
| 1157 | __builtin_msa_fslt_d, | |
| 1158 | __builtin_msa_fslt_w, | |
| 1159 | __builtin_msa_fsne_d, | |
| 1160 | __builtin_msa_fsne_w, | |
| 1161 | __builtin_msa_fsor_d, | |
| 1162 | __builtin_msa_fsor_w, | |
| 1163 | __builtin_msa_fsqrt_d, | |
| 1164 | __builtin_msa_fsqrt_w, | |
| 1165 | __builtin_msa_fsub_d, | |
| 1166 | __builtin_msa_fsub_w, | |
| 1167 | __builtin_msa_fsueq_d, | |
| 1168 | __builtin_msa_fsueq_w, | |
| 1169 | __builtin_msa_fsule_d, | |
| 1170 | __builtin_msa_fsule_w, | |
| 1171 | __builtin_msa_fsult_d, | |
| 1172 | __builtin_msa_fsult_w, | |
| 1173 | __builtin_msa_fsun_d, | |
| 1174 | __builtin_msa_fsun_w, | |
| 1175 | __builtin_msa_fsune_d, | |
| 1176 | __builtin_msa_fsune_w, | |
| 1177 | __builtin_msa_ftint_s_d, | |
| 1178 | __builtin_msa_ftint_s_w, | |
| 1179 | __builtin_msa_ftint_u_d, | |
| 1180 | __builtin_msa_ftint_u_w, | |
| 1181 | __builtin_msa_ftq_h, | |
| 1182 | __builtin_msa_ftq_w, | |
| 1183 | __builtin_msa_ftrunc_s_d, | |
| 1184 | __builtin_msa_ftrunc_s_w, | |
| 1185 | __builtin_msa_ftrunc_u_d, | |
| 1186 | __builtin_msa_ftrunc_u_w, | |
| 1187 | __builtin_msa_hadd_s_d, | |
| 1188 | __builtin_msa_hadd_s_h, | |
| 1189 | __builtin_msa_hadd_s_w, | |
| 1190 | __builtin_msa_hadd_u_d, | |
| 1191 | __builtin_msa_hadd_u_h, | |
| 1192 | __builtin_msa_hadd_u_w, | |
| 1193 | __builtin_msa_hsub_s_d, | |
| 1194 | __builtin_msa_hsub_s_h, | |
| 1195 | __builtin_msa_hsub_s_w, | |
| 1196 | __builtin_msa_hsub_u_d, | |
| 1197 | __builtin_msa_hsub_u_h, | |
| 1198 | __builtin_msa_hsub_u_w, | |
| 1199 | __builtin_msa_ilvev_b, | |
| 1200 | __builtin_msa_ilvev_d, | |
| 1201 | __builtin_msa_ilvev_h, | |
| 1202 | __builtin_msa_ilvev_w, | |
| 1203 | __builtin_msa_ilvl_b, | |
| 1204 | __builtin_msa_ilvl_d, | |
| 1205 | __builtin_msa_ilvl_h, | |
| 1206 | __builtin_msa_ilvl_w, | |
| 1207 | __builtin_msa_ilvod_b, | |
| 1208 | __builtin_msa_ilvod_d, | |
| 1209 | __builtin_msa_ilvod_h, | |
| 1210 | __builtin_msa_ilvod_w, | |
| 1211 | __builtin_msa_ilvr_b, | |
| 1212 | __builtin_msa_ilvr_d, | |
| 1213 | __builtin_msa_ilvr_h, | |
| 1214 | __builtin_msa_ilvr_w, | |
| 1215 | __builtin_msa_insert_b, | |
| 1216 | __builtin_msa_insert_d, | |
| 1217 | __builtin_msa_insert_h, | |
| 1218 | __builtin_msa_insert_w, | |
| 1219 | __builtin_msa_insve_b, | |
| 1220 | __builtin_msa_insve_d, | |
| 1221 | __builtin_msa_insve_h, | |
| 1222 | __builtin_msa_insve_w, | |
| 1223 | __builtin_msa_ld_b, | |
| 1224 | __builtin_msa_ld_d, | |
| 1225 | __builtin_msa_ld_h, | |
| 1226 | __builtin_msa_ld_w, | |
| 1227 | __builtin_msa_ldi_b, | |
| 1228 | __builtin_msa_ldi_d, | |
| 1229 | __builtin_msa_ldi_h, | |
| 1230 | __builtin_msa_ldi_w, | |
| 1231 | __builtin_msa_ldr_d, | |
| 1232 | __builtin_msa_ldr_w, | |
| 1233 | __builtin_msa_madd_q_h, | |
| 1234 | __builtin_msa_madd_q_w, | |
| 1235 | __builtin_msa_maddr_q_h, | |
| 1236 | __builtin_msa_maddr_q_w, | |
| 1237 | __builtin_msa_maddv_b, | |
| 1238 | __builtin_msa_maddv_d, | |
| 1239 | __builtin_msa_maddv_h, | |
| 1240 | __builtin_msa_maddv_w, | |
| 1241 | __builtin_msa_max_a_b, | |
| 1242 | __builtin_msa_max_a_d, | |
| 1243 | __builtin_msa_max_a_h, | |
| 1244 | __builtin_msa_max_a_w, | |
| 1245 | __builtin_msa_max_s_b, | |
| 1246 | __builtin_msa_max_s_d, | |
| 1247 | __builtin_msa_max_s_h, | |
| 1248 | __builtin_msa_max_s_w, | |
| 1249 | __builtin_msa_max_u_b, | |
| 1250 | __builtin_msa_max_u_d, | |
| 1251 | __builtin_msa_max_u_h, | |
| 1252 | __builtin_msa_max_u_w, | |
| 1253 | __builtin_msa_maxi_s_b, | |
| 1254 | __builtin_msa_maxi_s_d, | |
| 1255 | __builtin_msa_maxi_s_h, | |
| 1256 | __builtin_msa_maxi_s_w, | |
| 1257 | __builtin_msa_maxi_u_b, | |
| 1258 | __builtin_msa_maxi_u_d, | |
| 1259 | __builtin_msa_maxi_u_h, | |
| 1260 | __builtin_msa_maxi_u_w, | |
| 1261 | __builtin_msa_min_a_b, | |
| 1262 | __builtin_msa_min_a_d, | |
| 1263 | __builtin_msa_min_a_h, | |
| 1264 | __builtin_msa_min_a_w, | |
| 1265 | __builtin_msa_min_s_b, | |
| 1266 | __builtin_msa_min_s_d, | |
| 1267 | __builtin_msa_min_s_h, | |
| 1268 | __builtin_msa_min_s_w, | |
| 1269 | __builtin_msa_min_u_b, | |
| 1270 | __builtin_msa_min_u_d, | |
| 1271 | __builtin_msa_min_u_h, | |
| 1272 | __builtin_msa_min_u_w, | |
| 1273 | __builtin_msa_mini_s_b, | |
| 1274 | __builtin_msa_mini_s_d, | |
| 1275 | __builtin_msa_mini_s_h, | |
| 1276 | __builtin_msa_mini_s_w, | |
| 1277 | __builtin_msa_mini_u_b, | |
| 1278 | __builtin_msa_mini_u_d, | |
| 1279 | __builtin_msa_mini_u_h, | |
| 1280 | __builtin_msa_mini_u_w, | |
| 1281 | __builtin_msa_mod_s_b, | |
| 1282 | __builtin_msa_mod_s_d, | |
| 1283 | __builtin_msa_mod_s_h, | |
| 1284 | __builtin_msa_mod_s_w, | |
| 1285 | __builtin_msa_mod_u_b, | |
| 1286 | __builtin_msa_mod_u_d, | |
| 1287 | __builtin_msa_mod_u_h, | |
| 1288 | __builtin_msa_mod_u_w, | |
| 1289 | __builtin_msa_move_v, | |
| 1290 | __builtin_msa_msub_q_h, | |
| 1291 | __builtin_msa_msub_q_w, | |
| 1292 | __builtin_msa_msubr_q_h, | |
| 1293 | __builtin_msa_msubr_q_w, | |
| 1294 | __builtin_msa_msubv_b, | |
| 1295 | __builtin_msa_msubv_d, | |
| 1296 | __builtin_msa_msubv_h, | |
| 1297 | __builtin_msa_msubv_w, | |
| 1298 | __builtin_msa_mul_q_h, | |
| 1299 | __builtin_msa_mul_q_w, | |
| 1300 | __builtin_msa_mulr_q_h, | |
| 1301 | __builtin_msa_mulr_q_w, | |
| 1302 | __builtin_msa_mulv_b, | |
| 1303 | __builtin_msa_mulv_d, | |
| 1304 | __builtin_msa_mulv_h, | |
| 1305 | __builtin_msa_mulv_w, | |
| 1306 | __builtin_msa_nloc_b, | |
| 1307 | __builtin_msa_nloc_d, | |
| 1308 | __builtin_msa_nloc_h, | |
| 1309 | __builtin_msa_nloc_w, | |
| 1310 | __builtin_msa_nlzc_b, | |
| 1311 | __builtin_msa_nlzc_d, | |
| 1312 | __builtin_msa_nlzc_h, | |
| 1313 | __builtin_msa_nlzc_w, | |
| 1314 | __builtin_msa_nor_v, | |
| 1315 | __builtin_msa_nori_b, | |
| 1316 | __builtin_msa_or_v, | |
| 1317 | __builtin_msa_ori_b, | |
| 1318 | __builtin_msa_pckev_b, | |
| 1319 | __builtin_msa_pckev_d, | |
| 1320 | __builtin_msa_pckev_h, | |
| 1321 | __builtin_msa_pckev_w, | |
| 1322 | __builtin_msa_pckod_b, | |
| 1323 | __builtin_msa_pckod_d, | |
| 1324 | __builtin_msa_pckod_h, | |
| 1325 | __builtin_msa_pckod_w, | |
| 1326 | __builtin_msa_pcnt_b, | |
| 1327 | __builtin_msa_pcnt_d, | |
| 1328 | __builtin_msa_pcnt_h, | |
| 1329 | __builtin_msa_pcnt_w, | |
| 1330 | __builtin_msa_sat_s_b, | |
| 1331 | __builtin_msa_sat_s_d, | |
| 1332 | __builtin_msa_sat_s_h, | |
| 1333 | __builtin_msa_sat_s_w, | |
| 1334 | __builtin_msa_sat_u_b, | |
| 1335 | __builtin_msa_sat_u_d, | |
| 1336 | __builtin_msa_sat_u_h, | |
| 1337 | __builtin_msa_sat_u_w, | |
| 1338 | __builtin_msa_shf_b, | |
| 1339 | __builtin_msa_shf_h, | |
| 1340 | __builtin_msa_shf_w, | |
| 1341 | __builtin_msa_sld_b, | |
| 1342 | __builtin_msa_sld_d, | |
| 1343 | __builtin_msa_sld_h, | |
| 1344 | __builtin_msa_sld_w, | |
| 1345 | __builtin_msa_sldi_b, | |
| 1346 | __builtin_msa_sldi_d, | |
| 1347 | __builtin_msa_sldi_h, | |
| 1348 | __builtin_msa_sldi_w, | |
| 1349 | __builtin_msa_sll_b, | |
| 1350 | __builtin_msa_sll_d, | |
| 1351 | __builtin_msa_sll_h, | |
| 1352 | __builtin_msa_sll_w, | |
| 1353 | __builtin_msa_slli_b, | |
| 1354 | __builtin_msa_slli_d, | |
| 1355 | __builtin_msa_slli_h, | |
| 1356 | __builtin_msa_slli_w, | |
| 1357 | __builtin_msa_splat_b, | |
| 1358 | __builtin_msa_splat_d, | |
| 1359 | __builtin_msa_splat_h, | |
| 1360 | __builtin_msa_splat_w, | |
| 1361 | __builtin_msa_splati_b, | |
| 1362 | __builtin_msa_splati_d, | |
| 1363 | __builtin_msa_splati_h, | |
| 1364 | __builtin_msa_splati_w, | |
| 1365 | __builtin_msa_sra_b, | |
| 1366 | __builtin_msa_sra_d, | |
| 1367 | __builtin_msa_sra_h, | |
| 1368 | __builtin_msa_sra_w, | |
| 1369 | __builtin_msa_srai_b, | |
| 1370 | __builtin_msa_srai_d, | |
| 1371 | __builtin_msa_srai_h, | |
| 1372 | __builtin_msa_srai_w, | |
| 1373 | __builtin_msa_srar_b, | |
| 1374 | __builtin_msa_srar_d, | |
| 1375 | __builtin_msa_srar_h, | |
| 1376 | __builtin_msa_srar_w, | |
| 1377 | __builtin_msa_srari_b, | |
| 1378 | __builtin_msa_srari_d, | |
| 1379 | __builtin_msa_srari_h, | |
| 1380 | __builtin_msa_srari_w, | |
| 1381 | __builtin_msa_srl_b, | |
| 1382 | __builtin_msa_srl_d, | |
| 1383 | __builtin_msa_srl_h, | |
| 1384 | __builtin_msa_srl_w, | |
| 1385 | __builtin_msa_srli_b, | |
| 1386 | __builtin_msa_srli_d, | |
| 1387 | __builtin_msa_srli_h, | |
| 1388 | __builtin_msa_srli_w, | |
| 1389 | __builtin_msa_srlr_b, | |
| 1390 | __builtin_msa_srlr_d, | |
| 1391 | __builtin_msa_srlr_h, | |
| 1392 | __builtin_msa_srlr_w, | |
| 1393 | __builtin_msa_srlri_b, | |
| 1394 | __builtin_msa_srlri_d, | |
| 1395 | __builtin_msa_srlri_h, | |
| 1396 | __builtin_msa_srlri_w, | |
| 1397 | __builtin_msa_st_b, | |
| 1398 | __builtin_msa_st_d, | |
| 1399 | __builtin_msa_st_h, | |
| 1400 | __builtin_msa_st_w, | |
| 1401 | __builtin_msa_str_d, | |
| 1402 | __builtin_msa_str_w, | |
| 1403 | __builtin_msa_subs_s_b, | |
| 1404 | __builtin_msa_subs_s_d, | |
| 1405 | __builtin_msa_subs_s_h, | |
| 1406 | __builtin_msa_subs_s_w, | |
| 1407 | __builtin_msa_subs_u_b, | |
| 1408 | __builtin_msa_subs_u_d, | |
| 1409 | __builtin_msa_subs_u_h, | |
| 1410 | __builtin_msa_subs_u_w, | |
| 1411 | __builtin_msa_subsus_u_b, | |
| 1412 | __builtin_msa_subsus_u_d, | |
| 1413 | __builtin_msa_subsus_u_h, | |
| 1414 | __builtin_msa_subsus_u_w, | |
| 1415 | __builtin_msa_subsuu_s_b, | |
| 1416 | __builtin_msa_subsuu_s_d, | |
| 1417 | __builtin_msa_subsuu_s_h, | |
| 1418 | __builtin_msa_subsuu_s_w, | |
| 1419 | __builtin_msa_subv_b, | |
| 1420 | __builtin_msa_subv_d, | |
| 1421 | __builtin_msa_subv_h, | |
| 1422 | __builtin_msa_subv_w, | |
| 1423 | __builtin_msa_subvi_b, | |
| 1424 | __builtin_msa_subvi_d, | |
| 1425 | __builtin_msa_subvi_h, | |
| 1426 | __builtin_msa_subvi_w, | |
| 1427 | __builtin_msa_vshf_b, | |
| 1428 | __builtin_msa_vshf_d, | |
| 1429 | __builtin_msa_vshf_h, | |
| 1430 | __builtin_msa_vshf_w, | |
| 1431 | __builtin_msa_xor_v, | |
| 1432 | __builtin_msa_xori_b, | |
| 1433 | __builtin_mul_overflow, | |
| 1434 | __builtin_nan, | |
| 1435 | __builtin_nanf, | |
| 1436 | __builtin_nanf128, | |
| 1437 | __builtin_nanf16, | |
| 1438 | __builtin_nanl, | |
| 1439 | __builtin_nans, | |
| 1440 | __builtin_nansf, | |
| 1441 | __builtin_nansf128, | |
| 1442 | __builtin_nansf16, | |
| 1443 | __builtin_nansl, | |
| 1444 | __builtin_nearbyint, | |
| 1445 | __builtin_nearbyintf, | |
| 1446 | __builtin_nearbyintf128, | |
| 1447 | __builtin_nearbyintl, | |
| 1448 | __builtin_nextafter, | |
| 1449 | __builtin_nextafterf, | |
| 1450 | __builtin_nextafterf128, | |
| 1451 | __builtin_nextafterl, | |
| 1452 | __builtin_nexttoward, | |
| 1453 | __builtin_nexttowardf, | |
| 1454 | __builtin_nexttowardf128, | |
| 1455 | __builtin_nexttowardl, | |
| 1456 | __builtin_nondeterministic_value, | |
| 1457 | __builtin_nontemporal_load, | |
| 1458 | __builtin_nontemporal_store, | |
| 1459 | __builtin_objc_memmove_collectable, | |
| 1460 | __builtin_object_size, | |
| 1461 | __builtin_offsetof, | |
| 1462 | __builtin_operator_delete, | |
| 1463 | __builtin_operator_new, | |
| 1464 | __builtin_os_log_format, | |
| 1465 | __builtin_os_log_format_buffer_size, | |
| 1466 | __builtin_pack_longdouble, | |
| 1467 | __builtin_parity, | |
| 1468 | __builtin_parityl, | |
| 1469 | __builtin_parityll, | |
| 1470 | __builtin_popcount, | |
| 1471 | __builtin_popcountl, | |
| 1472 | __builtin_popcountll, | |
| 1473 | __builtin_pow, | |
| 1474 | __builtin_powf, | |
| 1475 | __builtin_powf128, | |
| 1476 | __builtin_powf16, | |
| 1477 | __builtin_powi, | |
| 1478 | __builtin_powif, | |
| 1479 | __builtin_powil, | |
| 1480 | __builtin_powl, | |
| 1481 | __builtin_ppc_alignx, | |
| 1482 | __builtin_ppc_cmpb, | |
| 1483 | __builtin_ppc_compare_and_swap, | |
| 1484 | __builtin_ppc_compare_and_swaplp, | |
| 1485 | __builtin_ppc_dcbfl, | |
| 1486 | __builtin_ppc_dcbflp, | |
| 1487 | __builtin_ppc_dcbst, | |
| 1488 | __builtin_ppc_dcbt, | |
| 1489 | __builtin_ppc_dcbtst, | |
| 1490 | __builtin_ppc_dcbtstt, | |
| 1491 | __builtin_ppc_dcbtt, | |
| 1492 | __builtin_ppc_dcbz, | |
| 1493 | __builtin_ppc_eieio, | |
| 1494 | __builtin_ppc_fcfid, | |
| 1495 | __builtin_ppc_fcfud, | |
| 1496 | __builtin_ppc_fctid, | |
| 1497 | __builtin_ppc_fctidz, | |
| 1498 | __builtin_ppc_fctiw, | |
| 1499 | __builtin_ppc_fctiwz, | |
| 1500 | __builtin_ppc_fctudz, | |
| 1501 | __builtin_ppc_fctuwz, | |
| 1502 | __builtin_ppc_fetch_and_add, | |
| 1503 | __builtin_ppc_fetch_and_addlp, | |
| 1504 | __builtin_ppc_fetch_and_and, | |
| 1505 | __builtin_ppc_fetch_and_andlp, | |
| 1506 | __builtin_ppc_fetch_and_or, | |
| 1507 | __builtin_ppc_fetch_and_orlp, | |
| 1508 | __builtin_ppc_fetch_and_swap, | |
| 1509 | __builtin_ppc_fetch_and_swaplp, | |
| 1510 | __builtin_ppc_fmsub, | |
| 1511 | __builtin_ppc_fmsubs, | |
| 1512 | __builtin_ppc_fnabs, | |
| 1513 | __builtin_ppc_fnabss, | |
| 1514 | __builtin_ppc_fnmadd, | |
| 1515 | __builtin_ppc_fnmadds, | |
| 1516 | __builtin_ppc_fnmsub, | |
| 1517 | __builtin_ppc_fnmsubs, | |
| 1518 | __builtin_ppc_fre, | |
| 1519 | __builtin_ppc_fres, | |
| 1520 | __builtin_ppc_fric, | |
| 1521 | __builtin_ppc_frim, | |
| 1522 | __builtin_ppc_frims, | |
| 1523 | __builtin_ppc_frin, | |
| 1524 | __builtin_ppc_frins, | |
| 1525 | __builtin_ppc_frip, | |
| 1526 | __builtin_ppc_frips, | |
| 1527 | __builtin_ppc_friz, | |
| 1528 | __builtin_ppc_frizs, | |
| 1529 | __builtin_ppc_frsqrte, | |
| 1530 | __builtin_ppc_frsqrtes, | |
| 1531 | __builtin_ppc_fsel, | |
| 1532 | __builtin_ppc_fsels, | |
| 1533 | __builtin_ppc_fsqrt, | |
| 1534 | __builtin_ppc_fsqrts, | |
| 1535 | __builtin_ppc_get_timebase, | |
| 1536 | __builtin_ppc_iospace_eieio, | |
| 1537 | __builtin_ppc_iospace_lwsync, | |
| 1538 | __builtin_ppc_iospace_sync, | |
| 1539 | __builtin_ppc_isync, | |
| 1540 | __builtin_ppc_ldarx, | |
| 1541 | __builtin_ppc_load2r, | |
| 1542 | __builtin_ppc_load4r, | |
| 1543 | __builtin_ppc_lwarx, | |
| 1544 | __builtin_ppc_lwsync, | |
| 1545 | __builtin_ppc_maxfe, | |
| 1546 | __builtin_ppc_maxfl, | |
| 1547 | __builtin_ppc_maxfs, | |
| 1548 | __builtin_ppc_mfmsr, | |
| 1549 | __builtin_ppc_mfspr, | |
| 1550 | __builtin_ppc_mftbu, | |
| 1551 | __builtin_ppc_minfe, | |
| 1552 | __builtin_ppc_minfl, | |
| 1553 | __builtin_ppc_minfs, | |
| 1554 | __builtin_ppc_mtfsb0, | |
| 1555 | __builtin_ppc_mtfsb1, | |
| 1556 | __builtin_ppc_mtfsf, | |
| 1557 | __builtin_ppc_mtfsfi, | |
| 1558 | __builtin_ppc_mtmsr, | |
| 1559 | __builtin_ppc_mtspr, | |
| 1560 | __builtin_ppc_mulhd, | |
| 1561 | __builtin_ppc_mulhdu, | |
| 1562 | __builtin_ppc_mulhw, | |
| 1563 | __builtin_ppc_mulhwu, | |
| 1564 | __builtin_ppc_popcntb, | |
| 1565 | __builtin_ppc_poppar4, | |
| 1566 | __builtin_ppc_poppar8, | |
| 1567 | __builtin_ppc_rdlam, | |
| 1568 | __builtin_ppc_recipdivd, | |
| 1569 | __builtin_ppc_recipdivf, | |
| 1570 | __builtin_ppc_rldimi, | |
| 1571 | __builtin_ppc_rlwimi, | |
| 1572 | __builtin_ppc_rlwnm, | |
| 1573 | __builtin_ppc_rsqrtd, | |
| 1574 | __builtin_ppc_rsqrtf, | |
| 1575 | __builtin_ppc_stdcx, | |
| 1576 | __builtin_ppc_stfiw, | |
| 1577 | __builtin_ppc_store2r, | |
| 1578 | __builtin_ppc_store4r, | |
| 1579 | __builtin_ppc_stwcx, | |
| 1580 | __builtin_ppc_swdiv, | |
| 1581 | __builtin_ppc_swdiv_nochk, | |
| 1582 | __builtin_ppc_swdivs, | |
| 1583 | __builtin_ppc_swdivs_nochk, | |
| 1584 | __builtin_ppc_sync, | |
| 1585 | __builtin_ppc_tdw, | |
| 1586 | __builtin_ppc_trap, | |
| 1587 | __builtin_ppc_trapd, | |
| 1588 | __builtin_ppc_tw, | |
| 1589 | __builtin_prefetch, | |
| 1590 | __builtin_preserve_access_index, | |
| 1591 | __builtin_printf, | |
| 1592 | __builtin_ptx_get_image_channel_data_typei_, | |
| 1593 | __builtin_ptx_get_image_channel_orderi_, | |
| 1594 | __builtin_ptx_get_image_depthi_, | |
| 1595 | __builtin_ptx_get_image_heighti_, | |
| 1596 | __builtin_ptx_get_image_widthi_, | |
| 1597 | __builtin_ptx_read_image2Dff_, | |
| 1598 | __builtin_ptx_read_image2Dfi_, | |
| 1599 | __builtin_ptx_read_image2Dif_, | |
| 1600 | __builtin_ptx_read_image2Dii_, | |
| 1601 | __builtin_ptx_read_image3Dff_, | |
| 1602 | __builtin_ptx_read_image3Dfi_, | |
| 1603 | __builtin_ptx_read_image3Dif_, | |
| 1604 | __builtin_ptx_read_image3Dii_, | |
| 1605 | __builtin_ptx_write_image2Df_, | |
| 1606 | __builtin_ptx_write_image2Di_, | |
| 1607 | __builtin_ptx_write_image2Dui_, | |
| 1608 | __builtin_r600_implicitarg_ptr, | |
| 1609 | __builtin_r600_read_tgid_x, | |
| 1610 | __builtin_r600_read_tgid_y, | |
| 1611 | __builtin_r600_read_tgid_z, | |
| 1612 | __builtin_r600_read_tidig_x, | |
| 1613 | __builtin_r600_read_tidig_y, | |
| 1614 | __builtin_r600_read_tidig_z, | |
| 1615 | __builtin_r600_recipsqrt_ieee, | |
| 1616 | __builtin_r600_recipsqrt_ieeef, | |
| 1617 | __builtin_readcyclecounter, | |
| 1618 | __builtin_readflm, | |
| 1619 | __builtin_realloc, | |
| 1620 | __builtin_reduce_add, | |
| 1621 | __builtin_reduce_and, | |
| 1622 | __builtin_reduce_max, | |
| 1623 | __builtin_reduce_min, | |
| 1624 | __builtin_reduce_mul, | |
| 1625 | __builtin_reduce_or, | |
| 1626 | __builtin_reduce_xor, | |
| 1627 | __builtin_remainder, | |
| 1628 | __builtin_remainderf, | |
| 1629 | __builtin_remainderf128, | |
| 1630 | __builtin_remainderl, | |
| 1631 | __builtin_remquo, | |
| 1632 | __builtin_remquof, | |
| 1633 | __builtin_remquof128, | |
| 1634 | __builtin_remquol, | |
| 1635 | __builtin_return_address, | |
| 1636 | __builtin_rindex, | |
| 1637 | __builtin_rint, | |
| 1638 | __builtin_rintf, | |
| 1639 | __builtin_rintf128, | |
| 1640 | __builtin_rintf16, | |
| 1641 | __builtin_rintl, | |
| 1642 | __builtin_rotateleft16, | |
| 1643 | __builtin_rotateleft32, | |
| 1644 | __builtin_rotateleft64, | |
| 1645 | __builtin_rotateleft8, | |
| 1646 | __builtin_rotateright16, | |
| 1647 | __builtin_rotateright32, | |
| 1648 | __builtin_rotateright64, | |
| 1649 | __builtin_rotateright8, | |
| 1650 | __builtin_round, | |
| 1651 | __builtin_roundeven, | |
| 1652 | __builtin_roundevenf, | |
| 1653 | __builtin_roundevenf128, | |
| 1654 | __builtin_roundevenf16, | |
| 1655 | __builtin_roundevenl, | |
| 1656 | __builtin_roundf, | |
| 1657 | __builtin_roundf128, | |
| 1658 | __builtin_roundf16, | |
| 1659 | __builtin_roundl, | |
| 1660 | __builtin_sadd_overflow, | |
| 1661 | __builtin_saddl_overflow, | |
| 1662 | __builtin_saddll_overflow, | |
| 1663 | __builtin_scalbln, | |
| 1664 | __builtin_scalblnf, | |
| 1665 | __builtin_scalblnf128, | |
| 1666 | __builtin_scalblnl, | |
| 1667 | __builtin_scalbn, | |
| 1668 | __builtin_scalbnf, | |
| 1669 | __builtin_scalbnf128, | |
| 1670 | __builtin_scalbnl, | |
| 1671 | __builtin_scanf, | |
| 1672 | __builtin_set_flt_rounds, | |
| 1673 | __builtin_setflm, | |
| 1674 | __builtin_setjmp, | |
| 1675 | __builtin_setps, | |
| 1676 | __builtin_setrnd, | |
| 1677 | __builtin_shufflevector, | |
| 1678 | __builtin_signbit, | |
| 1679 | __builtin_signbitf, | |
| 1680 | __builtin_signbitl, | |
| 1681 | __builtin_sin, | |
| 1682 | __builtin_sinf, | |
| 1683 | __builtin_sinf128, | |
| 1684 | __builtin_sinf16, | |
| 1685 | __builtin_sinh, | |
| 1686 | __builtin_sinhf, | |
| 1687 | __builtin_sinhf128, | |
| 1688 | __builtin_sinhl, | |
| 1689 | __builtin_sinl, | |
| 1690 | __builtin_smul_overflow, | |
| 1691 | __builtin_smull_overflow, | |
| 1692 | __builtin_smulll_overflow, | |
| 1693 | __builtin_snprintf, | |
| 1694 | __builtin_sponentry, | |
| 1695 | __builtin_sprintf, | |
| 1696 | __builtin_sqrt, | |
| 1697 | __builtin_sqrtf, | |
| 1698 | __builtin_sqrtf128, | |
| 1699 | __builtin_sqrtf16, | |
| 1700 | __builtin_sqrtl, | |
| 1701 | __builtin_sscanf, | |
| 1702 | __builtin_ssub_overflow, | |
| 1703 | __builtin_ssubl_overflow, | |
| 1704 | __builtin_ssubll_overflow, | |
| 1705 | __builtin_stdarg_start, | |
| 1706 | __builtin_stpcpy, | |
| 1707 | __builtin_stpncpy, | |
| 1708 | __builtin_strcasecmp, | |
| 1709 | __builtin_strcat, | |
| 1710 | __builtin_strchr, | |
| 1711 | __builtin_strcmp, | |
| 1712 | __builtin_strcpy, | |
| 1713 | __builtin_strcspn, | |
| 1714 | __builtin_strdup, | |
| 1715 | __builtin_strlen, | |
| 1716 | __builtin_strncasecmp, | |
| 1717 | __builtin_strncat, | |
| 1718 | __builtin_strncmp, | |
| 1719 | __builtin_strncpy, | |
| 1720 | __builtin_strndup, | |
| 1721 | __builtin_strpbrk, | |
| 1722 | __builtin_strrchr, | |
| 1723 | __builtin_strspn, | |
| 1724 | __builtin_strstr, | |
| 1725 | __builtin_sub_overflow, | |
| 1726 | __builtin_subc, | |
| 1727 | __builtin_subcb, | |
| 1728 | __builtin_subcl, | |
| 1729 | __builtin_subcll, | |
| 1730 | __builtin_subcs, | |
| 1731 | __builtin_tan, | |
| 1732 | __builtin_tanf, | |
| 1733 | __builtin_tanf128, | |
| 1734 | __builtin_tanh, | |
| 1735 | __builtin_tanhf, | |
| 1736 | __builtin_tanhf128, | |
| 1737 | __builtin_tanhl, | |
| 1738 | __builtin_tanl, | |
| 1739 | __builtin_tgamma, | |
| 1740 | __builtin_tgammaf, | |
| 1741 | __builtin_tgammaf128, | |
| 1742 | __builtin_tgammal, | |
| 1743 | __builtin_thread_pointer, | |
| 1744 | __builtin_trap, | |
| 1745 | __builtin_trunc, | |
| 1746 | __builtin_truncf, | |
| 1747 | __builtin_truncf128, | |
| 1748 | __builtin_truncf16, | |
| 1749 | __builtin_truncl, | |
| 1750 | __builtin_types_compatible_p, | |
| 1751 | __builtin_uadd_overflow, | |
| 1752 | __builtin_uaddl_overflow, | |
| 1753 | __builtin_uaddll_overflow, | |
| 1754 | __builtin_umul_overflow, | |
| 1755 | __builtin_umull_overflow, | |
| 1756 | __builtin_umulll_overflow, | |
| 1757 | __builtin_unpack_longdouble, | |
| 1758 | __builtin_unpredictable, | |
| 1759 | __builtin_unreachable, | |
| 1760 | __builtin_unwind_init, | |
| 1761 | __builtin_usub_overflow, | |
| 1762 | __builtin_usubl_overflow, | |
| 1763 | __builtin_usubll_overflow, | |
| 1764 | __builtin_va_arg, | |
| 1765 | __builtin_va_copy, | |
| 1766 | __builtin_va_end, | |
| 1767 | __builtin_va_start, | |
| 1768 | __builtin_ve_vl_andm_MMM, | |
| 1769 | __builtin_ve_vl_andm_mmm, | |
| 1770 | __builtin_ve_vl_eqvm_MMM, | |
| 1771 | __builtin_ve_vl_eqvm_mmm, | |
| 1772 | __builtin_ve_vl_extract_vm512l, | |
| 1773 | __builtin_ve_vl_extract_vm512u, | |
| 1774 | __builtin_ve_vl_fencec_s, | |
| 1775 | __builtin_ve_vl_fencei, | |
| 1776 | __builtin_ve_vl_fencem_s, | |
| 1777 | __builtin_ve_vl_fidcr_sss, | |
| 1778 | __builtin_ve_vl_insert_vm512l, | |
| 1779 | __builtin_ve_vl_insert_vm512u, | |
| 1780 | __builtin_ve_vl_lcr_sss, | |
| 1781 | __builtin_ve_vl_lsv_vvss, | |
| 1782 | __builtin_ve_vl_lvm_MMss, | |
| 1783 | __builtin_ve_vl_lvm_mmss, | |
| 1784 | __builtin_ve_vl_lvsd_svs, | |
| 1785 | __builtin_ve_vl_lvsl_svs, | |
| 1786 | __builtin_ve_vl_lvss_svs, | |
| 1787 | __builtin_ve_vl_lzvm_sml, | |
| 1788 | __builtin_ve_vl_negm_MM, | |
| 1789 | __builtin_ve_vl_negm_mm, | |
| 1790 | __builtin_ve_vl_nndm_MMM, | |
| 1791 | __builtin_ve_vl_nndm_mmm, | |
| 1792 | __builtin_ve_vl_orm_MMM, | |
| 1793 | __builtin_ve_vl_orm_mmm, | |
| 1794 | __builtin_ve_vl_pack_f32a, | |
| 1795 | __builtin_ve_vl_pack_f32p, | |
| 1796 | __builtin_ve_vl_pcvm_sml, | |
| 1797 | __builtin_ve_vl_pfchv_ssl, | |
| 1798 | __builtin_ve_vl_pfchvnc_ssl, | |
| 1799 | __builtin_ve_vl_pvadds_vsvMvl, | |
| 1800 | __builtin_ve_vl_pvadds_vsvl, | |
| 1801 | __builtin_ve_vl_pvadds_vsvvl, | |
| 1802 | __builtin_ve_vl_pvadds_vvvMvl, | |
| 1803 | __builtin_ve_vl_pvadds_vvvl, | |
| 1804 | __builtin_ve_vl_pvadds_vvvvl, | |
| 1805 | __builtin_ve_vl_pvaddu_vsvMvl, | |
| 1806 | __builtin_ve_vl_pvaddu_vsvl, | |
| 1807 | __builtin_ve_vl_pvaddu_vsvvl, | |
| 1808 | __builtin_ve_vl_pvaddu_vvvMvl, | |
| 1809 | __builtin_ve_vl_pvaddu_vvvl, | |
| 1810 | __builtin_ve_vl_pvaddu_vvvvl, | |
| 1811 | __builtin_ve_vl_pvand_vsvMvl, | |
| 1812 | __builtin_ve_vl_pvand_vsvl, | |
| 1813 | __builtin_ve_vl_pvand_vsvvl, | |
| 1814 | __builtin_ve_vl_pvand_vvvMvl, | |
| 1815 | __builtin_ve_vl_pvand_vvvl, | |
| 1816 | __builtin_ve_vl_pvand_vvvvl, | |
| 1817 | __builtin_ve_vl_pvbrd_vsMvl, | |
| 1818 | __builtin_ve_vl_pvbrd_vsl, | |
| 1819 | __builtin_ve_vl_pvbrd_vsvl, | |
| 1820 | __builtin_ve_vl_pvbrv_vvMvl, | |
| 1821 | __builtin_ve_vl_pvbrv_vvl, | |
| 1822 | __builtin_ve_vl_pvbrv_vvvl, | |
| 1823 | __builtin_ve_vl_pvbrvlo_vvl, | |
| 1824 | __builtin_ve_vl_pvbrvlo_vvmvl, | |
| 1825 | __builtin_ve_vl_pvbrvlo_vvvl, | |
| 1826 | __builtin_ve_vl_pvbrvup_vvl, | |
| 1827 | __builtin_ve_vl_pvbrvup_vvmvl, | |
| 1828 | __builtin_ve_vl_pvbrvup_vvvl, | |
| 1829 | __builtin_ve_vl_pvcmps_vsvMvl, | |
| 1830 | __builtin_ve_vl_pvcmps_vsvl, | |
| 1831 | __builtin_ve_vl_pvcmps_vsvvl, | |
| 1832 | __builtin_ve_vl_pvcmps_vvvMvl, | |
| 1833 | __builtin_ve_vl_pvcmps_vvvl, | |
| 1834 | __builtin_ve_vl_pvcmps_vvvvl, | |
| 1835 | __builtin_ve_vl_pvcmpu_vsvMvl, | |
| 1836 | __builtin_ve_vl_pvcmpu_vsvl, | |
| 1837 | __builtin_ve_vl_pvcmpu_vsvvl, | |
| 1838 | __builtin_ve_vl_pvcmpu_vvvMvl, | |
| 1839 | __builtin_ve_vl_pvcmpu_vvvl, | |
| 1840 | __builtin_ve_vl_pvcmpu_vvvvl, | |
| 1841 | __builtin_ve_vl_pvcvtsw_vvl, | |
| 1842 | __builtin_ve_vl_pvcvtsw_vvvl, | |
| 1843 | __builtin_ve_vl_pvcvtws_vvMvl, | |
| 1844 | __builtin_ve_vl_pvcvtws_vvl, | |
| 1845 | __builtin_ve_vl_pvcvtws_vvvl, | |
| 1846 | __builtin_ve_vl_pvcvtwsrz_vvMvl, | |
| 1847 | __builtin_ve_vl_pvcvtwsrz_vvl, | |
| 1848 | __builtin_ve_vl_pvcvtwsrz_vvvl, | |
| 1849 | __builtin_ve_vl_pveqv_vsvMvl, | |
| 1850 | __builtin_ve_vl_pveqv_vsvl, | |
| 1851 | __builtin_ve_vl_pveqv_vsvvl, | |
| 1852 | __builtin_ve_vl_pveqv_vvvMvl, | |
| 1853 | __builtin_ve_vl_pveqv_vvvl, | |
| 1854 | __builtin_ve_vl_pveqv_vvvvl, | |
| 1855 | __builtin_ve_vl_pvfadd_vsvMvl, | |
| 1856 | __builtin_ve_vl_pvfadd_vsvl, | |
| 1857 | __builtin_ve_vl_pvfadd_vsvvl, | |
| 1858 | __builtin_ve_vl_pvfadd_vvvMvl, | |
| 1859 | __builtin_ve_vl_pvfadd_vvvl, | |
| 1860 | __builtin_ve_vl_pvfadd_vvvvl, | |
| 1861 | __builtin_ve_vl_pvfcmp_vsvMvl, | |
| 1862 | __builtin_ve_vl_pvfcmp_vsvl, | |
| 1863 | __builtin_ve_vl_pvfcmp_vsvvl, | |
| 1864 | __builtin_ve_vl_pvfcmp_vvvMvl, | |
| 1865 | __builtin_ve_vl_pvfcmp_vvvl, | |
| 1866 | __builtin_ve_vl_pvfcmp_vvvvl, | |
| 1867 | __builtin_ve_vl_pvfmad_vsvvMvl, | |
| 1868 | __builtin_ve_vl_pvfmad_vsvvl, | |
| 1869 | __builtin_ve_vl_pvfmad_vsvvvl, | |
| 1870 | __builtin_ve_vl_pvfmad_vvsvMvl, | |
| 1871 | __builtin_ve_vl_pvfmad_vvsvl, | |
| 1872 | __builtin_ve_vl_pvfmad_vvsvvl, | |
| 1873 | __builtin_ve_vl_pvfmad_vvvvMvl, | |
| 1874 | __builtin_ve_vl_pvfmad_vvvvl, | |
| 1875 | __builtin_ve_vl_pvfmad_vvvvvl, | |
| 1876 | __builtin_ve_vl_pvfmax_vsvMvl, | |
| 1877 | __builtin_ve_vl_pvfmax_vsvl, | |
| 1878 | __builtin_ve_vl_pvfmax_vsvvl, | |
| 1879 | __builtin_ve_vl_pvfmax_vvvMvl, | |
| 1880 | __builtin_ve_vl_pvfmax_vvvl, | |
| 1881 | __builtin_ve_vl_pvfmax_vvvvl, | |
| 1882 | __builtin_ve_vl_pvfmin_vsvMvl, | |
| 1883 | __builtin_ve_vl_pvfmin_vsvl, | |
| 1884 | __builtin_ve_vl_pvfmin_vsvvl, | |
| 1885 | __builtin_ve_vl_pvfmin_vvvMvl, | |
| 1886 | __builtin_ve_vl_pvfmin_vvvl, | |
| 1887 | __builtin_ve_vl_pvfmin_vvvvl, | |
| 1888 | __builtin_ve_vl_pvfmkaf_Ml, | |
| 1889 | __builtin_ve_vl_pvfmkat_Ml, | |
| 1890 | __builtin_ve_vl_pvfmkseq_MvMl, | |
| 1891 | __builtin_ve_vl_pvfmkseq_Mvl, | |
| 1892 | __builtin_ve_vl_pvfmkseqnan_MvMl, | |
| 1893 | __builtin_ve_vl_pvfmkseqnan_Mvl, | |
| 1894 | __builtin_ve_vl_pvfmksge_MvMl, | |
| 1895 | __builtin_ve_vl_pvfmksge_Mvl, | |
| 1896 | __builtin_ve_vl_pvfmksgenan_MvMl, | |
| 1897 | __builtin_ve_vl_pvfmksgenan_Mvl, | |
| 1898 | __builtin_ve_vl_pvfmksgt_MvMl, | |
| 1899 | __builtin_ve_vl_pvfmksgt_Mvl, | |
| 1900 | __builtin_ve_vl_pvfmksgtnan_MvMl, | |
| 1901 | __builtin_ve_vl_pvfmksgtnan_Mvl, | |
| 1902 | __builtin_ve_vl_pvfmksle_MvMl, | |
| 1903 | __builtin_ve_vl_pvfmksle_Mvl, | |
| 1904 | __builtin_ve_vl_pvfmkslenan_MvMl, | |
| 1905 | __builtin_ve_vl_pvfmkslenan_Mvl, | |
| 1906 | __builtin_ve_vl_pvfmksloeq_mvl, | |
| 1907 | __builtin_ve_vl_pvfmksloeq_mvml, | |
| 1908 | __builtin_ve_vl_pvfmksloeqnan_mvl, | |
| 1909 | __builtin_ve_vl_pvfmksloeqnan_mvml, | |
| 1910 | __builtin_ve_vl_pvfmksloge_mvl, | |
| 1911 | __builtin_ve_vl_pvfmksloge_mvml, | |
| 1912 | __builtin_ve_vl_pvfmkslogenan_mvl, | |
| 1913 | __builtin_ve_vl_pvfmkslogenan_mvml, | |
| 1914 | __builtin_ve_vl_pvfmkslogt_mvl, | |
| 1915 | __builtin_ve_vl_pvfmkslogt_mvml, | |
| 1916 | __builtin_ve_vl_pvfmkslogtnan_mvl, | |
| 1917 | __builtin_ve_vl_pvfmkslogtnan_mvml, | |
| 1918 | __builtin_ve_vl_pvfmkslole_mvl, | |
| 1919 | __builtin_ve_vl_pvfmkslole_mvml, | |
| 1920 | __builtin_ve_vl_pvfmkslolenan_mvl, | |
| 1921 | __builtin_ve_vl_pvfmkslolenan_mvml, | |
| 1922 | __builtin_ve_vl_pvfmkslolt_mvl, | |
| 1923 | __builtin_ve_vl_pvfmkslolt_mvml, | |
| 1924 | __builtin_ve_vl_pvfmksloltnan_mvl, | |
| 1925 | __builtin_ve_vl_pvfmksloltnan_mvml, | |
| 1926 | __builtin_ve_vl_pvfmkslonan_mvl, | |
| 1927 | __builtin_ve_vl_pvfmkslonan_mvml, | |
| 1928 | __builtin_ve_vl_pvfmkslone_mvl, | |
| 1929 | __builtin_ve_vl_pvfmkslone_mvml, | |
| 1930 | __builtin_ve_vl_pvfmkslonenan_mvl, | |
| 1931 | __builtin_ve_vl_pvfmkslonenan_mvml, | |
| 1932 | __builtin_ve_vl_pvfmkslonum_mvl, | |
| 1933 | __builtin_ve_vl_pvfmkslonum_mvml, | |
| 1934 | __builtin_ve_vl_pvfmkslt_MvMl, | |
| 1935 | __builtin_ve_vl_pvfmkslt_Mvl, | |
| 1936 | __builtin_ve_vl_pvfmksltnan_MvMl, | |
| 1937 | __builtin_ve_vl_pvfmksltnan_Mvl, | |
| 1938 | __builtin_ve_vl_pvfmksnan_MvMl, | |
| 1939 | __builtin_ve_vl_pvfmksnan_Mvl, | |
| 1940 | __builtin_ve_vl_pvfmksne_MvMl, | |
| 1941 | __builtin_ve_vl_pvfmksne_Mvl, | |
| 1942 | __builtin_ve_vl_pvfmksnenan_MvMl, | |
| 1943 | __builtin_ve_vl_pvfmksnenan_Mvl, | |
| 1944 | __builtin_ve_vl_pvfmksnum_MvMl, | |
| 1945 | __builtin_ve_vl_pvfmksnum_Mvl, | |
| 1946 | __builtin_ve_vl_pvfmksupeq_mvl, | |
| 1947 | __builtin_ve_vl_pvfmksupeq_mvml, | |
| 1948 | __builtin_ve_vl_pvfmksupeqnan_mvl, | |
| 1949 | __builtin_ve_vl_pvfmksupeqnan_mvml, | |
| 1950 | __builtin_ve_vl_pvfmksupge_mvl, | |
| 1951 | __builtin_ve_vl_pvfmksupge_mvml, | |
| 1952 | __builtin_ve_vl_pvfmksupgenan_mvl, | |
| 1953 | __builtin_ve_vl_pvfmksupgenan_mvml, | |
| 1954 | __builtin_ve_vl_pvfmksupgt_mvl, | |
| 1955 | __builtin_ve_vl_pvfmksupgt_mvml, | |
| 1956 | __builtin_ve_vl_pvfmksupgtnan_mvl, | |
| 1957 | __builtin_ve_vl_pvfmksupgtnan_mvml, | |
| 1958 | __builtin_ve_vl_pvfmksuple_mvl, | |
| 1959 | __builtin_ve_vl_pvfmksuple_mvml, | |
| 1960 | __builtin_ve_vl_pvfmksuplenan_mvl, | |
| 1961 | __builtin_ve_vl_pvfmksuplenan_mvml, | |
| 1962 | __builtin_ve_vl_pvfmksuplt_mvl, | |
| 1963 | __builtin_ve_vl_pvfmksuplt_mvml, | |
| 1964 | __builtin_ve_vl_pvfmksupltnan_mvl, | |
| 1965 | __builtin_ve_vl_pvfmksupltnan_mvml, | |
| 1966 | __builtin_ve_vl_pvfmksupnan_mvl, | |
| 1967 | __builtin_ve_vl_pvfmksupnan_mvml, | |
| 1968 | __builtin_ve_vl_pvfmksupne_mvl, | |
| 1969 | __builtin_ve_vl_pvfmksupne_mvml, | |
| 1970 | __builtin_ve_vl_pvfmksupnenan_mvl, | |
| 1971 | __builtin_ve_vl_pvfmksupnenan_mvml, | |
| 1972 | __builtin_ve_vl_pvfmksupnum_mvl, | |
| 1973 | __builtin_ve_vl_pvfmksupnum_mvml, | |
| 1974 | __builtin_ve_vl_pvfmkweq_MvMl, | |
| 1975 | __builtin_ve_vl_pvfmkweq_Mvl, | |
| 1976 | __builtin_ve_vl_pvfmkweqnan_MvMl, | |
| 1977 | __builtin_ve_vl_pvfmkweqnan_Mvl, | |
| 1978 | __builtin_ve_vl_pvfmkwge_MvMl, | |
| 1979 | __builtin_ve_vl_pvfmkwge_Mvl, | |
| 1980 | __builtin_ve_vl_pvfmkwgenan_MvMl, | |
| 1981 | __builtin_ve_vl_pvfmkwgenan_Mvl, | |
| 1982 | __builtin_ve_vl_pvfmkwgt_MvMl, | |
| 1983 | __builtin_ve_vl_pvfmkwgt_Mvl, | |
| 1984 | __builtin_ve_vl_pvfmkwgtnan_MvMl, | |
| 1985 | __builtin_ve_vl_pvfmkwgtnan_Mvl, | |
| 1986 | __builtin_ve_vl_pvfmkwle_MvMl, | |
| 1987 | __builtin_ve_vl_pvfmkwle_Mvl, | |
| 1988 | __builtin_ve_vl_pvfmkwlenan_MvMl, | |
| 1989 | __builtin_ve_vl_pvfmkwlenan_Mvl, | |
| 1990 | __builtin_ve_vl_pvfmkwloeq_mvl, | |
| 1991 | __builtin_ve_vl_pvfmkwloeq_mvml, | |
| 1992 | __builtin_ve_vl_pvfmkwloeqnan_mvl, | |
| 1993 | __builtin_ve_vl_pvfmkwloeqnan_mvml, | |
| 1994 | __builtin_ve_vl_pvfmkwloge_mvl, | |
| 1995 | __builtin_ve_vl_pvfmkwloge_mvml, | |
| 1996 | __builtin_ve_vl_pvfmkwlogenan_mvl, | |
| 1997 | __builtin_ve_vl_pvfmkwlogenan_mvml, | |
| 1998 | __builtin_ve_vl_pvfmkwlogt_mvl, | |
| 1999 | __builtin_ve_vl_pvfmkwlogt_mvml, | |
| 2000 | __builtin_ve_vl_pvfmkwlogtnan_mvl, | |
| 2001 | __builtin_ve_vl_pvfmkwlogtnan_mvml, | |
| 2002 | __builtin_ve_vl_pvfmkwlole_mvl, | |
| 2003 | __builtin_ve_vl_pvfmkwlole_mvml, | |
| 2004 | __builtin_ve_vl_pvfmkwlolenan_mvl, | |
| 2005 | __builtin_ve_vl_pvfmkwlolenan_mvml, | |
| 2006 | __builtin_ve_vl_pvfmkwlolt_mvl, | |
| 2007 | __builtin_ve_vl_pvfmkwlolt_mvml, | |
| 2008 | __builtin_ve_vl_pvfmkwloltnan_mvl, | |
| 2009 | __builtin_ve_vl_pvfmkwloltnan_mvml, | |
| 2010 | __builtin_ve_vl_pvfmkwlonan_mvl, | |
| 2011 | __builtin_ve_vl_pvfmkwlonan_mvml, | |
| 2012 | __builtin_ve_vl_pvfmkwlone_mvl, | |
| 2013 | __builtin_ve_vl_pvfmkwlone_mvml, | |
| 2014 | __builtin_ve_vl_pvfmkwlonenan_mvl, | |
| 2015 | __builtin_ve_vl_pvfmkwlonenan_mvml, | |
| 2016 | __builtin_ve_vl_pvfmkwlonum_mvl, | |
| 2017 | __builtin_ve_vl_pvfmkwlonum_mvml, | |
| 2018 | __builtin_ve_vl_pvfmkwlt_MvMl, | |
| 2019 | __builtin_ve_vl_pvfmkwlt_Mvl, | |
| 2020 | __builtin_ve_vl_pvfmkwltnan_MvMl, | |
| 2021 | __builtin_ve_vl_pvfmkwltnan_Mvl, | |
| 2022 | __builtin_ve_vl_pvfmkwnan_MvMl, | |
| 2023 | __builtin_ve_vl_pvfmkwnan_Mvl, | |
| 2024 | __builtin_ve_vl_pvfmkwne_MvMl, | |
| 2025 | __builtin_ve_vl_pvfmkwne_Mvl, | |
| 2026 | __builtin_ve_vl_pvfmkwnenan_MvMl, | |
| 2027 | __builtin_ve_vl_pvfmkwnenan_Mvl, | |
| 2028 | __builtin_ve_vl_pvfmkwnum_MvMl, | |
| 2029 | __builtin_ve_vl_pvfmkwnum_Mvl, | |
| 2030 | __builtin_ve_vl_pvfmkwupeq_mvl, | |
| 2031 | __builtin_ve_vl_pvfmkwupeq_mvml, | |
| 2032 | __builtin_ve_vl_pvfmkwupeqnan_mvl, | |
| 2033 | __builtin_ve_vl_pvfmkwupeqnan_mvml, | |
| 2034 | __builtin_ve_vl_pvfmkwupge_mvl, | |
| 2035 | __builtin_ve_vl_pvfmkwupge_mvml, | |
| 2036 | __builtin_ve_vl_pvfmkwupgenan_mvl, | |
| 2037 | __builtin_ve_vl_pvfmkwupgenan_mvml, | |
| 2038 | __builtin_ve_vl_pvfmkwupgt_mvl, | |
| 2039 | __builtin_ve_vl_pvfmkwupgt_mvml, | |
| 2040 | __builtin_ve_vl_pvfmkwupgtnan_mvl, | |
| 2041 | __builtin_ve_vl_pvfmkwupgtnan_mvml, | |
| 2042 | __builtin_ve_vl_pvfmkwuple_mvl, | |
| 2043 | __builtin_ve_vl_pvfmkwuple_mvml, | |
| 2044 | __builtin_ve_vl_pvfmkwuplenan_mvl, | |
| 2045 | __builtin_ve_vl_pvfmkwuplenan_mvml, | |
| 2046 | __builtin_ve_vl_pvfmkwuplt_mvl, | |
| 2047 | __builtin_ve_vl_pvfmkwuplt_mvml, | |
| 2048 | __builtin_ve_vl_pvfmkwupltnan_mvl, | |
| 2049 | __builtin_ve_vl_pvfmkwupltnan_mvml, | |
| 2050 | __builtin_ve_vl_pvfmkwupnan_mvl, | |
| 2051 | __builtin_ve_vl_pvfmkwupnan_mvml, | |
| 2052 | __builtin_ve_vl_pvfmkwupne_mvl, | |
| 2053 | __builtin_ve_vl_pvfmkwupne_mvml, | |
| 2054 | __builtin_ve_vl_pvfmkwupnenan_mvl, | |
| 2055 | __builtin_ve_vl_pvfmkwupnenan_mvml, | |
| 2056 | __builtin_ve_vl_pvfmkwupnum_mvl, | |
| 2057 | __builtin_ve_vl_pvfmkwupnum_mvml, | |
| 2058 | __builtin_ve_vl_pvfmsb_vsvvMvl, | |
| 2059 | __builtin_ve_vl_pvfmsb_vsvvl, | |
| 2060 | __builtin_ve_vl_pvfmsb_vsvvvl, | |
| 2061 | __builtin_ve_vl_pvfmsb_vvsvMvl, | |
| 2062 | __builtin_ve_vl_pvfmsb_vvsvl, | |
| 2063 | __builtin_ve_vl_pvfmsb_vvsvvl, | |
| 2064 | __builtin_ve_vl_pvfmsb_vvvvMvl, | |
| 2065 | __builtin_ve_vl_pvfmsb_vvvvl, | |
| 2066 | __builtin_ve_vl_pvfmsb_vvvvvl, | |
| 2067 | __builtin_ve_vl_pvfmul_vsvMvl, | |
| 2068 | __builtin_ve_vl_pvfmul_vsvl, | |
| 2069 | __builtin_ve_vl_pvfmul_vsvvl, | |
| 2070 | __builtin_ve_vl_pvfmul_vvvMvl, | |
| 2071 | __builtin_ve_vl_pvfmul_vvvl, | |
| 2072 | __builtin_ve_vl_pvfmul_vvvvl, | |
| 2073 | __builtin_ve_vl_pvfnmad_vsvvMvl, | |
| 2074 | __builtin_ve_vl_pvfnmad_vsvvl, | |
| 2075 | __builtin_ve_vl_pvfnmad_vsvvvl, | |
| 2076 | __builtin_ve_vl_pvfnmad_vvsvMvl, | |
| 2077 | __builtin_ve_vl_pvfnmad_vvsvl, | |
| 2078 | __builtin_ve_vl_pvfnmad_vvsvvl, | |
| 2079 | __builtin_ve_vl_pvfnmad_vvvvMvl, | |
| 2080 | __builtin_ve_vl_pvfnmad_vvvvl, | |
| 2081 | __builtin_ve_vl_pvfnmad_vvvvvl, | |
| 2082 | __builtin_ve_vl_pvfnmsb_vsvvMvl, | |
| 2083 | __builtin_ve_vl_pvfnmsb_vsvvl, | |
| 2084 | __builtin_ve_vl_pvfnmsb_vsvvvl, | |
| 2085 | __builtin_ve_vl_pvfnmsb_vvsvMvl, | |
| 2086 | __builtin_ve_vl_pvfnmsb_vvsvl, | |
| 2087 | __builtin_ve_vl_pvfnmsb_vvsvvl, | |
| 2088 | __builtin_ve_vl_pvfnmsb_vvvvMvl, | |
| 2089 | __builtin_ve_vl_pvfnmsb_vvvvl, | |
| 2090 | __builtin_ve_vl_pvfnmsb_vvvvvl, | |
| 2091 | __builtin_ve_vl_pvfsub_vsvMvl, | |
| 2092 | __builtin_ve_vl_pvfsub_vsvl, | |
| 2093 | __builtin_ve_vl_pvfsub_vsvvl, | |
| 2094 | __builtin_ve_vl_pvfsub_vvvMvl, | |
| 2095 | __builtin_ve_vl_pvfsub_vvvl, | |
| 2096 | __builtin_ve_vl_pvfsub_vvvvl, | |
| 2097 | __builtin_ve_vl_pvldz_vvMvl, | |
| 2098 | __builtin_ve_vl_pvldz_vvl, | |
| 2099 | __builtin_ve_vl_pvldz_vvvl, | |
| 2100 | __builtin_ve_vl_pvldzlo_vvl, | |
| 2101 | __builtin_ve_vl_pvldzlo_vvmvl, | |
| 2102 | __builtin_ve_vl_pvldzlo_vvvl, | |
| 2103 | __builtin_ve_vl_pvldzup_vvl, | |
| 2104 | __builtin_ve_vl_pvldzup_vvmvl, | |
| 2105 | __builtin_ve_vl_pvldzup_vvvl, | |
| 2106 | __builtin_ve_vl_pvmaxs_vsvMvl, | |
| 2107 | __builtin_ve_vl_pvmaxs_vsvl, | |
| 2108 | __builtin_ve_vl_pvmaxs_vsvvl, | |
| 2109 | __builtin_ve_vl_pvmaxs_vvvMvl, | |
| 2110 | __builtin_ve_vl_pvmaxs_vvvl, | |
| 2111 | __builtin_ve_vl_pvmaxs_vvvvl, | |
| 2112 | __builtin_ve_vl_pvmins_vsvMvl, | |
| 2113 | __builtin_ve_vl_pvmins_vsvl, | |
| 2114 | __builtin_ve_vl_pvmins_vsvvl, | |
| 2115 | __builtin_ve_vl_pvmins_vvvMvl, | |
| 2116 | __builtin_ve_vl_pvmins_vvvl, | |
| 2117 | __builtin_ve_vl_pvmins_vvvvl, | |
| 2118 | __builtin_ve_vl_pvor_vsvMvl, | |
| 2119 | __builtin_ve_vl_pvor_vsvl, | |
| 2120 | __builtin_ve_vl_pvor_vsvvl, | |
| 2121 | __builtin_ve_vl_pvor_vvvMvl, | |
| 2122 | __builtin_ve_vl_pvor_vvvl, | |
| 2123 | __builtin_ve_vl_pvor_vvvvl, | |
| 2124 | __builtin_ve_vl_pvpcnt_vvMvl, | |
| 2125 | __builtin_ve_vl_pvpcnt_vvl, | |
| 2126 | __builtin_ve_vl_pvpcnt_vvvl, | |
| 2127 | __builtin_ve_vl_pvpcntlo_vvl, | |
| 2128 | __builtin_ve_vl_pvpcntlo_vvmvl, | |
| 2129 | __builtin_ve_vl_pvpcntlo_vvvl, | |
| 2130 | __builtin_ve_vl_pvpcntup_vvl, | |
| 2131 | __builtin_ve_vl_pvpcntup_vvmvl, | |
| 2132 | __builtin_ve_vl_pvpcntup_vvvl, | |
| 2133 | __builtin_ve_vl_pvrcp_vvl, | |
| 2134 | __builtin_ve_vl_pvrcp_vvvl, | |
| 2135 | __builtin_ve_vl_pvrsqrt_vvl, | |
| 2136 | __builtin_ve_vl_pvrsqrt_vvvl, | |
| 2137 | __builtin_ve_vl_pvrsqrtnex_vvl, | |
| 2138 | __builtin_ve_vl_pvrsqrtnex_vvvl, | |
| 2139 | __builtin_ve_vl_pvseq_vl, | |
| 2140 | __builtin_ve_vl_pvseq_vvl, | |
| 2141 | __builtin_ve_vl_pvseqlo_vl, | |
| 2142 | __builtin_ve_vl_pvseqlo_vvl, | |
| 2143 | __builtin_ve_vl_pvsequp_vl, | |
| 2144 | __builtin_ve_vl_pvsequp_vvl, | |
| 2145 | __builtin_ve_vl_pvsla_vvsMvl, | |
| 2146 | __builtin_ve_vl_pvsla_vvsl, | |
| 2147 | __builtin_ve_vl_pvsla_vvsvl, | |
| 2148 | __builtin_ve_vl_pvsla_vvvMvl, | |
| 2149 | __builtin_ve_vl_pvsla_vvvl, | |
| 2150 | __builtin_ve_vl_pvsla_vvvvl, | |
| 2151 | __builtin_ve_vl_pvsll_vvsMvl, | |
| 2152 | __builtin_ve_vl_pvsll_vvsl, | |
| 2153 | __builtin_ve_vl_pvsll_vvsvl, | |
| 2154 | __builtin_ve_vl_pvsll_vvvMvl, | |
| 2155 | __builtin_ve_vl_pvsll_vvvl, | |
| 2156 | __builtin_ve_vl_pvsll_vvvvl, | |
| 2157 | __builtin_ve_vl_pvsra_vvsMvl, | |
| 2158 | __builtin_ve_vl_pvsra_vvsl, | |
| 2159 | __builtin_ve_vl_pvsra_vvsvl, | |
| 2160 | __builtin_ve_vl_pvsra_vvvMvl, | |
| 2161 | __builtin_ve_vl_pvsra_vvvl, | |
| 2162 | __builtin_ve_vl_pvsra_vvvvl, | |
| 2163 | __builtin_ve_vl_pvsrl_vvsMvl, | |
| 2164 | __builtin_ve_vl_pvsrl_vvsl, | |
| 2165 | __builtin_ve_vl_pvsrl_vvsvl, | |
| 2166 | __builtin_ve_vl_pvsrl_vvvMvl, | |
| 2167 | __builtin_ve_vl_pvsrl_vvvl, | |
| 2168 | __builtin_ve_vl_pvsrl_vvvvl, | |
| 2169 | __builtin_ve_vl_pvsubs_vsvMvl, | |
| 2170 | __builtin_ve_vl_pvsubs_vsvl, | |
| 2171 | __builtin_ve_vl_pvsubs_vsvvl, | |
| 2172 | __builtin_ve_vl_pvsubs_vvvMvl, | |
| 2173 | __builtin_ve_vl_pvsubs_vvvl, | |
| 2174 | __builtin_ve_vl_pvsubs_vvvvl, | |
| 2175 | __builtin_ve_vl_pvsubu_vsvMvl, | |
| 2176 | __builtin_ve_vl_pvsubu_vsvl, | |
| 2177 | __builtin_ve_vl_pvsubu_vsvvl, | |
| 2178 | __builtin_ve_vl_pvsubu_vvvMvl, | |
| 2179 | __builtin_ve_vl_pvsubu_vvvl, | |
| 2180 | __builtin_ve_vl_pvsubu_vvvvl, | |
| 2181 | __builtin_ve_vl_pvxor_vsvMvl, | |
| 2182 | __builtin_ve_vl_pvxor_vsvl, | |
| 2183 | __builtin_ve_vl_pvxor_vsvvl, | |
| 2184 | __builtin_ve_vl_pvxor_vvvMvl, | |
| 2185 | __builtin_ve_vl_pvxor_vvvl, | |
| 2186 | __builtin_ve_vl_pvxor_vvvvl, | |
| 2187 | __builtin_ve_vl_scr_sss, | |
| 2188 | __builtin_ve_vl_svm_sMs, | |
| 2189 | __builtin_ve_vl_svm_sms, | |
| 2190 | __builtin_ve_vl_svob, | |
| 2191 | __builtin_ve_vl_tovm_sml, | |
| 2192 | __builtin_ve_vl_tscr_ssss, | |
| 2193 | __builtin_ve_vl_vaddsl_vsvl, | |
| 2194 | __builtin_ve_vl_vaddsl_vsvmvl, | |
| 2195 | __builtin_ve_vl_vaddsl_vsvvl, | |
| 2196 | __builtin_ve_vl_vaddsl_vvvl, | |
| 2197 | __builtin_ve_vl_vaddsl_vvvmvl, | |
| 2198 | __builtin_ve_vl_vaddsl_vvvvl, | |
| 2199 | __builtin_ve_vl_vaddswsx_vsvl, | |
| 2200 | __builtin_ve_vl_vaddswsx_vsvmvl, | |
| 2201 | __builtin_ve_vl_vaddswsx_vsvvl, | |
| 2202 | __builtin_ve_vl_vaddswsx_vvvl, | |
| 2203 | __builtin_ve_vl_vaddswsx_vvvmvl, | |
| 2204 | __builtin_ve_vl_vaddswsx_vvvvl, | |
| 2205 | __builtin_ve_vl_vaddswzx_vsvl, | |
| 2206 | __builtin_ve_vl_vaddswzx_vsvmvl, | |
| 2207 | __builtin_ve_vl_vaddswzx_vsvvl, | |
| 2208 | __builtin_ve_vl_vaddswzx_vvvl, | |
| 2209 | __builtin_ve_vl_vaddswzx_vvvmvl, | |
| 2210 | __builtin_ve_vl_vaddswzx_vvvvl, | |
| 2211 | __builtin_ve_vl_vaddul_vsvl, | |
| 2212 | __builtin_ve_vl_vaddul_vsvmvl, | |
| 2213 | __builtin_ve_vl_vaddul_vsvvl, | |
| 2214 | __builtin_ve_vl_vaddul_vvvl, | |
| 2215 | __builtin_ve_vl_vaddul_vvvmvl, | |
| 2216 | __builtin_ve_vl_vaddul_vvvvl, | |
| 2217 | __builtin_ve_vl_vadduw_vsvl, | |
| 2218 | __builtin_ve_vl_vadduw_vsvmvl, | |
| 2219 | __builtin_ve_vl_vadduw_vsvvl, | |
| 2220 | __builtin_ve_vl_vadduw_vvvl, | |
| 2221 | __builtin_ve_vl_vadduw_vvvmvl, | |
| 2222 | __builtin_ve_vl_vadduw_vvvvl, | |
| 2223 | __builtin_ve_vl_vand_vsvl, | |
| 2224 | __builtin_ve_vl_vand_vsvmvl, | |
| 2225 | __builtin_ve_vl_vand_vsvvl, | |
| 2226 | __builtin_ve_vl_vand_vvvl, | |
| 2227 | __builtin_ve_vl_vand_vvvmvl, | |
| 2228 | __builtin_ve_vl_vand_vvvvl, | |
| 2229 | __builtin_ve_vl_vbrdd_vsl, | |
| 2230 | __builtin_ve_vl_vbrdd_vsmvl, | |
| 2231 | __builtin_ve_vl_vbrdd_vsvl, | |
| 2232 | __builtin_ve_vl_vbrdl_vsl, | |
| 2233 | __builtin_ve_vl_vbrdl_vsmvl, | |
| 2234 | __builtin_ve_vl_vbrdl_vsvl, | |
| 2235 | __builtin_ve_vl_vbrds_vsl, | |
| 2236 | __builtin_ve_vl_vbrds_vsmvl, | |
| 2237 | __builtin_ve_vl_vbrds_vsvl, | |
| 2238 | __builtin_ve_vl_vbrdw_vsl, | |
| 2239 | __builtin_ve_vl_vbrdw_vsmvl, | |
| 2240 | __builtin_ve_vl_vbrdw_vsvl, | |
| 2241 | __builtin_ve_vl_vbrv_vvl, | |
| 2242 | __builtin_ve_vl_vbrv_vvmvl, | |
| 2243 | __builtin_ve_vl_vbrv_vvvl, | |
| 2244 | __builtin_ve_vl_vcmpsl_vsvl, | |
| 2245 | __builtin_ve_vl_vcmpsl_vsvmvl, | |
| 2246 | __builtin_ve_vl_vcmpsl_vsvvl, | |
| 2247 | __builtin_ve_vl_vcmpsl_vvvl, | |
| 2248 | __builtin_ve_vl_vcmpsl_vvvmvl, | |
| 2249 | __builtin_ve_vl_vcmpsl_vvvvl, | |
| 2250 | __builtin_ve_vl_vcmpswsx_vsvl, | |
| 2251 | __builtin_ve_vl_vcmpswsx_vsvmvl, | |
| 2252 | __builtin_ve_vl_vcmpswsx_vsvvl, | |
| 2253 | __builtin_ve_vl_vcmpswsx_vvvl, | |
| 2254 | __builtin_ve_vl_vcmpswsx_vvvmvl, | |
| 2255 | __builtin_ve_vl_vcmpswsx_vvvvl, | |
| 2256 | __builtin_ve_vl_vcmpswzx_vsvl, | |
| 2257 | __builtin_ve_vl_vcmpswzx_vsvmvl, | |
| 2258 | __builtin_ve_vl_vcmpswzx_vsvvl, | |
| 2259 | __builtin_ve_vl_vcmpswzx_vvvl, | |
| 2260 | __builtin_ve_vl_vcmpswzx_vvvmvl, | |
| 2261 | __builtin_ve_vl_vcmpswzx_vvvvl, | |
| 2262 | __builtin_ve_vl_vcmpul_vsvl, | |
| 2263 | __builtin_ve_vl_vcmpul_vsvmvl, | |
| 2264 | __builtin_ve_vl_vcmpul_vsvvl, | |
| 2265 | __builtin_ve_vl_vcmpul_vvvl, | |
| 2266 | __builtin_ve_vl_vcmpul_vvvmvl, | |
| 2267 | __builtin_ve_vl_vcmpul_vvvvl, | |
| 2268 | __builtin_ve_vl_vcmpuw_vsvl, | |
| 2269 | __builtin_ve_vl_vcmpuw_vsvmvl, | |
| 2270 | __builtin_ve_vl_vcmpuw_vsvvl, | |
| 2271 | __builtin_ve_vl_vcmpuw_vvvl, | |
| 2272 | __builtin_ve_vl_vcmpuw_vvvmvl, | |
| 2273 | __builtin_ve_vl_vcmpuw_vvvvl, | |
| 2274 | __builtin_ve_vl_vcp_vvmvl, | |
| 2275 | __builtin_ve_vl_vcvtdl_vvl, | |
| 2276 | __builtin_ve_vl_vcvtdl_vvvl, | |
| 2277 | __builtin_ve_vl_vcvtds_vvl, | |
| 2278 | __builtin_ve_vl_vcvtds_vvvl, | |
| 2279 | __builtin_ve_vl_vcvtdw_vvl, | |
| 2280 | __builtin_ve_vl_vcvtdw_vvvl, | |
| 2281 | __builtin_ve_vl_vcvtld_vvl, | |
| 2282 | __builtin_ve_vl_vcvtld_vvmvl, | |
| 2283 | __builtin_ve_vl_vcvtld_vvvl, | |
| 2284 | __builtin_ve_vl_vcvtldrz_vvl, | |
| 2285 | __builtin_ve_vl_vcvtldrz_vvmvl, | |
| 2286 | __builtin_ve_vl_vcvtldrz_vvvl, | |
| 2287 | __builtin_ve_vl_vcvtsd_vvl, | |
| 2288 | __builtin_ve_vl_vcvtsd_vvvl, | |
| 2289 | __builtin_ve_vl_vcvtsw_vvl, | |
| 2290 | __builtin_ve_vl_vcvtsw_vvvl, | |
| 2291 | __builtin_ve_vl_vcvtwdsx_vvl, | |
| 2292 | __builtin_ve_vl_vcvtwdsx_vvmvl, | |
| 2293 | __builtin_ve_vl_vcvtwdsx_vvvl, | |
| 2294 | __builtin_ve_vl_vcvtwdsxrz_vvl, | |
| 2295 | __builtin_ve_vl_vcvtwdsxrz_vvmvl, | |
| 2296 | __builtin_ve_vl_vcvtwdsxrz_vvvl, | |
| 2297 | __builtin_ve_vl_vcvtwdzx_vvl, | |
| 2298 | __builtin_ve_vl_vcvtwdzx_vvmvl, | |
| 2299 | __builtin_ve_vl_vcvtwdzx_vvvl, | |
| 2300 | __builtin_ve_vl_vcvtwdzxrz_vvl, | |
| 2301 | __builtin_ve_vl_vcvtwdzxrz_vvmvl, | |
| 2302 | __builtin_ve_vl_vcvtwdzxrz_vvvl, | |
| 2303 | __builtin_ve_vl_vcvtwssx_vvl, | |
| 2304 | __builtin_ve_vl_vcvtwssx_vvmvl, | |
| 2305 | __builtin_ve_vl_vcvtwssx_vvvl, | |
| 2306 | __builtin_ve_vl_vcvtwssxrz_vvl, | |
| 2307 | __builtin_ve_vl_vcvtwssxrz_vvmvl, | |
| 2308 | __builtin_ve_vl_vcvtwssxrz_vvvl, | |
| 2309 | __builtin_ve_vl_vcvtwszx_vvl, | |
| 2310 | __builtin_ve_vl_vcvtwszx_vvmvl, | |
| 2311 | __builtin_ve_vl_vcvtwszx_vvvl, | |
| 2312 | __builtin_ve_vl_vcvtwszxrz_vvl, | |
| 2313 | __builtin_ve_vl_vcvtwszxrz_vvmvl, | |
| 2314 | __builtin_ve_vl_vcvtwszxrz_vvvl, | |
| 2315 | __builtin_ve_vl_vdivsl_vsvl, | |
| 2316 | __builtin_ve_vl_vdivsl_vsvmvl, | |
| 2317 | __builtin_ve_vl_vdivsl_vsvvl, | |
| 2318 | __builtin_ve_vl_vdivsl_vvsl, | |
| 2319 | __builtin_ve_vl_vdivsl_vvsmvl, | |
| 2320 | __builtin_ve_vl_vdivsl_vvsvl, | |
| 2321 | __builtin_ve_vl_vdivsl_vvvl, | |
| 2322 | __builtin_ve_vl_vdivsl_vvvmvl, | |
| 2323 | __builtin_ve_vl_vdivsl_vvvvl, | |
| 2324 | __builtin_ve_vl_vdivswsx_vsvl, | |
| 2325 | __builtin_ve_vl_vdivswsx_vsvmvl, | |
| 2326 | __builtin_ve_vl_vdivswsx_vsvvl, | |
| 2327 | __builtin_ve_vl_vdivswsx_vvsl, | |
| 2328 | __builtin_ve_vl_vdivswsx_vvsmvl, | |
| 2329 | __builtin_ve_vl_vdivswsx_vvsvl, | |
| 2330 | __builtin_ve_vl_vdivswsx_vvvl, | |
| 2331 | __builtin_ve_vl_vdivswsx_vvvmvl, | |
| 2332 | __builtin_ve_vl_vdivswsx_vvvvl, | |
| 2333 | __builtin_ve_vl_vdivswzx_vsvl, | |
| 2334 | __builtin_ve_vl_vdivswzx_vsvmvl, | |
| 2335 | __builtin_ve_vl_vdivswzx_vsvvl, | |
| 2336 | __builtin_ve_vl_vdivswzx_vvsl, | |
| 2337 | __builtin_ve_vl_vdivswzx_vvsmvl, | |
| 2338 | __builtin_ve_vl_vdivswzx_vvsvl, | |
| 2339 | __builtin_ve_vl_vdivswzx_vvvl, | |
| 2340 | __builtin_ve_vl_vdivswzx_vvvmvl, | |
| 2341 | __builtin_ve_vl_vdivswzx_vvvvl, | |
| 2342 | __builtin_ve_vl_vdivul_vsvl, | |
| 2343 | __builtin_ve_vl_vdivul_vsvmvl, | |
| 2344 | __builtin_ve_vl_vdivul_vsvvl, | |
| 2345 | __builtin_ve_vl_vdivul_vvsl, | |
| 2346 | __builtin_ve_vl_vdivul_vvsmvl, | |
| 2347 | __builtin_ve_vl_vdivul_vvsvl, | |
| 2348 | __builtin_ve_vl_vdivul_vvvl, | |
| 2349 | __builtin_ve_vl_vdivul_vvvmvl, | |
| 2350 | __builtin_ve_vl_vdivul_vvvvl, | |
| 2351 | __builtin_ve_vl_vdivuw_vsvl, | |
| 2352 | __builtin_ve_vl_vdivuw_vsvmvl, | |
| 2353 | __builtin_ve_vl_vdivuw_vsvvl, | |
| 2354 | __builtin_ve_vl_vdivuw_vvsl, | |
| 2355 | __builtin_ve_vl_vdivuw_vvsmvl, | |
| 2356 | __builtin_ve_vl_vdivuw_vvsvl, | |
| 2357 | __builtin_ve_vl_vdivuw_vvvl, | |
| 2358 | __builtin_ve_vl_vdivuw_vvvmvl, | |
| 2359 | __builtin_ve_vl_vdivuw_vvvvl, | |
| 2360 | __builtin_ve_vl_veqv_vsvl, | |
| 2361 | __builtin_ve_vl_veqv_vsvmvl, | |
| 2362 | __builtin_ve_vl_veqv_vsvvl, | |
| 2363 | __builtin_ve_vl_veqv_vvvl, | |
| 2364 | __builtin_ve_vl_veqv_vvvmvl, | |
| 2365 | __builtin_ve_vl_veqv_vvvvl, | |
| 2366 | __builtin_ve_vl_vex_vvmvl, | |
| 2367 | __builtin_ve_vl_vfaddd_vsvl, | |
| 2368 | __builtin_ve_vl_vfaddd_vsvmvl, | |
| 2369 | __builtin_ve_vl_vfaddd_vsvvl, | |
| 2370 | __builtin_ve_vl_vfaddd_vvvl, | |
| 2371 | __builtin_ve_vl_vfaddd_vvvmvl, | |
| 2372 | __builtin_ve_vl_vfaddd_vvvvl, | |
| 2373 | __builtin_ve_vl_vfadds_vsvl, | |
| 2374 | __builtin_ve_vl_vfadds_vsvmvl, | |
| 2375 | __builtin_ve_vl_vfadds_vsvvl, | |
| 2376 | __builtin_ve_vl_vfadds_vvvl, | |
| 2377 | __builtin_ve_vl_vfadds_vvvmvl, | |
| 2378 | __builtin_ve_vl_vfadds_vvvvl, | |
| 2379 | __builtin_ve_vl_vfcmpd_vsvl, | |
| 2380 | __builtin_ve_vl_vfcmpd_vsvmvl, | |
| 2381 | __builtin_ve_vl_vfcmpd_vsvvl, | |
| 2382 | __builtin_ve_vl_vfcmpd_vvvl, | |
| 2383 | __builtin_ve_vl_vfcmpd_vvvmvl, | |
| 2384 | __builtin_ve_vl_vfcmpd_vvvvl, | |
| 2385 | __builtin_ve_vl_vfcmps_vsvl, | |
| 2386 | __builtin_ve_vl_vfcmps_vsvmvl, | |
| 2387 | __builtin_ve_vl_vfcmps_vsvvl, | |
| 2388 | __builtin_ve_vl_vfcmps_vvvl, | |
| 2389 | __builtin_ve_vl_vfcmps_vvvmvl, | |
| 2390 | __builtin_ve_vl_vfcmps_vvvvl, | |
| 2391 | __builtin_ve_vl_vfdivd_vsvl, | |
| 2392 | __builtin_ve_vl_vfdivd_vsvmvl, | |
| 2393 | __builtin_ve_vl_vfdivd_vsvvl, | |
| 2394 | __builtin_ve_vl_vfdivd_vvvl, | |
| 2395 | __builtin_ve_vl_vfdivd_vvvmvl, | |
| 2396 | __builtin_ve_vl_vfdivd_vvvvl, | |
| 2397 | __builtin_ve_vl_vfdivs_vsvl, | |
| 2398 | __builtin_ve_vl_vfdivs_vsvmvl, | |
| 2399 | __builtin_ve_vl_vfdivs_vsvvl, | |
| 2400 | __builtin_ve_vl_vfdivs_vvvl, | |
| 2401 | __builtin_ve_vl_vfdivs_vvvmvl, | |
| 2402 | __builtin_ve_vl_vfdivs_vvvvl, | |
| 2403 | __builtin_ve_vl_vfmadd_vsvvl, | |
| 2404 | __builtin_ve_vl_vfmadd_vsvvmvl, | |
| 2405 | __builtin_ve_vl_vfmadd_vsvvvl, | |
| 2406 | __builtin_ve_vl_vfmadd_vvsvl, | |
| 2407 | __builtin_ve_vl_vfmadd_vvsvmvl, | |
| 2408 | __builtin_ve_vl_vfmadd_vvsvvl, | |
| 2409 | __builtin_ve_vl_vfmadd_vvvvl, | |
| 2410 | __builtin_ve_vl_vfmadd_vvvvmvl, | |
| 2411 | __builtin_ve_vl_vfmadd_vvvvvl, | |
| 2412 | __builtin_ve_vl_vfmads_vsvvl, | |
| 2413 | __builtin_ve_vl_vfmads_vsvvmvl, | |
| 2414 | __builtin_ve_vl_vfmads_vsvvvl, | |
| 2415 | __builtin_ve_vl_vfmads_vvsvl, | |
| 2416 | __builtin_ve_vl_vfmads_vvsvmvl, | |
| 2417 | __builtin_ve_vl_vfmads_vvsvvl, | |
| 2418 | __builtin_ve_vl_vfmads_vvvvl, | |
| 2419 | __builtin_ve_vl_vfmads_vvvvmvl, | |
| 2420 | __builtin_ve_vl_vfmads_vvvvvl, | |
| 2421 | __builtin_ve_vl_vfmaxd_vsvl, | |
| 2422 | __builtin_ve_vl_vfmaxd_vsvmvl, | |
| 2423 | __builtin_ve_vl_vfmaxd_vsvvl, | |
| 2424 | __builtin_ve_vl_vfmaxd_vvvl, | |
| 2425 | __builtin_ve_vl_vfmaxd_vvvmvl, | |
| 2426 | __builtin_ve_vl_vfmaxd_vvvvl, | |
| 2427 | __builtin_ve_vl_vfmaxs_vsvl, | |
| 2428 | __builtin_ve_vl_vfmaxs_vsvmvl, | |
| 2429 | __builtin_ve_vl_vfmaxs_vsvvl, | |
| 2430 | __builtin_ve_vl_vfmaxs_vvvl, | |
| 2431 | __builtin_ve_vl_vfmaxs_vvvmvl, | |
| 2432 | __builtin_ve_vl_vfmaxs_vvvvl, | |
| 2433 | __builtin_ve_vl_vfmind_vsvl, | |
| 2434 | __builtin_ve_vl_vfmind_vsvmvl, | |
| 2435 | __builtin_ve_vl_vfmind_vsvvl, | |
| 2436 | __builtin_ve_vl_vfmind_vvvl, | |
| 2437 | __builtin_ve_vl_vfmind_vvvmvl, | |
| 2438 | __builtin_ve_vl_vfmind_vvvvl, | |
| 2439 | __builtin_ve_vl_vfmins_vsvl, | |
| 2440 | __builtin_ve_vl_vfmins_vsvmvl, | |
| 2441 | __builtin_ve_vl_vfmins_vsvvl, | |
| 2442 | __builtin_ve_vl_vfmins_vvvl, | |
| 2443 | __builtin_ve_vl_vfmins_vvvmvl, | |
| 2444 | __builtin_ve_vl_vfmins_vvvvl, | |
| 2445 | __builtin_ve_vl_vfmkdeq_mvl, | |
| 2446 | __builtin_ve_vl_vfmkdeq_mvml, | |
| 2447 | __builtin_ve_vl_vfmkdeqnan_mvl, | |
| 2448 | __builtin_ve_vl_vfmkdeqnan_mvml, | |
| 2449 | __builtin_ve_vl_vfmkdge_mvl, | |
| 2450 | __builtin_ve_vl_vfmkdge_mvml, | |
| 2451 | __builtin_ve_vl_vfmkdgenan_mvl, | |
| 2452 | __builtin_ve_vl_vfmkdgenan_mvml, | |
| 2453 | __builtin_ve_vl_vfmkdgt_mvl, | |
| 2454 | __builtin_ve_vl_vfmkdgt_mvml, | |
| 2455 | __builtin_ve_vl_vfmkdgtnan_mvl, | |
| 2456 | __builtin_ve_vl_vfmkdgtnan_mvml, | |
| 2457 | __builtin_ve_vl_vfmkdle_mvl, | |
| 2458 | __builtin_ve_vl_vfmkdle_mvml, | |
| 2459 | __builtin_ve_vl_vfmkdlenan_mvl, | |
| 2460 | __builtin_ve_vl_vfmkdlenan_mvml, | |
| 2461 | __builtin_ve_vl_vfmkdlt_mvl, | |
| 2462 | __builtin_ve_vl_vfmkdlt_mvml, | |
| 2463 | __builtin_ve_vl_vfmkdltnan_mvl, | |
| 2464 | __builtin_ve_vl_vfmkdltnan_mvml, | |
| 2465 | __builtin_ve_vl_vfmkdnan_mvl, | |
| 2466 | __builtin_ve_vl_vfmkdnan_mvml, | |
| 2467 | __builtin_ve_vl_vfmkdne_mvl, | |
| 2468 | __builtin_ve_vl_vfmkdne_mvml, | |
| 2469 | __builtin_ve_vl_vfmkdnenan_mvl, | |
| 2470 | __builtin_ve_vl_vfmkdnenan_mvml, | |
| 2471 | __builtin_ve_vl_vfmkdnum_mvl, | |
| 2472 | __builtin_ve_vl_vfmkdnum_mvml, | |
| 2473 | __builtin_ve_vl_vfmklaf_ml, | |
| 2474 | __builtin_ve_vl_vfmklat_ml, | |
| 2475 | __builtin_ve_vl_vfmkleq_mvl, | |
| 2476 | __builtin_ve_vl_vfmkleq_mvml, | |
| 2477 | __builtin_ve_vl_vfmkleqnan_mvl, | |
| 2478 | __builtin_ve_vl_vfmkleqnan_mvml, | |
| 2479 | __builtin_ve_vl_vfmklge_mvl, | |
| 2480 | __builtin_ve_vl_vfmklge_mvml, | |
| 2481 | __builtin_ve_vl_vfmklgenan_mvl, | |
| 2482 | __builtin_ve_vl_vfmklgenan_mvml, | |
| 2483 | __builtin_ve_vl_vfmklgt_mvl, | |
| 2484 | __builtin_ve_vl_vfmklgt_mvml, | |
| 2485 | __builtin_ve_vl_vfmklgtnan_mvl, | |
| 2486 | __builtin_ve_vl_vfmklgtnan_mvml, | |
| 2487 | __builtin_ve_vl_vfmklle_mvl, | |
| 2488 | __builtin_ve_vl_vfmklle_mvml, | |
| 2489 | __builtin_ve_vl_vfmkllenan_mvl, | |
| 2490 | __builtin_ve_vl_vfmkllenan_mvml, | |
| 2491 | __builtin_ve_vl_vfmkllt_mvl, | |
| 2492 | __builtin_ve_vl_vfmkllt_mvml, | |
| 2493 | __builtin_ve_vl_vfmklltnan_mvl, | |
| 2494 | __builtin_ve_vl_vfmklltnan_mvml, | |
| 2495 | __builtin_ve_vl_vfmklnan_mvl, | |
| 2496 | __builtin_ve_vl_vfmklnan_mvml, | |
| 2497 | __builtin_ve_vl_vfmklne_mvl, | |
| 2498 | __builtin_ve_vl_vfmklne_mvml, | |
| 2499 | __builtin_ve_vl_vfmklnenan_mvl, | |
| 2500 | __builtin_ve_vl_vfmklnenan_mvml, | |
| 2501 | __builtin_ve_vl_vfmklnum_mvl, | |
| 2502 | __builtin_ve_vl_vfmklnum_mvml, | |
| 2503 | __builtin_ve_vl_vfmkseq_mvl, | |
| 2504 | __builtin_ve_vl_vfmkseq_mvml, | |
| 2505 | __builtin_ve_vl_vfmkseqnan_mvl, | |
| 2506 | __builtin_ve_vl_vfmkseqnan_mvml, | |
| 2507 | __builtin_ve_vl_vfmksge_mvl, | |
| 2508 | __builtin_ve_vl_vfmksge_mvml, | |
| 2509 | __builtin_ve_vl_vfmksgenan_mvl, | |
| 2510 | __builtin_ve_vl_vfmksgenan_mvml, | |
| 2511 | __builtin_ve_vl_vfmksgt_mvl, | |
| 2512 | __builtin_ve_vl_vfmksgt_mvml, | |
| 2513 | __builtin_ve_vl_vfmksgtnan_mvl, | |
| 2514 | __builtin_ve_vl_vfmksgtnan_mvml, | |
| 2515 | __builtin_ve_vl_vfmksle_mvl, | |
| 2516 | __builtin_ve_vl_vfmksle_mvml, | |
| 2517 | __builtin_ve_vl_vfmkslenan_mvl, | |
| 2518 | __builtin_ve_vl_vfmkslenan_mvml, | |
| 2519 | __builtin_ve_vl_vfmkslt_mvl, | |
| 2520 | __builtin_ve_vl_vfmkslt_mvml, | |
| 2521 | __builtin_ve_vl_vfmksltnan_mvl, | |
| 2522 | __builtin_ve_vl_vfmksltnan_mvml, | |
| 2523 | __builtin_ve_vl_vfmksnan_mvl, | |
| 2524 | __builtin_ve_vl_vfmksnan_mvml, | |
| 2525 | __builtin_ve_vl_vfmksne_mvl, | |
| 2526 | __builtin_ve_vl_vfmksne_mvml, | |
| 2527 | __builtin_ve_vl_vfmksnenan_mvl, | |
| 2528 | __builtin_ve_vl_vfmksnenan_mvml, | |
| 2529 | __builtin_ve_vl_vfmksnum_mvl, | |
| 2530 | __builtin_ve_vl_vfmksnum_mvml, | |
| 2531 | __builtin_ve_vl_vfmkweq_mvl, | |
| 2532 | __builtin_ve_vl_vfmkweq_mvml, | |
| 2533 | __builtin_ve_vl_vfmkweqnan_mvl, | |
| 2534 | __builtin_ve_vl_vfmkweqnan_mvml, | |
| 2535 | __builtin_ve_vl_vfmkwge_mvl, | |
| 2536 | __builtin_ve_vl_vfmkwge_mvml, | |
| 2537 | __builtin_ve_vl_vfmkwgenan_mvl, | |
| 2538 | __builtin_ve_vl_vfmkwgenan_mvml, | |
| 2539 | __builtin_ve_vl_vfmkwgt_mvl, | |
| 2540 | __builtin_ve_vl_vfmkwgt_mvml, | |
| 2541 | __builtin_ve_vl_vfmkwgtnan_mvl, | |
| 2542 | __builtin_ve_vl_vfmkwgtnan_mvml, | |
| 2543 | __builtin_ve_vl_vfmkwle_mvl, | |
| 2544 | __builtin_ve_vl_vfmkwle_mvml, | |
| 2545 | __builtin_ve_vl_vfmkwlenan_mvl, | |
| 2546 | __builtin_ve_vl_vfmkwlenan_mvml, | |
| 2547 | __builtin_ve_vl_vfmkwlt_mvl, | |
| 2548 | __builtin_ve_vl_vfmkwlt_mvml, | |
| 2549 | __builtin_ve_vl_vfmkwltnan_mvl, | |
| 2550 | __builtin_ve_vl_vfmkwltnan_mvml, | |
| 2551 | __builtin_ve_vl_vfmkwnan_mvl, | |
| 2552 | __builtin_ve_vl_vfmkwnan_mvml, | |
| 2553 | __builtin_ve_vl_vfmkwne_mvl, | |
| 2554 | __builtin_ve_vl_vfmkwne_mvml, | |
| 2555 | __builtin_ve_vl_vfmkwnenan_mvl, | |
| 2556 | __builtin_ve_vl_vfmkwnenan_mvml, | |
| 2557 | __builtin_ve_vl_vfmkwnum_mvl, | |
| 2558 | __builtin_ve_vl_vfmkwnum_mvml, | |
| 2559 | __builtin_ve_vl_vfmsbd_vsvvl, | |
| 2560 | __builtin_ve_vl_vfmsbd_vsvvmvl, | |
| 2561 | __builtin_ve_vl_vfmsbd_vsvvvl, | |
| 2562 | __builtin_ve_vl_vfmsbd_vvsvl, | |
| 2563 | __builtin_ve_vl_vfmsbd_vvsvmvl, | |
| 2564 | __builtin_ve_vl_vfmsbd_vvsvvl, | |
| 2565 | __builtin_ve_vl_vfmsbd_vvvvl, | |
| 2566 | __builtin_ve_vl_vfmsbd_vvvvmvl, | |
| 2567 | __builtin_ve_vl_vfmsbd_vvvvvl, | |
| 2568 | __builtin_ve_vl_vfmsbs_vsvvl, | |
| 2569 | __builtin_ve_vl_vfmsbs_vsvvmvl, | |
| 2570 | __builtin_ve_vl_vfmsbs_vsvvvl, | |
| 2571 | __builtin_ve_vl_vfmsbs_vvsvl, | |
| 2572 | __builtin_ve_vl_vfmsbs_vvsvmvl, | |
| 2573 | __builtin_ve_vl_vfmsbs_vvsvvl, | |
| 2574 | __builtin_ve_vl_vfmsbs_vvvvl, | |
| 2575 | __builtin_ve_vl_vfmsbs_vvvvmvl, | |
| 2576 | __builtin_ve_vl_vfmsbs_vvvvvl, | |
| 2577 | __builtin_ve_vl_vfmuld_vsvl, | |
| 2578 | __builtin_ve_vl_vfmuld_vsvmvl, | |
| 2579 | __builtin_ve_vl_vfmuld_vsvvl, | |
| 2580 | __builtin_ve_vl_vfmuld_vvvl, | |
| 2581 | __builtin_ve_vl_vfmuld_vvvmvl, | |
| 2582 | __builtin_ve_vl_vfmuld_vvvvl, | |
| 2583 | __builtin_ve_vl_vfmuls_vsvl, | |
| 2584 | __builtin_ve_vl_vfmuls_vsvmvl, | |
| 2585 | __builtin_ve_vl_vfmuls_vsvvl, | |
| 2586 | __builtin_ve_vl_vfmuls_vvvl, | |
| 2587 | __builtin_ve_vl_vfmuls_vvvmvl, | |
| 2588 | __builtin_ve_vl_vfmuls_vvvvl, | |
| 2589 | __builtin_ve_vl_vfnmadd_vsvvl, | |
| 2590 | __builtin_ve_vl_vfnmadd_vsvvmvl, | |
| 2591 | __builtin_ve_vl_vfnmadd_vsvvvl, | |
| 2592 | __builtin_ve_vl_vfnmadd_vvsvl, | |
| 2593 | __builtin_ve_vl_vfnmadd_vvsvmvl, | |
| 2594 | __builtin_ve_vl_vfnmadd_vvsvvl, | |
| 2595 | __builtin_ve_vl_vfnmadd_vvvvl, | |
| 2596 | __builtin_ve_vl_vfnmadd_vvvvmvl, | |
| 2597 | __builtin_ve_vl_vfnmadd_vvvvvl, | |
| 2598 | __builtin_ve_vl_vfnmads_vsvvl, | |
| 2599 | __builtin_ve_vl_vfnmads_vsvvmvl, | |
| 2600 | __builtin_ve_vl_vfnmads_vsvvvl, | |
| 2601 | __builtin_ve_vl_vfnmads_vvsvl, | |
| 2602 | __builtin_ve_vl_vfnmads_vvsvmvl, | |
| 2603 | __builtin_ve_vl_vfnmads_vvsvvl, | |
| 2604 | __builtin_ve_vl_vfnmads_vvvvl, | |
| 2605 | __builtin_ve_vl_vfnmads_vvvvmvl, | |
| 2606 | __builtin_ve_vl_vfnmads_vvvvvl, | |
| 2607 | __builtin_ve_vl_vfnmsbd_vsvvl, | |
| 2608 | __builtin_ve_vl_vfnmsbd_vsvvmvl, | |
| 2609 | __builtin_ve_vl_vfnmsbd_vsvvvl, | |
| 2610 | __builtin_ve_vl_vfnmsbd_vvsvl, | |
| 2611 | __builtin_ve_vl_vfnmsbd_vvsvmvl, | |
| 2612 | __builtin_ve_vl_vfnmsbd_vvsvvl, | |
| 2613 | __builtin_ve_vl_vfnmsbd_vvvvl, | |
| 2614 | __builtin_ve_vl_vfnmsbd_vvvvmvl, | |
| 2615 | __builtin_ve_vl_vfnmsbd_vvvvvl, | |
| 2616 | __builtin_ve_vl_vfnmsbs_vsvvl, | |
| 2617 | __builtin_ve_vl_vfnmsbs_vsvvmvl, | |
| 2618 | __builtin_ve_vl_vfnmsbs_vsvvvl, | |
| 2619 | __builtin_ve_vl_vfnmsbs_vvsvl, | |
| 2620 | __builtin_ve_vl_vfnmsbs_vvsvmvl, | |
| 2621 | __builtin_ve_vl_vfnmsbs_vvsvvl, | |
| 2622 | __builtin_ve_vl_vfnmsbs_vvvvl, | |
| 2623 | __builtin_ve_vl_vfnmsbs_vvvvmvl, | |
| 2624 | __builtin_ve_vl_vfnmsbs_vvvvvl, | |
| 2625 | __builtin_ve_vl_vfrmaxdfst_vvl, | |
| 2626 | __builtin_ve_vl_vfrmaxdfst_vvvl, | |
| 2627 | __builtin_ve_vl_vfrmaxdlst_vvl, | |
| 2628 | __builtin_ve_vl_vfrmaxdlst_vvvl, | |
| 2629 | __builtin_ve_vl_vfrmaxsfst_vvl, | |
| 2630 | __builtin_ve_vl_vfrmaxsfst_vvvl, | |
| 2631 | __builtin_ve_vl_vfrmaxslst_vvl, | |
| 2632 | __builtin_ve_vl_vfrmaxslst_vvvl, | |
| 2633 | __builtin_ve_vl_vfrmindfst_vvl, | |
| 2634 | __builtin_ve_vl_vfrmindfst_vvvl, | |
| 2635 | __builtin_ve_vl_vfrmindlst_vvl, | |
| 2636 | __builtin_ve_vl_vfrmindlst_vvvl, | |
| 2637 | __builtin_ve_vl_vfrminsfst_vvl, | |
| 2638 | __builtin_ve_vl_vfrminsfst_vvvl, | |
| 2639 | __builtin_ve_vl_vfrminslst_vvl, | |
| 2640 | __builtin_ve_vl_vfrminslst_vvvl, | |
| 2641 | __builtin_ve_vl_vfsqrtd_vvl, | |
| 2642 | __builtin_ve_vl_vfsqrtd_vvvl, | |
| 2643 | __builtin_ve_vl_vfsqrts_vvl, | |
| 2644 | __builtin_ve_vl_vfsqrts_vvvl, | |
| 2645 | __builtin_ve_vl_vfsubd_vsvl, | |
| 2646 | __builtin_ve_vl_vfsubd_vsvmvl, | |
| 2647 | __builtin_ve_vl_vfsubd_vsvvl, | |
| 2648 | __builtin_ve_vl_vfsubd_vvvl, | |
| 2649 | __builtin_ve_vl_vfsubd_vvvmvl, | |
| 2650 | __builtin_ve_vl_vfsubd_vvvvl, | |
| 2651 | __builtin_ve_vl_vfsubs_vsvl, | |
| 2652 | __builtin_ve_vl_vfsubs_vsvmvl, | |
| 2653 | __builtin_ve_vl_vfsubs_vsvvl, | |
| 2654 | __builtin_ve_vl_vfsubs_vvvl, | |
| 2655 | __builtin_ve_vl_vfsubs_vvvmvl, | |
| 2656 | __builtin_ve_vl_vfsubs_vvvvl, | |
| 2657 | __builtin_ve_vl_vfsumd_vvl, | |
| 2658 | __builtin_ve_vl_vfsumd_vvml, | |
| 2659 | __builtin_ve_vl_vfsums_vvl, | |
| 2660 | __builtin_ve_vl_vfsums_vvml, | |
| 2661 | __builtin_ve_vl_vgt_vvssl, | |
| 2662 | __builtin_ve_vl_vgt_vvssml, | |
| 2663 | __builtin_ve_vl_vgt_vvssmvl, | |
| 2664 | __builtin_ve_vl_vgt_vvssvl, | |
| 2665 | __builtin_ve_vl_vgtlsx_vvssl, | |
| 2666 | __builtin_ve_vl_vgtlsx_vvssml, | |
| 2667 | __builtin_ve_vl_vgtlsx_vvssmvl, | |
| 2668 | __builtin_ve_vl_vgtlsx_vvssvl, | |
| 2669 | __builtin_ve_vl_vgtlsxnc_vvssl, | |
| 2670 | __builtin_ve_vl_vgtlsxnc_vvssml, | |
| 2671 | __builtin_ve_vl_vgtlsxnc_vvssmvl, | |
| 2672 | __builtin_ve_vl_vgtlsxnc_vvssvl, | |
| 2673 | __builtin_ve_vl_vgtlzx_vvssl, | |
| 2674 | __builtin_ve_vl_vgtlzx_vvssml, | |
| 2675 | __builtin_ve_vl_vgtlzx_vvssmvl, | |
| 2676 | __builtin_ve_vl_vgtlzx_vvssvl, | |
| 2677 | __builtin_ve_vl_vgtlzxnc_vvssl, | |
| 2678 | __builtin_ve_vl_vgtlzxnc_vvssml, | |
| 2679 | __builtin_ve_vl_vgtlzxnc_vvssmvl, | |
| 2680 | __builtin_ve_vl_vgtlzxnc_vvssvl, | |
| 2681 | __builtin_ve_vl_vgtnc_vvssl, | |
| 2682 | __builtin_ve_vl_vgtnc_vvssml, | |
| 2683 | __builtin_ve_vl_vgtnc_vvssmvl, | |
| 2684 | __builtin_ve_vl_vgtnc_vvssvl, | |
| 2685 | __builtin_ve_vl_vgtu_vvssl, | |
| 2686 | __builtin_ve_vl_vgtu_vvssml, | |
| 2687 | __builtin_ve_vl_vgtu_vvssmvl, | |
| 2688 | __builtin_ve_vl_vgtu_vvssvl, | |
| 2689 | __builtin_ve_vl_vgtunc_vvssl, | |
| 2690 | __builtin_ve_vl_vgtunc_vvssml, | |
| 2691 | __builtin_ve_vl_vgtunc_vvssmvl, | |
| 2692 | __builtin_ve_vl_vgtunc_vvssvl, | |
| 2693 | __builtin_ve_vl_vld2d_vssl, | |
| 2694 | __builtin_ve_vl_vld2d_vssvl, | |
| 2695 | __builtin_ve_vl_vld2dnc_vssl, | |
| 2696 | __builtin_ve_vl_vld2dnc_vssvl, | |
| 2697 | __builtin_ve_vl_vld_vssl, | |
| 2698 | __builtin_ve_vl_vld_vssvl, | |
| 2699 | __builtin_ve_vl_vldl2dsx_vssl, | |
| 2700 | __builtin_ve_vl_vldl2dsx_vssvl, | |
| 2701 | __builtin_ve_vl_vldl2dsxnc_vssl, | |
| 2702 | __builtin_ve_vl_vldl2dsxnc_vssvl, | |
| 2703 | __builtin_ve_vl_vldl2dzx_vssl, | |
| 2704 | __builtin_ve_vl_vldl2dzx_vssvl, | |
| 2705 | __builtin_ve_vl_vldl2dzxnc_vssl, | |
| 2706 | __builtin_ve_vl_vldl2dzxnc_vssvl, | |
| 2707 | __builtin_ve_vl_vldlsx_vssl, | |
| 2708 | __builtin_ve_vl_vldlsx_vssvl, | |
| 2709 | __builtin_ve_vl_vldlsxnc_vssl, | |
| 2710 | __builtin_ve_vl_vldlsxnc_vssvl, | |
| 2711 | __builtin_ve_vl_vldlzx_vssl, | |
| 2712 | __builtin_ve_vl_vldlzx_vssvl, | |
| 2713 | __builtin_ve_vl_vldlzxnc_vssl, | |
| 2714 | __builtin_ve_vl_vldlzxnc_vssvl, | |
| 2715 | __builtin_ve_vl_vldnc_vssl, | |
| 2716 | __builtin_ve_vl_vldnc_vssvl, | |
| 2717 | __builtin_ve_vl_vldu2d_vssl, | |
| 2718 | __builtin_ve_vl_vldu2d_vssvl, | |
| 2719 | __builtin_ve_vl_vldu2dnc_vssl, | |
| 2720 | __builtin_ve_vl_vldu2dnc_vssvl, | |
| 2721 | __builtin_ve_vl_vldu_vssl, | |
| 2722 | __builtin_ve_vl_vldu_vssvl, | |
| 2723 | __builtin_ve_vl_vldunc_vssl, | |
| 2724 | __builtin_ve_vl_vldunc_vssvl, | |
| 2725 | __builtin_ve_vl_vldz_vvl, | |
| 2726 | __builtin_ve_vl_vldz_vvmvl, | |
| 2727 | __builtin_ve_vl_vldz_vvvl, | |
| 2728 | __builtin_ve_vl_vmaxsl_vsvl, | |
| 2729 | __builtin_ve_vl_vmaxsl_vsvmvl, | |
| 2730 | __builtin_ve_vl_vmaxsl_vsvvl, | |
| 2731 | __builtin_ve_vl_vmaxsl_vvvl, | |
| 2732 | __builtin_ve_vl_vmaxsl_vvvmvl, | |
| 2733 | __builtin_ve_vl_vmaxsl_vvvvl, | |
| 2734 | __builtin_ve_vl_vmaxswsx_vsvl, | |
| 2735 | __builtin_ve_vl_vmaxswsx_vsvmvl, | |
| 2736 | __builtin_ve_vl_vmaxswsx_vsvvl, | |
| 2737 | __builtin_ve_vl_vmaxswsx_vvvl, | |
| 2738 | __builtin_ve_vl_vmaxswsx_vvvmvl, | |
| 2739 | __builtin_ve_vl_vmaxswsx_vvvvl, | |
| 2740 | __builtin_ve_vl_vmaxswzx_vsvl, | |
| 2741 | __builtin_ve_vl_vmaxswzx_vsvmvl, | |
| 2742 | __builtin_ve_vl_vmaxswzx_vsvvl, | |
| 2743 | __builtin_ve_vl_vmaxswzx_vvvl, | |
| 2744 | __builtin_ve_vl_vmaxswzx_vvvmvl, | |
| 2745 | __builtin_ve_vl_vmaxswzx_vvvvl, | |
| 2746 | __builtin_ve_vl_vminsl_vsvl, | |
| 2747 | __builtin_ve_vl_vminsl_vsvmvl, | |
| 2748 | __builtin_ve_vl_vminsl_vsvvl, | |
| 2749 | __builtin_ve_vl_vminsl_vvvl, | |
| 2750 | __builtin_ve_vl_vminsl_vvvmvl, | |
| 2751 | __builtin_ve_vl_vminsl_vvvvl, | |
| 2752 | __builtin_ve_vl_vminswsx_vsvl, | |
| 2753 | __builtin_ve_vl_vminswsx_vsvmvl, | |
| 2754 | __builtin_ve_vl_vminswsx_vsvvl, | |
| 2755 | __builtin_ve_vl_vminswsx_vvvl, | |
| 2756 | __builtin_ve_vl_vminswsx_vvvmvl, | |
| 2757 | __builtin_ve_vl_vminswsx_vvvvl, | |
| 2758 | __builtin_ve_vl_vminswzx_vsvl, | |
| 2759 | __builtin_ve_vl_vminswzx_vsvmvl, | |
| 2760 | __builtin_ve_vl_vminswzx_vsvvl, | |
| 2761 | __builtin_ve_vl_vminswzx_vvvl, | |
| 2762 | __builtin_ve_vl_vminswzx_vvvmvl, | |
| 2763 | __builtin_ve_vl_vminswzx_vvvvl, | |
| 2764 | __builtin_ve_vl_vmrg_vsvml, | |
| 2765 | __builtin_ve_vl_vmrg_vsvmvl, | |
| 2766 | __builtin_ve_vl_vmrg_vvvml, | |
| 2767 | __builtin_ve_vl_vmrg_vvvmvl, | |
| 2768 | __builtin_ve_vl_vmrgw_vsvMl, | |
| 2769 | __builtin_ve_vl_vmrgw_vsvMvl, | |
| 2770 | __builtin_ve_vl_vmrgw_vvvMl, | |
| 2771 | __builtin_ve_vl_vmrgw_vvvMvl, | |
| 2772 | __builtin_ve_vl_vmulsl_vsvl, | |
| 2773 | __builtin_ve_vl_vmulsl_vsvmvl, | |
| 2774 | __builtin_ve_vl_vmulsl_vsvvl, | |
| 2775 | __builtin_ve_vl_vmulsl_vvvl, | |
| 2776 | __builtin_ve_vl_vmulsl_vvvmvl, | |
| 2777 | __builtin_ve_vl_vmulsl_vvvvl, | |
| 2778 | __builtin_ve_vl_vmulslw_vsvl, | |
| 2779 | __builtin_ve_vl_vmulslw_vsvvl, | |
| 2780 | __builtin_ve_vl_vmulslw_vvvl, | |
| 2781 | __builtin_ve_vl_vmulslw_vvvvl, | |
| 2782 | __builtin_ve_vl_vmulswsx_vsvl, | |
| 2783 | __builtin_ve_vl_vmulswsx_vsvmvl, | |
| 2784 | __builtin_ve_vl_vmulswsx_vsvvl, | |
| 2785 | __builtin_ve_vl_vmulswsx_vvvl, | |
| 2786 | __builtin_ve_vl_vmulswsx_vvvmvl, | |
| 2787 | __builtin_ve_vl_vmulswsx_vvvvl, | |
| 2788 | __builtin_ve_vl_vmulswzx_vsvl, | |
| 2789 | __builtin_ve_vl_vmulswzx_vsvmvl, | |
| 2790 | __builtin_ve_vl_vmulswzx_vsvvl, | |
| 2791 | __builtin_ve_vl_vmulswzx_vvvl, | |
| 2792 | __builtin_ve_vl_vmulswzx_vvvmvl, | |
| 2793 | __builtin_ve_vl_vmulswzx_vvvvl, | |
| 2794 | __builtin_ve_vl_vmulul_vsvl, | |
| 2795 | __builtin_ve_vl_vmulul_vsvmvl, | |
| 2796 | __builtin_ve_vl_vmulul_vsvvl, | |
| 2797 | __builtin_ve_vl_vmulul_vvvl, | |
| 2798 | __builtin_ve_vl_vmulul_vvvmvl, | |
| 2799 | __builtin_ve_vl_vmulul_vvvvl, | |
| 2800 | __builtin_ve_vl_vmuluw_vsvl, | |
| 2801 | __builtin_ve_vl_vmuluw_vsvmvl, | |
| 2802 | __builtin_ve_vl_vmuluw_vsvvl, | |
| 2803 | __builtin_ve_vl_vmuluw_vvvl, | |
| 2804 | __builtin_ve_vl_vmuluw_vvvmvl, | |
| 2805 | __builtin_ve_vl_vmuluw_vvvvl, | |
| 2806 | __builtin_ve_vl_vmv_vsvl, | |
| 2807 | __builtin_ve_vl_vmv_vsvmvl, | |
| 2808 | __builtin_ve_vl_vmv_vsvvl, | |
| 2809 | __builtin_ve_vl_vor_vsvl, | |
| 2810 | __builtin_ve_vl_vor_vsvmvl, | |
| 2811 | __builtin_ve_vl_vor_vsvvl, | |
| 2812 | __builtin_ve_vl_vor_vvvl, | |
| 2813 | __builtin_ve_vl_vor_vvvmvl, | |
| 2814 | __builtin_ve_vl_vor_vvvvl, | |
| 2815 | __builtin_ve_vl_vpcnt_vvl, | |
| 2816 | __builtin_ve_vl_vpcnt_vvmvl, | |
| 2817 | __builtin_ve_vl_vpcnt_vvvl, | |
| 2818 | __builtin_ve_vl_vrand_vvl, | |
| 2819 | __builtin_ve_vl_vrand_vvml, | |
| 2820 | __builtin_ve_vl_vrcpd_vvl, | |
| 2821 | __builtin_ve_vl_vrcpd_vvvl, | |
| 2822 | __builtin_ve_vl_vrcps_vvl, | |
| 2823 | __builtin_ve_vl_vrcps_vvvl, | |
| 2824 | __builtin_ve_vl_vrmaxslfst_vvl, | |
| 2825 | __builtin_ve_vl_vrmaxslfst_vvvl, | |
| 2826 | __builtin_ve_vl_vrmaxsllst_vvl, | |
| 2827 | __builtin_ve_vl_vrmaxsllst_vvvl, | |
| 2828 | __builtin_ve_vl_vrmaxswfstsx_vvl, | |
| 2829 | __builtin_ve_vl_vrmaxswfstsx_vvvl, | |
| 2830 | __builtin_ve_vl_vrmaxswfstzx_vvl, | |
| 2831 | __builtin_ve_vl_vrmaxswfstzx_vvvl, | |
| 2832 | __builtin_ve_vl_vrmaxswlstsx_vvl, | |
| 2833 | __builtin_ve_vl_vrmaxswlstsx_vvvl, | |
| 2834 | __builtin_ve_vl_vrmaxswlstzx_vvl, | |
| 2835 | __builtin_ve_vl_vrmaxswlstzx_vvvl, | |
| 2836 | __builtin_ve_vl_vrminslfst_vvl, | |
| 2837 | __builtin_ve_vl_vrminslfst_vvvl, | |
| 2838 | __builtin_ve_vl_vrminsllst_vvl, | |
| 2839 | __builtin_ve_vl_vrminsllst_vvvl, | |
| 2840 | __builtin_ve_vl_vrminswfstsx_vvl, | |
| 2841 | __builtin_ve_vl_vrminswfstsx_vvvl, | |
| 2842 | __builtin_ve_vl_vrminswfstzx_vvl, | |
| 2843 | __builtin_ve_vl_vrminswfstzx_vvvl, | |
| 2844 | __builtin_ve_vl_vrminswlstsx_vvl, | |
| 2845 | __builtin_ve_vl_vrminswlstsx_vvvl, | |
| 2846 | __builtin_ve_vl_vrminswlstzx_vvl, | |
| 2847 | __builtin_ve_vl_vrminswlstzx_vvvl, | |
| 2848 | __builtin_ve_vl_vror_vvl, | |
| 2849 | __builtin_ve_vl_vror_vvml, | |
| 2850 | __builtin_ve_vl_vrsqrtd_vvl, | |
| 2851 | __builtin_ve_vl_vrsqrtd_vvvl, | |
| 2852 | __builtin_ve_vl_vrsqrtdnex_vvl, | |
| 2853 | __builtin_ve_vl_vrsqrtdnex_vvvl, | |
| 2854 | __builtin_ve_vl_vrsqrts_vvl, | |
| 2855 | __builtin_ve_vl_vrsqrts_vvvl, | |
| 2856 | __builtin_ve_vl_vrsqrtsnex_vvl, | |
| 2857 | __builtin_ve_vl_vrsqrtsnex_vvvl, | |
| 2858 | __builtin_ve_vl_vrxor_vvl, | |
| 2859 | __builtin_ve_vl_vrxor_vvml, | |
| 2860 | __builtin_ve_vl_vsc_vvssl, | |
| 2861 | __builtin_ve_vl_vsc_vvssml, | |
| 2862 | __builtin_ve_vl_vscl_vvssl, | |
| 2863 | __builtin_ve_vl_vscl_vvssml, | |
| 2864 | __builtin_ve_vl_vsclnc_vvssl, | |
| 2865 | __builtin_ve_vl_vsclnc_vvssml, | |
| 2866 | __builtin_ve_vl_vsclncot_vvssl, | |
| 2867 | __builtin_ve_vl_vsclncot_vvssml, | |
| 2868 | __builtin_ve_vl_vsclot_vvssl, | |
| 2869 | __builtin_ve_vl_vsclot_vvssml, | |
| 2870 | __builtin_ve_vl_vscnc_vvssl, | |
| 2871 | __builtin_ve_vl_vscnc_vvssml, | |
| 2872 | __builtin_ve_vl_vscncot_vvssl, | |
| 2873 | __builtin_ve_vl_vscncot_vvssml, | |
| 2874 | __builtin_ve_vl_vscot_vvssl, | |
| 2875 | __builtin_ve_vl_vscot_vvssml, | |
| 2876 | __builtin_ve_vl_vscu_vvssl, | |
| 2877 | __builtin_ve_vl_vscu_vvssml, | |
| 2878 | __builtin_ve_vl_vscunc_vvssl, | |
| 2879 | __builtin_ve_vl_vscunc_vvssml, | |
| 2880 | __builtin_ve_vl_vscuncot_vvssl, | |
| 2881 | __builtin_ve_vl_vscuncot_vvssml, | |
| 2882 | __builtin_ve_vl_vscuot_vvssl, | |
| 2883 | __builtin_ve_vl_vscuot_vvssml, | |
| 2884 | __builtin_ve_vl_vseq_vl, | |
| 2885 | __builtin_ve_vl_vseq_vvl, | |
| 2886 | __builtin_ve_vl_vsfa_vvssl, | |
| 2887 | __builtin_ve_vl_vsfa_vvssmvl, | |
| 2888 | __builtin_ve_vl_vsfa_vvssvl, | |
| 2889 | __builtin_ve_vl_vshf_vvvsl, | |
| 2890 | __builtin_ve_vl_vshf_vvvsvl, | |
| 2891 | __builtin_ve_vl_vslal_vvsl, | |
| 2892 | __builtin_ve_vl_vslal_vvsmvl, | |
| 2893 | __builtin_ve_vl_vslal_vvsvl, | |
| 2894 | __builtin_ve_vl_vslal_vvvl, | |
| 2895 | __builtin_ve_vl_vslal_vvvmvl, | |
| 2896 | __builtin_ve_vl_vslal_vvvvl, | |
| 2897 | __builtin_ve_vl_vslawsx_vvsl, | |
| 2898 | __builtin_ve_vl_vslawsx_vvsmvl, | |
| 2899 | __builtin_ve_vl_vslawsx_vvsvl, | |
| 2900 | __builtin_ve_vl_vslawsx_vvvl, | |
| 2901 | __builtin_ve_vl_vslawsx_vvvmvl, | |
| 2902 | __builtin_ve_vl_vslawsx_vvvvl, | |
| 2903 | __builtin_ve_vl_vslawzx_vvsl, | |
| 2904 | __builtin_ve_vl_vslawzx_vvsmvl, | |
| 2905 | __builtin_ve_vl_vslawzx_vvsvl, | |
| 2906 | __builtin_ve_vl_vslawzx_vvvl, | |
| 2907 | __builtin_ve_vl_vslawzx_vvvmvl, | |
| 2908 | __builtin_ve_vl_vslawzx_vvvvl, | |
| 2909 | __builtin_ve_vl_vsll_vvsl, | |
| 2910 | __builtin_ve_vl_vsll_vvsmvl, | |
| 2911 | __builtin_ve_vl_vsll_vvsvl, | |
| 2912 | __builtin_ve_vl_vsll_vvvl, | |
| 2913 | __builtin_ve_vl_vsll_vvvmvl, | |
| 2914 | __builtin_ve_vl_vsll_vvvvl, | |
| 2915 | __builtin_ve_vl_vsral_vvsl, | |
| 2916 | __builtin_ve_vl_vsral_vvsmvl, | |
| 2917 | __builtin_ve_vl_vsral_vvsvl, | |
| 2918 | __builtin_ve_vl_vsral_vvvl, | |
| 2919 | __builtin_ve_vl_vsral_vvvmvl, | |
| 2920 | __builtin_ve_vl_vsral_vvvvl, | |
| 2921 | __builtin_ve_vl_vsrawsx_vvsl, | |
| 2922 | __builtin_ve_vl_vsrawsx_vvsmvl, | |
| 2923 | __builtin_ve_vl_vsrawsx_vvsvl, | |
| 2924 | __builtin_ve_vl_vsrawsx_vvvl, | |
| 2925 | __builtin_ve_vl_vsrawsx_vvvmvl, | |
| 2926 | __builtin_ve_vl_vsrawsx_vvvvl, | |
| 2927 | __builtin_ve_vl_vsrawzx_vvsl, | |
| 2928 | __builtin_ve_vl_vsrawzx_vvsmvl, | |
| 2929 | __builtin_ve_vl_vsrawzx_vvsvl, | |
| 2930 | __builtin_ve_vl_vsrawzx_vvvl, | |
| 2931 | __builtin_ve_vl_vsrawzx_vvvmvl, | |
| 2932 | __builtin_ve_vl_vsrawzx_vvvvl, | |
| 2933 | __builtin_ve_vl_vsrl_vvsl, | |
| 2934 | __builtin_ve_vl_vsrl_vvsmvl, | |
| 2935 | __builtin_ve_vl_vsrl_vvsvl, | |
| 2936 | __builtin_ve_vl_vsrl_vvvl, | |
| 2937 | __builtin_ve_vl_vsrl_vvvmvl, | |
| 2938 | __builtin_ve_vl_vsrl_vvvvl, | |
| 2939 | __builtin_ve_vl_vst2d_vssl, | |
| 2940 | __builtin_ve_vl_vst2d_vssml, | |
| 2941 | __builtin_ve_vl_vst2dnc_vssl, | |
| 2942 | __builtin_ve_vl_vst2dnc_vssml, | |
| 2943 | __builtin_ve_vl_vst2dncot_vssl, | |
| 2944 | __builtin_ve_vl_vst2dncot_vssml, | |
| 2945 | __builtin_ve_vl_vst2dot_vssl, | |
| 2946 | __builtin_ve_vl_vst2dot_vssml, | |
| 2947 | __builtin_ve_vl_vst_vssl, | |
| 2948 | __builtin_ve_vl_vst_vssml, | |
| 2949 | __builtin_ve_vl_vstl2d_vssl, | |
| 2950 | __builtin_ve_vl_vstl2d_vssml, | |
| 2951 | __builtin_ve_vl_vstl2dnc_vssl, | |
| 2952 | __builtin_ve_vl_vstl2dnc_vssml, | |
| 2953 | __builtin_ve_vl_vstl2dncot_vssl, | |
| 2954 | __builtin_ve_vl_vstl2dncot_vssml, | |
| 2955 | __builtin_ve_vl_vstl2dot_vssl, | |
| 2956 | __builtin_ve_vl_vstl2dot_vssml, | |
| 2957 | __builtin_ve_vl_vstl_vssl, | |
| 2958 | __builtin_ve_vl_vstl_vssml, | |
| 2959 | __builtin_ve_vl_vstlnc_vssl, | |
| 2960 | __builtin_ve_vl_vstlnc_vssml, | |
| 2961 | __builtin_ve_vl_vstlncot_vssl, | |
| 2962 | __builtin_ve_vl_vstlncot_vssml, | |
| 2963 | __builtin_ve_vl_vstlot_vssl, | |
| 2964 | __builtin_ve_vl_vstlot_vssml, | |
| 2965 | __builtin_ve_vl_vstnc_vssl, | |
| 2966 | __builtin_ve_vl_vstnc_vssml, | |
| 2967 | __builtin_ve_vl_vstncot_vssl, | |
| 2968 | __builtin_ve_vl_vstncot_vssml, | |
| 2969 | __builtin_ve_vl_vstot_vssl, | |
| 2970 | __builtin_ve_vl_vstot_vssml, | |
| 2971 | __builtin_ve_vl_vstu2d_vssl, | |
| 2972 | __builtin_ve_vl_vstu2d_vssml, | |
| 2973 | __builtin_ve_vl_vstu2dnc_vssl, | |
| 2974 | __builtin_ve_vl_vstu2dnc_vssml, | |
| 2975 | __builtin_ve_vl_vstu2dncot_vssl, | |
| 2976 | __builtin_ve_vl_vstu2dncot_vssml, | |
| 2977 | __builtin_ve_vl_vstu2dot_vssl, | |
| 2978 | __builtin_ve_vl_vstu2dot_vssml, | |
| 2979 | __builtin_ve_vl_vstu_vssl, | |
| 2980 | __builtin_ve_vl_vstu_vssml, | |
| 2981 | __builtin_ve_vl_vstunc_vssl, | |
| 2982 | __builtin_ve_vl_vstunc_vssml, | |
| 2983 | __builtin_ve_vl_vstuncot_vssl, | |
| 2984 | __builtin_ve_vl_vstuncot_vssml, | |
| 2985 | __builtin_ve_vl_vstuot_vssl, | |
| 2986 | __builtin_ve_vl_vstuot_vssml, | |
| 2987 | __builtin_ve_vl_vsubsl_vsvl, | |
| 2988 | __builtin_ve_vl_vsubsl_vsvmvl, | |
| 2989 | __builtin_ve_vl_vsubsl_vsvvl, | |
| 2990 | __builtin_ve_vl_vsubsl_vvvl, | |
| 2991 | __builtin_ve_vl_vsubsl_vvvmvl, | |
| 2992 | __builtin_ve_vl_vsubsl_vvvvl, | |
| 2993 | __builtin_ve_vl_vsubswsx_vsvl, | |
| 2994 | __builtin_ve_vl_vsubswsx_vsvmvl, | |
| 2995 | __builtin_ve_vl_vsubswsx_vsvvl, | |
| 2996 | __builtin_ve_vl_vsubswsx_vvvl, | |
| 2997 | __builtin_ve_vl_vsubswsx_vvvmvl, | |
| 2998 | __builtin_ve_vl_vsubswsx_vvvvl, | |
| 2999 | __builtin_ve_vl_vsubswzx_vsvl, | |
| 3000 | __builtin_ve_vl_vsubswzx_vsvmvl, | |
| 3001 | __builtin_ve_vl_vsubswzx_vsvvl, | |
| 3002 | __builtin_ve_vl_vsubswzx_vvvl, | |
| 3003 | __builtin_ve_vl_vsubswzx_vvvmvl, | |
| 3004 | __builtin_ve_vl_vsubswzx_vvvvl, | |
| 3005 | __builtin_ve_vl_vsubul_vsvl, | |
| 3006 | __builtin_ve_vl_vsubul_vsvmvl, | |
| 3007 | __builtin_ve_vl_vsubul_vsvvl, | |
| 3008 | __builtin_ve_vl_vsubul_vvvl, | |
| 3009 | __builtin_ve_vl_vsubul_vvvmvl, | |
| 3010 | __builtin_ve_vl_vsubul_vvvvl, | |
| 3011 | __builtin_ve_vl_vsubuw_vsvl, | |
| 3012 | __builtin_ve_vl_vsubuw_vsvmvl, | |
| 3013 | __builtin_ve_vl_vsubuw_vsvvl, | |
| 3014 | __builtin_ve_vl_vsubuw_vvvl, | |
| 3015 | __builtin_ve_vl_vsubuw_vvvmvl, | |
| 3016 | __builtin_ve_vl_vsubuw_vvvvl, | |
| 3017 | __builtin_ve_vl_vsuml_vvl, | |
| 3018 | __builtin_ve_vl_vsuml_vvml, | |
| 3019 | __builtin_ve_vl_vsumwsx_vvl, | |
| 3020 | __builtin_ve_vl_vsumwsx_vvml, | |
| 3021 | __builtin_ve_vl_vsumwzx_vvl, | |
| 3022 | __builtin_ve_vl_vsumwzx_vvml, | |
| 3023 | __builtin_ve_vl_vxor_vsvl, | |
| 3024 | __builtin_ve_vl_vxor_vsvmvl, | |
| 3025 | __builtin_ve_vl_vxor_vsvvl, | |
| 3026 | __builtin_ve_vl_vxor_vvvl, | |
| 3027 | __builtin_ve_vl_vxor_vvvmvl, | |
| 3028 | __builtin_ve_vl_vxor_vvvvl, | |
| 3029 | __builtin_ve_vl_xorm_MMM, | |
| 3030 | __builtin_ve_vl_xorm_mmm, | |
| 3031 | __builtin_vfprintf, | |
| 3032 | __builtin_vfscanf, | |
| 3033 | __builtin_vprintf, | |
| 3034 | __builtin_vscanf, | |
| 3035 | __builtin_vsnprintf, | |
| 3036 | __builtin_vsprintf, | |
| 3037 | __builtin_vsscanf, | |
| 3038 | __builtin_wasm_max_f32, | |
| 3039 | __builtin_wasm_max_f64, | |
| 3040 | __builtin_wasm_memory_grow, | |
| 3041 | __builtin_wasm_memory_size, | |
| 3042 | __builtin_wasm_min_f32, | |
| 3043 | __builtin_wasm_min_f64, | |
| 3044 | __builtin_wasm_trunc_s_i32_f32, | |
| 3045 | __builtin_wasm_trunc_s_i32_f64, | |
| 3046 | __builtin_wasm_trunc_s_i64_f32, | |
| 3047 | __builtin_wasm_trunc_s_i64_f64, | |
| 3048 | __builtin_wasm_trunc_u_i32_f32, | |
| 3049 | __builtin_wasm_trunc_u_i32_f64, | |
| 3050 | __builtin_wasm_trunc_u_i64_f32, | |
| 3051 | __builtin_wasm_trunc_u_i64_f64, | |
| 3052 | __builtin_wcschr, | |
| 3053 | __builtin_wcscmp, | |
| 3054 | __builtin_wcslen, | |
| 3055 | __builtin_wcsncmp, | |
| 3056 | __builtin_wmemchr, | |
| 3057 | __builtin_wmemcmp, | |
| 3058 | __builtin_wmemcpy, | |
| 3059 | __builtin_wmemmove, | |
| 3060 | __c11_atomic_compare_exchange_strong, | |
| 3061 | __c11_atomic_compare_exchange_weak, | |
| 3062 | __c11_atomic_exchange, | |
| 3063 | __c11_atomic_fetch_add, | |
| 3064 | __c11_atomic_fetch_and, | |
| 3065 | __c11_atomic_fetch_max, | |
| 3066 | __c11_atomic_fetch_min, | |
| 3067 | __c11_atomic_fetch_nand, | |
| 3068 | __c11_atomic_fetch_or, | |
| 3069 | __c11_atomic_fetch_sub, | |
| 3070 | __c11_atomic_fetch_xor, | |
| 3071 | __c11_atomic_init, | |
| 3072 | __c11_atomic_is_lock_free, | |
| 3073 | __c11_atomic_load, | |
| 3074 | __c11_atomic_signal_fence, | |
| 3075 | __c11_atomic_store, | |
| 3076 | __c11_atomic_thread_fence, | |
| 3077 | __clear_cache, | |
| 3078 | __cospi, | |
| 3079 | __cospif, | |
| 3080 | __debugbreak, | |
| 3081 | __dmb, | |
| 3082 | __dsb, | |
| 3083 | __emit, | |
| 3084 | __exception_code, | |
| 3085 | __exception_info, | |
| 3086 | __exp10, | |
| 3087 | __exp10f, | |
| 3088 | __fastfail, | |
| 3089 | __finite, | |
| 3090 | __finitef, | |
| 3091 | __finitel, | |
| 3092 | __isb, | |
| 3093 | __iso_volatile_load16, | |
| 3094 | __iso_volatile_load32, | |
| 3095 | __iso_volatile_load64, | |
| 3096 | __iso_volatile_load8, | |
| 3097 | __iso_volatile_store16, | |
| 3098 | __iso_volatile_store32, | |
| 3099 | __iso_volatile_store64, | |
| 3100 | __iso_volatile_store8, | |
| 3101 | __ldrexd, | |
| 3102 | __lzcnt, | |
| 3103 | __lzcnt16, | |
| 3104 | __lzcnt64, | |
| 3105 | __noop, | |
| 3106 | __nvvm_add_rm_d, | |
| 3107 | __nvvm_add_rm_f, | |
| 3108 | __nvvm_add_rm_ftz_f, | |
| 3109 | __nvvm_add_rn_d, | |
| 3110 | __nvvm_add_rn_f, | |
| 3111 | __nvvm_add_rn_ftz_f, | |
| 3112 | __nvvm_add_rp_d, | |
| 3113 | __nvvm_add_rp_f, | |
| 3114 | __nvvm_add_rp_ftz_f, | |
| 3115 | __nvvm_add_rz_d, | |
| 3116 | __nvvm_add_rz_f, | |
| 3117 | __nvvm_add_rz_ftz_f, | |
| 3118 | __nvvm_atom_add_gen_f, | |
| 3119 | __nvvm_atom_add_gen_i, | |
| 3120 | __nvvm_atom_add_gen_l, | |
| 3121 | __nvvm_atom_add_gen_ll, | |
| 3122 | __nvvm_atom_and_gen_i, | |
| 3123 | __nvvm_atom_and_gen_l, | |
| 3124 | __nvvm_atom_and_gen_ll, | |
| 3125 | __nvvm_atom_cas_gen_i, | |
| 3126 | __nvvm_atom_cas_gen_l, | |
| 3127 | __nvvm_atom_cas_gen_ll, | |
| 3128 | __nvvm_atom_dec_gen_ui, | |
| 3129 | __nvvm_atom_inc_gen_ui, | |
| 3130 | __nvvm_atom_max_gen_i, | |
| 3131 | __nvvm_atom_max_gen_l, | |
| 3132 | __nvvm_atom_max_gen_ll, | |
| 3133 | __nvvm_atom_max_gen_ui, | |
| 3134 | __nvvm_atom_max_gen_ul, | |
| 3135 | __nvvm_atom_max_gen_ull, | |
| 3136 | __nvvm_atom_min_gen_i, | |
| 3137 | __nvvm_atom_min_gen_l, | |
| 3138 | __nvvm_atom_min_gen_ll, | |
| 3139 | __nvvm_atom_min_gen_ui, | |
| 3140 | __nvvm_atom_min_gen_ul, | |
| 3141 | __nvvm_atom_min_gen_ull, | |
| 3142 | __nvvm_atom_or_gen_i, | |
| 3143 | __nvvm_atom_or_gen_l, | |
| 3144 | __nvvm_atom_or_gen_ll, | |
| 3145 | __nvvm_atom_sub_gen_i, | |
| 3146 | __nvvm_atom_sub_gen_l, | |
| 3147 | __nvvm_atom_sub_gen_ll, | |
| 3148 | __nvvm_atom_xchg_gen_i, | |
| 3149 | __nvvm_atom_xchg_gen_l, | |
| 3150 | __nvvm_atom_xchg_gen_ll, | |
| 3151 | __nvvm_atom_xor_gen_i, | |
| 3152 | __nvvm_atom_xor_gen_l, | |
| 3153 | __nvvm_atom_xor_gen_ll, | |
| 3154 | __nvvm_bar0_and, | |
| 3155 | __nvvm_bar0_or, | |
| 3156 | __nvvm_bar0_popc, | |
| 3157 | __nvvm_bar_sync, | |
| 3158 | __nvvm_bitcast_d2ll, | |
| 3159 | __nvvm_bitcast_f2i, | |
| 3160 | __nvvm_bitcast_i2f, | |
| 3161 | __nvvm_bitcast_ll2d, | |
| 3162 | __nvvm_ceil_d, | |
| 3163 | __nvvm_ceil_f, | |
| 3164 | __nvvm_ceil_ftz_f, | |
| 3165 | __nvvm_compiler_error, | |
| 3166 | __nvvm_compiler_warn, | |
| 3167 | __nvvm_cos_approx_f, | |
| 3168 | __nvvm_cos_approx_ftz_f, | |
| 3169 | __nvvm_d2f_rm, | |
| 3170 | __nvvm_d2f_rm_ftz, | |
| 3171 | __nvvm_d2f_rn, | |
| 3172 | __nvvm_d2f_rn_ftz, | |
| 3173 | __nvvm_d2f_rp, | |
| 3174 | __nvvm_d2f_rp_ftz, | |
| 3175 | __nvvm_d2f_rz, | |
| 3176 | __nvvm_d2f_rz_ftz, | |
| 3177 | __nvvm_d2i_hi, | |
| 3178 | __nvvm_d2i_lo, | |
| 3179 | __nvvm_d2i_rm, | |
| 3180 | __nvvm_d2i_rn, | |
| 3181 | __nvvm_d2i_rp, | |
| 3182 | __nvvm_d2i_rz, | |
| 3183 | __nvvm_d2ll_rm, | |
| 3184 | __nvvm_d2ll_rn, | |
| 3185 | __nvvm_d2ll_rp, | |
| 3186 | __nvvm_d2ll_rz, | |
| 3187 | __nvvm_d2ui_rm, | |
| 3188 | __nvvm_d2ui_rn, | |
| 3189 | __nvvm_d2ui_rp, | |
| 3190 | __nvvm_d2ui_rz, | |
| 3191 | __nvvm_d2ull_rm, | |
| 3192 | __nvvm_d2ull_rn, | |
| 3193 | __nvvm_d2ull_rp, | |
| 3194 | __nvvm_d2ull_rz, | |
| 3195 | __nvvm_div_approx_f, | |
| 3196 | __nvvm_div_approx_ftz_f, | |
| 3197 | __nvvm_div_rm_d, | |
| 3198 | __nvvm_div_rm_f, | |
| 3199 | __nvvm_div_rm_ftz_f, | |
| 3200 | __nvvm_div_rn_d, | |
| 3201 | __nvvm_div_rn_f, | |
| 3202 | __nvvm_div_rn_ftz_f, | |
| 3203 | __nvvm_div_rp_d, | |
| 3204 | __nvvm_div_rp_f, | |
| 3205 | __nvvm_div_rp_ftz_f, | |
| 3206 | __nvvm_div_rz_d, | |
| 3207 | __nvvm_div_rz_f, | |
| 3208 | __nvvm_div_rz_ftz_f, | |
| 3209 | __nvvm_ex2_approx_d, | |
| 3210 | __nvvm_ex2_approx_f, | |
| 3211 | __nvvm_ex2_approx_ftz_f, | |
| 3212 | __nvvm_f2h_rn, | |
| 3213 | __nvvm_f2h_rn_ftz, | |
| 3214 | __nvvm_f2i_rm, | |
| 3215 | __nvvm_f2i_rm_ftz, | |
| 3216 | __nvvm_f2i_rn, | |
| 3217 | __nvvm_f2i_rn_ftz, | |
| 3218 | __nvvm_f2i_rp, | |
| 3219 | __nvvm_f2i_rp_ftz, | |
| 3220 | __nvvm_f2i_rz, | |
| 3221 | __nvvm_f2i_rz_ftz, | |
| 3222 | __nvvm_f2ll_rm, | |
| 3223 | __nvvm_f2ll_rm_ftz, | |
| 3224 | __nvvm_f2ll_rn, | |
| 3225 | __nvvm_f2ll_rn_ftz, | |
| 3226 | __nvvm_f2ll_rp, | |
| 3227 | __nvvm_f2ll_rp_ftz, | |
| 3228 | __nvvm_f2ll_rz, | |
| 3229 | __nvvm_f2ll_rz_ftz, | |
| 3230 | __nvvm_f2ui_rm, | |
| 3231 | __nvvm_f2ui_rm_ftz, | |
| 3232 | __nvvm_f2ui_rn, | |
| 3233 | __nvvm_f2ui_rn_ftz, | |
| 3234 | __nvvm_f2ui_rp, | |
| 3235 | __nvvm_f2ui_rp_ftz, | |
| 3236 | __nvvm_f2ui_rz, | |
| 3237 | __nvvm_f2ui_rz_ftz, | |
| 3238 | __nvvm_f2ull_rm, | |
| 3239 | __nvvm_f2ull_rm_ftz, | |
| 3240 | __nvvm_f2ull_rn, | |
| 3241 | __nvvm_f2ull_rn_ftz, | |
| 3242 | __nvvm_f2ull_rp, | |
| 3243 | __nvvm_f2ull_rp_ftz, | |
| 3244 | __nvvm_f2ull_rz, | |
| 3245 | __nvvm_f2ull_rz_ftz, | |
| 3246 | __nvvm_fabs_d, | |
| 3247 | __nvvm_fabs_f, | |
| 3248 | __nvvm_fabs_ftz_f, | |
| 3249 | __nvvm_floor_d, | |
| 3250 | __nvvm_floor_f, | |
| 3251 | __nvvm_floor_ftz_f, | |
| 3252 | __nvvm_fma_rm_d, | |
| 3253 | __nvvm_fma_rm_f, | |
| 3254 | __nvvm_fma_rm_ftz_f, | |
| 3255 | __nvvm_fma_rn_d, | |
| 3256 | __nvvm_fma_rn_f, | |
| 3257 | __nvvm_fma_rn_ftz_f, | |
| 3258 | __nvvm_fma_rp_d, | |
| 3259 | __nvvm_fma_rp_f, | |
| 3260 | __nvvm_fma_rp_ftz_f, | |
| 3261 | __nvvm_fma_rz_d, | |
| 3262 | __nvvm_fma_rz_f, | |
| 3263 | __nvvm_fma_rz_ftz_f, | |
| 3264 | __nvvm_fmax_d, | |
| 3265 | __nvvm_fmax_f, | |
| 3266 | __nvvm_fmax_ftz_f, | |
| 3267 | __nvvm_fmin_d, | |
| 3268 | __nvvm_fmin_f, | |
| 3269 | __nvvm_fmin_ftz_f, | |
| 3270 | __nvvm_i2d_rm, | |
| 3271 | __nvvm_i2d_rn, | |
| 3272 | __nvvm_i2d_rp, | |
| 3273 | __nvvm_i2d_rz, | |
| 3274 | __nvvm_i2f_rm, | |
| 3275 | __nvvm_i2f_rn, | |
| 3276 | __nvvm_i2f_rp, | |
| 3277 | __nvvm_i2f_rz, | |
| 3278 | __nvvm_isspacep_const, | |
| 3279 | __nvvm_isspacep_global, | |
| 3280 | __nvvm_isspacep_local, | |
| 3281 | __nvvm_isspacep_shared, | |
| 3282 | __nvvm_ldg_c, | |
| 3283 | __nvvm_ldg_c2, | |
| 3284 | __nvvm_ldg_c4, | |
| 3285 | __nvvm_ldg_d, | |
| 3286 | __nvvm_ldg_d2, | |
| 3287 | __nvvm_ldg_f, | |
| 3288 | __nvvm_ldg_f2, | |
| 3289 | __nvvm_ldg_f4, | |
| 3290 | __nvvm_ldg_h, | |
| 3291 | __nvvm_ldg_h2, | |
| 3292 | __nvvm_ldg_i, | |
| 3293 | __nvvm_ldg_i2, | |
| 3294 | __nvvm_ldg_i4, | |
| 3295 | __nvvm_ldg_l, | |
| 3296 | __nvvm_ldg_l2, | |
| 3297 | __nvvm_ldg_ll, | |
| 3298 | __nvvm_ldg_ll2, | |
| 3299 | __nvvm_ldg_s, | |
| 3300 | __nvvm_ldg_s2, | |
| 3301 | __nvvm_ldg_s4, | |
| 3302 | __nvvm_ldg_sc, | |
| 3303 | __nvvm_ldg_sc2, | |
| 3304 | __nvvm_ldg_sc4, | |
| 3305 | __nvvm_ldg_uc, | |
| 3306 | __nvvm_ldg_uc2, | |
| 3307 | __nvvm_ldg_uc4, | |
| 3308 | __nvvm_ldg_ui, | |
| 3309 | __nvvm_ldg_ui2, | |
| 3310 | __nvvm_ldg_ui4, | |
| 3311 | __nvvm_ldg_ul, | |
| 3312 | __nvvm_ldg_ul2, | |
| 3313 | __nvvm_ldg_ull, | |
| 3314 | __nvvm_ldg_ull2, | |
| 3315 | __nvvm_ldg_us, | |
| 3316 | __nvvm_ldg_us2, | |
| 3317 | __nvvm_ldg_us4, | |
| 3318 | __nvvm_ldu_c, | |
| 3319 | __nvvm_ldu_c2, | |
| 3320 | __nvvm_ldu_c4, | |
| 3321 | __nvvm_ldu_d, | |
| 3322 | __nvvm_ldu_d2, | |
| 3323 | __nvvm_ldu_f, | |
| 3324 | __nvvm_ldu_f2, | |
| 3325 | __nvvm_ldu_f4, | |
| 3326 | __nvvm_ldu_h, | |
| 3327 | __nvvm_ldu_h2, | |
| 3328 | __nvvm_ldu_i, | |
| 3329 | __nvvm_ldu_i2, | |
| 3330 | __nvvm_ldu_i4, | |
| 3331 | __nvvm_ldu_l, | |
| 3332 | __nvvm_ldu_l2, | |
| 3333 | __nvvm_ldu_ll, | |
| 3334 | __nvvm_ldu_ll2, | |
| 3335 | __nvvm_ldu_s, | |
| 3336 | __nvvm_ldu_s2, | |
| 3337 | __nvvm_ldu_s4, | |
| 3338 | __nvvm_ldu_sc, | |
| 3339 | __nvvm_ldu_sc2, | |
| 3340 | __nvvm_ldu_sc4, | |
| 3341 | __nvvm_ldu_uc, | |
| 3342 | __nvvm_ldu_uc2, | |
| 3343 | __nvvm_ldu_uc4, | |
| 3344 | __nvvm_ldu_ui, | |
| 3345 | __nvvm_ldu_ui2, | |
| 3346 | __nvvm_ldu_ui4, | |
| 3347 | __nvvm_ldu_ul, | |
| 3348 | __nvvm_ldu_ul2, | |
| 3349 | __nvvm_ldu_ull, | |
| 3350 | __nvvm_ldu_ull2, | |
| 3351 | __nvvm_ldu_us, | |
| 3352 | __nvvm_ldu_us2, | |
| 3353 | __nvvm_ldu_us4, | |
| 3354 | __nvvm_lg2_approx_d, | |
| 3355 | __nvvm_lg2_approx_f, | |
| 3356 | __nvvm_lg2_approx_ftz_f, | |
| 3357 | __nvvm_ll2d_rm, | |
| 3358 | __nvvm_ll2d_rn, | |
| 3359 | __nvvm_ll2d_rp, | |
| 3360 | __nvvm_ll2d_rz, | |
| 3361 | __nvvm_ll2f_rm, | |
| 3362 | __nvvm_ll2f_rn, | |
| 3363 | __nvvm_ll2f_rp, | |
| 3364 | __nvvm_ll2f_rz, | |
| 3365 | __nvvm_lohi_i2d, | |
| 3366 | __nvvm_membar_cta, | |
| 3367 | __nvvm_membar_gl, | |
| 3368 | __nvvm_membar_sys, | |
| 3369 | __nvvm_memcpy, | |
| 3370 | __nvvm_memset, | |
| 3371 | __nvvm_mul24_i, | |
| 3372 | __nvvm_mul24_ui, | |
| 3373 | __nvvm_mul_rm_d, | |
| 3374 | __nvvm_mul_rm_f, | |
| 3375 | __nvvm_mul_rm_ftz_f, | |
| 3376 | __nvvm_mul_rn_d, | |
| 3377 | __nvvm_mul_rn_f, | |
| 3378 | __nvvm_mul_rn_ftz_f, | |
| 3379 | __nvvm_mul_rp_d, | |
| 3380 | __nvvm_mul_rp_f, | |
| 3381 | __nvvm_mul_rp_ftz_f, | |
| 3382 | __nvvm_mul_rz_d, | |
| 3383 | __nvvm_mul_rz_f, | |
| 3384 | __nvvm_mul_rz_ftz_f, | |
| 3385 | __nvvm_mulhi_i, | |
| 3386 | __nvvm_mulhi_ll, | |
| 3387 | __nvvm_mulhi_ui, | |
| 3388 | __nvvm_mulhi_ull, | |
| 3389 | __nvvm_prmt, | |
| 3390 | __nvvm_rcp_approx_ftz_d, | |
| 3391 | __nvvm_rcp_approx_ftz_f, | |
| 3392 | __nvvm_rcp_rm_d, | |
| 3393 | __nvvm_rcp_rm_f, | |
| 3394 | __nvvm_rcp_rm_ftz_f, | |
| 3395 | __nvvm_rcp_rn_d, | |
| 3396 | __nvvm_rcp_rn_f, | |
| 3397 | __nvvm_rcp_rn_ftz_f, | |
| 3398 | __nvvm_rcp_rp_d, | |
| 3399 | __nvvm_rcp_rp_f, | |
| 3400 | __nvvm_rcp_rp_ftz_f, | |
| 3401 | __nvvm_rcp_rz_d, | |
| 3402 | __nvvm_rcp_rz_f, | |
| 3403 | __nvvm_rcp_rz_ftz_f, | |
| 3404 | __nvvm_read_ptx_sreg_clock, | |
| 3405 | __nvvm_read_ptx_sreg_clock64, | |
| 3406 | __nvvm_read_ptx_sreg_ctaid_w, | |
| 3407 | __nvvm_read_ptx_sreg_ctaid_x, | |
| 3408 | __nvvm_read_ptx_sreg_ctaid_y, | |
| 3409 | __nvvm_read_ptx_sreg_ctaid_z, | |
| 3410 | __nvvm_read_ptx_sreg_gridid, | |
| 3411 | __nvvm_read_ptx_sreg_laneid, | |
| 3412 | __nvvm_read_ptx_sreg_lanemask_eq, | |
| 3413 | __nvvm_read_ptx_sreg_lanemask_ge, | |
| 3414 | __nvvm_read_ptx_sreg_lanemask_gt, | |
| 3415 | __nvvm_read_ptx_sreg_lanemask_le, | |
| 3416 | __nvvm_read_ptx_sreg_lanemask_lt, | |
| 3417 | __nvvm_read_ptx_sreg_nctaid_w, | |
| 3418 | __nvvm_read_ptx_sreg_nctaid_x, | |
| 3419 | __nvvm_read_ptx_sreg_nctaid_y, | |
| 3420 | __nvvm_read_ptx_sreg_nctaid_z, | |
| 3421 | __nvvm_read_ptx_sreg_nsmid, | |
| 3422 | __nvvm_read_ptx_sreg_ntid_w, | |
| 3423 | __nvvm_read_ptx_sreg_ntid_x, | |
| 3424 | __nvvm_read_ptx_sreg_ntid_y, | |
| 3425 | __nvvm_read_ptx_sreg_ntid_z, | |
| 3426 | __nvvm_read_ptx_sreg_nwarpid, | |
| 3427 | __nvvm_read_ptx_sreg_pm0, | |
| 3428 | __nvvm_read_ptx_sreg_pm1, | |
| 3429 | __nvvm_read_ptx_sreg_pm2, | |
| 3430 | __nvvm_read_ptx_sreg_pm3, | |
| 3431 | __nvvm_read_ptx_sreg_smid, | |
| 3432 | __nvvm_read_ptx_sreg_tid_w, | |
| 3433 | __nvvm_read_ptx_sreg_tid_x, | |
| 3434 | __nvvm_read_ptx_sreg_tid_y, | |
| 3435 | __nvvm_read_ptx_sreg_tid_z, | |
| 3436 | __nvvm_read_ptx_sreg_warpid, | |
| 3437 | __nvvm_round_d, | |
| 3438 | __nvvm_round_f, | |
| 3439 | __nvvm_round_ftz_f, | |
| 3440 | __nvvm_rsqrt_approx_d, | |
| 3441 | __nvvm_rsqrt_approx_f, | |
| 3442 | __nvvm_rsqrt_approx_ftz_f, | |
| 3443 | __nvvm_sad_i, | |
| 3444 | __nvvm_sad_ui, | |
| 3445 | __nvvm_saturate_d, | |
| 3446 | __nvvm_saturate_f, | |
| 3447 | __nvvm_saturate_ftz_f, | |
| 3448 | __nvvm_shfl_bfly_f32, | |
| 3449 | __nvvm_shfl_bfly_i32, | |
| 3450 | __nvvm_shfl_down_f32, | |
| 3451 | __nvvm_shfl_down_i32, | |
| 3452 | __nvvm_shfl_idx_f32, | |
| 3453 | __nvvm_shfl_idx_i32, | |
| 3454 | __nvvm_shfl_up_f32, | |
| 3455 | __nvvm_shfl_up_i32, | |
| 3456 | __nvvm_sin_approx_f, | |
| 3457 | __nvvm_sin_approx_ftz_f, | |
| 3458 | __nvvm_sqrt_approx_f, | |
| 3459 | __nvvm_sqrt_approx_ftz_f, | |
| 3460 | __nvvm_sqrt_rm_d, | |
| 3461 | __nvvm_sqrt_rm_f, | |
| 3462 | __nvvm_sqrt_rm_ftz_f, | |
| 3463 | __nvvm_sqrt_rn_d, | |
| 3464 | __nvvm_sqrt_rn_f, | |
| 3465 | __nvvm_sqrt_rn_ftz_f, | |
| 3466 | __nvvm_sqrt_rp_d, | |
| 3467 | __nvvm_sqrt_rp_f, | |
| 3468 | __nvvm_sqrt_rp_ftz_f, | |
| 3469 | __nvvm_sqrt_rz_d, | |
| 3470 | __nvvm_sqrt_rz_f, | |
| 3471 | __nvvm_sqrt_rz_ftz_f, | |
| 3472 | __nvvm_trunc_d, | |
| 3473 | __nvvm_trunc_f, | |
| 3474 | __nvvm_trunc_ftz_f, | |
| 3475 | __nvvm_ui2d_rm, | |
| 3476 | __nvvm_ui2d_rn, | |
| 3477 | __nvvm_ui2d_rp, | |
| 3478 | __nvvm_ui2d_rz, | |
| 3479 | __nvvm_ui2f_rm, | |
| 3480 | __nvvm_ui2f_rn, | |
| 3481 | __nvvm_ui2f_rp, | |
| 3482 | __nvvm_ui2f_rz, | |
| 3483 | __nvvm_ull2d_rm, | |
| 3484 | __nvvm_ull2d_rn, | |
| 3485 | __nvvm_ull2d_rp, | |
| 3486 | __nvvm_ull2d_rz, | |
| 3487 | __nvvm_ull2f_rm, | |
| 3488 | __nvvm_ull2f_rn, | |
| 3489 | __nvvm_ull2f_rp, | |
| 3490 | __nvvm_ull2f_rz, | |
| 3491 | __nvvm_vote_all, | |
| 3492 | __nvvm_vote_any, | |
| 3493 | __nvvm_vote_ballot, | |
| 3494 | __nvvm_vote_uni, | |
| 3495 | __popcnt, | |
| 3496 | __popcnt16, | |
| 3497 | __popcnt64, | |
| 3498 | __rdtsc, | |
| 3499 | __sev, | |
| 3500 | __sevl, | |
| 3501 | __sigsetjmp, | |
| 3502 | __sinpi, | |
| 3503 | __sinpif, | |
| 3504 | __sync_add_and_fetch, | |
| 3505 | __sync_add_and_fetch_1, | |
| 3506 | __sync_add_and_fetch_16, | |
| 3507 | __sync_add_and_fetch_2, | |
| 3508 | __sync_add_and_fetch_4, | |
| 3509 | __sync_add_and_fetch_8, | |
| 3510 | __sync_and_and_fetch, | |
| 3511 | __sync_and_and_fetch_1, | |
| 3512 | __sync_and_and_fetch_16, | |
| 3513 | __sync_and_and_fetch_2, | |
| 3514 | __sync_and_and_fetch_4, | |
| 3515 | __sync_and_and_fetch_8, | |
| 3516 | __sync_bool_compare_and_swap, | |
| 3517 | __sync_bool_compare_and_swap_1, | |
| 3518 | __sync_bool_compare_and_swap_16, | |
| 3519 | __sync_bool_compare_and_swap_2, | |
| 3520 | __sync_bool_compare_and_swap_4, | |
| 3521 | __sync_bool_compare_and_swap_8, | |
| 3522 | __sync_fetch_and_add, | |
| 3523 | __sync_fetch_and_add_1, | |
| 3524 | __sync_fetch_and_add_16, | |
| 3525 | __sync_fetch_and_add_2, | |
| 3526 | __sync_fetch_and_add_4, | |
| 3527 | __sync_fetch_and_add_8, | |
| 3528 | __sync_fetch_and_and, | |
| 3529 | __sync_fetch_and_and_1, | |
| 3530 | __sync_fetch_and_and_16, | |
| 3531 | __sync_fetch_and_and_2, | |
| 3532 | __sync_fetch_and_and_4, | |
| 3533 | __sync_fetch_and_and_8, | |
| 3534 | __sync_fetch_and_max, | |
| 3535 | __sync_fetch_and_min, | |
| 3536 | __sync_fetch_and_nand, | |
| 3537 | __sync_fetch_and_nand_1, | |
| 3538 | __sync_fetch_and_nand_16, | |
| 3539 | __sync_fetch_and_nand_2, | |
| 3540 | __sync_fetch_and_nand_4, | |
| 3541 | __sync_fetch_and_nand_8, | |
| 3542 | __sync_fetch_and_or, | |
| 3543 | __sync_fetch_and_or_1, | |
| 3544 | __sync_fetch_and_or_16, | |
| 3545 | __sync_fetch_and_or_2, | |
| 3546 | __sync_fetch_and_or_4, | |
| 3547 | __sync_fetch_and_or_8, | |
| 3548 | __sync_fetch_and_sub, | |
| 3549 | __sync_fetch_and_sub_1, | |
| 3550 | __sync_fetch_and_sub_16, | |
| 3551 | __sync_fetch_and_sub_2, | |
| 3552 | __sync_fetch_and_sub_4, | |
| 3553 | __sync_fetch_and_sub_8, | |
| 3554 | __sync_fetch_and_umax, | |
| 3555 | __sync_fetch_and_umin, | |
| 3556 | __sync_fetch_and_xor, | |
| 3557 | __sync_fetch_and_xor_1, | |
| 3558 | __sync_fetch_and_xor_16, | |
| 3559 | __sync_fetch_and_xor_2, | |
| 3560 | __sync_fetch_and_xor_4, | |
| 3561 | __sync_fetch_and_xor_8, | |
| 3562 | __sync_lock_release, | |
| 3563 | __sync_lock_release_1, | |
| 3564 | __sync_lock_release_16, | |
| 3565 | __sync_lock_release_2, | |
| 3566 | __sync_lock_release_4, | |
| 3567 | __sync_lock_release_8, | |
| 3568 | __sync_lock_test_and_set, | |
| 3569 | __sync_lock_test_and_set_1, | |
| 3570 | __sync_lock_test_and_set_16, | |
| 3571 | __sync_lock_test_and_set_2, | |
| 3572 | __sync_lock_test_and_set_4, | |
| 3573 | __sync_lock_test_and_set_8, | |
| 3574 | __sync_nand_and_fetch, | |
| 3575 | __sync_nand_and_fetch_1, | |
| 3576 | __sync_nand_and_fetch_16, | |
| 3577 | __sync_nand_and_fetch_2, | |
| 3578 | __sync_nand_and_fetch_4, | |
| 3579 | __sync_nand_and_fetch_8, | |
| 3580 | __sync_or_and_fetch, | |
| 3581 | __sync_or_and_fetch_1, | |
| 3582 | __sync_or_and_fetch_16, | |
| 3583 | __sync_or_and_fetch_2, | |
| 3584 | __sync_or_and_fetch_4, | |
| 3585 | __sync_or_and_fetch_8, | |
| 3586 | __sync_sub_and_fetch, | |
| 3587 | __sync_sub_and_fetch_1, | |
| 3588 | __sync_sub_and_fetch_16, | |
| 3589 | __sync_sub_and_fetch_2, | |
| 3590 | __sync_sub_and_fetch_4, | |
| 3591 | __sync_sub_and_fetch_8, | |
| 3592 | __sync_swap, | |
| 3593 | __sync_swap_1, | |
| 3594 | __sync_swap_16, | |
| 3595 | __sync_swap_2, | |
| 3596 | __sync_swap_4, | |
| 3597 | __sync_swap_8, | |
| 3598 | __sync_synchronize, | |
| 3599 | __sync_val_compare_and_swap, | |
| 3600 | __sync_val_compare_and_swap_1, | |
| 3601 | __sync_val_compare_and_swap_16, | |
| 3602 | __sync_val_compare_and_swap_2, | |
| 3603 | __sync_val_compare_and_swap_4, | |
| 3604 | __sync_val_compare_and_swap_8, | |
| 3605 | __sync_xor_and_fetch, | |
| 3606 | __sync_xor_and_fetch_1, | |
| 3607 | __sync_xor_and_fetch_16, | |
| 3608 | __sync_xor_and_fetch_2, | |
| 3609 | __sync_xor_and_fetch_4, | |
| 3610 | __sync_xor_and_fetch_8, | |
| 3611 | __syncthreads, | |
| 3612 | __tanpi, | |
| 3613 | __tanpif, | |
| 3614 | __va_start, | |
| 3615 | __warn_memset_zero_len, | |
| 3616 | __wfe, | |
| 3617 | __wfi, | |
| 3618 | __xray_customevent, | |
| 3619 | __xray_typedevent, | |
| 3620 | __yield, | |
| 3621 | _abnormal_termination, | |
| 3622 | _alloca, | |
| 3623 | _bittest, | |
| 3624 | _bittest64, | |
| 3625 | _bittestandcomplement, | |
| 3626 | _bittestandcomplement64, | |
| 3627 | _bittestandreset, | |
| 3628 | _bittestandreset64, | |
| 3629 | _bittestandset, | |
| 3630 | _bittestandset64, | |
| 3631 | _byteswap_uint64, | |
| 3632 | _byteswap_ulong, | |
| 3633 | _byteswap_ushort, | |
| 3634 | _exception_code, | |
| 3635 | _exception_info, | |
| 3636 | _exit, | |
| 3637 | _interlockedbittestandreset, | |
| 3638 | _interlockedbittestandreset64, | |
| 3639 | _interlockedbittestandreset_acq, | |
| 3640 | _interlockedbittestandreset_nf, | |
| 3641 | _interlockedbittestandreset_rel, | |
| 3642 | _interlockedbittestandset, | |
| 3643 | _interlockedbittestandset64, | |
| 3644 | _interlockedbittestandset_acq, | |
| 3645 | _interlockedbittestandset_nf, | |
| 3646 | _interlockedbittestandset_rel, | |
| 3647 | _longjmp, | |
| 3648 | _lrotl, | |
| 3649 | _lrotr, | |
| 3650 | _rotl, | |
| 3651 | _rotl16, | |
| 3652 | _rotl64, | |
| 3653 | _rotl8, | |
| 3654 | _rotr, | |
| 3655 | _rotr16, | |
| 3656 | _rotr64, | |
| 3657 | _rotr8, | |
| 3658 | _setjmp, | |
| 3659 | _setjmpex, | |
| 3660 | abort, | |
| 3661 | abs, | |
| 3662 | acos, | |
| 3663 | acosf, | |
| 3664 | acosh, | |
| 3665 | acoshf, | |
| 3666 | acoshl, | |
| 3667 | acosl, | |
| 3668 | aligned_alloc, | |
| 3669 | alloca, | |
| 3670 | asin, | |
| 3671 | asinf, | |
| 3672 | asinh, | |
| 3673 | asinhf, | |
| 3674 | asinhl, | |
| 3675 | asinl, | |
| 3676 | atan, | |
| 3677 | atan2, | |
| 3678 | atan2f, | |
| 3679 | atan2l, | |
| 3680 | atanf, | |
| 3681 | atanh, | |
| 3682 | atanhf, | |
| 3683 | atanhl, | |
| 3684 | atanl, | |
| 3685 | bcmp, | |
| 3686 | bcopy, | |
| 3687 | bzero, | |
| 3688 | cabs, | |
| 3689 | cabsf, | |
| 3690 | cabsl, | |
| 3691 | cacos, | |
| 3692 | cacosf, | |
| 3693 | cacosh, | |
| 3694 | cacoshf, | |
| 3695 | cacoshl, | |
| 3696 | cacosl, | |
| 3697 | calloc, | |
| 3698 | carg, | |
| 3699 | cargf, | |
| 3700 | cargl, | |
| 3701 | casin, | |
| 3702 | casinf, | |
| 3703 | casinh, | |
| 3704 | casinhf, | |
| 3705 | casinhl, | |
| 3706 | casinl, | |
| 3707 | catan, | |
| 3708 | catanf, | |
| 3709 | catanh, | |
| 3710 | catanhf, | |
| 3711 | catanhl, | |
| 3712 | catanl, | |
| 3713 | cbrt, | |
| 3714 | cbrtf, | |
| 3715 | cbrtl, | |
| 3716 | ccos, | |
| 3717 | ccosf, | |
| 3718 | ccosh, | |
| 3719 | ccoshf, | |
| 3720 | ccoshl, | |
| 3721 | ccosl, | |
| 3722 | ceil, | |
| 3723 | ceilf, | |
| 3724 | ceill, | |
| 3725 | cexp, | |
| 3726 | cexpf, | |
| 3727 | cexpl, | |
| 3728 | cimag, | |
| 3729 | cimagf, | |
| 3730 | cimagl, | |
| 3731 | clog, | |
| 3732 | clogf, | |
| 3733 | clogl, | |
| 3734 | conj, | |
| 3735 | conjf, | |
| 3736 | conjl, | |
| 3737 | copysign, | |
| 3738 | copysignf, | |
| 3739 | copysignl, | |
| 3740 | cos, | |
| 3741 | cosf, | |
| 3742 | cosh, | |
| 3743 | coshf, | |
| 3744 | coshl, | |
| 3745 | cosl, | |
| 3746 | cpow, | |
| 3747 | cpowf, | |
| 3748 | cpowl, | |
| 3749 | cproj, | |
| 3750 | cprojf, | |
| 3751 | cprojl, | |
| 3752 | creal, | |
| 3753 | crealf, | |
| 3754 | creall, | |
| 3755 | csin, | |
| 3756 | csinf, | |
| 3757 | csinh, | |
| 3758 | csinhf, | |
| 3759 | csinhl, | |
| 3760 | csinl, | |
| 3761 | csqrt, | |
| 3762 | csqrtf, | |
| 3763 | csqrtl, | |
| 3764 | ctan, | |
| 3765 | ctanf, | |
| 3766 | ctanh, | |
| 3767 | ctanhf, | |
| 3768 | ctanhl, | |
| 3769 | ctanl, | |
| 3770 | erf, | |
| 3771 | erfc, | |
| 3772 | erfcf, | |
| 3773 | erfcl, | |
| 3774 | erff, | |
| 3775 | erfl, | |
| 3776 | exit, | |
| 3777 | exp, | |
| 3778 | exp2, | |
| 3779 | exp2f, | |
| 3780 | exp2l, | |
| 3781 | expf, | |
| 3782 | expl, | |
| 3783 | expm1, | |
| 3784 | expm1f, | |
| 3785 | expm1l, | |
| 3786 | fabs, | |
| 3787 | fabsf, | |
| 3788 | fabsl, | |
| 3789 | fdim, | |
| 3790 | fdimf, | |
| 3791 | fdiml, | |
| 3792 | finite, | |
| 3793 | finitef, | |
| 3794 | finitel, | |
| 3795 | floor, | |
| 3796 | floorf, | |
| 3797 | floorl, | |
| 3798 | fma, | |
| 3799 | fmaf, | |
| 3800 | fmal, | |
| 3801 | fmax, | |
| 3802 | fmaxf, | |
| 3803 | fmaxl, | |
| 3804 | fmin, | |
| 3805 | fminf, | |
| 3806 | fminl, | |
| 3807 | fmod, | |
| 3808 | fmodf, | |
| 3809 | fmodl, | |
| 3810 | fopen, | |
| 3811 | fprintf, | |
| 3812 | fread, | |
| 3813 | free, | |
| 3814 | frexp, | |
| 3815 | frexpf, | |
| 3816 | frexpl, | |
| 3817 | fscanf, | |
| 3818 | fwrite, | |
| 3819 | getcontext, | |
| 3820 | hypot, | |
| 3821 | hypotf, | |
| 3822 | hypotl, | |
| 3823 | ilogb, | |
| 3824 | ilogbf, | |
| 3825 | ilogbl, | |
| 3826 | index, | |
| 3827 | isalnum, | |
| 3828 | isalpha, | |
| 3829 | isblank, | |
| 3830 | iscntrl, | |
| 3831 | isdigit, | |
| 3832 | isgraph, | |
| 3833 | islower, | |
| 3834 | isprint, | |
| 3835 | ispunct, | |
| 3836 | isspace, | |
| 3837 | isupper, | |
| 3838 | isxdigit, | |
| 3839 | labs, | |
| 3840 | ldexp, | |
| 3841 | ldexpf, | |
| 3842 | ldexpl, | |
| 3843 | lgamma, | |
| 3844 | lgammaf, | |
| 3845 | lgammal, | |
| 3846 | llabs, | |
| 3847 | llrint, | |
| 3848 | llrintf, | |
| 3849 | llrintl, | |
| 3850 | llround, | |
| 3851 | llroundf, | |
| 3852 | llroundl, | |
| 3853 | log, | |
| 3854 | log10, | |
| 3855 | log10f, | |
| 3856 | log10l, | |
| 3857 | log1p, | |
| 3858 | log1pf, | |
| 3859 | log1pl, | |
| 3860 | log2, | |
| 3861 | log2f, | |
| 3862 | log2l, | |
| 3863 | logb, | |
| 3864 | logbf, | |
| 3865 | logbl, | |
| 3866 | logf, | |
| 3867 | logl, | |
| 3868 | longjmp, | |
| 3869 | lrint, | |
| 3870 | lrintf, | |
| 3871 | lrintl, | |
| 3872 | lround, | |
| 3873 | lroundf, | |
| 3874 | lroundl, | |
| 3875 | malloc, | |
| 3876 | memalign, | |
| 3877 | memccpy, | |
| 3878 | memchr, | |
| 3879 | memcmp, | |
| 3880 | memcpy, | |
| 3881 | memmove, | |
| 3882 | mempcpy, | |
| 3883 | memset, | |
| 3884 | modf, | |
| 3885 | modff, | |
| 3886 | modfl, | |
| 3887 | nan, | |
| 3888 | nanf, | |
| 3889 | nanl, | |
| 3890 | nearbyint, | |
| 3891 | nearbyintf, | |
| 3892 | nearbyintl, | |
| 3893 | nextafter, | |
| 3894 | nextafterf, | |
| 3895 | nextafterl, | |
| 3896 | nexttoward, | |
| 3897 | nexttowardf, | |
| 3898 | nexttowardl, | |
| 3899 | pow, | |
| 3900 | powf, | |
| 3901 | powl, | |
| 3902 | printf, | |
| 3903 | realloc, | |
| 3904 | remainder, | |
| 3905 | remainderf, | |
| 3906 | remainderl, | |
| 3907 | remquo, | |
| 3908 | remquof, | |
| 3909 | remquol, | |
| 3910 | rindex, | |
| 3911 | rint, | |
| 3912 | rintf, | |
| 3913 | rintl, | |
| 3914 | round, | |
| 3915 | roundeven, | |
| 3916 | roundevenf, | |
| 3917 | roundevenl, | |
| 3918 | roundf, | |
| 3919 | roundl, | |
| 3920 | savectx, | |
| 3921 | scalbln, | |
| 3922 | scalblnf, | |
| 3923 | scalblnl, | |
| 3924 | scalbn, | |
| 3925 | scalbnf, | |
| 3926 | scalbnl, | |
| 3927 | scanf, | |
| 3928 | setjmp, | |
| 3929 | siglongjmp, | |
| 3930 | sigsetjmp, | |
| 3931 | sin, | |
| 3932 | sinf, | |
| 3933 | sinh, | |
| 3934 | sinhf, | |
| 3935 | sinhl, | |
| 3936 | sinl, | |
| 3937 | snprintf, | |
| 3938 | sprintf, | |
| 3939 | sqrt, | |
| 3940 | sqrtf, | |
| 3941 | sqrtl, | |
| 3942 | sscanf, | |
| 3943 | stpcpy, | |
| 3944 | stpncpy, | |
| 3945 | strcasecmp, | |
| 3946 | strcat, | |
| 3947 | strchr, | |
| 3948 | strcmp, | |
| 3949 | strcpy, | |
| 3950 | strcspn, | |
| 3951 | strdup, | |
| 3952 | strerror, | |
| 3953 | strlcat, | |
| 3954 | strlcpy, | |
| 3955 | strlen, | |
| 3956 | strncasecmp, | |
| 3957 | strncat, | |
| 3958 | strncmp, | |
| 3959 | strncpy, | |
| 3960 | strndup, | |
| 3961 | strpbrk, | |
| 3962 | strrchr, | |
| 3963 | strspn, | |
| 3964 | strstr, | |
| 3965 | strtod, | |
| 3966 | strtof, | |
| 3967 | strtok, | |
| 3968 | strtol, | |
| 3969 | strtold, | |
| 3970 | strtoll, | |
| 3971 | strtoul, | |
| 3972 | strtoull, | |
| 3973 | strxfrm, | |
| 3974 | tan, | |
| 3975 | tanf, | |
| 3976 | tanh, | |
| 3977 | tanhf, | |
| 3978 | tanhl, | |
| 3979 | tanl, | |
| 3980 | tgamma, | |
| 3981 | tgammaf, | |
| 3982 | tgammal, | |
| 3983 | tolower, | |
| 3984 | toupper, | |
| 3985 | trunc, | |
| 3986 | truncf, | |
| 3987 | truncl, | |
| 3988 | va_copy, | |
| 3989 | va_end, | |
| 3990 | va_start, | |
| 3991 | vfork, | |
| 3992 | vfprintf, | |
| 3993 | vfscanf, | |
| 3994 | vprintf, | |
| 3995 | vscanf, | |
| 3996 | vsnprintf, | |
| 3997 | vsprintf, | |
| 3998 | vsscanf, | |
| 3999 | wcschr, | |
| 4000 | wcscmp, | |
| 4001 | wcslen, | |
| 4002 | wcsncmp, | |
| 4003 | wmemchr, | |
| 4004 | wmemcmp, | |
| 4005 | wmemcpy, | |
| 4006 | wmemmove, | |
| 4007 | }; | |
| 17 | 4008 | |
| 18 | 4009 | const Self = @This(); |
| 19 | 4010 | |
| ... | ... | @@ -71,7 +4062,7 @@ pub const longest_name = 43; |
| 71 | 4062 | /// If found, returns the index of the node within the `dafsa` array. |
| 72 | 4063 | /// Otherwise, returns `null`. |
| 73 | 4064 | pub fn findInList(first_child_index: u16, char: u8) ?u16 { |
| 74 | @setEvalBranchQuota(7972); | |
| 4065 | @setEvalBranchQuota(7982); | |
| 75 | 4066 | var index = first_child_index; |
| 76 | 4067 | while (true) { |
| 77 | 4068 | if (dafsa[index].char == char) return index; |
| ... | ... | @@ -119,7 +4110,7 @@ pub fn nameFromUniqueIndex(index: u16, buf: []u8) []u8 { |
| 119 | 4110 | |
| 120 | 4111 | var node_index: u16 = 0; |
| 121 | 4112 | var count: u16 = index; |
| 122 | var w: std.Io.Writer = .fixed(buf); | |
| 4113 | var w = std.Io.Writer.fixed(buf); | |
| 123 | 4114 | |
| 124 | 4115 | while (true) { |
| 125 | 4116 | var sibling_index = dafsa[node_index].child_index; |
| ... | ... | @@ -176,7 +4167,7 @@ const Node = packed struct(u64) { |
| 176 | 4167 | |
| 177 | 4168 | const dafsa = [_]Node{ |
| 178 | 4169 | .{ .char = 0, .end_of_word = false, .end_of_list = true, .number = 0, .child_index = 1 }, |
| 179 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3639, .child_index = 19 }, | |
| 4170 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3644, .child_index = 19 }, | |
| 180 | 4171 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 32 }, |
| 181 | 4172 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 37 }, |
| 182 | 4173 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 82, .child_index = 39 }, |
| ... | ... | @@ -199,7 +4190,7 @@ const dafsa = [_]Node{ |
| 199 | 4190 | .{ .char = 'I', .end_of_word = false, .end_of_list = false, .number = 29, .child_index = 104 }, |
| 200 | 4191 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 105 }, |
| 201 | 4192 | .{ .char = 'R', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 106 }, |
| 202 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3563, .child_index = 107 }, | |
| 4193 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3568, .child_index = 107 }, | |
| 203 | 4194 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 125 }, |
| 204 | 4195 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 127 }, |
| 205 | 4196 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 129 }, |
| ... | ... | @@ -284,7 +4275,7 @@ const dafsa = [_]Node{ |
| 284 | 4275 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 241 }, |
| 285 | 4276 | .{ .char = 'G', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 242 }, |
| 286 | 4277 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 34, .child_index = 243 }, |
| 287 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2967, .child_index = 248 }, | |
| 4278 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2972, .child_index = 248 }, | |
| 288 | 4279 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 249 }, |
| 289 | 4280 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 252 }, |
| 290 | 4281 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 255 }, |
| ... | ... | @@ -423,7 +4414,7 @@ const dafsa = [_]Node{ |
| 423 | 4414 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 404 }, |
| 424 | 4415 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 405 }, |
| 425 | 4416 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 406 }, |
| 426 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 407 }, | |
| 4417 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 407 }, | |
| 427 | 4418 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 17, .child_index = 408 }, |
| 428 | 4419 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 409 }, |
| 429 | 4420 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 410 }, |
| ... | ... | @@ -582,7 +4573,7 @@ const dafsa = [_]Node{ |
| 582 | 4573 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 534 }, |
| 583 | 4574 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 535 }, |
| 584 | 4575 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 536 }, |
| 585 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 537 }, | |
| 4576 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 537 }, | |
| 586 | 4577 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 538 }, |
| 587 | 4578 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 539 }, |
| 588 | 4579 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 540 }, |
| ... | ... | @@ -712,7 +4703,7 @@ const dafsa = [_]Node{ |
| 712 | 4703 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 625 }, |
| 713 | 4704 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 626 }, |
| 714 | 4705 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 627 }, |
| 715 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 628 }, | |
| 4706 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 628 }, | |
| 716 | 4707 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 629 }, |
| 717 | 4708 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 630 }, |
| 718 | 4709 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 631 }, |
| ... | ... | @@ -803,7 +4794,7 @@ const dafsa = [_]Node{ |
| 803 | 4794 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 675 }, |
| 804 | 4795 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 805 | 4796 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 676 }, |
| 806 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 677 }, | |
| 4797 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 677 }, | |
| 807 | 4798 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 678 }, |
| 808 | 4799 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 679 }, |
| 809 | 4800 | .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, |
| ... | ... | @@ -852,7 +4843,7 @@ const dafsa = [_]Node{ |
| 852 | 4843 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 731 }, |
| 853 | 4844 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 732 }, |
| 854 | 4845 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 733 }, |
| 855 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 734 }, | |
| 4846 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 734 }, | |
| 856 | 4847 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 735 }, |
| 857 | 4848 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 736 }, |
| 858 | 4849 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| ... | ... | @@ -909,7 +4900,7 @@ const dafsa = [_]Node{ |
| 909 | 4900 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 804 }, |
| 910 | 4901 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 805 }, |
| 911 | 4902 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 806 }, |
| 912 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 818 }, | |
| 4903 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 818 }, | |
| 913 | 4904 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 819 }, |
| 914 | 4905 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 820 }, |
| 915 | 4906 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 821 }, |
| ... | ... | @@ -993,7 +4984,7 @@ const dafsa = [_]Node{ |
| 993 | 4984 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 905 }, |
| 994 | 4985 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 908 }, |
| 995 | 4986 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 910 }, |
| 996 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 911 }, | |
| 4987 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 911 }, | |
| 997 | 4988 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 932 }, |
| 998 | 4989 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 933 }, |
| 999 | 4990 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 934 }, |
| ... | ... | @@ -1088,8 +5079,8 @@ const dafsa = [_]Node{ |
| 1088 | 5079 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 904 }, |
| 1089 | 5080 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 1018 }, |
| 1090 | 5081 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 302, .child_index = 1019 }, |
| 1091 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1028 }, | |
| 1092 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 114, .child_index = 1032 }, | |
| 5082 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1028 }, | |
| 5083 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 115, .child_index = 1032 }, | |
| 1093 | 5084 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1044 }, |
| 1094 | 5085 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 58, .child_index = 1049 }, |
| 1095 | 5086 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 49, .child_index = 1053 }, |
| ... | ... | @@ -1099,707 +5090,716 @@ const dafsa = [_]Node{ |
| 1099 | 5090 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 52, .child_index = 1068 }, |
| 1100 | 5091 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 686, .child_index = 1074 }, |
| 1101 | 5092 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 1080 }, |
| 1102 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1083 }, | |
| 1103 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 142, .child_index = 1086 }, | |
| 1104 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 52, .child_index = 1091 }, | |
| 1105 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 1095 }, | |
| 1106 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 1107 }, | |
| 1107 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 1111 }, | |
| 1108 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 1273, .child_index = 1115 }, | |
| 1109 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 22, .child_index = 1120 }, | |
| 1110 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1123 }, | |
| 1111 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1124 }, | |
| 5093 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1083 }, | |
| 5094 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 142, .child_index = 1087 }, | |
| 5095 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 52, .child_index = 1092 }, | |
| 5096 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 1096 }, | |
| 5097 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1108 }, | |
| 5098 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 1113 }, | |
| 5099 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 1274, .child_index = 1117 }, | |
| 5100 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 22, .child_index = 1122 }, | |
| 5101 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1125 }, | |
| 5102 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1126 }, | |
| 1112 | 5103 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, |
| 1113 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1125 }, | |
| 1114 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1126 }, | |
| 1115 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1127 }, | |
| 1116 | .{ .char = '0', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1128 }, | |
| 1117 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1129 }, | |
| 1118 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1130 }, | |
| 1119 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1120 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1132 }, | |
| 1121 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1133 }, | |
| 1122 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1134 }, | |
| 1123 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1135 }, | |
| 5104 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1127 }, | |
| 5105 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1128 }, | |
| 5106 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1129 }, | |
| 5107 | .{ .char = '0', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1130 }, | |
| 5108 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1131 }, | |
| 5109 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1132 }, | |
| 5110 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5111 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1134 }, | |
| 5112 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1135 }, | |
| 5113 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1136 }, | |
| 5114 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1137 }, | |
| 1124 | 5115 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 960 }, |
| 1125 | 5116 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 960 }, |
| 1126 | 5117 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 946 }, |
| 1127 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1138 }, | |
| 1128 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1140 }, | |
| 1129 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1141 }, | |
| 5118 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1140 }, | |
| 5119 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1142 }, | |
| 5120 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1143 }, | |
| 1130 | 5121 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 944 }, |
| 1131 | 5122 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 944 }, |
| 1132 | 5123 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 952 }, |
| 1133 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1134 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1142 }, | |
| 1135 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1126 }, | |
| 1136 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1137 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1138 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1143 }, | |
| 1139 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1144 }, | |
| 1140 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1145 }, | |
| 1141 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1153 }, | |
| 1142 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1154 }, | |
| 5124 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5125 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1144 }, | |
| 5126 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1128 }, | |
| 5127 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5128 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5129 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1145 }, | |
| 5130 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1146 }, | |
| 5131 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1147 }, | |
| 5132 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1155 }, | |
| 5133 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1156 }, | |
| 1143 | 5134 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 292 }, |
| 1144 | 5135 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 486 }, |
| 1145 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1155 }, | |
| 1146 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1126 }, | |
| 1147 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1156 }, | |
| 1148 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1157 }, | |
| 1149 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1159 }, | |
| 1150 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1160 }, | |
| 1151 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1161 }, | |
| 1152 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1162 }, | |
| 1153 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1164 }, | |
| 1154 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1165 }, | |
| 5136 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1157 }, | |
| 5137 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1128 }, | |
| 5138 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1158 }, | |
| 5139 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1159 }, | |
| 5140 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1161 }, | |
| 5141 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1162 }, | |
| 5142 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1163 }, | |
| 5143 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1164 }, | |
| 5144 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1166 }, | |
| 5145 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1167 }, | |
| 1155 | 5146 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 949 }, |
| 1156 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1166 }, | |
| 1157 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1167 }, | |
| 1158 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1168 }, | |
| 1159 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1169 }, | |
| 1160 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1170 }, | |
| 1161 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 1162 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1172 }, | |
| 1163 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 1164 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1174 }, | |
| 1165 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1175 }, | |
| 1166 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1176 }, | |
| 1167 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1177 }, | |
| 5147 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1168 }, | |
| 5148 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1169 }, | |
| 5149 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1170 }, | |
| 5150 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1171 }, | |
| 5151 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1172 }, | |
| 5152 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 5153 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1174 }, | |
| 5154 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1175 }, | |
| 5155 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1176 }, | |
| 5156 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1177 }, | |
| 1168 | 5157 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1178 }, |
| 1169 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1179 }, | |
| 1170 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1182 }, | |
| 1171 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1185 }, | |
| 1172 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1187 }, | |
| 1173 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1188 }, | |
| 1174 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 29, .child_index = 1189 }, | |
| 1175 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1196 }, | |
| 1176 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, | |
| 1177 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1198 }, | |
| 1178 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 5158 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1179 }, | |
| 5159 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1180 }, | |
| 5160 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1181 }, | |
| 5161 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1184 }, | |
| 5162 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1187 }, | |
| 5163 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1189 }, | |
| 5164 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1190 }, | |
| 5165 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 29, .child_index = 1191 }, | |
| 5166 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1198 }, | |
| 5167 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 5168 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1200 }, | |
| 5169 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, | |
| 1179 | 5170 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, |
| 1180 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1200 }, | |
| 1181 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, | |
| 1182 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1202 }, | |
| 1183 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1203 }, | |
| 1184 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1204 }, | |
| 1185 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1205 }, | |
| 1186 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1206 }, | |
| 5171 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1202 }, | |
| 5172 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1203 }, | |
| 5173 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1204 }, | |
| 5174 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1205 }, | |
| 5175 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1206 }, | |
| 5176 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1207 }, | |
| 5177 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1208 }, | |
| 1187 | 5178 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, |
| 1188 | 5179 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, |
| 1189 | 5180 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1001 }, |
| 1190 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1207 }, | |
| 1191 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1208 }, | |
| 1192 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1209 }, | |
| 5181 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1209 }, | |
| 5182 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1210 }, | |
| 5183 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1211 }, | |
| 1193 | 5184 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, |
| 1194 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1210 }, | |
| 1195 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1211 }, | |
| 1196 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 1212 }, | |
| 5185 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1212 }, | |
| 5186 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1213 }, | |
| 5187 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 1214 }, | |
| 1197 | 5188 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 135 }, |
| 1198 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1221 }, | |
| 1199 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1222 }, | |
| 1200 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1223 }, | |
| 1201 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 122, .child_index = 1225 }, | |
| 5189 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1223 }, | |
| 5190 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1224 }, | |
| 5191 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1225 }, | |
| 5192 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 122, .child_index = 1227 }, | |
| 1202 | 5193 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 403 }, |
| 1203 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 134, .child_index = 1226 }, | |
| 1204 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1227 }, | |
| 1205 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1229 }, | |
| 5194 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 134, .child_index = 1228 }, | |
| 5195 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1229 }, | |
| 5196 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1231 }, | |
| 1206 | 5197 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 142 }, |
| 1207 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1230 }, | |
| 1208 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1231 }, | |
| 5198 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1232 }, | |
| 5199 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1233 }, | |
| 1209 | 5200 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 144 }, |
| 1210 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 1232 }, | |
| 1211 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1239 }, | |
| 5201 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 1234 }, | |
| 5202 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1241 }, | |
| 1212 | 5203 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 137 }, |
| 1213 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1240 }, | |
| 1214 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1242 }, | |
| 5204 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1242 }, | |
| 5205 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1244 }, | |
| 1215 | 5206 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 154 }, |
| 1216 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1243 }, | |
| 1217 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1247 }, | |
| 1218 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1251 }, | |
| 5207 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1246 }, | |
| 5208 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1250 }, | |
| 5209 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1254 }, | |
| 1219 | 5210 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 161 }, |
| 1220 | 5211 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 162 }, |
| 1221 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1254 }, | |
| 1222 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1256 }, | |
| 1223 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1257 }, | |
| 1224 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1258 }, | |
| 1225 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1259 }, | |
| 1226 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1260 }, | |
| 1227 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1261 }, | |
| 1228 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 1262 }, | |
| 1229 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1263 }, | |
| 1230 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 23, .child_index = 1264 }, | |
| 1231 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1266 }, | |
| 1232 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1267 }, | |
| 1233 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1268 }, | |
| 1234 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1269 }, | |
| 1235 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1271 }, | |
| 1236 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1274 }, | |
| 1237 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1276 }, | |
| 5212 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1257 }, | |
| 5213 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1259 }, | |
| 5214 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1260 }, | |
| 5215 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1261 }, | |
| 5216 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1262 }, | |
| 5217 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1263 }, | |
| 5218 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1264 }, | |
| 5219 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 1265 }, | |
| 5220 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1266 }, | |
| 5221 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 23, .child_index = 1267 }, | |
| 5222 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1269 }, | |
| 5223 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1270 }, | |
| 5224 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1271 }, | |
| 5225 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1272 }, | |
| 5226 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1274 }, | |
| 5227 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1277 }, | |
| 5228 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1279 }, | |
| 1238 | 5229 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 178 }, |
| 1239 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1279 }, | |
| 1240 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1280 }, | |
| 1241 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1281 }, | |
| 1242 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1282 }, | |
| 1243 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1283 }, | |
| 1244 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1284 }, | |
| 1245 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1287 }, | |
| 1246 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1294 }, | |
| 1247 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1296 }, | |
| 1248 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1297 }, | |
| 1249 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1298 }, | |
| 1250 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 1300 }, | |
| 1251 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1302 }, | |
| 1252 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1304 }, | |
| 1253 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1306 }, | |
| 1254 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 135, .child_index = 1307 }, | |
| 1255 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1308 }, | |
| 1256 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 534, .child_index = 1309 }, | |
| 1257 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1310 }, | |
| 1258 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1311 }, | |
| 1259 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1312 }, | |
| 1260 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1314 }, | |
| 1261 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1315 }, | |
| 1262 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1316 }, | |
| 1263 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1317 }, | |
| 1264 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1318 }, | |
| 1265 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1320 }, | |
| 1266 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 108, .child_index = 1322 }, | |
| 1267 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1323 }, | |
| 1268 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1325 }, | |
| 1269 | .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1326 }, | |
| 1270 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 1327 }, | |
| 1271 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1331 }, | |
| 1272 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 1332 }, | |
| 1273 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1334 }, | |
| 1274 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1335 }, | |
| 1275 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1336 }, | |
| 1276 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1337 }, | |
| 1277 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1338 }, | |
| 1278 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1340 }, | |
| 5230 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1282 }, | |
| 5231 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1283 }, | |
| 5232 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1284 }, | |
| 5233 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1285 }, | |
| 5234 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1286 }, | |
| 5235 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1287 }, | |
| 5236 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1290 }, | |
| 5237 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1297 }, | |
| 5238 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1299 }, | |
| 5239 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1300 }, | |
| 5240 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1301 }, | |
| 5241 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 1303 }, | |
| 5242 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1305 }, | |
| 5243 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1307 }, | |
| 5244 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1309 }, | |
| 5245 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 135, .child_index = 1310 }, | |
| 5246 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1311 }, | |
| 5247 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 534, .child_index = 1312 }, | |
| 5248 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1313 }, | |
| 5249 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1314 }, | |
| 5250 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1315 }, | |
| 5251 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1317 }, | |
| 5252 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1318 }, | |
| 5253 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1319 }, | |
| 5254 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1320 }, | |
| 5255 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1321 }, | |
| 5256 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1322 }, | |
| 5257 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1324 }, | |
| 5258 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 108, .child_index = 1326 }, | |
| 5259 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1327 }, | |
| 5260 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1329 }, | |
| 5261 | .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1330 }, | |
| 5262 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 1331 }, | |
| 5263 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1335 }, | |
| 5264 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 1336 }, | |
| 5265 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1338 }, | |
| 5266 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1339 }, | |
| 5267 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1340 }, | |
| 5268 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1341 }, | |
| 5269 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1342 }, | |
| 5270 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1344 }, | |
| 1279 | 5271 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 220 }, |
| 1280 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1341 }, | |
| 1281 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1343 }, | |
| 1282 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1344 }, | |
| 1283 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1346 }, | |
| 1284 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1349 }, | |
| 1285 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1350 }, | |
| 1286 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1297 }, | |
| 1287 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1351 }, | |
| 1288 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1352 }, | |
| 1289 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1334 }, | |
| 1290 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1340 }, | |
| 1291 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1354 }, | |
| 1292 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1357 }, | |
| 1293 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 227 }, | |
| 1294 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1263, .child_index = 1358 }, | |
| 1295 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1359 }, | |
| 5272 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1345 }, | |
| 5273 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1347 }, | |
| 5274 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1348 }, | |
| 5275 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1350 }, | |
| 5276 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1353 }, | |
| 5277 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1354 }, | |
| 5278 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1300 }, | |
| 5279 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1355 }, | |
| 5280 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1356 }, | |
| 5281 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1358 }, | |
| 5282 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1338 }, | |
| 5283 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1344 }, | |
| 5284 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1359 }, | |
| 5285 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1362 }, | |
| 5286 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1363 }, | |
| 5287 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1263, .child_index = 1364 }, | |
| 5288 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1365 }, | |
| 1296 | 5289 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 176 }, |
| 1297 | 5290 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 231 }, |
| 1298 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 1361 }, | |
| 5291 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 1367 }, | |
| 1299 | 5292 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 235 }, |
| 1300 | 5293 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 236 }, |
| 1301 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1362 }, | |
| 5294 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1368 }, | |
| 1302 | 5295 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 1303 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1363 }, | |
| 1304 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1364 }, | |
| 1305 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1368 }, | |
| 1306 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1376 }, | |
| 1307 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, | |
| 1308 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1380 }, | |
| 1309 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1381 }, | |
| 1310 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1383 }, | |
| 1311 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1384 }, | |
| 1312 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1385 }, | |
| 1313 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1389 }, | |
| 5296 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1369 }, | |
| 5297 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1370 }, | |
| 5298 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1374 }, | |
| 5299 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1382 }, | |
| 5300 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, | |
| 5301 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1386 }, | |
| 5302 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1387 }, | |
| 5303 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1389 }, | |
| 5304 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1390 }, | |
| 5305 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1391 }, | |
| 5306 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1395 }, | |
| 1314 | 5307 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 451 }, |
| 1315 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1390 }, | |
| 1316 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1384 }, | |
| 1317 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1364 }, | |
| 1318 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1394 }, | |
| 1319 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1395 }, | |
| 1320 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1321 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1390 }, | |
| 1322 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1396 }, | |
| 1323 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, | |
| 1324 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1399 }, | |
| 1325 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, | |
| 1326 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1399 }, | |
| 1327 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, | |
| 1328 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1400 }, | |
| 1329 | .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 6, .child_index = 1402 }, | |
| 1330 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1405 }, | |
| 1331 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1409 }, | |
| 1332 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1410 }, | |
| 5308 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1396 }, | |
| 5309 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1390 }, | |
| 5310 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1370 }, | |
| 5311 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1400 }, | |
| 5312 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1401 }, | |
| 5313 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5314 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1396 }, | |
| 5315 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1402 }, | |
| 5316 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, | |
| 5317 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1405 }, | |
| 5318 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, | |
| 5319 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1405 }, | |
| 5320 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, | |
| 5321 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1406 }, | |
| 5322 | .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 6, .child_index = 1408 }, | |
| 5323 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1411 }, | |
| 5324 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1415 }, | |
| 5325 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1416 }, | |
| 1333 | 5326 | .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 974 }, |
| 1334 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1411 }, | |
| 1335 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1412 }, | |
| 1336 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1364 }, | |
| 1337 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1413 }, | |
| 1338 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 5327 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1417 }, | |
| 5328 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1418 }, | |
| 5329 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1370 }, | |
| 5330 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1419 }, | |
| 5331 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 1339 | 5332 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 950 }, |
| 1340 | 5333 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1341 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, | |
| 1342 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1414 }, | |
| 1343 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1415 }, | |
| 1344 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1345 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1419 }, | |
| 1346 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1422 }, | |
| 1347 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1423 }, | |
| 1348 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1425 }, | |
| 1349 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1426 }, | |
| 1350 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1430 }, | |
| 1351 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1431 }, | |
| 5334 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, | |
| 5335 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1420 }, | |
| 5336 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1421 }, | |
| 5337 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5338 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1425 }, | |
| 5339 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1428 }, | |
| 5340 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1429 }, | |
| 5341 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1431 }, | |
| 5342 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1432 }, | |
| 5343 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1436 }, | |
| 5344 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1437 }, | |
| 1352 | 5345 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 1353 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1432 }, | |
| 1354 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1433 }, | |
| 1355 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1434 }, | |
| 1356 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1435 }, | |
| 1357 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1436 }, | |
| 1358 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1437 }, | |
| 1359 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1438 }, | |
| 1360 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1439 }, | |
| 1361 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1440 }, | |
| 1362 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1441 }, | |
| 1363 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1442 }, | |
| 1364 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1443 }, | |
| 1365 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1444 }, | |
| 1366 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1445 }, | |
| 1367 | .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1446 }, | |
| 1368 | .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1447 }, | |
| 1369 | .{ .char = 'D', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1448 }, | |
| 1370 | .{ .char = 'E', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1449 }, | |
| 1371 | .{ .char = 'I', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1450 }, | |
| 1372 | .{ .char = 'O', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1451 }, | |
| 1373 | .{ .char = 'X', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1452 }, | |
| 1374 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1453 }, | |
| 5346 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1438 }, | |
| 5347 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1439 }, | |
| 5348 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1440 }, | |
| 5349 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1441 }, | |
| 5350 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1442 }, | |
| 5351 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1443 }, | |
| 5352 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1444 }, | |
| 5353 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1445 }, | |
| 5354 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1446 }, | |
| 5355 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1447 }, | |
| 5356 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1448 }, | |
| 5357 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1449 }, | |
| 5358 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1450 }, | |
| 5359 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1451 }, | |
| 5360 | .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1452 }, | |
| 5361 | .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1453 }, | |
| 5362 | .{ .char = 'D', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1454 }, | |
| 5363 | .{ .char = 'E', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1455 }, | |
| 5364 | .{ .char = 'I', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1456 }, | |
| 5365 | .{ .char = 'O', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1457 }, | |
| 5366 | .{ .char = 'X', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1458 }, | |
| 5367 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1459 }, | |
| 1375 | 5368 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 1376 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1454 }, | |
| 1377 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1455 }, | |
| 1378 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1456 }, | |
| 5369 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1460 }, | |
| 5370 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1461 }, | |
| 5371 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1462 }, | |
| 1379 | 5372 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 1380 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1457 }, | |
| 1381 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1458 }, | |
| 1382 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1459 }, | |
| 1383 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1460 }, | |
| 1384 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1461 }, | |
| 1385 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1462 }, | |
| 1386 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1463 }, | |
| 1387 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1464 }, | |
| 1388 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1465 }, | |
| 1389 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1466 }, | |
| 1390 | .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1467 }, | |
| 1391 | .{ .char = 'N', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1468 }, | |
| 1392 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1469 }, | |
| 1393 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, | |
| 1394 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1471 }, | |
| 1395 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1472 }, | |
| 1396 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, | |
| 1397 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1474 }, | |
| 1398 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1477 }, | |
| 1399 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1480 }, | |
| 1400 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1481 }, | |
| 1401 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1483 }, | |
| 1402 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1484 }, | |
| 1403 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1485 }, | |
| 1404 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1486 }, | |
| 1405 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1350 }, | |
| 1406 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1487 }, | |
| 1407 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1488 }, | |
| 1408 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1489 }, | |
| 1409 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1490 }, | |
| 5373 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1463 }, | |
| 5374 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1464 }, | |
| 5375 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1465 }, | |
| 5376 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1466 }, | |
| 5377 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1467 }, | |
| 5378 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1468 }, | |
| 5379 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1469 }, | |
| 5380 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1470 }, | |
| 5381 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1471 }, | |
| 5382 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1472 }, | |
| 5383 | .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, | |
| 5384 | .{ .char = 'N', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1474 }, | |
| 5385 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1475 }, | |
| 5386 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, | |
| 5387 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1477 }, | |
| 5388 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1478 }, | |
| 5389 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1479 }, | |
| 5390 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1480 }, | |
| 5391 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1483 }, | |
| 5392 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1486 }, | |
| 5393 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1487 }, | |
| 5394 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1489 }, | |
| 5395 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1490 }, | |
| 5396 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1491 }, | |
| 5397 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1492 }, | |
| 5398 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1354 }, | |
| 5399 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1493 }, | |
| 5400 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1494 }, | |
| 5401 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1495 }, | |
| 5402 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1497 }, | |
| 1410 | 5403 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 294 }, |
| 1411 | 5404 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 137 }, |
| 1412 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1491 }, | |
| 1413 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1492 }, | |
| 5405 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1498 }, | |
| 5406 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1499 }, | |
| 1414 | 5407 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 296 }, |
| 1415 | 5408 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 140 }, |
| 1416 | 5409 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 164 }, |
| 1417 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1493 }, | |
| 1418 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1494 }, | |
| 5410 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1500 }, | |
| 5411 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1501 }, | |
| 1419 | 5412 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 299 }, |
| 1420 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1495 }, | |
| 1421 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1496 }, | |
| 5413 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1502 }, | |
| 5414 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1503 }, | |
| 5415 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1504 }, | |
| 1422 | 5416 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 296 }, |
| 1423 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1497 }, | |
| 1424 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1498 }, | |
| 1425 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1500 }, | |
| 1426 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1501 }, | |
| 1427 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1504 }, | |
| 1428 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1505 }, | |
| 5417 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1505 }, | |
| 5418 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1506 }, | |
| 5419 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1508 }, | |
| 5420 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1509 }, | |
| 5421 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1512 }, | |
| 5422 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1513 }, | |
| 1429 | 5423 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 209 }, |
| 1430 | 5424 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 306 }, |
| 1431 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1508 }, | |
| 5425 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1516 }, | |
| 1432 | 5426 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 223 }, |
| 1433 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1498 }, | |
| 5427 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1506 }, | |
| 1434 | 5428 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 1435 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1509 }, | |
| 1436 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1510 }, | |
| 1437 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1511 }, | |
| 1438 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1512 }, | |
| 1439 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1513 }, | |
| 1440 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1514 }, | |
| 1441 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1515 }, | |
| 1442 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 21, .child_index = 1518 }, | |
| 1443 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1524 }, | |
| 1444 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1526 }, | |
| 1445 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1527 }, | |
| 1446 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, | |
| 1447 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1529 }, | |
| 1448 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1530 }, | |
| 1449 | .{ .char = 'a', .end_of_word = true, .end_of_list = false, .number = 10, .child_index = 1531 }, | |
| 1450 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1534 }, | |
| 1451 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1535 }, | |
| 1452 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1536 }, | |
| 5429 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1517 }, | |
| 5430 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1518 }, | |
| 5431 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1519 }, | |
| 5432 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1520 }, | |
| 5433 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1521 }, | |
| 5434 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1522 }, | |
| 5435 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1523 }, | |
| 5436 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 21, .child_index = 1526 }, | |
| 5437 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1532 }, | |
| 5438 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1534 }, | |
| 5439 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1535 }, | |
| 5440 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, | |
| 5441 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1537 }, | |
| 5442 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1538 }, | |
| 5443 | .{ .char = 'a', .end_of_word = true, .end_of_list = false, .number = 10, .child_index = 1539 }, | |
| 5444 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1542 }, | |
| 5445 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1543 }, | |
| 5446 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1544 }, | |
| 1453 | 5447 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 210 }, |
| 1454 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1537 }, | |
| 1455 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1538 }, | |
| 1456 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1540 }, | |
| 1457 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1541 }, | |
| 1458 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1543 }, | |
| 1459 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1544 }, | |
| 1460 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1545 }, | |
| 1461 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1546 }, | |
| 5448 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1545 }, | |
| 5449 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1546 }, | |
| 5450 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1548 }, | |
| 5451 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1549 }, | |
| 5452 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1551 }, | |
| 5453 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1552 }, | |
| 5454 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1553 }, | |
| 5455 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1554 }, | |
| 1462 | 5456 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, |
| 1463 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, | |
| 1464 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1549 }, | |
| 1465 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1550 }, | |
| 1466 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1551 }, | |
| 1467 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1553 }, | |
| 1468 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1554 }, | |
| 1469 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1555 }, | |
| 1470 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1556 }, | |
| 1471 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1558 }, | |
| 5457 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, | |
| 5458 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1557 }, | |
| 5459 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1558 }, | |
| 5460 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1559 }, | |
| 5461 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1561 }, | |
| 5462 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1562 }, | |
| 5463 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1563 }, | |
| 5464 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1564 }, | |
| 5465 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1566 }, | |
| 1472 | 5466 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, |
| 1473 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1559 }, | |
| 1474 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1560 }, | |
| 1475 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1561 }, | |
| 5467 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1567 }, | |
| 5468 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1568 }, | |
| 5469 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1569 }, | |
| 1476 | 5470 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 194 }, |
| 1477 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1302 }, | |
| 1478 | .{ .char = 'g', .end_of_word = true, .end_of_list = false, .number = 23, .child_index = 1562 }, | |
| 5471 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1305 }, | |
| 5472 | .{ .char = 'g', .end_of_word = true, .end_of_list = false, .number = 23, .child_index = 1570 }, | |
| 1479 | 5473 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 352 }, |
| 1480 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1567 }, | |
| 1481 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1568 }, | |
| 5474 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1575 }, | |
| 5475 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1576 }, | |
| 1482 | 5476 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 295 }, |
| 1483 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1569 }, | |
| 1484 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1570 }, | |
| 1485 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1574 }, | |
| 1486 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1575 }, | |
| 1487 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1576 }, | |
| 1488 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1577 }, | |
| 1489 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 1578 }, | |
| 1490 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1581 }, | |
| 1491 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1582 }, | |
| 1492 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1583 }, | |
| 1493 | .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1585 }, | |
| 1494 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1587 }, | |
| 1495 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1588 }, | |
| 1496 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1589 }, | |
| 1497 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1590 }, | |
| 1498 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1591 }, | |
| 1499 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1592 }, | |
| 1500 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1595 }, | |
| 1501 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1596 }, | |
| 5477 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1577 }, | |
| 5478 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1578 }, | |
| 5479 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1582 }, | |
| 5480 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1583 }, | |
| 5481 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1584 }, | |
| 5482 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1585 }, | |
| 5483 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 1586 }, | |
| 5484 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1589 }, | |
| 5485 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1590 }, | |
| 5486 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1591 }, | |
| 5487 | .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1593 }, | |
| 5488 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1595 }, | |
| 5489 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1596 }, | |
| 5490 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1597 }, | |
| 5491 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1598 }, | |
| 5492 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1599 }, | |
| 5493 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1600 }, | |
| 5494 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1601 }, | |
| 5495 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1604 }, | |
| 5496 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1605 }, | |
| 1502 | 5497 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 365 }, |
| 1503 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1598 }, | |
| 1504 | .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1599 }, | |
| 1505 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1600 }, | |
| 1506 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1602 }, | |
| 1507 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1603 }, | |
| 1508 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1605 }, | |
| 1509 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1606 }, | |
| 1510 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1608 }, | |
| 1511 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1609 }, | |
| 1512 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1610 }, | |
| 1513 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1611 }, | |
| 1514 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1613 }, | |
| 1515 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1618 }, | |
| 1516 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1619 }, | |
| 1517 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1505 }, | |
| 1518 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1620 }, | |
| 1519 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1621 }, | |
| 5498 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1607 }, | |
| 5499 | .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1608 }, | |
| 5500 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1609 }, | |
| 5501 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1611 }, | |
| 5502 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1612 }, | |
| 5503 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1614 }, | |
| 5504 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1615 }, | |
| 5505 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1617 }, | |
| 5506 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1618 }, | |
| 5507 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1619 }, | |
| 5508 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1620 }, | |
| 5509 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1622 }, | |
| 5510 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1627 }, | |
| 5511 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1628 }, | |
| 5512 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1513 }, | |
| 5513 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1629 }, | |
| 5514 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1630 }, | |
| 1520 | 5515 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 210 }, |
| 1521 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1622 }, | |
| 5516 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1631 }, | |
| 1522 | 5517 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 327 }, |
| 1523 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1623 }, | |
| 1524 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1624 }, | |
| 5518 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1632 }, | |
| 5519 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1633 }, | |
| 1525 | 5520 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 377 }, |
| 1526 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1625 }, | |
| 1527 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1481 }, | |
| 1528 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1632 }, | |
| 1529 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1635 }, | |
| 5521 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1634 }, | |
| 5522 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1487 }, | |
| 5523 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1641 }, | |
| 5524 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1644 }, | |
| 1530 | 5525 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 291 }, |
| 1531 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1636 }, | |
| 1532 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1637 }, | |
| 1533 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1639 }, | |
| 1534 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1640 }, | |
| 1535 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1623 }, | |
| 1536 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1641 }, | |
| 5526 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1645 }, | |
| 5527 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1646 }, | |
| 5528 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1647 }, | |
| 5529 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1649 }, | |
| 5530 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1650 }, | |
| 5531 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1632 }, | |
| 5532 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1651 }, | |
| 5533 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1655 }, | |
| 1537 | 5534 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 176 }, |
| 1538 | 5535 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 178 }, |
| 1539 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1642 }, | |
| 1540 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1643 }, | |
| 1541 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1650 }, | |
| 1542 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1131 }, | |
| 1543 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1131 }, | |
| 1544 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1131 }, | |
| 1545 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 1546 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1651 }, | |
| 1547 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1653 }, | |
| 1548 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1654 }, | |
| 1549 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1655 }, | |
| 1550 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1656 }, | |
| 1551 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1658 }, | |
| 1552 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1659 }, | |
| 1553 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1660 }, | |
| 5536 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1656 }, | |
| 5537 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1657 }, | |
| 5538 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1664 }, | |
| 5539 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1133 }, | |
| 5540 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1133 }, | |
| 5541 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1133 }, | |
| 5542 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 5543 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1665 }, | |
| 5544 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1667 }, | |
| 5545 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1668 }, | |
| 5546 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1669 }, | |
| 5547 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1670 }, | |
| 5548 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1672 }, | |
| 5549 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1673 }, | |
| 5550 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1674 }, | |
| 1554 | 5551 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 519 }, |
| 1555 | 5552 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, |
| 1556 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1662 }, | |
| 1557 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1663 }, | |
| 1558 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1664 }, | |
| 5553 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1676 }, | |
| 5554 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1677 }, | |
| 5555 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1678 }, | |
| 1559 | 5556 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1560 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1665 }, | |
| 1561 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1666 }, | |
| 1562 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1667 }, | |
| 1563 | .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1668 }, | |
| 1564 | .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1668 }, | |
| 1565 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1668 }, | |
| 1566 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1668 }, | |
| 5557 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1679 }, | |
| 5558 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1680 }, | |
| 5559 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1681 }, | |
| 5560 | .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1682 }, | |
| 5561 | .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1682 }, | |
| 5562 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1682 }, | |
| 5563 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1682 }, | |
| 1567 | 5564 | .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1568 | 5565 | .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1569 | 5566 | .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1570 | 5567 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1571 | 5568 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1572 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1669 }, | |
| 1573 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1668 }, | |
| 1574 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1670 }, | |
| 5569 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1683 }, | |
| 5570 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1682 }, | |
| 5571 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1684 }, | |
| 1575 | 5572 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1576 | 5573 | .{ .char = '4', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1577 | 5574 | .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1578 | 5575 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1579 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, | |
| 5576 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, | |
| 1580 | 5577 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1581 | 5578 | .{ .char = '4', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1582 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1397 }, | |
| 1583 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, | |
| 1584 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, | |
| 1585 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1400 }, | |
| 1586 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1397 }, | |
| 1587 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1671 }, | |
| 1588 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1672 }, | |
| 1589 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1673 }, | |
| 1590 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1676 }, | |
| 1591 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1677 }, | |
| 1592 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1678 }, | |
| 1593 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1679 }, | |
| 1594 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1680 }, | |
| 1595 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1681 }, | |
| 1596 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1682 }, | |
| 1597 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1683 }, | |
| 1598 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1685 }, | |
| 1599 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1686 }, | |
| 1600 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1687 }, | |
| 1601 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1688 }, | |
| 1602 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1689 }, | |
| 1603 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1690 }, | |
| 1604 | .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1691 }, | |
| 5579 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1403 }, | |
| 5580 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, | |
| 5581 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, | |
| 5582 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1406 }, | |
| 5583 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1403 }, | |
| 5584 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1685 }, | |
| 5585 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1686 }, | |
| 5586 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1687 }, | |
| 5587 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1690 }, | |
| 5588 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1691 }, | |
| 5589 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1692 }, | |
| 5590 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1693 }, | |
| 5591 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1694 }, | |
| 5592 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1695 }, | |
| 5593 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1696 }, | |
| 5594 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1697 }, | |
| 5595 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1699 }, | |
| 5596 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1700 }, | |
| 5597 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1701 }, | |
| 5598 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1702 }, | |
| 5599 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1703 }, | |
| 5600 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1704 }, | |
| 5601 | .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1705 }, | |
| 1605 | 5602 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1606 | 5603 | .{ .char = '4', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1607 | 5604 | .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1608 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1692 }, | |
| 1609 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1693 }, | |
| 1610 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1694 }, | |
| 1611 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1434 }, | |
| 1612 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1695 }, | |
| 1613 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1696 }, | |
| 1614 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1697 }, | |
| 1615 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1698 }, | |
| 1616 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1699 }, | |
| 1617 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1700 }, | |
| 1618 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1701 }, | |
| 1619 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1702 }, | |
| 1620 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1703 }, | |
| 1621 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1704 }, | |
| 1622 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1705 }, | |
| 1623 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1706 }, | |
| 1624 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1708 }, | |
| 1625 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1709 }, | |
| 1626 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1710 }, | |
| 1627 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1711 }, | |
| 1628 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1710 }, | |
| 1629 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1712 }, | |
| 1630 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1451 }, | |
| 1631 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1714 }, | |
| 1632 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1715 }, | |
| 1633 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1716 }, | |
| 5605 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1706 }, | |
| 5606 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1707 }, | |
| 5607 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1708 }, | |
| 5608 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1440 }, | |
| 5609 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1709 }, | |
| 5610 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1710 }, | |
| 5611 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1711 }, | |
| 5612 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1712 }, | |
| 5613 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1713 }, | |
| 5614 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1714 }, | |
| 5615 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1715 }, | |
| 5616 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1716 }, | |
| 5617 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1717 }, | |
| 5618 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1718 }, | |
| 5619 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1719 }, | |
| 5620 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1720 }, | |
| 5621 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1722 }, | |
| 5622 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1723 }, | |
| 5623 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1724 }, | |
| 5624 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1725 }, | |
| 5625 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1724 }, | |
| 5626 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1726 }, | |
| 5627 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1457 }, | |
| 5628 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1728 }, | |
| 5629 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1729 }, | |
| 5630 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1730 }, | |
| 1634 | 5631 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 899 }, |
| 1635 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1717 }, | |
| 1636 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1718 }, | |
| 1637 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1719 }, | |
| 1638 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1720 }, | |
| 5632 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1731 }, | |
| 5633 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1732 }, | |
| 5634 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1733 }, | |
| 5635 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1734 }, | |
| 1639 | 5636 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, |
| 1640 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1721 }, | |
| 1641 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1722 }, | |
| 1642 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1461 }, | |
| 1643 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1723 }, | |
| 1644 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1724 }, | |
| 1645 | .{ .char = 'F', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1725 }, | |
| 1646 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1725 }, | |
| 5637 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1735 }, | |
| 5638 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1736 }, | |
| 5639 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1467 }, | |
| 5640 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1737 }, | |
| 5641 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1738 }, | |
| 5642 | .{ .char = 'F', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1739 }, | |
| 5643 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1739 }, | |
| 1647 | 5644 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 409 }, |
| 1648 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1473 }, | |
| 1649 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1726 }, | |
| 1650 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1727 }, | |
| 1651 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1728 }, | |
| 1652 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, | |
| 1653 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, | |
| 1654 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1729 }, | |
| 1655 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, | |
| 1656 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, | |
| 1657 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1731 }, | |
| 1658 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1632 }, | |
| 1659 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1733 }, | |
| 1660 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1734 }, | |
| 1661 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1737 }, | |
| 1662 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1738 }, | |
| 1663 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1739 }, | |
| 1664 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1740 }, | |
| 1665 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1756 }, | |
| 1666 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 12, .child_index = 1757 }, | |
| 1667 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1761 }, | |
| 1668 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1762 }, | |
| 1669 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1763 }, | |
| 1670 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1765 }, | |
| 1671 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 1672 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1673 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1768 }, | |
| 1674 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1769 }, | |
| 1675 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1770 }, | |
| 5645 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1479 }, | |
| 5646 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1740 }, | |
| 5647 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1741 }, | |
| 5648 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1742 }, | |
| 5649 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, | |
| 5650 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1479 }, | |
| 5651 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1743 }, | |
| 5652 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, | |
| 5653 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1479 }, | |
| 5654 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1745 }, | |
| 5655 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1641 }, | |
| 5656 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1747 }, | |
| 5657 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1748 }, | |
| 5658 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1751 }, | |
| 5659 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1752 }, | |
| 5660 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1753 }, | |
| 5661 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1754 }, | |
| 5662 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1770 }, | |
| 5663 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 12, .child_index = 1771 }, | |
| 5664 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1775 }, | |
| 5665 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1776 }, | |
| 5666 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1777 }, | |
| 5667 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1778 }, | |
| 5668 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1780 }, | |
| 5669 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 5670 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5671 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1783 }, | |
| 5672 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1784 }, | |
| 5673 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1785 }, | |
| 5674 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1786 }, | |
| 1676 | 5675 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, |
| 1677 | 5676 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1678 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1771 }, | |
| 5677 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1787 }, | |
| 1679 | 5678 | .{ .char = 'j', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 361 }, |
| 1680 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1772 }, | |
| 1681 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1773 }, | |
| 1682 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1774 }, | |
| 1683 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 1684 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, | |
| 5679 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1788 }, | |
| 5680 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1789 }, | |
| 5681 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1790 }, | |
| 5682 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 5683 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, | |
| 1685 | 5684 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1686 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1776 }, | |
| 1687 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1778 }, | |
| 1688 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1779 }, | |
| 1689 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1780 }, | |
| 1690 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1781 }, | |
| 1691 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1782 }, | |
| 1692 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1783 }, | |
| 1693 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, | |
| 1694 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, | |
| 5685 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1792 }, | |
| 5686 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1794 }, | |
| 5687 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1795 }, | |
| 5688 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1796 }, | |
| 5689 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1797 }, | |
| 5690 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1798 }, | |
| 5691 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1799 }, | |
| 5692 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, | |
| 5693 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, | |
| 1695 | 5694 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1696 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1785 }, | |
| 1697 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, | |
| 1698 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1786 }, | |
| 1699 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 5695 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1801 }, | |
| 5696 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, | |
| 5697 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1802 }, | |
| 5698 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 1700 | 5699 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1701 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1787 }, | |
| 1702 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1788 }, | |
| 1703 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1789 }, | |
| 1704 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1705 | .{ .char = 'm', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 5700 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1803 }, | |
| 5701 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1804 }, | |
| 5702 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1805 }, | |
| 5703 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5704 | .{ .char = 'm', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 1706 | 5705 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, |
| 1707 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1790 }, | |
| 1708 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1791 }, | |
| 1709 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 5706 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1806 }, | |
| 5707 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1807 }, | |
| 5708 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 1710 | 5709 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1711 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1712 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1713 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1714 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1792 }, | |
| 1715 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1793 }, | |
| 5710 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5711 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5712 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5713 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1808 }, | |
| 5714 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1809 }, | |
| 1716 | 5715 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1717 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1794 }, | |
| 1718 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1795 }, | |
| 5716 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1810 }, | |
| 5717 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1811 }, | |
| 1719 | 5718 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, |
| 1720 | 5719 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 1721 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1796 }, | |
| 1722 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1493 }, | |
| 1723 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1797 }, | |
| 1724 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1798 }, | |
| 1725 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 5720 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1812 }, | |
| 5721 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1500 }, | |
| 5722 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1813 }, | |
| 5723 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1814 }, | |
| 5724 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 1726 | 5725 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1727 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1799 }, | |
| 1728 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1800 }, | |
| 1729 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1801 }, | |
| 1730 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1802 }, | |
| 1731 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1803 }, | |
| 1732 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1804 }, | |
| 1733 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1805 }, | |
| 5726 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1815 }, | |
| 5727 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1816 }, | |
| 5728 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1817 }, | |
| 5729 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1818 }, | |
| 5730 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1819 }, | |
| 5731 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1820 }, | |
| 5732 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1821 }, | |
| 1734 | 5733 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 457 }, |
| 1735 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1806 }, | |
| 1736 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1807 }, | |
| 1737 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1808 }, | |
| 1738 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1794 }, | |
| 1739 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1809 }, | |
| 1740 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1810 }, | |
| 1741 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, | |
| 1742 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, | |
| 1743 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 5734 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1822 }, | |
| 5735 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1823 }, | |
| 5736 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1824 }, | |
| 5737 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1810 }, | |
| 5738 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1825 }, | |
| 5739 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1826 }, | |
| 5740 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, | |
| 5741 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, | |
| 5742 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 1744 | 5743 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1745 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1493 }, | |
| 1746 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1812 }, | |
| 1747 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1813 }, | |
| 1748 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1814 }, | |
| 5744 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1500 }, | |
| 5745 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1828 }, | |
| 5746 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1829 }, | |
| 5747 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1830 }, | |
| 1749 | 5748 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 484 }, |
| 1750 | 5749 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 485 }, |
| 1751 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1817 }, | |
| 1752 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1818 }, | |
| 1753 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 1754 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1819 }, | |
| 1755 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1733 }, | |
| 1756 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 5750 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1833 }, | |
| 5751 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1834 }, | |
| 5752 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 5753 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1835 }, | |
| 5754 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1747 }, | |
| 5755 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 1757 | 5756 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1758 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1759 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1834 }, | |
| 1760 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1835 }, | |
| 1761 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1837 }, | |
| 1762 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1838 }, | |
| 1763 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1839 }, | |
| 1764 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1840 }, | |
| 1765 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1841 }, | |
| 1766 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1842 }, | |
| 1767 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1843 }, | |
| 1768 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1844 }, | |
| 1769 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1845 }, | |
| 1770 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 5757 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5758 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1850 }, | |
| 5759 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1851 }, | |
| 5760 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1853 }, | |
| 5761 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1854 }, | |
| 5762 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1855 }, | |
| 5763 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1856 }, | |
| 5764 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1857 }, | |
| 5765 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1858 }, | |
| 5766 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1859 }, | |
| 5767 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1860 }, | |
| 5768 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1861 }, | |
| 5769 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1862 }, | |
| 5770 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 1771 | 5771 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 361 }, |
| 1772 | 5772 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1773 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1846 }, | |
| 1774 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1462 }, | |
| 1775 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1859 }, | |
| 1776 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1860 }, | |
| 1777 | .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1863 }, | |
| 1778 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1864 }, | |
| 5773 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1863 }, | |
| 5774 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1468 }, | |
| 5775 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1876 }, | |
| 5776 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1877 }, | |
| 5777 | .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1880 }, | |
| 5778 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1881 }, | |
| 1779 | 5779 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 295 }, |
| 1780 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 1866 }, | |
| 1781 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1867 }, | |
| 1782 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1868 }, | |
| 1783 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1869 }, | |
| 5780 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 1883 }, | |
| 5781 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1884 }, | |
| 5782 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1885 }, | |
| 5783 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1886 }, | |
| 1784 | 5784 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, |
| 1785 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1786 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1870 }, | |
| 1787 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1871 }, | |
| 1788 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1872 }, | |
| 1789 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1874 }, | |
| 5785 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5786 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1887 }, | |
| 5787 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1888 }, | |
| 5788 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1889 }, | |
| 5789 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1891 }, | |
| 1790 | 5790 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 1791 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1875 }, | |
| 1792 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1876 }, | |
| 5791 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1892 }, | |
| 5792 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1893 }, | |
| 1793 | 5793 | .{ .char = 'j', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 497 }, |
| 1794 | 5794 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, |
| 1795 | 5795 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, |
| 1796 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1877 }, | |
| 1797 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1878 }, | |
| 1798 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1872 }, | |
| 1799 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1879 }, | |
| 1800 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1801 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1872 }, | |
| 1802 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1880 }, | |
| 5796 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1894 }, | |
| 5797 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1895 }, | |
| 5798 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1889 }, | |
| 5799 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1896 }, | |
| 5800 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5801 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1889 }, | |
| 5802 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1897 }, | |
| 1803 | 5803 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 500 }, |
| 1804 | 5804 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 505 }, |
| 1805 | 5805 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 323 }, |
| ... | ... | @@ -1807,11338 +5807,7384 @@ const dafsa = [_]Node{ |
| 1807 | 5807 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 511 }, |
| 1808 | 5808 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 512 }, |
| 1809 | 5809 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 513 }, |
| 1810 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, | |
| 1811 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, | |
| 5810 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, | |
| 5811 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, | |
| 1812 | 5812 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1813 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1881 }, | |
| 1814 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1882 }, | |
| 1815 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1883 }, | |
| 1816 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1884 }, | |
| 1817 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1885 }, | |
| 1818 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1886 }, | |
| 1819 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1887 }, | |
| 1820 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1888 }, | |
| 1821 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1889 }, | |
| 1822 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1890 }, | |
| 5813 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1898 }, | |
| 5814 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1899 }, | |
| 5815 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1900 }, | |
| 5816 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1901 }, | |
| 5817 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1902 }, | |
| 5818 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1903 }, | |
| 5819 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1904 }, | |
| 5820 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1905 }, | |
| 5821 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 518 }, | |
| 5822 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 519 }, | |
| 5823 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 520 }, | |
| 5824 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1906 }, | |
| 5825 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1907 }, | |
| 5826 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1908 }, | |
| 5827 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1909 }, | |
| 1823 | 5828 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 898 }, |
| 1824 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1891 }, | |
| 1825 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1893 }, | |
| 1826 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1894 }, | |
| 1827 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1896 }, | |
| 1828 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1897 }, | |
| 1829 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1898 }, | |
| 1830 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1899 }, | |
| 1831 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1900 }, | |
| 1832 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1901 }, | |
| 1833 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1901 }, | |
| 1834 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1902 }, | |
| 1835 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1903 }, | |
| 1836 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, | |
| 1837 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1905 }, | |
| 1838 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1906 }, | |
| 1839 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1658 }, | |
| 1840 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1907 }, | |
| 5829 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1910 }, | |
| 5830 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1912 }, | |
| 5831 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1913 }, | |
| 5832 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1915 }, | |
| 5833 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1916 }, | |
| 5834 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1917 }, | |
| 5835 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1918 }, | |
| 5836 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1919 }, | |
| 5837 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1920 }, | |
| 5838 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1920 }, | |
| 5839 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1921 }, | |
| 5840 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1922 }, | |
| 5841 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, | |
| 5842 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1924 }, | |
| 5843 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1925 }, | |
| 5844 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1672 }, | |
| 5845 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1926 }, | |
| 1841 | 5846 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, |
| 1842 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1908 }, | |
| 1843 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1909 }, | |
| 1844 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1910 }, | |
| 1845 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1911 }, | |
| 1846 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1912 }, | |
| 1847 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1913 }, | |
| 1848 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1914 }, | |
| 5847 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1927 }, | |
| 5848 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1928 }, | |
| 5849 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1929 }, | |
| 5850 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1930 }, | |
| 5851 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1931 }, | |
| 5852 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1932 }, | |
| 5853 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1933 }, | |
| 1849 | 5854 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, |
| 1850 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1915 }, | |
| 5855 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1934 }, | |
| 1851 | 5856 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1852 | 5857 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, |
| 1853 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1918 }, | |
| 1854 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1920 }, | |
| 1855 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1921 }, | |
| 1856 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1922 }, | |
| 1857 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1923 }, | |
| 1858 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1924 }, | |
| 1859 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1925 }, | |
| 1860 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, | |
| 5858 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1937 }, | |
| 5859 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1939 }, | |
| 5860 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1940 }, | |
| 5861 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1941 }, | |
| 5862 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1942 }, | |
| 5863 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1943 }, | |
| 5864 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1944 }, | |
| 5865 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, | |
| 1861 | 5866 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, |
| 1862 | 5867 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, |
| 1863 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1927 }, | |
| 1864 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, | |
| 1865 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1928 }, | |
| 1866 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1929 }, | |
| 1867 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1930 }, | |
| 1868 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1931 }, | |
| 5868 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1946 }, | |
| 5869 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, | |
| 5870 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1947 }, | |
| 5871 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1948 }, | |
| 5872 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1949 }, | |
| 5873 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1950 }, | |
| 1869 | 5874 | .{ .char = '6', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1870 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1932 }, | |
| 1871 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1933 }, | |
| 1872 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1934 }, | |
| 1873 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1935 }, | |
| 1874 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1936 }, | |
| 1875 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1937 }, | |
| 1876 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1438 }, | |
| 1877 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1938 }, | |
| 1878 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1939 }, | |
| 1879 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1940 }, | |
| 5875 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1951 }, | |
| 5876 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1952 }, | |
| 5877 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1953 }, | |
| 5878 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1954 }, | |
| 5879 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1955 }, | |
| 5880 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1956 }, | |
| 5881 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1444 }, | |
| 5882 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1957 }, | |
| 5883 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1958 }, | |
| 5884 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, | |
| 1880 | 5885 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 286 }, |
| 1881 | 5886 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 1882 | 5887 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, |
| 1883 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1941 }, | |
| 1884 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1942 }, | |
| 1885 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1943 }, | |
| 1886 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1712 }, | |
| 1887 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1944 }, | |
| 1888 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, | |
| 1889 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1946 }, | |
| 5888 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1960 }, | |
| 5889 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1961 }, | |
| 5890 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1962 }, | |
| 5891 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1726 }, | |
| 5892 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1963 }, | |
| 5893 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1964 }, | |
| 5894 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1965 }, | |
| 1890 | 5895 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 1891 | 5896 | .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1892 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1947 }, | |
| 1893 | .{ .char = 'I', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1443 }, | |
| 1894 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1948 }, | |
| 1895 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1949 }, | |
| 1896 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1950 }, | |
| 1897 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1951 }, | |
| 1898 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1957 }, | |
| 1899 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1958 }, | |
| 1900 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 1901 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, | |
| 1902 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 1903 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1960 }, | |
| 1904 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1961 }, | |
| 1905 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1962 }, | |
| 1906 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1966 }, | |
| 1907 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1967 }, | |
| 1908 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1969 }, | |
| 1909 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, | |
| 1910 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1473 }, | |
| 1911 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1972 }, | |
| 5897 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1966 }, | |
| 5898 | .{ .char = 'I', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1449 }, | |
| 5899 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1967 }, | |
| 5900 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1968 }, | |
| 5901 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1969 }, | |
| 5902 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1970 }, | |
| 5903 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1976 }, | |
| 5904 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1977 }, | |
| 5905 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, | |
| 5906 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1978 }, | |
| 5907 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, | |
| 5908 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1979 }, | |
| 5909 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1980 }, | |
| 5910 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1981 }, | |
| 5911 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1985 }, | |
| 5912 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1986 }, | |
| 5913 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1988 }, | |
| 5914 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, | |
| 5915 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1479 }, | |
| 5916 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1991 }, | |
| 1912 | 5917 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 1913 | 5918 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, |
| 1914 | 5919 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1915 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1973 }, | |
| 1916 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1974 }, | |
| 1917 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1975 }, | |
| 1918 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1976 }, | |
| 1919 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1979 }, | |
| 1920 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1982 }, | |
| 1921 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1983 }, | |
| 1922 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1984 }, | |
| 1923 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1985 }, | |
| 5920 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1992 }, | |
| 5921 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1993 }, | |
| 5922 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1994 }, | |
| 5923 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1995 }, | |
| 5924 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1998 }, | |
| 5925 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2001 }, | |
| 5926 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2002 }, | |
| 5927 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2003 }, | |
| 5928 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2004 }, | |
| 1924 | 5929 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 420 }, |
| 1925 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1987 }, | |
| 1926 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1988 }, | |
| 1927 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1991 }, | |
| 1928 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 51, .child_index = 1993 }, | |
| 1929 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2000 }, | |
| 1930 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2003 }, | |
| 1931 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2008 }, | |
| 1932 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2009 }, | |
| 5930 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2006 }, | |
| 5931 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2007 }, | |
| 5932 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2010 }, | |
| 5933 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 51, .child_index = 2012 }, | |
| 5934 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2019 }, | |
| 5935 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2022 }, | |
| 5936 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2027 }, | |
| 5937 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2028 }, | |
| 1933 | 5938 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 274 }, |
| 1934 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2011 }, | |
| 1935 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, | |
| 1936 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, | |
| 1937 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, | |
| 5939 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2030 }, | |
| 5940 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, | |
| 5941 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, | |
| 5942 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, | |
| 1938 | 5943 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1939 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2012 }, | |
| 1940 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2013 }, | |
| 1941 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2016 }, | |
| 5944 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1319 }, | |
| 5945 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2031 }, | |
| 5946 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2032 }, | |
| 5947 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2035 }, | |
| 1942 | 5948 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, |
| 1943 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2017 }, | |
| 1944 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, | |
| 5949 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2036 }, | |
| 5950 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, | |
| 1945 | 5951 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 1946 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2018 }, | |
| 1947 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2019 }, | |
| 1948 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, | |
| 5952 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2037 }, | |
| 5953 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2038 }, | |
| 5954 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2039 }, | |
| 5955 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, | |
| 1949 | 5956 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, |
| 1950 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2020 }, | |
| 1951 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2021 }, | |
| 1952 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2022 }, | |
| 1953 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2023 }, | |
| 1954 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2025 }, | |
| 1955 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2027 }, | |
| 1956 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2028 }, | |
| 1957 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2029 }, | |
| 1958 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2030 }, | |
| 1959 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2031 }, | |
| 1960 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2032 }, | |
| 1961 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2033 }, | |
| 1962 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2034 }, | |
| 1963 | .{ .char = '0', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1964 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2035 }, | |
| 1965 | .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 1966 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2036 }, | |
| 1967 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2037 }, | |
| 1968 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1969 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2038 }, | |
| 1970 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2039 }, | |
| 1971 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2040 }, | |
| 1972 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 1973 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2041 }, | |
| 1974 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2042 }, | |
| 1975 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2043 }, | |
| 1976 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 1977 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2044 }, | |
| 1978 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2045 }, | |
| 5957 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2040 }, | |
| 5958 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2041 }, | |
| 5959 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2042 }, | |
| 5960 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2043 }, | |
| 5961 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2045 }, | |
| 5962 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2047 }, | |
| 5963 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2048 }, | |
| 5964 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2049 }, | |
| 5965 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2050 }, | |
| 5966 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2051 }, | |
| 5967 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2052 }, | |
| 5968 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2053 }, | |
| 5969 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2054 }, | |
| 5970 | .{ .char = '0', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5971 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2055 }, | |
| 5972 | .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 5973 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2056 }, | |
| 5974 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2057 }, | |
| 5975 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5976 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2058 }, | |
| 5977 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2059 }, | |
| 5978 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2060 }, | |
| 5979 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 5980 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2061 }, | |
| 5981 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2062 }, | |
| 5982 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2063 }, | |
| 5983 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 5984 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2064 }, | |
| 5985 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2065 }, | |
| 1979 | 5986 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, |
| 1980 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2046 }, | |
| 1981 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2047 }, | |
| 1982 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2048 }, | |
| 1983 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2049 }, | |
| 1984 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2050 }, | |
| 1985 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2051 }, | |
| 5987 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2066 }, | |
| 5988 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2067 }, | |
| 5989 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2068 }, | |
| 5990 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2069 }, | |
| 5991 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2070 }, | |
| 5992 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2071 }, | |
| 1986 | 5993 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, |
| 1987 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2052 }, | |
| 1988 | .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, | |
| 1989 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 1990 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2053 }, | |
| 1991 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2054 }, | |
| 5994 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2072 }, | |
| 5995 | .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, | |
| 5996 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 5997 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2073 }, | |
| 5998 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2074 }, | |
| 1992 | 5999 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, |
| 1993 | 6000 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 291 }, |
| 1994 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2055 }, | |
| 1995 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2056 }, | |
| 1996 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 2057 }, | |
| 1997 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2069 }, | |
| 1998 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 56, .child_index = 2073 }, | |
| 1999 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2079 }, | |
| 2000 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2084 }, | |
| 2001 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 106, .child_index = 2087 }, | |
| 2002 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2098 }, | |
| 2003 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2100 }, | |
| 2004 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2102 }, | |
| 2005 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 73, .child_index = 2103 }, | |
| 2006 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2108 }, | |
| 2007 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2110 }, | |
| 2008 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2111 }, | |
| 2009 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 97, .child_index = 2112 }, | |
| 2010 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2119 }, | |
| 2011 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2120 }, | |
| 2012 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2121 }, | |
| 2013 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2122 }, | |
| 2014 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2123 }, | |
| 2015 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2124 }, | |
| 2016 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2125 }, | |
| 2017 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2126 }, | |
| 2018 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2127 }, | |
| 2019 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2128 }, | |
| 2020 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2129 }, | |
| 2021 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2130 }, | |
| 2022 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2131 }, | |
| 2023 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2132 }, | |
| 2024 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2133 }, | |
| 2025 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2134 }, | |
| 2026 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2136 }, | |
| 2027 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2137 }, | |
| 2028 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 41, .child_index = 2138 }, | |
| 2029 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2144 }, | |
| 2030 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2145 }, | |
| 2031 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2147 }, | |
| 2032 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2150 }, | |
| 2033 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2155 }, | |
| 2034 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2156 }, | |
| 2035 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2160 }, | |
| 2036 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2163 }, | |
| 2037 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2166 }, | |
| 2038 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2167 }, | |
| 2039 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2168 }, | |
| 2040 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2169 }, | |
| 2041 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 2170 }, | |
| 2042 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2172 }, | |
| 2043 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1876 }, | |
| 2044 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2173 }, | |
| 2045 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2174 }, | |
| 2046 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2175 }, | |
| 2047 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2176 }, | |
| 2048 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2177 }, | |
| 2049 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 2178 }, | |
| 2050 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1733 }, | |
| 2051 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2181 }, | |
| 2052 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2183 }, | |
| 2053 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2185 }, | |
| 6001 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2075 }, | |
| 6002 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2076 }, | |
| 6003 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 2077 }, | |
| 6004 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2089 }, | |
| 6005 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 56, .child_index = 2093 }, | |
| 6006 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2099 }, | |
| 6007 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2104 }, | |
| 6008 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 106, .child_index = 2107 }, | |
| 6009 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2118 }, | |
| 6010 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2120 }, | |
| 6011 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2122 }, | |
| 6012 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 73, .child_index = 2123 }, | |
| 6013 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2128 }, | |
| 6014 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2130 }, | |
| 6015 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2131 }, | |
| 6016 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 97, .child_index = 2132 }, | |
| 6017 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2139 }, | |
| 6018 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2140 }, | |
| 6019 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2141 }, | |
| 6020 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2142 }, | |
| 6021 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2143 }, | |
| 6022 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2144 }, | |
| 6023 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2145 }, | |
| 6024 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2146 }, | |
| 6025 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2147 }, | |
| 6026 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2148 }, | |
| 6027 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2149 }, | |
| 6028 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2150 }, | |
| 6029 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2151 }, | |
| 6030 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2152 }, | |
| 6031 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2153 }, | |
| 6032 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2154 }, | |
| 6033 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2155 }, | |
| 6034 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2157 }, | |
| 6035 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2158 }, | |
| 6036 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 41, .child_index = 2159 }, | |
| 6037 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2165 }, | |
| 6038 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2166 }, | |
| 6039 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2168 }, | |
| 6040 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2171 }, | |
| 6041 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2176 }, | |
| 6042 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2177 }, | |
| 6043 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2181 }, | |
| 6044 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2184 }, | |
| 6045 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2187 }, | |
| 6046 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2188 }, | |
| 6047 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2189 }, | |
| 6048 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2190 }, | |
| 6049 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 2191 }, | |
| 6050 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2193 }, | |
| 6051 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1893 }, | |
| 6052 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2194 }, | |
| 6053 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2195 }, | |
| 6054 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2196 }, | |
| 6055 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2197 }, | |
| 6056 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2198 }, | |
| 6057 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 2199 }, | |
| 6058 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1747 }, | |
| 6059 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2202 }, | |
| 6060 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2204 }, | |
| 6061 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2206 }, | |
| 2054 | 6062 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 2055 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2186 }, | |
| 2056 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2187 }, | |
| 2057 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2188 }, | |
| 2058 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2189 }, | |
| 2059 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2036 }, | |
| 2060 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, | |
| 2061 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1589 }, | |
| 2062 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2190 }, | |
| 2063 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2191 }, | |
| 2064 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2192 }, | |
| 2065 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2193 }, | |
| 2066 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2194 }, | |
| 2067 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2196 }, | |
| 2068 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2197 }, | |
| 6063 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2207 }, | |
| 6064 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2208 }, | |
| 6065 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2209 }, | |
| 6066 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2210 }, | |
| 6067 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2056 }, | |
| 6068 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, | |
| 6069 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2211 }, | |
| 6070 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1598 }, | |
| 6071 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2212 }, | |
| 6072 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2213 }, | |
| 6073 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2214 }, | |
| 6074 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, | |
| 6075 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2215 }, | |
| 6076 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2216 }, | |
| 6077 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2218 }, | |
| 6078 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2219 }, | |
| 2069 | 6079 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 238 }, |
| 2070 | 6080 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1007 }, |
| 2071 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2198 }, | |
| 6081 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2220 }, | |
| 2072 | 6082 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1013 }, |
| 2073 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2199 }, | |
| 6083 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2221 }, | |
| 2074 | 6084 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1017 }, |
| 2075 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2200 }, | |
| 2076 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2202 }, | |
| 2077 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, | |
| 2078 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, | |
| 2079 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2203 }, | |
| 2080 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2204 }, | |
| 2081 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2204 }, | |
| 2082 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2205 }, | |
| 2083 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, | |
| 2084 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2206 }, | |
| 6085 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2222 }, | |
| 6086 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2224 }, | |
| 6087 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, | |
| 6088 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, | |
| 6089 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2225 }, | |
| 6090 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2226 }, | |
| 6091 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2226 }, | |
| 6092 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2227 }, | |
| 6093 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, | |
| 6094 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2228 }, | |
| 2085 | 6095 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, |
| 2086 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2207 }, | |
| 2087 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2211 }, | |
| 2088 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2212 }, | |
| 2089 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2213 }, | |
| 2090 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2214 }, | |
| 2091 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2215 }, | |
| 2092 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2216 }, | |
| 2093 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2217 }, | |
| 6096 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2229 }, | |
| 6097 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2233 }, | |
| 6098 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2234 }, | |
| 6099 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2235 }, | |
| 6100 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, | |
| 6101 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2237 }, | |
| 6102 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2238 }, | |
| 6103 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2239 }, | |
| 2094 | 6104 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, |
| 2095 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2218 }, | |
| 6105 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2240 }, | |
| 2096 | 6106 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2097 | 6107 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 2098 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2219 }, | |
| 2099 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2220 }, | |
| 2100 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 2101 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2221 }, | |
| 2102 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2222 }, | |
| 2103 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, | |
| 2104 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2223 }, | |
| 2105 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2225 }, | |
| 2106 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2226 }, | |
| 2107 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2227 }, | |
| 2108 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2228 }, | |
| 2109 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2229 }, | |
| 2110 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, | |
| 2111 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2231 }, | |
| 2112 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2232 }, | |
| 6108 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2241 }, | |
| 6109 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2242 }, | |
| 6110 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 6111 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2243 }, | |
| 6112 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2244 }, | |
| 6113 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, | |
| 6114 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2245 }, | |
| 6115 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2247 }, | |
| 6116 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2248 }, | |
| 6117 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2249 }, | |
| 6118 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2250 }, | |
| 6119 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2251 }, | |
| 6120 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, | |
| 6121 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2253 }, | |
| 6122 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2254 }, | |
| 2113 | 6123 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, |
| 2114 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2233 }, | |
| 2115 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2234 }, | |
| 6124 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2255 }, | |
| 6125 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2256 }, | |
| 2116 | 6126 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, |
| 2117 | 6127 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, |
| 2118 | 6128 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2119 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2235 }, | |
| 2120 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, | |
| 2121 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2237 }, | |
| 2122 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2238 }, | |
| 2123 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2239 }, | |
| 2124 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2240 }, | |
| 2125 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2241 }, | |
| 6129 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2257 }, | |
| 6130 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, | |
| 6131 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2259 }, | |
| 6132 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2260 }, | |
| 6133 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2261 }, | |
| 6134 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2262 }, | |
| 6135 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2263 }, | |
| 2126 | 6136 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 582 }, |
| 2127 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2242 }, | |
| 2128 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1464 }, | |
| 2129 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2243 }, | |
| 2130 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2245 }, | |
| 2131 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2247 }, | |
| 6137 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2264 }, | |
| 6138 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1470 }, | |
| 6139 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2265 }, | |
| 6140 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2267 }, | |
| 6141 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2269 }, | |
| 2132 | 6142 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, |
| 2133 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2248 }, | |
| 6143 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2270 }, | |
| 2134 | 6144 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, |
| 2135 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2249 }, | |
| 6145 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2271 }, | |
| 2136 | 6146 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 656 }, |
| 2137 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2250 }, | |
| 2138 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2251 }, | |
| 2139 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2252 }, | |
| 2140 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2253 }, | |
| 2141 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2255 }, | |
| 2142 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2256 }, | |
| 2143 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2257 }, | |
| 2144 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, | |
| 2145 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2259 }, | |
| 2146 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2256 }, | |
| 2147 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2260 }, | |
| 2148 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2262 }, | |
| 2149 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2262 }, | |
| 2150 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2263 }, | |
| 2151 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2264 }, | |
| 2152 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2266 }, | |
| 2153 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2267 }, | |
| 2154 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2268 }, | |
| 2155 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2269 }, | |
| 2156 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2272 }, | |
| 2157 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1940 }, | |
| 6147 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2272 }, | |
| 6148 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2273 }, | |
| 6149 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2274 }, | |
| 6150 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2275 }, | |
| 6151 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2277 }, | |
| 6152 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2278 }, | |
| 6153 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2279 }, | |
| 6154 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2280 }, | |
| 6155 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2281 }, | |
| 6156 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2278 }, | |
| 6157 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2282 }, | |
| 6158 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2284 }, | |
| 6159 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2284 }, | |
| 6160 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2285 }, | |
| 6161 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2286 }, | |
| 6162 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2288 }, | |
| 6163 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2289 }, | |
| 6164 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2290 }, | |
| 6165 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2291 }, | |
| 6166 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2294 }, | |
| 6167 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1959 }, | |
| 2158 | 6168 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, |
| 2159 | 6169 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 2160 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2273 }, | |
| 6170 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2295 }, | |
| 2161 | 6171 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 2162 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2274 }, | |
| 2163 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2277 }, | |
| 2164 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2278 }, | |
| 2165 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2280 }, | |
| 2166 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2281 }, | |
| 2167 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2283 }, | |
| 2168 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2284 }, | |
| 2169 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2286 }, | |
| 2170 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2287 }, | |
| 2171 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2288 }, | |
| 2172 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2290 }, | |
| 2173 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2293 }, | |
| 2174 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2295 }, | |
| 2175 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2297 }, | |
| 2176 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2299 }, | |
| 2177 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2302 }, | |
| 2178 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2303 }, | |
| 6172 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2296 }, | |
| 6173 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2299 }, | |
| 6174 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2300 }, | |
| 6175 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2302 }, | |
| 6176 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2303 }, | |
| 6177 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2305 }, | |
| 6178 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2306 }, | |
| 6179 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2308 }, | |
| 6180 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2309 }, | |
| 6181 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2310 }, | |
| 6182 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2312 }, | |
| 6183 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2315 }, | |
| 6184 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2317 }, | |
| 6185 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2319 }, | |
| 6186 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2321 }, | |
| 6187 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2324 }, | |
| 6188 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2325 }, | |
| 2179 | 6189 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 520 }, |
| 2180 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2305 }, | |
| 2181 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2288 }, | |
| 2182 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2293 }, | |
| 2183 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2293 }, | |
| 2184 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2306 }, | |
| 2185 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2302 }, | |
| 2186 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2308 }, | |
| 6190 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2327 }, | |
| 6191 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2310 }, | |
| 6192 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2315 }, | |
| 6193 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2315 }, | |
| 6194 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2328 }, | |
| 6195 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2324 }, | |
| 6196 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2330 }, | |
| 2187 | 6197 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 431 }, |
| 2188 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2287 }, | |
| 2189 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2309 }, | |
| 2190 | .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 2310 }, | |
| 6198 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2309 }, | |
| 6199 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2331 }, | |
| 6200 | .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 2332 }, | |
| 2191 | 6201 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 2192 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2311 }, | |
| 6202 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2333 }, | |
| 2193 | 6203 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, |
| 2194 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2312 }, | |
| 2195 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2313 }, | |
| 2196 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2314 }, | |
| 2197 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2315 }, | |
| 2198 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2316 }, | |
| 2199 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2317 }, | |
| 2200 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2318 }, | |
| 2201 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2319 }, | |
| 6204 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2334 }, | |
| 6205 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2335 }, | |
| 6206 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2336 }, | |
| 6207 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2337 }, | |
| 6208 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2338 }, | |
| 6209 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2339 }, | |
| 6210 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2340 }, | |
| 6211 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2341 }, | |
| 6212 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2342 }, | |
| 2202 | 6213 | .{ .char = '6', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2203 | 6214 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 238 }, |
| 2204 | 6215 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2205 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2320 }, | |
| 2206 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2321 }, | |
| 2207 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2322 }, | |
| 2208 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2323 }, | |
| 2209 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2325 }, | |
| 2210 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2326 }, | |
| 2211 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2327 }, | |
| 2212 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2319 }, | |
| 2213 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2328 }, | |
| 2214 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2329 }, | |
| 2215 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2330 }, | |
| 2216 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2331 }, | |
| 2217 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2332 }, | |
| 2218 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2333 }, | |
| 2219 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2334 }, | |
| 2220 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2335 }, | |
| 2221 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2336 }, | |
| 2222 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2337 }, | |
| 2223 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2338 }, | |
| 2224 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2339 }, | |
| 2225 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2340 }, | |
| 2226 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, | |
| 2227 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2341 }, | |
| 2228 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, | |
| 2229 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2344 }, | |
| 2230 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 2231 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 2232 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2345 }, | |
| 2233 | .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2346 }, | |
| 2234 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2346 }, | |
| 2235 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2347 }, | |
| 2236 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2350 }, | |
| 2237 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2353 }, | |
| 2238 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2354 }, | |
| 2239 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2355 }, | |
| 2240 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2356 }, | |
| 2241 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2357 }, | |
| 2242 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2360 }, | |
| 2243 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 21, .child_index = 2365 }, | |
| 2244 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2368 }, | |
| 2245 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 2371 }, | |
| 2246 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2373 }, | |
| 2247 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2374 }, | |
| 2248 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2375 }, | |
| 2249 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2376 }, | |
| 2250 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2377 }, | |
| 2251 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2378 }, | |
| 2252 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2379 }, | |
| 2253 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2380 }, | |
| 2254 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2382 }, | |
| 2255 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2384 }, | |
| 2256 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2385 }, | |
| 2257 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2386 }, | |
| 2258 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2387 }, | |
| 2259 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2388 }, | |
| 2260 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2390 }, | |
| 2261 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2387 }, | |
| 2262 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2391 }, | |
| 2263 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2392 }, | |
| 2264 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2098 }, | |
| 2265 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2393 }, | |
| 2266 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2394 }, | |
| 2267 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2400 }, | |
| 2268 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2401 }, | |
| 2269 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2402 }, | |
| 2270 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2404 }, | |
| 2271 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2405 }, | |
| 2272 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2406 }, | |
| 2273 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2410 }, | |
| 2274 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2413 }, | |
| 2275 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2420 }, | |
| 2276 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2423 }, | |
| 2277 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2424 }, | |
| 2278 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2425 }, | |
| 2279 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2426 }, | |
| 2280 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2427 }, | |
| 2281 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 2430 }, | |
| 2282 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 2432 }, | |
| 2283 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2433 }, | |
| 2284 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2435 }, | |
| 2285 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2436 }, | |
| 2286 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2437 }, | |
| 2287 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2110 }, | |
| 2288 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, | |
| 2289 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2441 }, | |
| 2290 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2443 }, | |
| 2291 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2444 }, | |
| 2292 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2445 }, | |
| 2293 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2447 }, | |
| 2294 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2448 }, | |
| 2295 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2450 }, | |
| 2296 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2452 }, | |
| 2297 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2453 }, | |
| 2298 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2110 }, | |
| 2299 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2454 }, | |
| 2300 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2455 }, | |
| 2301 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2456 }, | |
| 2302 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2457 }, | |
| 2303 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2458 }, | |
| 2304 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2459 }, | |
| 2305 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2460 }, | |
| 2306 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2461 }, | |
| 2307 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, | |
| 2308 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2463 }, | |
| 2309 | .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, | |
| 2310 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2464 }, | |
| 2311 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2465 }, | |
| 2312 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2466 }, | |
| 2313 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2467 }, | |
| 2314 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2468 }, | |
| 2315 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2469 }, | |
| 2316 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2470 }, | |
| 2317 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2472 }, | |
| 2318 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2473 }, | |
| 2319 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2474 }, | |
| 2320 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2476 }, | |
| 2321 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2479 }, | |
| 2322 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2481 }, | |
| 2323 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2482 }, | |
| 2324 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, | |
| 2325 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2483 }, | |
| 2326 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2484 }, | |
| 2327 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2485 }, | |
| 2328 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2487 }, | |
| 2329 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2488 }, | |
| 2330 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2491 }, | |
| 2331 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2492 }, | |
| 2332 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2495 }, | |
| 2333 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2496 }, | |
| 2334 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2497 }, | |
| 2335 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2498 }, | |
| 2336 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2499 }, | |
| 2337 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2501 }, | |
| 2338 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2502 }, | |
| 2339 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2506 }, | |
| 2340 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1663 }, | |
| 6216 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, | |
| 6217 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2344 }, | |
| 6218 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2345 }, | |
| 6219 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2346 }, | |
| 6220 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2348 }, | |
| 6221 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2349 }, | |
| 6222 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2350 }, | |
| 6223 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2342 }, | |
| 6224 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2351 }, | |
| 6225 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2352 }, | |
| 6226 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2353 }, | |
| 6227 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2354 }, | |
| 6228 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2355 }, | |
| 6229 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2356 }, | |
| 6230 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2357 }, | |
| 6231 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2358 }, | |
| 6232 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2359 }, | |
| 6233 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2360 }, | |
| 6234 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2361 }, | |
| 6235 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2362 }, | |
| 6236 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2363 }, | |
| 6237 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, | |
| 6238 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2364 }, | |
| 6239 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, | |
| 6240 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2367 }, | |
| 6241 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 6242 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 6243 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2368 }, | |
| 6244 | .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2369 }, | |
| 6245 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2369 }, | |
| 6246 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2370 }, | |
| 6247 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2373 }, | |
| 6248 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2376 }, | |
| 6249 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2377 }, | |
| 6250 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2378 }, | |
| 6251 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2379 }, | |
| 6252 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2380 }, | |
| 6253 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2383 }, | |
| 6254 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 21, .child_index = 2388 }, | |
| 6255 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2391 }, | |
| 6256 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 2394 }, | |
| 6257 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2396 }, | |
| 6258 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2397 }, | |
| 6259 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2398 }, | |
| 6260 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2399 }, | |
| 6261 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2400 }, | |
| 6262 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2401 }, | |
| 6263 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2402 }, | |
| 6264 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2403 }, | |
| 6265 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2405 }, | |
| 6266 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2407 }, | |
| 6267 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2408 }, | |
| 6268 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2409 }, | |
| 6269 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2410 }, | |
| 6270 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2411 }, | |
| 6271 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2413 }, | |
| 6272 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2410 }, | |
| 6273 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2414 }, | |
| 6274 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2415 }, | |
| 6275 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2118 }, | |
| 6276 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2416 }, | |
| 6277 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2417 }, | |
| 6278 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2423 }, | |
| 6279 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2424 }, | |
| 6280 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2425 }, | |
| 6281 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2427 }, | |
| 6282 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2428 }, | |
| 6283 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2429 }, | |
| 6284 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2433 }, | |
| 6285 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2436 }, | |
| 6286 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2443 }, | |
| 6287 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2446 }, | |
| 6288 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2447 }, | |
| 6289 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2448 }, | |
| 6290 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2449 }, | |
| 6291 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2450 }, | |
| 6292 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 2453 }, | |
| 6293 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 2455 }, | |
| 6294 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2456 }, | |
| 6295 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2458 }, | |
| 6296 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2459 }, | |
| 6297 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2460 }, | |
| 6298 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2130 }, | |
| 6299 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, | |
| 6300 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2464 }, | |
| 6301 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2466 }, | |
| 6302 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2467 }, | |
| 6303 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2468 }, | |
| 6304 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2470 }, | |
| 6305 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2471 }, | |
| 6306 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2473 }, | |
| 6307 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2475 }, | |
| 6308 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2476 }, | |
| 6309 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2130 }, | |
| 6310 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2477 }, | |
| 6311 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2478 }, | |
| 6312 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2479 }, | |
| 6313 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2480 }, | |
| 6314 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2481 }, | |
| 6315 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2482 }, | |
| 6316 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2483 }, | |
| 6317 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2484 }, | |
| 6318 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2485 }, | |
| 6319 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2486 }, | |
| 6320 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2487 }, | |
| 6321 | .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, | |
| 6322 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2488 }, | |
| 6323 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2489 }, | |
| 6324 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2490 }, | |
| 6325 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2491 }, | |
| 6326 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2492 }, | |
| 6327 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2493 }, | |
| 6328 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2494 }, | |
| 6329 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2496 }, | |
| 6330 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2497 }, | |
| 6331 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2498 }, | |
| 6332 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2500 }, | |
| 6333 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2503 }, | |
| 6334 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2505 }, | |
| 6335 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2506 }, | |
| 6336 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, | |
| 2341 | 6337 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2507 }, |
| 2342 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2508 }, | |
| 6338 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2508 }, | |
| 6339 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2509 }, | |
| 6340 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2511 }, | |
| 6341 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2512 }, | |
| 6342 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2515 }, | |
| 6343 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2516 }, | |
| 6344 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2519 }, | |
| 6345 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2520 }, | |
| 6346 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2521 }, | |
| 6347 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2522 }, | |
| 6348 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2523 }, | |
| 6349 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2525 }, | |
| 6350 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2526 }, | |
| 6351 | .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2530 }, | |
| 6352 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1677 }, | |
| 6353 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2531 }, | |
| 6354 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2532 }, | |
| 2343 | 6355 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2344 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2509 }, | |
| 2345 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2510 }, | |
| 2346 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2511 }, | |
| 2347 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2512 }, | |
| 2348 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2513 }, | |
| 2349 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2514 }, | |
| 2350 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2515 }, | |
| 2351 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2516 }, | |
| 2352 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2517 }, | |
| 2353 | .{ .char = 'o', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 2354 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2040 }, | |
| 2355 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2518 }, | |
| 2356 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2520 }, | |
| 2357 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, | |
| 6356 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2533 }, | |
| 6357 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2534 }, | |
| 6358 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2535 }, | |
| 6359 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2536 }, | |
| 6360 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2537 }, | |
| 6361 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2538 }, | |
| 6362 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2539 }, | |
| 6363 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2540 }, | |
| 6364 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2541 }, | |
| 6365 | .{ .char = 'o', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 6366 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2060 }, | |
| 6367 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2542 }, | |
| 6368 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2544 }, | |
| 6369 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, | |
| 2358 | 6370 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2359 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1733 }, | |
| 2360 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1577 }, | |
| 2361 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2521 }, | |
| 2362 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 2363 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2522 }, | |
| 2364 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2523 }, | |
| 6371 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1747 }, | |
| 6372 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1585 }, | |
| 6373 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2545 }, | |
| 6374 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 6375 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2546 }, | |
| 6376 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2547 }, | |
| 2365 | 6377 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 297 }, |
| 2366 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2524 }, | |
| 6378 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2548 }, | |
| 2367 | 6379 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 429 }, |
| 2368 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2525 }, | |
| 2369 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2526 }, | |
| 2370 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2527 }, | |
| 2371 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2528 }, | |
| 2372 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2540 }, | |
| 2373 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2543 }, | |
| 2374 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2544 }, | |
| 2375 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2545 }, | |
| 6380 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2549 }, | |
| 6381 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2550 }, | |
| 6382 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2551 }, | |
| 6383 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2552 }, | |
| 6384 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2553 }, | |
| 6385 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2565 }, | |
| 6386 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2568 }, | |
| 6387 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2569 }, | |
| 6388 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2570 }, | |
| 2376 | 6389 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, |
| 2377 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2546 }, | |
| 2378 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2547 }, | |
| 2379 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2548 }, | |
| 2380 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2549 }, | |
| 2381 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2550 }, | |
| 2382 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2551 }, | |
| 2383 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2552 }, | |
| 2384 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, | |
| 2385 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2553 }, | |
| 2386 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2554 }, | |
| 2387 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2555 }, | |
| 2388 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2556 }, | |
| 6390 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2571 }, | |
| 6391 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2572 }, | |
| 6392 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2573 }, | |
| 6393 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2574 }, | |
| 6394 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2575 }, | |
| 6395 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2576 }, | |
| 6396 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2577 }, | |
| 6397 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, | |
| 6398 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2578 }, | |
| 6399 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2579 }, | |
| 6400 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2580 }, | |
| 6401 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2581 }, | |
| 2389 | 6402 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 2390 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2557 }, | |
| 2391 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2559 }, | |
| 2392 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2560 }, | |
| 2393 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2561 }, | |
| 2394 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2562 }, | |
| 6403 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2582 }, | |
| 6404 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2584 }, | |
| 6405 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2585 }, | |
| 6406 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2586 }, | |
| 6407 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2587 }, | |
| 2395 | 6408 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, |
| 2396 | 6409 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 2397 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2566 }, | |
| 2398 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2567 }, | |
| 2399 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, | |
| 2400 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, | |
| 2401 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2568 }, | |
| 2402 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2568 }, | |
| 2403 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2569 }, | |
| 2404 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2570 }, | |
| 2405 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2571 }, | |
| 2406 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2572 }, | |
| 2407 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2573 }, | |
| 2408 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2574 }, | |
| 2409 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2575 }, | |
| 2410 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2576 }, | |
| 6410 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2591 }, | |
| 6411 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2592 }, | |
| 6412 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, | |
| 6413 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, | |
| 6414 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2593 }, | |
| 6415 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, | |
| 6416 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2594 }, | |
| 6417 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2595 }, | |
| 6418 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2596 }, | |
| 6419 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2597 }, | |
| 6420 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2598 }, | |
| 6421 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2599 }, | |
| 6422 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2600 }, | |
| 6423 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2601 }, | |
| 2411 | 6424 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 674 }, |
| 2412 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2577 }, | |
| 2413 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2578 }, | |
| 6425 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2602 }, | |
| 6426 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2603 }, | |
| 2414 | 6427 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 584 }, |
| 2415 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2579 }, | |
| 2416 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2580 }, | |
| 2417 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2581 }, | |
| 2418 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2582 }, | |
| 2419 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2583 }, | |
| 2420 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2584 }, | |
| 6428 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2604 }, | |
| 6429 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2605 }, | |
| 6430 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2606 }, | |
| 6431 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2607 }, | |
| 6432 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2608 }, | |
| 6433 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2609 }, | |
| 2421 | 6434 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, |
| 2422 | 6435 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, |
| 2423 | 6436 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, |
| 2424 | 6437 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, |
| 2425 | 6438 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, |
| 2426 | 6439 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 2427 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2585 }, | |
| 2428 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2586 }, | |
| 2429 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2587 }, | |
| 2430 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2588 }, | |
| 2431 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2259 }, | |
| 2432 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2589 }, | |
| 2433 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2590 }, | |
| 2434 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2259 }, | |
| 2435 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2591 }, | |
| 2436 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2592 }, | |
| 2437 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2589 }, | |
| 2438 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2591 }, | |
| 2439 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2589 }, | |
| 2440 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2260 }, | |
| 2441 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, | |
| 2442 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2594 }, | |
| 6440 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2610 }, | |
| 6441 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2611 }, | |
| 6442 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2612 }, | |
| 6443 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2613 }, | |
| 6444 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2281 }, | |
| 6445 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2614 }, | |
| 6446 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2615 }, | |
| 6447 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2281 }, | |
| 6448 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2616 }, | |
| 6449 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2617 }, | |
| 6450 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2614 }, | |
| 6451 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2616 }, | |
| 6452 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2614 }, | |
| 6453 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2282 }, | |
| 6454 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2618 }, | |
| 6455 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2619 }, | |
| 2443 | 6456 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 2444 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2595 }, | |
| 2445 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2597 }, | |
| 2446 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, | |
| 6457 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2620 }, | |
| 6458 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2622 }, | |
| 6459 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, | |
| 2447 | 6460 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, |
| 2448 | .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1938 }, | |
| 2449 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1938 }, | |
| 2450 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2614 }, | |
| 2451 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2615 }, | |
| 6461 | .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1957 }, | |
| 6462 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1957 }, | |
| 6463 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2639 }, | |
| 6464 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2640 }, | |
| 2452 | 6465 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, |
| 2453 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2616 }, | |
| 2454 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2618 }, | |
| 2455 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2619 }, | |
| 2456 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1399 }, | |
| 2457 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2621 }, | |
| 2458 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1207 }, | |
| 2459 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1708 }, | |
| 6466 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2641 }, | |
| 6467 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2643 }, | |
| 6468 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2644 }, | |
| 6469 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1405 }, | |
| 6470 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2646 }, | |
| 6471 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1209 }, | |
| 6472 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1722 }, | |
| 2460 | 6473 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 2461 | 6474 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 2462 | 6475 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, |
| 2463 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2622 }, | |
| 2464 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1699 }, | |
| 2465 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2623 }, | |
| 2466 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2625 }, | |
| 6476 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2647 }, | |
| 6477 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1713 }, | |
| 6478 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2648 }, | |
| 6479 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2650 }, | |
| 2467 | 6480 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 2468 | 6481 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2469 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2615 }, | |
| 6482 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2640 }, | |
| 2470 | 6483 | .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, |
| 2471 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2288 }, | |
| 2472 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2626 }, | |
| 2473 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2628 }, | |
| 2474 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2630 }, | |
| 2475 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2633 }, | |
| 2476 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2635 }, | |
| 2477 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2616 }, | |
| 6484 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2310 }, | |
| 6485 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2651 }, | |
| 6486 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2653 }, | |
| 6487 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2655 }, | |
| 6488 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2658 }, | |
| 6489 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, | |
| 6490 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2641 }, | |
| 2478 | 6491 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, |
| 2479 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2618 }, | |
| 2480 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2636 }, | |
| 2481 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2638 }, | |
| 2482 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2639 }, | |
| 2483 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2640 }, | |
| 2484 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2641 }, | |
| 2485 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2635 }, | |
| 2486 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2644 }, | |
| 2487 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2645 }, | |
| 2488 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2647 }, | |
| 6492 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2643 }, | |
| 6493 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2661 }, | |
| 6494 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2663 }, | |
| 6495 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2664 }, | |
| 6496 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2665 }, | |
| 6497 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2666 }, | |
| 6498 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, | |
| 6499 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2669 }, | |
| 6500 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2670 }, | |
| 6501 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2672 }, | |
| 2489 | 6502 | .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2490 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2648 }, | |
| 2491 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2649 }, | |
| 2492 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2650 }, | |
| 2493 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2651 }, | |
| 2494 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2652 }, | |
| 2495 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2653 }, | |
| 2496 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1534 }, | |
| 6503 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2673 }, | |
| 6504 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2674 }, | |
| 6505 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2675 }, | |
| 6506 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2676 }, | |
| 6507 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2677 }, | |
| 6508 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2678 }, | |
| 6509 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2679 }, | |
| 6510 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1542 }, | |
| 2497 | 6511 | .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2498 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2654 }, | |
| 2499 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2655 }, | |
| 2500 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2656 }, | |
| 2501 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2657 }, | |
| 2502 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2658 }, | |
| 2503 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2659 }, | |
| 2504 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, | |
| 2505 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2661 }, | |
| 2506 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2662 }, | |
| 2507 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2663 }, | |
| 2508 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1795 }, | |
| 2509 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2664 }, | |
| 2510 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2665 }, | |
| 6512 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2680 }, | |
| 6513 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2681 }, | |
| 6514 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2682 }, | |
| 6515 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2683 }, | |
| 6516 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2684 }, | |
| 6517 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2685 }, | |
| 6518 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2686 }, | |
| 6519 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2687 }, | |
| 6520 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2688 }, | |
| 6521 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2689 }, | |
| 6522 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1811 }, | |
| 6523 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2690 }, | |
| 6524 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2691 }, | |
| 2511 | 6525 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 729 }, |
| 2512 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2666 }, | |
| 2513 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1494 }, | |
| 2514 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2667 }, | |
| 2515 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2669 }, | |
| 2516 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2670 }, | |
| 2517 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, | |
| 2518 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2671 }, | |
| 2519 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2672 }, | |
| 2520 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2673 }, | |
| 6526 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2692 }, | |
| 6527 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1501 }, | |
| 6528 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2693 }, | |
| 6529 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2695 }, | |
| 6530 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2696 }, | |
| 6531 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 6532 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2697 }, | |
| 6533 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2698 }, | |
| 6534 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2699 }, | |
| 2521 | 6535 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 2522 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2674 }, | |
| 2523 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2675 }, | |
| 2524 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2677 }, | |
| 2525 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2678 }, | |
| 2526 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2679 }, | |
| 2527 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2680 }, | |
| 6536 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2700 }, | |
| 6537 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2701 }, | |
| 6538 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2703 }, | |
| 6539 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2704 }, | |
| 6540 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2705 }, | |
| 6541 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2706 }, | |
| 2528 | 6542 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 479 }, |
| 2529 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2681 }, | |
| 2530 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2682 }, | |
| 2531 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2683 }, | |
| 2532 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2684 }, | |
| 2533 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2686 }, | |
| 2534 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2687 }, | |
| 2535 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2688 }, | |
| 6543 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2707 }, | |
| 6544 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2708 }, | |
| 6545 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2709 }, | |
| 6546 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2710 }, | |
| 6547 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2712 }, | |
| 6548 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2713 }, | |
| 6549 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2714 }, | |
| 2536 | 6550 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, |
| 2537 | 6551 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 2538 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2689 }, | |
| 2539 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2691 }, | |
| 2540 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2692 }, | |
| 2541 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2693 }, | |
| 2542 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2694 }, | |
| 2543 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2695 }, | |
| 2544 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2696 }, | |
| 2545 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 2697 }, | |
| 2546 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2698 }, | |
| 2547 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2699 }, | |
| 2548 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2700 }, | |
| 2549 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2701 }, | |
| 2550 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 2704 }, | |
| 2551 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2699 }, | |
| 2552 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2705 }, | |
| 2553 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, | |
| 2554 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2708 }, | |
| 2555 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2709 }, | |
| 2556 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2711 }, | |
| 2557 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2712 }, | |
| 2558 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2713 }, | |
| 2559 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, | |
| 2560 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2714 }, | |
| 2561 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2385 }, | |
| 2562 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2715 }, | |
| 2563 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2717 }, | |
| 2564 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2565 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2724 }, | |
| 2566 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2725 }, | |
| 2567 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2725 }, | |
| 2568 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2727 }, | |
| 2569 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2570 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2729 }, | |
| 2571 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2730 }, | |
| 2572 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2731 }, | |
| 2573 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, | |
| 2574 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2733 }, | |
| 2575 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2736 }, | |
| 2576 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2737 }, | |
| 2577 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2738 }, | |
| 2578 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2741 }, | |
| 2579 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2742 }, | |
| 2580 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2745 }, | |
| 2581 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2746 }, | |
| 2582 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2748 }, | |
| 2583 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2749 }, | |
| 2584 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2750 }, | |
| 2585 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2752 }, | |
| 2586 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2753 }, | |
| 2587 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2754 }, | |
| 2588 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2755 }, | |
| 2589 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2756 }, | |
| 2590 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2757 }, | |
| 2591 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2731 }, | |
| 2592 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, | |
| 2593 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2758 }, | |
| 2594 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2736 }, | |
| 2595 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2737 }, | |
| 2596 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2760 }, | |
| 2597 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2761 }, | |
| 2598 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2745 }, | |
| 2599 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2765 }, | |
| 2600 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2766 }, | |
| 2601 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2767 }, | |
| 2602 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2768 }, | |
| 2603 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2769 }, | |
| 2604 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2773 }, | |
| 2605 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, | |
| 2606 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, | |
| 2607 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2608 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2781 }, | |
| 2609 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2782 }, | |
| 2610 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2782 }, | |
| 2611 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2728 }, | |
| 2612 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2784 }, | |
| 2613 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2785 }, | |
| 2614 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2786 }, | |
| 2615 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2789 }, | |
| 2616 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2789 }, | |
| 2617 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2790 }, | |
| 2618 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2791 }, | |
| 2619 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2792 }, | |
| 2620 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2794 }, | |
| 2621 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2622 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2795 }, | |
| 2623 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2722 }, | |
| 2624 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2625 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2796 }, | |
| 2626 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2797 }, | |
| 2627 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2797 }, | |
| 2628 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, | |
| 2629 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2630 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2800 }, | |
| 2631 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2802 }, | |
| 2632 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1567 }, | |
| 2633 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2803 }, | |
| 2634 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2804 }, | |
| 2635 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2805 }, | |
| 2636 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 2637 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2807 }, | |
| 2638 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2808 }, | |
| 2639 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2809 }, | |
| 2640 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2810 }, | |
| 2641 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2811 }, | |
| 2642 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2812 }, | |
| 2643 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2813 }, | |
| 6552 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2715 }, | |
| 6553 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2717 }, | |
| 6554 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2718 }, | |
| 6555 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2719 }, | |
| 6556 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2720 }, | |
| 6557 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2721 }, | |
| 6558 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2722 }, | |
| 6559 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 2723 }, | |
| 6560 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2724 }, | |
| 6561 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2725 }, | |
| 6562 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2726 }, | |
| 6563 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2727 }, | |
| 6564 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 2730 }, | |
| 6565 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2725 }, | |
| 6566 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2731 }, | |
| 6567 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, | |
| 6568 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2734 }, | |
| 6569 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2735 }, | |
| 6570 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2737 }, | |
| 6571 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2738 }, | |
| 6572 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2739 }, | |
| 6573 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, | |
| 6574 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2740 }, | |
| 6575 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2408 }, | |
| 6576 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2741 }, | |
| 6577 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2743 }, | |
| 6578 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6579 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2750 }, | |
| 6580 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2751 }, | |
| 6581 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2751 }, | |
| 6582 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2753 }, | |
| 6583 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6584 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2755 }, | |
| 6585 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2756 }, | |
| 6586 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2757 }, | |
| 6587 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, | |
| 6588 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2759 }, | |
| 6589 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2762 }, | |
| 6590 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2763 }, | |
| 6591 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2764 }, | |
| 6592 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2767 }, | |
| 6593 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2768 }, | |
| 6594 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2771 }, | |
| 6595 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2772 }, | |
| 6596 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2774 }, | |
| 6597 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2775 }, | |
| 6598 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2776 }, | |
| 6599 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2778 }, | |
| 6600 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2779 }, | |
| 6601 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 6602 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2781 }, | |
| 6603 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2782 }, | |
| 6604 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2783 }, | |
| 6605 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2757 }, | |
| 6606 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, | |
| 6607 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2784 }, | |
| 6608 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2762 }, | |
| 6609 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2763 }, | |
| 6610 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2786 }, | |
| 6611 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2787 }, | |
| 6612 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2771 }, | |
| 6613 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2791 }, | |
| 6614 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2792 }, | |
| 6615 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2793 }, | |
| 6616 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2794 }, | |
| 6617 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2795 }, | |
| 6618 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2799 }, | |
| 6619 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, | |
| 6620 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, | |
| 6621 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6622 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2807 }, | |
| 6623 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2808 }, | |
| 6624 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2808 }, | |
| 6625 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2754 }, | |
| 6626 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2810 }, | |
| 6627 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2811 }, | |
| 6628 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2812 }, | |
| 6629 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2815 }, | |
| 6630 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2815 }, | |
| 6631 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2816 }, | |
| 6632 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2817 }, | |
| 6633 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2818 }, | |
| 6634 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2820 }, | |
| 6635 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6636 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2821 }, | |
| 6637 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2748 }, | |
| 6638 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6639 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2822 }, | |
| 6640 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2823 }, | |
| 6641 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2823 }, | |
| 6642 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, | |
| 6643 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6644 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2826 }, | |
| 6645 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2828 }, | |
| 6646 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1575 }, | |
| 6647 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2829 }, | |
| 6648 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2830 }, | |
| 6649 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2831 }, | |
| 6650 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2832 }, | |
| 6651 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2833 }, | |
| 6652 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2834 }, | |
| 6653 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, | |
| 6654 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2835 }, | |
| 6655 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2836 }, | |
| 6656 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2837 }, | |
| 6657 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2838 }, | |
| 6658 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2839 }, | |
| 2644 | 6659 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 2645 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2814 }, | |
| 2646 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2815 }, | |
| 2647 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2819 }, | |
| 2648 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2820 }, | |
| 2649 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2822 }, | |
| 2650 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2824 }, | |
| 2651 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2825 }, | |
| 2652 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2826 }, | |
| 2653 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2827 }, | |
| 2654 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, | |
| 2655 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2830 }, | |
| 2656 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2835 }, | |
| 2657 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2836 }, | |
| 2658 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2837 }, | |
| 2659 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2838 }, | |
| 2660 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2839 }, | |
| 2661 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2840 }, | |
| 2662 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2841 }, | |
| 2663 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2840 }, | |
| 2664 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, | |
| 2665 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2842 }, | |
| 2666 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2843 }, | |
| 2667 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2844 }, | |
| 2668 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2845 }, | |
| 2669 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2842 }, | |
| 2670 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2846 }, | |
| 2671 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2843 }, | |
| 2672 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2844 }, | |
| 2673 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2847 }, | |
| 2674 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2848 }, | |
| 2675 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2850 }, | |
| 2676 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2851 }, | |
| 2677 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2852 }, | |
| 2678 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2853 }, | |
| 2679 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 2680 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2856 }, | |
| 2681 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2857 }, | |
| 2682 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2858 }, | |
| 2683 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2856 }, | |
| 2684 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2859 }, | |
| 6660 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2840 }, | |
| 6661 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2841 }, | |
| 6662 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2845 }, | |
| 6663 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2846 }, | |
| 6664 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2848 }, | |
| 6665 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2850 }, | |
| 6666 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2851 }, | |
| 6667 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2852 }, | |
| 6668 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2853 }, | |
| 6669 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, | |
| 6670 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2856 }, | |
| 6671 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2861 }, | |
| 6672 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2862 }, | |
| 6673 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2863 }, | |
| 6674 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2864 }, | |
| 6675 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2865 }, | |
| 6676 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2866 }, | |
| 6677 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2867 }, | |
| 6678 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2866 }, | |
| 6679 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, | |
| 6680 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2868 }, | |
| 6681 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2869 }, | |
| 6682 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2870 }, | |
| 6683 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2871 }, | |
| 6684 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2868 }, | |
| 6685 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2872 }, | |
| 6686 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2869 }, | |
| 6687 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2870 }, | |
| 6688 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2873 }, | |
| 6689 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2874 }, | |
| 6690 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2876 }, | |
| 6691 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2877 }, | |
| 6692 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2878 }, | |
| 6693 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2879 }, | |
| 6694 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2881 }, | |
| 6695 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2882 }, | |
| 6696 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2883 }, | |
| 6697 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2884 }, | |
| 6698 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2882 }, | |
| 6699 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2885 }, | |
| 2685 | 6700 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2686 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2860 }, | |
| 2687 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2861 }, | |
| 2688 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2862 }, | |
| 2689 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2863 }, | |
| 2690 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2864 }, | |
| 2691 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2865 }, | |
| 2692 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2866 }, | |
| 2693 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2868 }, | |
| 2694 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2869 }, | |
| 2695 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2803 }, | |
| 2696 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2873 }, | |
| 2697 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2874 }, | |
| 2698 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2875 }, | |
| 2699 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 2700 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1530 }, | |
| 2701 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2653 }, | |
| 2702 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2876 }, | |
| 2703 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2877 }, | |
| 2704 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2878 }, | |
| 2705 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2879 }, | |
| 2706 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2880 }, | |
| 2707 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2881 }, | |
| 2708 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2883 }, | |
| 2709 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2885 }, | |
| 2710 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2886 }, | |
| 2711 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2890 }, | |
| 2712 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2892 }, | |
| 2713 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 393, .child_index = 2893 }, | |
| 2714 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2897 }, | |
| 2715 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2899 }, | |
| 2716 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 836, .child_index = 2901 }, | |
| 2717 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2915 }, | |
| 2718 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2916 }, | |
| 2719 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2917 }, | |
| 2720 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2918 }, | |
| 2721 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2919 }, | |
| 2722 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2920 }, | |
| 2723 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2921 }, | |
| 6701 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2886 }, | |
| 6702 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2887 }, | |
| 6703 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2888 }, | |
| 6704 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2889 }, | |
| 6705 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2890 }, | |
| 6706 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2891 }, | |
| 6707 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2892 }, | |
| 6708 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2894 }, | |
| 6709 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2895 }, | |
| 6710 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2829 }, | |
| 6711 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2899 }, | |
| 6712 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2900 }, | |
| 6713 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2901 }, | |
| 6714 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 6715 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1538 }, | |
| 6716 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2679 }, | |
| 6717 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2902 }, | |
| 6718 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2903 }, | |
| 6719 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2904 }, | |
| 6720 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2905 }, | |
| 6721 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2906 }, | |
| 6722 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2907 }, | |
| 6723 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2908 }, | |
| 6724 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2910 }, | |
| 6725 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2912 }, | |
| 6726 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2913 }, | |
| 6727 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2917 }, | |
| 6728 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2919 }, | |
| 6729 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 393, .child_index = 2920 }, | |
| 6730 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2924 }, | |
| 6731 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2926 }, | |
| 6732 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 836, .child_index = 2928 }, | |
| 6733 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2942 }, | |
| 6734 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2943 }, | |
| 6735 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2944 }, | |
| 6736 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2945 }, | |
| 6737 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2946 }, | |
| 6738 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2947 }, | |
| 6739 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2948 }, | |
| 2724 | 6740 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 2725 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2922 }, | |
| 2726 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2923 }, | |
| 2727 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2924 }, | |
| 2728 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2925 }, | |
| 2729 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2926 }, | |
| 2730 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2927 }, | |
| 2731 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2928 }, | |
| 2732 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, | |
| 6741 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2949 }, | |
| 6742 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2950 }, | |
| 6743 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2951 }, | |
| 6744 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2952 }, | |
| 6745 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2953 }, | |
| 6746 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2954 }, | |
| 6747 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2955 }, | |
| 6748 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, | |
| 2733 | 6749 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 2734 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1671 }, | |
| 6750 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1685 }, | |
| 2735 | 6751 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 506 }, |
| 2736 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2929 }, | |
| 2737 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2930 }, | |
| 6752 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2956 }, | |
| 6753 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2957 }, | |
| 2738 | 6754 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2739 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, | |
| 2740 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2931 }, | |
| 2741 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2932 }, | |
| 2742 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2933 }, | |
| 2743 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2934 }, | |
| 2744 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2935 }, | |
| 2745 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2936 }, | |
| 2746 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2311 }, | |
| 6755 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, | |
| 6756 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2958 }, | |
| 6757 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2959 }, | |
| 6758 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2960 }, | |
| 6759 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2961 }, | |
| 6760 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2962 }, | |
| 6761 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2963 }, | |
| 6762 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2333 }, | |
| 2747 | 6763 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, |
| 2748 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2937 }, | |
| 2749 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2944 }, | |
| 2750 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2945 }, | |
| 2751 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2946 }, | |
| 6764 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2964 }, | |
| 6765 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2971 }, | |
| 6766 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2972 }, | |
| 6767 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2973 }, | |
| 2752 | 6768 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 2753 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2947 }, | |
| 2754 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2948 }, | |
| 2755 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2949 }, | |
| 2756 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2950 }, | |
| 2757 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2951 }, | |
| 2758 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2952 }, | |
| 2759 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2953 }, | |
| 2760 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2954 }, | |
| 2761 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, | |
| 6769 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2974 }, | |
| 6770 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2975 }, | |
| 6771 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2976 }, | |
| 6772 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2977 }, | |
| 6773 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2978 }, | |
| 6774 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2979 }, | |
| 6775 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2980 }, | |
| 6776 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2981 }, | |
| 6777 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, | |
| 2762 | 6778 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 897 }, |
| 2763 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2955 }, | |
| 2764 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2956 }, | |
| 2765 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2957 }, | |
| 2766 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2958 }, | |
| 2767 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, | |
| 2768 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2960 }, | |
| 2769 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, | |
| 2770 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, | |
| 2771 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2961 }, | |
| 2772 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2962 }, | |
| 2773 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2963 }, | |
| 2774 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2964 }, | |
| 2775 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2965 }, | |
| 2776 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2967 }, | |
| 2777 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2968 }, | |
| 2778 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2972 }, | |
| 2779 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2974 }, | |
| 2780 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2976 }, | |
| 2781 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2980 }, | |
| 2782 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2981 }, | |
| 2783 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2985 }, | |
| 2784 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2986 }, | |
| 2785 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2989 }, | |
| 2786 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2992 }, | |
| 2787 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 2994 }, | |
| 2788 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 23, .child_index = 2997 }, | |
| 2789 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3003 }, | |
| 2790 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3004 }, | |
| 2791 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3006 }, | |
| 2792 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3008 }, | |
| 2793 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3009 }, | |
| 6779 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2982 }, | |
| 6780 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2983 }, | |
| 6781 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2984 }, | |
| 6782 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2985 }, | |
| 6783 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, | |
| 6784 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2987 }, | |
| 6785 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, | |
| 6786 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, | |
| 6787 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2988 }, | |
| 6788 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2989 }, | |
| 6789 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2990 }, | |
| 6790 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2991 }, | |
| 6791 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2992 }, | |
| 6792 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2994 }, | |
| 6793 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2995 }, | |
| 6794 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2999 }, | |
| 6795 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3001 }, | |
| 6796 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3003 }, | |
| 6797 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3007 }, | |
| 6798 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3008 }, | |
| 6799 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3012 }, | |
| 6800 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3013 }, | |
| 6801 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3016 }, | |
| 6802 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3019 }, | |
| 6803 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 3021 }, | |
| 6804 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 23, .child_index = 3024 }, | |
| 6805 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3030 }, | |
| 6806 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3031 }, | |
| 6807 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3033 }, | |
| 6808 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3035 }, | |
| 6809 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3036 }, | |
| 2794 | 6810 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, |
| 2795 | 6811 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2796 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3010 }, | |
| 6812 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3037 }, | |
| 2797 | 6813 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2798 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, | |
| 2799 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, | |
| 2800 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1712 }, | |
| 6814 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, | |
| 6815 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, | |
| 6816 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1726 }, | |
| 2801 | 6817 | .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, |
| 2802 | 6818 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2803 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3011 }, | |
| 6819 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3038 }, | |
| 2804 | 6820 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, |
| 2805 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2635 }, | |
| 2806 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3013 }, | |
| 2807 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3018 }, | |
| 2808 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3020 }, | |
| 2809 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3021 }, | |
| 2810 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3020 }, | |
| 2811 | .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3024 }, | |
| 6821 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, | |
| 6822 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3040 }, | |
| 6823 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3045 }, | |
| 6824 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3047 }, | |
| 6825 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3048 }, | |
| 6826 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3047 }, | |
| 6827 | .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3051 }, | |
| 2812 | 6828 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2813 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3011 }, | |
| 2814 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3025 }, | |
| 2815 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, | |
| 2816 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3027 }, | |
| 2817 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3028 }, | |
| 6829 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3038 }, | |
| 6830 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3052 }, | |
| 6831 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, | |
| 6832 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3054 }, | |
| 6833 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3055 }, | |
| 2818 | 6834 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, |
| 2819 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3029 }, | |
| 2820 | .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3024 }, | |
| 6835 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3056 }, | |
| 6836 | .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3051 }, | |
| 2821 | 6837 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2822 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3031 }, | |
| 2823 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1800 }, | |
| 2824 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3032 }, | |
| 2825 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3033 }, | |
| 2826 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3034 }, | |
| 2827 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3035 }, | |
| 6838 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3058 }, | |
| 6839 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1816 }, | |
| 6840 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3059 }, | |
| 6841 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3060 }, | |
| 6842 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3061 }, | |
| 6843 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3062 }, | |
| 2828 | 6844 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 512 }, |
| 2829 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3036 }, | |
| 2830 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3037 }, | |
| 2831 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3038 }, | |
| 2832 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3039 }, | |
| 6845 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3063 }, | |
| 6846 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3064 }, | |
| 6847 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, | |
| 6848 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3066 }, | |
| 6849 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3067 }, | |
| 2833 | 6850 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 2834 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3040 }, | |
| 6851 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3068 }, | |
| 2835 | 6852 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, |
| 2836 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3041 }, | |
| 2837 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3042 }, | |
| 2838 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3043 }, | |
| 2839 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3044 }, | |
| 2840 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3045 }, | |
| 2841 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3046 }, | |
| 2842 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1174 }, | |
| 2843 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3047 }, | |
| 2844 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3048 }, | |
| 2845 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3049 }, | |
| 2846 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3050 }, | |
| 2847 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3051 }, | |
| 2848 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3052 }, | |
| 2849 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3053 }, | |
| 2850 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3054 }, | |
| 2851 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3055 }, | |
| 2852 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3056 }, | |
| 2853 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3057 }, | |
| 2854 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3058 }, | |
| 2855 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3059 }, | |
| 2856 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3060 }, | |
| 2857 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3061 }, | |
| 2858 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, | |
| 2859 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3066 }, | |
| 2860 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3067 }, | |
| 2861 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3068 }, | |
| 2862 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3071 }, | |
| 2863 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3071 }, | |
| 2864 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3075 }, | |
| 2865 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, | |
| 6853 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3069 }, | |
| 6854 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3070 }, | |
| 6855 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3071 }, | |
| 6856 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3072 }, | |
| 6857 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3073 }, | |
| 6858 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3074 }, | |
| 6859 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1176 }, | |
| 6860 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3075 }, | |
| 6861 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3076 }, | |
| 6862 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3077 }, | |
| 6863 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3078 }, | |
| 6864 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3079 }, | |
| 6865 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3080 }, | |
| 6866 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3081 }, | |
| 6867 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3082 }, | |
| 6868 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3083 }, | |
| 6869 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3084 }, | |
| 6870 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3085 }, | |
| 6871 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3086 }, | |
| 6872 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3087 }, | |
| 6873 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3088 }, | |
| 6874 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3089 }, | |
| 6875 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3093 }, | |
| 6876 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3094 }, | |
| 6877 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3095 }, | |
| 6878 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3096 }, | |
| 6879 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3099 }, | |
| 6880 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3099 }, | |
| 6881 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3103 }, | |
| 6882 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, | |
| 2866 | 6883 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 2867 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3077 }, | |
| 2868 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3078 }, | |
| 2869 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3079 }, | |
| 2870 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3080 }, | |
| 2871 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3081 }, | |
| 2872 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 3082 }, | |
| 2873 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3087 }, | |
| 2874 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3088 }, | |
| 2875 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3089 }, | |
| 2876 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3091 }, | |
| 2877 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3092 }, | |
| 2878 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3093 }, | |
| 2879 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3094 }, | |
| 2880 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3095 }, | |
| 2881 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3096 }, | |
| 2882 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 3098 }, | |
| 2883 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3100 }, | |
| 2884 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3101 }, | |
| 2885 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2886 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2887 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3102 }, | |
| 2888 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2889 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2890 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3104 }, | |
| 2891 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, | |
| 2892 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2893 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2439 }, | |
| 2894 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 6884 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3105 }, | |
| 6885 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3106 }, | |
| 6886 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3107 }, | |
| 6887 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3108 }, | |
| 6888 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3109 }, | |
| 6889 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 3110 }, | |
| 6890 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3115 }, | |
| 6891 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3116 }, | |
| 6892 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3117 }, | |
| 6893 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3119 }, | |
| 6894 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3120 }, | |
| 6895 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3121 }, | |
| 6896 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3122 }, | |
| 6897 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3123 }, | |
| 6898 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3124 }, | |
| 6899 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 3126 }, | |
| 6900 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3128 }, | |
| 6901 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3129 }, | |
| 6902 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6903 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6904 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3130 }, | |
| 6905 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6906 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6907 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3132 }, | |
| 6908 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, | |
| 6909 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6910 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2462 }, | |
| 6911 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 2895 | 6912 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2896 | 6913 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2897 | 6914 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2898 | 6915 | .{ .char = 'v', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2899 | 6916 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2900 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, | |
| 2901 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 2902 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3106 }, | |
| 2903 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3102 }, | |
| 2904 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2905 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2906 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3102 }, | |
| 2907 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3107 }, | |
| 2908 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2909 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2910 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2911 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3108 }, | |
| 2912 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, | |
| 2913 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2914 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2915 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2916 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, | |
| 2917 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2758 }, | |
| 2918 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3109 }, | |
| 2919 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2920 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3111 }, | |
| 2921 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3112 }, | |
| 2922 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3113 }, | |
| 2923 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3114 }, | |
| 2924 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, | |
| 2925 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2926 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 2927 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3112 }, | |
| 2928 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2730 }, | |
| 2929 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3115 }, | |
| 2930 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3115 }, | |
| 2931 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3116 }, | |
| 2932 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2933 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2934 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3117 }, | |
| 2935 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2760 }, | |
| 2936 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, | |
| 2937 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 2938 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3117 }, | |
| 2939 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, | |
| 2940 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, | |
| 2941 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2758 }, | |
| 2942 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3109 }, | |
| 2943 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3118 }, | |
| 2944 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3120 }, | |
| 2945 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3107 }, | |
| 2946 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3107 }, | |
| 2947 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3121 }, | |
| 2948 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, | |
| 2949 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3122 }, | |
| 2950 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 2951 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3123 }, | |
| 2952 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3124 }, | |
| 6917 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, | |
| 6918 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 6919 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3134 }, | |
| 6920 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3130 }, | |
| 6921 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6922 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6923 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3130 }, | |
| 6924 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3135 }, | |
| 6925 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6926 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6927 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6928 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3136 }, | |
| 6929 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, | |
| 6930 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6931 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6932 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6933 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, | |
| 6934 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2784 }, | |
| 6935 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3137 }, | |
| 6936 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6937 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3139 }, | |
| 6938 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3140 }, | |
| 6939 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3141 }, | |
| 6940 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3142 }, | |
| 6941 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, | |
| 6942 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6943 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 6944 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3140 }, | |
| 6945 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2756 }, | |
| 6946 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3143 }, | |
| 6947 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3143 }, | |
| 6948 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3144 }, | |
| 6949 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6950 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6951 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3145 }, | |
| 6952 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2786 }, | |
| 6953 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, | |
| 6954 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 6955 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3145 }, | |
| 6956 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, | |
| 6957 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, | |
| 6958 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2784 }, | |
| 6959 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3137 }, | |
| 6960 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3146 }, | |
| 6961 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3148 }, | |
| 6962 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3135 }, | |
| 6963 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3135 }, | |
| 6964 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3149 }, | |
| 6965 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, | |
| 6966 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3150 }, | |
| 6967 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 6968 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3151 }, | |
| 6969 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3152 }, | |
| 2953 | 6970 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2954 | 6971 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2955 | 6972 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 2956 | 6973 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2957 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2775 }, | |
| 2958 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3125 }, | |
| 2959 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2786 }, | |
| 2960 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3127 }, | |
| 2961 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, | |
| 2962 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3130 }, | |
| 2963 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2786 }, | |
| 2964 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3131 }, | |
| 2965 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3132 }, | |
| 2966 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 2967 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 6974 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2801 }, | |
| 6975 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3153 }, | |
| 6976 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2812 }, | |
| 6977 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3155 }, | |
| 6978 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, | |
| 6979 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3158 }, | |
| 6980 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2812 }, | |
| 6981 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3159 }, | |
| 6982 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3160 }, | |
| 6983 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 6984 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 2968 | 6985 | .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2969 | 6986 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 2970 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3121 }, | |
| 2971 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3122 }, | |
| 2972 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 2973 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3133 }, | |
| 2974 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3136 }, | |
| 2975 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, | |
| 2976 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, | |
| 2977 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2978 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3137 }, | |
| 2979 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 2980 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 2981 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3139 }, | |
| 2982 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3140 }, | |
| 2983 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3141 }, | |
| 2984 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3142 }, | |
| 2985 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3143 }, | |
| 2986 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, | |
| 2987 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3144 }, | |
| 2988 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3145 }, | |
| 2989 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3146 }, | |
| 2990 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, | |
| 2991 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3147 }, | |
| 2992 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3148 }, | |
| 2993 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3149 }, | |
| 6987 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3149 }, | |
| 6988 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3150 }, | |
| 6989 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 6990 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3161 }, | |
| 6991 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3164 }, | |
| 6992 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, | |
| 6993 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, | |
| 6994 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6995 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3165 }, | |
| 6996 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 6997 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 6998 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3167 }, | |
| 6999 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3168 }, | |
| 7000 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3169 }, | |
| 7001 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3170 }, | |
| 7002 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3171 }, | |
| 7003 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, | |
| 7004 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3172 }, | |
| 7005 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3173 }, | |
| 7006 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3174 }, | |
| 7007 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, | |
| 7008 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3175 }, | |
| 7009 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3176 }, | |
| 7010 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3177 }, | |
| 2994 | 7011 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 311 }, |
| 2995 | .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 3150 }, | |
| 7012 | .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 3178 }, | |
| 2996 | 7013 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 2997 | 7014 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, |
| 2998 | 7015 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, |
| 2999 | 7016 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, |
| 3000 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3152 }, | |
| 3001 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3154 }, | |
| 3002 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3156 }, | |
| 3003 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3157 }, | |
| 3004 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3158 }, | |
| 3005 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3159 }, | |
| 3006 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2825 }, | |
| 7017 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3180 }, | |
| 7018 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3182 }, | |
| 7019 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3184 }, | |
| 7020 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3185 }, | |
| 7021 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3186 }, | |
| 7022 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3187 }, | |
| 7023 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2851 }, | |
| 3007 | 7024 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3008 | 7025 | .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3009 | .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, | |
| 3010 | .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, | |
| 3011 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, | |
| 3012 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3013 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3160 }, | |
| 3014 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3015 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3161 }, | |
| 3016 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3162 }, | |
| 3017 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3163 }, | |
| 7026 | .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, | |
| 7027 | .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, | |
| 7028 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, | |
| 7029 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7030 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3188 }, | |
| 7031 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7032 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3189 }, | |
| 7033 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3190 }, | |
| 7034 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3191 }, | |
| 3018 | 7035 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 3019 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3164 }, | |
| 3020 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3166 }, | |
| 7036 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3192 }, | |
| 7037 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3194 }, | |
| 3021 | 7038 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 3022 | 7039 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 3023 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3169 }, | |
| 3024 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3170 }, | |
| 3025 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3172 }, | |
| 3026 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3174 }, | |
| 3027 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3175 }, | |
| 7040 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3197 }, | |
| 7041 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3198 }, | |
| 7042 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3200 }, | |
| 7043 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3202 }, | |
| 7044 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3203 }, | |
| 3028 | 7045 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 3029 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3176 }, | |
| 3030 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3177 }, | |
| 3031 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3177 }, | |
| 7046 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3204 }, | |
| 7047 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3205 }, | |
| 7048 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3205 }, | |
| 3032 | 7049 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 3033 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3178 }, | |
| 7050 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3206 }, | |
| 3034 | 7051 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 3035 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, | |
| 3036 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3179 }, | |
| 3037 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3180 }, | |
| 3038 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3181 }, | |
| 3039 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3182 }, | |
| 3040 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3183 }, | |
| 3041 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3184 }, | |
| 3042 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3185 }, | |
| 3043 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3186 }, | |
| 3044 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3187 }, | |
| 3045 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3188 }, | |
| 3046 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3189 }, | |
| 3047 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2243 }, | |
| 3048 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3190 }, | |
| 7052 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, | |
| 7053 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3207 }, | |
| 7054 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3208 }, | |
| 7055 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3209 }, | |
| 7056 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3210 }, | |
| 7057 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3211 }, | |
| 7058 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3212 }, | |
| 7059 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3213 }, | |
| 7060 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3214 }, | |
| 7061 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3215 }, | |
| 7062 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3216 }, | |
| 7063 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3217 }, | |
| 7064 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2265 }, | |
| 7065 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3218 }, | |
| 3049 | 7066 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, |
| 3050 | 7067 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, |
| 3051 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3193 }, | |
| 3052 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3194 }, | |
| 3053 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1534 }, | |
| 7068 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3221 }, | |
| 7069 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3222 }, | |
| 7070 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1542 }, | |
| 3054 | 7071 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, |
| 3055 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3195 }, | |
| 3056 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3196 }, | |
| 3057 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3197 }, | |
| 3058 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3198 }, | |
| 3059 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3199 }, | |
| 3060 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3200 }, | |
| 3061 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3201 }, | |
| 3062 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3202 }, | |
| 3063 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3203 }, | |
| 3064 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3204 }, | |
| 3065 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3205 }, | |
| 3066 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3206 }, | |
| 3067 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3208 }, | |
| 3068 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3209 }, | |
| 3069 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3198 }, | |
| 3070 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3210 }, | |
| 3071 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3211 }, | |
| 3072 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3208 }, | |
| 3073 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3212 }, | |
| 3074 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 388, .child_index = 3213 }, | |
| 3075 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3204 }, | |
| 3076 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3225 }, | |
| 3077 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3208 }, | |
| 3078 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3227 }, | |
| 3079 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3228 }, | |
| 3080 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 3230 }, | |
| 3081 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 3231 }, | |
| 3082 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 45, .child_index = 3234 }, | |
| 3083 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3235 }, | |
| 3084 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 294, .child_index = 3237 }, | |
| 3085 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 3244 }, | |
| 3086 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 35, .child_index = 3245 }, | |
| 3087 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 81, .child_index = 3246 }, | |
| 3088 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3251 }, | |
| 3089 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3252 }, | |
| 3090 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3253 }, | |
| 3091 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 163, .child_index = 3259 }, | |
| 3092 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3267 }, | |
| 3093 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2892 }, | |
| 3094 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, | |
| 3095 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3269 }, | |
| 3096 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, | |
| 3097 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3270 }, | |
| 3098 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3271 }, | |
| 3099 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3272 }, | |
| 3100 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3273 }, | |
| 3101 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3274 }, | |
| 3102 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3275 }, | |
| 3103 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3276 }, | |
| 3104 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3277 }, | |
| 3105 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3278 }, | |
| 7072 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3223 }, | |
| 7073 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3224 }, | |
| 7074 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3225 }, | |
| 7075 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3226 }, | |
| 7076 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3227 }, | |
| 7077 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3228 }, | |
| 7078 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3229 }, | |
| 7079 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3230 }, | |
| 7080 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3231 }, | |
| 7081 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3232 }, | |
| 7082 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3233 }, | |
| 7083 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3234 }, | |
| 7084 | .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3235 }, | |
| 7085 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3237 }, | |
| 7086 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3238 }, | |
| 7087 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3227 }, | |
| 7088 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3239 }, | |
| 7089 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3240 }, | |
| 7090 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3237 }, | |
| 7091 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3241 }, | |
| 7092 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 388, .child_index = 3242 }, | |
| 7093 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3233 }, | |
| 7094 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3254 }, | |
| 7095 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3237 }, | |
| 7096 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3256 }, | |
| 7097 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3257 }, | |
| 7098 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 3259 }, | |
| 7099 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 3260 }, | |
| 7100 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 45, .child_index = 3263 }, | |
| 7101 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3264 }, | |
| 7102 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 294, .child_index = 3266 }, | |
| 7103 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 3273 }, | |
| 7104 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 35, .child_index = 3274 }, | |
| 7105 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 81, .child_index = 3275 }, | |
| 7106 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3280 }, | |
| 7107 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3281 }, | |
| 7108 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3282 }, | |
| 7109 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 163, .child_index = 3288 }, | |
| 7110 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3296 }, | |
| 7111 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2919 }, | |
| 7112 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, | |
| 7113 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3298 }, | |
| 7114 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, | |
| 7115 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3299 }, | |
| 7116 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3300 }, | |
| 7117 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, | |
| 7118 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3302 }, | |
| 7119 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3303 }, | |
| 7120 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3304 }, | |
| 7121 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3305 }, | |
| 7122 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3306 }, | |
| 7123 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3307 }, | |
| 3106 | 7124 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 3107 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3279 }, | |
| 3108 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3280 }, | |
| 3109 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3281 }, | |
| 3110 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3282 }, | |
| 3111 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3283 }, | |
| 3112 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3284 }, | |
| 3113 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3285 }, | |
| 3114 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3286 }, | |
| 3115 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3287 }, | |
| 3116 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2245 }, | |
| 3117 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3289 }, | |
| 3118 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3290 }, | |
| 3119 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3291 }, | |
| 3120 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3292 }, | |
| 3121 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3293 }, | |
| 3122 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3294 }, | |
| 3123 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3295 }, | |
| 3124 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3296 }, | |
| 3125 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3297 }, | |
| 3126 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3298 }, | |
| 3127 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3299 }, | |
| 3128 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3300 }, | |
| 3129 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, | |
| 3130 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3302 }, | |
| 3131 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3303 }, | |
| 3132 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3304 }, | |
| 3133 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3305 }, | |
| 7125 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3308 }, | |
| 7126 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3309 }, | |
| 7127 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3310 }, | |
| 7128 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3311 }, | |
| 7129 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3312 }, | |
| 7130 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3313 }, | |
| 7131 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3314 }, | |
| 7132 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3315 }, | |
| 7133 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3316 }, | |
| 7134 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2267 }, | |
| 7135 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3318 }, | |
| 7136 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3319 }, | |
| 7137 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3320 }, | |
| 7138 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3321 }, | |
| 7139 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3322 }, | |
| 7140 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3323 }, | |
| 7141 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3324 }, | |
| 7142 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3325 }, | |
| 7143 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3326 }, | |
| 7144 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3327 }, | |
| 7145 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3328 }, | |
| 7146 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3329 }, | |
| 7147 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3330 }, | |
| 7148 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3331 }, | |
| 7149 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3332 }, | |
| 7150 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3333 }, | |
| 7151 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3334 }, | |
| 3134 | 7152 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 486 }, |
| 3135 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3306 }, | |
| 3136 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3307 }, | |
| 3137 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3308 }, | |
| 3138 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, | |
| 3139 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3309 }, | |
| 7153 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3335 }, | |
| 7154 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3336 }, | |
| 7155 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3337 }, | |
| 7156 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, | |
| 7157 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3338 }, | |
| 3140 | 7158 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, |
| 3141 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3310 }, | |
| 3142 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3311 }, | |
| 3143 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3312 }, | |
| 3144 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3313 }, | |
| 3145 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3314 }, | |
| 3146 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3315 }, | |
| 3147 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3316 }, | |
| 3148 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3317 }, | |
| 3149 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3318 }, | |
| 3150 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3319 }, | |
| 3151 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3321 }, | |
| 3152 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3322 }, | |
| 3153 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3323 }, | |
| 3154 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3324 }, | |
| 3155 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1948 }, | |
| 3156 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3325 }, | |
| 3157 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3326 }, | |
| 3158 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3328 }, | |
| 3159 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3330 }, | |
| 3160 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2865 }, | |
| 3161 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3331 }, | |
| 3162 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3332 }, | |
| 3163 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3333 }, | |
| 3164 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3334 }, | |
| 3165 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3335 }, | |
| 3166 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3336 }, | |
| 3167 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3337 }, | |
| 3168 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3338 }, | |
| 3169 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3339 }, | |
| 3170 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3340 }, | |
| 3171 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3341 }, | |
| 3172 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3342 }, | |
| 3173 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3343 }, | |
| 3174 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3344 }, | |
| 3175 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3345 }, | |
| 3176 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3351 }, | |
| 3177 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3352 }, | |
| 7159 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3339 }, | |
| 7160 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3340 }, | |
| 7161 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3341 }, | |
| 7162 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3342 }, | |
| 7163 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3343 }, | |
| 7164 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3344 }, | |
| 7165 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3345 }, | |
| 7166 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3346 }, | |
| 7167 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3347 }, | |
| 7168 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3348 }, | |
| 7169 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3350 }, | |
| 7170 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3351 }, | |
| 7171 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3352 }, | |
| 3178 | 7172 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3353 }, |
| 3179 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3354 }, | |
| 3180 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3356 }, | |
| 3181 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3357 }, | |
| 3182 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3352 }, | |
| 3183 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3358 }, | |
| 3184 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3359 }, | |
| 3185 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3360 }, | |
| 3186 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3361 }, | |
| 3187 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3362 }, | |
| 3188 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3181 }, | |
| 7173 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1967 }, | |
| 7174 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3354 }, | |
| 7175 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3355 }, | |
| 7176 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3357 }, | |
| 7177 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3359 }, | |
| 7178 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2891 }, | |
| 7179 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3360 }, | |
| 7180 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3361 }, | |
| 7181 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3362 }, | |
| 7182 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, | |
| 7183 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3364 }, | |
| 7184 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3365 }, | |
| 7185 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3366 }, | |
| 7186 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3367 }, | |
| 7187 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3368 }, | |
| 7188 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3369 }, | |
| 7189 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3370 }, | |
| 7190 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3371 }, | |
| 7191 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3372 }, | |
| 7192 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3373 }, | |
| 7193 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3374 }, | |
| 7194 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3380 }, | |
| 7195 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3381 }, | |
| 7196 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3382 }, | |
| 7197 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3383 }, | |
| 7198 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3385 }, | |
| 7199 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3386 }, | |
| 7200 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3381 }, | |
| 7201 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3387 }, | |
| 7202 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3388 }, | |
| 7203 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3389 }, | |
| 7204 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3390 }, | |
| 7205 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3391 }, | |
| 7206 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3209 }, | |
| 3189 | 7207 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 3190 | 7208 | .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3191 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, | |
| 3192 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3365 }, | |
| 3193 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3020 }, | |
| 3194 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, | |
| 3195 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3363 }, | |
| 3196 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3365 }, | |
| 3197 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3020 }, | |
| 3198 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3365 }, | |
| 3199 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, | |
| 3200 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, | |
| 3201 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3363 }, | |
| 7209 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, | |
| 7210 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3394 }, | |
| 7211 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3047 }, | |
| 7212 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, | |
| 7213 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3392 }, | |
| 7214 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3394 }, | |
| 7215 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3047 }, | |
| 7216 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3394 }, | |
| 7217 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, | |
| 7218 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, | |
| 7219 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3392 }, | |
| 3202 | 7220 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 648 }, |
| 3203 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, | |
| 7221 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, | |
| 3204 | 7222 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 648 }, |
| 3205 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3366 }, | |
| 7223 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, | |
| 3206 | 7224 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 238 }, |
| 3207 | 7225 | .{ .char = '8', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3208 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2319 }, | |
| 3209 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3367 }, | |
| 3210 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3368 }, | |
| 3211 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3369 }, | |
| 3212 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3370 }, | |
| 3213 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3371 }, | |
| 3214 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3372 }, | |
| 7226 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2342 }, | |
| 7227 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3396 }, | |
| 7228 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3397 }, | |
| 7229 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3398 }, | |
| 7230 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3399 }, | |
| 7231 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3400 }, | |
| 7232 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2870 }, | |
| 7233 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3401 }, | |
| 3215 | 7234 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 3216 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3373 }, | |
| 3217 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3374 }, | |
| 7235 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3402 }, | |
| 7236 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3403 }, | |
| 3218 | 7237 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 581 }, |
| 3219 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3375 }, | |
| 3220 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3376 }, | |
| 3221 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3377 }, | |
| 3222 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3378 }, | |
| 3223 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3379 }, | |
| 3224 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3380 }, | |
| 7238 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3404 }, | |
| 7239 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, | |
| 7240 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3406 }, | |
| 7241 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3407 }, | |
| 7242 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3408 }, | |
| 7243 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3409 }, | |
| 3225 | 7244 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, |
| 3226 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3381 }, | |
| 7245 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3410 }, | |
| 3227 | 7246 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, |
| 3228 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3382 }, | |
| 3229 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3383 }, | |
| 7247 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3411 }, | |
| 7248 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3412 }, | |
| 3230 | 7249 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, |
| 3231 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3384 }, | |
| 3232 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, | |
| 3233 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3385 }, | |
| 3234 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3052 }, | |
| 3235 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3386 }, | |
| 3236 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3387 }, | |
| 3237 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3388 }, | |
| 3238 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3389 }, | |
| 3239 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3390 }, | |
| 7250 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3413 }, | |
| 7251 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, | |
| 7252 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3414 }, | |
| 7253 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3080 }, | |
| 7254 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3415 }, | |
| 7255 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3416 }, | |
| 7256 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3417 }, | |
| 7257 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3418 }, | |
| 7258 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3419 }, | |
| 3240 | 7259 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, |
| 3241 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3392 }, | |
| 7260 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3421 }, | |
| 3242 | 7261 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, |
| 3243 | 7262 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, |
| 3244 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3394 }, | |
| 3245 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, | |
| 3246 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3396 }, | |
| 3247 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3398 }, | |
| 3248 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3400 }, | |
| 3249 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, | |
| 3250 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3402 }, | |
| 3251 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3404 }, | |
| 3252 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, | |
| 3253 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3406 }, | |
| 3254 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3407 }, | |
| 3255 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, | |
| 3256 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3409 }, | |
| 3257 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2248 }, | |
| 3258 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, | |
| 3259 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3410 }, | |
| 3260 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3411 }, | |
| 3261 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3413 }, | |
| 3262 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3415 }, | |
| 3263 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3416 }, | |
| 3264 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, | |
| 3265 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3417 }, | |
| 3266 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, | |
| 3267 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 17, .child_index = 3419 }, | |
| 3268 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, | |
| 3269 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3421 }, | |
| 7263 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3423 }, | |
| 7264 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3424 }, | |
| 7265 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3425 }, | |
| 7266 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3427 }, | |
| 7267 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3429 }, | |
| 7268 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, | |
| 7269 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3431 }, | |
| 7270 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3433 }, | |
| 7271 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, | |
| 7272 | .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3435 }, | |
| 7273 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3436 }, | |
| 7274 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, | |
| 7275 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3438 }, | |
| 7276 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2270 }, | |
| 7277 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, | |
| 7278 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3439 }, | |
| 7279 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3440 }, | |
| 7280 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3442 }, | |
| 7281 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3444 }, | |
| 7282 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3445 }, | |
| 7283 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, | |
| 7284 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3446 }, | |
| 7285 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, | |
| 7286 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 17, .child_index = 3448 }, | |
| 7287 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3093 }, | |
| 7288 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3450 }, | |
| 3270 | 7289 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 3271 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, | |
| 7290 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, | |
| 3272 | 7291 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, |
| 3273 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3422 }, | |
| 3274 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3423 }, | |
| 3275 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, | |
| 3276 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3390 }, | |
| 3277 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3392 }, | |
| 3278 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 3279 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3127 }, | |
| 3280 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, | |
| 3281 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 3282 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2722 }, | |
| 3283 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 7292 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3451 }, | |
| 7293 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3452 }, | |
| 7294 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, | |
| 7295 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3419 }, | |
| 7296 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3421 }, | |
| 7297 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 7298 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3155 }, | |
| 7299 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, | |
| 7300 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 7301 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2748 }, | |
| 7302 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 3284 | 7303 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, |
| 3285 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3424 }, | |
| 3286 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3426 }, | |
| 3287 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3125 }, | |
| 3288 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 3289 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2765 }, | |
| 3290 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 3291 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2746 }, | |
| 3292 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3427 }, | |
| 3293 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3428 }, | |
| 3294 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 3295 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 7304 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3453 }, | |
| 7305 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3455 }, | |
| 7306 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3153 }, | |
| 7307 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 7308 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2791 }, | |
| 7309 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 7310 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2772 }, | |
| 7311 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3456 }, | |
| 7312 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3457 }, | |
| 7313 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 7314 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 3296 | 7315 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3297 | 7316 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3298 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3431 }, | |
| 3299 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 3300 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 3301 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2794 }, | |
| 3302 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 7317 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3460 }, | |
| 7318 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 7319 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 7320 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2820 }, | |
| 7321 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 3303 | 7322 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3304 | 7323 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3305 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, | |
| 3306 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, | |
| 3307 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 3308 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, | |
| 3309 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2765 }, | |
| 3310 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3131 }, | |
| 7324 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, | |
| 7325 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, | |
| 7326 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 7327 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, | |
| 7328 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2791 }, | |
| 7329 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3159 }, | |
| 3311 | 7330 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3312 | 7331 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3313 | 7332 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3314 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, | |
| 3315 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3102 }, | |
| 3316 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3432 }, | |
| 3317 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, | |
| 3318 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2053 }, | |
| 3319 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, | |
| 3320 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3435 }, | |
| 3321 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3436 }, | |
| 3322 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3437 }, | |
| 3323 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3439 }, | |
| 3324 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3440 }, | |
| 7333 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, | |
| 7334 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3130 }, | |
| 7335 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3461 }, | |
| 7336 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, | |
| 7337 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2073 }, | |
| 7338 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3463 }, | |
| 7339 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3464 }, | |
| 7340 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3465 }, | |
| 7341 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3466 }, | |
| 7342 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3468 }, | |
| 7343 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3469 }, | |
| 3325 | 7344 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, |
| 3326 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3441 }, | |
| 3327 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3442 }, | |
| 3328 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3443 }, | |
| 7345 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3470 }, | |
| 7346 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3471 }, | |
| 7347 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3472 }, | |
| 3329 | 7348 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3330 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3444 }, | |
| 3331 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3444 }, | |
| 3332 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2560 }, | |
| 3333 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2560 }, | |
| 3334 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3445 }, | |
| 3335 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3336 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3337 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3446 }, | |
| 3338 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, | |
| 3339 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3340 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3448 }, | |
| 3341 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3449 }, | |
| 7349 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3473 }, | |
| 7350 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3473 }, | |
| 7351 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2585 }, | |
| 7352 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2585 }, | |
| 7353 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3474 }, | |
| 7354 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7355 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7356 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3475 }, | |
| 7357 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3476 }, | |
| 7358 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7359 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3477 }, | |
| 7360 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3478 }, | |
| 3342 | 7361 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, |
| 3343 | 7362 | .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 3344 | 7363 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3345 | 7364 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3346 | 7365 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3347 | 7366 | .{ .char = 'u', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3348 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3450 }, | |
| 3349 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3452 }, | |
| 3350 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3408 }, | |
| 3351 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, | |
| 3352 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3453 }, | |
| 3353 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3454 }, | |
| 3354 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3455 }, | |
| 3355 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, | |
| 3356 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3456 }, | |
| 3357 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3164 }, | |
| 3358 | .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3458 }, | |
| 7367 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3479 }, | |
| 7368 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3481 }, | |
| 7369 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3437 }, | |
| 7370 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, | |
| 7371 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3482 }, | |
| 7372 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3483 }, | |
| 7373 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3484 }, | |
| 7374 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, | |
| 7375 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, | |
| 7376 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3192 }, | |
| 7377 | .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3487 }, | |
| 3359 | 7378 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3360 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3460 }, | |
| 3361 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3461 }, | |
| 3362 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3462 }, | |
| 3363 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3463 }, | |
| 3364 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3464 }, | |
| 3365 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3465 }, | |
| 3366 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3466 }, | |
| 3367 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3467 }, | |
| 7379 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3489 }, | |
| 7380 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3490 }, | |
| 7381 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3491 }, | |
| 7382 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3492 }, | |
| 7383 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3493 }, | |
| 7384 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3494 }, | |
| 7385 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3495 }, | |
| 7386 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3496 }, | |
| 3368 | 7387 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, |
| 3369 | 7388 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 457 }, |
| 3370 | 7389 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 3371 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3468 }, | |
| 3372 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3469 }, | |
| 3373 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2878 }, | |
| 3374 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3470 }, | |
| 7390 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3497 }, | |
| 7391 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3498 }, | |
| 7392 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3499 }, | |
| 7393 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2905 }, | |
| 7394 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3500 }, | |
| 3375 | 7395 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 238 }, |
| 3376 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3210 }, | |
| 3377 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3210 }, | |
| 3378 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3471 }, | |
| 3379 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3472 }, | |
| 3380 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3473 }, | |
| 3381 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3474 }, | |
| 3382 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3475 }, | |
| 3383 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3476 }, | |
| 3384 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3477 }, | |
| 3385 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3478 }, | |
| 3386 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3481 }, | |
| 3387 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3482 }, | |
| 3388 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3483 }, | |
| 3389 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3484 }, | |
| 3390 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, | |
| 3391 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3486 }, | |
| 3392 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3488 }, | |
| 3393 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 3489 }, | |
| 3394 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3491 }, | |
| 3395 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 242, .child_index = 3492 }, | |
| 3396 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3497 }, | |
| 3397 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3498 }, | |
| 3398 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3500 }, | |
| 3399 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3501 }, | |
| 3400 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3502 }, | |
| 3401 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3504 }, | |
| 3402 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3508 }, | |
| 3403 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3509 }, | |
| 7396 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3239 }, | |
| 7397 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3239 }, | |
| 7398 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3501 }, | |
| 7399 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3502 }, | |
| 7400 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3503 }, | |
| 7401 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3504 }, | |
| 7402 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3505 }, | |
| 7403 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3506 }, | |
| 7404 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3507 }, | |
| 7405 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3508 }, | |
| 7406 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3511 }, | |
| 7407 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3512 }, | |
| 7408 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3513 }, | |
| 7409 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3514 }, | |
| 7410 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3515 }, | |
| 7411 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3516 }, | |
| 7412 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3518 }, | |
| 7413 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 3519 }, | |
| 7414 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3521 }, | |
| 7415 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 242, .child_index = 3522 }, | |
| 7416 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3527 }, | |
| 7417 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3528 }, | |
| 7418 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3530 }, | |
| 7419 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3531 }, | |
| 7420 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3532 }, | |
| 7421 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3534 }, | |
| 7422 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3538 }, | |
| 7423 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3539 }, | |
| 3404 | 7424 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 3405 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3510 }, | |
| 3406 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3511 }, | |
| 3407 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3512 }, | |
| 3408 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3513 }, | |
| 3409 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3515 }, | |
| 3410 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3516 }, | |
| 3411 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3517 }, | |
| 3412 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3518 }, | |
| 3413 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3519 }, | |
| 3414 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3516 }, | |
| 3415 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3520 }, | |
| 3416 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3521 }, | |
| 3417 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3522 }, | |
| 3418 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 186, .child_index = 3523 }, | |
| 3419 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3528 }, | |
| 3420 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3529 }, | |
| 3421 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 3530 }, | |
| 3422 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 32, .child_index = 3532 }, | |
| 3423 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 35, .child_index = 3536 }, | |
| 3424 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3542 }, | |
| 3425 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3543 }, | |
| 3426 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3544 }, | |
| 3427 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 34, .child_index = 3545 }, | |
| 3428 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3546 }, | |
| 3429 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, | |
| 3430 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3548 }, | |
| 3431 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3549 }, | |
| 3432 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3550 }, | |
| 3433 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3551 }, | |
| 3434 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3553 }, | |
| 3435 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3554 }, | |
| 3436 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3555 }, | |
| 3437 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3556 }, | |
| 3438 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3561 }, | |
| 3439 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3562 }, | |
| 3440 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3563 }, | |
| 3441 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3564 }, | |
| 3442 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3564 }, | |
| 3443 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 48, .child_index = 3566 }, | |
| 3444 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3572 }, | |
| 3445 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3251 }, | |
| 3446 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3574 }, | |
| 3447 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3575 }, | |
| 3448 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3576 }, | |
| 3449 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3577 }, | |
| 3450 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3578 }, | |
| 3451 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3579 }, | |
| 3452 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3369 }, | |
| 3453 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3583 }, | |
| 3454 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3584 }, | |
| 3455 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3585 }, | |
| 3456 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3586 }, | |
| 7425 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3540 }, | |
| 7426 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3541 }, | |
| 7427 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3542 }, | |
| 7428 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3543 }, | |
| 7429 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3545 }, | |
| 7430 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3546 }, | |
| 7431 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3547 }, | |
| 7432 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3548 }, | |
| 7433 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3549 }, | |
| 7434 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3546 }, | |
| 7435 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3550 }, | |
| 7436 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3551 }, | |
| 7437 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3552 }, | |
| 7438 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 186, .child_index = 3553 }, | |
| 7439 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3558 }, | |
| 7440 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3559 }, | |
| 7441 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 3560 }, | |
| 7442 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 32, .child_index = 3562 }, | |
| 7443 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 35, .child_index = 3566 }, | |
| 7444 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3572 }, | |
| 7445 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3573 }, | |
| 7446 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3574 }, | |
| 7447 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 34, .child_index = 3575 }, | |
| 7448 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3576 }, | |
| 7449 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, | |
| 7450 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3578 }, | |
| 7451 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3579 }, | |
| 7452 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3580 }, | |
| 7453 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3581 }, | |
| 7454 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3583 }, | |
| 7455 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3584 }, | |
| 7456 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3585 }, | |
| 7457 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3586 }, | |
| 7458 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3591 }, | |
| 7459 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3592 }, | |
| 7460 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3593 }, | |
| 7461 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3594 }, | |
| 7462 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3594 }, | |
| 7463 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 48, .child_index = 3596 }, | |
| 7464 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3602 }, | |
| 7465 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3280 }, | |
| 7466 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3604 }, | |
| 7467 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3605 }, | |
| 7468 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3606 }, | |
| 7469 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3607 }, | |
| 7470 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3608 }, | |
| 7471 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3609 }, | |
| 7472 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3398 }, | |
| 7473 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3613 }, | |
| 7474 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3614 }, | |
| 7475 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3615 }, | |
| 7476 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3616 }, | |
| 3457 | 7477 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, |
| 3458 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1665 }, | |
| 3459 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2640 }, | |
| 3460 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3588 }, | |
| 3461 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, | |
| 3462 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3056 }, | |
| 3463 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3589 }, | |
| 3464 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3590 }, | |
| 3465 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3591 }, | |
| 3466 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3591 }, | |
| 3467 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3592 }, | |
| 3468 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 3469 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3593 }, | |
| 3470 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2245 }, | |
| 3471 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3290 }, | |
| 3472 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 3473 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3594 }, | |
| 3474 | .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 3475 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3595 }, | |
| 3476 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3596 }, | |
| 3477 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3597 }, | |
| 3478 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3598 }, | |
| 7478 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1679 }, | |
| 7479 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2665 }, | |
| 7480 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3618 }, | |
| 7481 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, | |
| 7482 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3084 }, | |
| 7483 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3619 }, | |
| 7484 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3620 }, | |
| 7485 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3621 }, | |
| 7486 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3621 }, | |
| 7487 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3622 }, | |
| 7488 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 7489 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3623 }, | |
| 7490 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2267 }, | |
| 7491 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3319 }, | |
| 7492 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 7493 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3624 }, | |
| 7494 | .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 7495 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3625 }, | |
| 7496 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3626 }, | |
| 7497 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3627 }, | |
| 7498 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3628 }, | |
| 3479 | 7499 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 3480 | .{ .char = 'E', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3599 }, | |
| 3481 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3600 }, | |
| 3482 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 3601 }, | |
| 7500 | .{ .char = 'E', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3629 }, | |
| 7501 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3630 }, | |
| 7502 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 3631 }, | |
| 3483 | 7503 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 3484 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3606 }, | |
| 3485 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3607 }, | |
| 3486 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3608 }, | |
| 3487 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3609 }, | |
| 3488 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3610 }, | |
| 3489 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3611 }, | |
| 3490 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3612 }, | |
| 3491 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3613 }, | |
| 3492 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3614 }, | |
| 3493 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3615 }, | |
| 7504 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3636 }, | |
| 7505 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3637 }, | |
| 7506 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3638 }, | |
| 7507 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3639 }, | |
| 7508 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3640 }, | |
| 7509 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3641 }, | |
| 7510 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3642 }, | |
| 7511 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3643 }, | |
| 7512 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3644 }, | |
| 7513 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3645 }, | |
| 3494 | 7514 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 3495 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3616 }, | |
| 3496 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3617 }, | |
| 3497 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3618 }, | |
| 3498 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3619 }, | |
| 3499 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3620 }, | |
| 3500 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3626 }, | |
| 3501 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2555 }, | |
| 3502 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, | |
| 3503 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3627 }, | |
| 3504 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3628 }, | |
| 3505 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3629 }, | |
| 3506 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3630 }, | |
| 3507 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3631 }, | |
| 3508 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3632 }, | |
| 3509 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3633 }, | |
| 3510 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3634 }, | |
| 3511 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3636 }, | |
| 3512 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3637 }, | |
| 7515 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3646 }, | |
| 7516 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3647 }, | |
| 7517 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3648 }, | |
| 7518 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3649 }, | |
| 7519 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3650 }, | |
| 7520 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3656 }, | |
| 7521 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2580 }, | |
| 7522 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, | |
| 7523 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3657 }, | |
| 7524 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3658 }, | |
| 7525 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3659 }, | |
| 7526 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3660 }, | |
| 7527 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3661 }, | |
| 7528 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3662 }, | |
| 7529 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3663 }, | |
| 7530 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3664 }, | |
| 7531 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3666 }, | |
| 7532 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3667 }, | |
| 3513 | 7533 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 3514 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3638 }, | |
| 3515 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3640 }, | |
| 3516 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3641 }, | |
| 3517 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3642 }, | |
| 3518 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3643 }, | |
| 3519 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3644 }, | |
| 7534 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3668 }, | |
| 7535 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3670 }, | |
| 7536 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3671 }, | |
| 7537 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3672 }, | |
| 7538 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3673 }, | |
| 7539 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3674 }, | |
| 3520 | 7540 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, |
| 3521 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3645 }, | |
| 3522 | .{ .char = 'q', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3646 }, | |
| 3523 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3648 }, | |
| 3524 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3649 }, | |
| 3525 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3651 }, | |
| 3526 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3652 }, | |
| 3527 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3653 }, | |
| 3528 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3655 }, | |
| 3529 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3656 }, | |
| 7541 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3675 }, | |
| 7542 | .{ .char = 'q', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3676 }, | |
| 7543 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3678 }, | |
| 7544 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3679 }, | |
| 7545 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3681 }, | |
| 7546 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3682 }, | |
| 7547 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3683 }, | |
| 7548 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3685 }, | |
| 7549 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3686 }, | |
| 3530 | 7550 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 3531 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3657 }, | |
| 3532 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3658 }, | |
| 7551 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3687 }, | |
| 7552 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3688 }, | |
| 3533 | 7553 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 3534 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3659 }, | |
| 3535 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3660 }, | |
| 3536 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3658 }, | |
| 3537 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3661 }, | |
| 3538 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3662 }, | |
| 3539 | .{ .char = 'T', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3663 }, | |
| 3540 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3664 }, | |
| 7554 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3689 }, | |
| 7555 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3690 }, | |
| 7556 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3688 }, | |
| 7557 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3691 }, | |
| 7558 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3692 }, | |
| 7559 | .{ .char = 'T', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3693 }, | |
| 7560 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3694 }, | |
| 3541 | 7561 | .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3542 | 7562 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3543 | 7563 | .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3544 | 7564 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 3545 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3456 }, | |
| 3546 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3665 }, | |
| 3547 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3579 }, | |
| 3548 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3666 }, | |
| 3549 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3667 }, | |
| 3550 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3668 }, | |
| 3551 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3669 }, | |
| 3552 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3670 }, | |
| 3553 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3671 }, | |
| 3554 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3672 }, | |
| 3555 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3673 }, | |
| 3556 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3674 }, | |
| 3557 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3675 }, | |
| 3558 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3676 }, | |
| 3559 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3677 }, | |
| 3560 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3442 }, | |
| 3561 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3678 }, | |
| 3562 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2672 }, | |
| 3563 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3679 }, | |
| 3564 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3680 }, | |
| 3565 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3681 }, | |
| 3566 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3682 }, | |
| 3567 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3683 }, | |
| 3568 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3684 }, | |
| 3569 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3686 }, | |
| 3570 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3687 }, | |
| 3571 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3690 }, | |
| 3572 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, | |
| 3573 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3691 }, | |
| 3574 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3692 }, | |
| 3575 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3693 }, | |
| 3576 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3695 }, | |
| 3577 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3400 }, | |
| 3578 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3696 }, | |
| 3579 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 3580 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3699 }, | |
| 3581 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3700 }, | |
| 3582 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3701 }, | |
| 3583 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3401 }, | |
| 7565 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, | |
| 7566 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3695 }, | |
| 7567 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3609 }, | |
| 7568 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3696 }, | |
| 7569 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3697 }, | |
| 7570 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 7571 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3699 }, | |
| 7572 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3700 }, | |
| 7573 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3701 }, | |
| 7574 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3702 }, | |
| 7575 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3703 }, | |
| 7576 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3704 }, | |
| 7577 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3705 }, | |
| 7578 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3706 }, | |
| 7579 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3707 }, | |
| 7580 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3471 }, | |
| 7581 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3708 }, | |
| 7582 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2698 }, | |
| 7583 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3709 }, | |
| 7584 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3710 }, | |
| 7585 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3711 }, | |
| 7586 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3712 }, | |
| 7587 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3713 }, | |
| 7588 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3714 }, | |
| 7589 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3716 }, | |
| 7590 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3717 }, | |
| 7591 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3720 }, | |
| 7592 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, | |
| 7593 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3721 }, | |
| 7594 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3722 }, | |
| 7595 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3723 }, | |
| 7596 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3725 }, | |
| 7597 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3429 }, | |
| 7598 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3726 }, | |
| 7599 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, | |
| 7600 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3729 }, | |
| 7601 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3730 }, | |
| 7602 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3731 }, | |
| 7603 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3430 }, | |
| 3584 | 7604 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 3585 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3702 }, | |
| 7605 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3732 }, | |
| 3586 | 7606 | .{ .char = 'u', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3587 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3705 }, | |
| 7607 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3735 }, | |
| 3588 | 7608 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 3589 | 7609 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 3590 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 3591 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3707 }, | |
| 3592 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3708 }, | |
| 3593 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3709 }, | |
| 3594 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3711 }, | |
| 3595 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3713 }, | |
| 3596 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3714 }, | |
| 3597 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3716 }, | |
| 3598 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3718 }, | |
| 3599 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3720 }, | |
| 3600 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3721 }, | |
| 3601 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3724 }, | |
| 3602 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3727 }, | |
| 3603 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3727 }, | |
| 3604 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 3605 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3728 }, | |
| 3606 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, | |
| 7610 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, | |
| 7611 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3737 }, | |
| 7612 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3738 }, | |
| 7613 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3739 }, | |
| 7614 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3741 }, | |
| 7615 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3743 }, | |
| 7616 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3744 }, | |
| 7617 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3746 }, | |
| 7618 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3748 }, | |
| 7619 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3750 }, | |
| 7620 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3751 }, | |
| 7621 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3754 }, | |
| 7622 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3757 }, | |
| 7623 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3757 }, | |
| 7624 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 7625 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3758 }, | |
| 7626 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, | |
| 3607 | 7627 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3608 | 7628 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3609 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3427 }, | |
| 3610 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3730 }, | |
| 3611 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3731 }, | |
| 3612 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3732 }, | |
| 3613 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3733 }, | |
| 3614 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3734 }, | |
| 3615 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3735 }, | |
| 3616 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3736 }, | |
| 3617 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3737 }, | |
| 3618 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3738 }, | |
| 3619 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3739 }, | |
| 7629 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3456 }, | |
| 7630 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3760 }, | |
| 7631 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3761 }, | |
| 7632 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3762 }, | |
| 7633 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3763 }, | |
| 7634 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3764 }, | |
| 7635 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3765 }, | |
| 7636 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3766 }, | |
| 7637 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3767 }, | |
| 7638 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3768 }, | |
| 7639 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3769 }, | |
| 3620 | 7640 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3621 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3740 }, | |
| 7641 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3770 }, | |
| 3622 | 7642 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3623 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3741 }, | |
| 3624 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3625 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3742 }, | |
| 3626 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3743 }, | |
| 3627 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3744 }, | |
| 7643 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3771 }, | |
| 7644 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7645 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3772 }, | |
| 7646 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3773 }, | |
| 7647 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3774 }, | |
| 3628 | 7648 | .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3629 | 7649 | .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3630 | 7650 | .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3631 | 7651 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 3632 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3745 }, | |
| 3633 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3747 }, | |
| 7652 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3775 }, | |
| 7653 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3777 }, | |
| 3634 | 7654 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3635 | 7655 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3636 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3748 }, | |
| 3637 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3749 }, | |
| 3638 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3750 }, | |
| 3639 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3751 }, | |
| 3640 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3752 }, | |
| 3641 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3753 }, | |
| 3642 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3754 }, | |
| 3643 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3755 }, | |
| 3644 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3756 }, | |
| 3645 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3757 }, | |
| 3646 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3579 }, | |
| 3647 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3468 }, | |
| 7656 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3778 }, | |
| 7657 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3779 }, | |
| 7658 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3780 }, | |
| 7659 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3781 }, | |
| 7660 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3782 }, | |
| 7661 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3783 }, | |
| 7662 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3784 }, | |
| 7663 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3785 }, | |
| 7664 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3786 }, | |
| 7665 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3787 }, | |
| 7666 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3609 }, | |
| 7667 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3497 }, | |
| 7668 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3788 }, | |
| 3648 | 7669 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 3649 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3758 }, | |
| 3650 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3759 }, | |
| 3651 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3204 }, | |
| 3652 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3760 }, | |
| 3653 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3761 }, | |
| 3654 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3762 }, | |
| 3655 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3763 }, | |
| 3656 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3765 }, | |
| 3657 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3765 }, | |
| 3658 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3765 }, | |
| 3659 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3766 }, | |
| 3660 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3767 }, | |
| 3661 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3768 }, | |
| 3662 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3770 }, | |
| 3663 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3771 }, | |
| 3664 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3772 }, | |
| 3665 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3773 }, | |
| 3666 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3774 }, | |
| 3667 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3776 }, | |
| 3668 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3777 }, | |
| 3669 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3778 }, | |
| 3670 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3779 }, | |
| 3671 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3780 }, | |
| 3672 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 206, .child_index = 3781 }, | |
| 3673 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3786 }, | |
| 3674 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3787 }, | |
| 3675 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3788 }, | |
| 3676 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3789 }, | |
| 3677 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3790 }, | |
| 3678 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 3679 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3792 }, | |
| 3680 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3793 }, | |
| 3681 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3794 }, | |
| 3682 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3795 }, | |
| 3683 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3796 }, | |
| 3684 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3796 }, | |
| 3685 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3798 }, | |
| 3686 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3500 }, | |
| 7670 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3789 }, | |
| 7671 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3790 }, | |
| 7672 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3233 }, | |
| 7673 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3791 }, | |
| 7674 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3792 }, | |
| 7675 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3793 }, | |
| 7676 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3794 }, | |
| 7677 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3796 }, | |
| 7678 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3796 }, | |
| 7679 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3796 }, | |
| 7680 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3797 }, | |
| 7681 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3798 }, | |
| 3687 | 7682 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3799 }, |
| 3688 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3800 }, | |
| 3689 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3801 }, | |
| 3690 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, | |
| 7683 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3801 }, | |
| 7684 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3802 }, | |
| 3691 | 7685 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3803 }, |
| 3692 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, | |
| 3693 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3801 }, | |
| 3694 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3808 }, | |
| 3695 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3809 }, | |
| 3696 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3813 }, | |
| 3697 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, | |
| 3698 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3815 }, | |
| 3699 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3816 }, | |
| 3700 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3817 }, | |
| 3701 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3818 }, | |
| 3702 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3820 }, | |
| 3703 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 114, .child_index = 3821 }, | |
| 3704 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3825 }, | |
| 3705 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3826 }, | |
| 3706 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3827 }, | |
| 3707 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3829 }, | |
| 3708 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3831 }, | |
| 3709 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3832 }, | |
| 3710 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3834 }, | |
| 3711 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3835 }, | |
| 3712 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3837 }, | |
| 3713 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3838 }, | |
| 3714 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3840 }, | |
| 3715 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3841 }, | |
| 3716 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3842 }, | |
| 3717 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3845 }, | |
| 3718 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3846 }, | |
| 3719 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, | |
| 3720 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3849 }, | |
| 3721 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3849 }, | |
| 3722 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3850 }, | |
| 3723 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 34, .child_index = 3852 }, | |
| 3724 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3854 }, | |
| 3725 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3855 }, | |
| 3726 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3856 }, | |
| 3727 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3857 }, | |
| 3728 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3858 }, | |
| 3729 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3860 }, | |
| 3730 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3861 }, | |
| 3731 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, | |
| 3732 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3863 }, | |
| 3733 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3553 }, | |
| 3734 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3864 }, | |
| 3735 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3865 }, | |
| 7686 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3804 }, | |
| 7687 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3805 }, | |
| 7688 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3807 }, | |
| 7689 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3808 }, | |
| 7690 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3809 }, | |
| 7691 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3810 }, | |
| 7692 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3811 }, | |
| 7693 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 206, .child_index = 3812 }, | |
| 7694 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3817 }, | |
| 7695 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3818 }, | |
| 7696 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3819 }, | |
| 7697 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3820 }, | |
| 7698 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3821 }, | |
| 7699 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 7700 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3823 }, | |
| 7701 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3824 }, | |
| 7702 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3825 }, | |
| 7703 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3826 }, | |
| 7704 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3827 }, | |
| 7705 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3827 }, | |
| 7706 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3829 }, | |
| 7707 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3530 }, | |
| 7708 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3830 }, | |
| 7709 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3831 }, | |
| 7710 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3832 }, | |
| 7711 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, | |
| 7712 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3834 }, | |
| 7713 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, | |
| 7714 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3832 }, | |
| 7715 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3839 }, | |
| 7716 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3840 }, | |
| 7717 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3844 }, | |
| 7718 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, | |
| 7719 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3846 }, | |
| 7720 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3847 }, | |
| 7721 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3848 }, | |
| 7722 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3849 }, | |
| 7723 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3851 }, | |
| 7724 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 114, .child_index = 3852 }, | |
| 7725 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3856 }, | |
| 7726 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3857 }, | |
| 7727 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3858 }, | |
| 7728 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3860 }, | |
| 7729 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3862 }, | |
| 7730 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3863 }, | |
| 7731 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3865 }, | |
| 7732 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3866 }, | |
| 3736 | 7733 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3868 }, |
| 3737 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3869 }, | |
| 3738 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3865 }, | |
| 3739 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3870 }, | |
| 3740 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3871 }, | |
| 3741 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3872 }, | |
| 3742 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3873 }, | |
| 3743 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3875 }, | |
| 3744 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3876 }, | |
| 3745 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, | |
| 3746 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3878 }, | |
| 3747 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3882 }, | |
| 3748 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3883 }, | |
| 3749 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3878 }, | |
| 3750 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3801 }, | |
| 3751 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3884 }, | |
| 3752 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3886 }, | |
| 3753 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3888 }, | |
| 3754 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3889 }, | |
| 3755 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3890 }, | |
| 7734 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3869 }, | |
| 7735 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3871 }, | |
| 7736 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3872 }, | |
| 7737 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3873 }, | |
| 7738 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3876 }, | |
| 7739 | .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3877 }, | |
| 7740 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, | |
| 7741 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3880 }, | |
| 7742 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3880 }, | |
| 7743 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3881 }, | |
| 7744 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 34, .child_index = 3883 }, | |
| 7745 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3885 }, | |
| 7746 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3886 }, | |
| 7747 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3887 }, | |
| 7748 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3888 }, | |
| 7749 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3889 }, | |
| 7750 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3891 }, | |
| 7751 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3892 }, | |
| 7752 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, | |
| 7753 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3894 }, | |
| 7754 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3583 }, | |
| 7755 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3895 }, | |
| 7756 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3896 }, | |
| 7757 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3899 }, | |
| 7758 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3900 }, | |
| 7759 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3896 }, | |
| 7760 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3901 }, | |
| 7761 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3902 }, | |
| 7762 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3903 }, | |
| 7763 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3904 }, | |
| 7764 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3906 }, | |
| 7765 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3907 }, | |
| 7766 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, | |
| 7767 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3909 }, | |
| 7768 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3913 }, | |
| 7769 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3914 }, | |
| 7770 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3909 }, | |
| 7771 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3832 }, | |
| 7772 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3915 }, | |
| 7773 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3917 }, | |
| 7774 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3919 }, | |
| 7775 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3920 }, | |
| 7776 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3921 }, | |
| 3756 | 7777 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 3757 | 7778 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 3758 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2311 }, | |
| 7779 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2333 }, | |
| 3759 | 7780 | .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, |
| 3760 | 7781 | .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3761 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3891 }, | |
| 3762 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3894 }, | |
| 3763 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3895 }, | |
| 7782 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3922 }, | |
| 7783 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3925 }, | |
| 7784 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3926 }, | |
| 3764 | 7785 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3765 | 7786 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, |
| 3766 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, | |
| 3767 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3898 }, | |
| 3768 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3899 }, | |
| 3769 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 3770 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3591 }, | |
| 3771 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 3772 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3900 }, | |
| 3773 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3901 }, | |
| 7787 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, | |
| 7788 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3929 }, | |
| 7789 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3930 }, | |
| 7790 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 7791 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3621 }, | |
| 7792 | .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 7793 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3931 }, | |
| 7794 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3932 }, | |
| 3774 | 7795 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, |
| 3775 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1699 }, | |
| 3776 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3902 }, | |
| 3777 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3903 }, | |
| 3778 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3024 }, | |
| 7796 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1713 }, | |
| 7797 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3933 }, | |
| 7798 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3934 }, | |
| 7799 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3051 }, | |
| 3779 | 7800 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 3780 | 7801 | .{ .char = '8', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3781 | .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3904 }, | |
| 3782 | .{ .char = 'P', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3046 }, | |
| 3783 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3905 }, | |
| 3784 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3906 }, | |
| 3785 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3907 }, | |
| 7802 | .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3935 }, | |
| 7803 | .{ .char = 'P', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3074 }, | |
| 7804 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3936 }, | |
| 7805 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3937 }, | |
| 7806 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3938 }, | |
| 3786 | 7807 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, |
| 3787 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, | |
| 3788 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3908 }, | |
| 3789 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3909 }, | |
| 3790 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3910 }, | |
| 3791 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3911 }, | |
| 3792 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3912 }, | |
| 3793 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3913 }, | |
| 3794 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3914 }, | |
| 3795 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3918 }, | |
| 3796 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3919 }, | |
| 3797 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3920 }, | |
| 3798 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3922 }, | |
| 3799 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3923 }, | |
| 3800 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3924 }, | |
| 3801 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3925 }, | |
| 3802 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3927 }, | |
| 3803 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3928 }, | |
| 3804 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3929 }, | |
| 3805 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3930 }, | |
| 3806 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3659 }, | |
| 3807 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3931 }, | |
| 3808 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3932 }, | |
| 3809 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3933 }, | |
| 3810 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3934 }, | |
| 3811 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3935 }, | |
| 3812 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3936 }, | |
| 3813 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2934 }, | |
| 3814 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3937 }, | |
| 3815 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, | |
| 3816 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3938 }, | |
| 7808 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, | |
| 7809 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3939 }, | |
| 7810 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3940 }, | |
| 7811 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3941 }, | |
| 7812 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3942 }, | |
| 7813 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3943 }, | |
| 7814 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3944 }, | |
| 7815 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3945 }, | |
| 7816 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3949 }, | |
| 7817 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3950 }, | |
| 7818 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3951 }, | |
| 7819 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3953 }, | |
| 7820 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3954 }, | |
| 7821 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3955 }, | |
| 7822 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3956 }, | |
| 7823 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3958 }, | |
| 7824 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3959 }, | |
| 7825 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3960 }, | |
| 7826 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3961 }, | |
| 7827 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3689 }, | |
| 7828 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3962 }, | |
| 7829 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3963 }, | |
| 7830 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3964 }, | |
| 7831 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3965 }, | |
| 7832 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3966 }, | |
| 7833 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3967 }, | |
| 7834 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2961 }, | |
| 7835 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3968 }, | |
| 7836 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, | |
| 7837 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3969 }, | |
| 3817 | 7838 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3818 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3939 }, | |
| 3819 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3940 }, | |
| 3820 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, | |
| 3821 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3942 }, | |
| 3822 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3943 }, | |
| 3823 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3944 }, | |
| 3824 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3947 }, | |
| 7839 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3970 }, | |
| 7840 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3971 }, | |
| 7841 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, | |
| 7842 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3973 }, | |
| 7843 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3974 }, | |
| 7844 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3975 }, | |
| 7845 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3978 }, | |
| 3825 | 7846 | .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3826 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3948 }, | |
| 3827 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3949 }, | |
| 3828 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3950 }, | |
| 3829 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3951 }, | |
| 3830 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3950 }, | |
| 3831 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3952 }, | |
| 3832 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3954 }, | |
| 3833 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3955 }, | |
| 3834 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3956 }, | |
| 3835 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3958 }, | |
| 3836 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3959 }, | |
| 7847 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3979 }, | |
| 7848 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3980 }, | |
| 7849 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3981 }, | |
| 7850 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3982 }, | |
| 7851 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3981 }, | |
| 7852 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3983 }, | |
| 7853 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3985 }, | |
| 7854 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3986 }, | |
| 7855 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3987 }, | |
| 7856 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3989 }, | |
| 7857 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3990 }, | |
| 3837 | 7858 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, |
| 3838 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3960 }, | |
| 3839 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3961 }, | |
| 3840 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3962 }, | |
| 3841 | .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3964 }, | |
| 3842 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3966 }, | |
| 3843 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3967 }, | |
| 3844 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3968 }, | |
| 3845 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3969 }, | |
| 3846 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3970 }, | |
| 7859 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3991 }, | |
| 7860 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3992 }, | |
| 7861 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3993 }, | |
| 7862 | .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3995 }, | |
| 7863 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3997 }, | |
| 7864 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3998 }, | |
| 7865 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3999 }, | |
| 7866 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4000 }, | |
| 7867 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4001 }, | |
| 3847 | 7868 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, |
| 3848 | 7869 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 3849 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3971 }, | |
| 3850 | .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, | |
| 3851 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3973 }, | |
| 3852 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3974 }, | |
| 3853 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3975 }, | |
| 3854 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3679 }, | |
| 3855 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3976 }, | |
| 3856 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3977 }, | |
| 7870 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4002 }, | |
| 7871 | .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4003 }, | |
| 7872 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4004 }, | |
| 7873 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 4005 }, | |
| 7874 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4006 }, | |
| 7875 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3709 }, | |
| 7876 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4007 }, | |
| 7877 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4008 }, | |
| 3857 | 7878 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, |
| 3858 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3978 }, | |
| 3859 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2237 }, | |
| 3860 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3979 }, | |
| 3861 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3980 }, | |
| 7879 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4009 }, | |
| 7880 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2259 }, | |
| 7881 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4010 }, | |
| 7882 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4011 }, | |
| 3862 | 7883 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 3863 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, | |
| 3864 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3982 }, | |
| 7884 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, | |
| 7885 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4013 }, | |
| 3865 | 7886 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 3866 | 7887 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, |
| 3867 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, | |
| 3868 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3985 }, | |
| 3869 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2568 }, | |
| 3870 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 3871 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3698 }, | |
| 3872 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 3873 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3400 }, | |
| 3874 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3987 }, | |
| 3875 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3988 }, | |
| 7888 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, | |
| 7889 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4016 }, | |
| 7890 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, | |
| 7891 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, | |
| 7892 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3728 }, | |
| 7893 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, | |
| 7894 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3429 }, | |
| 7895 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4018 }, | |
| 7896 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4019 }, | |
| 3876 | 7897 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 578 }, |
| 3877 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3990 }, | |
| 3878 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3992 }, | |
| 3879 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3993 }, | |
| 3880 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3994 }, | |
| 3881 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3996 }, | |
| 7898 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4021 }, | |
| 7899 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4023 }, | |
| 7900 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4024 }, | |
| 7901 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4025 }, | |
| 7902 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4027 }, | |
| 3882 | 7903 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3883 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3997 }, | |
| 3884 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3998 }, | |
| 3885 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3999 }, | |
| 3886 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4000 }, | |
| 3887 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4001 }, | |
| 3888 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, | |
| 3889 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, | |
| 3890 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4002 }, | |
| 3891 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 7904 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4028 }, | |
| 7905 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4029 }, | |
| 7906 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4030 }, | |
| 7907 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4031 }, | |
| 7908 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4032 }, | |
| 7909 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, | |
| 7910 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, | |
| 7911 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4033 }, | |
| 7912 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, | |
| 3892 | 7913 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 3893 | 7914 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 3894 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4003 }, | |
| 3895 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4005 }, | |
| 3896 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4006 }, | |
| 3897 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4008 }, | |
| 3898 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4010 }, | |
| 7915 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4034 }, | |
| 7916 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4036 }, | |
| 7917 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4037 }, | |
| 7918 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4039 }, | |
| 7919 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4041 }, | |
| 3899 | 7920 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 3900 | 7921 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, |
| 3901 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, | |
| 7922 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, | |
| 3902 | 7923 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 3903 | 7924 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, |
| 3904 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3980 }, | |
| 3905 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4011 }, | |
| 3906 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, | |
| 3907 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, | |
| 3908 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4014 }, | |
| 3909 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4015 }, | |
| 3910 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4016 }, | |
| 3911 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4017 }, | |
| 3912 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4018 }, | |
| 3913 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4019 }, | |
| 3914 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, | |
| 3915 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4020 }, | |
| 3916 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4021 }, | |
| 3917 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4022 }, | |
| 7925 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4011 }, | |
| 7926 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4042 }, | |
| 7927 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, | |
| 7928 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, | |
| 7929 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4045 }, | |
| 7930 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4046 }, | |
| 7931 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4047 }, | |
| 7932 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4048 }, | |
| 7933 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4049 }, | |
| 7934 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4050 }, | |
| 7935 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, | |
| 7936 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4051 }, | |
| 7937 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4052 }, | |
| 7938 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4053 }, | |
| 3918 | 7939 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3919 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4023 }, | |
| 3920 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, | |
| 3921 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4024 }, | |
| 3922 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4025 }, | |
| 7940 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4054 }, | |
| 7941 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, | |
| 7942 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4055 }, | |
| 7943 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4056 }, | |
| 3923 | 7944 | .{ .char = '4', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 3924 | 7945 | .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 3925 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4026 }, | |
| 3926 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4027 }, | |
| 3927 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3748 }, | |
| 3928 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4028 }, | |
| 3929 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4029 }, | |
| 3930 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4030 }, | |
| 3931 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4031 }, | |
| 3932 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4032 }, | |
| 3933 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4033 }, | |
| 3934 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4035 }, | |
| 3935 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4036 }, | |
| 3936 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4037 }, | |
| 3937 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4038 }, | |
| 3938 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4041 }, | |
| 3939 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, | |
| 3940 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4042 }, | |
| 3941 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4043 }, | |
| 3942 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4044 }, | |
| 3943 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4045 }, | |
| 3944 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4046 }, | |
| 3945 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4047 }, | |
| 3946 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4049 }, | |
| 3947 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4050 }, | |
| 3948 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4051 }, | |
| 3949 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4052 }, | |
| 3950 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4054 }, | |
| 3951 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 3952 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4056 }, | |
| 3953 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4057 }, | |
| 3954 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4054 }, | |
| 3955 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4060 }, | |
| 3956 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 3957 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3773 }, | |
| 3958 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4062 }, | |
| 3959 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 4063 }, | |
| 3960 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4065 }, | |
| 3961 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 170, .child_index = 4066 }, | |
| 3962 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4069 }, | |
| 3963 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4070 }, | |
| 3964 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4071 }, | |
| 3965 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4073 }, | |
| 3966 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4057 }, | |
| 3967 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4074 }, | |
| 3968 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4074 }, | |
| 3969 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4075 }, | |
| 3970 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4076 }, | |
| 3971 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 3972 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4078 }, | |
| 3973 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4079 }, | |
| 3974 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4082 }, | |
| 3975 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4082 }, | |
| 3976 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4054 }, | |
| 3977 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4083 }, | |
| 3978 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4085 }, | |
| 3979 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4086 }, | |
| 3980 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4088 }, | |
| 3981 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4090 }, | |
| 3982 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4090 }, | |
| 3983 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4090 }, | |
| 3984 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4090 }, | |
| 3985 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4091 }, | |
| 3986 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4092 }, | |
| 3987 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4093 }, | |
| 3988 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4096 }, | |
| 3989 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4097 }, | |
| 3990 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 4099 }, | |
| 3991 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 27, .child_index = 4101 }, | |
| 3992 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4103 }, | |
| 3993 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, | |
| 3994 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, | |
| 3995 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, | |
| 3996 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4107 }, | |
| 3997 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, | |
| 3998 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, | |
| 3999 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4109 }, | |
| 4000 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 4113 }, | |
| 4001 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4109 }, | |
| 4002 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4109 }, | |
| 4003 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4107 }, | |
| 4004 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, | |
| 4005 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4118 }, | |
| 4006 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3825 }, | |
| 4007 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4119 }, | |
| 4008 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4120 }, | |
| 4009 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4121 }, | |
| 4010 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4105 }, | |
| 4011 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4122 }, | |
| 4012 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4124 }, | |
| 4013 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4125 }, | |
| 4014 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4125 }, | |
| 4015 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4126 }, | |
| 4016 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3834 }, | |
| 4017 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3837 }, | |
| 4018 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4127 }, | |
| 4019 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4129 }, | |
| 4020 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4130 }, | |
| 4021 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4131 }, | |
| 4022 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4131 }, | |
| 4023 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4132 }, | |
| 4024 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3840 }, | |
| 4025 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3841 }, | |
| 4026 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3845 }, | |
| 4027 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4086 }, | |
| 4028 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4133 }, | |
| 4029 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4134 }, | |
| 4030 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 22, .child_index = 4135 }, | |
| 4031 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4088 }, | |
| 4032 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4137 }, | |
| 4033 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4138 }, | |
| 4034 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, | |
| 4035 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, | |
| 4036 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, | |
| 4037 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 4038 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4140 }, | |
| 4039 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4140 }, | |
| 4040 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4141 }, | |
| 4041 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4142 }, | |
| 4042 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3877 }, | |
| 4043 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3864 }, | |
| 4044 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3868 }, | |
| 4045 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3869 }, | |
| 4046 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4143 }, | |
| 4047 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4145 }, | |
| 4048 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4146 }, | |
| 4049 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4147 }, | |
| 4050 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4148 }, | |
| 4051 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3875 }, | |
| 4052 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4149 }, | |
| 4053 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4151 }, | |
| 4054 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4152 }, | |
| 4055 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4155 }, | |
| 4056 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3876 }, | |
| 4057 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, | |
| 4058 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3882 }, | |
| 4059 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3883 }, | |
| 4060 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4156 }, | |
| 4061 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4158 }, | |
| 4062 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3862 }, | |
| 4063 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4159 }, | |
| 4064 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2311 }, | |
| 7946 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4057 }, | |
| 7947 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4058 }, | |
| 7948 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3778 }, | |
| 7949 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4059 }, | |
| 7950 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4060 }, | |
| 7951 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4061 }, | |
| 7952 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4062 }, | |
| 7953 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4063 }, | |
| 7954 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4064 }, | |
| 7955 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4066 }, | |
| 7956 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4067 }, | |
| 7957 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4068 }, | |
| 7958 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4069 }, | |
| 7959 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4070 }, | |
| 7960 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4073 }, | |
| 7961 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 7962 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4074 }, | |
| 7963 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4075 }, | |
| 7964 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4076 }, | |
| 7965 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4077 }, | |
| 7966 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4078 }, | |
| 7967 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4079 }, | |
| 7968 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4081 }, | |
| 7969 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4082 }, | |
| 7970 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4083 }, | |
| 7971 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4084 }, | |
| 7972 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4086 }, | |
| 7973 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 7974 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4088 }, | |
| 7975 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4089 }, | |
| 7976 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4086 }, | |
| 7977 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4092 }, | |
| 7978 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 7979 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3804 }, | |
| 7980 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4094 }, | |
| 7981 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 4095 }, | |
| 7982 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4097 }, | |
| 7983 | .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 170, .child_index = 4098 }, | |
| 7984 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4101 }, | |
| 7985 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4102 }, | |
| 7986 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4103 }, | |
| 7987 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4105 }, | |
| 7988 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4089 }, | |
| 7989 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4106 }, | |
| 7990 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4106 }, | |
| 7991 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4107 }, | |
| 7992 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4108 }, | |
| 7993 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 7994 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4110 }, | |
| 7995 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4111 }, | |
| 7996 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4114 }, | |
| 7997 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4114 }, | |
| 7998 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4086 }, | |
| 7999 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4115 }, | |
| 8000 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4117 }, | |
| 8001 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4118 }, | |
| 8002 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4120 }, | |
| 8003 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4122 }, | |
| 8004 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4122 }, | |
| 8005 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4122 }, | |
| 8006 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4122 }, | |
| 8007 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4123 }, | |
| 8008 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4124 }, | |
| 8009 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4125 }, | |
| 8010 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4128 }, | |
| 8011 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4129 }, | |
| 8012 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 4131 }, | |
| 8013 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 27, .child_index = 4133 }, | |
| 8014 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4135 }, | |
| 8015 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, | |
| 8016 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, | |
| 8017 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, | |
| 8018 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4139 }, | |
| 8019 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, | |
| 8020 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, | |
| 8021 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4141 }, | |
| 8022 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 4145 }, | |
| 8023 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4141 }, | |
| 8024 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4141 }, | |
| 8025 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4139 }, | |
| 8026 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, | |
| 8027 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4150 }, | |
| 8028 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3856 }, | |
| 8029 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4151 }, | |
| 8030 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4152 }, | |
| 8031 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4153 }, | |
| 8032 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4137 }, | |
| 8033 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4154 }, | |
| 8034 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4156 }, | |
| 8035 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4157 }, | |
| 8036 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4157 }, | |
| 8037 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4158 }, | |
| 8038 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3865 }, | |
| 8039 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3868 }, | |
| 8040 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4159 }, | |
| 8041 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4161 }, | |
| 8042 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4162 }, | |
| 8043 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4163 }, | |
| 8044 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4163 }, | |
| 8045 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4164 }, | |
| 8046 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3871 }, | |
| 8047 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3872 }, | |
| 8048 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3876 }, | |
| 8049 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4118 }, | |
| 8050 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4165 }, | |
| 8051 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4166 }, | |
| 8052 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 22, .child_index = 4167 }, | |
| 8053 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4120 }, | |
| 8054 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4169 }, | |
| 8055 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4170 }, | |
| 8056 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, | |
| 8057 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, | |
| 8058 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, | |
| 8059 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 8060 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4172 }, | |
| 8061 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4172 }, | |
| 8062 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4173 }, | |
| 8063 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4174 }, | |
| 8064 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3908 }, | |
| 8065 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3895 }, | |
| 8066 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3899 }, | |
| 8067 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3900 }, | |
| 8068 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4175 }, | |
| 8069 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4177 }, | |
| 8070 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4178 }, | |
| 8071 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4179 }, | |
| 8072 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4180 }, | |
| 8073 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3906 }, | |
| 8074 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4181 }, | |
| 8075 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4183 }, | |
| 8076 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4184 }, | |
| 8077 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4187 }, | |
| 8078 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3907 }, | |
| 8079 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, | |
| 8080 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3913 }, | |
| 8081 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3914 }, | |
| 8082 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4188 }, | |
| 8083 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4190 }, | |
| 8084 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3893 }, | |
| 8085 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4191 }, | |
| 8086 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2333 }, | |
| 4065 | 8087 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, |
| 4066 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4161 }, | |
| 4067 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4162 }, | |
| 4068 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4164 }, | |
| 8088 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4193 }, | |
| 8089 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4194 }, | |
| 8090 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4196 }, | |
| 4069 | 8091 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4070 | 8092 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4071 | 8093 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, |
| 4072 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, | |
| 8094 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, | |
| 4073 | 8095 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4074 | 8096 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, |
| 4075 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3586 }, | |
| 4076 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3367 }, | |
| 4077 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 4165 }, | |
| 4078 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4173 }, | |
| 4079 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4174 }, | |
| 4080 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4175 }, | |
| 4081 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4176 }, | |
| 4082 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1708 }, | |
| 4083 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2622 }, | |
| 4084 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4177 }, | |
| 4085 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4178 }, | |
| 4086 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4179 }, | |
| 4087 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4180 }, | |
| 4088 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4181 }, | |
| 4089 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4182 }, | |
| 4090 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4183 }, | |
| 8097 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3616 }, | |
| 8098 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3396 }, | |
| 8099 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 4197 }, | |
| 8100 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4205 }, | |
| 8101 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4206 }, | |
| 8102 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4207 }, | |
| 8103 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4208 }, | |
| 8104 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1722 }, | |
| 8105 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2647 }, | |
| 8106 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4209 }, | |
| 8107 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4210 }, | |
| 8108 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4211 }, | |
| 8109 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4212 }, | |
| 8110 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4213 }, | |
| 8111 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4214 }, | |
| 8112 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4215 }, | |
| 4091 | 8113 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, |
| 4092 | 8114 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, |
| 4093 | 8115 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 568 }, |
| 4094 | 8116 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, |
| 4095 | 8117 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, |
| 4096 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4184 }, | |
| 4097 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4185 }, | |
| 4098 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4186 }, | |
| 4099 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4188 }, | |
| 4100 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2680 }, | |
| 4101 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3927 }, | |
| 4102 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4189 }, | |
| 4103 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4190 }, | |
| 4104 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4191 }, | |
| 4105 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4193 }, | |
| 4106 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4194 }, | |
| 8118 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4216 }, | |
| 8119 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4217 }, | |
| 8120 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4218 }, | |
| 8121 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4220 }, | |
| 8122 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2706 }, | |
| 8123 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3958 }, | |
| 8124 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4221 }, | |
| 8125 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4222 }, | |
| 8126 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4223 }, | |
| 8127 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4225 }, | |
| 8128 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4226 }, | |
| 4107 | 8129 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 4108 | 8130 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 4109 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4195 }, | |
| 4110 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4196 }, | |
| 4111 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4197 }, | |
| 4112 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4198 }, | |
| 4113 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4199 }, | |
| 4114 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4200 }, | |
| 4115 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4201 }, | |
| 4116 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4202 }, | |
| 4117 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4203 }, | |
| 4118 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4204 }, | |
| 4119 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4205 }, | |
| 4120 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4206 }, | |
| 4121 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, | |
| 4122 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4208 }, | |
| 4123 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4209 }, | |
| 4124 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4210 }, | |
| 4125 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4211 }, | |
| 4126 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4212 }, | |
| 4127 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4213 }, | |
| 4128 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4214 }, | |
| 4129 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4215 }, | |
| 4130 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4217 }, | |
| 4131 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4218 }, | |
| 4132 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4220 }, | |
| 4133 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4221 }, | |
| 4134 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4222 }, | |
| 4135 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3011 }, | |
| 4136 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4223 }, | |
| 8131 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4227 }, | |
| 8132 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4228 }, | |
| 8133 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4229 }, | |
| 8134 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4230 }, | |
| 8135 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4231 }, | |
| 8136 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4232 }, | |
| 8137 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4233 }, | |
| 8138 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4234 }, | |
| 8139 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4235 }, | |
| 8140 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4236 }, | |
| 8141 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4237 }, | |
| 8142 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4238 }, | |
| 8143 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, | |
| 8144 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4240 }, | |
| 8145 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4241 }, | |
| 8146 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4242 }, | |
| 8147 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4243 }, | |
| 8148 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4244 }, | |
| 8149 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4245 }, | |
| 8150 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4246 }, | |
| 8151 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4247 }, | |
| 8152 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4249 }, | |
| 8153 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4250 }, | |
| 8154 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4252 }, | |
| 8155 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4253 }, | |
| 8156 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4254 }, | |
| 8157 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3038 }, | |
| 8158 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4255 }, | |
| 4137 | 8159 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, |
| 4138 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4224 }, | |
| 4139 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4225 }, | |
| 4140 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4226 }, | |
| 4141 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4227 }, | |
| 4142 | .{ .char = 'A', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4228 }, | |
| 8160 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4256 }, | |
| 8161 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4257 }, | |
| 8162 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4258 }, | |
| 8163 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4259 }, | |
| 8164 | .{ .char = 'A', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4260 }, | |
| 4143 | 8165 | .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4144 | 8166 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 4145 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4229 }, | |
| 4146 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4230 }, | |
| 4147 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 4231 }, | |
| 8167 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, | |
| 8168 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4262 }, | |
| 8169 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 4263 }, | |
| 4148 | 8170 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 4149 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4233 }, | |
| 4150 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1840 }, | |
| 4151 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4234 }, | |
| 4152 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 4235 }, | |
| 4153 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4247 }, | |
| 4154 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4248 }, | |
| 4155 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4249 }, | |
| 4156 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4250 }, | |
| 8171 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4265 }, | |
| 8172 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1856 }, | |
| 8173 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4266 }, | |
| 8174 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 4267 }, | |
| 8175 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4279 }, | |
| 8176 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4280 }, | |
| 8177 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4281 }, | |
| 8178 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4282 }, | |
| 4157 | 8179 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 4158 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4251 }, | |
| 4159 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4254 }, | |
| 8180 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4283 }, | |
| 8181 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4286 }, | |
| 4160 | 8182 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 4161 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3981 }, | |
| 8183 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4012 }, | |
| 4162 | 8184 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4163 | 8185 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, |
| 4164 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, | |
| 4165 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, | |
| 4166 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4256 }, | |
| 4167 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, | |
| 4168 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, | |
| 4169 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4257 }, | |
| 4170 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4258 }, | |
| 4171 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4260 }, | |
| 4172 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2507 }, | |
| 4173 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, | |
| 8186 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, | |
| 8187 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, | |
| 8188 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4288 }, | |
| 8189 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, | |
| 8190 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, | |
| 8191 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4289 }, | |
| 8192 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4290 }, | |
| 8193 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4292 }, | |
| 8194 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2531 }, | |
| 8195 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4293 }, | |
| 4174 | 8196 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 656 }, |
| 4175 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4262 }, | |
| 4176 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3997 }, | |
| 4177 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3998 }, | |
| 4178 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4263 }, | |
| 4179 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, | |
| 4180 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4264 }, | |
| 4181 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3997 }, | |
| 4182 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4005 }, | |
| 4183 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4265 }, | |
| 4184 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4266 }, | |
| 4185 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4267 }, | |
| 4186 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4268 }, | |
| 4187 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4271 }, | |
| 4188 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, | |
| 8197 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4294 }, | |
| 8198 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4028 }, | |
| 8199 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4029 }, | |
| 8200 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4295 }, | |
| 8201 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, | |
| 8202 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4296 }, | |
| 8203 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4028 }, | |
| 8204 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4036 }, | |
| 8205 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4297 }, | |
| 8206 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4298 }, | |
| 8207 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4299 }, | |
| 8208 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4300 }, | |
| 8209 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4303 }, | |
| 8210 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, | |
| 4189 | 8211 | .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4190 | 8212 | .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4191 | 8213 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4192 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 4193 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, | |
| 4194 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4272 }, | |
| 4195 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4273 }, | |
| 4196 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4275 }, | |
| 4197 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4276 }, | |
| 4198 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4277 }, | |
| 4199 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3196 }, | |
| 4200 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4278 }, | |
| 4201 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4279 }, | |
| 4202 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4280 }, | |
| 4203 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4281 }, | |
| 4204 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3456 }, | |
| 4205 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3308 }, | |
| 4206 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4284 }, | |
| 4207 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4285 }, | |
| 4208 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4286 }, | |
| 4209 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4287 }, | |
| 4210 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, | |
| 4211 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4289 }, | |
| 4212 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4290 }, | |
| 4213 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4291 }, | |
| 4214 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3676 }, | |
| 4215 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4041 }, | |
| 4216 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4292 }, | |
| 8214 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 8215 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, | |
| 8216 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4304 }, | |
| 8217 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4305 }, | |
| 8218 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4307 }, | |
| 8219 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4308 }, | |
| 8220 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4309 }, | |
| 8221 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3225 }, | |
| 8222 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4310 }, | |
| 8223 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4311 }, | |
| 8224 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4312 }, | |
| 8225 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4313 }, | |
| 8226 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, | |
| 8227 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3337 }, | |
| 8228 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4316 }, | |
| 8229 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4317 }, | |
| 8230 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4318 }, | |
| 8231 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4319 }, | |
| 8232 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4320 }, | |
| 8233 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4321 }, | |
| 8234 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4322 }, | |
| 8235 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4323 }, | |
| 8236 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3706 }, | |
| 8237 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4324 }, | |
| 8238 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4073 }, | |
| 8239 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4325 }, | |
| 4217 | 8240 | .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4218 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4292 }, | |
| 4219 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4293 }, | |
| 4220 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, | |
| 4221 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, | |
| 4222 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, | |
| 4223 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4294 }, | |
| 4224 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4295 }, | |
| 4225 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4296 }, | |
| 8241 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4325 }, | |
| 8242 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4326 }, | |
| 8243 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 8244 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 8245 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, | |
| 8246 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4327 }, | |
| 8247 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4328 }, | |
| 8248 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4329 }, | |
| 4226 | 8249 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 4227 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4296 }, | |
| 8250 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4329 }, | |
| 4228 | 8251 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 4229 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4297 }, | |
| 4230 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4298 }, | |
| 4231 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4299 }, | |
| 4232 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3791 }, | |
| 4233 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4234 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4300 }, | |
| 4235 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4301 }, | |
| 4236 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4302 }, | |
| 4237 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4303 }, | |
| 4238 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4304 }, | |
| 4239 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4305 }, | |
| 4240 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4241 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4306 }, | |
| 4242 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4243 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4244 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4307 }, | |
| 4245 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 84, .child_index = 4309 }, | |
| 4246 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 84, .child_index = 4309 }, | |
| 4247 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4306 }, | |
| 4248 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4249 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4314 }, | |
| 4250 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4069 }, | |
| 4251 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4252 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, | |
| 4253 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4315 }, | |
| 4254 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4057 }, | |
| 4255 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4317 }, | |
| 4256 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4318 }, | |
| 4257 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4146 }, | |
| 4258 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4319 }, | |
| 4259 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4320 }, | |
| 4260 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4321 }, | |
| 8252 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4330 }, | |
| 8253 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4331 }, | |
| 8254 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4332 }, | |
| 8255 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3822 }, | |
| 8256 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8257 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4333 }, | |
| 8258 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4334 }, | |
| 8259 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4335 }, | |
| 8260 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4336 }, | |
| 8261 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4337 }, | |
| 8262 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4338 }, | |
| 8263 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8264 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4339 }, | |
| 8265 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8266 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8267 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4340 }, | |
| 8268 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 84, .child_index = 4342 }, | |
| 8269 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 84, .child_index = 4342 }, | |
| 8270 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4339 }, | |
| 8271 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8272 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4347 }, | |
| 8273 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4101 }, | |
| 8274 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8275 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, | |
| 8276 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4348 }, | |
| 8277 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4089 }, | |
| 8278 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4350 }, | |
| 8279 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4351 }, | |
| 8280 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4178 }, | |
| 8281 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4352 }, | |
| 8282 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4353 }, | |
| 8283 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4354 }, | |
| 4261 | 8284 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, |
| 4262 | 8285 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 4263 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3761 }, | |
| 4264 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3547 }, | |
| 4265 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4322 }, | |
| 4266 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3547 }, | |
| 4267 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, | |
| 4268 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4324 }, | |
| 4269 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4325 }, | |
| 4270 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4326 }, | |
| 4271 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, | |
| 4272 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, | |
| 4273 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 4274 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4327 }, | |
| 4275 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, | |
| 4276 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 4277 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4329 }, | |
| 4278 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4329 }, | |
| 4279 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4331 }, | |
| 4280 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4332 }, | |
| 4281 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4331 }, | |
| 4282 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4331 }, | |
| 4283 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3547 }, | |
| 4284 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, | |
| 4285 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4334 }, | |
| 4286 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4334 }, | |
| 4287 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4335 }, | |
| 4288 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, | |
| 4289 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, | |
| 4290 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4338 }, | |
| 4291 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4341 }, | |
| 4292 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4335 }, | |
| 4293 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, | |
| 4294 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, | |
| 4295 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4338 }, | |
| 4296 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4107 }, | |
| 4297 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4343 }, | |
| 4298 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4343 }, | |
| 4299 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3858 }, | |
| 4300 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3862 }, | |
| 4301 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, | |
| 4302 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4345 }, | |
| 4303 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3838 }, | |
| 4304 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3834 }, | |
| 4305 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3841 }, | |
| 4306 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3845 }, | |
| 4307 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4346 }, | |
| 4308 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4347 }, | |
| 4309 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4127 }, | |
| 4310 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3841 }, | |
| 4311 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4349 }, | |
| 4312 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4351 }, | |
| 4313 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4352 }, | |
| 4314 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4322 }, | |
| 4315 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4325 }, | |
| 4316 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4325 }, | |
| 4317 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4325 }, | |
| 4318 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4354 }, | |
| 4319 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4356 }, | |
| 4320 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4357 }, | |
| 4321 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3864 }, | |
| 4322 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3869 }, | |
| 4323 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3864 }, | |
| 4324 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, | |
| 4325 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4361 }, | |
| 4326 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4362 }, | |
| 4327 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4363 }, | |
| 4328 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4363 }, | |
| 4329 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4364 }, | |
| 4330 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, | |
| 4331 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3882 }, | |
| 4332 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3883 }, | |
| 4333 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4365 }, | |
| 4334 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, | |
| 4335 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3883 }, | |
| 4336 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3877 }, | |
| 4337 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4366 }, | |
| 4338 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4366 }, | |
| 4339 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4367 }, | |
| 4340 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4369 }, | |
| 4341 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4369 }, | |
| 4342 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4370 }, | |
| 4343 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4371 }, | |
| 4344 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4373 }, | |
| 4345 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4374 }, | |
| 4346 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4375 }, | |
| 4347 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4379 }, | |
| 4348 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4380 }, | |
| 4349 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4381 }, | |
| 4350 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4382 }, | |
| 4351 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4383 }, | |
| 4352 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4384 }, | |
| 4353 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4385 }, | |
| 4354 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4387 }, | |
| 4355 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4388 }, | |
| 4356 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4389 }, | |
| 4357 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4390 }, | |
| 4358 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4391 }, | |
| 4359 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, | |
| 4360 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4394 }, | |
| 4361 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4395 }, | |
| 4362 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4396 }, | |
| 4363 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4399 }, | |
| 4364 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4400 }, | |
| 4365 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4401 }, | |
| 4366 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4402 }, | |
| 8286 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3792 }, | |
| 8287 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3577 }, | |
| 8288 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4355 }, | |
| 8289 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3577 }, | |
| 8290 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, | |
| 8291 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4357 }, | |
| 8292 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4358 }, | |
| 8293 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4359 }, | |
| 8294 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, | |
| 8295 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, | |
| 8296 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 8297 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4360 }, | |
| 8298 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, | |
| 8299 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 8300 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4362 }, | |
| 8301 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4362 }, | |
| 8302 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4364 }, | |
| 8303 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4365 }, | |
| 8304 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4364 }, | |
| 8305 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4364 }, | |
| 8306 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3577 }, | |
| 8307 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, | |
| 8308 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4367 }, | |
| 8309 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4367 }, | |
| 8310 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4368 }, | |
| 8311 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, | |
| 8312 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, | |
| 8313 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4371 }, | |
| 8314 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4374 }, | |
| 8315 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4368 }, | |
| 8316 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, | |
| 8317 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, | |
| 8318 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4371 }, | |
| 8319 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4139 }, | |
| 8320 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4376 }, | |
| 8321 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4376 }, | |
| 8322 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3889 }, | |
| 8323 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3893 }, | |
| 8324 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, | |
| 8325 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4378 }, | |
| 8326 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3869 }, | |
| 8327 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3865 }, | |
| 8328 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3872 }, | |
| 8329 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3876 }, | |
| 8330 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4379 }, | |
| 8331 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4380 }, | |
| 8332 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4159 }, | |
| 8333 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3872 }, | |
| 8334 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4382 }, | |
| 8335 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4384 }, | |
| 8336 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4385 }, | |
| 8337 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4355 }, | |
| 8338 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4358 }, | |
| 8339 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4358 }, | |
| 8340 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4358 }, | |
| 8341 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4387 }, | |
| 8342 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4389 }, | |
| 8343 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4390 }, | |
| 8344 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3895 }, | |
| 8345 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3900 }, | |
| 8346 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3895 }, | |
| 8347 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, | |
| 8348 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4394 }, | |
| 8349 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4395 }, | |
| 8350 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4396 }, | |
| 8351 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4396 }, | |
| 8352 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4397 }, | |
| 8353 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, | |
| 8354 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3913 }, | |
| 8355 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3914 }, | |
| 8356 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4398 }, | |
| 8357 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, | |
| 8358 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3914 }, | |
| 8359 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3908 }, | |
| 8360 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4399 }, | |
| 8361 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4399 }, | |
| 8362 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4400 }, | |
| 8363 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4402 }, | |
| 8364 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4402 }, | |
| 8365 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4403 }, | |
| 8366 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4404 }, | |
| 8367 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4406 }, | |
| 8368 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4407 }, | |
| 8369 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4408 }, | |
| 8370 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4412 }, | |
| 8371 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4413 }, | |
| 8372 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4414 }, | |
| 8373 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4415 }, | |
| 8374 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4416 }, | |
| 8375 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4417 }, | |
| 8376 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4418 }, | |
| 8377 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4420 }, | |
| 8378 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4421 }, | |
| 8379 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4422 }, | |
| 8380 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4423 }, | |
| 8381 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4424 }, | |
| 8382 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4425 }, | |
| 8383 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4427 }, | |
| 8384 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4428 }, | |
| 8385 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4429 }, | |
| 8386 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4432 }, | |
| 8387 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4433 }, | |
| 8388 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4434 }, | |
| 8389 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4435 }, | |
| 4367 | 8390 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 405 }, |
| 4368 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4403 }, | |
| 4369 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4404 }, | |
| 8391 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4436 }, | |
| 8392 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4437 }, | |
| 4370 | 8393 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, |
| 4371 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4405 }, | |
| 4372 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4406 }, | |
| 4373 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4407 }, | |
| 4374 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4409 }, | |
| 4375 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4410 }, | |
| 4376 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4411 }, | |
| 4377 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4412 }, | |
| 4378 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4413 }, | |
| 4379 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4414 }, | |
| 4380 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4415 }, | |
| 4381 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4416 }, | |
| 4382 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4418 }, | |
| 4383 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2319 }, | |
| 4384 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4420 }, | |
| 4385 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4421 }, | |
| 4386 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4422 }, | |
| 4387 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4423 }, | |
| 4388 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3979 }, | |
| 4389 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4424 }, | |
| 4390 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4425 }, | |
| 4391 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4426 }, | |
| 4392 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4427 }, | |
| 8394 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4438 }, | |
| 8395 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4439 }, | |
| 8396 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4440 }, | |
| 8397 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4442 }, | |
| 8398 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4443 }, | |
| 8399 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4444 }, | |
| 8400 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4445 }, | |
| 8401 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4446 }, | |
| 8402 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4447 }, | |
| 8403 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4448 }, | |
| 8404 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4449 }, | |
| 8405 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4451 }, | |
| 8406 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2342 }, | |
| 8407 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4453 }, | |
| 8408 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4454 }, | |
| 8409 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4455 }, | |
| 8410 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4456 }, | |
| 8411 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4010 }, | |
| 8412 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4457 }, | |
| 8413 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4458 }, | |
| 8414 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4459 }, | |
| 8415 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4460 }, | |
| 4393 | 8416 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, |
| 4394 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4428 }, | |
| 4395 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4429 }, | |
| 4396 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4430 }, | |
| 4397 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4428 }, | |
| 8417 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4461 }, | |
| 8418 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4462 }, | |
| 8419 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4463 }, | |
| 8420 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4461 }, | |
| 4398 | 8421 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 4399 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4431 }, | |
| 4400 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, | |
| 4401 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4432 }, | |
| 4402 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4434 }, | |
| 4403 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3648 }, | |
| 4404 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4435 }, | |
| 4405 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4436 }, | |
| 8422 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4464 }, | |
| 8423 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, | |
| 8424 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4465 }, | |
| 8425 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4467 }, | |
| 8426 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3678 }, | |
| 8427 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4468 }, | |
| 8428 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4469 }, | |
| 4406 | 8429 | .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4407 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4437 }, | |
| 4408 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4438 }, | |
| 4409 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3024 }, | |
| 8430 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4470 }, | |
| 8431 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4471 }, | |
| 8432 | .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3051 }, | |
| 4410 | 8433 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4411 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4439 }, | |
| 4412 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4440 }, | |
| 4413 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4441 }, | |
| 4414 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4443 }, | |
| 4415 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4444 }, | |
| 4416 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4447 }, | |
| 4417 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4448 }, | |
| 4418 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4450 }, | |
| 4419 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2245 }, | |
| 4420 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4451 }, | |
| 4421 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3609 }, | |
| 4422 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4452 }, | |
| 4423 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4454 }, | |
| 4424 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4457 }, | |
| 4425 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4458 }, | |
| 4426 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4459 }, | |
| 4427 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4460 }, | |
| 4428 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4461 }, | |
| 8434 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4472 }, | |
| 8435 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4473 }, | |
| 8436 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4474 }, | |
| 8437 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4476 }, | |
| 8438 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4477 }, | |
| 8439 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4480 }, | |
| 8440 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4481 }, | |
| 8441 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4483 }, | |
| 8442 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2267 }, | |
| 8443 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4484 }, | |
| 8444 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3639 }, | |
| 8445 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4485 }, | |
| 8446 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4487 }, | |
| 8447 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4490 }, | |
| 8448 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4491 }, | |
| 8449 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4492 }, | |
| 8450 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4493 }, | |
| 8451 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4494 }, | |
| 4429 | 8452 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 4430 | 8453 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, |
| 4431 | 8454 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4432 | 8455 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, |
| 4433 | 8456 | .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4434 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4462 }, | |
| 4435 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4463 }, | |
| 4436 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, | |
| 4437 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, | |
| 4438 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4464 }, | |
| 4439 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, | |
| 4440 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4465 }, | |
| 4441 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4466 }, | |
| 4442 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, | |
| 4443 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4467 }, | |
| 4444 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, | |
| 4445 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4468 }, | |
| 4446 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4469 }, | |
| 4447 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4266 }, | |
| 4448 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4470 }, | |
| 4449 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4471 }, | |
| 4450 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4472 }, | |
| 4451 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1893 }, | |
| 4452 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4473 }, | |
| 4453 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4474 }, | |
| 8457 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4495 }, | |
| 8458 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4496 }, | |
| 8459 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, | |
| 8460 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, | |
| 8461 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4497 }, | |
| 8462 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, | |
| 8463 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4498 }, | |
| 8464 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4499 }, | |
| 8465 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, | |
| 8466 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4500 }, | |
| 8467 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, | |
| 8468 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4501 }, | |
| 8469 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4502 }, | |
| 8470 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4298 }, | |
| 8471 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4503 }, | |
| 8472 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4504 }, | |
| 8473 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4505 }, | |
| 8474 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1912 }, | |
| 8475 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4506 }, | |
| 8476 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4507 }, | |
| 4454 | 8477 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, |
| 4455 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4475 }, | |
| 4456 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4476 }, | |
| 4457 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4477 }, | |
| 4458 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4478 }, | |
| 4459 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2137 }, | |
| 4460 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4479 }, | |
| 4461 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, | |
| 4462 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4480 }, | |
| 4463 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4481 }, | |
| 4464 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4482 }, | |
| 4465 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4483 }, | |
| 4466 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4484 }, | |
| 4467 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4485 }, | |
| 4468 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4486 }, | |
| 4469 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4487 }, | |
| 8478 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4508 }, | |
| 8479 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4509 }, | |
| 8480 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4510 }, | |
| 8481 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4511 }, | |
| 8482 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2158 }, | |
| 8483 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4512 }, | |
| 8484 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, | |
| 8485 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4513 }, | |
| 8486 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4514 }, | |
| 8487 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4515 }, | |
| 8488 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4516 }, | |
| 8489 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4517 }, | |
| 8490 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4518 }, | |
| 8491 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4519 }, | |
| 8492 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4520 }, | |
| 8493 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4521 }, | |
| 4470 | 8494 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 4471 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4488 }, | |
| 8495 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4522 }, | |
| 4472 | 8496 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, |
| 4473 | 8497 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4474 | 8498 | .{ .char = 'M', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4475 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4489 }, | |
| 4476 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4490 }, | |
| 4477 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4491 }, | |
| 4478 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4492 }, | |
| 4479 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4493 }, | |
| 4480 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, | |
| 4481 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, | |
| 4482 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 4483 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4494 }, | |
| 4484 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4496 }, | |
| 4485 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4497 }, | |
| 4486 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4497 }, | |
| 4487 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4498 }, | |
| 4488 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4499 }, | |
| 4489 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 4501 }, | |
| 4490 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4504 }, | |
| 4491 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4507 }, | |
| 4492 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4306 }, | |
| 4493 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4493 }, | |
| 4494 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4493 }, | |
| 4495 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4146 }, | |
| 4496 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4508 }, | |
| 4497 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3870 }, | |
| 4498 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3870 }, | |
| 4499 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4510 }, | |
| 4500 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4511 }, | |
| 4501 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4511 }, | |
| 4502 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4512 }, | |
| 4503 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4513 }, | |
| 4504 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4516 }, | |
| 4505 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4091 }, | |
| 4506 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4517 }, | |
| 4507 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4518 }, | |
| 4508 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4518 }, | |
| 4509 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4519 }, | |
| 4510 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4520 }, | |
| 4511 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4520 }, | |
| 4512 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4521 }, | |
| 4513 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4522 }, | |
| 4514 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4522 }, | |
| 4515 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4522 }, | |
| 4516 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4524 }, | |
| 4517 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4522 }, | |
| 4518 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4525 }, | |
| 4519 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4526 }, | |
| 4520 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4526 }, | |
| 4521 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4527 }, | |
| 4522 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4527 }, | |
| 4523 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4529 }, | |
| 4524 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, | |
| 4525 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4131 }, | |
| 4526 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4131 }, | |
| 4527 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4530 }, | |
| 4528 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4530 }, | |
| 4529 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4531 }, | |
| 4530 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3855 }, | |
| 4531 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4533 }, | |
| 4532 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4527 }, | |
| 4533 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4534 }, | |
| 4534 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4536 }, | |
| 4535 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4508 }, | |
| 4536 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4508 }, | |
| 8499 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4523 }, | |
| 8500 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4524 }, | |
| 8501 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4525 }, | |
| 8502 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4526 }, | |
| 8503 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4527 }, | |
| 8504 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, | |
| 8505 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, | |
| 8506 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 8507 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4528 }, | |
| 8508 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4530 }, | |
| 8509 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4531 }, | |
| 8510 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4531 }, | |
| 8511 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4532 }, | |
| 8512 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4533 }, | |
| 8513 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 4535 }, | |
| 8514 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4538 }, | |
| 8515 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4541 }, | |
| 8516 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4339 }, | |
| 8517 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4527 }, | |
| 8518 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4527 }, | |
| 8519 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4178 }, | |
| 8520 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4542 }, | |
| 8521 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3901 }, | |
| 8522 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3901 }, | |
| 8523 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4544 }, | |
| 8524 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4545 }, | |
| 8525 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4545 }, | |
| 8526 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4546 }, | |
| 8527 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4547 }, | |
| 8528 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4550 }, | |
| 8529 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4123 }, | |
| 8530 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4551 }, | |
| 8531 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4552 }, | |
| 8532 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4552 }, | |
| 8533 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4553 }, | |
| 8534 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4554 }, | |
| 8535 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4554 }, | |
| 8536 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4555 }, | |
| 8537 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4556 }, | |
| 8538 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4556 }, | |
| 8539 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4556 }, | |
| 8540 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4558 }, | |
| 8541 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4556 }, | |
| 8542 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4559 }, | |
| 8543 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4560 }, | |
| 8544 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4560 }, | |
| 8545 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4561 }, | |
| 8546 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4561 }, | |
| 8547 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4563 }, | |
| 8548 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, | |
| 8549 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4163 }, | |
| 8550 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4163 }, | |
| 8551 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4564 }, | |
| 8552 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4564 }, | |
| 8553 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4565 }, | |
| 8554 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3886 }, | |
| 8555 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4567 }, | |
| 8556 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4561 }, | |
| 8557 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4568 }, | |
| 8558 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4570 }, | |
| 8559 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4542 }, | |
| 8560 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4542 }, | |
| 4537 | 8561 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4538 | 8562 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4539 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4538 }, | |
| 4540 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4539 }, | |
| 4541 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3875 }, | |
| 4542 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4540 }, | |
| 4543 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4536 }, | |
| 4544 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, | |
| 4545 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4542 }, | |
| 4546 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, | |
| 4547 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4543 }, | |
| 4548 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4544 }, | |
| 4549 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4545 }, | |
| 4550 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4546 }, | |
| 4551 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4547 }, | |
| 4552 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4548 }, | |
| 4553 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4549 }, | |
| 4554 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4380 }, | |
| 4555 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4381 }, | |
| 4556 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4382 }, | |
| 4557 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4550 }, | |
| 4558 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4554 }, | |
| 4559 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4555 }, | |
| 4560 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4556 }, | |
| 4561 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4557 }, | |
| 4562 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4558 }, | |
| 4563 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 4559 }, | |
| 4564 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4560 }, | |
| 4565 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4561 }, | |
| 4566 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4562 }, | |
| 4567 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4563 }, | |
| 4568 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4564 }, | |
| 4569 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4565 }, | |
| 8563 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4572 }, | |
| 8564 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4573 }, | |
| 8565 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3906 }, | |
| 8566 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4574 }, | |
| 8567 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4570 }, | |
| 8568 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, | |
| 8569 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4576 }, | |
| 8570 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, | |
| 8571 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4577 }, | |
| 8572 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4578 }, | |
| 8573 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4579 }, | |
| 8574 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4580 }, | |
| 8575 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4581 }, | |
| 8576 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4582 }, | |
| 8577 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4583 }, | |
| 8578 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4413 }, | |
| 8579 | .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4414 }, | |
| 8580 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4415 }, | |
| 8581 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4584 }, | |
| 8582 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4588 }, | |
| 8583 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4589 }, | |
| 8584 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4590 }, | |
| 8585 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4591 }, | |
| 8586 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4592 }, | |
| 8587 | .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 4593 }, | |
| 8588 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4594 }, | |
| 8589 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4595 }, | |
| 8590 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4596 }, | |
| 8591 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4597 }, | |
| 8592 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4598 }, | |
| 8593 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4599 }, | |
| 4570 | 8594 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 311 }, |
| 4571 | 8595 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, |
| 4572 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4566 }, | |
| 4573 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4568 }, | |
| 4574 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4569 }, | |
| 4575 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4571 }, | |
| 4576 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2214 }, | |
| 4577 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4572 }, | |
| 4578 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4573 }, | |
| 4579 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3913 }, | |
| 4580 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4574 }, | |
| 8596 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4600 }, | |
| 8597 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4602 }, | |
| 8598 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4603 }, | |
| 8599 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4605 }, | |
| 8600 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, | |
| 8601 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4606 }, | |
| 8602 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4607 }, | |
| 8603 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3944 }, | |
| 8604 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4608 }, | |
| 4581 | 8605 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 4582 | 8606 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 4583 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4575 }, | |
| 4584 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4576 }, | |
| 4585 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3637 }, | |
| 4586 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4577 }, | |
| 4587 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4578 }, | |
| 4588 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4579 }, | |
| 8607 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4609 }, | |
| 8608 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4610 }, | |
| 8609 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3667 }, | |
| 8610 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4611 }, | |
| 8611 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4612 }, | |
| 8612 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4613 }, | |
| 4589 | 8613 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, |
| 4590 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4580 }, | |
| 4591 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4582 }, | |
| 4592 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4583 }, | |
| 4593 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4584 }, | |
| 4594 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1389 }, | |
| 8614 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4614 }, | |
| 8615 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4616 }, | |
| 8616 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4617 }, | |
| 8617 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4618 }, | |
| 8618 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1395 }, | |
| 4595 | 8619 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, |
| 4596 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4420 }, | |
| 4597 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4585 }, | |
| 4598 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4586 }, | |
| 4599 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4587 }, | |
| 4600 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4588 }, | |
| 4601 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4589 }, | |
| 4602 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3324 }, | |
| 8620 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4453 }, | |
| 8621 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4619 }, | |
| 8622 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4620 }, | |
| 8623 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4621 }, | |
| 8624 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4622 }, | |
| 8625 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4623 }, | |
| 8626 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3353 }, | |
| 4603 | 8627 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, |
| 4604 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4590 }, | |
| 4605 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4591 }, | |
| 4606 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1940 }, | |
| 4607 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4592 }, | |
| 4608 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2819 }, | |
| 8628 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4624 }, | |
| 8629 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4625 }, | |
| 8630 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, | |
| 8631 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4626 }, | |
| 8632 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2845 }, | |
| 4609 | 8633 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, |
| 4610 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3648 }, | |
| 4611 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4593 }, | |
| 4612 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4594 }, | |
| 4613 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4595 }, | |
| 4614 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4596 }, | |
| 4615 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4597 }, | |
| 4616 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4598 }, | |
| 8634 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3678 }, | |
| 8635 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4627 }, | |
| 8636 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4628 }, | |
| 8637 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4629 }, | |
| 8638 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4630 }, | |
| 8639 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4631 }, | |
| 8640 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4632 }, | |
| 4617 | 8641 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, |
| 4618 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4599 }, | |
| 8642 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4633 }, | |
| 4619 | 8643 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, |
| 4620 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4600 }, | |
| 4621 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4601 }, | |
| 4622 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4602 }, | |
| 8644 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4634 }, | |
| 8645 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4635 }, | |
| 8646 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4636 }, | |
| 4623 | 8647 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 738 }, |
| 4624 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4603 }, | |
| 4625 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2268 }, | |
| 4626 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4605 }, | |
| 8648 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4637 }, | |
| 8649 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2290 }, | |
| 8650 | .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4639 }, | |
| 4627 | 8651 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, |
| 4628 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4606 }, | |
| 4629 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4607 }, | |
| 8652 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4640 }, | |
| 8653 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4641 }, | |
| 4630 | 8654 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 580 }, |
| 4631 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4608 }, | |
| 8655 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4642 }, | |
| 4632 | 8656 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 457 }, |
| 4633 | 8657 | .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 286 }, |
| 4634 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4609 }, | |
| 4635 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4610 }, | |
| 4636 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4611 }, | |
| 4637 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4612 }, | |
| 4638 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4613 }, | |
| 4639 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4614 }, | |
| 8658 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4643 }, | |
| 8659 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4644 }, | |
| 8660 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4645 }, | |
| 8661 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4646 }, | |
| 8662 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4647 }, | |
| 8663 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4648 }, | |
| 4640 | 8664 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, |
| 4641 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, | |
| 8665 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4293 }, | |
| 4642 | 8666 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 561 }, |
| 4643 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4615 }, | |
| 4644 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3701 }, | |
| 4645 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4616 }, | |
| 4646 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4617 }, | |
| 4647 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, | |
| 4648 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4618 }, | |
| 4649 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4619 }, | |
| 4650 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4620 }, | |
| 4651 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2199 }, | |
| 4652 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4621 }, | |
| 4653 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4622 }, | |
| 4654 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4623 }, | |
| 4655 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4624 }, | |
| 4656 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, | |
| 4657 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1129 }, | |
| 4658 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4627 }, | |
| 4659 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4628 }, | |
| 4660 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4632 }, | |
| 4661 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4634 }, | |
| 4662 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4635 }, | |
| 4663 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4636 }, | |
| 4664 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4637 }, | |
| 4665 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4638 }, | |
| 4666 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4639 }, | |
| 4667 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4640 }, | |
| 8667 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4649 }, | |
| 8668 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3731 }, | |
| 8669 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4650 }, | |
| 8670 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4651 }, | |
| 8671 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4293 }, | |
| 8672 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4652 }, | |
| 8673 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4653 }, | |
| 8674 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4654 }, | |
| 8675 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2221 }, | |
| 8676 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4655 }, | |
| 8677 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4656 }, | |
| 8678 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4657 }, | |
| 8679 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4658 }, | |
| 8680 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3330 }, | |
| 8681 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1131 }, | |
| 8682 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4661 }, | |
| 8683 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4662 }, | |
| 8684 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4666 }, | |
| 8685 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4668 }, | |
| 8686 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4669 }, | |
| 8687 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4670 }, | |
| 8688 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4671 }, | |
| 8689 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4672 }, | |
| 8690 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4673 }, | |
| 8691 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4674 }, | |
| 8692 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4675 }, | |
| 4668 | 8693 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4669 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4298 }, | |
| 4670 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4642 }, | |
| 4671 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4642 }, | |
| 4672 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4301 }, | |
| 4673 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4645 }, | |
| 4674 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4646 }, | |
| 4675 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4648 }, | |
| 4676 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4649 }, | |
| 4677 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4649 }, | |
| 4678 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4649 }, | |
| 4679 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4649 }, | |
| 4680 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4109 }, | |
| 4681 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4649 }, | |
| 4682 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4651 }, | |
| 4683 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4649 }, | |
| 4684 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4652 }, | |
| 4685 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4109 }, | |
| 4686 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4317 }, | |
| 4687 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4653 }, | |
| 4688 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4654 }, | |
| 4689 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, | |
| 4690 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4513 }, | |
| 8694 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4331 }, | |
| 8695 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4677 }, | |
| 8696 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4677 }, | |
| 8697 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4334 }, | |
| 8698 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4680 }, | |
| 8699 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4681 }, | |
| 8700 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4683 }, | |
| 8701 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, | |
| 8702 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4684 }, | |
| 8703 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, | |
| 8704 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4684 }, | |
| 8705 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4141 }, | |
| 8706 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, | |
| 8707 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4686 }, | |
| 8708 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4684 }, | |
| 8709 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4687 }, | |
| 8710 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4141 }, | |
| 8711 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4350 }, | |
| 8712 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4688 }, | |
| 8713 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4689 }, | |
| 8714 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, | |
| 8715 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4547 }, | |
| 4691 | 8716 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4692 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4516 }, | |
| 8717 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4550 }, | |
| 4693 | 8718 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4694 | 8719 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4695 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, | |
| 4696 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4327 }, | |
| 4697 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4656 }, | |
| 4698 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4331 }, | |
| 4699 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4658 }, | |
| 4700 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4660 }, | |
| 4701 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4661 }, | |
| 4702 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4662 }, | |
| 4703 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4662 }, | |
| 4704 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4295 }, | |
| 4705 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4663 }, | |
| 4706 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4663 }, | |
| 4707 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4664 }, | |
| 4708 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4667 }, | |
| 4709 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4668 }, | |
| 4710 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4668 }, | |
| 4711 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4669 }, | |
| 4712 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4670 }, | |
| 4713 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4670 }, | |
| 8720 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, | |
| 8721 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4360 }, | |
| 8722 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4691 }, | |
| 8723 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4364 }, | |
| 8724 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4693 }, | |
| 8725 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4695 }, | |
| 8726 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4696 }, | |
| 8727 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4697 }, | |
| 8728 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4697 }, | |
| 8729 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4328 }, | |
| 8730 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4698 }, | |
| 8731 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4698 }, | |
| 8732 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4699 }, | |
| 8733 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4702 }, | |
| 8734 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4703 }, | |
| 8735 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4703 }, | |
| 8736 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4704 }, | |
| 8737 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4705 }, | |
| 8738 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4705 }, | |
| 4714 | 8739 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4715 | 8740 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4716 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4512 }, | |
| 4717 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4346 }, | |
| 4718 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4513 }, | |
| 4719 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4513 }, | |
| 4720 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3609 }, | |
| 4721 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4671 }, | |
| 4722 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4673 }, | |
| 4723 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4674 }, | |
| 4724 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4381 }, | |
| 4725 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4675 }, | |
| 4726 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4676 }, | |
| 4727 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4546 }, | |
| 8741 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4546 }, | |
| 8742 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4379 }, | |
| 8743 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4547 }, | |
| 8744 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4547 }, | |
| 8745 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3639 }, | |
| 8746 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4706 }, | |
| 8747 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4708 }, | |
| 8748 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4709 }, | |
| 8749 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4414 }, | |
| 8750 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4710 }, | |
| 8751 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4711 }, | |
| 8752 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4580 }, | |
| 4728 | 8753 | .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4729 | 8754 | .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4730 | 8755 | .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4731 | 8756 | .{ .char = '3', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4732 | 8757 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, |
| 4733 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4677 }, | |
| 4734 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4678 }, | |
| 4735 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, | |
| 4736 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4679 }, | |
| 4737 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4680 }, | |
| 4738 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4681 }, | |
| 4739 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4682 }, | |
| 4740 | .{ .char = 'C', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4683 }, | |
| 4741 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, | |
| 4742 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4685 }, | |
| 4743 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4686 }, | |
| 4744 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4687 }, | |
| 4745 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4688 }, | |
| 4746 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4689 }, | |
| 4747 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3026 }, | |
| 4748 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4690 }, | |
| 4749 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4692 }, | |
| 4750 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, | |
| 4751 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, | |
| 4752 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4693 }, | |
| 8758 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4712 }, | |
| 8759 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4713 }, | |
| 8760 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, | |
| 8761 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4714 }, | |
| 8762 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4715 }, | |
| 8763 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4716 }, | |
| 8764 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4717 }, | |
| 8765 | .{ .char = 'C', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4718 }, | |
| 8766 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4719 }, | |
| 8767 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4720 }, | |
| 8768 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4721 }, | |
| 8769 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4722 }, | |
| 8770 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4723 }, | |
| 8771 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4724 }, | |
| 8772 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3053 }, | |
| 8773 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4725 }, | |
| 8774 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4727 }, | |
| 8775 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, | |
| 8776 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, | |
| 8777 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4728 }, | |
| 4753 | 8778 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, |
| 4754 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3470 }, | |
| 4755 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4694 }, | |
| 4756 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4695 }, | |
| 4757 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4696 }, | |
| 4758 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4697 }, | |
| 4759 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4698 }, | |
| 8779 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3500 }, | |
| 8780 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4729 }, | |
| 8781 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4730 }, | |
| 8782 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4731 }, | |
| 8783 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4732 }, | |
| 8784 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4733 }, | |
| 4760 | 8785 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, |
| 4761 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4700 }, | |
| 4762 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4701 }, | |
| 4763 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4702 }, | |
| 4764 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4703 }, | |
| 8786 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4735 }, | |
| 8787 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4736 }, | |
| 8788 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4737 }, | |
| 8789 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4738 }, | |
| 4765 | 8790 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 4766 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4704 }, | |
| 4767 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4705 }, | |
| 4768 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4706 }, | |
| 4769 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4707 }, | |
| 4770 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4708 }, | |
| 4771 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4709 }, | |
| 4772 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4710 }, | |
| 4773 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4711 }, | |
| 4774 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4712 }, | |
| 4775 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4713 }, | |
| 4776 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4714 }, | |
| 4777 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4715 }, | |
| 4778 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4716 }, | |
| 4779 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4717 }, | |
| 4780 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4718 }, | |
| 4781 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4719 }, | |
| 8791 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4739 }, | |
| 8792 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4740 }, | |
| 8793 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4741 }, | |
| 8794 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4742 }, | |
| 8795 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4743 }, | |
| 8796 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4744 }, | |
| 8797 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4745 }, | |
| 8798 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4746 }, | |
| 8799 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4747 }, | |
| 8800 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4748 }, | |
| 8801 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4749 }, | |
| 8802 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4750 }, | |
| 8803 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4751 }, | |
| 8804 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4752 }, | |
| 8805 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4753 }, | |
| 8806 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4754 }, | |
| 4782 | 8807 | .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4783 | 8808 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, |
| 4784 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4720 }, | |
| 4785 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4722 }, | |
| 4786 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4723 }, | |
| 4787 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4716 }, | |
| 4788 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1663 }, | |
| 4789 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4724 }, | |
| 8809 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4755 }, | |
| 8810 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4757 }, | |
| 8811 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4758 }, | |
| 8812 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4751 }, | |
| 8813 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1677 }, | |
| 8814 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4759 }, | |
| 4790 | 8815 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, |
| 4791 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4725 }, | |
| 4792 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4726 }, | |
| 8816 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4760 }, | |
| 8817 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4761 }, | |
| 4793 | 8818 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 561 }, |
| 4794 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4727 }, | |
| 4795 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4728 }, | |
| 4796 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4730 }, | |
| 4797 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4731 }, | |
| 4798 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4732 }, | |
| 4799 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4733 }, | |
| 4800 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4734 }, | |
| 4801 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4735 }, | |
| 4802 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4736 }, | |
| 4803 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4738 }, | |
| 4804 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4739 }, | |
| 4805 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4740 }, | |
| 4806 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4741 }, | |
| 4807 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4742 }, | |
| 4808 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4743 }, | |
| 4809 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4744 }, | |
| 4810 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4745 }, | |
| 4811 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4745 }, | |
| 4812 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4746 }, | |
| 4813 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4747 }, | |
| 4814 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4748 }, | |
| 4815 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4636 }, | |
| 4816 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4751 }, | |
| 4817 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4752 }, | |
| 8819 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4762 }, | |
| 8820 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4763 }, | |
| 8821 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4765 }, | |
| 8822 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4766 }, | |
| 8823 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4767 }, | |
| 8824 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4768 }, | |
| 8825 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4769 }, | |
| 8826 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4770 }, | |
| 8827 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4771 }, | |
| 8828 | .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4773 }, | |
| 8829 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4774 }, | |
| 8830 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4775 }, | |
| 8831 | .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4776 }, | |
| 8832 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4777 }, | |
| 8833 | .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4778 }, | |
| 8834 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4779 }, | |
| 8835 | .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4780 }, | |
| 8836 | .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4780 }, | |
| 8837 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4781 }, | |
| 8838 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4782 }, | |
| 8839 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4783 }, | |
| 8840 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4670 }, | |
| 8841 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4786 }, | |
| 8842 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4787 }, | |
| 8843 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4788 }, | |
| 4818 | 8844 | .{ .char = 'a', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4819 | 8845 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4820 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4516 }, | |
| 8846 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4550 }, | |
| 4821 | 8847 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4822 | 8848 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4823 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4753 }, | |
| 4824 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4301 }, | |
| 4825 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4315 }, | |
| 8849 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4789 }, | |
| 8850 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4334 }, | |
| 8851 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4348 }, | |
| 4826 | 8852 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4827 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4754 }, | |
| 4828 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4755 }, | |
| 4829 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4756 }, | |
| 4830 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4756 }, | |
| 4831 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4757 }, | |
| 4832 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4642 }, | |
| 4833 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4642 }, | |
| 4834 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4325 }, | |
| 4835 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4540 }, | |
| 4836 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4091 }, | |
| 4837 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4138 }, | |
| 4838 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4356 }, | |
| 4839 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4524 }, | |
| 4840 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4660 }, | |
| 4841 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4758 }, | |
| 8853 | .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4790 }, | |
| 8854 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4791 }, | |
| 8855 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4792 }, | |
| 8856 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4792 }, | |
| 8857 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4793 }, | |
| 8858 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4677 }, | |
| 8859 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4677 }, | |
| 8860 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4358 }, | |
| 8861 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4574 }, | |
| 8862 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4123 }, | |
| 8863 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4170 }, | |
| 8864 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4389 }, | |
| 8865 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4558 }, | |
| 8866 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4695 }, | |
| 8867 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4794 }, | |
| 4842 | 8868 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4843 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4359 }, | |
| 8869 | .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4392 }, | |
| 4844 | 8870 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, |
| 4845 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, | |
| 4846 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4759 }, | |
| 4847 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4760 }, | |
| 4848 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4762 }, | |
| 4849 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4763 }, | |
| 4850 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4764 }, | |
| 4851 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4765 }, | |
| 4852 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4766 }, | |
| 4853 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4554 }, | |
| 4854 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4767 }, | |
| 4855 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4769 }, | |
| 4856 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4554 }, | |
| 8871 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, | |
| 8872 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4795 }, | |
| 8873 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4796 }, | |
| 8874 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4798 }, | |
| 8875 | .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4799 }, | |
| 8876 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4800 }, | |
| 8877 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4801 }, | |
| 8878 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4802 }, | |
| 8879 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4588 }, | |
| 8880 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4803 }, | |
| 8881 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4805 }, | |
| 8882 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4588 }, | |
| 4857 | 8883 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 873 }, |
| 4858 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4560 }, | |
| 4859 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 4773 }, | |
| 4860 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4775 }, | |
| 4861 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4776 }, | |
| 4862 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4777 }, | |
| 4863 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4778 }, | |
| 4864 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4779 }, | |
| 4865 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4780 }, | |
| 4866 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4780 }, | |
| 4867 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4781 }, | |
| 8884 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4594 }, | |
| 8885 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 4809 }, | |
| 8886 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4811 }, | |
| 8887 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4812 }, | |
| 8888 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4813 }, | |
| 8889 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4814 }, | |
| 8890 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4815 }, | |
| 8891 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4816 }, | |
| 8892 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4816 }, | |
| 8893 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4817 }, | |
| 4868 | 8894 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 4869 | .{ .char = '8', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4782 }, | |
| 4870 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4783 }, | |
| 8895 | .{ .char = '8', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4818 }, | |
| 8896 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4819 }, | |
| 4871 | 8897 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, |
| 4872 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3659 }, | |
| 4873 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4636 }, | |
| 4874 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4784 }, | |
| 4875 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, | |
| 4876 | .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4785 }, | |
| 4877 | .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4785 }, | |
| 4878 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4786 }, | |
| 8898 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3689 }, | |
| 8899 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4670 }, | |
| 8900 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4820 }, | |
| 8901 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, | |
| 8902 | .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4821 }, | |
| 8903 | .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4821 }, | |
| 8904 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4822 }, | |
| 4879 | 8905 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, |
| 4880 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, | |
| 4881 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4787 }, | |
| 4882 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4788 }, | |
| 4883 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4789 }, | |
| 4884 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4790 }, | |
| 4885 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4791 }, | |
| 4886 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4792 }, | |
| 4887 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4793 }, | |
| 4888 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, | |
| 4889 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4794 }, | |
| 4890 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4289 }, | |
| 4891 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4795 }, | |
| 4892 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4796 }, | |
| 4893 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4797 }, | |
| 4894 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4798 }, | |
| 4895 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4799 }, | |
| 4896 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4800 }, | |
| 4897 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, | |
| 4898 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4801 }, | |
| 8906 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, | |
| 8907 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4823 }, | |
| 8908 | .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4824 }, | |
| 8909 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4825 }, | |
| 8910 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4826 }, | |
| 8911 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4827 }, | |
| 8912 | .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4828 }, | |
| 8913 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4829 }, | |
| 8914 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, | |
| 8915 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4830 }, | |
| 8916 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4321 }, | |
| 8917 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4831 }, | |
| 8918 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4832 }, | |
| 8919 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4833 }, | |
| 8920 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4834 }, | |
| 8921 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4835 }, | |
| 8922 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4836 }, | |
| 8923 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, | |
| 8924 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4837 }, | |
| 4899 | 8925 | .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4900 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4802 }, | |
| 4901 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4803 }, | |
| 4902 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4804 }, | |
| 4903 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4805 }, | |
| 4904 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4806 }, | |
| 4905 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4807 }, | |
| 4906 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4469 }, | |
| 4907 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4618 }, | |
| 4908 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4469 }, | |
| 4909 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4266 }, | |
| 4910 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4808 }, | |
| 4911 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4809 }, | |
| 4912 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4810 }, | |
| 4913 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4811 }, | |
| 4914 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4812 }, | |
| 4915 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4812 }, | |
| 4916 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4813 }, | |
| 4917 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4814 }, | |
| 4918 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4815 }, | |
| 4919 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4816 }, | |
| 4920 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4817 }, | |
| 4921 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4818 }, | |
| 4922 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4819 }, | |
| 4923 | .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4820 }, | |
| 4924 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4822 }, | |
| 4925 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, | |
| 8926 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4838 }, | |
| 8927 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4839 }, | |
| 8928 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4840 }, | |
| 8929 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4841 }, | |
| 8930 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4842 }, | |
| 8931 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4843 }, | |
| 8932 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4502 }, | |
| 8933 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4652 }, | |
| 8934 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4502 }, | |
| 8935 | .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4298 }, | |
| 8936 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4844 }, | |
| 8937 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4845 }, | |
| 8938 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4846 }, | |
| 8939 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4847 }, | |
| 8940 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4848 }, | |
| 8941 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4848 }, | |
| 8942 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4849 }, | |
| 8943 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4850 }, | |
| 8944 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4851 }, | |
| 8945 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4852 }, | |
| 8946 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4853 }, | |
| 8947 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4854 }, | |
| 8948 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4855 }, | |
| 8949 | .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4856 }, | |
| 8950 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4858 }, | |
| 8951 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, | |
| 4926 | 8952 | .{ .char = 'x', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4927 | 8953 | .{ .char = 'y', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4928 | 8954 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4929 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4823 }, | |
| 4930 | .{ .char = '5', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4824 }, | |
| 4931 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4301 }, | |
| 4932 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4825 }, | |
| 4933 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4651 }, | |
| 4934 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4754 }, | |
| 4935 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 4936 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, | |
| 4937 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, | |
| 4938 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4146 }, | |
| 4939 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4146 }, | |
| 4940 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4826 }, | |
| 4941 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, | |
| 4942 | .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, | |
| 4943 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4828 }, | |
| 4944 | .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1938 }, | |
| 8955 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4859 }, | |
| 8956 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, | |
| 8957 | .{ .char = '5', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4860 }, | |
| 8958 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4334 }, | |
| 8959 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4861 }, | |
| 8960 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4686 }, | |
| 8961 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4790 }, | |
| 8962 | .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 8963 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, | |
| 8964 | .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, | |
| 8965 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4178 }, | |
| 8966 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4178 }, | |
| 8967 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4862 }, | |
| 8968 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, | |
| 8969 | .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, | |
| 8970 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4864 }, | |
| 8971 | .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1957 }, | |
| 4945 | 8972 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, |
| 4946 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4829 }, | |
| 8973 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4865 }, | |
| 4947 | 8974 | .{ .char = 'w', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4948 | 8975 | .{ .char = 'x', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4949 | 8976 | .{ .char = 'y', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 4950 | 8977 | .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4951 | 8978 | .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, |
| 4952 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4830 }, | |
| 4953 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 4833 }, | |
| 4954 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4837 }, | |
| 4955 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4838 }, | |
| 4956 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4839 }, | |
| 4957 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4840 }, | |
| 4958 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3886 }, | |
| 4959 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4841 }, | |
| 4960 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4842 }, | |
| 4961 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4843 }, | |
| 4962 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4844 }, | |
| 4963 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4845 }, | |
| 4964 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4846 }, | |
| 4965 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4847 }, | |
| 4966 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4416 }, | |
| 4967 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4210 }, | |
| 4968 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4848 }, | |
| 4969 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4849 }, | |
| 4970 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4850 }, | |
| 4971 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4851 }, | |
| 4972 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4852 }, | |
| 4973 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4854 }, | |
| 4974 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4855 }, | |
| 4975 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4856 }, | |
| 4976 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4857 }, | |
| 4977 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4858 }, | |
| 4978 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4859 }, | |
| 8979 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4866 }, | |
| 8980 | .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 4869 }, | |
| 8981 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4873 }, | |
| 8982 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4874 }, | |
| 8983 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4875 }, | |
| 8984 | .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4876 }, | |
| 8985 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3917 }, | |
| 8986 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4877 }, | |
| 8987 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4878 }, | |
| 8988 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4879 }, | |
| 8989 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4880 }, | |
| 8990 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4881 }, | |
| 8991 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4882 }, | |
| 8992 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4883 }, | |
| 8993 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4449 }, | |
| 8994 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4242 }, | |
| 8995 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4884 }, | |
| 8996 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4885 }, | |
| 8997 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4886 }, | |
| 8998 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4887 }, | |
| 8999 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4888 }, | |
| 9000 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4890 }, | |
| 9001 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4891 }, | |
| 9002 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4892 }, | |
| 9003 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4893 }, | |
| 9004 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4894 }, | |
| 9005 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4895 }, | |
| 4979 | 9006 | .{ .char = '0', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 4980 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4860 }, | |
| 4981 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4861 }, | |
| 4982 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4862 }, | |
| 4983 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4863 }, | |
| 4984 | .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4864 }, | |
| 4985 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4865 }, | |
| 4986 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4867 }, | |
| 4987 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4868 }, | |
| 4988 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4869 }, | |
| 4989 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4739 }, | |
| 4990 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4813 }, | |
| 9007 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4896 }, | |
| 9008 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4897 }, | |
| 9009 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4898 }, | |
| 9010 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4899 }, | |
| 9011 | .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4900 }, | |
| 9012 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4901 }, | |
| 9013 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4903 }, | |
| 9014 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4904 }, | |
| 9015 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4905 }, | |
| 9016 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4774 }, | |
| 9017 | .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4849 }, | |
| 4991 | 9018 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, |
| 4992 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4870 }, | |
| 4993 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4871 }, | |
| 4994 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4872 }, | |
| 4995 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4873 }, | |
| 4996 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4874 }, | |
| 4997 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4873 }, | |
| 4998 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4875 }, | |
| 4999 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4875 }, | |
| 5000 | .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4877 }, | |
| 5001 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4880 }, | |
| 5002 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4881 }, | |
| 5003 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4882 }, | |
| 5004 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4757 }, | |
| 5005 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4757 }, | |
| 5006 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4884 }, | |
| 5007 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4885 }, | |
| 5008 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4886 }, | |
| 9019 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4906 }, | |
| 9020 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4907 }, | |
| 9021 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4908 }, | |
| 9022 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4909 }, | |
| 9023 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4910 }, | |
| 9024 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4909 }, | |
| 9025 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4911 }, | |
| 9026 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4911 }, | |
| 9027 | .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4913 }, | |
| 9028 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4916 }, | |
| 9029 | .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4917 }, | |
| 9030 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4918 }, | |
| 9031 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4793 }, | |
| 9032 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4793 }, | |
| 9033 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4920 }, | |
| 9034 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4921 }, | |
| 9035 | .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4922 }, | |
| 5009 | 9036 | .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 496 }, |
| 5010 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3366 }, | |
| 9037 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, | |
| 5011 | 9038 | .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, |
| 5012 | 9039 | .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, |
| 5013 | 9040 | .{ .char = '8', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 5014 | .{ .char = 'P', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4887 }, | |
| 5015 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4888 }, | |
| 5016 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4889 }, | |
| 5017 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3052 }, | |
| 5018 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4890 }, | |
| 5019 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4891 }, | |
| 5020 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2568 }, | |
| 5021 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4892 }, | |
| 5022 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2808 }, | |
| 5023 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, | |
| 5024 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4894 }, | |
| 5025 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, | |
| 5026 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, | |
| 5027 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4895 }, | |
| 5028 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4896 }, | |
| 5029 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3961 }, | |
| 5030 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4485 }, | |
| 5031 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4409 }, | |
| 5032 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4897 }, | |
| 5033 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4898 }, | |
| 5034 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4899 }, | |
| 9041 | .{ .char = 'P', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4923 }, | |
| 9042 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4924 }, | |
| 9043 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4925 }, | |
| 9044 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3080 }, | |
| 9045 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4926 }, | |
| 9046 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4927 }, | |
| 9047 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, | |
| 9048 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4928 }, | |
| 9049 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2834 }, | |
| 9050 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, | |
| 9051 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4930 }, | |
| 9052 | .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, | |
| 9053 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, | |
| 9054 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4931 }, | |
| 9055 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4932 }, | |
| 9056 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3992 }, | |
| 9057 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4518 }, | |
| 9058 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4442 }, | |
| 9059 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4933 }, | |
| 9060 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4934 }, | |
| 9061 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4935 }, | |
| 5035 | 9062 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, |
| 5036 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4900 }, | |
| 5037 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4901 }, | |
| 9063 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4936 }, | |
| 9064 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4937 }, | |
| 5038 | 9065 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 471 }, |
| 5039 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4902 }, | |
| 5040 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4903 }, | |
| 5041 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4904 }, | |
| 5042 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4905 }, | |
| 5043 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4906 }, | |
| 5044 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4906 }, | |
| 5045 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4907 }, | |
| 5046 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2877 }, | |
| 5047 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4908 }, | |
| 5048 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4813 }, | |
| 9066 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4938 }, | |
| 9067 | .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4939 }, | |
| 9068 | .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4940 }, | |
| 9069 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4941 }, | |
| 9070 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4942 }, | |
| 9071 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4942 }, | |
| 9072 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4943 }, | |
| 9073 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2904 }, | |
| 9074 | .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4944 }, | |
| 9075 | .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4849 }, | |
| 5049 | 9076 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 183 }, |
| 5050 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4909 }, | |
| 5051 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4910 }, | |
| 5052 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4911 }, | |
| 5053 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4912 }, | |
| 5054 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4912 }, | |
| 5055 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4912 }, | |
| 5056 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4912 }, | |
| 5057 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, | |
| 5058 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4693 }, | |
| 5059 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4914 }, | |
| 9077 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4945 }, | |
| 9078 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4946 }, | |
| 9079 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4947 }, | |
| 9080 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4948 }, | |
| 9081 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4948 }, | |
| 9082 | .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4948 }, | |
| 9083 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4948 }, | |
| 9084 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, | |
| 9085 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4728 }, | |
| 9086 | .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4950 }, | |
| 5060 | 9087 | .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, |
| 5061 | 9088 | .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5062 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4916 }, | |
| 5063 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4917 }, | |
| 5064 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4918 }, | |
| 5065 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4919 }, | |
| 5066 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4920 }, | |
| 5067 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4921 }, | |
| 5068 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2963 }, | |
| 5069 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4925 }, | |
| 5070 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3026 }, | |
| 5071 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, | |
| 5072 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4926 }, | |
| 5073 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3366 }, | |
| 9089 | .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4952 }, | |
| 9090 | .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4953 }, | |
| 9091 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4954 }, | |
| 9092 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4955 }, | |
| 9093 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4956 }, | |
| 9094 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4957 }, | |
| 9095 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2990 }, | |
| 9096 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4961 }, | |
| 9097 | .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3053 }, | |
| 9098 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, | |
| 9099 | .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4962 }, | |
| 9100 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, | |
| 5074 | 9101 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, |
| 5075 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4927 }, | |
| 5076 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4928 }, | |
| 9102 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4963 }, | |
| 9103 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4964 }, | |
| 5077 | 9104 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, |
| 5078 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4929 }, | |
| 5079 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4930 }, | |
| 9105 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4965 }, | |
| 9106 | .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4966 }, | |
| 5080 | 9107 | .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, |
| 5081 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4931 }, | |
| 5082 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4932 }, | |
| 5083 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4017 }, | |
| 9108 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4967 }, | |
| 9109 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4968 }, | |
| 9110 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4048 }, | |
| 5084 | 9111 | .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5085 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4933 }, | |
| 5086 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4934 }, | |
| 5087 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4935 }, | |
| 5088 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, | |
| 5089 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4936 }, | |
| 9112 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4969 }, | |
| 9113 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4970 }, | |
| 9114 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4971 }, | |
| 9115 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, | |
| 9116 | .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4972 }, | |
| 5090 | 9117 | .{ .char = '_', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5091 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4912 }, | |
| 9118 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4948 }, | |
| 5092 | 9119 | .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 5093 | 9120 | .{ .char = 'u', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5094 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4937 }, | |
| 5095 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4938 }, | |
| 9121 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4973 }, | |
| 9122 | .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4974 }, | |
| 5096 | 9123 | .{ .char = 'q', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5097 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4939 }, | |
| 5098 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4940 }, | |
| 5099 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4941 }, | |
| 5100 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4587 }, | |
| 9124 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4975 }, | |
| 9125 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4976 }, | |
| 9126 | .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4977 }, | |
| 9127 | .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4621 }, | |
| 5101 | 9128 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 520 }, |
| 5102 | 9129 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 420 }, |
| 5103 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4942 }, | |
| 5104 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4943 }, | |
| 5105 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4944 }, | |
| 5106 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4945 }, | |
| 5107 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, | |
| 5108 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4946 }, | |
| 5109 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4947 }, | |
| 5110 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3195 }, | |
| 5111 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4948 }, | |
| 5112 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2460 }, | |
| 5113 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4949 }, | |
| 5114 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, | |
| 5115 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4950 }, | |
| 5116 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4952 }, | |
| 5117 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4955 }, | |
| 5118 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4956 }, | |
| 5119 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4957 }, | |
| 9130 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4978 }, | |
| 9131 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4979 }, | |
| 9132 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4980 }, | |
| 9133 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4981 }, | |
| 9134 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3330 }, | |
| 9135 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4982 }, | |
| 9136 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4983 }, | |
| 9137 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3224 }, | |
| 9138 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4984 }, | |
| 9139 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2483 }, | |
| 9140 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4985 }, | |
| 9141 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, | |
| 9142 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4986 }, | |
| 9143 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4988 }, | |
| 9144 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4991 }, | |
| 9145 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4992 }, | |
| 9146 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4993 }, | |
| 5120 | 9147 | .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5121 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4958 }, | |
| 5122 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3578 }, | |
| 9148 | .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4994 }, | |
| 9149 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3608 }, | |
| 5123 | 9150 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, |
| 5124 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, | |
| 5125 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4959 }, | |
| 9151 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, | |
| 9152 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4995 }, | |
| 5126 | 9153 | .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, |
| 5127 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4960 }, | |
| 5128 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4961 }, | |
| 9154 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4996 }, | |
| 9155 | .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4997 }, | |
| 5129 | 9156 | .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 821 }, |
| 5130 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4918 }, | |
| 5131 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4962 }, | |
| 5132 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4962 }, | |
| 5133 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4964 }, | |
| 5134 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4965 }, | |
| 5135 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4966 }, | |
| 5136 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, | |
| 9157 | .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4954 }, | |
| 9158 | .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4998 }, | |
| 9159 | .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4998 }, | |
| 9160 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 5000 }, | |
| 9161 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5001 }, | |
| 9162 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5002 }, | |
| 9163 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, | |
| 5137 | 9164 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, |
| 5138 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4967 }, | |
| 5139 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4969 }, | |
| 9165 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 5003 }, | |
| 9166 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5005 }, | |
| 5140 | 9167 | .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, |
| 5141 | 9168 | .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, |
| 5142 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4970 }, | |
| 5143 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4971 }, | |
| 5144 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4972 }, | |
| 5145 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4973 }, | |
| 5146 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4974 }, | |
| 5147 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1440 }, | |
| 5148 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4975 }, | |
| 5149 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4976 }, | |
| 9169 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 5006 }, | |
| 9170 | .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5007 }, | |
| 9171 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5008 }, | |
| 9172 | .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 5009 }, | |
| 9173 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5010 }, | |
| 9174 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1446 }, | |
| 9175 | .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 5011 }, | |
| 9176 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5012 }, | |
| 5150 | 9177 | .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, |
| 5151 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4977 }, | |
| 5152 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4978 }, | |
| 9178 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5013 }, | |
| 9179 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5014 }, | |
| 5153 | 9180 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, |
| 5154 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4979 }, | |
| 5155 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4980 }, | |
| 5156 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4981 }, | |
| 5157 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1701 }, | |
| 5158 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4982 }, | |
| 5159 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4983 }, | |
| 5160 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4984 }, | |
| 5161 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, | |
| 5162 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4985 }, | |
| 5163 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4986 }, | |
| 5164 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4987 }, | |
| 5165 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, | |
| 9181 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5015 }, | |
| 9182 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5016 }, | |
| 9183 | .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5017 }, | |
| 9184 | .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1715 }, | |
| 9185 | .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5018 }, | |
| 9186 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5019 }, | |
| 9187 | .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5020 }, | |
| 9188 | .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, | |
| 9189 | .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5021 }, | |
| 9190 | .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5022 }, | |
| 9191 | .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5023 }, | |
| 9192 | .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, | |
| 5166 | 9193 | }; |
| 5167 | 9194 | pub const data = blk: { |
| 5168 | @setEvalBranchQuota(27902); | |
| 9195 | @setEvalBranchQuota(27937); | |
| 5169 | 9196 | break :blk [_]@This(){ |
| 5170 | // _Block_object_assign | |
| 5171 | .{ .tag = @enumFromInt(0), .properties = .{ .param_str = "vv*vC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 5172 | // _Block_object_dispose | |
| 5173 | .{ .tag = @enumFromInt(1), .properties = .{ .param_str = "vvC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 5174 | // _Exit | |
| 5175 | .{ .tag = @enumFromInt(2), .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 5176 | // _InterlockedAnd | |
| 5177 | .{ .tag = @enumFromInt(3), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 5178 | // _InterlockedAnd16 | |
| 5179 | .{ .tag = @enumFromInt(4), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 5180 | // _InterlockedAnd8 | |
| 5181 | .{ .tag = @enumFromInt(5), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 5182 | // _InterlockedCompareExchange | |
| 5183 | .{ .tag = @enumFromInt(6), .properties = .{ .param_str = "NiNiD*NiNi", .language = .all_ms_languages } }, | |
| 5184 | // _InterlockedCompareExchange16 | |
| 5185 | .{ .tag = @enumFromInt(7), .properties = .{ .param_str = "ssD*ss", .language = .all_ms_languages } }, | |
| 5186 | // _InterlockedCompareExchange64 | |
| 5187 | .{ .tag = @enumFromInt(8), .properties = .{ .param_str = "LLiLLiD*LLiLLi", .language = .all_ms_languages } }, | |
| 5188 | // _InterlockedCompareExchange8 | |
| 5189 | .{ .tag = @enumFromInt(9), .properties = .{ .param_str = "ccD*cc", .language = .all_ms_languages } }, | |
| 5190 | // _InterlockedCompareExchangePointer | |
| 5191 | .{ .tag = @enumFromInt(10), .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, | |
| 5192 | // _InterlockedCompareExchangePointer_nf | |
| 5193 | .{ .tag = @enumFromInt(11), .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, | |
| 5194 | // _InterlockedDecrement | |
| 5195 | .{ .tag = @enumFromInt(12), .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, | |
| 5196 | // _InterlockedDecrement16 | |
| 5197 | .{ .tag = @enumFromInt(13), .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, | |
| 5198 | // _InterlockedExchange | |
| 5199 | .{ .tag = @enumFromInt(14), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 5200 | // _InterlockedExchange16 | |
| 5201 | .{ .tag = @enumFromInt(15), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 5202 | // _InterlockedExchange8 | |
| 5203 | .{ .tag = @enumFromInt(16), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 5204 | // _InterlockedExchangeAdd | |
| 5205 | .{ .tag = @enumFromInt(17), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 5206 | // _InterlockedExchangeAdd16 | |
| 5207 | .{ .tag = @enumFromInt(18), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 5208 | // _InterlockedExchangeAdd8 | |
| 5209 | .{ .tag = @enumFromInt(19), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 5210 | // _InterlockedExchangePointer | |
| 5211 | .{ .tag = @enumFromInt(20), .properties = .{ .param_str = "v*v*D*v*", .language = .all_ms_languages } }, | |
| 5212 | // _InterlockedExchangeSub | |
| 5213 | .{ .tag = @enumFromInt(21), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 5214 | // _InterlockedExchangeSub16 | |
| 5215 | .{ .tag = @enumFromInt(22), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 5216 | // _InterlockedExchangeSub8 | |
| 5217 | .{ .tag = @enumFromInt(23), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 5218 | // _InterlockedIncrement | |
| 5219 | .{ .tag = @enumFromInt(24), .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, | |
| 5220 | // _InterlockedIncrement16 | |
| 5221 | .{ .tag = @enumFromInt(25), .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, | |
| 5222 | // _InterlockedOr | |
| 5223 | .{ .tag = @enumFromInt(26), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 5224 | // _InterlockedOr16 | |
| 5225 | .{ .tag = @enumFromInt(27), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 5226 | // _InterlockedOr8 | |
| 5227 | .{ .tag = @enumFromInt(28), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 5228 | // _InterlockedXor | |
| 5229 | .{ .tag = @enumFromInt(29), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 5230 | // _InterlockedXor16 | |
| 5231 | .{ .tag = @enumFromInt(30), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 5232 | // _InterlockedXor8 | |
| 5233 | .{ .tag = @enumFromInt(31), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 5234 | // _MoveFromCoprocessor | |
| 5235 | .{ .tag = @enumFromInt(32), .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 5236 | // _MoveFromCoprocessor2 | |
| 5237 | .{ .tag = @enumFromInt(33), .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 5238 | // _MoveToCoprocessor | |
| 5239 | .{ .tag = @enumFromInt(34), .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 5240 | // _MoveToCoprocessor2 | |
| 5241 | .{ .tag = @enumFromInt(35), .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 5242 | // _ReturnAddress | |
| 5243 | .{ .tag = @enumFromInt(36), .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, | |
| 5244 | // __GetExceptionInfo | |
| 5245 | .{ .tag = @enumFromInt(37), .properties = .{ .param_str = "v*.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true, .eval_args = false } } }, | |
| 5246 | // __abnormal_termination | |
| 5247 | .{ .tag = @enumFromInt(38), .properties = .{ .param_str = "i", .language = .all_ms_languages } }, | |
| 5248 | // __annotation | |
| 5249 | .{ .tag = @enumFromInt(39), .properties = .{ .param_str = "wC*.", .language = .all_ms_languages } }, | |
| 5250 | // __arithmetic_fence | |
| 5251 | .{ .tag = @enumFromInt(40), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 5252 | // __assume | |
| 5253 | .{ .tag = @enumFromInt(41), .properties = .{ .param_str = "vb", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 5254 | // __atomic_add_fetch | |
| 5255 | .{ .tag = @enumFromInt(42), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5256 | // __atomic_always_lock_free | |
| 5257 | .{ .tag = @enumFromInt(43), .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, | |
| 5258 | // __atomic_and_fetch | |
| 5259 | .{ .tag = @enumFromInt(44), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5260 | // __atomic_clear | |
| 5261 | .{ .tag = @enumFromInt(45), .properties = .{ .param_str = "vvD*i" } }, | |
| 5262 | // __atomic_compare_exchange | |
| 5263 | .{ .tag = @enumFromInt(46), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5264 | // __atomic_compare_exchange_n | |
| 5265 | .{ .tag = @enumFromInt(47), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5266 | // __atomic_exchange | |
| 5267 | .{ .tag = @enumFromInt(48), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5268 | // __atomic_exchange_n | |
| 5269 | .{ .tag = @enumFromInt(49), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5270 | // __atomic_fetch_add | |
| 5271 | .{ .tag = @enumFromInt(50), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5272 | // __atomic_fetch_and | |
| 5273 | .{ .tag = @enumFromInt(51), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5274 | // __atomic_fetch_max | |
| 5275 | .{ .tag = @enumFromInt(52), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5276 | // __atomic_fetch_min | |
| 5277 | .{ .tag = @enumFromInt(53), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5278 | // __atomic_fetch_nand | |
| 5279 | .{ .tag = @enumFromInt(54), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5280 | // __atomic_fetch_or | |
| 5281 | .{ .tag = @enumFromInt(55), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5282 | // __atomic_fetch_sub | |
| 5283 | .{ .tag = @enumFromInt(56), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5284 | // __atomic_fetch_xor | |
| 5285 | .{ .tag = @enumFromInt(57), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5286 | // __atomic_is_lock_free | |
| 5287 | .{ .tag = @enumFromInt(58), .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, | |
| 5288 | // __atomic_load | |
| 5289 | .{ .tag = @enumFromInt(59), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5290 | // __atomic_load_n | |
| 5291 | .{ .tag = @enumFromInt(60), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5292 | // __atomic_max_fetch | |
| 5293 | .{ .tag = @enumFromInt(61), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5294 | // __atomic_min_fetch | |
| 5295 | .{ .tag = @enumFromInt(62), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5296 | // __atomic_nand_fetch | |
| 5297 | .{ .tag = @enumFromInt(63), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5298 | // __atomic_or_fetch | |
| 5299 | .{ .tag = @enumFromInt(64), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5300 | // __atomic_signal_fence | |
| 5301 | .{ .tag = @enumFromInt(65), .properties = .{ .param_str = "vi" } }, | |
| 5302 | // __atomic_store | |
| 5303 | .{ .tag = @enumFromInt(66), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5304 | // __atomic_store_n | |
| 5305 | .{ .tag = @enumFromInt(67), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5306 | // __atomic_sub_fetch | |
| 5307 | .{ .tag = @enumFromInt(68), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5308 | // __atomic_test_and_set | |
| 5309 | .{ .tag = @enumFromInt(69), .properties = .{ .param_str = "bvD*i" } }, | |
| 5310 | // __atomic_thread_fence | |
| 5311 | .{ .tag = @enumFromInt(70), .properties = .{ .param_str = "vi" } }, | |
| 5312 | // __atomic_xor_fetch | |
| 5313 | .{ .tag = @enumFromInt(71), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5314 | // __builtin___CFStringMakeConstantString | |
| 5315 | .{ .tag = @enumFromInt(72), .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5316 | // __builtin___NSStringMakeConstantString | |
| 5317 | .{ .tag = @enumFromInt(73), .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5318 | // __builtin___clear_cache | |
| 5319 | .{ .tag = @enumFromInt(74), .properties = .{ .param_str = "vc*c*" } }, | |
| 5320 | // __builtin___fprintf_chk | |
| 5321 | .{ .tag = @enumFromInt(75), .properties = .{ .param_str = "iP*RicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, | |
| 5322 | // __builtin___get_unsafe_stack_bottom | |
| 5323 | .{ .tag = @enumFromInt(76), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5324 | // __builtin___get_unsafe_stack_ptr | |
| 5325 | .{ .tag = @enumFromInt(77), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5326 | // __builtin___get_unsafe_stack_start | |
| 5327 | .{ .tag = @enumFromInt(78), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5328 | // __builtin___get_unsafe_stack_top | |
| 5329 | .{ .tag = @enumFromInt(79), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5330 | // __builtin___memccpy_chk | |
| 5331 | .{ .tag = @enumFromInt(80), .properties = .{ .param_str = "v*v*vC*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5332 | // __builtin___memcpy_chk | |
| 5333 | .{ .tag = @enumFromInt(81), .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5334 | // __builtin___memmove_chk | |
| 5335 | .{ .tag = @enumFromInt(82), .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5336 | // __builtin___mempcpy_chk | |
| 5337 | .{ .tag = @enumFromInt(83), .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5338 | // __builtin___memset_chk | |
| 5339 | .{ .tag = @enumFromInt(84), .properties = .{ .param_str = "v*v*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5340 | // __builtin___printf_chk | |
| 5341 | .{ .tag = @enumFromInt(85), .properties = .{ .param_str = "iicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 5342 | // __builtin___snprintf_chk | |
| 5343 | .{ .tag = @enumFromInt(86), .properties = .{ .param_str = "ic*RzizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 4 } } }, | |
| 5344 | // __builtin___sprintf_chk | |
| 5345 | .{ .tag = @enumFromInt(87), .properties = .{ .param_str = "ic*RizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 3 } } }, | |
| 5346 | // __builtin___stpcpy_chk | |
| 5347 | .{ .tag = @enumFromInt(88), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5348 | // __builtin___stpncpy_chk | |
| 5349 | .{ .tag = @enumFromInt(89), .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5350 | // __builtin___strcat_chk | |
| 5351 | .{ .tag = @enumFromInt(90), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5352 | // __builtin___strcpy_chk | |
| 5353 | .{ .tag = @enumFromInt(91), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5354 | // __builtin___strlcat_chk | |
| 5355 | .{ .tag = @enumFromInt(92), .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5356 | // __builtin___strlcpy_chk | |
| 5357 | .{ .tag = @enumFromInt(93), .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5358 | // __builtin___strncat_chk | |
| 5359 | .{ .tag = @enumFromInt(94), .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5360 | // __builtin___strncpy_chk | |
| 5361 | .{ .tag = @enumFromInt(95), .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5362 | // __builtin___vfprintf_chk | |
| 5363 | .{ .tag = @enumFromInt(96), .properties = .{ .param_str = "iP*RicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, | |
| 5364 | // __builtin___vprintf_chk | |
| 5365 | .{ .tag = @enumFromInt(97), .properties = .{ .param_str = "iicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 5366 | // __builtin___vsnprintf_chk | |
| 5367 | .{ .tag = @enumFromInt(98), .properties = .{ .param_str = "ic*RzizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 4 } } }, | |
| 5368 | // __builtin___vsprintf_chk | |
| 5369 | .{ .tag = @enumFromInt(99), .properties = .{ .param_str = "ic*RizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 3 } } }, | |
| 5370 | // __builtin_abort | |
| 5371 | .{ .tag = @enumFromInt(100), .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true, .lib_function_with_builtin_prefix = true } } }, | |
| 5372 | // __builtin_abs | |
| 5373 | .{ .tag = @enumFromInt(101), .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 5374 | // __builtin_acos | |
| 5375 | .{ .tag = @enumFromInt(102), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5376 | // __builtin_acosf | |
| 5377 | .{ .tag = @enumFromInt(103), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5378 | // __builtin_acosf128 | |
| 5379 | .{ .tag = @enumFromInt(104), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5380 | // __builtin_acosh | |
| 5381 | .{ .tag = @enumFromInt(105), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5382 | // __builtin_acoshf | |
| 5383 | .{ .tag = @enumFromInt(106), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5384 | // __builtin_acoshf128 | |
| 5385 | .{ .tag = @enumFromInt(107), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5386 | // __builtin_acoshl | |
| 5387 | .{ .tag = @enumFromInt(108), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5388 | // __builtin_acosl | |
| 5389 | .{ .tag = @enumFromInt(109), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5390 | // __builtin_add_overflow | |
| 5391 | .{ .tag = @enumFromInt(110), .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 5392 | // __builtin_addc | |
| 5393 | .{ .tag = @enumFromInt(111), .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, | |
| 5394 | // __builtin_addcb | |
| 5395 | .{ .tag = @enumFromInt(112), .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, | |
| 5396 | // __builtin_addcl | |
| 5397 | .{ .tag = @enumFromInt(113), .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, | |
| 5398 | // __builtin_addcll | |
| 5399 | .{ .tag = @enumFromInt(114), .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, | |
| 5400 | // __builtin_addcs | |
| 5401 | .{ .tag = @enumFromInt(115), .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, | |
| 5402 | // __builtin_align_down | |
| 5403 | .{ .tag = @enumFromInt(116), .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 5404 | // __builtin_align_up | |
| 5405 | .{ .tag = @enumFromInt(117), .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 5406 | // __builtin_alloca | |
| 5407 | .{ .tag = @enumFromInt(118), .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5408 | // __builtin_alloca_uninitialized | |
| 5409 | .{ .tag = @enumFromInt(119), .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5410 | // __builtin_alloca_with_align | |
| 5411 | .{ .tag = @enumFromInt(120), .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5412 | // __builtin_alloca_with_align_uninitialized | |
| 5413 | .{ .tag = @enumFromInt(121), .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5414 | // __builtin_amdgcn_alignbit | |
| 5415 | .{ .tag = @enumFromInt(122), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5416 | // __builtin_amdgcn_alignbyte | |
| 5417 | .{ .tag = @enumFromInt(123), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5418 | // __builtin_amdgcn_atomic_dec32 | |
| 5419 | .{ .tag = @enumFromInt(124), .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5420 | // __builtin_amdgcn_atomic_dec64 | |
| 5421 | .{ .tag = @enumFromInt(125), .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5422 | // __builtin_amdgcn_atomic_inc32 | |
| 5423 | .{ .tag = @enumFromInt(126), .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5424 | // __builtin_amdgcn_atomic_inc64 | |
| 5425 | .{ .tag = @enumFromInt(127), .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5426 | // __builtin_amdgcn_buffer_wbinvl1 | |
| 5427 | .{ .tag = @enumFromInt(128), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5428 | // __builtin_amdgcn_class | |
| 5429 | .{ .tag = @enumFromInt(129), .properties = .{ .param_str = "bdi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5430 | // __builtin_amdgcn_classf | |
| 5431 | .{ .tag = @enumFromInt(130), .properties = .{ .param_str = "bfi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5432 | // __builtin_amdgcn_cosf | |
| 5433 | .{ .tag = @enumFromInt(131), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5434 | // __builtin_amdgcn_cubeid | |
| 5435 | .{ .tag = @enumFromInt(132), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5436 | // __builtin_amdgcn_cubema | |
| 5437 | .{ .tag = @enumFromInt(133), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5438 | // __builtin_amdgcn_cubesc | |
| 5439 | .{ .tag = @enumFromInt(134), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5440 | // __builtin_amdgcn_cubetc | |
| 5441 | .{ .tag = @enumFromInt(135), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5442 | // __builtin_amdgcn_cvt_pk_i16 | |
| 5443 | .{ .tag = @enumFromInt(136), .properties = .{ .param_str = "E2sii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5444 | // __builtin_amdgcn_cvt_pk_u16 | |
| 5445 | .{ .tag = @enumFromInt(137), .properties = .{ .param_str = "E2UsUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5446 | // __builtin_amdgcn_cvt_pk_u8_f32 | |
| 5447 | .{ .tag = @enumFromInt(138), .properties = .{ .param_str = "UifUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5448 | // __builtin_amdgcn_cvt_pknorm_i16 | |
| 5449 | .{ .tag = @enumFromInt(139), .properties = .{ .param_str = "E2sff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5450 | // __builtin_amdgcn_cvt_pknorm_u16 | |
| 5451 | .{ .tag = @enumFromInt(140), .properties = .{ .param_str = "E2Usff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5452 | // __builtin_amdgcn_cvt_pkrtz | |
| 5453 | .{ .tag = @enumFromInt(141), .properties = .{ .param_str = "E2hff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5454 | // __builtin_amdgcn_dispatch_ptr | |
| 5455 | .{ .tag = @enumFromInt(142), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5456 | // __builtin_amdgcn_div_fixup | |
| 5457 | .{ .tag = @enumFromInt(143), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5458 | // __builtin_amdgcn_div_fixupf | |
| 5459 | .{ .tag = @enumFromInt(144), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5460 | // __builtin_amdgcn_div_fmas | |
| 5461 | .{ .tag = @enumFromInt(145), .properties = .{ .param_str = "ddddb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5462 | // __builtin_amdgcn_div_fmasf | |
| 5463 | .{ .tag = @enumFromInt(146), .properties = .{ .param_str = "ffffb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5464 | // __builtin_amdgcn_div_scale | |
| 5465 | .{ .tag = @enumFromInt(147), .properties = .{ .param_str = "dddbb*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5466 | // __builtin_amdgcn_div_scalef | |
| 5467 | .{ .tag = @enumFromInt(148), .properties = .{ .param_str = "fffbb*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5468 | // __builtin_amdgcn_ds_append | |
| 5469 | .{ .tag = @enumFromInt(149), .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5470 | // __builtin_amdgcn_ds_bpermute | |
| 5471 | .{ .tag = @enumFromInt(150), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5472 | // __builtin_amdgcn_ds_consume | |
| 5473 | .{ .tag = @enumFromInt(151), .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5474 | // __builtin_amdgcn_ds_faddf | |
| 5475 | .{ .tag = @enumFromInt(152), .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5476 | // __builtin_amdgcn_ds_fmaxf | |
| 5477 | .{ .tag = @enumFromInt(153), .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5478 | // __builtin_amdgcn_ds_fminf | |
| 5479 | .{ .tag = @enumFromInt(154), .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5480 | // __builtin_amdgcn_ds_permute | |
| 5481 | .{ .tag = @enumFromInt(155), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5482 | // __builtin_amdgcn_ds_swizzle | |
| 5483 | .{ .tag = @enumFromInt(156), .properties = .{ .param_str = "iiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5484 | // __builtin_amdgcn_endpgm | |
| 5485 | .{ .tag = @enumFromInt(157), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .noreturn = true } } }, | |
| 5486 | // __builtin_amdgcn_exp2f | |
| 5487 | .{ .tag = @enumFromInt(158), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5488 | // __builtin_amdgcn_fcmp | |
| 5489 | .{ .tag = @enumFromInt(159), .properties = .{ .param_str = "WUiddIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5490 | // __builtin_amdgcn_fcmpf | |
| 5491 | .{ .tag = @enumFromInt(160), .properties = .{ .param_str = "WUiffIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5492 | // __builtin_amdgcn_fence | |
| 5493 | .{ .tag = @enumFromInt(161), .properties = .{ .param_str = "vUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5494 | // __builtin_amdgcn_fmed3f | |
| 5495 | .{ .tag = @enumFromInt(162), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5496 | // __builtin_amdgcn_fract | |
| 5497 | .{ .tag = @enumFromInt(163), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5498 | // __builtin_amdgcn_fractf | |
| 5499 | .{ .tag = @enumFromInt(164), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5500 | // __builtin_amdgcn_frexp_exp | |
| 5501 | .{ .tag = @enumFromInt(165), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5502 | // __builtin_amdgcn_frexp_expf | |
| 5503 | .{ .tag = @enumFromInt(166), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5504 | // __builtin_amdgcn_frexp_mant | |
| 5505 | .{ .tag = @enumFromInt(167), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5506 | // __builtin_amdgcn_frexp_mantf | |
| 5507 | .{ .tag = @enumFromInt(168), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5508 | // __builtin_amdgcn_grid_size_x | |
| 5509 | .{ .tag = @enumFromInt(169), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5510 | // __builtin_amdgcn_grid_size_y | |
| 5511 | .{ .tag = @enumFromInt(170), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5512 | // __builtin_amdgcn_grid_size_z | |
| 5513 | .{ .tag = @enumFromInt(171), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5514 | // __builtin_amdgcn_groupstaticsize | |
| 5515 | .{ .tag = @enumFromInt(172), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5516 | // __builtin_amdgcn_iglp_opt | |
| 5517 | .{ .tag = @enumFromInt(173), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5518 | // __builtin_amdgcn_implicitarg_ptr | |
| 5519 | .{ .tag = @enumFromInt(174), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5520 | // __builtin_amdgcn_interp_mov | |
| 5521 | .{ .tag = @enumFromInt(175), .properties = .{ .param_str = "fUiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5522 | // __builtin_amdgcn_interp_p1 | |
| 5523 | .{ .tag = @enumFromInt(176), .properties = .{ .param_str = "ffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5524 | // __builtin_amdgcn_interp_p1_f16 | |
| 5525 | .{ .tag = @enumFromInt(177), .properties = .{ .param_str = "ffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5526 | // __builtin_amdgcn_interp_p2 | |
| 5527 | .{ .tag = @enumFromInt(178), .properties = .{ .param_str = "fffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5528 | // __builtin_amdgcn_interp_p2_f16 | |
| 5529 | .{ .tag = @enumFromInt(179), .properties = .{ .param_str = "hffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5530 | // __builtin_amdgcn_is_private | |
| 5531 | .{ .tag = @enumFromInt(180), .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5532 | // __builtin_amdgcn_is_shared | |
| 5533 | .{ .tag = @enumFromInt(181), .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5534 | // __builtin_amdgcn_kernarg_segment_ptr | |
| 5535 | .{ .tag = @enumFromInt(182), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5536 | // __builtin_amdgcn_ldexp | |
| 5537 | .{ .tag = @enumFromInt(183), .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5538 | // __builtin_amdgcn_ldexpf | |
| 5539 | .{ .tag = @enumFromInt(184), .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5540 | // __builtin_amdgcn_lerp | |
| 5541 | .{ .tag = @enumFromInt(185), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5542 | // __builtin_amdgcn_log_clampf | |
| 5543 | .{ .tag = @enumFromInt(186), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5544 | // __builtin_amdgcn_logf | |
| 5545 | .{ .tag = @enumFromInt(187), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5546 | // __builtin_amdgcn_mbcnt_hi | |
| 5547 | .{ .tag = @enumFromInt(188), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5548 | // __builtin_amdgcn_mbcnt_lo | |
| 5549 | .{ .tag = @enumFromInt(189), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5550 | // __builtin_amdgcn_mqsad_pk_u16_u8 | |
| 5551 | .{ .tag = @enumFromInt(190), .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5552 | // __builtin_amdgcn_mqsad_u32_u8 | |
| 5553 | .{ .tag = @enumFromInt(191), .properties = .{ .param_str = "V4UiWUiUiV4Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5554 | // __builtin_amdgcn_msad_u8 | |
| 5555 | .{ .tag = @enumFromInt(192), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5556 | // __builtin_amdgcn_qsad_pk_u16_u8 | |
| 5557 | .{ .tag = @enumFromInt(193), .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5558 | // __builtin_amdgcn_queue_ptr | |
| 5559 | .{ .tag = @enumFromInt(194), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5560 | // __builtin_amdgcn_rcp | |
| 5561 | .{ .tag = @enumFromInt(195), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5562 | // __builtin_amdgcn_rcpf | |
| 5563 | .{ .tag = @enumFromInt(196), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5564 | // __builtin_amdgcn_read_exec | |
| 5565 | .{ .tag = @enumFromInt(197), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5566 | // __builtin_amdgcn_read_exec_hi | |
| 5567 | .{ .tag = @enumFromInt(198), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5568 | // __builtin_amdgcn_read_exec_lo | |
| 5569 | .{ .tag = @enumFromInt(199), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5570 | // __builtin_amdgcn_readfirstlane | |
| 5571 | .{ .tag = @enumFromInt(200), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5572 | // __builtin_amdgcn_readlane | |
| 5573 | .{ .tag = @enumFromInt(201), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5574 | // __builtin_amdgcn_rsq | |
| 5575 | .{ .tag = @enumFromInt(202), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5576 | // __builtin_amdgcn_rsq_clamp | |
| 5577 | .{ .tag = @enumFromInt(203), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5578 | // __builtin_amdgcn_rsq_clampf | |
| 5579 | .{ .tag = @enumFromInt(204), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5580 | // __builtin_amdgcn_rsqf | |
| 5581 | .{ .tag = @enumFromInt(205), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5582 | // __builtin_amdgcn_s_barrier | |
| 5583 | .{ .tag = @enumFromInt(206), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5584 | // __builtin_amdgcn_s_dcache_inv | |
| 5585 | .{ .tag = @enumFromInt(207), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5586 | // __builtin_amdgcn_s_decperflevel | |
| 5587 | .{ .tag = @enumFromInt(208), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5588 | // __builtin_amdgcn_s_getpc | |
| 5589 | .{ .tag = @enumFromInt(209), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5590 | // __builtin_amdgcn_s_getreg | |
| 5591 | .{ .tag = @enumFromInt(210), .properties = .{ .param_str = "UiIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5592 | // __builtin_amdgcn_s_incperflevel | |
| 5593 | .{ .tag = @enumFromInt(211), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5594 | // __builtin_amdgcn_s_sendmsg | |
| 5595 | .{ .tag = @enumFromInt(212), .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5596 | // __builtin_amdgcn_s_sendmsghalt | |
| 5597 | .{ .tag = @enumFromInt(213), .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5598 | // __builtin_amdgcn_s_setprio | |
| 5599 | .{ .tag = @enumFromInt(214), .properties = .{ .param_str = "vIs", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5600 | // __builtin_amdgcn_s_setreg | |
| 5601 | .{ .tag = @enumFromInt(215), .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5602 | // __builtin_amdgcn_s_sleep | |
| 5603 | .{ .tag = @enumFromInt(216), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5604 | // __builtin_amdgcn_s_waitcnt | |
| 5605 | .{ .tag = @enumFromInt(217), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5606 | // __builtin_amdgcn_sad_hi_u8 | |
| 5607 | .{ .tag = @enumFromInt(218), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5608 | // __builtin_amdgcn_sad_u16 | |
| 5609 | .{ .tag = @enumFromInt(219), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5610 | // __builtin_amdgcn_sad_u8 | |
| 5611 | .{ .tag = @enumFromInt(220), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5612 | // __builtin_amdgcn_sbfe | |
| 5613 | .{ .tag = @enumFromInt(221), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5614 | // __builtin_amdgcn_sched_barrier | |
| 5615 | .{ .tag = @enumFromInt(222), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5616 | // __builtin_amdgcn_sched_group_barrier | |
| 5617 | .{ .tag = @enumFromInt(223), .properties = .{ .param_str = "vIiIiIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5618 | // __builtin_amdgcn_sicmp | |
| 5619 | .{ .tag = @enumFromInt(224), .properties = .{ .param_str = "WUiiiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5620 | // __builtin_amdgcn_sicmpl | |
| 5621 | .{ .tag = @enumFromInt(225), .properties = .{ .param_str = "WUiWiWiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5622 | // __builtin_amdgcn_sinf | |
| 5623 | .{ .tag = @enumFromInt(226), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5624 | // __builtin_amdgcn_sqrt | |
| 5625 | .{ .tag = @enumFromInt(227), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5626 | // __builtin_amdgcn_sqrtf | |
| 5627 | .{ .tag = @enumFromInt(228), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5628 | // __builtin_amdgcn_trig_preop | |
| 5629 | .{ .tag = @enumFromInt(229), .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5630 | // __builtin_amdgcn_trig_preopf | |
| 5631 | .{ .tag = @enumFromInt(230), .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5632 | // __builtin_amdgcn_ubfe | |
| 5633 | .{ .tag = @enumFromInt(231), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5634 | // __builtin_amdgcn_uicmp | |
| 5635 | .{ .tag = @enumFromInt(232), .properties = .{ .param_str = "WUiUiUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5636 | // __builtin_amdgcn_uicmpl | |
| 5637 | .{ .tag = @enumFromInt(233), .properties = .{ .param_str = "WUiWUiWUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5638 | // __builtin_amdgcn_wave_barrier | |
| 5639 | .{ .tag = @enumFromInt(234), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 5640 | // __builtin_amdgcn_workgroup_id_x | |
| 5641 | .{ .tag = @enumFromInt(235), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5642 | // __builtin_amdgcn_workgroup_id_y | |
| 5643 | .{ .tag = @enumFromInt(236), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5644 | // __builtin_amdgcn_workgroup_id_z | |
| 5645 | .{ .tag = @enumFromInt(237), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5646 | // __builtin_amdgcn_workgroup_size_x | |
| 5647 | .{ .tag = @enumFromInt(238), .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5648 | // __builtin_amdgcn_workgroup_size_y | |
| 5649 | .{ .tag = @enumFromInt(239), .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5650 | // __builtin_amdgcn_workgroup_size_z | |
| 5651 | .{ .tag = @enumFromInt(240), .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5652 | // __builtin_amdgcn_workitem_id_x | |
| 5653 | .{ .tag = @enumFromInt(241), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5654 | // __builtin_amdgcn_workitem_id_y | |
| 5655 | .{ .tag = @enumFromInt(242), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5656 | // __builtin_amdgcn_workitem_id_z | |
| 5657 | .{ .tag = @enumFromInt(243), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 5658 | // __builtin_annotation | |
| 5659 | .{ .tag = @enumFromInt(244), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 5660 | // __builtin_arm_cdp | |
| 5661 | .{ .tag = @enumFromInt(245), .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5662 | // __builtin_arm_cdp2 | |
| 5663 | .{ .tag = @enumFromInt(246), .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5664 | // __builtin_arm_clrex | |
| 5665 | .{ .tag = @enumFromInt(247), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5666 | // __builtin_arm_cls | |
| 5667 | .{ .tag = @enumFromInt(248), .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5668 | // __builtin_arm_cls64 | |
| 5669 | .{ .tag = @enumFromInt(249), .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5670 | // __builtin_arm_clz | |
| 5671 | .{ .tag = @enumFromInt(250), .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5672 | // __builtin_arm_clz64 | |
| 5673 | .{ .tag = @enumFromInt(251), .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5674 | // __builtin_arm_cmse_TT | |
| 5675 | .{ .tag = @enumFromInt(252), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5676 | // __builtin_arm_cmse_TTA | |
| 5677 | .{ .tag = @enumFromInt(253), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5678 | // __builtin_arm_cmse_TTAT | |
| 5679 | .{ .tag = @enumFromInt(254), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5680 | // __builtin_arm_cmse_TTT | |
| 5681 | .{ .tag = @enumFromInt(255), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5682 | // __builtin_arm_dbg | |
| 5683 | .{ .tag = @enumFromInt(256), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5684 | // __builtin_arm_dmb | |
| 5685 | .{ .tag = @enumFromInt(257), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5686 | // __builtin_arm_dsb | |
| 5687 | .{ .tag = @enumFromInt(258), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5688 | // __builtin_arm_get_fpscr | |
| 5689 | .{ .tag = @enumFromInt(259), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5690 | // __builtin_arm_isb | |
| 5691 | .{ .tag = @enumFromInt(260), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5692 | // __builtin_arm_ldaex | |
| 5693 | .{ .tag = @enumFromInt(261), .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 5694 | // __builtin_arm_ldc | |
| 5695 | .{ .tag = @enumFromInt(262), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5696 | // __builtin_arm_ldc2 | |
| 5697 | .{ .tag = @enumFromInt(263), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5698 | // __builtin_arm_ldc2l | |
| 5699 | .{ .tag = @enumFromInt(264), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5700 | // __builtin_arm_ldcl | |
| 5701 | .{ .tag = @enumFromInt(265), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5702 | // __builtin_arm_ldrex | |
| 5703 | .{ .tag = @enumFromInt(266), .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 5704 | // __builtin_arm_ldrexd | |
| 5705 | .{ .tag = @enumFromInt(267), .properties = .{ .param_str = "LLUiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5706 | // __builtin_arm_mcr | |
| 5707 | .{ .tag = @enumFromInt(268), .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5708 | // __builtin_arm_mcr2 | |
| 5709 | .{ .tag = @enumFromInt(269), .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5710 | // __builtin_arm_mcrr | |
| 5711 | .{ .tag = @enumFromInt(270), .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5712 | // __builtin_arm_mcrr2 | |
| 5713 | .{ .tag = @enumFromInt(271), .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5714 | // __builtin_arm_mrc | |
| 5715 | .{ .tag = @enumFromInt(272), .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5716 | // __builtin_arm_mrc2 | |
| 5717 | .{ .tag = @enumFromInt(273), .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5718 | // __builtin_arm_mrrc | |
| 5719 | .{ .tag = @enumFromInt(274), .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5720 | // __builtin_arm_mrrc2 | |
| 5721 | .{ .tag = @enumFromInt(275), .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 5722 | // __builtin_arm_nop | |
| 5723 | .{ .tag = @enumFromInt(276), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5724 | // __builtin_arm_prefetch | |
| 5725 | .{ .tag = @enumFromInt(277), .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5726 | // __builtin_arm_qadd | |
| 5727 | .{ .tag = @enumFromInt(278), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5728 | // __builtin_arm_qadd16 | |
| 5729 | .{ .tag = @enumFromInt(279), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5730 | // __builtin_arm_qadd8 | |
| 5731 | .{ .tag = @enumFromInt(280), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5732 | // __builtin_arm_qasx | |
| 5733 | .{ .tag = @enumFromInt(281), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5734 | // __builtin_arm_qdbl | |
| 5735 | .{ .tag = @enumFromInt(282), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5736 | // __builtin_arm_qsax | |
| 5737 | .{ .tag = @enumFromInt(283), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5738 | // __builtin_arm_qsub | |
| 5739 | .{ .tag = @enumFromInt(284), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5740 | // __builtin_arm_qsub16 | |
| 5741 | .{ .tag = @enumFromInt(285), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5742 | // __builtin_arm_qsub8 | |
| 5743 | .{ .tag = @enumFromInt(286), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5744 | // __builtin_arm_rbit | |
| 5745 | .{ .tag = @enumFromInt(287), .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5746 | // __builtin_arm_rbit64 | |
| 5747 | .{ .tag = @enumFromInt(288), .properties = .{ .param_str = "WUiWUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, | |
| 5748 | // __builtin_arm_rsr | |
| 5749 | .{ .tag = @enumFromInt(289), .properties = .{ .param_str = "UicC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5750 | // __builtin_arm_rsr64 | |
| 5751 | .{ .tag = @enumFromInt(290), .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5752 | // __builtin_arm_rsrp | |
| 5753 | .{ .tag = @enumFromInt(291), .properties = .{ .param_str = "v*cC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5754 | // __builtin_arm_sadd16 | |
| 5755 | .{ .tag = @enumFromInt(292), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5756 | // __builtin_arm_sadd8 | |
| 5757 | .{ .tag = @enumFromInt(293), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5758 | // __builtin_arm_sasx | |
| 5759 | .{ .tag = @enumFromInt(294), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5760 | // __builtin_arm_sel | |
| 5761 | .{ .tag = @enumFromInt(295), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5762 | // __builtin_arm_set_fpscr | |
| 5763 | .{ .tag = @enumFromInt(296), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5764 | // __builtin_arm_sev | |
| 5765 | .{ .tag = @enumFromInt(297), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5766 | // __builtin_arm_sevl | |
| 5767 | .{ .tag = @enumFromInt(298), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5768 | // __builtin_arm_shadd16 | |
| 5769 | .{ .tag = @enumFromInt(299), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5770 | // __builtin_arm_shadd8 | |
| 5771 | .{ .tag = @enumFromInt(300), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5772 | // __builtin_arm_shasx | |
| 5773 | .{ .tag = @enumFromInt(301), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5774 | // __builtin_arm_shsax | |
| 5775 | .{ .tag = @enumFromInt(302), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5776 | // __builtin_arm_shsub16 | |
| 5777 | .{ .tag = @enumFromInt(303), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5778 | // __builtin_arm_shsub8 | |
| 5779 | .{ .tag = @enumFromInt(304), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5780 | // __builtin_arm_smlabb | |
| 5781 | .{ .tag = @enumFromInt(305), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5782 | // __builtin_arm_smlabt | |
| 5783 | .{ .tag = @enumFromInt(306), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5784 | // __builtin_arm_smlad | |
| 5785 | .{ .tag = @enumFromInt(307), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5786 | // __builtin_arm_smladx | |
| 5787 | .{ .tag = @enumFromInt(308), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5788 | // __builtin_arm_smlald | |
| 5789 | .{ .tag = @enumFromInt(309), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5790 | // __builtin_arm_smlaldx | |
| 5791 | .{ .tag = @enumFromInt(310), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5792 | // __builtin_arm_smlatb | |
| 5793 | .{ .tag = @enumFromInt(311), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5794 | // __builtin_arm_smlatt | |
| 5795 | .{ .tag = @enumFromInt(312), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5796 | // __builtin_arm_smlawb | |
| 5797 | .{ .tag = @enumFromInt(313), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5798 | // __builtin_arm_smlawt | |
| 5799 | .{ .tag = @enumFromInt(314), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5800 | // __builtin_arm_smlsd | |
| 5801 | .{ .tag = @enumFromInt(315), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5802 | // __builtin_arm_smlsdx | |
| 5803 | .{ .tag = @enumFromInt(316), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5804 | // __builtin_arm_smlsld | |
| 5805 | .{ .tag = @enumFromInt(317), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5806 | // __builtin_arm_smlsldx | |
| 5807 | .{ .tag = @enumFromInt(318), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5808 | // __builtin_arm_smuad | |
| 5809 | .{ .tag = @enumFromInt(319), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5810 | // __builtin_arm_smuadx | |
| 5811 | .{ .tag = @enumFromInt(320), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5812 | // __builtin_arm_smulbb | |
| 5813 | .{ .tag = @enumFromInt(321), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5814 | // __builtin_arm_smulbt | |
| 5815 | .{ .tag = @enumFromInt(322), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5816 | // __builtin_arm_smultb | |
| 5817 | .{ .tag = @enumFromInt(323), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5818 | // __builtin_arm_smultt | |
| 5819 | .{ .tag = @enumFromInt(324), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5820 | // __builtin_arm_smulwb | |
| 5821 | .{ .tag = @enumFromInt(325), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5822 | // __builtin_arm_smulwt | |
| 5823 | .{ .tag = @enumFromInt(326), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5824 | // __builtin_arm_smusd | |
| 5825 | .{ .tag = @enumFromInt(327), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5826 | // __builtin_arm_smusdx | |
| 5827 | .{ .tag = @enumFromInt(328), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5828 | // __builtin_arm_ssat | |
| 5829 | .{ .tag = @enumFromInt(329), .properties = .{ .param_str = "iiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5830 | // __builtin_arm_ssat16 | |
| 5831 | .{ .tag = @enumFromInt(330), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5832 | // __builtin_arm_ssax | |
| 5833 | .{ .tag = @enumFromInt(331), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5834 | // __builtin_arm_ssub16 | |
| 5835 | .{ .tag = @enumFromInt(332), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5836 | // __builtin_arm_ssub8 | |
| 5837 | .{ .tag = @enumFromInt(333), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5838 | // __builtin_arm_stc | |
| 5839 | .{ .tag = @enumFromInt(334), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5840 | // __builtin_arm_stc2 | |
| 5841 | .{ .tag = @enumFromInt(335), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5842 | // __builtin_arm_stc2l | |
| 5843 | .{ .tag = @enumFromInt(336), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5844 | // __builtin_arm_stcl | |
| 5845 | .{ .tag = @enumFromInt(337), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5846 | // __builtin_arm_stlex | |
| 5847 | .{ .tag = @enumFromInt(338), .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 5848 | // __builtin_arm_strex | |
| 5849 | .{ .tag = @enumFromInt(339), .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 5850 | // __builtin_arm_strexd | |
| 5851 | .{ .tag = @enumFromInt(340), .properties = .{ .param_str = "iLLUiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 5852 | // __builtin_arm_sxtab16 | |
| 5853 | .{ .tag = @enumFromInt(341), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5854 | // __builtin_arm_sxtb16 | |
| 5855 | .{ .tag = @enumFromInt(342), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5856 | // __builtin_arm_tcancel | |
| 5857 | .{ .tag = @enumFromInt(343), .properties = .{ .param_str = "vWUIi", .target_set = TargetSet.initOne(.aarch64) } }, | |
| 5858 | // __builtin_arm_tcommit | |
| 5859 | .{ .tag = @enumFromInt(344), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.aarch64) } }, | |
| 5860 | // __builtin_arm_tstart | |
| 5861 | .{ .tag = @enumFromInt(345), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .returns_twice = true } } }, | |
| 5862 | // __builtin_arm_ttest | |
| 5863 | .{ .tag = @enumFromInt(346), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, | |
| 5864 | // __builtin_arm_uadd16 | |
| 5865 | .{ .tag = @enumFromInt(347), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5866 | // __builtin_arm_uadd8 | |
| 5867 | .{ .tag = @enumFromInt(348), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5868 | // __builtin_arm_uasx | |
| 5869 | .{ .tag = @enumFromInt(349), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5870 | // __builtin_arm_uhadd16 | |
| 5871 | .{ .tag = @enumFromInt(350), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5872 | // __builtin_arm_uhadd8 | |
| 5873 | .{ .tag = @enumFromInt(351), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5874 | // __builtin_arm_uhasx | |
| 5875 | .{ .tag = @enumFromInt(352), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5876 | // __builtin_arm_uhsax | |
| 5877 | .{ .tag = @enumFromInt(353), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5878 | // __builtin_arm_uhsub16 | |
| 5879 | .{ .tag = @enumFromInt(354), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5880 | // __builtin_arm_uhsub8 | |
| 5881 | .{ .tag = @enumFromInt(355), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5882 | // __builtin_arm_uqadd16 | |
| 5883 | .{ .tag = @enumFromInt(356), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5884 | // __builtin_arm_uqadd8 | |
| 5885 | .{ .tag = @enumFromInt(357), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5886 | // __builtin_arm_uqasx | |
| 5887 | .{ .tag = @enumFromInt(358), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5888 | // __builtin_arm_uqsax | |
| 5889 | .{ .tag = @enumFromInt(359), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5890 | // __builtin_arm_uqsub16 | |
| 5891 | .{ .tag = @enumFromInt(360), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5892 | // __builtin_arm_uqsub8 | |
| 5893 | .{ .tag = @enumFromInt(361), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5894 | // __builtin_arm_usad8 | |
| 5895 | .{ .tag = @enumFromInt(362), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5896 | // __builtin_arm_usada8 | |
| 5897 | .{ .tag = @enumFromInt(363), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5898 | // __builtin_arm_usat | |
| 5899 | .{ .tag = @enumFromInt(364), .properties = .{ .param_str = "UiiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5900 | // __builtin_arm_usat16 | |
| 5901 | .{ .tag = @enumFromInt(365), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5902 | // __builtin_arm_usax | |
| 5903 | .{ .tag = @enumFromInt(366), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5904 | // __builtin_arm_usub16 | |
| 5905 | .{ .tag = @enumFromInt(367), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5906 | // __builtin_arm_usub8 | |
| 5907 | .{ .tag = @enumFromInt(368), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5908 | // __builtin_arm_uxtab16 | |
| 5909 | .{ .tag = @enumFromInt(369), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5910 | // __builtin_arm_uxtb16 | |
| 5911 | .{ .tag = @enumFromInt(370), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5912 | // __builtin_arm_vcvtr_d | |
| 5913 | .{ .tag = @enumFromInt(371), .properties = .{ .param_str = "fdi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5914 | // __builtin_arm_vcvtr_f | |
| 5915 | .{ .tag = @enumFromInt(372), .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 5916 | // __builtin_arm_wfe | |
| 5917 | .{ .tag = @enumFromInt(373), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5918 | // __builtin_arm_wfi | |
| 5919 | .{ .tag = @enumFromInt(374), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5920 | // __builtin_arm_wsr | |
| 5921 | .{ .tag = @enumFromInt(375), .properties = .{ .param_str = "vcC*Ui", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5922 | // __builtin_arm_wsr64 | |
| 5923 | .{ .tag = @enumFromInt(376), .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5924 | // __builtin_arm_wsrp | |
| 5925 | .{ .tag = @enumFromInt(377), .properties = .{ .param_str = "vcC*vC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 5926 | // __builtin_arm_yield | |
| 5927 | .{ .tag = @enumFromInt(378), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 5928 | // __builtin_asin | |
| 5929 | .{ .tag = @enumFromInt(379), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5930 | // __builtin_asinf | |
| 5931 | .{ .tag = @enumFromInt(380), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5932 | // __builtin_asinf128 | |
| 5933 | .{ .tag = @enumFromInt(381), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5934 | // __builtin_asinh | |
| 5935 | .{ .tag = @enumFromInt(382), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5936 | // __builtin_asinhf | |
| 5937 | .{ .tag = @enumFromInt(383), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5938 | // __builtin_asinhf128 | |
| 5939 | .{ .tag = @enumFromInt(384), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5940 | // __builtin_asinhl | |
| 5941 | .{ .tag = @enumFromInt(385), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5942 | // __builtin_asinl | |
| 5943 | .{ .tag = @enumFromInt(386), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5944 | // __builtin_assume | |
| 5945 | .{ .tag = @enumFromInt(387), .properties = .{ .param_str = "vb", .attributes = .{ .const_evaluable = true } } }, | |
| 5946 | // __builtin_assume_aligned | |
| 5947 | .{ .tag = @enumFromInt(388), .properties = .{ .param_str = "v*vC*z.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 5948 | // __builtin_assume_separate_storage | |
| 5949 | .{ .tag = @enumFromInt(389), .properties = .{ .param_str = "vvCD*vCD*", .attributes = .{ .const_evaluable = true } } }, | |
| 5950 | // __builtin_atan | |
| 5951 | .{ .tag = @enumFromInt(390), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5952 | // __builtin_atan2 | |
| 5953 | .{ .tag = @enumFromInt(391), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5954 | // __builtin_atan2f | |
| 5955 | .{ .tag = @enumFromInt(392), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5956 | // __builtin_atan2f128 | |
| 5957 | .{ .tag = @enumFromInt(393), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5958 | // __builtin_atan2l | |
| 5959 | .{ .tag = @enumFromInt(394), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5960 | // __builtin_atanf | |
| 5961 | .{ .tag = @enumFromInt(395), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5962 | // __builtin_atanf128 | |
| 5963 | .{ .tag = @enumFromInt(396), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5964 | // __builtin_atanh | |
| 5965 | .{ .tag = @enumFromInt(397), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5966 | // __builtin_atanhf | |
| 5967 | .{ .tag = @enumFromInt(398), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5968 | // __builtin_atanhf128 | |
| 5969 | .{ .tag = @enumFromInt(399), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5970 | // __builtin_atanhl | |
| 5971 | .{ .tag = @enumFromInt(400), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5972 | // __builtin_atanl | |
| 5973 | .{ .tag = @enumFromInt(401), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5974 | // __builtin_bcmp | |
| 5975 | .{ .tag = @enumFromInt(402), .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 5976 | // __builtin_bcopy | |
| 5977 | .{ .tag = @enumFromInt(403), .properties = .{ .param_str = "vvC*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5978 | // __builtin_bitrev | |
| 5979 | .{ .tag = @enumFromInt(404), .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, | |
| 5980 | // __builtin_bitreverse16 | |
| 5981 | .{ .tag = @enumFromInt(405), .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5982 | // __builtin_bitreverse32 | |
| 5983 | .{ .tag = @enumFromInt(406), .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5984 | // __builtin_bitreverse64 | |
| 5985 | .{ .tag = @enumFromInt(407), .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5986 | // __builtin_bitreverse8 | |
| 5987 | .{ .tag = @enumFromInt(408), .properties = .{ .param_str = "UcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5988 | // __builtin_bswap16 | |
| 5989 | .{ .tag = @enumFromInt(409), .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5990 | // __builtin_bswap32 | |
| 5991 | .{ .tag = @enumFromInt(410), .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5992 | // __builtin_bswap64 | |
| 5993 | .{ .tag = @enumFromInt(411), .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 5994 | // __builtin_bzero | |
| 5995 | .{ .tag = @enumFromInt(412), .properties = .{ .param_str = "vv*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 5996 | // __builtin_cabs | |
| 5997 | .{ .tag = @enumFromInt(413), .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 5998 | // __builtin_cabsf | |
| 5999 | .{ .tag = @enumFromInt(414), .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6000 | // __builtin_cabsl | |
| 6001 | .{ .tag = @enumFromInt(415), .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6002 | // __builtin_cacos | |
| 6003 | .{ .tag = @enumFromInt(416), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6004 | // __builtin_cacosf | |
| 6005 | .{ .tag = @enumFromInt(417), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6006 | // __builtin_cacosh | |
| 6007 | .{ .tag = @enumFromInt(418), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6008 | // __builtin_cacoshf | |
| 6009 | .{ .tag = @enumFromInt(419), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6010 | // __builtin_cacoshl | |
| 6011 | .{ .tag = @enumFromInt(420), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6012 | // __builtin_cacosl | |
| 6013 | .{ .tag = @enumFromInt(421), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6014 | // __builtin_call_with_static_chain | |
| 6015 | .{ .tag = @enumFromInt(422), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 6016 | // __builtin_calloc | |
| 6017 | .{ .tag = @enumFromInt(423), .properties = .{ .param_str = "v*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6018 | // __builtin_canonicalize | |
| 6019 | .{ .tag = @enumFromInt(424), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true } } }, | |
| 6020 | // __builtin_canonicalizef | |
| 6021 | .{ .tag = @enumFromInt(425), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true } } }, | |
| 6022 | // __builtin_canonicalizef16 | |
| 6023 | .{ .tag = @enumFromInt(426), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true } } }, | |
| 6024 | // __builtin_canonicalizel | |
| 6025 | .{ .tag = @enumFromInt(427), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true } } }, | |
| 6026 | // __builtin_carg | |
| 6027 | .{ .tag = @enumFromInt(428), .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6028 | // __builtin_cargf | |
| 6029 | .{ .tag = @enumFromInt(429), .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6030 | // __builtin_cargl | |
| 6031 | .{ .tag = @enumFromInt(430), .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6032 | // __builtin_casin | |
| 6033 | .{ .tag = @enumFromInt(431), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6034 | // __builtin_casinf | |
| 6035 | .{ .tag = @enumFromInt(432), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6036 | // __builtin_casinh | |
| 6037 | .{ .tag = @enumFromInt(433), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6038 | // __builtin_casinhf | |
| 6039 | .{ .tag = @enumFromInt(434), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6040 | // __builtin_casinhl | |
| 6041 | .{ .tag = @enumFromInt(435), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6042 | // __builtin_casinl | |
| 6043 | .{ .tag = @enumFromInt(436), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6044 | // __builtin_catan | |
| 6045 | .{ .tag = @enumFromInt(437), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6046 | // __builtin_catanf | |
| 6047 | .{ .tag = @enumFromInt(438), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6048 | // __builtin_catanh | |
| 6049 | .{ .tag = @enumFromInt(439), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6050 | // __builtin_catanhf | |
| 6051 | .{ .tag = @enumFromInt(440), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6052 | // __builtin_catanhl | |
| 6053 | .{ .tag = @enumFromInt(441), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6054 | // __builtin_catanl | |
| 6055 | .{ .tag = @enumFromInt(442), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6056 | // __builtin_cbrt | |
| 6057 | .{ .tag = @enumFromInt(443), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6058 | // __builtin_cbrtf | |
| 6059 | .{ .tag = @enumFromInt(444), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6060 | // __builtin_cbrtf128 | |
| 6061 | .{ .tag = @enumFromInt(445), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6062 | // __builtin_cbrtl | |
| 6063 | .{ .tag = @enumFromInt(446), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6064 | // __builtin_ccos | |
| 6065 | .{ .tag = @enumFromInt(447), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6066 | // __builtin_ccosf | |
| 6067 | .{ .tag = @enumFromInt(448), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6068 | // __builtin_ccosh | |
| 6069 | .{ .tag = @enumFromInt(449), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6070 | // __builtin_ccoshf | |
| 6071 | .{ .tag = @enumFromInt(450), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6072 | // __builtin_ccoshl | |
| 6073 | .{ .tag = @enumFromInt(451), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6074 | // __builtin_ccosl | |
| 6075 | .{ .tag = @enumFromInt(452), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6076 | // __builtin_ceil | |
| 6077 | .{ .tag = @enumFromInt(453), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6078 | // __builtin_ceilf | |
| 6079 | .{ .tag = @enumFromInt(454), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6080 | // __builtin_ceilf128 | |
| 6081 | .{ .tag = @enumFromInt(455), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6082 | // __builtin_ceilf16 | |
| 6083 | .{ .tag = @enumFromInt(456), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6084 | // __builtin_ceill | |
| 6085 | .{ .tag = @enumFromInt(457), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6086 | // __builtin_cexp | |
| 6087 | .{ .tag = @enumFromInt(458), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6088 | // __builtin_cexpf | |
| 6089 | .{ .tag = @enumFromInt(459), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6090 | // __builtin_cexpl | |
| 6091 | .{ .tag = @enumFromInt(460), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6092 | // __builtin_char_memchr | |
| 6093 | .{ .tag = @enumFromInt(461), .properties = .{ .param_str = "c*cC*iz", .attributes = .{ .const_evaluable = true } } }, | |
| 6094 | // __builtin_cimag | |
| 6095 | .{ .tag = @enumFromInt(462), .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6096 | // __builtin_cimagf | |
| 6097 | .{ .tag = @enumFromInt(463), .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6098 | // __builtin_cimagl | |
| 6099 | .{ .tag = @enumFromInt(464), .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6100 | // __builtin_classify_type | |
| 6101 | .{ .tag = @enumFromInt(465), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, | |
| 6102 | // __builtin_clog | |
| 6103 | .{ .tag = @enumFromInt(466), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6104 | // __builtin_clogf | |
| 6105 | .{ .tag = @enumFromInt(467), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6106 | // __builtin_clogl | |
| 6107 | .{ .tag = @enumFromInt(468), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6108 | // __builtin_clrsb | |
| 6109 | .{ .tag = @enumFromInt(469), .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6110 | // __builtin_clrsbl | |
| 6111 | .{ .tag = @enumFromInt(470), .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6112 | // __builtin_clrsbll | |
| 6113 | .{ .tag = @enumFromInt(471), .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6114 | // __builtin_clz | |
| 6115 | .{ .tag = @enumFromInt(472), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6116 | // __builtin_clzl | |
| 6117 | .{ .tag = @enumFromInt(473), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6118 | // __builtin_clzll | |
| 6119 | .{ .tag = @enumFromInt(474), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6120 | // __builtin_clzs | |
| 6121 | .{ .tag = @enumFromInt(475), .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6122 | // __builtin_complex | |
| 6123 | .{ .tag = @enumFromInt(476), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 6124 | // __builtin_conj | |
| 6125 | .{ .tag = @enumFromInt(477), .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6126 | // __builtin_conjf | |
| 6127 | .{ .tag = @enumFromInt(478), .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6128 | // __builtin_conjl | |
| 6129 | .{ .tag = @enumFromInt(479), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6130 | // __builtin_constant_p | |
| 6131 | .{ .tag = @enumFromInt(480), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, | |
| 6132 | // __builtin_convertvector | |
| 6133 | .{ .tag = @enumFromInt(481), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6134 | // __builtin_copysign | |
| 6135 | .{ .tag = @enumFromInt(482), .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6136 | // __builtin_copysignf | |
| 6137 | .{ .tag = @enumFromInt(483), .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6138 | // __builtin_copysignf128 | |
| 6139 | .{ .tag = @enumFromInt(484), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6140 | // __builtin_copysignf16 | |
| 6141 | .{ .tag = @enumFromInt(485), .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6142 | // __builtin_copysignl | |
| 6143 | .{ .tag = @enumFromInt(486), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6144 | // __builtin_cos | |
| 6145 | .{ .tag = @enumFromInt(487), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6146 | // __builtin_cosf | |
| 6147 | .{ .tag = @enumFromInt(488), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6148 | // __builtin_cosf128 | |
| 6149 | .{ .tag = @enumFromInt(489), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6150 | // __builtin_cosf16 | |
| 6151 | .{ .tag = @enumFromInt(490), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6152 | // __builtin_cosh | |
| 6153 | .{ .tag = @enumFromInt(491), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6154 | // __builtin_coshf | |
| 6155 | .{ .tag = @enumFromInt(492), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6156 | // __builtin_coshf128 | |
| 6157 | .{ .tag = @enumFromInt(493), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6158 | // __builtin_coshl | |
| 6159 | .{ .tag = @enumFromInt(494), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6160 | // __builtin_cosl | |
| 6161 | .{ .tag = @enumFromInt(495), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6162 | // __builtin_cpow | |
| 6163 | .{ .tag = @enumFromInt(496), .properties = .{ .param_str = "XdXdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6164 | // __builtin_cpowf | |
| 6165 | .{ .tag = @enumFromInt(497), .properties = .{ .param_str = "XfXfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6166 | // __builtin_cpowl | |
| 6167 | .{ .tag = @enumFromInt(498), .properties = .{ .param_str = "XLdXLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6168 | // __builtin_cproj | |
| 6169 | .{ .tag = @enumFromInt(499), .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6170 | // __builtin_cprojf | |
| 6171 | .{ .tag = @enumFromInt(500), .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6172 | // __builtin_cprojl | |
| 6173 | .{ .tag = @enumFromInt(501), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6174 | // __builtin_cpu_init | |
| 6175 | .{ .tag = @enumFromInt(502), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.x86) } }, | |
| 6176 | // __builtin_cpu_is | |
| 6177 | .{ .tag = @enumFromInt(503), .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, | |
| 6178 | // __builtin_cpu_supports | |
| 6179 | .{ .tag = @enumFromInt(504), .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, | |
| 6180 | // __builtin_creal | |
| 6181 | .{ .tag = @enumFromInt(505), .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6182 | // __builtin_crealf | |
| 6183 | .{ .tag = @enumFromInt(506), .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6184 | // __builtin_creall | |
| 6185 | .{ .tag = @enumFromInt(507), .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6186 | // __builtin_csin | |
| 6187 | .{ .tag = @enumFromInt(508), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6188 | // __builtin_csinf | |
| 6189 | .{ .tag = @enumFromInt(509), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6190 | // __builtin_csinh | |
| 6191 | .{ .tag = @enumFromInt(510), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6192 | // __builtin_csinhf | |
| 6193 | .{ .tag = @enumFromInt(511), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6194 | // __builtin_csinhl | |
| 6195 | .{ .tag = @enumFromInt(512), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6196 | // __builtin_csinl | |
| 6197 | .{ .tag = @enumFromInt(513), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6198 | // __builtin_csqrt | |
| 6199 | .{ .tag = @enumFromInt(514), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6200 | // __builtin_csqrtf | |
| 6201 | .{ .tag = @enumFromInt(515), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6202 | // __builtin_csqrtl | |
| 6203 | .{ .tag = @enumFromInt(516), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6204 | // __builtin_ctan | |
| 6205 | .{ .tag = @enumFromInt(517), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6206 | // __builtin_ctanf | |
| 6207 | .{ .tag = @enumFromInt(518), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6208 | // __builtin_ctanh | |
| 6209 | .{ .tag = @enumFromInt(519), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6210 | // __builtin_ctanhf | |
| 6211 | .{ .tag = @enumFromInt(520), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6212 | // __builtin_ctanhl | |
| 6213 | .{ .tag = @enumFromInt(521), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6214 | // __builtin_ctanl | |
| 6215 | .{ .tag = @enumFromInt(522), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6216 | // __builtin_ctz | |
| 6217 | .{ .tag = @enumFromInt(523), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6218 | // __builtin_ctzl | |
| 6219 | .{ .tag = @enumFromInt(524), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6220 | // __builtin_ctzll | |
| 6221 | .{ .tag = @enumFromInt(525), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6222 | // __builtin_ctzs | |
| 6223 | .{ .tag = @enumFromInt(526), .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6224 | // __builtin_dcbf | |
| 6225 | .{ .tag = @enumFromInt(527), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 6226 | // __builtin_debugtrap | |
| 6227 | .{ .tag = @enumFromInt(528), .properties = .{ .param_str = "v" } }, | |
| 6228 | // __builtin_dump_struct | |
| 6229 | .{ .tag = @enumFromInt(529), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 6230 | // __builtin_dwarf_cfa | |
| 6231 | .{ .tag = @enumFromInt(530), .properties = .{ .param_str = "v*" } }, | |
| 6232 | // __builtin_dwarf_sp_column | |
| 6233 | .{ .tag = @enumFromInt(531), .properties = .{ .param_str = "Ui" } }, | |
| 6234 | // __builtin_dynamic_object_size | |
| 6235 | .{ .tag = @enumFromInt(532), .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, | |
| 6236 | // __builtin_eh_return | |
| 6237 | .{ .tag = @enumFromInt(533), .properties = .{ .param_str = "vzv*", .attributes = .{ .noreturn = true } } }, | |
| 6238 | // __builtin_eh_return_data_regno | |
| 6239 | .{ .tag = @enumFromInt(534), .properties = .{ .param_str = "iIi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6240 | // __builtin_elementwise_abs | |
| 6241 | .{ .tag = @enumFromInt(535), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6242 | // __builtin_elementwise_add_sat | |
| 6243 | .{ .tag = @enumFromInt(536), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6244 | // __builtin_elementwise_bitreverse | |
| 6245 | .{ .tag = @enumFromInt(537), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6246 | // __builtin_elementwise_canonicalize | |
| 6247 | .{ .tag = @enumFromInt(538), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6248 | // __builtin_elementwise_ceil | |
| 6249 | .{ .tag = @enumFromInt(539), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6250 | // __builtin_elementwise_copysign | |
| 6251 | .{ .tag = @enumFromInt(540), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6252 | // __builtin_elementwise_cos | |
| 6253 | .{ .tag = @enumFromInt(541), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6254 | // __builtin_elementwise_exp | |
| 6255 | .{ .tag = @enumFromInt(542), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6256 | // __builtin_elementwise_exp2 | |
| 6257 | .{ .tag = @enumFromInt(543), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6258 | // __builtin_elementwise_floor | |
| 6259 | .{ .tag = @enumFromInt(544), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6260 | // __builtin_elementwise_fma | |
| 6261 | .{ .tag = @enumFromInt(545), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6262 | // __builtin_elementwise_log | |
| 6263 | .{ .tag = @enumFromInt(546), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6264 | // __builtin_elementwise_log10 | |
| 6265 | .{ .tag = @enumFromInt(547), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6266 | // __builtin_elementwise_log2 | |
| 6267 | .{ .tag = @enumFromInt(548), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6268 | // __builtin_elementwise_max | |
| 6269 | .{ .tag = @enumFromInt(549), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6270 | // __builtin_elementwise_min | |
| 6271 | .{ .tag = @enumFromInt(550), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6272 | // __builtin_elementwise_nearbyint | |
| 6273 | .{ .tag = @enumFromInt(551), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6274 | // __builtin_elementwise_pow | |
| 6275 | .{ .tag = @enumFromInt(552), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6276 | // __builtin_elementwise_rint | |
| 6277 | .{ .tag = @enumFromInt(553), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6278 | // __builtin_elementwise_round | |
| 6279 | .{ .tag = @enumFromInt(554), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6280 | // __builtin_elementwise_roundeven | |
| 6281 | .{ .tag = @enumFromInt(555), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6282 | // __builtin_elementwise_sin | |
| 6283 | .{ .tag = @enumFromInt(556), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6284 | // __builtin_elementwise_sqrt | |
| 6285 | .{ .tag = @enumFromInt(557), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6286 | // __builtin_elementwise_sub_sat | |
| 6287 | .{ .tag = @enumFromInt(558), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6288 | // __builtin_elementwise_trunc | |
| 6289 | .{ .tag = @enumFromInt(559), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 6290 | // __builtin_erf | |
| 6291 | .{ .tag = @enumFromInt(560), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6292 | // __builtin_erfc | |
| 6293 | .{ .tag = @enumFromInt(561), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6294 | // __builtin_erfcf | |
| 6295 | .{ .tag = @enumFromInt(562), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6296 | // __builtin_erfcf128 | |
| 6297 | .{ .tag = @enumFromInt(563), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6298 | // __builtin_erfcl | |
| 6299 | .{ .tag = @enumFromInt(564), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6300 | // __builtin_erff | |
| 6301 | .{ .tag = @enumFromInt(565), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6302 | // __builtin_erff128 | |
| 6303 | .{ .tag = @enumFromInt(566), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6304 | // __builtin_erfl | |
| 6305 | .{ .tag = @enumFromInt(567), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6306 | // __builtin_exp | |
| 6307 | .{ .tag = @enumFromInt(568), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6308 | // __builtin_exp10 | |
| 6309 | .{ .tag = @enumFromInt(569), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6310 | // __builtin_exp10f | |
| 6311 | .{ .tag = @enumFromInt(570), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6312 | // __builtin_exp10f128 | |
| 6313 | .{ .tag = @enumFromInt(571), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6314 | // __builtin_exp10f16 | |
| 6315 | .{ .tag = @enumFromInt(572), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6316 | // __builtin_exp10l | |
| 6317 | .{ .tag = @enumFromInt(573), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6318 | // __builtin_exp2 | |
| 6319 | .{ .tag = @enumFromInt(574), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6320 | // __builtin_exp2f | |
| 6321 | .{ .tag = @enumFromInt(575), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6322 | // __builtin_exp2f128 | |
| 6323 | .{ .tag = @enumFromInt(576), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6324 | // __builtin_exp2f16 | |
| 6325 | .{ .tag = @enumFromInt(577), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6326 | // __builtin_exp2l | |
| 6327 | .{ .tag = @enumFromInt(578), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6328 | // __builtin_expect | |
| 6329 | .{ .tag = @enumFromInt(579), .properties = .{ .param_str = "LiLiLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6330 | // __builtin_expect_with_probability | |
| 6331 | .{ .tag = @enumFromInt(580), .properties = .{ .param_str = "LiLiLid", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6332 | // __builtin_expf | |
| 6333 | .{ .tag = @enumFromInt(581), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6334 | // __builtin_expf128 | |
| 6335 | .{ .tag = @enumFromInt(582), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6336 | // __builtin_expf16 | |
| 6337 | .{ .tag = @enumFromInt(583), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6338 | // __builtin_expl | |
| 6339 | .{ .tag = @enumFromInt(584), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6340 | // __builtin_expm1 | |
| 6341 | .{ .tag = @enumFromInt(585), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6342 | // __builtin_expm1f | |
| 6343 | .{ .tag = @enumFromInt(586), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6344 | // __builtin_expm1f128 | |
| 6345 | .{ .tag = @enumFromInt(587), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6346 | // __builtin_expm1l | |
| 6347 | .{ .tag = @enumFromInt(588), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6348 | // __builtin_extend_pointer | |
| 6349 | .{ .tag = @enumFromInt(589), .properties = .{ .param_str = "ULLiv*" } }, | |
| 6350 | // __builtin_extract_return_addr | |
| 6351 | .{ .tag = @enumFromInt(590), .properties = .{ .param_str = "v*v*" } }, | |
| 6352 | // __builtin_fabs | |
| 6353 | .{ .tag = @enumFromInt(591), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6354 | // __builtin_fabsf | |
| 6355 | .{ .tag = @enumFromInt(592), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6356 | // __builtin_fabsf128 | |
| 6357 | .{ .tag = @enumFromInt(593), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6358 | // __builtin_fabsf16 | |
| 6359 | .{ .tag = @enumFromInt(594), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6360 | // __builtin_fabsl | |
| 6361 | .{ .tag = @enumFromInt(595), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6362 | // __builtin_fdim | |
| 6363 | .{ .tag = @enumFromInt(596), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6364 | // __builtin_fdimf | |
| 6365 | .{ .tag = @enumFromInt(597), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6366 | // __builtin_fdimf128 | |
| 6367 | .{ .tag = @enumFromInt(598), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6368 | // __builtin_fdiml | |
| 6369 | .{ .tag = @enumFromInt(599), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6370 | // __builtin_ffs | |
| 6371 | .{ .tag = @enumFromInt(600), .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6372 | // __builtin_ffsl | |
| 6373 | .{ .tag = @enumFromInt(601), .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6374 | // __builtin_ffsll | |
| 6375 | .{ .tag = @enumFromInt(602), .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6376 | // __builtin_floor | |
| 6377 | .{ .tag = @enumFromInt(603), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6378 | // __builtin_floorf | |
| 6379 | .{ .tag = @enumFromInt(604), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6380 | // __builtin_floorf128 | |
| 6381 | .{ .tag = @enumFromInt(605), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6382 | // __builtin_floorf16 | |
| 6383 | .{ .tag = @enumFromInt(606), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6384 | // __builtin_floorl | |
| 6385 | .{ .tag = @enumFromInt(607), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6386 | // __builtin_flt_rounds | |
| 6387 | .{ .tag = @enumFromInt(608), .properties = .{ .param_str = "i" } }, | |
| 6388 | // __builtin_fma | |
| 6389 | .{ .tag = @enumFromInt(609), .properties = .{ .param_str = "dddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6390 | // __builtin_fmaf | |
| 6391 | .{ .tag = @enumFromInt(610), .properties = .{ .param_str = "ffff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6392 | // __builtin_fmaf128 | |
| 6393 | .{ .tag = @enumFromInt(611), .properties = .{ .param_str = "LLdLLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6394 | // __builtin_fmaf16 | |
| 6395 | .{ .tag = @enumFromInt(612), .properties = .{ .param_str = "hhhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6396 | // __builtin_fmal | |
| 6397 | .{ .tag = @enumFromInt(613), .properties = .{ .param_str = "LdLdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6398 | // __builtin_fmax | |
| 6399 | .{ .tag = @enumFromInt(614), .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6400 | // __builtin_fmaxf | |
| 6401 | .{ .tag = @enumFromInt(615), .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6402 | // __builtin_fmaxf128 | |
| 6403 | .{ .tag = @enumFromInt(616), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6404 | // __builtin_fmaxf16 | |
| 6405 | .{ .tag = @enumFromInt(617), .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6406 | // __builtin_fmaxl | |
| 6407 | .{ .tag = @enumFromInt(618), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6408 | // __builtin_fmin | |
| 6409 | .{ .tag = @enumFromInt(619), .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6410 | // __builtin_fminf | |
| 6411 | .{ .tag = @enumFromInt(620), .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6412 | // __builtin_fminf128 | |
| 6413 | .{ .tag = @enumFromInt(621), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6414 | // __builtin_fminf16 | |
| 6415 | .{ .tag = @enumFromInt(622), .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6416 | // __builtin_fminl | |
| 6417 | .{ .tag = @enumFromInt(623), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6418 | // __builtin_fmod | |
| 6419 | .{ .tag = @enumFromInt(624), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6420 | // __builtin_fmodf | |
| 6421 | .{ .tag = @enumFromInt(625), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6422 | // __builtin_fmodf128 | |
| 6423 | .{ .tag = @enumFromInt(626), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6424 | // __builtin_fmodf16 | |
| 6425 | .{ .tag = @enumFromInt(627), .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6426 | // __builtin_fmodl | |
| 6427 | .{ .tag = @enumFromInt(628), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6428 | // __builtin_fpclassify | |
| 6429 | .{ .tag = @enumFromInt(629), .properties = .{ .param_str = "iiiiii.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6430 | // __builtin_fprintf | |
| 6431 | .{ .tag = @enumFromInt(630), .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 6432 | // __builtin_frame_address | |
| 6433 | .{ .tag = @enumFromInt(631), .properties = .{ .param_str = "v*IUi" } }, | |
| 6434 | // __builtin_free | |
| 6435 | .{ .tag = @enumFromInt(632), .properties = .{ .param_str = "vv*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6436 | // __builtin_frexp | |
| 6437 | .{ .tag = @enumFromInt(633), .properties = .{ .param_str = "ddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6438 | // __builtin_frexpf | |
| 6439 | .{ .tag = @enumFromInt(634), .properties = .{ .param_str = "ffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6440 | // __builtin_frexpf128 | |
| 6441 | .{ .tag = @enumFromInt(635), .properties = .{ .param_str = "LLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6442 | // __builtin_frexpf16 | |
| 6443 | .{ .tag = @enumFromInt(636), .properties = .{ .param_str = "hhi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6444 | // __builtin_frexpl | |
| 6445 | .{ .tag = @enumFromInt(637), .properties = .{ .param_str = "LdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6446 | // __builtin_frob_return_addr | |
| 6447 | .{ .tag = @enumFromInt(638), .properties = .{ .param_str = "v*v*" } }, | |
| 6448 | // __builtin_fscanf | |
| 6449 | .{ .tag = @enumFromInt(639), .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 6450 | // __builtin_getid | |
| 6451 | .{ .tag = @enumFromInt(640), .properties = .{ .param_str = "Si", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, | |
| 6452 | // __builtin_getps | |
| 6453 | .{ .tag = @enumFromInt(641), .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore) } }, | |
| 6454 | // __builtin_huge_val | |
| 6455 | .{ .tag = @enumFromInt(642), .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6456 | // __builtin_huge_valf | |
| 6457 | .{ .tag = @enumFromInt(643), .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6458 | // __builtin_huge_valf128 | |
| 6459 | .{ .tag = @enumFromInt(644), .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6460 | // __builtin_huge_valf16 | |
| 6461 | .{ .tag = @enumFromInt(645), .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6462 | // __builtin_huge_vall | |
| 6463 | .{ .tag = @enumFromInt(646), .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6464 | // __builtin_hypot | |
| 6465 | .{ .tag = @enumFromInt(647), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6466 | // __builtin_hypotf | |
| 6467 | .{ .tag = @enumFromInt(648), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6468 | // __builtin_hypotf128 | |
| 6469 | .{ .tag = @enumFromInt(649), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6470 | // __builtin_hypotl | |
| 6471 | .{ .tag = @enumFromInt(650), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6472 | // __builtin_ia32_rdpmc | |
| 6473 | .{ .tag = @enumFromInt(651), .properties = .{ .param_str = "UOii", .target_set = TargetSet.initOne(.x86) } }, | |
| 6474 | // __builtin_ia32_rdtsc | |
| 6475 | .{ .tag = @enumFromInt(652), .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, | |
| 6476 | // __builtin_ia32_rdtscp | |
| 6477 | .{ .tag = @enumFromInt(653), .properties = .{ .param_str = "UOiUi*", .target_set = TargetSet.initOne(.x86) } }, | |
| 6478 | // __builtin_ilogb | |
| 6479 | .{ .tag = @enumFromInt(654), .properties = .{ .param_str = "id", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6480 | // __builtin_ilogbf | |
| 6481 | .{ .tag = @enumFromInt(655), .properties = .{ .param_str = "if", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6482 | // __builtin_ilogbf128 | |
| 6483 | .{ .tag = @enumFromInt(656), .properties = .{ .param_str = "iLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6484 | // __builtin_ilogbl | |
| 6485 | .{ .tag = @enumFromInt(657), .properties = .{ .param_str = "iLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6486 | // __builtin_index | |
| 6487 | .{ .tag = @enumFromInt(658), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6488 | // __builtin_inf | |
| 6489 | .{ .tag = @enumFromInt(659), .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6490 | // __builtin_inff | |
| 6491 | .{ .tag = @enumFromInt(660), .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6492 | // __builtin_inff128 | |
| 6493 | .{ .tag = @enumFromInt(661), .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6494 | // __builtin_inff16 | |
| 6495 | .{ .tag = @enumFromInt(662), .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6496 | // __builtin_infl | |
| 6497 | .{ .tag = @enumFromInt(663), .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 6498 | // __builtin_init_dwarf_reg_size_table | |
| 6499 | .{ .tag = @enumFromInt(664), .properties = .{ .param_str = "vv*" } }, | |
| 6500 | // __builtin_is_aligned | |
| 6501 | .{ .tag = @enumFromInt(665), .properties = .{ .param_str = "bvC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 6502 | // __builtin_isfinite | |
| 6503 | .{ .tag = @enumFromInt(666), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6504 | // __builtin_isfpclass | |
| 6505 | .{ .tag = @enumFromInt(667), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 6506 | // __builtin_isgreater | |
| 6507 | .{ .tag = @enumFromInt(668), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6508 | // __builtin_isgreaterequal | |
| 6509 | .{ .tag = @enumFromInt(669), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6510 | // __builtin_isinf | |
| 6511 | .{ .tag = @enumFromInt(670), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6512 | // __builtin_isinf_sign | |
| 6513 | .{ .tag = @enumFromInt(671), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6514 | // __builtin_isless | |
| 6515 | .{ .tag = @enumFromInt(672), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6516 | // __builtin_islessequal | |
| 6517 | .{ .tag = @enumFromInt(673), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6518 | // __builtin_islessgreater | |
| 6519 | .{ .tag = @enumFromInt(674), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6520 | // __builtin_isnan | |
| 6521 | .{ .tag = @enumFromInt(675), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6522 | // __builtin_isnormal | |
| 6523 | .{ .tag = @enumFromInt(676), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6524 | // __builtin_isunordered | |
| 6525 | .{ .tag = @enumFromInt(677), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6526 | // __builtin_labs | |
| 6527 | .{ .tag = @enumFromInt(678), .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6528 | // __builtin_launder | |
| 6529 | .{ .tag = @enumFromInt(679), .properties = .{ .param_str = "v*v*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 6530 | // __builtin_ldexp | |
| 6531 | .{ .tag = @enumFromInt(680), .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6532 | // __builtin_ldexpf | |
| 6533 | .{ .tag = @enumFromInt(681), .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6534 | // __builtin_ldexpf128 | |
| 6535 | .{ .tag = @enumFromInt(682), .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6536 | // __builtin_ldexpf16 | |
| 6537 | .{ .tag = @enumFromInt(683), .properties = .{ .param_str = "hhi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6538 | // __builtin_ldexpl | |
| 6539 | .{ .tag = @enumFromInt(684), .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6540 | // __builtin_lgamma | |
| 6541 | .{ .tag = @enumFromInt(685), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6542 | // __builtin_lgammaf | |
| 6543 | .{ .tag = @enumFromInt(686), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6544 | // __builtin_lgammaf128 | |
| 6545 | .{ .tag = @enumFromInt(687), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6546 | // __builtin_lgammal | |
| 6547 | .{ .tag = @enumFromInt(688), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6548 | // __builtin_llabs | |
| 6549 | .{ .tag = @enumFromInt(689), .properties = .{ .param_str = "LLiLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6550 | // __builtin_llrint | |
| 6551 | .{ .tag = @enumFromInt(690), .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6552 | // __builtin_llrintf | |
| 6553 | .{ .tag = @enumFromInt(691), .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6554 | // __builtin_llrintf128 | |
| 6555 | .{ .tag = @enumFromInt(692), .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6556 | // __builtin_llrintl | |
| 6557 | .{ .tag = @enumFromInt(693), .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6558 | // __builtin_llround | |
| 6559 | .{ .tag = @enumFromInt(694), .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6560 | // __builtin_llroundf | |
| 6561 | .{ .tag = @enumFromInt(695), .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6562 | // __builtin_llroundf128 | |
| 6563 | .{ .tag = @enumFromInt(696), .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6564 | // __builtin_llroundl | |
| 6565 | .{ .tag = @enumFromInt(697), .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6566 | // __builtin_log | |
| 6567 | .{ .tag = @enumFromInt(698), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6568 | // __builtin_log10 | |
| 6569 | .{ .tag = @enumFromInt(699), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6570 | // __builtin_log10f | |
| 6571 | .{ .tag = @enumFromInt(700), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6572 | // __builtin_log10f128 | |
| 6573 | .{ .tag = @enumFromInt(701), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6574 | // __builtin_log10f16 | |
| 6575 | .{ .tag = @enumFromInt(702), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6576 | // __builtin_log10l | |
| 6577 | .{ .tag = @enumFromInt(703), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6578 | // __builtin_log1p | |
| 6579 | .{ .tag = @enumFromInt(704), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6580 | // __builtin_log1pf | |
| 6581 | .{ .tag = @enumFromInt(705), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6582 | // __builtin_log1pf128 | |
| 6583 | .{ .tag = @enumFromInt(706), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6584 | // __builtin_log1pl | |
| 6585 | .{ .tag = @enumFromInt(707), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6586 | // __builtin_log2 | |
| 6587 | .{ .tag = @enumFromInt(708), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6588 | // __builtin_log2f | |
| 6589 | .{ .tag = @enumFromInt(709), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6590 | // __builtin_log2f128 | |
| 6591 | .{ .tag = @enumFromInt(710), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6592 | // __builtin_log2f16 | |
| 6593 | .{ .tag = @enumFromInt(711), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6594 | // __builtin_log2l | |
| 6595 | .{ .tag = @enumFromInt(712), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6596 | // __builtin_logb | |
| 6597 | .{ .tag = @enumFromInt(713), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6598 | // __builtin_logbf | |
| 6599 | .{ .tag = @enumFromInt(714), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6600 | // __builtin_logbf128 | |
| 6601 | .{ .tag = @enumFromInt(715), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6602 | // __builtin_logbl | |
| 6603 | .{ .tag = @enumFromInt(716), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6604 | // __builtin_logf | |
| 6605 | .{ .tag = @enumFromInt(717), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6606 | // __builtin_logf128 | |
| 6607 | .{ .tag = @enumFromInt(718), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6608 | // __builtin_logf16 | |
| 6609 | .{ .tag = @enumFromInt(719), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6610 | // __builtin_logl | |
| 6611 | .{ .tag = @enumFromInt(720), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6612 | // __builtin_longjmp | |
| 6613 | .{ .tag = @enumFromInt(721), .properties = .{ .param_str = "vv**i", .attributes = .{ .noreturn = true } } }, | |
| 6614 | // __builtin_lrint | |
| 6615 | .{ .tag = @enumFromInt(722), .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6616 | // __builtin_lrintf | |
| 6617 | .{ .tag = @enumFromInt(723), .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6618 | // __builtin_lrintf128 | |
| 6619 | .{ .tag = @enumFromInt(724), .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6620 | // __builtin_lrintl | |
| 6621 | .{ .tag = @enumFromInt(725), .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6622 | // __builtin_lround | |
| 6623 | .{ .tag = @enumFromInt(726), .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6624 | // __builtin_lroundf | |
| 6625 | .{ .tag = @enumFromInt(727), .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6626 | // __builtin_lroundf128 | |
| 6627 | .{ .tag = @enumFromInt(728), .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6628 | // __builtin_lroundl | |
| 6629 | .{ .tag = @enumFromInt(729), .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 6630 | // __builtin_malloc | |
| 6631 | .{ .tag = @enumFromInt(730), .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6632 | // __builtin_matrix_column_major_load | |
| 6633 | .{ .tag = @enumFromInt(731), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6634 | // __builtin_matrix_column_major_store | |
| 6635 | .{ .tag = @enumFromInt(732), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6636 | // __builtin_matrix_transpose | |
| 6637 | .{ .tag = @enumFromInt(733), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 6638 | // __builtin_memchr | |
| 6639 | .{ .tag = @enumFromInt(734), .properties = .{ .param_str = "v*vC*iz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6640 | // __builtin_memcmp | |
| 6641 | .{ .tag = @enumFromInt(735), .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6642 | // __builtin_memcpy | |
| 6643 | .{ .tag = @enumFromInt(736), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6644 | // __builtin_memcpy_inline | |
| 6645 | .{ .tag = @enumFromInt(737), .properties = .{ .param_str = "vv*vC*Iz" } }, | |
| 6646 | // __builtin_memmove | |
| 6647 | .{ .tag = @enumFromInt(738), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 6648 | // __builtin_mempcpy | |
| 6649 | .{ .tag = @enumFromInt(739), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6650 | // __builtin_memset | |
| 6651 | .{ .tag = @enumFromInt(740), .properties = .{ .param_str = "v*v*iz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6652 | // __builtin_memset_inline | |
| 6653 | .{ .tag = @enumFromInt(741), .properties = .{ .param_str = "vv*iIz" } }, | |
| 6654 | // __builtin_mips_absq_s_ph | |
| 6655 | .{ .tag = @enumFromInt(742), .properties = .{ .param_str = "V2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6656 | // __builtin_mips_absq_s_qb | |
| 6657 | .{ .tag = @enumFromInt(743), .properties = .{ .param_str = "V4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6658 | // __builtin_mips_absq_s_w | |
| 6659 | .{ .tag = @enumFromInt(744), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6660 | // __builtin_mips_addq_ph | |
| 6661 | .{ .tag = @enumFromInt(745), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6662 | // __builtin_mips_addq_s_ph | |
| 6663 | .{ .tag = @enumFromInt(746), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6664 | // __builtin_mips_addq_s_w | |
| 6665 | .{ .tag = @enumFromInt(747), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6666 | // __builtin_mips_addqh_ph | |
| 6667 | .{ .tag = @enumFromInt(748), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6668 | // __builtin_mips_addqh_r_ph | |
| 6669 | .{ .tag = @enumFromInt(749), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6670 | // __builtin_mips_addqh_r_w | |
| 6671 | .{ .tag = @enumFromInt(750), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6672 | // __builtin_mips_addqh_w | |
| 6673 | .{ .tag = @enumFromInt(751), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6674 | // __builtin_mips_addsc | |
| 6675 | .{ .tag = @enumFromInt(752), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6676 | // __builtin_mips_addu_ph | |
| 6677 | .{ .tag = @enumFromInt(753), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6678 | // __builtin_mips_addu_qb | |
| 6679 | .{ .tag = @enumFromInt(754), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6680 | // __builtin_mips_addu_s_ph | |
| 6681 | .{ .tag = @enumFromInt(755), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6682 | // __builtin_mips_addu_s_qb | |
| 6683 | .{ .tag = @enumFromInt(756), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6684 | // __builtin_mips_adduh_qb | |
| 6685 | .{ .tag = @enumFromInt(757), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6686 | // __builtin_mips_adduh_r_qb | |
| 6687 | .{ .tag = @enumFromInt(758), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6688 | // __builtin_mips_addwc | |
| 6689 | .{ .tag = @enumFromInt(759), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6690 | // __builtin_mips_append | |
| 6691 | .{ .tag = @enumFromInt(760), .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6692 | // __builtin_mips_balign | |
| 6693 | .{ .tag = @enumFromInt(761), .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6694 | // __builtin_mips_bitrev | |
| 6695 | .{ .tag = @enumFromInt(762), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6696 | // __builtin_mips_bposge32 | |
| 6697 | .{ .tag = @enumFromInt(763), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.mips) } }, | |
| 6698 | // __builtin_mips_cmp_eq_ph | |
| 6699 | .{ .tag = @enumFromInt(764), .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6700 | // __builtin_mips_cmp_le_ph | |
| 6701 | .{ .tag = @enumFromInt(765), .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6702 | // __builtin_mips_cmp_lt_ph | |
| 6703 | .{ .tag = @enumFromInt(766), .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6704 | // __builtin_mips_cmpgdu_eq_qb | |
| 6705 | .{ .tag = @enumFromInt(767), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6706 | // __builtin_mips_cmpgdu_le_qb | |
| 6707 | .{ .tag = @enumFromInt(768), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6708 | // __builtin_mips_cmpgdu_lt_qb | |
| 6709 | .{ .tag = @enumFromInt(769), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6710 | // __builtin_mips_cmpgu_eq_qb | |
| 6711 | .{ .tag = @enumFromInt(770), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6712 | // __builtin_mips_cmpgu_le_qb | |
| 6713 | .{ .tag = @enumFromInt(771), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6714 | // __builtin_mips_cmpgu_lt_qb | |
| 6715 | .{ .tag = @enumFromInt(772), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6716 | // __builtin_mips_cmpu_eq_qb | |
| 6717 | .{ .tag = @enumFromInt(773), .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6718 | // __builtin_mips_cmpu_le_qb | |
| 6719 | .{ .tag = @enumFromInt(774), .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6720 | // __builtin_mips_cmpu_lt_qb | |
| 6721 | .{ .tag = @enumFromInt(775), .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6722 | // __builtin_mips_dpa_w_ph | |
| 6723 | .{ .tag = @enumFromInt(776), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6724 | // __builtin_mips_dpaq_s_w_ph | |
| 6725 | .{ .tag = @enumFromInt(777), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6726 | // __builtin_mips_dpaq_sa_l_w | |
| 6727 | .{ .tag = @enumFromInt(778), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6728 | // __builtin_mips_dpaqx_s_w_ph | |
| 6729 | .{ .tag = @enumFromInt(779), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6730 | // __builtin_mips_dpaqx_sa_w_ph | |
| 6731 | .{ .tag = @enumFromInt(780), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6732 | // __builtin_mips_dpau_h_qbl | |
| 6733 | .{ .tag = @enumFromInt(781), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6734 | // __builtin_mips_dpau_h_qbr | |
| 6735 | .{ .tag = @enumFromInt(782), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6736 | // __builtin_mips_dpax_w_ph | |
| 6737 | .{ .tag = @enumFromInt(783), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6738 | // __builtin_mips_dps_w_ph | |
| 6739 | .{ .tag = @enumFromInt(784), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6740 | // __builtin_mips_dpsq_s_w_ph | |
| 6741 | .{ .tag = @enumFromInt(785), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6742 | // __builtin_mips_dpsq_sa_l_w | |
| 6743 | .{ .tag = @enumFromInt(786), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6744 | // __builtin_mips_dpsqx_s_w_ph | |
| 6745 | .{ .tag = @enumFromInt(787), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6746 | // __builtin_mips_dpsqx_sa_w_ph | |
| 6747 | .{ .tag = @enumFromInt(788), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6748 | // __builtin_mips_dpsu_h_qbl | |
| 6749 | .{ .tag = @enumFromInt(789), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6750 | // __builtin_mips_dpsu_h_qbr | |
| 6751 | .{ .tag = @enumFromInt(790), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6752 | // __builtin_mips_dpsx_w_ph | |
| 6753 | .{ .tag = @enumFromInt(791), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6754 | // __builtin_mips_extp | |
| 6755 | .{ .tag = @enumFromInt(792), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6756 | // __builtin_mips_extpdp | |
| 6757 | .{ .tag = @enumFromInt(793), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6758 | // __builtin_mips_extr_r_w | |
| 6759 | .{ .tag = @enumFromInt(794), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6760 | // __builtin_mips_extr_rs_w | |
| 6761 | .{ .tag = @enumFromInt(795), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6762 | // __builtin_mips_extr_s_h | |
| 6763 | .{ .tag = @enumFromInt(796), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6764 | // __builtin_mips_extr_w | |
| 6765 | .{ .tag = @enumFromInt(797), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6766 | // __builtin_mips_insv | |
| 6767 | .{ .tag = @enumFromInt(798), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6768 | // __builtin_mips_lbux | |
| 6769 | .{ .tag = @enumFromInt(799), .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, | |
| 6770 | // __builtin_mips_lhx | |
| 6771 | .{ .tag = @enumFromInt(800), .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, | |
| 6772 | // __builtin_mips_lwx | |
| 6773 | .{ .tag = @enumFromInt(801), .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, | |
| 6774 | // __builtin_mips_madd | |
| 6775 | .{ .tag = @enumFromInt(802), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6776 | // __builtin_mips_maddu | |
| 6777 | .{ .tag = @enumFromInt(803), .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6778 | // __builtin_mips_maq_s_w_phl | |
| 6779 | .{ .tag = @enumFromInt(804), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6780 | // __builtin_mips_maq_s_w_phr | |
| 6781 | .{ .tag = @enumFromInt(805), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6782 | // __builtin_mips_maq_sa_w_phl | |
| 6783 | .{ .tag = @enumFromInt(806), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6784 | // __builtin_mips_maq_sa_w_phr | |
| 6785 | .{ .tag = @enumFromInt(807), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6786 | // __builtin_mips_modsub | |
| 6787 | .{ .tag = @enumFromInt(808), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6788 | // __builtin_mips_msub | |
| 6789 | .{ .tag = @enumFromInt(809), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6790 | // __builtin_mips_msubu | |
| 6791 | .{ .tag = @enumFromInt(810), .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6792 | // __builtin_mips_mthlip | |
| 6793 | .{ .tag = @enumFromInt(811), .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6794 | // __builtin_mips_mul_ph | |
| 6795 | .{ .tag = @enumFromInt(812), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6796 | // __builtin_mips_mul_s_ph | |
| 6797 | .{ .tag = @enumFromInt(813), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6798 | // __builtin_mips_muleq_s_w_phl | |
| 6799 | .{ .tag = @enumFromInt(814), .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6800 | // __builtin_mips_muleq_s_w_phr | |
| 6801 | .{ .tag = @enumFromInt(815), .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6802 | // __builtin_mips_muleu_s_ph_qbl | |
| 6803 | .{ .tag = @enumFromInt(816), .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6804 | // __builtin_mips_muleu_s_ph_qbr | |
| 6805 | .{ .tag = @enumFromInt(817), .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6806 | // __builtin_mips_mulq_rs_ph | |
| 6807 | .{ .tag = @enumFromInt(818), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6808 | // __builtin_mips_mulq_rs_w | |
| 6809 | .{ .tag = @enumFromInt(819), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6810 | // __builtin_mips_mulq_s_ph | |
| 6811 | .{ .tag = @enumFromInt(820), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6812 | // __builtin_mips_mulq_s_w | |
| 6813 | .{ .tag = @enumFromInt(821), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6814 | // __builtin_mips_mulsa_w_ph | |
| 6815 | .{ .tag = @enumFromInt(822), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6816 | // __builtin_mips_mulsaq_s_w_ph | |
| 6817 | .{ .tag = @enumFromInt(823), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6818 | // __builtin_mips_mult | |
| 6819 | .{ .tag = @enumFromInt(824), .properties = .{ .param_str = "LLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6820 | // __builtin_mips_multu | |
| 6821 | .{ .tag = @enumFromInt(825), .properties = .{ .param_str = "LLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6822 | // __builtin_mips_packrl_ph | |
| 6823 | .{ .tag = @enumFromInt(826), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6824 | // __builtin_mips_pick_ph | |
| 6825 | .{ .tag = @enumFromInt(827), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6826 | // __builtin_mips_pick_qb | |
| 6827 | .{ .tag = @enumFromInt(828), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6828 | // __builtin_mips_preceq_w_phl | |
| 6829 | .{ .tag = @enumFromInt(829), .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6830 | // __builtin_mips_preceq_w_phr | |
| 6831 | .{ .tag = @enumFromInt(830), .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6832 | // __builtin_mips_precequ_ph_qbl | |
| 6833 | .{ .tag = @enumFromInt(831), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6834 | // __builtin_mips_precequ_ph_qbla | |
| 6835 | .{ .tag = @enumFromInt(832), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6836 | // __builtin_mips_precequ_ph_qbr | |
| 6837 | .{ .tag = @enumFromInt(833), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6838 | // __builtin_mips_precequ_ph_qbra | |
| 6839 | .{ .tag = @enumFromInt(834), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6840 | // __builtin_mips_preceu_ph_qbl | |
| 6841 | .{ .tag = @enumFromInt(835), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6842 | // __builtin_mips_preceu_ph_qbla | |
| 6843 | .{ .tag = @enumFromInt(836), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6844 | // __builtin_mips_preceu_ph_qbr | |
| 6845 | .{ .tag = @enumFromInt(837), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6846 | // __builtin_mips_preceu_ph_qbra | |
| 6847 | .{ .tag = @enumFromInt(838), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6848 | // __builtin_mips_precr_qb_ph | |
| 6849 | .{ .tag = @enumFromInt(839), .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6850 | // __builtin_mips_precr_sra_ph_w | |
| 6851 | .{ .tag = @enumFromInt(840), .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6852 | // __builtin_mips_precr_sra_r_ph_w | |
| 6853 | .{ .tag = @enumFromInt(841), .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6854 | // __builtin_mips_precrq_ph_w | |
| 6855 | .{ .tag = @enumFromInt(842), .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6856 | // __builtin_mips_precrq_qb_ph | |
| 6857 | .{ .tag = @enumFromInt(843), .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6858 | // __builtin_mips_precrq_rs_ph_w | |
| 6859 | .{ .tag = @enumFromInt(844), .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6860 | // __builtin_mips_precrqu_s_qb_ph | |
| 6861 | .{ .tag = @enumFromInt(845), .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6862 | // __builtin_mips_prepend | |
| 6863 | .{ .tag = @enumFromInt(846), .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6864 | // __builtin_mips_raddu_w_qb | |
| 6865 | .{ .tag = @enumFromInt(847), .properties = .{ .param_str = "iV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6866 | // __builtin_mips_rddsp | |
| 6867 | .{ .tag = @enumFromInt(848), .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, | |
| 6868 | // __builtin_mips_repl_ph | |
| 6869 | .{ .tag = @enumFromInt(849), .properties = .{ .param_str = "V2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6870 | // __builtin_mips_repl_qb | |
| 6871 | .{ .tag = @enumFromInt(850), .properties = .{ .param_str = "V4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6872 | // __builtin_mips_shilo | |
| 6873 | .{ .tag = @enumFromInt(851), .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6874 | // __builtin_mips_shll_ph | |
| 6875 | .{ .tag = @enumFromInt(852), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, | |
| 6876 | // __builtin_mips_shll_qb | |
| 6877 | .{ .tag = @enumFromInt(853), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips) } }, | |
| 6878 | // __builtin_mips_shll_s_ph | |
| 6879 | .{ .tag = @enumFromInt(854), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, | |
| 6880 | // __builtin_mips_shll_s_w | |
| 6881 | .{ .tag = @enumFromInt(855), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6882 | // __builtin_mips_shra_ph | |
| 6883 | .{ .tag = @enumFromInt(856), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6884 | // __builtin_mips_shra_qb | |
| 6885 | .{ .tag = @enumFromInt(857), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6886 | // __builtin_mips_shra_r_ph | |
| 6887 | .{ .tag = @enumFromInt(858), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6888 | // __builtin_mips_shra_r_qb | |
| 6889 | .{ .tag = @enumFromInt(859), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6890 | // __builtin_mips_shra_r_w | |
| 6891 | .{ .tag = @enumFromInt(860), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6892 | // __builtin_mips_shrl_ph | |
| 6893 | .{ .tag = @enumFromInt(861), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6894 | // __builtin_mips_shrl_qb | |
| 6895 | .{ .tag = @enumFromInt(862), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6896 | // __builtin_mips_subq_ph | |
| 6897 | .{ .tag = @enumFromInt(863), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6898 | // __builtin_mips_subq_s_ph | |
| 6899 | .{ .tag = @enumFromInt(864), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6900 | // __builtin_mips_subq_s_w | |
| 6901 | .{ .tag = @enumFromInt(865), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 6902 | // __builtin_mips_subqh_ph | |
| 6903 | .{ .tag = @enumFromInt(866), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6904 | // __builtin_mips_subqh_r_ph | |
| 6905 | .{ .tag = @enumFromInt(867), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6906 | // __builtin_mips_subqh_r_w | |
| 6907 | .{ .tag = @enumFromInt(868), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6908 | // __builtin_mips_subqh_w | |
| 6909 | .{ .tag = @enumFromInt(869), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6910 | // __builtin_mips_subu_ph | |
| 6911 | .{ .tag = @enumFromInt(870), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6912 | // __builtin_mips_subu_qb | |
| 6913 | .{ .tag = @enumFromInt(871), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6914 | // __builtin_mips_subu_s_ph | |
| 6915 | .{ .tag = @enumFromInt(872), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 6916 | // __builtin_mips_subu_s_qb | |
| 6917 | .{ .tag = @enumFromInt(873), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 6918 | // __builtin_mips_subuh_qb | |
| 6919 | .{ .tag = @enumFromInt(874), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6920 | // __builtin_mips_subuh_r_qb | |
| 6921 | .{ .tag = @enumFromInt(875), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6922 | // __builtin_mips_wrdsp | |
| 6923 | .{ .tag = @enumFromInt(876), .properties = .{ .param_str = "viIi", .target_set = TargetSet.initOne(.mips) } }, | |
| 6924 | // __builtin_modf | |
| 6925 | .{ .tag = @enumFromInt(877), .properties = .{ .param_str = "ddd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6926 | // __builtin_modff | |
| 6927 | .{ .tag = @enumFromInt(878), .properties = .{ .param_str = "fff*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6928 | // __builtin_modff128 | |
| 6929 | .{ .tag = @enumFromInt(879), .properties = .{ .param_str = "LLdLLdLLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6930 | // __builtin_modfl | |
| 6931 | .{ .tag = @enumFromInt(880), .properties = .{ .param_str = "LdLdLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 6932 | // __builtin_msa_add_a_b | |
| 6933 | .{ .tag = @enumFromInt(881), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6934 | // __builtin_msa_add_a_d | |
| 6935 | .{ .tag = @enumFromInt(882), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6936 | // __builtin_msa_add_a_h | |
| 6937 | .{ .tag = @enumFromInt(883), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6938 | // __builtin_msa_add_a_w | |
| 6939 | .{ .tag = @enumFromInt(884), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6940 | // __builtin_msa_adds_a_b | |
| 6941 | .{ .tag = @enumFromInt(885), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6942 | // __builtin_msa_adds_a_d | |
| 6943 | .{ .tag = @enumFromInt(886), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6944 | // __builtin_msa_adds_a_h | |
| 6945 | .{ .tag = @enumFromInt(887), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6946 | // __builtin_msa_adds_a_w | |
| 6947 | .{ .tag = @enumFromInt(888), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6948 | // __builtin_msa_adds_s_b | |
| 6949 | .{ .tag = @enumFromInt(889), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6950 | // __builtin_msa_adds_s_d | |
| 6951 | .{ .tag = @enumFromInt(890), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6952 | // __builtin_msa_adds_s_h | |
| 6953 | .{ .tag = @enumFromInt(891), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6954 | // __builtin_msa_adds_s_w | |
| 6955 | .{ .tag = @enumFromInt(892), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6956 | // __builtin_msa_adds_u_b | |
| 6957 | .{ .tag = @enumFromInt(893), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6958 | // __builtin_msa_adds_u_d | |
| 6959 | .{ .tag = @enumFromInt(894), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6960 | // __builtin_msa_adds_u_h | |
| 6961 | .{ .tag = @enumFromInt(895), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6962 | // __builtin_msa_adds_u_w | |
| 6963 | .{ .tag = @enumFromInt(896), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6964 | // __builtin_msa_addv_b | |
| 6965 | .{ .tag = @enumFromInt(897), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6966 | // __builtin_msa_addv_d | |
| 6967 | .{ .tag = @enumFromInt(898), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6968 | // __builtin_msa_addv_h | |
| 6969 | .{ .tag = @enumFromInt(899), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6970 | // __builtin_msa_addv_w | |
| 6971 | .{ .tag = @enumFromInt(900), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6972 | // __builtin_msa_addvi_b | |
| 6973 | .{ .tag = @enumFromInt(901), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6974 | // __builtin_msa_addvi_d | |
| 6975 | .{ .tag = @enumFromInt(902), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6976 | // __builtin_msa_addvi_h | |
| 6977 | .{ .tag = @enumFromInt(903), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6978 | // __builtin_msa_addvi_w | |
| 6979 | .{ .tag = @enumFromInt(904), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6980 | // __builtin_msa_and_v | |
| 6981 | .{ .tag = @enumFromInt(905), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6982 | // __builtin_msa_andi_b | |
| 6983 | .{ .tag = @enumFromInt(906), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6984 | // __builtin_msa_asub_s_b | |
| 6985 | .{ .tag = @enumFromInt(907), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6986 | // __builtin_msa_asub_s_d | |
| 6987 | .{ .tag = @enumFromInt(908), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6988 | // __builtin_msa_asub_s_h | |
| 6989 | .{ .tag = @enumFromInt(909), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6990 | // __builtin_msa_asub_s_w | |
| 6991 | .{ .tag = @enumFromInt(910), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6992 | // __builtin_msa_asub_u_b | |
| 6993 | .{ .tag = @enumFromInt(911), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6994 | // __builtin_msa_asub_u_d | |
| 6995 | .{ .tag = @enumFromInt(912), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6996 | // __builtin_msa_asub_u_h | |
| 6997 | .{ .tag = @enumFromInt(913), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 6998 | // __builtin_msa_asub_u_w | |
| 6999 | .{ .tag = @enumFromInt(914), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7000 | // __builtin_msa_ave_s_b | |
| 7001 | .{ .tag = @enumFromInt(915), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7002 | // __builtin_msa_ave_s_d | |
| 7003 | .{ .tag = @enumFromInt(916), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7004 | // __builtin_msa_ave_s_h | |
| 7005 | .{ .tag = @enumFromInt(917), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7006 | // __builtin_msa_ave_s_w | |
| 7007 | .{ .tag = @enumFromInt(918), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7008 | // __builtin_msa_ave_u_b | |
| 7009 | .{ .tag = @enumFromInt(919), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7010 | // __builtin_msa_ave_u_d | |
| 7011 | .{ .tag = @enumFromInt(920), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7012 | // __builtin_msa_ave_u_h | |
| 7013 | .{ .tag = @enumFromInt(921), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7014 | // __builtin_msa_ave_u_w | |
| 7015 | .{ .tag = @enumFromInt(922), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7016 | // __builtin_msa_aver_s_b | |
| 7017 | .{ .tag = @enumFromInt(923), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7018 | // __builtin_msa_aver_s_d | |
| 7019 | .{ .tag = @enumFromInt(924), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7020 | // __builtin_msa_aver_s_h | |
| 7021 | .{ .tag = @enumFromInt(925), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7022 | // __builtin_msa_aver_s_w | |
| 7023 | .{ .tag = @enumFromInt(926), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7024 | // __builtin_msa_aver_u_b | |
| 7025 | .{ .tag = @enumFromInt(927), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7026 | // __builtin_msa_aver_u_d | |
| 7027 | .{ .tag = @enumFromInt(928), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7028 | // __builtin_msa_aver_u_h | |
| 7029 | .{ .tag = @enumFromInt(929), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7030 | // __builtin_msa_aver_u_w | |
| 7031 | .{ .tag = @enumFromInt(930), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7032 | // __builtin_msa_bclr_b | |
| 7033 | .{ .tag = @enumFromInt(931), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7034 | // __builtin_msa_bclr_d | |
| 7035 | .{ .tag = @enumFromInt(932), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7036 | // __builtin_msa_bclr_h | |
| 7037 | .{ .tag = @enumFromInt(933), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7038 | // __builtin_msa_bclr_w | |
| 7039 | .{ .tag = @enumFromInt(934), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7040 | // __builtin_msa_bclri_b | |
| 7041 | .{ .tag = @enumFromInt(935), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7042 | // __builtin_msa_bclri_d | |
| 7043 | .{ .tag = @enumFromInt(936), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7044 | // __builtin_msa_bclri_h | |
| 7045 | .{ .tag = @enumFromInt(937), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7046 | // __builtin_msa_bclri_w | |
| 7047 | .{ .tag = @enumFromInt(938), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7048 | // __builtin_msa_binsl_b | |
| 7049 | .{ .tag = @enumFromInt(939), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7050 | // __builtin_msa_binsl_d | |
| 7051 | .{ .tag = @enumFromInt(940), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7052 | // __builtin_msa_binsl_h | |
| 7053 | .{ .tag = @enumFromInt(941), .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7054 | // __builtin_msa_binsl_w | |
| 7055 | .{ .tag = @enumFromInt(942), .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7056 | // __builtin_msa_binsli_b | |
| 7057 | .{ .tag = @enumFromInt(943), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7058 | // __builtin_msa_binsli_d | |
| 7059 | .{ .tag = @enumFromInt(944), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7060 | // __builtin_msa_binsli_h | |
| 7061 | .{ .tag = @enumFromInt(945), .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7062 | // __builtin_msa_binsli_w | |
| 7063 | .{ .tag = @enumFromInt(946), .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7064 | // __builtin_msa_binsr_b | |
| 7065 | .{ .tag = @enumFromInt(947), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7066 | // __builtin_msa_binsr_d | |
| 7067 | .{ .tag = @enumFromInt(948), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7068 | // __builtin_msa_binsr_h | |
| 7069 | .{ .tag = @enumFromInt(949), .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7070 | // __builtin_msa_binsr_w | |
| 7071 | .{ .tag = @enumFromInt(950), .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7072 | // __builtin_msa_binsri_b | |
| 7073 | .{ .tag = @enumFromInt(951), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7074 | // __builtin_msa_binsri_d | |
| 7075 | .{ .tag = @enumFromInt(952), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7076 | // __builtin_msa_binsri_h | |
| 7077 | .{ .tag = @enumFromInt(953), .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7078 | // __builtin_msa_binsri_w | |
| 7079 | .{ .tag = @enumFromInt(954), .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7080 | // __builtin_msa_bmnz_v | |
| 7081 | .{ .tag = @enumFromInt(955), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7082 | // __builtin_msa_bmnzi_b | |
| 7083 | .{ .tag = @enumFromInt(956), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7084 | // __builtin_msa_bmz_v | |
| 7085 | .{ .tag = @enumFromInt(957), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7086 | // __builtin_msa_bmzi_b | |
| 7087 | .{ .tag = @enumFromInt(958), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7088 | // __builtin_msa_bneg_b | |
| 7089 | .{ .tag = @enumFromInt(959), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7090 | // __builtin_msa_bneg_d | |
| 7091 | .{ .tag = @enumFromInt(960), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7092 | // __builtin_msa_bneg_h | |
| 7093 | .{ .tag = @enumFromInt(961), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7094 | // __builtin_msa_bneg_w | |
| 7095 | .{ .tag = @enumFromInt(962), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7096 | // __builtin_msa_bnegi_b | |
| 7097 | .{ .tag = @enumFromInt(963), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7098 | // __builtin_msa_bnegi_d | |
| 7099 | .{ .tag = @enumFromInt(964), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7100 | // __builtin_msa_bnegi_h | |
| 7101 | .{ .tag = @enumFromInt(965), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7102 | // __builtin_msa_bnegi_w | |
| 7103 | .{ .tag = @enumFromInt(966), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7104 | // __builtin_msa_bnz_b | |
| 7105 | .{ .tag = @enumFromInt(967), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7106 | // __builtin_msa_bnz_d | |
| 7107 | .{ .tag = @enumFromInt(968), .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7108 | // __builtin_msa_bnz_h | |
| 7109 | .{ .tag = @enumFromInt(969), .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7110 | // __builtin_msa_bnz_v | |
| 7111 | .{ .tag = @enumFromInt(970), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7112 | // __builtin_msa_bnz_w | |
| 7113 | .{ .tag = @enumFromInt(971), .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7114 | // __builtin_msa_bsel_v | |
| 7115 | .{ .tag = @enumFromInt(972), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7116 | // __builtin_msa_bseli_b | |
| 7117 | .{ .tag = @enumFromInt(973), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7118 | // __builtin_msa_bset_b | |
| 7119 | .{ .tag = @enumFromInt(974), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7120 | // __builtin_msa_bset_d | |
| 7121 | .{ .tag = @enumFromInt(975), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7122 | // __builtin_msa_bset_h | |
| 7123 | .{ .tag = @enumFromInt(976), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7124 | // __builtin_msa_bset_w | |
| 7125 | .{ .tag = @enumFromInt(977), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7126 | // __builtin_msa_bseti_b | |
| 7127 | .{ .tag = @enumFromInt(978), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7128 | // __builtin_msa_bseti_d | |
| 7129 | .{ .tag = @enumFromInt(979), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7130 | // __builtin_msa_bseti_h | |
| 7131 | .{ .tag = @enumFromInt(980), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7132 | // __builtin_msa_bseti_w | |
| 7133 | .{ .tag = @enumFromInt(981), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7134 | // __builtin_msa_bz_b | |
| 7135 | .{ .tag = @enumFromInt(982), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7136 | // __builtin_msa_bz_d | |
| 7137 | .{ .tag = @enumFromInt(983), .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7138 | // __builtin_msa_bz_h | |
| 7139 | .{ .tag = @enumFromInt(984), .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7140 | // __builtin_msa_bz_v | |
| 7141 | .{ .tag = @enumFromInt(985), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7142 | // __builtin_msa_bz_w | |
| 7143 | .{ .tag = @enumFromInt(986), .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7144 | // __builtin_msa_ceq_b | |
| 7145 | .{ .tag = @enumFromInt(987), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7146 | // __builtin_msa_ceq_d | |
| 7147 | .{ .tag = @enumFromInt(988), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7148 | // __builtin_msa_ceq_h | |
| 7149 | .{ .tag = @enumFromInt(989), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7150 | // __builtin_msa_ceq_w | |
| 7151 | .{ .tag = @enumFromInt(990), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7152 | // __builtin_msa_ceqi_b | |
| 7153 | .{ .tag = @enumFromInt(991), .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7154 | // __builtin_msa_ceqi_d | |
| 7155 | .{ .tag = @enumFromInt(992), .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7156 | // __builtin_msa_ceqi_h | |
| 7157 | .{ .tag = @enumFromInt(993), .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7158 | // __builtin_msa_ceqi_w | |
| 7159 | .{ .tag = @enumFromInt(994), .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7160 | // __builtin_msa_cfcmsa | |
| 7161 | .{ .tag = @enumFromInt(995), .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, | |
| 7162 | // __builtin_msa_cle_s_b | |
| 7163 | .{ .tag = @enumFromInt(996), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7164 | // __builtin_msa_cle_s_d | |
| 7165 | .{ .tag = @enumFromInt(997), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7166 | // __builtin_msa_cle_s_h | |
| 7167 | .{ .tag = @enumFromInt(998), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7168 | // __builtin_msa_cle_s_w | |
| 7169 | .{ .tag = @enumFromInt(999), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7170 | // __builtin_msa_cle_u_b | |
| 7171 | .{ .tag = @enumFromInt(1000), .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7172 | // __builtin_msa_cle_u_d | |
| 7173 | .{ .tag = @enumFromInt(1001), .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7174 | // __builtin_msa_cle_u_h | |
| 7175 | .{ .tag = @enumFromInt(1002), .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7176 | // __builtin_msa_cle_u_w | |
| 7177 | .{ .tag = @enumFromInt(1003), .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7178 | // __builtin_msa_clei_s_b | |
| 7179 | .{ .tag = @enumFromInt(1004), .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7180 | // __builtin_msa_clei_s_d | |
| 7181 | .{ .tag = @enumFromInt(1005), .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7182 | // __builtin_msa_clei_s_h | |
| 7183 | .{ .tag = @enumFromInt(1006), .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7184 | // __builtin_msa_clei_s_w | |
| 7185 | .{ .tag = @enumFromInt(1007), .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7186 | // __builtin_msa_clei_u_b | |
| 7187 | .{ .tag = @enumFromInt(1008), .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7188 | // __builtin_msa_clei_u_d | |
| 7189 | .{ .tag = @enumFromInt(1009), .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7190 | // __builtin_msa_clei_u_h | |
| 7191 | .{ .tag = @enumFromInt(1010), .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7192 | // __builtin_msa_clei_u_w | |
| 7193 | .{ .tag = @enumFromInt(1011), .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7194 | // __builtin_msa_clt_s_b | |
| 7195 | .{ .tag = @enumFromInt(1012), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7196 | // __builtin_msa_clt_s_d | |
| 7197 | .{ .tag = @enumFromInt(1013), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7198 | // __builtin_msa_clt_s_h | |
| 7199 | .{ .tag = @enumFromInt(1014), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7200 | // __builtin_msa_clt_s_w | |
| 7201 | .{ .tag = @enumFromInt(1015), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7202 | // __builtin_msa_clt_u_b | |
| 7203 | .{ .tag = @enumFromInt(1016), .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7204 | // __builtin_msa_clt_u_d | |
| 7205 | .{ .tag = @enumFromInt(1017), .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7206 | // __builtin_msa_clt_u_h | |
| 7207 | .{ .tag = @enumFromInt(1018), .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7208 | // __builtin_msa_clt_u_w | |
| 7209 | .{ .tag = @enumFromInt(1019), .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7210 | // __builtin_msa_clti_s_b | |
| 7211 | .{ .tag = @enumFromInt(1020), .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7212 | // __builtin_msa_clti_s_d | |
| 7213 | .{ .tag = @enumFromInt(1021), .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7214 | // __builtin_msa_clti_s_h | |
| 7215 | .{ .tag = @enumFromInt(1022), .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7216 | // __builtin_msa_clti_s_w | |
| 7217 | .{ .tag = @enumFromInt(1023), .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7218 | // __builtin_msa_clti_u_b | |
| 7219 | .{ .tag = @enumFromInt(1024), .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7220 | // __builtin_msa_clti_u_d | |
| 7221 | .{ .tag = @enumFromInt(1025), .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7222 | // __builtin_msa_clti_u_h | |
| 7223 | .{ .tag = @enumFromInt(1026), .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7224 | // __builtin_msa_clti_u_w | |
| 7225 | .{ .tag = @enumFromInt(1027), .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7226 | // __builtin_msa_copy_s_b | |
| 7227 | .{ .tag = @enumFromInt(1028), .properties = .{ .param_str = "iV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7228 | // __builtin_msa_copy_s_d | |
| 7229 | .{ .tag = @enumFromInt(1029), .properties = .{ .param_str = "LLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7230 | // __builtin_msa_copy_s_h | |
| 7231 | .{ .tag = @enumFromInt(1030), .properties = .{ .param_str = "iV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7232 | // __builtin_msa_copy_s_w | |
| 7233 | .{ .tag = @enumFromInt(1031), .properties = .{ .param_str = "iV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7234 | // __builtin_msa_copy_u_b | |
| 7235 | .{ .tag = @enumFromInt(1032), .properties = .{ .param_str = "iV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7236 | // __builtin_msa_copy_u_d | |
| 7237 | .{ .tag = @enumFromInt(1033), .properties = .{ .param_str = "LLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7238 | // __builtin_msa_copy_u_h | |
| 7239 | .{ .tag = @enumFromInt(1034), .properties = .{ .param_str = "iV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7240 | // __builtin_msa_copy_u_w | |
| 7241 | .{ .tag = @enumFromInt(1035), .properties = .{ .param_str = "iV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7242 | // __builtin_msa_ctcmsa | |
| 7243 | .{ .tag = @enumFromInt(1036), .properties = .{ .param_str = "vIii", .target_set = TargetSet.initOne(.mips) } }, | |
| 7244 | // __builtin_msa_div_s_b | |
| 7245 | .{ .tag = @enumFromInt(1037), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7246 | // __builtin_msa_div_s_d | |
| 7247 | .{ .tag = @enumFromInt(1038), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7248 | // __builtin_msa_div_s_h | |
| 7249 | .{ .tag = @enumFromInt(1039), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7250 | // __builtin_msa_div_s_w | |
| 7251 | .{ .tag = @enumFromInt(1040), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7252 | // __builtin_msa_div_u_b | |
| 7253 | .{ .tag = @enumFromInt(1041), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7254 | // __builtin_msa_div_u_d | |
| 7255 | .{ .tag = @enumFromInt(1042), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7256 | // __builtin_msa_div_u_h | |
| 7257 | .{ .tag = @enumFromInt(1043), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7258 | // __builtin_msa_div_u_w | |
| 7259 | .{ .tag = @enumFromInt(1044), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7260 | // __builtin_msa_dotp_s_d | |
| 7261 | .{ .tag = @enumFromInt(1045), .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7262 | // __builtin_msa_dotp_s_h | |
| 7263 | .{ .tag = @enumFromInt(1046), .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7264 | // __builtin_msa_dotp_s_w | |
| 7265 | .{ .tag = @enumFromInt(1047), .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7266 | // __builtin_msa_dotp_u_d | |
| 7267 | .{ .tag = @enumFromInt(1048), .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7268 | // __builtin_msa_dotp_u_h | |
| 7269 | .{ .tag = @enumFromInt(1049), .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7270 | // __builtin_msa_dotp_u_w | |
| 7271 | .{ .tag = @enumFromInt(1050), .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7272 | // __builtin_msa_dpadd_s_d | |
| 7273 | .{ .tag = @enumFromInt(1051), .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7274 | // __builtin_msa_dpadd_s_h | |
| 7275 | .{ .tag = @enumFromInt(1052), .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7276 | // __builtin_msa_dpadd_s_w | |
| 7277 | .{ .tag = @enumFromInt(1053), .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7278 | // __builtin_msa_dpadd_u_d | |
| 7279 | .{ .tag = @enumFromInt(1054), .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7280 | // __builtin_msa_dpadd_u_h | |
| 7281 | .{ .tag = @enumFromInt(1055), .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7282 | // __builtin_msa_dpadd_u_w | |
| 7283 | .{ .tag = @enumFromInt(1056), .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7284 | // __builtin_msa_dpsub_s_d | |
| 7285 | .{ .tag = @enumFromInt(1057), .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7286 | // __builtin_msa_dpsub_s_h | |
| 7287 | .{ .tag = @enumFromInt(1058), .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7288 | // __builtin_msa_dpsub_s_w | |
| 7289 | .{ .tag = @enumFromInt(1059), .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7290 | // __builtin_msa_dpsub_u_d | |
| 7291 | .{ .tag = @enumFromInt(1060), .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7292 | // __builtin_msa_dpsub_u_h | |
| 7293 | .{ .tag = @enumFromInt(1061), .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7294 | // __builtin_msa_dpsub_u_w | |
| 7295 | .{ .tag = @enumFromInt(1062), .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7296 | // __builtin_msa_fadd_d | |
| 7297 | .{ .tag = @enumFromInt(1063), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7298 | // __builtin_msa_fadd_w | |
| 7299 | .{ .tag = @enumFromInt(1064), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7300 | // __builtin_msa_fcaf_d | |
| 7301 | .{ .tag = @enumFromInt(1065), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7302 | // __builtin_msa_fcaf_w | |
| 7303 | .{ .tag = @enumFromInt(1066), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7304 | // __builtin_msa_fceq_d | |
| 7305 | .{ .tag = @enumFromInt(1067), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7306 | // __builtin_msa_fceq_w | |
| 7307 | .{ .tag = @enumFromInt(1068), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7308 | // __builtin_msa_fclass_d | |
| 7309 | .{ .tag = @enumFromInt(1069), .properties = .{ .param_str = "V2LLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7310 | // __builtin_msa_fclass_w | |
| 7311 | .{ .tag = @enumFromInt(1070), .properties = .{ .param_str = "V4iV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7312 | // __builtin_msa_fcle_d | |
| 7313 | .{ .tag = @enumFromInt(1071), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7314 | // __builtin_msa_fcle_w | |
| 7315 | .{ .tag = @enumFromInt(1072), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7316 | // __builtin_msa_fclt_d | |
| 7317 | .{ .tag = @enumFromInt(1073), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7318 | // __builtin_msa_fclt_w | |
| 7319 | .{ .tag = @enumFromInt(1074), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7320 | // __builtin_msa_fcne_d | |
| 7321 | .{ .tag = @enumFromInt(1075), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7322 | // __builtin_msa_fcne_w | |
| 7323 | .{ .tag = @enumFromInt(1076), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7324 | // __builtin_msa_fcor_d | |
| 7325 | .{ .tag = @enumFromInt(1077), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7326 | // __builtin_msa_fcor_w | |
| 7327 | .{ .tag = @enumFromInt(1078), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7328 | // __builtin_msa_fcueq_d | |
| 7329 | .{ .tag = @enumFromInt(1079), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7330 | // __builtin_msa_fcueq_w | |
| 7331 | .{ .tag = @enumFromInt(1080), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7332 | // __builtin_msa_fcule_d | |
| 7333 | .{ .tag = @enumFromInt(1081), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7334 | // __builtin_msa_fcule_w | |
| 7335 | .{ .tag = @enumFromInt(1082), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7336 | // __builtin_msa_fcult_d | |
| 7337 | .{ .tag = @enumFromInt(1083), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7338 | // __builtin_msa_fcult_w | |
| 7339 | .{ .tag = @enumFromInt(1084), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7340 | // __builtin_msa_fcun_d | |
| 7341 | .{ .tag = @enumFromInt(1085), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7342 | // __builtin_msa_fcun_w | |
| 7343 | .{ .tag = @enumFromInt(1086), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7344 | // __builtin_msa_fcune_d | |
| 7345 | .{ .tag = @enumFromInt(1087), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7346 | // __builtin_msa_fcune_w | |
| 7347 | .{ .tag = @enumFromInt(1088), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7348 | // __builtin_msa_fdiv_d | |
| 7349 | .{ .tag = @enumFromInt(1089), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7350 | // __builtin_msa_fdiv_w | |
| 7351 | .{ .tag = @enumFromInt(1090), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7352 | // __builtin_msa_fexdo_h | |
| 7353 | .{ .tag = @enumFromInt(1091), .properties = .{ .param_str = "V8hV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7354 | // __builtin_msa_fexdo_w | |
| 7355 | .{ .tag = @enumFromInt(1092), .properties = .{ .param_str = "V4fV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7356 | // __builtin_msa_fexp2_d | |
| 7357 | .{ .tag = @enumFromInt(1093), .properties = .{ .param_str = "V2dV2dV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7358 | // __builtin_msa_fexp2_w | |
| 7359 | .{ .tag = @enumFromInt(1094), .properties = .{ .param_str = "V4fV4fV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7360 | // __builtin_msa_fexupl_d | |
| 7361 | .{ .tag = @enumFromInt(1095), .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7362 | // __builtin_msa_fexupl_w | |
| 7363 | .{ .tag = @enumFromInt(1096), .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7364 | // __builtin_msa_fexupr_d | |
| 7365 | .{ .tag = @enumFromInt(1097), .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7366 | // __builtin_msa_fexupr_w | |
| 7367 | .{ .tag = @enumFromInt(1098), .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7368 | // __builtin_msa_ffint_s_d | |
| 7369 | .{ .tag = @enumFromInt(1099), .properties = .{ .param_str = "V2dV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7370 | // __builtin_msa_ffint_s_w | |
| 7371 | .{ .tag = @enumFromInt(1100), .properties = .{ .param_str = "V4fV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7372 | // __builtin_msa_ffint_u_d | |
| 7373 | .{ .tag = @enumFromInt(1101), .properties = .{ .param_str = "V2dV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7374 | // __builtin_msa_ffint_u_w | |
| 7375 | .{ .tag = @enumFromInt(1102), .properties = .{ .param_str = "V4fV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7376 | // __builtin_msa_ffql_d | |
| 7377 | .{ .tag = @enumFromInt(1103), .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7378 | // __builtin_msa_ffql_w | |
| 7379 | .{ .tag = @enumFromInt(1104), .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7380 | // __builtin_msa_ffqr_d | |
| 7381 | .{ .tag = @enumFromInt(1105), .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7382 | // __builtin_msa_ffqr_w | |
| 7383 | .{ .tag = @enumFromInt(1106), .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7384 | // __builtin_msa_fill_b | |
| 7385 | .{ .tag = @enumFromInt(1107), .properties = .{ .param_str = "V16Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7386 | // __builtin_msa_fill_d | |
| 7387 | .{ .tag = @enumFromInt(1108), .properties = .{ .param_str = "V2SLLiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7388 | // __builtin_msa_fill_h | |
| 7389 | .{ .tag = @enumFromInt(1109), .properties = .{ .param_str = "V8Ssi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7390 | // __builtin_msa_fill_w | |
| 7391 | .{ .tag = @enumFromInt(1110), .properties = .{ .param_str = "V4Sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7392 | // __builtin_msa_flog2_d | |
| 7393 | .{ .tag = @enumFromInt(1111), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7394 | // __builtin_msa_flog2_w | |
| 7395 | .{ .tag = @enumFromInt(1112), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7396 | // __builtin_msa_fmadd_d | |
| 7397 | .{ .tag = @enumFromInt(1113), .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7398 | // __builtin_msa_fmadd_w | |
| 7399 | .{ .tag = @enumFromInt(1114), .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7400 | // __builtin_msa_fmax_a_d | |
| 7401 | .{ .tag = @enumFromInt(1115), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7402 | // __builtin_msa_fmax_a_w | |
| 7403 | .{ .tag = @enumFromInt(1116), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7404 | // __builtin_msa_fmax_d | |
| 7405 | .{ .tag = @enumFromInt(1117), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7406 | // __builtin_msa_fmax_w | |
| 7407 | .{ .tag = @enumFromInt(1118), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7408 | // __builtin_msa_fmin_a_d | |
| 7409 | .{ .tag = @enumFromInt(1119), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7410 | // __builtin_msa_fmin_a_w | |
| 7411 | .{ .tag = @enumFromInt(1120), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7412 | // __builtin_msa_fmin_d | |
| 7413 | .{ .tag = @enumFromInt(1121), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7414 | // __builtin_msa_fmin_w | |
| 7415 | .{ .tag = @enumFromInt(1122), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7416 | // __builtin_msa_fmsub_d | |
| 7417 | .{ .tag = @enumFromInt(1123), .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7418 | // __builtin_msa_fmsub_w | |
| 7419 | .{ .tag = @enumFromInt(1124), .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7420 | // __builtin_msa_fmul_d | |
| 7421 | .{ .tag = @enumFromInt(1125), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7422 | // __builtin_msa_fmul_w | |
| 7423 | .{ .tag = @enumFromInt(1126), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7424 | // __builtin_msa_frcp_d | |
| 7425 | .{ .tag = @enumFromInt(1127), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7426 | // __builtin_msa_frcp_w | |
| 7427 | .{ .tag = @enumFromInt(1128), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7428 | // __builtin_msa_frint_d | |
| 7429 | .{ .tag = @enumFromInt(1129), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7430 | // __builtin_msa_frint_w | |
| 7431 | .{ .tag = @enumFromInt(1130), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7432 | // __builtin_msa_frsqrt_d | |
| 7433 | .{ .tag = @enumFromInt(1131), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7434 | // __builtin_msa_frsqrt_w | |
| 7435 | .{ .tag = @enumFromInt(1132), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7436 | // __builtin_msa_fsaf_d | |
| 7437 | .{ .tag = @enumFromInt(1133), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7438 | // __builtin_msa_fsaf_w | |
| 7439 | .{ .tag = @enumFromInt(1134), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7440 | // __builtin_msa_fseq_d | |
| 7441 | .{ .tag = @enumFromInt(1135), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7442 | // __builtin_msa_fseq_w | |
| 7443 | .{ .tag = @enumFromInt(1136), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7444 | // __builtin_msa_fsle_d | |
| 7445 | .{ .tag = @enumFromInt(1137), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7446 | // __builtin_msa_fsle_w | |
| 7447 | .{ .tag = @enumFromInt(1138), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7448 | // __builtin_msa_fslt_d | |
| 7449 | .{ .tag = @enumFromInt(1139), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7450 | // __builtin_msa_fslt_w | |
| 7451 | .{ .tag = @enumFromInt(1140), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7452 | // __builtin_msa_fsne_d | |
| 7453 | .{ .tag = @enumFromInt(1141), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7454 | // __builtin_msa_fsne_w | |
| 7455 | .{ .tag = @enumFromInt(1142), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7456 | // __builtin_msa_fsor_d | |
| 7457 | .{ .tag = @enumFromInt(1143), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7458 | // __builtin_msa_fsor_w | |
| 7459 | .{ .tag = @enumFromInt(1144), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7460 | // __builtin_msa_fsqrt_d | |
| 7461 | .{ .tag = @enumFromInt(1145), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7462 | // __builtin_msa_fsqrt_w | |
| 7463 | .{ .tag = @enumFromInt(1146), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7464 | // __builtin_msa_fsub_d | |
| 7465 | .{ .tag = @enumFromInt(1147), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7466 | // __builtin_msa_fsub_w | |
| 7467 | .{ .tag = @enumFromInt(1148), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7468 | // __builtin_msa_fsueq_d | |
| 7469 | .{ .tag = @enumFromInt(1149), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7470 | // __builtin_msa_fsueq_w | |
| 7471 | .{ .tag = @enumFromInt(1150), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7472 | // __builtin_msa_fsule_d | |
| 7473 | .{ .tag = @enumFromInt(1151), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7474 | // __builtin_msa_fsule_w | |
| 7475 | .{ .tag = @enumFromInt(1152), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7476 | // __builtin_msa_fsult_d | |
| 7477 | .{ .tag = @enumFromInt(1153), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7478 | // __builtin_msa_fsult_w | |
| 7479 | .{ .tag = @enumFromInt(1154), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7480 | // __builtin_msa_fsun_d | |
| 7481 | .{ .tag = @enumFromInt(1155), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7482 | // __builtin_msa_fsun_w | |
| 7483 | .{ .tag = @enumFromInt(1156), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7484 | // __builtin_msa_fsune_d | |
| 7485 | .{ .tag = @enumFromInt(1157), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7486 | // __builtin_msa_fsune_w | |
| 7487 | .{ .tag = @enumFromInt(1158), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7488 | // __builtin_msa_ftint_s_d | |
| 7489 | .{ .tag = @enumFromInt(1159), .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7490 | // __builtin_msa_ftint_s_w | |
| 7491 | .{ .tag = @enumFromInt(1160), .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7492 | // __builtin_msa_ftint_u_d | |
| 7493 | .{ .tag = @enumFromInt(1161), .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7494 | // __builtin_msa_ftint_u_w | |
| 7495 | .{ .tag = @enumFromInt(1162), .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7496 | // __builtin_msa_ftq_h | |
| 7497 | .{ .tag = @enumFromInt(1163), .properties = .{ .param_str = "V4UiV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7498 | // __builtin_msa_ftq_w | |
| 7499 | .{ .tag = @enumFromInt(1164), .properties = .{ .param_str = "V2ULLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7500 | // __builtin_msa_ftrunc_s_d | |
| 7501 | .{ .tag = @enumFromInt(1165), .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7502 | // __builtin_msa_ftrunc_s_w | |
| 7503 | .{ .tag = @enumFromInt(1166), .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7504 | // __builtin_msa_ftrunc_u_d | |
| 7505 | .{ .tag = @enumFromInt(1167), .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7506 | // __builtin_msa_ftrunc_u_w | |
| 7507 | .{ .tag = @enumFromInt(1168), .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7508 | // __builtin_msa_hadd_s_d | |
| 7509 | .{ .tag = @enumFromInt(1169), .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7510 | // __builtin_msa_hadd_s_h | |
| 7511 | .{ .tag = @enumFromInt(1170), .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7512 | // __builtin_msa_hadd_s_w | |
| 7513 | .{ .tag = @enumFromInt(1171), .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7514 | // __builtin_msa_hadd_u_d | |
| 7515 | .{ .tag = @enumFromInt(1172), .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7516 | // __builtin_msa_hadd_u_h | |
| 7517 | .{ .tag = @enumFromInt(1173), .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7518 | // __builtin_msa_hadd_u_w | |
| 7519 | .{ .tag = @enumFromInt(1174), .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7520 | // __builtin_msa_hsub_s_d | |
| 7521 | .{ .tag = @enumFromInt(1175), .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7522 | // __builtin_msa_hsub_s_h | |
| 7523 | .{ .tag = @enumFromInt(1176), .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7524 | // __builtin_msa_hsub_s_w | |
| 7525 | .{ .tag = @enumFromInt(1177), .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7526 | // __builtin_msa_hsub_u_d | |
| 7527 | .{ .tag = @enumFromInt(1178), .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7528 | // __builtin_msa_hsub_u_h | |
| 7529 | .{ .tag = @enumFromInt(1179), .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7530 | // __builtin_msa_hsub_u_w | |
| 7531 | .{ .tag = @enumFromInt(1180), .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7532 | // __builtin_msa_ilvev_b | |
| 7533 | .{ .tag = @enumFromInt(1181), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7534 | // __builtin_msa_ilvev_d | |
| 7535 | .{ .tag = @enumFromInt(1182), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7536 | // __builtin_msa_ilvev_h | |
| 7537 | .{ .tag = @enumFromInt(1183), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7538 | // __builtin_msa_ilvev_w | |
| 7539 | .{ .tag = @enumFromInt(1184), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7540 | // __builtin_msa_ilvl_b | |
| 7541 | .{ .tag = @enumFromInt(1185), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7542 | // __builtin_msa_ilvl_d | |
| 7543 | .{ .tag = @enumFromInt(1186), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7544 | // __builtin_msa_ilvl_h | |
| 7545 | .{ .tag = @enumFromInt(1187), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7546 | // __builtin_msa_ilvl_w | |
| 7547 | .{ .tag = @enumFromInt(1188), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7548 | // __builtin_msa_ilvod_b | |
| 7549 | .{ .tag = @enumFromInt(1189), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7550 | // __builtin_msa_ilvod_d | |
| 7551 | .{ .tag = @enumFromInt(1190), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7552 | // __builtin_msa_ilvod_h | |
| 7553 | .{ .tag = @enumFromInt(1191), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7554 | // __builtin_msa_ilvod_w | |
| 7555 | .{ .tag = @enumFromInt(1192), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7556 | // __builtin_msa_ilvr_b | |
| 7557 | .{ .tag = @enumFromInt(1193), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7558 | // __builtin_msa_ilvr_d | |
| 7559 | .{ .tag = @enumFromInt(1194), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7560 | // __builtin_msa_ilvr_h | |
| 7561 | .{ .tag = @enumFromInt(1195), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7562 | // __builtin_msa_ilvr_w | |
| 7563 | .{ .tag = @enumFromInt(1196), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7564 | // __builtin_msa_insert_b | |
| 7565 | .{ .tag = @enumFromInt(1197), .properties = .{ .param_str = "V16ScV16ScIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7566 | // __builtin_msa_insert_d | |
| 7567 | .{ .tag = @enumFromInt(1198), .properties = .{ .param_str = "V2SLLiV2SLLiIUiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7568 | // __builtin_msa_insert_h | |
| 7569 | .{ .tag = @enumFromInt(1199), .properties = .{ .param_str = "V8SsV8SsIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7570 | // __builtin_msa_insert_w | |
| 7571 | .{ .tag = @enumFromInt(1200), .properties = .{ .param_str = "V4SiV4SiIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7572 | // __builtin_msa_insve_b | |
| 7573 | .{ .tag = @enumFromInt(1201), .properties = .{ .param_str = "V16ScV16ScIUiV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7574 | // __builtin_msa_insve_d | |
| 7575 | .{ .tag = @enumFromInt(1202), .properties = .{ .param_str = "V2SLLiV2SLLiIUiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7576 | // __builtin_msa_insve_h | |
| 7577 | .{ .tag = @enumFromInt(1203), .properties = .{ .param_str = "V8SsV8SsIUiV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7578 | // __builtin_msa_insve_w | |
| 7579 | .{ .tag = @enumFromInt(1204), .properties = .{ .param_str = "V4SiV4SiIUiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7580 | // __builtin_msa_ld_b | |
| 7581 | .{ .tag = @enumFromInt(1205), .properties = .{ .param_str = "V16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7582 | // __builtin_msa_ld_d | |
| 7583 | .{ .tag = @enumFromInt(1206), .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7584 | // __builtin_msa_ld_h | |
| 7585 | .{ .tag = @enumFromInt(1207), .properties = .{ .param_str = "V8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7586 | // __builtin_msa_ld_w | |
| 7587 | .{ .tag = @enumFromInt(1208), .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7588 | // __builtin_msa_ldi_b | |
| 7589 | .{ .tag = @enumFromInt(1209), .properties = .{ .param_str = "V16cIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7590 | // __builtin_msa_ldi_d | |
| 7591 | .{ .tag = @enumFromInt(1210), .properties = .{ .param_str = "V2LLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7592 | // __builtin_msa_ldi_h | |
| 7593 | .{ .tag = @enumFromInt(1211), .properties = .{ .param_str = "V8sIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7594 | // __builtin_msa_ldi_w | |
| 7595 | .{ .tag = @enumFromInt(1212), .properties = .{ .param_str = "V4iIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7596 | // __builtin_msa_ldr_d | |
| 7597 | .{ .tag = @enumFromInt(1213), .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7598 | // __builtin_msa_ldr_w | |
| 7599 | .{ .tag = @enumFromInt(1214), .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7600 | // __builtin_msa_madd_q_h | |
| 7601 | .{ .tag = @enumFromInt(1215), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7602 | // __builtin_msa_madd_q_w | |
| 7603 | .{ .tag = @enumFromInt(1216), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7604 | // __builtin_msa_maddr_q_h | |
| 7605 | .{ .tag = @enumFromInt(1217), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7606 | // __builtin_msa_maddr_q_w | |
| 7607 | .{ .tag = @enumFromInt(1218), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7608 | // __builtin_msa_maddv_b | |
| 7609 | .{ .tag = @enumFromInt(1219), .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7610 | // __builtin_msa_maddv_d | |
| 7611 | .{ .tag = @enumFromInt(1220), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7612 | // __builtin_msa_maddv_h | |
| 7613 | .{ .tag = @enumFromInt(1221), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7614 | // __builtin_msa_maddv_w | |
| 7615 | .{ .tag = @enumFromInt(1222), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7616 | // __builtin_msa_max_a_b | |
| 7617 | .{ .tag = @enumFromInt(1223), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7618 | // __builtin_msa_max_a_d | |
| 7619 | .{ .tag = @enumFromInt(1224), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7620 | // __builtin_msa_max_a_h | |
| 7621 | .{ .tag = @enumFromInt(1225), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7622 | // __builtin_msa_max_a_w | |
| 7623 | .{ .tag = @enumFromInt(1226), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7624 | // __builtin_msa_max_s_b | |
| 7625 | .{ .tag = @enumFromInt(1227), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7626 | // __builtin_msa_max_s_d | |
| 7627 | .{ .tag = @enumFromInt(1228), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7628 | // __builtin_msa_max_s_h | |
| 7629 | .{ .tag = @enumFromInt(1229), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7630 | // __builtin_msa_max_s_w | |
| 7631 | .{ .tag = @enumFromInt(1230), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7632 | // __builtin_msa_max_u_b | |
| 7633 | .{ .tag = @enumFromInt(1231), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7634 | // __builtin_msa_max_u_d | |
| 7635 | .{ .tag = @enumFromInt(1232), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7636 | // __builtin_msa_max_u_h | |
| 7637 | .{ .tag = @enumFromInt(1233), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7638 | // __builtin_msa_max_u_w | |
| 7639 | .{ .tag = @enumFromInt(1234), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7640 | // __builtin_msa_maxi_s_b | |
| 7641 | .{ .tag = @enumFromInt(1235), .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7642 | // __builtin_msa_maxi_s_d | |
| 7643 | .{ .tag = @enumFromInt(1236), .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7644 | // __builtin_msa_maxi_s_h | |
| 7645 | .{ .tag = @enumFromInt(1237), .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7646 | // __builtin_msa_maxi_s_w | |
| 7647 | .{ .tag = @enumFromInt(1238), .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7648 | // __builtin_msa_maxi_u_b | |
| 7649 | .{ .tag = @enumFromInt(1239), .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7650 | // __builtin_msa_maxi_u_d | |
| 7651 | .{ .tag = @enumFromInt(1240), .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7652 | // __builtin_msa_maxi_u_h | |
| 7653 | .{ .tag = @enumFromInt(1241), .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7654 | // __builtin_msa_maxi_u_w | |
| 7655 | .{ .tag = @enumFromInt(1242), .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7656 | // __builtin_msa_min_a_b | |
| 7657 | .{ .tag = @enumFromInt(1243), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7658 | // __builtin_msa_min_a_d | |
| 7659 | .{ .tag = @enumFromInt(1244), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7660 | // __builtin_msa_min_a_h | |
| 7661 | .{ .tag = @enumFromInt(1245), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7662 | // __builtin_msa_min_a_w | |
| 7663 | .{ .tag = @enumFromInt(1246), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7664 | // __builtin_msa_min_s_b | |
| 7665 | .{ .tag = @enumFromInt(1247), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7666 | // __builtin_msa_min_s_d | |
| 7667 | .{ .tag = @enumFromInt(1248), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7668 | // __builtin_msa_min_s_h | |
| 7669 | .{ .tag = @enumFromInt(1249), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7670 | // __builtin_msa_min_s_w | |
| 7671 | .{ .tag = @enumFromInt(1250), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7672 | // __builtin_msa_min_u_b | |
| 7673 | .{ .tag = @enumFromInt(1251), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7674 | // __builtin_msa_min_u_d | |
| 7675 | .{ .tag = @enumFromInt(1252), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7676 | // __builtin_msa_min_u_h | |
| 7677 | .{ .tag = @enumFromInt(1253), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7678 | // __builtin_msa_min_u_w | |
| 7679 | .{ .tag = @enumFromInt(1254), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7680 | // __builtin_msa_mini_s_b | |
| 7681 | .{ .tag = @enumFromInt(1255), .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7682 | // __builtin_msa_mini_s_d | |
| 7683 | .{ .tag = @enumFromInt(1256), .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7684 | // __builtin_msa_mini_s_h | |
| 7685 | .{ .tag = @enumFromInt(1257), .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7686 | // __builtin_msa_mini_s_w | |
| 7687 | .{ .tag = @enumFromInt(1258), .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7688 | // __builtin_msa_mini_u_b | |
| 7689 | .{ .tag = @enumFromInt(1259), .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7690 | // __builtin_msa_mini_u_d | |
| 7691 | .{ .tag = @enumFromInt(1260), .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7692 | // __builtin_msa_mini_u_h | |
| 7693 | .{ .tag = @enumFromInt(1261), .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7694 | // __builtin_msa_mini_u_w | |
| 7695 | .{ .tag = @enumFromInt(1262), .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7696 | // __builtin_msa_mod_s_b | |
| 7697 | .{ .tag = @enumFromInt(1263), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7698 | // __builtin_msa_mod_s_d | |
| 7699 | .{ .tag = @enumFromInt(1264), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7700 | // __builtin_msa_mod_s_h | |
| 7701 | .{ .tag = @enumFromInt(1265), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7702 | // __builtin_msa_mod_s_w | |
| 7703 | .{ .tag = @enumFromInt(1266), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7704 | // __builtin_msa_mod_u_b | |
| 7705 | .{ .tag = @enumFromInt(1267), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7706 | // __builtin_msa_mod_u_d | |
| 7707 | .{ .tag = @enumFromInt(1268), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7708 | // __builtin_msa_mod_u_h | |
| 7709 | .{ .tag = @enumFromInt(1269), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7710 | // __builtin_msa_mod_u_w | |
| 7711 | .{ .tag = @enumFromInt(1270), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7712 | // __builtin_msa_move_v | |
| 7713 | .{ .tag = @enumFromInt(1271), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7714 | // __builtin_msa_msub_q_h | |
| 7715 | .{ .tag = @enumFromInt(1272), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7716 | // __builtin_msa_msub_q_w | |
| 7717 | .{ .tag = @enumFromInt(1273), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7718 | // __builtin_msa_msubr_q_h | |
| 7719 | .{ .tag = @enumFromInt(1274), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7720 | // __builtin_msa_msubr_q_w | |
| 7721 | .{ .tag = @enumFromInt(1275), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7722 | // __builtin_msa_msubv_b | |
| 7723 | .{ .tag = @enumFromInt(1276), .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7724 | // __builtin_msa_msubv_d | |
| 7725 | .{ .tag = @enumFromInt(1277), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7726 | // __builtin_msa_msubv_h | |
| 7727 | .{ .tag = @enumFromInt(1278), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7728 | // __builtin_msa_msubv_w | |
| 7729 | .{ .tag = @enumFromInt(1279), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7730 | // __builtin_msa_mul_q_h | |
| 7731 | .{ .tag = @enumFromInt(1280), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7732 | // __builtin_msa_mul_q_w | |
| 7733 | .{ .tag = @enumFromInt(1281), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7734 | // __builtin_msa_mulr_q_h | |
| 7735 | .{ .tag = @enumFromInt(1282), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7736 | // __builtin_msa_mulr_q_w | |
| 7737 | .{ .tag = @enumFromInt(1283), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7738 | // __builtin_msa_mulv_b | |
| 7739 | .{ .tag = @enumFromInt(1284), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7740 | // __builtin_msa_mulv_d | |
| 7741 | .{ .tag = @enumFromInt(1285), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7742 | // __builtin_msa_mulv_h | |
| 7743 | .{ .tag = @enumFromInt(1286), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7744 | // __builtin_msa_mulv_w | |
| 7745 | .{ .tag = @enumFromInt(1287), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7746 | // __builtin_msa_nloc_b | |
| 7747 | .{ .tag = @enumFromInt(1288), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7748 | // __builtin_msa_nloc_d | |
| 7749 | .{ .tag = @enumFromInt(1289), .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7750 | // __builtin_msa_nloc_h | |
| 7751 | .{ .tag = @enumFromInt(1290), .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7752 | // __builtin_msa_nloc_w | |
| 7753 | .{ .tag = @enumFromInt(1291), .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7754 | // __builtin_msa_nlzc_b | |
| 7755 | .{ .tag = @enumFromInt(1292), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7756 | // __builtin_msa_nlzc_d | |
| 7757 | .{ .tag = @enumFromInt(1293), .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7758 | // __builtin_msa_nlzc_h | |
| 7759 | .{ .tag = @enumFromInt(1294), .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7760 | // __builtin_msa_nlzc_w | |
| 7761 | .{ .tag = @enumFromInt(1295), .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7762 | // __builtin_msa_nor_v | |
| 7763 | .{ .tag = @enumFromInt(1296), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7764 | // __builtin_msa_nori_b | |
| 7765 | .{ .tag = @enumFromInt(1297), .properties = .{ .param_str = "V16UcV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7766 | // __builtin_msa_or_v | |
| 7767 | .{ .tag = @enumFromInt(1298), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7768 | // __builtin_msa_ori_b | |
| 7769 | .{ .tag = @enumFromInt(1299), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7770 | // __builtin_msa_pckev_b | |
| 7771 | .{ .tag = @enumFromInt(1300), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7772 | // __builtin_msa_pckev_d | |
| 7773 | .{ .tag = @enumFromInt(1301), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7774 | // __builtin_msa_pckev_h | |
| 7775 | .{ .tag = @enumFromInt(1302), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7776 | // __builtin_msa_pckev_w | |
| 7777 | .{ .tag = @enumFromInt(1303), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7778 | // __builtin_msa_pckod_b | |
| 7779 | .{ .tag = @enumFromInt(1304), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7780 | // __builtin_msa_pckod_d | |
| 7781 | .{ .tag = @enumFromInt(1305), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7782 | // __builtin_msa_pckod_h | |
| 7783 | .{ .tag = @enumFromInt(1306), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7784 | // __builtin_msa_pckod_w | |
| 7785 | .{ .tag = @enumFromInt(1307), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7786 | // __builtin_msa_pcnt_b | |
| 7787 | .{ .tag = @enumFromInt(1308), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7788 | // __builtin_msa_pcnt_d | |
| 7789 | .{ .tag = @enumFromInt(1309), .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7790 | // __builtin_msa_pcnt_h | |
| 7791 | .{ .tag = @enumFromInt(1310), .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7792 | // __builtin_msa_pcnt_w | |
| 7793 | .{ .tag = @enumFromInt(1311), .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7794 | // __builtin_msa_sat_s_b | |
| 7795 | .{ .tag = @enumFromInt(1312), .properties = .{ .param_str = "V16ScV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7796 | // __builtin_msa_sat_s_d | |
| 7797 | .{ .tag = @enumFromInt(1313), .properties = .{ .param_str = "V2SLLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7798 | // __builtin_msa_sat_s_h | |
| 7799 | .{ .tag = @enumFromInt(1314), .properties = .{ .param_str = "V8SsV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7800 | // __builtin_msa_sat_s_w | |
| 7801 | .{ .tag = @enumFromInt(1315), .properties = .{ .param_str = "V4SiV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7802 | // __builtin_msa_sat_u_b | |
| 7803 | .{ .tag = @enumFromInt(1316), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7804 | // __builtin_msa_sat_u_d | |
| 7805 | .{ .tag = @enumFromInt(1317), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7806 | // __builtin_msa_sat_u_h | |
| 7807 | .{ .tag = @enumFromInt(1318), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7808 | // __builtin_msa_sat_u_w | |
| 7809 | .{ .tag = @enumFromInt(1319), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7810 | // __builtin_msa_shf_b | |
| 7811 | .{ .tag = @enumFromInt(1320), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7812 | // __builtin_msa_shf_h | |
| 7813 | .{ .tag = @enumFromInt(1321), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7814 | // __builtin_msa_shf_w | |
| 7815 | .{ .tag = @enumFromInt(1322), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7816 | // __builtin_msa_sld_b | |
| 7817 | .{ .tag = @enumFromInt(1323), .properties = .{ .param_str = "V16cV16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7818 | // __builtin_msa_sld_d | |
| 7819 | .{ .tag = @enumFromInt(1324), .properties = .{ .param_str = "V2LLiV2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7820 | // __builtin_msa_sld_h | |
| 7821 | .{ .tag = @enumFromInt(1325), .properties = .{ .param_str = "V8sV8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7822 | // __builtin_msa_sld_w | |
| 7823 | .{ .tag = @enumFromInt(1326), .properties = .{ .param_str = "V4iV4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7824 | // __builtin_msa_sldi_b | |
| 7825 | .{ .tag = @enumFromInt(1327), .properties = .{ .param_str = "V16cV16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7826 | // __builtin_msa_sldi_d | |
| 7827 | .{ .tag = @enumFromInt(1328), .properties = .{ .param_str = "V2LLiV2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7828 | // __builtin_msa_sldi_h | |
| 7829 | .{ .tag = @enumFromInt(1329), .properties = .{ .param_str = "V8sV8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7830 | // __builtin_msa_sldi_w | |
| 7831 | .{ .tag = @enumFromInt(1330), .properties = .{ .param_str = "V4iV4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7832 | // __builtin_msa_sll_b | |
| 7833 | .{ .tag = @enumFromInt(1331), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7834 | // __builtin_msa_sll_d | |
| 7835 | .{ .tag = @enumFromInt(1332), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7836 | // __builtin_msa_sll_h | |
| 7837 | .{ .tag = @enumFromInt(1333), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7838 | // __builtin_msa_sll_w | |
| 7839 | .{ .tag = @enumFromInt(1334), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7840 | // __builtin_msa_slli_b | |
| 7841 | .{ .tag = @enumFromInt(1335), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7842 | // __builtin_msa_slli_d | |
| 7843 | .{ .tag = @enumFromInt(1336), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7844 | // __builtin_msa_slli_h | |
| 7845 | .{ .tag = @enumFromInt(1337), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7846 | // __builtin_msa_slli_w | |
| 7847 | .{ .tag = @enumFromInt(1338), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7848 | // __builtin_msa_splat_b | |
| 7849 | .{ .tag = @enumFromInt(1339), .properties = .{ .param_str = "V16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7850 | // __builtin_msa_splat_d | |
| 7851 | .{ .tag = @enumFromInt(1340), .properties = .{ .param_str = "V2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7852 | // __builtin_msa_splat_h | |
| 7853 | .{ .tag = @enumFromInt(1341), .properties = .{ .param_str = "V8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7854 | // __builtin_msa_splat_w | |
| 7855 | .{ .tag = @enumFromInt(1342), .properties = .{ .param_str = "V4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7856 | // __builtin_msa_splati_b | |
| 7857 | .{ .tag = @enumFromInt(1343), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7858 | // __builtin_msa_splati_d | |
| 7859 | .{ .tag = @enumFromInt(1344), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7860 | // __builtin_msa_splati_h | |
| 7861 | .{ .tag = @enumFromInt(1345), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7862 | // __builtin_msa_splati_w | |
| 7863 | .{ .tag = @enumFromInt(1346), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7864 | // __builtin_msa_sra_b | |
| 7865 | .{ .tag = @enumFromInt(1347), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7866 | // __builtin_msa_sra_d | |
| 7867 | .{ .tag = @enumFromInt(1348), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7868 | // __builtin_msa_sra_h | |
| 7869 | .{ .tag = @enumFromInt(1349), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7870 | // __builtin_msa_sra_w | |
| 7871 | .{ .tag = @enumFromInt(1350), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7872 | // __builtin_msa_srai_b | |
| 7873 | .{ .tag = @enumFromInt(1351), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7874 | // __builtin_msa_srai_d | |
| 7875 | .{ .tag = @enumFromInt(1352), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7876 | // __builtin_msa_srai_h | |
| 7877 | .{ .tag = @enumFromInt(1353), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7878 | // __builtin_msa_srai_w | |
| 7879 | .{ .tag = @enumFromInt(1354), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7880 | // __builtin_msa_srar_b | |
| 7881 | .{ .tag = @enumFromInt(1355), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7882 | // __builtin_msa_srar_d | |
| 7883 | .{ .tag = @enumFromInt(1356), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7884 | // __builtin_msa_srar_h | |
| 7885 | .{ .tag = @enumFromInt(1357), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7886 | // __builtin_msa_srar_w | |
| 7887 | .{ .tag = @enumFromInt(1358), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7888 | // __builtin_msa_srari_b | |
| 7889 | .{ .tag = @enumFromInt(1359), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7890 | // __builtin_msa_srari_d | |
| 7891 | .{ .tag = @enumFromInt(1360), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7892 | // __builtin_msa_srari_h | |
| 7893 | .{ .tag = @enumFromInt(1361), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7894 | // __builtin_msa_srari_w | |
| 7895 | .{ .tag = @enumFromInt(1362), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7896 | // __builtin_msa_srl_b | |
| 7897 | .{ .tag = @enumFromInt(1363), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7898 | // __builtin_msa_srl_d | |
| 7899 | .{ .tag = @enumFromInt(1364), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7900 | // __builtin_msa_srl_h | |
| 7901 | .{ .tag = @enumFromInt(1365), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7902 | // __builtin_msa_srl_w | |
| 7903 | .{ .tag = @enumFromInt(1366), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7904 | // __builtin_msa_srli_b | |
| 7905 | .{ .tag = @enumFromInt(1367), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7906 | // __builtin_msa_srli_d | |
| 7907 | .{ .tag = @enumFromInt(1368), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7908 | // __builtin_msa_srli_h | |
| 7909 | .{ .tag = @enumFromInt(1369), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7910 | // __builtin_msa_srli_w | |
| 7911 | .{ .tag = @enumFromInt(1370), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7912 | // __builtin_msa_srlr_b | |
| 7913 | .{ .tag = @enumFromInt(1371), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7914 | // __builtin_msa_srlr_d | |
| 7915 | .{ .tag = @enumFromInt(1372), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7916 | // __builtin_msa_srlr_h | |
| 7917 | .{ .tag = @enumFromInt(1373), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7918 | // __builtin_msa_srlr_w | |
| 7919 | .{ .tag = @enumFromInt(1374), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7920 | // __builtin_msa_srlri_b | |
| 7921 | .{ .tag = @enumFromInt(1375), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7922 | // __builtin_msa_srlri_d | |
| 7923 | .{ .tag = @enumFromInt(1376), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7924 | // __builtin_msa_srlri_h | |
| 7925 | .{ .tag = @enumFromInt(1377), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7926 | // __builtin_msa_srlri_w | |
| 7927 | .{ .tag = @enumFromInt(1378), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7928 | // __builtin_msa_st_b | |
| 7929 | .{ .tag = @enumFromInt(1379), .properties = .{ .param_str = "vV16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7930 | // __builtin_msa_st_d | |
| 7931 | .{ .tag = @enumFromInt(1380), .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7932 | // __builtin_msa_st_h | |
| 7933 | .{ .tag = @enumFromInt(1381), .properties = .{ .param_str = "vV8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7934 | // __builtin_msa_st_w | |
| 7935 | .{ .tag = @enumFromInt(1382), .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7936 | // __builtin_msa_str_d | |
| 7937 | .{ .tag = @enumFromInt(1383), .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7938 | // __builtin_msa_str_w | |
| 7939 | .{ .tag = @enumFromInt(1384), .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7940 | // __builtin_msa_subs_s_b | |
| 7941 | .{ .tag = @enumFromInt(1385), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7942 | // __builtin_msa_subs_s_d | |
| 7943 | .{ .tag = @enumFromInt(1386), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7944 | // __builtin_msa_subs_s_h | |
| 7945 | .{ .tag = @enumFromInt(1387), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7946 | // __builtin_msa_subs_s_w | |
| 7947 | .{ .tag = @enumFromInt(1388), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7948 | // __builtin_msa_subs_u_b | |
| 7949 | .{ .tag = @enumFromInt(1389), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7950 | // __builtin_msa_subs_u_d | |
| 7951 | .{ .tag = @enumFromInt(1390), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7952 | // __builtin_msa_subs_u_h | |
| 7953 | .{ .tag = @enumFromInt(1391), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7954 | // __builtin_msa_subs_u_w | |
| 7955 | .{ .tag = @enumFromInt(1392), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7956 | // __builtin_msa_subsus_u_b | |
| 7957 | .{ .tag = @enumFromInt(1393), .properties = .{ .param_str = "V16UcV16UcV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7958 | // __builtin_msa_subsus_u_d | |
| 7959 | .{ .tag = @enumFromInt(1394), .properties = .{ .param_str = "V2ULLiV2ULLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7960 | // __builtin_msa_subsus_u_h | |
| 7961 | .{ .tag = @enumFromInt(1395), .properties = .{ .param_str = "V8UsV8UsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7962 | // __builtin_msa_subsus_u_w | |
| 7963 | .{ .tag = @enumFromInt(1396), .properties = .{ .param_str = "V4UiV4UiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7964 | // __builtin_msa_subsuu_s_b | |
| 7965 | .{ .tag = @enumFromInt(1397), .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7966 | // __builtin_msa_subsuu_s_d | |
| 7967 | .{ .tag = @enumFromInt(1398), .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7968 | // __builtin_msa_subsuu_s_h | |
| 7969 | .{ .tag = @enumFromInt(1399), .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7970 | // __builtin_msa_subsuu_s_w | |
| 7971 | .{ .tag = @enumFromInt(1400), .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7972 | // __builtin_msa_subv_b | |
| 7973 | .{ .tag = @enumFromInt(1401), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7974 | // __builtin_msa_subv_d | |
| 7975 | .{ .tag = @enumFromInt(1402), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7976 | // __builtin_msa_subv_h | |
| 7977 | .{ .tag = @enumFromInt(1403), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7978 | // __builtin_msa_subv_w | |
| 7979 | .{ .tag = @enumFromInt(1404), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7980 | // __builtin_msa_subvi_b | |
| 7981 | .{ .tag = @enumFromInt(1405), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7982 | // __builtin_msa_subvi_d | |
| 7983 | .{ .tag = @enumFromInt(1406), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7984 | // __builtin_msa_subvi_h | |
| 7985 | .{ .tag = @enumFromInt(1407), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7986 | // __builtin_msa_subvi_w | |
| 7987 | .{ .tag = @enumFromInt(1408), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7988 | // __builtin_msa_vshf_b | |
| 7989 | .{ .tag = @enumFromInt(1409), .properties = .{ .param_str = "V16cV16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7990 | // __builtin_msa_vshf_d | |
| 7991 | .{ .tag = @enumFromInt(1410), .properties = .{ .param_str = "V2LLiV2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7992 | // __builtin_msa_vshf_h | |
| 7993 | .{ .tag = @enumFromInt(1411), .properties = .{ .param_str = "V8sV8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7994 | // __builtin_msa_vshf_w | |
| 7995 | .{ .tag = @enumFromInt(1412), .properties = .{ .param_str = "V4iV4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7996 | // __builtin_msa_xor_v | |
| 7997 | .{ .tag = @enumFromInt(1413), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 7998 | // __builtin_msa_xori_b | |
| 7999 | .{ .tag = @enumFromInt(1414), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 8000 | // __builtin_mul_overflow | |
| 8001 | .{ .tag = @enumFromInt(1415), .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 8002 | // __builtin_nan | |
| 8003 | .{ .tag = @enumFromInt(1416), .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8004 | // __builtin_nanf | |
| 8005 | .{ .tag = @enumFromInt(1417), .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8006 | // __builtin_nanf128 | |
| 8007 | .{ .tag = @enumFromInt(1418), .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8008 | // __builtin_nanf16 | |
| 8009 | .{ .tag = @enumFromInt(1419), .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8010 | // __builtin_nanl | |
| 8011 | .{ .tag = @enumFromInt(1420), .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8012 | // __builtin_nans | |
| 8013 | .{ .tag = @enumFromInt(1421), .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8014 | // __builtin_nansf | |
| 8015 | .{ .tag = @enumFromInt(1422), .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8016 | // __builtin_nansf128 | |
| 8017 | .{ .tag = @enumFromInt(1423), .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8018 | // __builtin_nansf16 | |
| 8019 | .{ .tag = @enumFromInt(1424), .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8020 | // __builtin_nansl | |
| 8021 | .{ .tag = @enumFromInt(1425), .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8022 | // __builtin_nearbyint | |
| 8023 | .{ .tag = @enumFromInt(1426), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8024 | // __builtin_nearbyintf | |
| 8025 | .{ .tag = @enumFromInt(1427), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8026 | // __builtin_nearbyintf128 | |
| 8027 | .{ .tag = @enumFromInt(1428), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8028 | // __builtin_nearbyintl | |
| 8029 | .{ .tag = @enumFromInt(1429), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8030 | // __builtin_nextafter | |
| 8031 | .{ .tag = @enumFromInt(1430), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8032 | // __builtin_nextafterf | |
| 8033 | .{ .tag = @enumFromInt(1431), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8034 | // __builtin_nextafterf128 | |
| 8035 | .{ .tag = @enumFromInt(1432), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8036 | // __builtin_nextafterl | |
| 8037 | .{ .tag = @enumFromInt(1433), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8038 | // __builtin_nexttoward | |
| 8039 | .{ .tag = @enumFromInt(1434), .properties = .{ .param_str = "ddLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8040 | // __builtin_nexttowardf | |
| 8041 | .{ .tag = @enumFromInt(1435), .properties = .{ .param_str = "ffLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8042 | // __builtin_nexttowardf128 | |
| 8043 | .{ .tag = @enumFromInt(1436), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8044 | // __builtin_nexttowardl | |
| 8045 | .{ .tag = @enumFromInt(1437), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8046 | // __builtin_nondeterministic_value | |
| 8047 | .{ .tag = @enumFromInt(1438), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 8048 | // __builtin_nontemporal_load | |
| 8049 | .{ .tag = @enumFromInt(1439), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 8050 | // __builtin_nontemporal_store | |
| 8051 | .{ .tag = @enumFromInt(1440), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 8052 | // __builtin_objc_memmove_collectable | |
| 8053 | .{ .tag = @enumFromInt(1441), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8054 | // __builtin_object_size | |
| 8055 | .{ .tag = @enumFromInt(1442), .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, | |
| 8056 | // __builtin_operator_delete | |
| 8057 | .{ .tag = @enumFromInt(1443), .properties = .{ .param_str = "vv*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 8058 | // __builtin_operator_new | |
| 8059 | .{ .tag = @enumFromInt(1444), .properties = .{ .param_str = "v*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 8060 | // __builtin_os_log_format | |
| 8061 | .{ .tag = @enumFromInt(1445), .properties = .{ .param_str = "v*v*cC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf } } }, | |
| 8062 | // __builtin_os_log_format_buffer_size | |
| 8063 | .{ .tag = @enumFromInt(1446), .properties = .{ .param_str = "zcC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf, .eval_args = false, .const_evaluable = true } } }, | |
| 8064 | // __builtin_pack_longdouble | |
| 8065 | .{ .tag = @enumFromInt(1447), .properties = .{ .param_str = "Lddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8066 | // __builtin_parity | |
| 8067 | .{ .tag = @enumFromInt(1448), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8068 | // __builtin_parityl | |
| 8069 | .{ .tag = @enumFromInt(1449), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8070 | // __builtin_parityll | |
| 8071 | .{ .tag = @enumFromInt(1450), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8072 | // __builtin_popcount | |
| 8073 | .{ .tag = @enumFromInt(1451), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8074 | // __builtin_popcountl | |
| 8075 | .{ .tag = @enumFromInt(1452), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8076 | // __builtin_popcountll | |
| 8077 | .{ .tag = @enumFromInt(1453), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8078 | // __builtin_pow | |
| 8079 | .{ .tag = @enumFromInt(1454), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8080 | // __builtin_powf | |
| 8081 | .{ .tag = @enumFromInt(1455), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8082 | // __builtin_powf128 | |
| 8083 | .{ .tag = @enumFromInt(1456), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8084 | // __builtin_powf16 | |
| 8085 | .{ .tag = @enumFromInt(1457), .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8086 | // __builtin_powi | |
| 8087 | .{ .tag = @enumFromInt(1458), .properties = .{ .param_str = "ddi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8088 | // __builtin_powif | |
| 8089 | .{ .tag = @enumFromInt(1459), .properties = .{ .param_str = "ffi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8090 | // __builtin_powil | |
| 8091 | .{ .tag = @enumFromInt(1460), .properties = .{ .param_str = "LdLdi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8092 | // __builtin_powl | |
| 8093 | .{ .tag = @enumFromInt(1461), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8094 | // __builtin_ppc_alignx | |
| 8095 | .{ .tag = @enumFromInt(1462), .properties = .{ .param_str = "vIivC*", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, | |
| 8096 | // __builtin_ppc_cmpb | |
| 8097 | .{ .tag = @enumFromInt(1463), .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8098 | // __builtin_ppc_compare_and_swap | |
| 8099 | .{ .tag = @enumFromInt(1464), .properties = .{ .param_str = "iiD*i*i", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8100 | // __builtin_ppc_compare_and_swaplp | |
| 8101 | .{ .tag = @enumFromInt(1465), .properties = .{ .param_str = "iLiD*Li*Li", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8102 | // __builtin_ppc_dcbfl | |
| 8103 | .{ .tag = @enumFromInt(1466), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8104 | // __builtin_ppc_dcbflp | |
| 8105 | .{ .tag = @enumFromInt(1467), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8106 | // __builtin_ppc_dcbst | |
| 8107 | .{ .tag = @enumFromInt(1468), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8108 | // __builtin_ppc_dcbt | |
| 8109 | .{ .tag = @enumFromInt(1469), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8110 | // __builtin_ppc_dcbtst | |
| 8111 | .{ .tag = @enumFromInt(1470), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8112 | // __builtin_ppc_dcbtstt | |
| 8113 | .{ .tag = @enumFromInt(1471), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8114 | // __builtin_ppc_dcbtt | |
| 8115 | .{ .tag = @enumFromInt(1472), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8116 | // __builtin_ppc_dcbz | |
| 8117 | .{ .tag = @enumFromInt(1473), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8118 | // __builtin_ppc_eieio | |
| 8119 | .{ .tag = @enumFromInt(1474), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8120 | // __builtin_ppc_fcfid | |
| 8121 | .{ .tag = @enumFromInt(1475), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8122 | // __builtin_ppc_fcfud | |
| 8123 | .{ .tag = @enumFromInt(1476), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8124 | // __builtin_ppc_fctid | |
| 8125 | .{ .tag = @enumFromInt(1477), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8126 | // __builtin_ppc_fctidz | |
| 8127 | .{ .tag = @enumFromInt(1478), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8128 | // __builtin_ppc_fctiw | |
| 8129 | .{ .tag = @enumFromInt(1479), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8130 | // __builtin_ppc_fctiwz | |
| 8131 | .{ .tag = @enumFromInt(1480), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8132 | // __builtin_ppc_fctudz | |
| 8133 | .{ .tag = @enumFromInt(1481), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8134 | // __builtin_ppc_fctuwz | |
| 8135 | .{ .tag = @enumFromInt(1482), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8136 | // __builtin_ppc_fetch_and_add | |
| 8137 | .{ .tag = @enumFromInt(1483), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8138 | // __builtin_ppc_fetch_and_addlp | |
| 8139 | .{ .tag = @enumFromInt(1484), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8140 | // __builtin_ppc_fetch_and_and | |
| 8141 | .{ .tag = @enumFromInt(1485), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8142 | // __builtin_ppc_fetch_and_andlp | |
| 8143 | .{ .tag = @enumFromInt(1486), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8144 | // __builtin_ppc_fetch_and_or | |
| 8145 | .{ .tag = @enumFromInt(1487), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8146 | // __builtin_ppc_fetch_and_orlp | |
| 8147 | .{ .tag = @enumFromInt(1488), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8148 | // __builtin_ppc_fetch_and_swap | |
| 8149 | .{ .tag = @enumFromInt(1489), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8150 | // __builtin_ppc_fetch_and_swaplp | |
| 8151 | .{ .tag = @enumFromInt(1490), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8152 | // __builtin_ppc_fmsub | |
| 8153 | .{ .tag = @enumFromInt(1491), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8154 | // __builtin_ppc_fmsubs | |
| 8155 | .{ .tag = @enumFromInt(1492), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8156 | // __builtin_ppc_fnabs | |
| 8157 | .{ .tag = @enumFromInt(1493), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8158 | // __builtin_ppc_fnabss | |
| 8159 | .{ .tag = @enumFromInt(1494), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8160 | // __builtin_ppc_fnmadd | |
| 8161 | .{ .tag = @enumFromInt(1495), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8162 | // __builtin_ppc_fnmadds | |
| 8163 | .{ .tag = @enumFromInt(1496), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8164 | // __builtin_ppc_fnmsub | |
| 8165 | .{ .tag = @enumFromInt(1497), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8166 | // __builtin_ppc_fnmsubs | |
| 8167 | .{ .tag = @enumFromInt(1498), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8168 | // __builtin_ppc_fre | |
| 8169 | .{ .tag = @enumFromInt(1499), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8170 | // __builtin_ppc_fres | |
| 8171 | .{ .tag = @enumFromInt(1500), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8172 | // __builtin_ppc_fric | |
| 8173 | .{ .tag = @enumFromInt(1501), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8174 | // __builtin_ppc_frim | |
| 8175 | .{ .tag = @enumFromInt(1502), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8176 | // __builtin_ppc_frims | |
| 8177 | .{ .tag = @enumFromInt(1503), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8178 | // __builtin_ppc_frin | |
| 8179 | .{ .tag = @enumFromInt(1504), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8180 | // __builtin_ppc_frins | |
| 8181 | .{ .tag = @enumFromInt(1505), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8182 | // __builtin_ppc_frip | |
| 8183 | .{ .tag = @enumFromInt(1506), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8184 | // __builtin_ppc_frips | |
| 8185 | .{ .tag = @enumFromInt(1507), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8186 | // __builtin_ppc_friz | |
| 8187 | .{ .tag = @enumFromInt(1508), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8188 | // __builtin_ppc_frizs | |
| 8189 | .{ .tag = @enumFromInt(1509), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8190 | // __builtin_ppc_frsqrte | |
| 8191 | .{ .tag = @enumFromInt(1510), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8192 | // __builtin_ppc_frsqrtes | |
| 8193 | .{ .tag = @enumFromInt(1511), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8194 | // __builtin_ppc_fsel | |
| 8195 | .{ .tag = @enumFromInt(1512), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8196 | // __builtin_ppc_fsels | |
| 8197 | .{ .tag = @enumFromInt(1513), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8198 | // __builtin_ppc_fsqrt | |
| 8199 | .{ .tag = @enumFromInt(1514), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8200 | // __builtin_ppc_fsqrts | |
| 8201 | .{ .tag = @enumFromInt(1515), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8202 | // __builtin_ppc_get_timebase | |
| 8203 | .{ .tag = @enumFromInt(1516), .properties = .{ .param_str = "ULLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8204 | // __builtin_ppc_iospace_eieio | |
| 8205 | .{ .tag = @enumFromInt(1517), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8206 | // __builtin_ppc_iospace_lwsync | |
| 8207 | .{ .tag = @enumFromInt(1518), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8208 | // __builtin_ppc_iospace_sync | |
| 8209 | .{ .tag = @enumFromInt(1519), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8210 | // __builtin_ppc_isync | |
| 8211 | .{ .tag = @enumFromInt(1520), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8212 | // __builtin_ppc_ldarx | |
| 8213 | .{ .tag = @enumFromInt(1521), .properties = .{ .param_str = "LiLiD*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8214 | // __builtin_ppc_load2r | |
| 8215 | .{ .tag = @enumFromInt(1522), .properties = .{ .param_str = "UsUs*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8216 | // __builtin_ppc_load4r | |
| 8217 | .{ .tag = @enumFromInt(1523), .properties = .{ .param_str = "UiUi*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8218 | // __builtin_ppc_lwarx | |
| 8219 | .{ .tag = @enumFromInt(1524), .properties = .{ .param_str = "iiD*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8220 | // __builtin_ppc_lwsync | |
| 8221 | .{ .tag = @enumFromInt(1525), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8222 | // __builtin_ppc_maxfe | |
| 8223 | .{ .tag = @enumFromInt(1526), .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 8224 | // __builtin_ppc_maxfl | |
| 8225 | .{ .tag = @enumFromInt(1527), .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 8226 | // __builtin_ppc_maxfs | |
| 8227 | .{ .tag = @enumFromInt(1528), .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 8228 | // __builtin_ppc_mfmsr | |
| 8229 | .{ .tag = @enumFromInt(1529), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8230 | // __builtin_ppc_mfspr | |
| 8231 | .{ .tag = @enumFromInt(1530), .properties = .{ .param_str = "ULiIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8232 | // __builtin_ppc_mftbu | |
| 8233 | .{ .tag = @enumFromInt(1531), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8234 | // __builtin_ppc_minfe | |
| 8235 | .{ .tag = @enumFromInt(1532), .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 8236 | // __builtin_ppc_minfl | |
| 8237 | .{ .tag = @enumFromInt(1533), .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 8238 | // __builtin_ppc_minfs | |
| 8239 | .{ .tag = @enumFromInt(1534), .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 8240 | // __builtin_ppc_mtfsb0 | |
| 8241 | .{ .tag = @enumFromInt(1535), .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8242 | // __builtin_ppc_mtfsb1 | |
| 8243 | .{ .tag = @enumFromInt(1536), .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8244 | // __builtin_ppc_mtfsf | |
| 8245 | .{ .tag = @enumFromInt(1537), .properties = .{ .param_str = "vUIiUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8246 | // __builtin_ppc_mtfsfi | |
| 8247 | .{ .tag = @enumFromInt(1538), .properties = .{ .param_str = "vUIiUIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8248 | // __builtin_ppc_mtmsr | |
| 8249 | .{ .tag = @enumFromInt(1539), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8250 | // __builtin_ppc_mtspr | |
| 8251 | .{ .tag = @enumFromInt(1540), .properties = .{ .param_str = "vIiULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8252 | // __builtin_ppc_mulhd | |
| 8253 | .{ .tag = @enumFromInt(1541), .properties = .{ .param_str = "LLiLiLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8254 | // __builtin_ppc_mulhdu | |
| 8255 | .{ .tag = @enumFromInt(1542), .properties = .{ .param_str = "ULLiULiULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8256 | // __builtin_ppc_mulhw | |
| 8257 | .{ .tag = @enumFromInt(1543), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8258 | // __builtin_ppc_mulhwu | |
| 8259 | .{ .tag = @enumFromInt(1544), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8260 | // __builtin_ppc_popcntb | |
| 8261 | .{ .tag = @enumFromInt(1545), .properties = .{ .param_str = "ULiULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8262 | // __builtin_ppc_poppar4 | |
| 8263 | .{ .tag = @enumFromInt(1546), .properties = .{ .param_str = "iUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8264 | // __builtin_ppc_poppar8 | |
| 8265 | .{ .tag = @enumFromInt(1547), .properties = .{ .param_str = "iULLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8266 | // __builtin_ppc_rdlam | |
| 8267 | .{ .tag = @enumFromInt(1548), .properties = .{ .param_str = "UWiUWiUWiUWIi", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, | |
| 8268 | // __builtin_ppc_recipdivd | |
| 8269 | .{ .tag = @enumFromInt(1549), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8270 | // __builtin_ppc_recipdivf | |
| 8271 | .{ .tag = @enumFromInt(1550), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8272 | // __builtin_ppc_rldimi | |
| 8273 | .{ .tag = @enumFromInt(1551), .properties = .{ .param_str = "ULLiULLiULLiIUiIULLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8274 | // __builtin_ppc_rlwimi | |
| 8275 | .{ .tag = @enumFromInt(1552), .properties = .{ .param_str = "UiUiUiIUiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8276 | // __builtin_ppc_rlwnm | |
| 8277 | .{ .tag = @enumFromInt(1553), .properties = .{ .param_str = "UiUiUiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8278 | // __builtin_ppc_rsqrtd | |
| 8279 | .{ .tag = @enumFromInt(1554), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8280 | // __builtin_ppc_rsqrtf | |
| 8281 | .{ .tag = @enumFromInt(1555), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8282 | // __builtin_ppc_stdcx | |
| 8283 | .{ .tag = @enumFromInt(1556), .properties = .{ .param_str = "iLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8284 | // __builtin_ppc_stfiw | |
| 8285 | .{ .tag = @enumFromInt(1557), .properties = .{ .param_str = "viC*d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8286 | // __builtin_ppc_store2r | |
| 8287 | .{ .tag = @enumFromInt(1558), .properties = .{ .param_str = "vUiUs*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8288 | // __builtin_ppc_store4r | |
| 8289 | .{ .tag = @enumFromInt(1559), .properties = .{ .param_str = "vUiUi*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8290 | // __builtin_ppc_stwcx | |
| 8291 | .{ .tag = @enumFromInt(1560), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8292 | // __builtin_ppc_swdiv | |
| 8293 | .{ .tag = @enumFromInt(1561), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8294 | // __builtin_ppc_swdiv_nochk | |
| 8295 | .{ .tag = @enumFromInt(1562), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8296 | // __builtin_ppc_swdivs | |
| 8297 | .{ .tag = @enumFromInt(1563), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8298 | // __builtin_ppc_swdivs_nochk | |
| 8299 | .{ .tag = @enumFromInt(1564), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8300 | // __builtin_ppc_sync | |
| 8301 | .{ .tag = @enumFromInt(1565), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8302 | // __builtin_ppc_tdw | |
| 8303 | .{ .tag = @enumFromInt(1566), .properties = .{ .param_str = "vLLiLLiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8304 | // __builtin_ppc_trap | |
| 8305 | .{ .tag = @enumFromInt(1567), .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8306 | // __builtin_ppc_trapd | |
| 8307 | .{ .tag = @enumFromInt(1568), .properties = .{ .param_str = "vLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8308 | // __builtin_ppc_tw | |
| 8309 | .{ .tag = @enumFromInt(1569), .properties = .{ .param_str = "viiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8310 | // __builtin_prefetch | |
| 8311 | .{ .tag = @enumFromInt(1570), .properties = .{ .param_str = "vvC*.", .attributes = .{ .@"const" = true } } }, | |
| 8312 | // __builtin_preserve_access_index | |
| 8313 | .{ .tag = @enumFromInt(1571), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 8314 | // __builtin_printf | |
| 8315 | .{ .tag = @enumFromInt(1572), .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf } } }, | |
| 8316 | // __builtin_ptx_get_image_channel_data_typei_ | |
| 8317 | .{ .tag = @enumFromInt(1573), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8318 | // __builtin_ptx_get_image_channel_orderi_ | |
| 8319 | .{ .tag = @enumFromInt(1574), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8320 | // __builtin_ptx_get_image_depthi_ | |
| 8321 | .{ .tag = @enumFromInt(1575), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8322 | // __builtin_ptx_get_image_heighti_ | |
| 8323 | .{ .tag = @enumFromInt(1576), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8324 | // __builtin_ptx_get_image_widthi_ | |
| 8325 | .{ .tag = @enumFromInt(1577), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8326 | // __builtin_ptx_read_image2Dff_ | |
| 8327 | .{ .tag = @enumFromInt(1578), .properties = .{ .param_str = "V4fiiff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8328 | // __builtin_ptx_read_image2Dfi_ | |
| 8329 | .{ .tag = @enumFromInt(1579), .properties = .{ .param_str = "V4fiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8330 | // __builtin_ptx_read_image2Dif_ | |
| 8331 | .{ .tag = @enumFromInt(1580), .properties = .{ .param_str = "V4iiiff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8332 | // __builtin_ptx_read_image2Dii_ | |
| 8333 | .{ .tag = @enumFromInt(1581), .properties = .{ .param_str = "V4iiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8334 | // __builtin_ptx_read_image3Dff_ | |
| 8335 | .{ .tag = @enumFromInt(1582), .properties = .{ .param_str = "V4fiiffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8336 | // __builtin_ptx_read_image3Dfi_ | |
| 8337 | .{ .tag = @enumFromInt(1583), .properties = .{ .param_str = "V4fiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8338 | // __builtin_ptx_read_image3Dif_ | |
| 8339 | .{ .tag = @enumFromInt(1584), .properties = .{ .param_str = "V4iiiffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8340 | // __builtin_ptx_read_image3Dii_ | |
| 8341 | .{ .tag = @enumFromInt(1585), .properties = .{ .param_str = "V4iiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8342 | // __builtin_ptx_write_image2Df_ | |
| 8343 | .{ .tag = @enumFromInt(1586), .properties = .{ .param_str = "viiiffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8344 | // __builtin_ptx_write_image2Di_ | |
| 8345 | .{ .tag = @enumFromInt(1587), .properties = .{ .param_str = "viiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8346 | // __builtin_ptx_write_image2Dui_ | |
| 8347 | .{ .tag = @enumFromInt(1588), .properties = .{ .param_str = "viiiUiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 8348 | // __builtin_r600_implicitarg_ptr | |
| 8349 | .{ .tag = @enumFromInt(1589), .properties = .{ .param_str = "Uc*7", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8350 | // __builtin_r600_read_tgid_x | |
| 8351 | .{ .tag = @enumFromInt(1590), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8352 | // __builtin_r600_read_tgid_y | |
| 8353 | .{ .tag = @enumFromInt(1591), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8354 | // __builtin_r600_read_tgid_z | |
| 8355 | .{ .tag = @enumFromInt(1592), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8356 | // __builtin_r600_read_tidig_x | |
| 8357 | .{ .tag = @enumFromInt(1593), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8358 | // __builtin_r600_read_tidig_y | |
| 8359 | .{ .tag = @enumFromInt(1594), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8360 | // __builtin_r600_read_tidig_z | |
| 8361 | .{ .tag = @enumFromInt(1595), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8362 | // __builtin_r600_recipsqrt_ieee | |
| 8363 | .{ .tag = @enumFromInt(1596), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8364 | // __builtin_r600_recipsqrt_ieeef | |
| 8365 | .{ .tag = @enumFromInt(1597), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 8366 | // __builtin_readcyclecounter | |
| 8367 | .{ .tag = @enumFromInt(1598), .properties = .{ .param_str = "ULLi" } }, | |
| 8368 | // __builtin_readflm | |
| 8369 | .{ .tag = @enumFromInt(1599), .properties = .{ .param_str = "d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8370 | // __builtin_realloc | |
| 8371 | .{ .tag = @enumFromInt(1600), .properties = .{ .param_str = "v*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8372 | // __builtin_reduce_add | |
| 8373 | .{ .tag = @enumFromInt(1601), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8374 | // __builtin_reduce_and | |
| 8375 | .{ .tag = @enumFromInt(1602), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8376 | // __builtin_reduce_max | |
| 8377 | .{ .tag = @enumFromInt(1603), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8378 | // __builtin_reduce_min | |
| 8379 | .{ .tag = @enumFromInt(1604), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8380 | // __builtin_reduce_mul | |
| 8381 | .{ .tag = @enumFromInt(1605), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8382 | // __builtin_reduce_or | |
| 8383 | .{ .tag = @enumFromInt(1606), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8384 | // __builtin_reduce_xor | |
| 8385 | .{ .tag = @enumFromInt(1607), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8386 | // __builtin_remainder | |
| 8387 | .{ .tag = @enumFromInt(1608), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8388 | // __builtin_remainderf | |
| 8389 | .{ .tag = @enumFromInt(1609), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8390 | // __builtin_remainderf128 | |
| 8391 | .{ .tag = @enumFromInt(1610), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8392 | // __builtin_remainderl | |
| 8393 | .{ .tag = @enumFromInt(1611), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8394 | // __builtin_remquo | |
| 8395 | .{ .tag = @enumFromInt(1612), .properties = .{ .param_str = "dddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8396 | // __builtin_remquof | |
| 8397 | .{ .tag = @enumFromInt(1613), .properties = .{ .param_str = "fffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8398 | // __builtin_remquof128 | |
| 8399 | .{ .tag = @enumFromInt(1614), .properties = .{ .param_str = "LLdLLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8400 | // __builtin_remquol | |
| 8401 | .{ .tag = @enumFromInt(1615), .properties = .{ .param_str = "LdLdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8402 | // __builtin_return_address | |
| 8403 | .{ .tag = @enumFromInt(1616), .properties = .{ .param_str = "v*IUi" } }, | |
| 8404 | // __builtin_rindex | |
| 8405 | .{ .tag = @enumFromInt(1617), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8406 | // __builtin_rint | |
| 8407 | .{ .tag = @enumFromInt(1618), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8408 | // __builtin_rintf | |
| 8409 | .{ .tag = @enumFromInt(1619), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8410 | // __builtin_rintf128 | |
| 8411 | .{ .tag = @enumFromInt(1620), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8412 | // __builtin_rintf16 | |
| 8413 | .{ .tag = @enumFromInt(1621), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8414 | // __builtin_rintl | |
| 8415 | .{ .tag = @enumFromInt(1622), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8416 | // __builtin_rotateleft16 | |
| 8417 | .{ .tag = @enumFromInt(1623), .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8418 | // __builtin_rotateleft32 | |
| 8419 | .{ .tag = @enumFromInt(1624), .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8420 | // __builtin_rotateleft64 | |
| 8421 | .{ .tag = @enumFromInt(1625), .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8422 | // __builtin_rotateleft8 | |
| 8423 | .{ .tag = @enumFromInt(1626), .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8424 | // __builtin_rotateright16 | |
| 8425 | .{ .tag = @enumFromInt(1627), .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8426 | // __builtin_rotateright32 | |
| 8427 | .{ .tag = @enumFromInt(1628), .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8428 | // __builtin_rotateright64 | |
| 8429 | .{ .tag = @enumFromInt(1629), .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8430 | // __builtin_rotateright8 | |
| 8431 | .{ .tag = @enumFromInt(1630), .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 8432 | // __builtin_round | |
| 8433 | .{ .tag = @enumFromInt(1631), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8434 | // __builtin_roundeven | |
| 8435 | .{ .tag = @enumFromInt(1632), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8436 | // __builtin_roundevenf | |
| 8437 | .{ .tag = @enumFromInt(1633), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8438 | // __builtin_roundevenf128 | |
| 8439 | .{ .tag = @enumFromInt(1634), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8440 | // __builtin_roundevenf16 | |
| 8441 | .{ .tag = @enumFromInt(1635), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8442 | // __builtin_roundevenl | |
| 8443 | .{ .tag = @enumFromInt(1636), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8444 | // __builtin_roundf | |
| 8445 | .{ .tag = @enumFromInt(1637), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8446 | // __builtin_roundf128 | |
| 8447 | .{ .tag = @enumFromInt(1638), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8448 | // __builtin_roundf16 | |
| 8449 | .{ .tag = @enumFromInt(1639), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8450 | // __builtin_roundl | |
| 8451 | .{ .tag = @enumFromInt(1640), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8452 | // __builtin_sadd_overflow | |
| 8453 | .{ .tag = @enumFromInt(1641), .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8454 | // __builtin_saddl_overflow | |
| 8455 | .{ .tag = @enumFromInt(1642), .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8456 | // __builtin_saddll_overflow | |
| 8457 | .{ .tag = @enumFromInt(1643), .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8458 | // __builtin_scalbln | |
| 8459 | .{ .tag = @enumFromInt(1644), .properties = .{ .param_str = "ddLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8460 | // __builtin_scalblnf | |
| 8461 | .{ .tag = @enumFromInt(1645), .properties = .{ .param_str = "ffLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8462 | // __builtin_scalblnf128 | |
| 8463 | .{ .tag = @enumFromInt(1646), .properties = .{ .param_str = "LLdLLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8464 | // __builtin_scalblnl | |
| 8465 | .{ .tag = @enumFromInt(1647), .properties = .{ .param_str = "LdLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8466 | // __builtin_scalbn | |
| 8467 | .{ .tag = @enumFromInt(1648), .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8468 | // __builtin_scalbnf | |
| 8469 | .{ .tag = @enumFromInt(1649), .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8470 | // __builtin_scalbnf128 | |
| 8471 | .{ .tag = @enumFromInt(1650), .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8472 | // __builtin_scalbnl | |
| 8473 | .{ .tag = @enumFromInt(1651), .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8474 | // __builtin_scanf | |
| 8475 | .{ .tag = @enumFromInt(1652), .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf } } }, | |
| 8476 | // __builtin_set_flt_rounds | |
| 8477 | .{ .tag = @enumFromInt(1653), .properties = .{ .param_str = "vi" } }, | |
| 8478 | // __builtin_setflm | |
| 8479 | .{ .tag = @enumFromInt(1654), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8480 | // __builtin_setjmp | |
| 8481 | .{ .tag = @enumFromInt(1655), .properties = .{ .param_str = "iv**", .attributes = .{ .returns_twice = true } } }, | |
| 8482 | // __builtin_setps | |
| 8483 | .{ .tag = @enumFromInt(1656), .properties = .{ .param_str = "vUiUi", .target_set = TargetSet.initOne(.xcore) } }, | |
| 8484 | // __builtin_setrnd | |
| 8485 | .{ .tag = @enumFromInt(1657), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8486 | // __builtin_shufflevector | |
| 8487 | .{ .tag = @enumFromInt(1658), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 8488 | // __builtin_signbit | |
| 8489 | .{ .tag = @enumFromInt(1659), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8490 | // __builtin_signbitf | |
| 8491 | .{ .tag = @enumFromInt(1660), .properties = .{ .param_str = "if", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8492 | // __builtin_signbitl | |
| 8493 | .{ .tag = @enumFromInt(1661), .properties = .{ .param_str = "iLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8494 | // __builtin_sin | |
| 8495 | .{ .tag = @enumFromInt(1662), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8496 | // __builtin_sinf | |
| 8497 | .{ .tag = @enumFromInt(1663), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8498 | // __builtin_sinf128 | |
| 8499 | .{ .tag = @enumFromInt(1664), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8500 | // __builtin_sinf16 | |
| 8501 | .{ .tag = @enumFromInt(1665), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8502 | // __builtin_sinh | |
| 8503 | .{ .tag = @enumFromInt(1666), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8504 | // __builtin_sinhf | |
| 8505 | .{ .tag = @enumFromInt(1667), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8506 | // __builtin_sinhf128 | |
| 8507 | .{ .tag = @enumFromInt(1668), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8508 | // __builtin_sinhl | |
| 8509 | .{ .tag = @enumFromInt(1669), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8510 | // __builtin_sinl | |
| 8511 | .{ .tag = @enumFromInt(1670), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8512 | // __builtin_smul_overflow | |
| 8513 | .{ .tag = @enumFromInt(1671), .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8514 | // __builtin_smull_overflow | |
| 8515 | .{ .tag = @enumFromInt(1672), .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8516 | // __builtin_smulll_overflow | |
| 8517 | .{ .tag = @enumFromInt(1673), .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8518 | // __builtin_snprintf | |
| 8519 | .{ .tag = @enumFromInt(1674), .properties = .{ .param_str = "ic*RzcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, | |
| 8520 | // __builtin_sponentry | |
| 8521 | .{ .tag = @enumFromInt(1675), .properties = .{ .param_str = "v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 8522 | // __builtin_sprintf | |
| 8523 | .{ .tag = @enumFromInt(1676), .properties = .{ .param_str = "ic*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 8524 | // __builtin_sqrt | |
| 8525 | .{ .tag = @enumFromInt(1677), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8526 | // __builtin_sqrtf | |
| 8527 | .{ .tag = @enumFromInt(1678), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8528 | // __builtin_sqrtf128 | |
| 8529 | .{ .tag = @enumFromInt(1679), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8530 | // __builtin_sqrtf16 | |
| 8531 | .{ .tag = @enumFromInt(1680), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8532 | // __builtin_sqrtl | |
| 8533 | .{ .tag = @enumFromInt(1681), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8534 | // __builtin_sscanf | |
| 8535 | .{ .tag = @enumFromInt(1682), .properties = .{ .param_str = "icC*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 8536 | // __builtin_ssub_overflow | |
| 8537 | .{ .tag = @enumFromInt(1683), .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8538 | // __builtin_ssubl_overflow | |
| 8539 | .{ .tag = @enumFromInt(1684), .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8540 | // __builtin_ssubll_overflow | |
| 8541 | .{ .tag = @enumFromInt(1685), .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8542 | // __builtin_stdarg_start | |
| 8543 | .{ .tag = @enumFromInt(1686), .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, | |
| 8544 | // __builtin_stpcpy | |
| 8545 | .{ .tag = @enumFromInt(1687), .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8546 | // __builtin_stpncpy | |
| 8547 | .{ .tag = @enumFromInt(1688), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8548 | // __builtin_strcasecmp | |
| 8549 | .{ .tag = @enumFromInt(1689), .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8550 | // __builtin_strcat | |
| 8551 | .{ .tag = @enumFromInt(1690), .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8552 | // __builtin_strchr | |
| 8553 | .{ .tag = @enumFromInt(1691), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8554 | // __builtin_strcmp | |
| 8555 | .{ .tag = @enumFromInt(1692), .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8556 | // __builtin_strcpy | |
| 8557 | .{ .tag = @enumFromInt(1693), .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8558 | // __builtin_strcspn | |
| 8559 | .{ .tag = @enumFromInt(1694), .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8560 | // __builtin_strdup | |
| 8561 | .{ .tag = @enumFromInt(1695), .properties = .{ .param_str = "c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8562 | // __builtin_strlen | |
| 8563 | .{ .tag = @enumFromInt(1696), .properties = .{ .param_str = "zcC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8564 | // __builtin_strncasecmp | |
| 8565 | .{ .tag = @enumFromInt(1697), .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8566 | // __builtin_strncat | |
| 8567 | .{ .tag = @enumFromInt(1698), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8568 | // __builtin_strncmp | |
| 8569 | .{ .tag = @enumFromInt(1699), .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 8570 | // __builtin_strncpy | |
| 8571 | .{ .tag = @enumFromInt(1700), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8572 | // __builtin_strndup | |
| 8573 | .{ .tag = @enumFromInt(1701), .properties = .{ .param_str = "c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8574 | // __builtin_strpbrk | |
| 8575 | .{ .tag = @enumFromInt(1702), .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8576 | // __builtin_strrchr | |
| 8577 | .{ .tag = @enumFromInt(1703), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8578 | // __builtin_strspn | |
| 8579 | .{ .tag = @enumFromInt(1704), .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8580 | // __builtin_strstr | |
| 8581 | .{ .tag = @enumFromInt(1705), .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 8582 | // __builtin_sub_overflow | |
| 8583 | .{ .tag = @enumFromInt(1706), .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 8584 | // __builtin_subc | |
| 8585 | .{ .tag = @enumFromInt(1707), .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, | |
| 8586 | // __builtin_subcb | |
| 8587 | .{ .tag = @enumFromInt(1708), .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, | |
| 8588 | // __builtin_subcl | |
| 8589 | .{ .tag = @enumFromInt(1709), .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, | |
| 8590 | // __builtin_subcll | |
| 8591 | .{ .tag = @enumFromInt(1710), .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, | |
| 8592 | // __builtin_subcs | |
| 8593 | .{ .tag = @enumFromInt(1711), .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, | |
| 8594 | // __builtin_tan | |
| 8595 | .{ .tag = @enumFromInt(1712), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8596 | // __builtin_tanf | |
| 8597 | .{ .tag = @enumFromInt(1713), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8598 | // __builtin_tanf128 | |
| 8599 | .{ .tag = @enumFromInt(1714), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8600 | // __builtin_tanh | |
| 8601 | .{ .tag = @enumFromInt(1715), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8602 | // __builtin_tanhf | |
| 8603 | .{ .tag = @enumFromInt(1716), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8604 | // __builtin_tanhf128 | |
| 8605 | .{ .tag = @enumFromInt(1717), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8606 | // __builtin_tanhl | |
| 8607 | .{ .tag = @enumFromInt(1718), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8608 | // __builtin_tanl | |
| 8609 | .{ .tag = @enumFromInt(1719), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8610 | // __builtin_tgamma | |
| 8611 | .{ .tag = @enumFromInt(1720), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8612 | // __builtin_tgammaf | |
| 8613 | .{ .tag = @enumFromInt(1721), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8614 | // __builtin_tgammaf128 | |
| 8615 | .{ .tag = @enumFromInt(1722), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8616 | // __builtin_tgammal | |
| 8617 | .{ .tag = @enumFromInt(1723), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 8618 | // __builtin_thread_pointer | |
| 8619 | .{ .tag = @enumFromInt(1724), .properties = .{ .param_str = "v*", .attributes = .{ .@"const" = true } } }, | |
| 8620 | // __builtin_trap | |
| 8621 | .{ .tag = @enumFromInt(1725), .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, | |
| 8622 | // __builtin_trunc | |
| 8623 | .{ .tag = @enumFromInt(1726), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8624 | // __builtin_truncf | |
| 8625 | .{ .tag = @enumFromInt(1727), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8626 | // __builtin_truncf128 | |
| 8627 | .{ .tag = @enumFromInt(1728), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8628 | // __builtin_truncf16 | |
| 8629 | .{ .tag = @enumFromInt(1729), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8630 | // __builtin_truncl | |
| 8631 | .{ .tag = @enumFromInt(1730), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 8632 | // __builtin_uadd_overflow | |
| 8633 | .{ .tag = @enumFromInt(1731), .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8634 | // __builtin_uaddl_overflow | |
| 8635 | .{ .tag = @enumFromInt(1732), .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8636 | // __builtin_uaddll_overflow | |
| 8637 | .{ .tag = @enumFromInt(1733), .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8638 | // __builtin_umul_overflow | |
| 8639 | .{ .tag = @enumFromInt(1734), .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8640 | // __builtin_umull_overflow | |
| 8641 | .{ .tag = @enumFromInt(1735), .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8642 | // __builtin_umulll_overflow | |
| 8643 | .{ .tag = @enumFromInt(1736), .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8644 | // __builtin_unpack_longdouble | |
| 8645 | .{ .tag = @enumFromInt(1737), .properties = .{ .param_str = "dLdIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 8646 | // __builtin_unpredictable | |
| 8647 | .{ .tag = @enumFromInt(1738), .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true } } }, | |
| 8648 | // __builtin_unreachable | |
| 8649 | .{ .tag = @enumFromInt(1739), .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, | |
| 8650 | // __builtin_unwind_init | |
| 8651 | .{ .tag = @enumFromInt(1740), .properties = .{ .param_str = "v" } }, | |
| 8652 | // __builtin_usub_overflow | |
| 8653 | .{ .tag = @enumFromInt(1741), .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8654 | // __builtin_usubl_overflow | |
| 8655 | .{ .tag = @enumFromInt(1742), .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8656 | // __builtin_usubll_overflow | |
| 8657 | .{ .tag = @enumFromInt(1743), .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 8658 | // __builtin_va_copy | |
| 8659 | .{ .tag = @enumFromInt(1744), .properties = .{ .param_str = "vAA" } }, | |
| 8660 | // __builtin_va_end | |
| 8661 | .{ .tag = @enumFromInt(1745), .properties = .{ .param_str = "vA" } }, | |
| 8662 | // __builtin_va_start | |
| 8663 | .{ .tag = @enumFromInt(1746), .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, | |
| 8664 | // __builtin_ve_vl_andm_MMM | |
| 8665 | .{ .tag = @enumFromInt(1747), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8666 | // __builtin_ve_vl_andm_mmm | |
| 8667 | .{ .tag = @enumFromInt(1748), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8668 | // __builtin_ve_vl_eqvm_MMM | |
| 8669 | .{ .tag = @enumFromInt(1749), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8670 | // __builtin_ve_vl_eqvm_mmm | |
| 8671 | .{ .tag = @enumFromInt(1750), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8672 | // __builtin_ve_vl_extract_vm512l | |
| 8673 | .{ .tag = @enumFromInt(1751), .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, | |
| 8674 | // __builtin_ve_vl_extract_vm512u | |
| 8675 | .{ .tag = @enumFromInt(1752), .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, | |
| 8676 | // __builtin_ve_vl_fencec_s | |
| 8677 | .{ .tag = @enumFromInt(1753), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8678 | // __builtin_ve_vl_fencei | |
| 8679 | .{ .tag = @enumFromInt(1754), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8680 | // __builtin_ve_vl_fencem_s | |
| 8681 | .{ .tag = @enumFromInt(1755), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8682 | // __builtin_ve_vl_fidcr_sss | |
| 8683 | .{ .tag = @enumFromInt(1756), .properties = .{ .param_str = "LUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8684 | // __builtin_ve_vl_insert_vm512l | |
| 8685 | .{ .tag = @enumFromInt(1757), .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, | |
| 8686 | // __builtin_ve_vl_insert_vm512u | |
| 8687 | .{ .tag = @enumFromInt(1758), .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, | |
| 8688 | // __builtin_ve_vl_lcr_sss | |
| 8689 | .{ .tag = @enumFromInt(1759), .properties = .{ .param_str = "LUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8690 | // __builtin_ve_vl_lsv_vvss | |
| 8691 | .{ .tag = @enumFromInt(1760), .properties = .{ .param_str = "V256dV256dUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8692 | // __builtin_ve_vl_lvm_MMss | |
| 8693 | .{ .tag = @enumFromInt(1761), .properties = .{ .param_str = "V512bV512bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8694 | // __builtin_ve_vl_lvm_mmss | |
| 8695 | .{ .tag = @enumFromInt(1762), .properties = .{ .param_str = "V256bV256bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8696 | // __builtin_ve_vl_lvsd_svs | |
| 8697 | .{ .tag = @enumFromInt(1763), .properties = .{ .param_str = "dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8698 | // __builtin_ve_vl_lvsl_svs | |
| 8699 | .{ .tag = @enumFromInt(1764), .properties = .{ .param_str = "LUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8700 | // __builtin_ve_vl_lvss_svs | |
| 8701 | .{ .tag = @enumFromInt(1765), .properties = .{ .param_str = "fV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8702 | // __builtin_ve_vl_lzvm_sml | |
| 8703 | .{ .tag = @enumFromInt(1766), .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8704 | // __builtin_ve_vl_negm_MM | |
| 8705 | .{ .tag = @enumFromInt(1767), .properties = .{ .param_str = "V512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8706 | // __builtin_ve_vl_negm_mm | |
| 8707 | .{ .tag = @enumFromInt(1768), .properties = .{ .param_str = "V256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8708 | // __builtin_ve_vl_nndm_MMM | |
| 8709 | .{ .tag = @enumFromInt(1769), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8710 | // __builtin_ve_vl_nndm_mmm | |
| 8711 | .{ .tag = @enumFromInt(1770), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8712 | // __builtin_ve_vl_orm_MMM | |
| 8713 | .{ .tag = @enumFromInt(1771), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8714 | // __builtin_ve_vl_orm_mmm | |
| 8715 | .{ .tag = @enumFromInt(1772), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8716 | // __builtin_ve_vl_pack_f32a | |
| 8717 | .{ .tag = @enumFromInt(1773), .properties = .{ .param_str = "ULifC*", .target_set = TargetSet.initOne(.ve) } }, | |
| 8718 | // __builtin_ve_vl_pack_f32p | |
| 8719 | .{ .tag = @enumFromInt(1774), .properties = .{ .param_str = "ULifC*fC*", .target_set = TargetSet.initOne(.ve) } }, | |
| 8720 | // __builtin_ve_vl_pcvm_sml | |
| 8721 | .{ .tag = @enumFromInt(1775), .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8722 | // __builtin_ve_vl_pfchv_ssl | |
| 8723 | .{ .tag = @enumFromInt(1776), .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8724 | // __builtin_ve_vl_pfchvnc_ssl | |
| 8725 | .{ .tag = @enumFromInt(1777), .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8726 | // __builtin_ve_vl_pvadds_vsvMvl | |
| 8727 | .{ .tag = @enumFromInt(1778), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8728 | // __builtin_ve_vl_pvadds_vsvl | |
| 8729 | .{ .tag = @enumFromInt(1779), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8730 | // __builtin_ve_vl_pvadds_vsvvl | |
| 8731 | .{ .tag = @enumFromInt(1780), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8732 | // __builtin_ve_vl_pvadds_vvvMvl | |
| 8733 | .{ .tag = @enumFromInt(1781), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8734 | // __builtin_ve_vl_pvadds_vvvl | |
| 8735 | .{ .tag = @enumFromInt(1782), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8736 | // __builtin_ve_vl_pvadds_vvvvl | |
| 8737 | .{ .tag = @enumFromInt(1783), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8738 | // __builtin_ve_vl_pvaddu_vsvMvl | |
| 8739 | .{ .tag = @enumFromInt(1784), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8740 | // __builtin_ve_vl_pvaddu_vsvl | |
| 8741 | .{ .tag = @enumFromInt(1785), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8742 | // __builtin_ve_vl_pvaddu_vsvvl | |
| 8743 | .{ .tag = @enumFromInt(1786), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8744 | // __builtin_ve_vl_pvaddu_vvvMvl | |
| 8745 | .{ .tag = @enumFromInt(1787), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8746 | // __builtin_ve_vl_pvaddu_vvvl | |
| 8747 | .{ .tag = @enumFromInt(1788), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8748 | // __builtin_ve_vl_pvaddu_vvvvl | |
| 8749 | .{ .tag = @enumFromInt(1789), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8750 | // __builtin_ve_vl_pvand_vsvMvl | |
| 8751 | .{ .tag = @enumFromInt(1790), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8752 | // __builtin_ve_vl_pvand_vsvl | |
| 8753 | .{ .tag = @enumFromInt(1791), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8754 | // __builtin_ve_vl_pvand_vsvvl | |
| 8755 | .{ .tag = @enumFromInt(1792), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8756 | // __builtin_ve_vl_pvand_vvvMvl | |
| 8757 | .{ .tag = @enumFromInt(1793), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8758 | // __builtin_ve_vl_pvand_vvvl | |
| 8759 | .{ .tag = @enumFromInt(1794), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8760 | // __builtin_ve_vl_pvand_vvvvl | |
| 8761 | .{ .tag = @enumFromInt(1795), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8762 | // __builtin_ve_vl_pvbrd_vsMvl | |
| 8763 | .{ .tag = @enumFromInt(1796), .properties = .{ .param_str = "V256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8764 | // __builtin_ve_vl_pvbrd_vsl | |
| 8765 | .{ .tag = @enumFromInt(1797), .properties = .{ .param_str = "V256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8766 | // __builtin_ve_vl_pvbrd_vsvl | |
| 8767 | .{ .tag = @enumFromInt(1798), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8768 | // __builtin_ve_vl_pvbrv_vvMvl | |
| 8769 | .{ .tag = @enumFromInt(1799), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8770 | // __builtin_ve_vl_pvbrv_vvl | |
| 8771 | .{ .tag = @enumFromInt(1800), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8772 | // __builtin_ve_vl_pvbrv_vvvl | |
| 8773 | .{ .tag = @enumFromInt(1801), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8774 | // __builtin_ve_vl_pvbrvlo_vvl | |
| 8775 | .{ .tag = @enumFromInt(1802), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8776 | // __builtin_ve_vl_pvbrvlo_vvmvl | |
| 8777 | .{ .tag = @enumFromInt(1803), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8778 | // __builtin_ve_vl_pvbrvlo_vvvl | |
| 8779 | .{ .tag = @enumFromInt(1804), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8780 | // __builtin_ve_vl_pvbrvup_vvl | |
| 8781 | .{ .tag = @enumFromInt(1805), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8782 | // __builtin_ve_vl_pvbrvup_vvmvl | |
| 8783 | .{ .tag = @enumFromInt(1806), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8784 | // __builtin_ve_vl_pvbrvup_vvvl | |
| 8785 | .{ .tag = @enumFromInt(1807), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8786 | // __builtin_ve_vl_pvcmps_vsvMvl | |
| 8787 | .{ .tag = @enumFromInt(1808), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8788 | // __builtin_ve_vl_pvcmps_vsvl | |
| 8789 | .{ .tag = @enumFromInt(1809), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8790 | // __builtin_ve_vl_pvcmps_vsvvl | |
| 8791 | .{ .tag = @enumFromInt(1810), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8792 | // __builtin_ve_vl_pvcmps_vvvMvl | |
| 8793 | .{ .tag = @enumFromInt(1811), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8794 | // __builtin_ve_vl_pvcmps_vvvl | |
| 8795 | .{ .tag = @enumFromInt(1812), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8796 | // __builtin_ve_vl_pvcmps_vvvvl | |
| 8797 | .{ .tag = @enumFromInt(1813), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8798 | // __builtin_ve_vl_pvcmpu_vsvMvl | |
| 8799 | .{ .tag = @enumFromInt(1814), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8800 | // __builtin_ve_vl_pvcmpu_vsvl | |
| 8801 | .{ .tag = @enumFromInt(1815), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8802 | // __builtin_ve_vl_pvcmpu_vsvvl | |
| 8803 | .{ .tag = @enumFromInt(1816), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8804 | // __builtin_ve_vl_pvcmpu_vvvMvl | |
| 8805 | .{ .tag = @enumFromInt(1817), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8806 | // __builtin_ve_vl_pvcmpu_vvvl | |
| 8807 | .{ .tag = @enumFromInt(1818), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8808 | // __builtin_ve_vl_pvcmpu_vvvvl | |
| 8809 | .{ .tag = @enumFromInt(1819), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8810 | // __builtin_ve_vl_pvcvtsw_vvl | |
| 8811 | .{ .tag = @enumFromInt(1820), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8812 | // __builtin_ve_vl_pvcvtsw_vvvl | |
| 8813 | .{ .tag = @enumFromInt(1821), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8814 | // __builtin_ve_vl_pvcvtws_vvMvl | |
| 8815 | .{ .tag = @enumFromInt(1822), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8816 | // __builtin_ve_vl_pvcvtws_vvl | |
| 8817 | .{ .tag = @enumFromInt(1823), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8818 | // __builtin_ve_vl_pvcvtws_vvvl | |
| 8819 | .{ .tag = @enumFromInt(1824), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8820 | // __builtin_ve_vl_pvcvtwsrz_vvMvl | |
| 8821 | .{ .tag = @enumFromInt(1825), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8822 | // __builtin_ve_vl_pvcvtwsrz_vvl | |
| 8823 | .{ .tag = @enumFromInt(1826), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8824 | // __builtin_ve_vl_pvcvtwsrz_vvvl | |
| 8825 | .{ .tag = @enumFromInt(1827), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8826 | // __builtin_ve_vl_pveqv_vsvMvl | |
| 8827 | .{ .tag = @enumFromInt(1828), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8828 | // __builtin_ve_vl_pveqv_vsvl | |
| 8829 | .{ .tag = @enumFromInt(1829), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8830 | // __builtin_ve_vl_pveqv_vsvvl | |
| 8831 | .{ .tag = @enumFromInt(1830), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8832 | // __builtin_ve_vl_pveqv_vvvMvl | |
| 8833 | .{ .tag = @enumFromInt(1831), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8834 | // __builtin_ve_vl_pveqv_vvvl | |
| 8835 | .{ .tag = @enumFromInt(1832), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8836 | // __builtin_ve_vl_pveqv_vvvvl | |
| 8837 | .{ .tag = @enumFromInt(1833), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8838 | // __builtin_ve_vl_pvfadd_vsvMvl | |
| 8839 | .{ .tag = @enumFromInt(1834), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8840 | // __builtin_ve_vl_pvfadd_vsvl | |
| 8841 | .{ .tag = @enumFromInt(1835), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8842 | // __builtin_ve_vl_pvfadd_vsvvl | |
| 8843 | .{ .tag = @enumFromInt(1836), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8844 | // __builtin_ve_vl_pvfadd_vvvMvl | |
| 8845 | .{ .tag = @enumFromInt(1837), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8846 | // __builtin_ve_vl_pvfadd_vvvl | |
| 8847 | .{ .tag = @enumFromInt(1838), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8848 | // __builtin_ve_vl_pvfadd_vvvvl | |
| 8849 | .{ .tag = @enumFromInt(1839), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8850 | // __builtin_ve_vl_pvfcmp_vsvMvl | |
| 8851 | .{ .tag = @enumFromInt(1840), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8852 | // __builtin_ve_vl_pvfcmp_vsvl | |
| 8853 | .{ .tag = @enumFromInt(1841), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8854 | // __builtin_ve_vl_pvfcmp_vsvvl | |
| 8855 | .{ .tag = @enumFromInt(1842), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8856 | // __builtin_ve_vl_pvfcmp_vvvMvl | |
| 8857 | .{ .tag = @enumFromInt(1843), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8858 | // __builtin_ve_vl_pvfcmp_vvvl | |
| 8859 | .{ .tag = @enumFromInt(1844), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8860 | // __builtin_ve_vl_pvfcmp_vvvvl | |
| 8861 | .{ .tag = @enumFromInt(1845), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8862 | // __builtin_ve_vl_pvfmad_vsvvMvl | |
| 8863 | .{ .tag = @enumFromInt(1846), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8864 | // __builtin_ve_vl_pvfmad_vsvvl | |
| 8865 | .{ .tag = @enumFromInt(1847), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8866 | // __builtin_ve_vl_pvfmad_vsvvvl | |
| 8867 | .{ .tag = @enumFromInt(1848), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8868 | // __builtin_ve_vl_pvfmad_vvsvMvl | |
| 8869 | .{ .tag = @enumFromInt(1849), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8870 | // __builtin_ve_vl_pvfmad_vvsvl | |
| 8871 | .{ .tag = @enumFromInt(1850), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8872 | // __builtin_ve_vl_pvfmad_vvsvvl | |
| 8873 | .{ .tag = @enumFromInt(1851), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8874 | // __builtin_ve_vl_pvfmad_vvvvMvl | |
| 8875 | .{ .tag = @enumFromInt(1852), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8876 | // __builtin_ve_vl_pvfmad_vvvvl | |
| 8877 | .{ .tag = @enumFromInt(1853), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8878 | // __builtin_ve_vl_pvfmad_vvvvvl | |
| 8879 | .{ .tag = @enumFromInt(1854), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8880 | // __builtin_ve_vl_pvfmax_vsvMvl | |
| 8881 | .{ .tag = @enumFromInt(1855), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8882 | // __builtin_ve_vl_pvfmax_vsvl | |
| 8883 | .{ .tag = @enumFromInt(1856), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8884 | // __builtin_ve_vl_pvfmax_vsvvl | |
| 8885 | .{ .tag = @enumFromInt(1857), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8886 | // __builtin_ve_vl_pvfmax_vvvMvl | |
| 8887 | .{ .tag = @enumFromInt(1858), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8888 | // __builtin_ve_vl_pvfmax_vvvl | |
| 8889 | .{ .tag = @enumFromInt(1859), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8890 | // __builtin_ve_vl_pvfmax_vvvvl | |
| 8891 | .{ .tag = @enumFromInt(1860), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8892 | // __builtin_ve_vl_pvfmin_vsvMvl | |
| 8893 | .{ .tag = @enumFromInt(1861), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8894 | // __builtin_ve_vl_pvfmin_vsvl | |
| 8895 | .{ .tag = @enumFromInt(1862), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8896 | // __builtin_ve_vl_pvfmin_vsvvl | |
| 8897 | .{ .tag = @enumFromInt(1863), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8898 | // __builtin_ve_vl_pvfmin_vvvMvl | |
| 8899 | .{ .tag = @enumFromInt(1864), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8900 | // __builtin_ve_vl_pvfmin_vvvl | |
| 8901 | .{ .tag = @enumFromInt(1865), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8902 | // __builtin_ve_vl_pvfmin_vvvvl | |
| 8903 | .{ .tag = @enumFromInt(1866), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8904 | // __builtin_ve_vl_pvfmkaf_Ml | |
| 8905 | .{ .tag = @enumFromInt(1867), .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8906 | // __builtin_ve_vl_pvfmkat_Ml | |
| 8907 | .{ .tag = @enumFromInt(1868), .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8908 | // __builtin_ve_vl_pvfmkseq_MvMl | |
| 8909 | .{ .tag = @enumFromInt(1869), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8910 | // __builtin_ve_vl_pvfmkseq_Mvl | |
| 8911 | .{ .tag = @enumFromInt(1870), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8912 | // __builtin_ve_vl_pvfmkseqnan_MvMl | |
| 8913 | .{ .tag = @enumFromInt(1871), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8914 | // __builtin_ve_vl_pvfmkseqnan_Mvl | |
| 8915 | .{ .tag = @enumFromInt(1872), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8916 | // __builtin_ve_vl_pvfmksge_MvMl | |
| 8917 | .{ .tag = @enumFromInt(1873), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8918 | // __builtin_ve_vl_pvfmksge_Mvl | |
| 8919 | .{ .tag = @enumFromInt(1874), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8920 | // __builtin_ve_vl_pvfmksgenan_MvMl | |
| 8921 | .{ .tag = @enumFromInt(1875), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8922 | // __builtin_ve_vl_pvfmksgenan_Mvl | |
| 8923 | .{ .tag = @enumFromInt(1876), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8924 | // __builtin_ve_vl_pvfmksgt_MvMl | |
| 8925 | .{ .tag = @enumFromInt(1877), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8926 | // __builtin_ve_vl_pvfmksgt_Mvl | |
| 8927 | .{ .tag = @enumFromInt(1878), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8928 | // __builtin_ve_vl_pvfmksgtnan_MvMl | |
| 8929 | .{ .tag = @enumFromInt(1879), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8930 | // __builtin_ve_vl_pvfmksgtnan_Mvl | |
| 8931 | .{ .tag = @enumFromInt(1880), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8932 | // __builtin_ve_vl_pvfmksle_MvMl | |
| 8933 | .{ .tag = @enumFromInt(1881), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8934 | // __builtin_ve_vl_pvfmksle_Mvl | |
| 8935 | .{ .tag = @enumFromInt(1882), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8936 | // __builtin_ve_vl_pvfmkslenan_MvMl | |
| 8937 | .{ .tag = @enumFromInt(1883), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8938 | // __builtin_ve_vl_pvfmkslenan_Mvl | |
| 8939 | .{ .tag = @enumFromInt(1884), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8940 | // __builtin_ve_vl_pvfmksloeq_mvl | |
| 8941 | .{ .tag = @enumFromInt(1885), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8942 | // __builtin_ve_vl_pvfmksloeq_mvml | |
| 8943 | .{ .tag = @enumFromInt(1886), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8944 | // __builtin_ve_vl_pvfmksloeqnan_mvl | |
| 8945 | .{ .tag = @enumFromInt(1887), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8946 | // __builtin_ve_vl_pvfmksloeqnan_mvml | |
| 8947 | .{ .tag = @enumFromInt(1888), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8948 | // __builtin_ve_vl_pvfmksloge_mvl | |
| 8949 | .{ .tag = @enumFromInt(1889), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8950 | // __builtin_ve_vl_pvfmksloge_mvml | |
| 8951 | .{ .tag = @enumFromInt(1890), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8952 | // __builtin_ve_vl_pvfmkslogenan_mvl | |
| 8953 | .{ .tag = @enumFromInt(1891), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8954 | // __builtin_ve_vl_pvfmkslogenan_mvml | |
| 8955 | .{ .tag = @enumFromInt(1892), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8956 | // __builtin_ve_vl_pvfmkslogt_mvl | |
| 8957 | .{ .tag = @enumFromInt(1893), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8958 | // __builtin_ve_vl_pvfmkslogt_mvml | |
| 8959 | .{ .tag = @enumFromInt(1894), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8960 | // __builtin_ve_vl_pvfmkslogtnan_mvl | |
| 8961 | .{ .tag = @enumFromInt(1895), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8962 | // __builtin_ve_vl_pvfmkslogtnan_mvml | |
| 8963 | .{ .tag = @enumFromInt(1896), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8964 | // __builtin_ve_vl_pvfmkslole_mvl | |
| 8965 | .{ .tag = @enumFromInt(1897), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8966 | // __builtin_ve_vl_pvfmkslole_mvml | |
| 8967 | .{ .tag = @enumFromInt(1898), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8968 | // __builtin_ve_vl_pvfmkslolenan_mvl | |
| 8969 | .{ .tag = @enumFromInt(1899), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8970 | // __builtin_ve_vl_pvfmkslolenan_mvml | |
| 8971 | .{ .tag = @enumFromInt(1900), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8972 | // __builtin_ve_vl_pvfmkslolt_mvl | |
| 8973 | .{ .tag = @enumFromInt(1901), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8974 | // __builtin_ve_vl_pvfmkslolt_mvml | |
| 8975 | .{ .tag = @enumFromInt(1902), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8976 | // __builtin_ve_vl_pvfmksloltnan_mvl | |
| 8977 | .{ .tag = @enumFromInt(1903), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8978 | // __builtin_ve_vl_pvfmksloltnan_mvml | |
| 8979 | .{ .tag = @enumFromInt(1904), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8980 | // __builtin_ve_vl_pvfmkslonan_mvl | |
| 8981 | .{ .tag = @enumFromInt(1905), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8982 | // __builtin_ve_vl_pvfmkslonan_mvml | |
| 8983 | .{ .tag = @enumFromInt(1906), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8984 | // __builtin_ve_vl_pvfmkslone_mvl | |
| 8985 | .{ .tag = @enumFromInt(1907), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8986 | // __builtin_ve_vl_pvfmkslone_mvml | |
| 8987 | .{ .tag = @enumFromInt(1908), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8988 | // __builtin_ve_vl_pvfmkslonenan_mvl | |
| 8989 | .{ .tag = @enumFromInt(1909), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8990 | // __builtin_ve_vl_pvfmkslonenan_mvml | |
| 8991 | .{ .tag = @enumFromInt(1910), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8992 | // __builtin_ve_vl_pvfmkslonum_mvl | |
| 8993 | .{ .tag = @enumFromInt(1911), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8994 | // __builtin_ve_vl_pvfmkslonum_mvml | |
| 8995 | .{ .tag = @enumFromInt(1912), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8996 | // __builtin_ve_vl_pvfmkslt_MvMl | |
| 8997 | .{ .tag = @enumFromInt(1913), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 8998 | // __builtin_ve_vl_pvfmkslt_Mvl | |
| 8999 | .{ .tag = @enumFromInt(1914), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9000 | // __builtin_ve_vl_pvfmksltnan_MvMl | |
| 9001 | .{ .tag = @enumFromInt(1915), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9002 | // __builtin_ve_vl_pvfmksltnan_Mvl | |
| 9003 | .{ .tag = @enumFromInt(1916), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9004 | // __builtin_ve_vl_pvfmksnan_MvMl | |
| 9005 | .{ .tag = @enumFromInt(1917), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9006 | // __builtin_ve_vl_pvfmksnan_Mvl | |
| 9007 | .{ .tag = @enumFromInt(1918), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9008 | // __builtin_ve_vl_pvfmksne_MvMl | |
| 9009 | .{ .tag = @enumFromInt(1919), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9010 | // __builtin_ve_vl_pvfmksne_Mvl | |
| 9011 | .{ .tag = @enumFromInt(1920), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9012 | // __builtin_ve_vl_pvfmksnenan_MvMl | |
| 9013 | .{ .tag = @enumFromInt(1921), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9014 | // __builtin_ve_vl_pvfmksnenan_Mvl | |
| 9015 | .{ .tag = @enumFromInt(1922), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9016 | // __builtin_ve_vl_pvfmksnum_MvMl | |
| 9017 | .{ .tag = @enumFromInt(1923), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9018 | // __builtin_ve_vl_pvfmksnum_Mvl | |
| 9019 | .{ .tag = @enumFromInt(1924), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9020 | // __builtin_ve_vl_pvfmksupeq_mvl | |
| 9021 | .{ .tag = @enumFromInt(1925), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9022 | // __builtin_ve_vl_pvfmksupeq_mvml | |
| 9023 | .{ .tag = @enumFromInt(1926), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9024 | // __builtin_ve_vl_pvfmksupeqnan_mvl | |
| 9025 | .{ .tag = @enumFromInt(1927), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9026 | // __builtin_ve_vl_pvfmksupeqnan_mvml | |
| 9027 | .{ .tag = @enumFromInt(1928), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9028 | // __builtin_ve_vl_pvfmksupge_mvl | |
| 9029 | .{ .tag = @enumFromInt(1929), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9030 | // __builtin_ve_vl_pvfmksupge_mvml | |
| 9031 | .{ .tag = @enumFromInt(1930), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9032 | // __builtin_ve_vl_pvfmksupgenan_mvl | |
| 9033 | .{ .tag = @enumFromInt(1931), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9034 | // __builtin_ve_vl_pvfmksupgenan_mvml | |
| 9035 | .{ .tag = @enumFromInt(1932), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9036 | // __builtin_ve_vl_pvfmksupgt_mvl | |
| 9037 | .{ .tag = @enumFromInt(1933), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9038 | // __builtin_ve_vl_pvfmksupgt_mvml | |
| 9039 | .{ .tag = @enumFromInt(1934), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9040 | // __builtin_ve_vl_pvfmksupgtnan_mvl | |
| 9041 | .{ .tag = @enumFromInt(1935), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9042 | // __builtin_ve_vl_pvfmksupgtnan_mvml | |
| 9043 | .{ .tag = @enumFromInt(1936), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9044 | // __builtin_ve_vl_pvfmksuple_mvl | |
| 9045 | .{ .tag = @enumFromInt(1937), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9046 | // __builtin_ve_vl_pvfmksuple_mvml | |
| 9047 | .{ .tag = @enumFromInt(1938), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9048 | // __builtin_ve_vl_pvfmksuplenan_mvl | |
| 9049 | .{ .tag = @enumFromInt(1939), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9050 | // __builtin_ve_vl_pvfmksuplenan_mvml | |
| 9051 | .{ .tag = @enumFromInt(1940), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9052 | // __builtin_ve_vl_pvfmksuplt_mvl | |
| 9053 | .{ .tag = @enumFromInt(1941), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9054 | // __builtin_ve_vl_pvfmksuplt_mvml | |
| 9055 | .{ .tag = @enumFromInt(1942), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9056 | // __builtin_ve_vl_pvfmksupltnan_mvl | |
| 9057 | .{ .tag = @enumFromInt(1943), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9058 | // __builtin_ve_vl_pvfmksupltnan_mvml | |
| 9059 | .{ .tag = @enumFromInt(1944), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9060 | // __builtin_ve_vl_pvfmksupnan_mvl | |
| 9061 | .{ .tag = @enumFromInt(1945), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9062 | // __builtin_ve_vl_pvfmksupnan_mvml | |
| 9063 | .{ .tag = @enumFromInt(1946), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9064 | // __builtin_ve_vl_pvfmksupne_mvl | |
| 9065 | .{ .tag = @enumFromInt(1947), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9066 | // __builtin_ve_vl_pvfmksupne_mvml | |
| 9067 | .{ .tag = @enumFromInt(1948), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9068 | // __builtin_ve_vl_pvfmksupnenan_mvl | |
| 9069 | .{ .tag = @enumFromInt(1949), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9070 | // __builtin_ve_vl_pvfmksupnenan_mvml | |
| 9071 | .{ .tag = @enumFromInt(1950), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9072 | // __builtin_ve_vl_pvfmksupnum_mvl | |
| 9073 | .{ .tag = @enumFromInt(1951), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9074 | // __builtin_ve_vl_pvfmksupnum_mvml | |
| 9075 | .{ .tag = @enumFromInt(1952), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9076 | // __builtin_ve_vl_pvfmkweq_MvMl | |
| 9077 | .{ .tag = @enumFromInt(1953), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9078 | // __builtin_ve_vl_pvfmkweq_Mvl | |
| 9079 | .{ .tag = @enumFromInt(1954), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9080 | // __builtin_ve_vl_pvfmkweqnan_MvMl | |
| 9081 | .{ .tag = @enumFromInt(1955), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9082 | // __builtin_ve_vl_pvfmkweqnan_Mvl | |
| 9083 | .{ .tag = @enumFromInt(1956), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9084 | // __builtin_ve_vl_pvfmkwge_MvMl | |
| 9085 | .{ .tag = @enumFromInt(1957), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9086 | // __builtin_ve_vl_pvfmkwge_Mvl | |
| 9087 | .{ .tag = @enumFromInt(1958), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9088 | // __builtin_ve_vl_pvfmkwgenan_MvMl | |
| 9089 | .{ .tag = @enumFromInt(1959), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9090 | // __builtin_ve_vl_pvfmkwgenan_Mvl | |
| 9091 | .{ .tag = @enumFromInt(1960), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9092 | // __builtin_ve_vl_pvfmkwgt_MvMl | |
| 9093 | .{ .tag = @enumFromInt(1961), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9094 | // __builtin_ve_vl_pvfmkwgt_Mvl | |
| 9095 | .{ .tag = @enumFromInt(1962), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9096 | // __builtin_ve_vl_pvfmkwgtnan_MvMl | |
| 9097 | .{ .tag = @enumFromInt(1963), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9098 | // __builtin_ve_vl_pvfmkwgtnan_Mvl | |
| 9099 | .{ .tag = @enumFromInt(1964), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9100 | // __builtin_ve_vl_pvfmkwle_MvMl | |
| 9101 | .{ .tag = @enumFromInt(1965), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9102 | // __builtin_ve_vl_pvfmkwle_Mvl | |
| 9103 | .{ .tag = @enumFromInt(1966), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9104 | // __builtin_ve_vl_pvfmkwlenan_MvMl | |
| 9105 | .{ .tag = @enumFromInt(1967), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9106 | // __builtin_ve_vl_pvfmkwlenan_Mvl | |
| 9107 | .{ .tag = @enumFromInt(1968), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9108 | // __builtin_ve_vl_pvfmkwloeq_mvl | |
| 9109 | .{ .tag = @enumFromInt(1969), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9110 | // __builtin_ve_vl_pvfmkwloeq_mvml | |
| 9111 | .{ .tag = @enumFromInt(1970), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9112 | // __builtin_ve_vl_pvfmkwloeqnan_mvl | |
| 9113 | .{ .tag = @enumFromInt(1971), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9114 | // __builtin_ve_vl_pvfmkwloeqnan_mvml | |
| 9115 | .{ .tag = @enumFromInt(1972), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9116 | // __builtin_ve_vl_pvfmkwloge_mvl | |
| 9117 | .{ .tag = @enumFromInt(1973), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9118 | // __builtin_ve_vl_pvfmkwloge_mvml | |
| 9119 | .{ .tag = @enumFromInt(1974), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9120 | // __builtin_ve_vl_pvfmkwlogenan_mvl | |
| 9121 | .{ .tag = @enumFromInt(1975), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9122 | // __builtin_ve_vl_pvfmkwlogenan_mvml | |
| 9123 | .{ .tag = @enumFromInt(1976), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9124 | // __builtin_ve_vl_pvfmkwlogt_mvl | |
| 9125 | .{ .tag = @enumFromInt(1977), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9126 | // __builtin_ve_vl_pvfmkwlogt_mvml | |
| 9127 | .{ .tag = @enumFromInt(1978), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9128 | // __builtin_ve_vl_pvfmkwlogtnan_mvl | |
| 9129 | .{ .tag = @enumFromInt(1979), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9130 | // __builtin_ve_vl_pvfmkwlogtnan_mvml | |
| 9131 | .{ .tag = @enumFromInt(1980), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9132 | // __builtin_ve_vl_pvfmkwlole_mvl | |
| 9133 | .{ .tag = @enumFromInt(1981), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9134 | // __builtin_ve_vl_pvfmkwlole_mvml | |
| 9135 | .{ .tag = @enumFromInt(1982), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9136 | // __builtin_ve_vl_pvfmkwlolenan_mvl | |
| 9137 | .{ .tag = @enumFromInt(1983), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9138 | // __builtin_ve_vl_pvfmkwlolenan_mvml | |
| 9139 | .{ .tag = @enumFromInt(1984), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9140 | // __builtin_ve_vl_pvfmkwlolt_mvl | |
| 9141 | .{ .tag = @enumFromInt(1985), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9142 | // __builtin_ve_vl_pvfmkwlolt_mvml | |
| 9143 | .{ .tag = @enumFromInt(1986), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9144 | // __builtin_ve_vl_pvfmkwloltnan_mvl | |
| 9145 | .{ .tag = @enumFromInt(1987), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9146 | // __builtin_ve_vl_pvfmkwloltnan_mvml | |
| 9147 | .{ .tag = @enumFromInt(1988), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9148 | // __builtin_ve_vl_pvfmkwlonan_mvl | |
| 9149 | .{ .tag = @enumFromInt(1989), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9150 | // __builtin_ve_vl_pvfmkwlonan_mvml | |
| 9151 | .{ .tag = @enumFromInt(1990), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9152 | // __builtin_ve_vl_pvfmkwlone_mvl | |
| 9153 | .{ .tag = @enumFromInt(1991), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9154 | // __builtin_ve_vl_pvfmkwlone_mvml | |
| 9155 | .{ .tag = @enumFromInt(1992), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9156 | // __builtin_ve_vl_pvfmkwlonenan_mvl | |
| 9157 | .{ .tag = @enumFromInt(1993), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9158 | // __builtin_ve_vl_pvfmkwlonenan_mvml | |
| 9159 | .{ .tag = @enumFromInt(1994), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9160 | // __builtin_ve_vl_pvfmkwlonum_mvl | |
| 9161 | .{ .tag = @enumFromInt(1995), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9162 | // __builtin_ve_vl_pvfmkwlonum_mvml | |
| 9163 | .{ .tag = @enumFromInt(1996), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9164 | // __builtin_ve_vl_pvfmkwlt_MvMl | |
| 9165 | .{ .tag = @enumFromInt(1997), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9166 | // __builtin_ve_vl_pvfmkwlt_Mvl | |
| 9167 | .{ .tag = @enumFromInt(1998), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9168 | // __builtin_ve_vl_pvfmkwltnan_MvMl | |
| 9169 | .{ .tag = @enumFromInt(1999), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9170 | // __builtin_ve_vl_pvfmkwltnan_Mvl | |
| 9171 | .{ .tag = @enumFromInt(2000), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9172 | // __builtin_ve_vl_pvfmkwnan_MvMl | |
| 9173 | .{ .tag = @enumFromInt(2001), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9174 | // __builtin_ve_vl_pvfmkwnan_Mvl | |
| 9175 | .{ .tag = @enumFromInt(2002), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9176 | // __builtin_ve_vl_pvfmkwne_MvMl | |
| 9177 | .{ .tag = @enumFromInt(2003), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9178 | // __builtin_ve_vl_pvfmkwne_Mvl | |
| 9179 | .{ .tag = @enumFromInt(2004), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9180 | // __builtin_ve_vl_pvfmkwnenan_MvMl | |
| 9181 | .{ .tag = @enumFromInt(2005), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9182 | // __builtin_ve_vl_pvfmkwnenan_Mvl | |
| 9183 | .{ .tag = @enumFromInt(2006), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9184 | // __builtin_ve_vl_pvfmkwnum_MvMl | |
| 9185 | .{ .tag = @enumFromInt(2007), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9186 | // __builtin_ve_vl_pvfmkwnum_Mvl | |
| 9187 | .{ .tag = @enumFromInt(2008), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9188 | // __builtin_ve_vl_pvfmkwupeq_mvl | |
| 9189 | .{ .tag = @enumFromInt(2009), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9190 | // __builtin_ve_vl_pvfmkwupeq_mvml | |
| 9191 | .{ .tag = @enumFromInt(2010), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9192 | // __builtin_ve_vl_pvfmkwupeqnan_mvl | |
| 9193 | .{ .tag = @enumFromInt(2011), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9194 | // __builtin_ve_vl_pvfmkwupeqnan_mvml | |
| 9195 | .{ .tag = @enumFromInt(2012), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9196 | // __builtin_ve_vl_pvfmkwupge_mvl | |
| 9197 | .{ .tag = @enumFromInt(2013), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9198 | // __builtin_ve_vl_pvfmkwupge_mvml | |
| 9199 | .{ .tag = @enumFromInt(2014), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9200 | // __builtin_ve_vl_pvfmkwupgenan_mvl | |
| 9201 | .{ .tag = @enumFromInt(2015), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9202 | // __builtin_ve_vl_pvfmkwupgenan_mvml | |
| 9203 | .{ .tag = @enumFromInt(2016), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9204 | // __builtin_ve_vl_pvfmkwupgt_mvl | |
| 9205 | .{ .tag = @enumFromInt(2017), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9206 | // __builtin_ve_vl_pvfmkwupgt_mvml | |
| 9207 | .{ .tag = @enumFromInt(2018), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9208 | // __builtin_ve_vl_pvfmkwupgtnan_mvl | |
| 9209 | .{ .tag = @enumFromInt(2019), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9210 | // __builtin_ve_vl_pvfmkwupgtnan_mvml | |
| 9211 | .{ .tag = @enumFromInt(2020), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9212 | // __builtin_ve_vl_pvfmkwuple_mvl | |
| 9213 | .{ .tag = @enumFromInt(2021), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9214 | // __builtin_ve_vl_pvfmkwuple_mvml | |
| 9215 | .{ .tag = @enumFromInt(2022), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9216 | // __builtin_ve_vl_pvfmkwuplenan_mvl | |
| 9217 | .{ .tag = @enumFromInt(2023), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9218 | // __builtin_ve_vl_pvfmkwuplenan_mvml | |
| 9219 | .{ .tag = @enumFromInt(2024), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9220 | // __builtin_ve_vl_pvfmkwuplt_mvl | |
| 9221 | .{ .tag = @enumFromInt(2025), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9222 | // __builtin_ve_vl_pvfmkwuplt_mvml | |
| 9223 | .{ .tag = @enumFromInt(2026), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9224 | // __builtin_ve_vl_pvfmkwupltnan_mvl | |
| 9225 | .{ .tag = @enumFromInt(2027), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9226 | // __builtin_ve_vl_pvfmkwupltnan_mvml | |
| 9227 | .{ .tag = @enumFromInt(2028), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9228 | // __builtin_ve_vl_pvfmkwupnan_mvl | |
| 9229 | .{ .tag = @enumFromInt(2029), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9230 | // __builtin_ve_vl_pvfmkwupnan_mvml | |
| 9231 | .{ .tag = @enumFromInt(2030), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9232 | // __builtin_ve_vl_pvfmkwupne_mvl | |
| 9233 | .{ .tag = @enumFromInt(2031), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9234 | // __builtin_ve_vl_pvfmkwupne_mvml | |
| 9235 | .{ .tag = @enumFromInt(2032), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9236 | // __builtin_ve_vl_pvfmkwupnenan_mvl | |
| 9237 | .{ .tag = @enumFromInt(2033), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9238 | // __builtin_ve_vl_pvfmkwupnenan_mvml | |
| 9239 | .{ .tag = @enumFromInt(2034), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9240 | // __builtin_ve_vl_pvfmkwupnum_mvl | |
| 9241 | .{ .tag = @enumFromInt(2035), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9242 | // __builtin_ve_vl_pvfmkwupnum_mvml | |
| 9243 | .{ .tag = @enumFromInt(2036), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9244 | // __builtin_ve_vl_pvfmsb_vsvvMvl | |
| 9245 | .{ .tag = @enumFromInt(2037), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9246 | // __builtin_ve_vl_pvfmsb_vsvvl | |
| 9247 | .{ .tag = @enumFromInt(2038), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9248 | // __builtin_ve_vl_pvfmsb_vsvvvl | |
| 9249 | .{ .tag = @enumFromInt(2039), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9250 | // __builtin_ve_vl_pvfmsb_vvsvMvl | |
| 9251 | .{ .tag = @enumFromInt(2040), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9252 | // __builtin_ve_vl_pvfmsb_vvsvl | |
| 9253 | .{ .tag = @enumFromInt(2041), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9254 | // __builtin_ve_vl_pvfmsb_vvsvvl | |
| 9255 | .{ .tag = @enumFromInt(2042), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9256 | // __builtin_ve_vl_pvfmsb_vvvvMvl | |
| 9257 | .{ .tag = @enumFromInt(2043), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9258 | // __builtin_ve_vl_pvfmsb_vvvvl | |
| 9259 | .{ .tag = @enumFromInt(2044), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9260 | // __builtin_ve_vl_pvfmsb_vvvvvl | |
| 9261 | .{ .tag = @enumFromInt(2045), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9262 | // __builtin_ve_vl_pvfmul_vsvMvl | |
| 9263 | .{ .tag = @enumFromInt(2046), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9264 | // __builtin_ve_vl_pvfmul_vsvl | |
| 9265 | .{ .tag = @enumFromInt(2047), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9266 | // __builtin_ve_vl_pvfmul_vsvvl | |
| 9267 | .{ .tag = @enumFromInt(2048), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9268 | // __builtin_ve_vl_pvfmul_vvvMvl | |
| 9269 | .{ .tag = @enumFromInt(2049), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9270 | // __builtin_ve_vl_pvfmul_vvvl | |
| 9271 | .{ .tag = @enumFromInt(2050), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9272 | // __builtin_ve_vl_pvfmul_vvvvl | |
| 9273 | .{ .tag = @enumFromInt(2051), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9274 | // __builtin_ve_vl_pvfnmad_vsvvMvl | |
| 9275 | .{ .tag = @enumFromInt(2052), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9276 | // __builtin_ve_vl_pvfnmad_vsvvl | |
| 9277 | .{ .tag = @enumFromInt(2053), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9278 | // __builtin_ve_vl_pvfnmad_vsvvvl | |
| 9279 | .{ .tag = @enumFromInt(2054), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9280 | // __builtin_ve_vl_pvfnmad_vvsvMvl | |
| 9281 | .{ .tag = @enumFromInt(2055), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9282 | // __builtin_ve_vl_pvfnmad_vvsvl | |
| 9283 | .{ .tag = @enumFromInt(2056), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9284 | // __builtin_ve_vl_pvfnmad_vvsvvl | |
| 9285 | .{ .tag = @enumFromInt(2057), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9286 | // __builtin_ve_vl_pvfnmad_vvvvMvl | |
| 9287 | .{ .tag = @enumFromInt(2058), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9288 | // __builtin_ve_vl_pvfnmad_vvvvl | |
| 9289 | .{ .tag = @enumFromInt(2059), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9290 | // __builtin_ve_vl_pvfnmad_vvvvvl | |
| 9291 | .{ .tag = @enumFromInt(2060), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9292 | // __builtin_ve_vl_pvfnmsb_vsvvMvl | |
| 9293 | .{ .tag = @enumFromInt(2061), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9294 | // __builtin_ve_vl_pvfnmsb_vsvvl | |
| 9295 | .{ .tag = @enumFromInt(2062), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9296 | // __builtin_ve_vl_pvfnmsb_vsvvvl | |
| 9297 | .{ .tag = @enumFromInt(2063), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9298 | // __builtin_ve_vl_pvfnmsb_vvsvMvl | |
| 9299 | .{ .tag = @enumFromInt(2064), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9300 | // __builtin_ve_vl_pvfnmsb_vvsvl | |
| 9301 | .{ .tag = @enumFromInt(2065), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9302 | // __builtin_ve_vl_pvfnmsb_vvsvvl | |
| 9303 | .{ .tag = @enumFromInt(2066), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9304 | // __builtin_ve_vl_pvfnmsb_vvvvMvl | |
| 9305 | .{ .tag = @enumFromInt(2067), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9306 | // __builtin_ve_vl_pvfnmsb_vvvvl | |
| 9307 | .{ .tag = @enumFromInt(2068), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9308 | // __builtin_ve_vl_pvfnmsb_vvvvvl | |
| 9309 | .{ .tag = @enumFromInt(2069), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9310 | // __builtin_ve_vl_pvfsub_vsvMvl | |
| 9311 | .{ .tag = @enumFromInt(2070), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9312 | // __builtin_ve_vl_pvfsub_vsvl | |
| 9313 | .{ .tag = @enumFromInt(2071), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9314 | // __builtin_ve_vl_pvfsub_vsvvl | |
| 9315 | .{ .tag = @enumFromInt(2072), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9316 | // __builtin_ve_vl_pvfsub_vvvMvl | |
| 9317 | .{ .tag = @enumFromInt(2073), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9318 | // __builtin_ve_vl_pvfsub_vvvl | |
| 9319 | .{ .tag = @enumFromInt(2074), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9320 | // __builtin_ve_vl_pvfsub_vvvvl | |
| 9321 | .{ .tag = @enumFromInt(2075), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9322 | // __builtin_ve_vl_pvldz_vvMvl | |
| 9323 | .{ .tag = @enumFromInt(2076), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9324 | // __builtin_ve_vl_pvldz_vvl | |
| 9325 | .{ .tag = @enumFromInt(2077), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9326 | // __builtin_ve_vl_pvldz_vvvl | |
| 9327 | .{ .tag = @enumFromInt(2078), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9328 | // __builtin_ve_vl_pvldzlo_vvl | |
| 9329 | .{ .tag = @enumFromInt(2079), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9330 | // __builtin_ve_vl_pvldzlo_vvmvl | |
| 9331 | .{ .tag = @enumFromInt(2080), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9332 | // __builtin_ve_vl_pvldzlo_vvvl | |
| 9333 | .{ .tag = @enumFromInt(2081), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9334 | // __builtin_ve_vl_pvldzup_vvl | |
| 9335 | .{ .tag = @enumFromInt(2082), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9336 | // __builtin_ve_vl_pvldzup_vvmvl | |
| 9337 | .{ .tag = @enumFromInt(2083), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9338 | // __builtin_ve_vl_pvldzup_vvvl | |
| 9339 | .{ .tag = @enumFromInt(2084), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9340 | // __builtin_ve_vl_pvmaxs_vsvMvl | |
| 9341 | .{ .tag = @enumFromInt(2085), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9342 | // __builtin_ve_vl_pvmaxs_vsvl | |
| 9343 | .{ .tag = @enumFromInt(2086), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9344 | // __builtin_ve_vl_pvmaxs_vsvvl | |
| 9345 | .{ .tag = @enumFromInt(2087), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9346 | // __builtin_ve_vl_pvmaxs_vvvMvl | |
| 9347 | .{ .tag = @enumFromInt(2088), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9348 | // __builtin_ve_vl_pvmaxs_vvvl | |
| 9349 | .{ .tag = @enumFromInt(2089), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9350 | // __builtin_ve_vl_pvmaxs_vvvvl | |
| 9351 | .{ .tag = @enumFromInt(2090), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9352 | // __builtin_ve_vl_pvmins_vsvMvl | |
| 9353 | .{ .tag = @enumFromInt(2091), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9354 | // __builtin_ve_vl_pvmins_vsvl | |
| 9355 | .{ .tag = @enumFromInt(2092), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9356 | // __builtin_ve_vl_pvmins_vsvvl | |
| 9357 | .{ .tag = @enumFromInt(2093), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9358 | // __builtin_ve_vl_pvmins_vvvMvl | |
| 9359 | .{ .tag = @enumFromInt(2094), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9360 | // __builtin_ve_vl_pvmins_vvvl | |
| 9361 | .{ .tag = @enumFromInt(2095), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9362 | // __builtin_ve_vl_pvmins_vvvvl | |
| 9363 | .{ .tag = @enumFromInt(2096), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9364 | // __builtin_ve_vl_pvor_vsvMvl | |
| 9365 | .{ .tag = @enumFromInt(2097), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9366 | // __builtin_ve_vl_pvor_vsvl | |
| 9367 | .{ .tag = @enumFromInt(2098), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9368 | // __builtin_ve_vl_pvor_vsvvl | |
| 9369 | .{ .tag = @enumFromInt(2099), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9370 | // __builtin_ve_vl_pvor_vvvMvl | |
| 9371 | .{ .tag = @enumFromInt(2100), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9372 | // __builtin_ve_vl_pvor_vvvl | |
| 9373 | .{ .tag = @enumFromInt(2101), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9374 | // __builtin_ve_vl_pvor_vvvvl | |
| 9375 | .{ .tag = @enumFromInt(2102), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9376 | // __builtin_ve_vl_pvpcnt_vvMvl | |
| 9377 | .{ .tag = @enumFromInt(2103), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9378 | // __builtin_ve_vl_pvpcnt_vvl | |
| 9379 | .{ .tag = @enumFromInt(2104), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9380 | // __builtin_ve_vl_pvpcnt_vvvl | |
| 9381 | .{ .tag = @enumFromInt(2105), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9382 | // __builtin_ve_vl_pvpcntlo_vvl | |
| 9383 | .{ .tag = @enumFromInt(2106), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9384 | // __builtin_ve_vl_pvpcntlo_vvmvl | |
| 9385 | .{ .tag = @enumFromInt(2107), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9386 | // __builtin_ve_vl_pvpcntlo_vvvl | |
| 9387 | .{ .tag = @enumFromInt(2108), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9388 | // __builtin_ve_vl_pvpcntup_vvl | |
| 9389 | .{ .tag = @enumFromInt(2109), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9390 | // __builtin_ve_vl_pvpcntup_vvmvl | |
| 9391 | .{ .tag = @enumFromInt(2110), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9392 | // __builtin_ve_vl_pvpcntup_vvvl | |
| 9393 | .{ .tag = @enumFromInt(2111), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9394 | // __builtin_ve_vl_pvrcp_vvl | |
| 9395 | .{ .tag = @enumFromInt(2112), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9396 | // __builtin_ve_vl_pvrcp_vvvl | |
| 9397 | .{ .tag = @enumFromInt(2113), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9398 | // __builtin_ve_vl_pvrsqrt_vvl | |
| 9399 | .{ .tag = @enumFromInt(2114), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9400 | // __builtin_ve_vl_pvrsqrt_vvvl | |
| 9401 | .{ .tag = @enumFromInt(2115), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9402 | // __builtin_ve_vl_pvrsqrtnex_vvl | |
| 9403 | .{ .tag = @enumFromInt(2116), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9404 | // __builtin_ve_vl_pvrsqrtnex_vvvl | |
| 9405 | .{ .tag = @enumFromInt(2117), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9406 | // __builtin_ve_vl_pvseq_vl | |
| 9407 | .{ .tag = @enumFromInt(2118), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9408 | // __builtin_ve_vl_pvseq_vvl | |
| 9409 | .{ .tag = @enumFromInt(2119), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9410 | // __builtin_ve_vl_pvseqlo_vl | |
| 9411 | .{ .tag = @enumFromInt(2120), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9412 | // __builtin_ve_vl_pvseqlo_vvl | |
| 9413 | .{ .tag = @enumFromInt(2121), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9414 | // __builtin_ve_vl_pvsequp_vl | |
| 9415 | .{ .tag = @enumFromInt(2122), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9416 | // __builtin_ve_vl_pvsequp_vvl | |
| 9417 | .{ .tag = @enumFromInt(2123), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9418 | // __builtin_ve_vl_pvsla_vvsMvl | |
| 9419 | .{ .tag = @enumFromInt(2124), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9420 | // __builtin_ve_vl_pvsla_vvsl | |
| 9421 | .{ .tag = @enumFromInt(2125), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9422 | // __builtin_ve_vl_pvsla_vvsvl | |
| 9423 | .{ .tag = @enumFromInt(2126), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9424 | // __builtin_ve_vl_pvsla_vvvMvl | |
| 9425 | .{ .tag = @enumFromInt(2127), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9426 | // __builtin_ve_vl_pvsla_vvvl | |
| 9427 | .{ .tag = @enumFromInt(2128), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9428 | // __builtin_ve_vl_pvsla_vvvvl | |
| 9429 | .{ .tag = @enumFromInt(2129), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9430 | // __builtin_ve_vl_pvsll_vvsMvl | |
| 9431 | .{ .tag = @enumFromInt(2130), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9432 | // __builtin_ve_vl_pvsll_vvsl | |
| 9433 | .{ .tag = @enumFromInt(2131), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9434 | // __builtin_ve_vl_pvsll_vvsvl | |
| 9435 | .{ .tag = @enumFromInt(2132), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9436 | // __builtin_ve_vl_pvsll_vvvMvl | |
| 9437 | .{ .tag = @enumFromInt(2133), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9438 | // __builtin_ve_vl_pvsll_vvvl | |
| 9439 | .{ .tag = @enumFromInt(2134), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9440 | // __builtin_ve_vl_pvsll_vvvvl | |
| 9441 | .{ .tag = @enumFromInt(2135), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9442 | // __builtin_ve_vl_pvsra_vvsMvl | |
| 9443 | .{ .tag = @enumFromInt(2136), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9444 | // __builtin_ve_vl_pvsra_vvsl | |
| 9445 | .{ .tag = @enumFromInt(2137), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9446 | // __builtin_ve_vl_pvsra_vvsvl | |
| 9447 | .{ .tag = @enumFromInt(2138), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9448 | // __builtin_ve_vl_pvsra_vvvMvl | |
| 9449 | .{ .tag = @enumFromInt(2139), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9450 | // __builtin_ve_vl_pvsra_vvvl | |
| 9451 | .{ .tag = @enumFromInt(2140), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9452 | // __builtin_ve_vl_pvsra_vvvvl | |
| 9453 | .{ .tag = @enumFromInt(2141), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9454 | // __builtin_ve_vl_pvsrl_vvsMvl | |
| 9455 | .{ .tag = @enumFromInt(2142), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9456 | // __builtin_ve_vl_pvsrl_vvsl | |
| 9457 | .{ .tag = @enumFromInt(2143), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9458 | // __builtin_ve_vl_pvsrl_vvsvl | |
| 9459 | .{ .tag = @enumFromInt(2144), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9460 | // __builtin_ve_vl_pvsrl_vvvMvl | |
| 9461 | .{ .tag = @enumFromInt(2145), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9462 | // __builtin_ve_vl_pvsrl_vvvl | |
| 9463 | .{ .tag = @enumFromInt(2146), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9464 | // __builtin_ve_vl_pvsrl_vvvvl | |
| 9465 | .{ .tag = @enumFromInt(2147), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9466 | // __builtin_ve_vl_pvsubs_vsvMvl | |
| 9467 | .{ .tag = @enumFromInt(2148), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9468 | // __builtin_ve_vl_pvsubs_vsvl | |
| 9469 | .{ .tag = @enumFromInt(2149), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9470 | // __builtin_ve_vl_pvsubs_vsvvl | |
| 9471 | .{ .tag = @enumFromInt(2150), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9472 | // __builtin_ve_vl_pvsubs_vvvMvl | |
| 9473 | .{ .tag = @enumFromInt(2151), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9474 | // __builtin_ve_vl_pvsubs_vvvl | |
| 9475 | .{ .tag = @enumFromInt(2152), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9476 | // __builtin_ve_vl_pvsubs_vvvvl | |
| 9477 | .{ .tag = @enumFromInt(2153), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9478 | // __builtin_ve_vl_pvsubu_vsvMvl | |
| 9479 | .{ .tag = @enumFromInt(2154), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9480 | // __builtin_ve_vl_pvsubu_vsvl | |
| 9481 | .{ .tag = @enumFromInt(2155), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9482 | // __builtin_ve_vl_pvsubu_vsvvl | |
| 9483 | .{ .tag = @enumFromInt(2156), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9484 | // __builtin_ve_vl_pvsubu_vvvMvl | |
| 9485 | .{ .tag = @enumFromInt(2157), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9486 | // __builtin_ve_vl_pvsubu_vvvl | |
| 9487 | .{ .tag = @enumFromInt(2158), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9488 | // __builtin_ve_vl_pvsubu_vvvvl | |
| 9489 | .{ .tag = @enumFromInt(2159), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9490 | // __builtin_ve_vl_pvxor_vsvMvl | |
| 9491 | .{ .tag = @enumFromInt(2160), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9492 | // __builtin_ve_vl_pvxor_vsvl | |
| 9493 | .{ .tag = @enumFromInt(2161), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9494 | // __builtin_ve_vl_pvxor_vsvvl | |
| 9495 | .{ .tag = @enumFromInt(2162), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9496 | // __builtin_ve_vl_pvxor_vvvMvl | |
| 9497 | .{ .tag = @enumFromInt(2163), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9498 | // __builtin_ve_vl_pvxor_vvvl | |
| 9499 | .{ .tag = @enumFromInt(2164), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9500 | // __builtin_ve_vl_pvxor_vvvvl | |
| 9501 | .{ .tag = @enumFromInt(2165), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9502 | // __builtin_ve_vl_scr_sss | |
| 9503 | .{ .tag = @enumFromInt(2166), .properties = .{ .param_str = "vLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9504 | // __builtin_ve_vl_svm_sMs | |
| 9505 | .{ .tag = @enumFromInt(2167), .properties = .{ .param_str = "LUiV512bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9506 | // __builtin_ve_vl_svm_sms | |
| 9507 | .{ .tag = @enumFromInt(2168), .properties = .{ .param_str = "LUiV256bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9508 | // __builtin_ve_vl_svob | |
| 9509 | .{ .tag = @enumFromInt(2169), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9510 | // __builtin_ve_vl_tovm_sml | |
| 9511 | .{ .tag = @enumFromInt(2170), .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9512 | // __builtin_ve_vl_tscr_ssss | |
| 9513 | .{ .tag = @enumFromInt(2171), .properties = .{ .param_str = "LUiLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9514 | // __builtin_ve_vl_vaddsl_vsvl | |
| 9515 | .{ .tag = @enumFromInt(2172), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9516 | // __builtin_ve_vl_vaddsl_vsvmvl | |
| 9517 | .{ .tag = @enumFromInt(2173), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9518 | // __builtin_ve_vl_vaddsl_vsvvl | |
| 9519 | .{ .tag = @enumFromInt(2174), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9520 | // __builtin_ve_vl_vaddsl_vvvl | |
| 9521 | .{ .tag = @enumFromInt(2175), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9522 | // __builtin_ve_vl_vaddsl_vvvmvl | |
| 9523 | .{ .tag = @enumFromInt(2176), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9524 | // __builtin_ve_vl_vaddsl_vvvvl | |
| 9525 | .{ .tag = @enumFromInt(2177), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9526 | // __builtin_ve_vl_vaddswsx_vsvl | |
| 9527 | .{ .tag = @enumFromInt(2178), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9528 | // __builtin_ve_vl_vaddswsx_vsvmvl | |
| 9529 | .{ .tag = @enumFromInt(2179), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9530 | // __builtin_ve_vl_vaddswsx_vsvvl | |
| 9531 | .{ .tag = @enumFromInt(2180), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9532 | // __builtin_ve_vl_vaddswsx_vvvl | |
| 9533 | .{ .tag = @enumFromInt(2181), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9534 | // __builtin_ve_vl_vaddswsx_vvvmvl | |
| 9535 | .{ .tag = @enumFromInt(2182), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9536 | // __builtin_ve_vl_vaddswsx_vvvvl | |
| 9537 | .{ .tag = @enumFromInt(2183), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9538 | // __builtin_ve_vl_vaddswzx_vsvl | |
| 9539 | .{ .tag = @enumFromInt(2184), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9540 | // __builtin_ve_vl_vaddswzx_vsvmvl | |
| 9541 | .{ .tag = @enumFromInt(2185), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9542 | // __builtin_ve_vl_vaddswzx_vsvvl | |
| 9543 | .{ .tag = @enumFromInt(2186), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9544 | // __builtin_ve_vl_vaddswzx_vvvl | |
| 9545 | .{ .tag = @enumFromInt(2187), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9546 | // __builtin_ve_vl_vaddswzx_vvvmvl | |
| 9547 | .{ .tag = @enumFromInt(2188), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9548 | // __builtin_ve_vl_vaddswzx_vvvvl | |
| 9549 | .{ .tag = @enumFromInt(2189), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9550 | // __builtin_ve_vl_vaddul_vsvl | |
| 9551 | .{ .tag = @enumFromInt(2190), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9552 | // __builtin_ve_vl_vaddul_vsvmvl | |
| 9553 | .{ .tag = @enumFromInt(2191), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9554 | // __builtin_ve_vl_vaddul_vsvvl | |
| 9555 | .{ .tag = @enumFromInt(2192), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9556 | // __builtin_ve_vl_vaddul_vvvl | |
| 9557 | .{ .tag = @enumFromInt(2193), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9558 | // __builtin_ve_vl_vaddul_vvvmvl | |
| 9559 | .{ .tag = @enumFromInt(2194), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9560 | // __builtin_ve_vl_vaddul_vvvvl | |
| 9561 | .{ .tag = @enumFromInt(2195), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9562 | // __builtin_ve_vl_vadduw_vsvl | |
| 9563 | .{ .tag = @enumFromInt(2196), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9564 | // __builtin_ve_vl_vadduw_vsvmvl | |
| 9565 | .{ .tag = @enumFromInt(2197), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9566 | // __builtin_ve_vl_vadduw_vsvvl | |
| 9567 | .{ .tag = @enumFromInt(2198), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9568 | // __builtin_ve_vl_vadduw_vvvl | |
| 9569 | .{ .tag = @enumFromInt(2199), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9570 | // __builtin_ve_vl_vadduw_vvvmvl | |
| 9571 | .{ .tag = @enumFromInt(2200), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9572 | // __builtin_ve_vl_vadduw_vvvvl | |
| 9573 | .{ .tag = @enumFromInt(2201), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9574 | // __builtin_ve_vl_vand_vsvl | |
| 9575 | .{ .tag = @enumFromInt(2202), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9576 | // __builtin_ve_vl_vand_vsvmvl | |
| 9577 | .{ .tag = @enumFromInt(2203), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9578 | // __builtin_ve_vl_vand_vsvvl | |
| 9579 | .{ .tag = @enumFromInt(2204), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9580 | // __builtin_ve_vl_vand_vvvl | |
| 9581 | .{ .tag = @enumFromInt(2205), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9582 | // __builtin_ve_vl_vand_vvvmvl | |
| 9583 | .{ .tag = @enumFromInt(2206), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9584 | // __builtin_ve_vl_vand_vvvvl | |
| 9585 | .{ .tag = @enumFromInt(2207), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9586 | // __builtin_ve_vl_vbrdd_vsl | |
| 9587 | .{ .tag = @enumFromInt(2208), .properties = .{ .param_str = "V256ddUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9588 | // __builtin_ve_vl_vbrdd_vsmvl | |
| 9589 | .{ .tag = @enumFromInt(2209), .properties = .{ .param_str = "V256ddV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9590 | // __builtin_ve_vl_vbrdd_vsvl | |
| 9591 | .{ .tag = @enumFromInt(2210), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9592 | // __builtin_ve_vl_vbrdl_vsl | |
| 9593 | .{ .tag = @enumFromInt(2211), .properties = .{ .param_str = "V256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9594 | // __builtin_ve_vl_vbrdl_vsmvl | |
| 9595 | .{ .tag = @enumFromInt(2212), .properties = .{ .param_str = "V256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9596 | // __builtin_ve_vl_vbrdl_vsvl | |
| 9597 | .{ .tag = @enumFromInt(2213), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9598 | // __builtin_ve_vl_vbrds_vsl | |
| 9599 | .{ .tag = @enumFromInt(2214), .properties = .{ .param_str = "V256dfUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9600 | // __builtin_ve_vl_vbrds_vsmvl | |
| 9601 | .{ .tag = @enumFromInt(2215), .properties = .{ .param_str = "V256dfV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9602 | // __builtin_ve_vl_vbrds_vsvl | |
| 9603 | .{ .tag = @enumFromInt(2216), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9604 | // __builtin_ve_vl_vbrdw_vsl | |
| 9605 | .{ .tag = @enumFromInt(2217), .properties = .{ .param_str = "V256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9606 | // __builtin_ve_vl_vbrdw_vsmvl | |
| 9607 | .{ .tag = @enumFromInt(2218), .properties = .{ .param_str = "V256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9608 | // __builtin_ve_vl_vbrdw_vsvl | |
| 9609 | .{ .tag = @enumFromInt(2219), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9610 | // __builtin_ve_vl_vbrv_vvl | |
| 9611 | .{ .tag = @enumFromInt(2220), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9612 | // __builtin_ve_vl_vbrv_vvmvl | |
| 9613 | .{ .tag = @enumFromInt(2221), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9614 | // __builtin_ve_vl_vbrv_vvvl | |
| 9615 | .{ .tag = @enumFromInt(2222), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9616 | // __builtin_ve_vl_vcmpsl_vsvl | |
| 9617 | .{ .tag = @enumFromInt(2223), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9618 | // __builtin_ve_vl_vcmpsl_vsvmvl | |
| 9619 | .{ .tag = @enumFromInt(2224), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9620 | // __builtin_ve_vl_vcmpsl_vsvvl | |
| 9621 | .{ .tag = @enumFromInt(2225), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9622 | // __builtin_ve_vl_vcmpsl_vvvl | |
| 9623 | .{ .tag = @enumFromInt(2226), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9624 | // __builtin_ve_vl_vcmpsl_vvvmvl | |
| 9625 | .{ .tag = @enumFromInt(2227), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9626 | // __builtin_ve_vl_vcmpsl_vvvvl | |
| 9627 | .{ .tag = @enumFromInt(2228), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9628 | // __builtin_ve_vl_vcmpswsx_vsvl | |
| 9629 | .{ .tag = @enumFromInt(2229), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9630 | // __builtin_ve_vl_vcmpswsx_vsvmvl | |
| 9631 | .{ .tag = @enumFromInt(2230), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9632 | // __builtin_ve_vl_vcmpswsx_vsvvl | |
| 9633 | .{ .tag = @enumFromInt(2231), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9634 | // __builtin_ve_vl_vcmpswsx_vvvl | |
| 9635 | .{ .tag = @enumFromInt(2232), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9636 | // __builtin_ve_vl_vcmpswsx_vvvmvl | |
| 9637 | .{ .tag = @enumFromInt(2233), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9638 | // __builtin_ve_vl_vcmpswsx_vvvvl | |
| 9639 | .{ .tag = @enumFromInt(2234), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9640 | // __builtin_ve_vl_vcmpswzx_vsvl | |
| 9641 | .{ .tag = @enumFromInt(2235), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9642 | // __builtin_ve_vl_vcmpswzx_vsvmvl | |
| 9643 | .{ .tag = @enumFromInt(2236), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9644 | // __builtin_ve_vl_vcmpswzx_vsvvl | |
| 9645 | .{ .tag = @enumFromInt(2237), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9646 | // __builtin_ve_vl_vcmpswzx_vvvl | |
| 9647 | .{ .tag = @enumFromInt(2238), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9648 | // __builtin_ve_vl_vcmpswzx_vvvmvl | |
| 9649 | .{ .tag = @enumFromInt(2239), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9650 | // __builtin_ve_vl_vcmpswzx_vvvvl | |
| 9651 | .{ .tag = @enumFromInt(2240), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9652 | // __builtin_ve_vl_vcmpul_vsvl | |
| 9653 | .{ .tag = @enumFromInt(2241), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9654 | // __builtin_ve_vl_vcmpul_vsvmvl | |
| 9655 | .{ .tag = @enumFromInt(2242), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9656 | // __builtin_ve_vl_vcmpul_vsvvl | |
| 9657 | .{ .tag = @enumFromInt(2243), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9658 | // __builtin_ve_vl_vcmpul_vvvl | |
| 9659 | .{ .tag = @enumFromInt(2244), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9660 | // __builtin_ve_vl_vcmpul_vvvmvl | |
| 9661 | .{ .tag = @enumFromInt(2245), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9662 | // __builtin_ve_vl_vcmpul_vvvvl | |
| 9663 | .{ .tag = @enumFromInt(2246), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9664 | // __builtin_ve_vl_vcmpuw_vsvl | |
| 9665 | .{ .tag = @enumFromInt(2247), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9666 | // __builtin_ve_vl_vcmpuw_vsvmvl | |
| 9667 | .{ .tag = @enumFromInt(2248), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9668 | // __builtin_ve_vl_vcmpuw_vsvvl | |
| 9669 | .{ .tag = @enumFromInt(2249), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9670 | // __builtin_ve_vl_vcmpuw_vvvl | |
| 9671 | .{ .tag = @enumFromInt(2250), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9672 | // __builtin_ve_vl_vcmpuw_vvvmvl | |
| 9673 | .{ .tag = @enumFromInt(2251), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9674 | // __builtin_ve_vl_vcmpuw_vvvvl | |
| 9675 | .{ .tag = @enumFromInt(2252), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9676 | // __builtin_ve_vl_vcp_vvmvl | |
| 9677 | .{ .tag = @enumFromInt(2253), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9678 | // __builtin_ve_vl_vcvtdl_vvl | |
| 9679 | .{ .tag = @enumFromInt(2254), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9680 | // __builtin_ve_vl_vcvtdl_vvvl | |
| 9681 | .{ .tag = @enumFromInt(2255), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9682 | // __builtin_ve_vl_vcvtds_vvl | |
| 9683 | .{ .tag = @enumFromInt(2256), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9684 | // __builtin_ve_vl_vcvtds_vvvl | |
| 9685 | .{ .tag = @enumFromInt(2257), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9686 | // __builtin_ve_vl_vcvtdw_vvl | |
| 9687 | .{ .tag = @enumFromInt(2258), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9688 | // __builtin_ve_vl_vcvtdw_vvvl | |
| 9689 | .{ .tag = @enumFromInt(2259), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9690 | // __builtin_ve_vl_vcvtld_vvl | |
| 9691 | .{ .tag = @enumFromInt(2260), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9692 | // __builtin_ve_vl_vcvtld_vvmvl | |
| 9693 | .{ .tag = @enumFromInt(2261), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9694 | // __builtin_ve_vl_vcvtld_vvvl | |
| 9695 | .{ .tag = @enumFromInt(2262), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9696 | // __builtin_ve_vl_vcvtldrz_vvl | |
| 9697 | .{ .tag = @enumFromInt(2263), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9698 | // __builtin_ve_vl_vcvtldrz_vvmvl | |
| 9699 | .{ .tag = @enumFromInt(2264), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9700 | // __builtin_ve_vl_vcvtldrz_vvvl | |
| 9701 | .{ .tag = @enumFromInt(2265), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9702 | // __builtin_ve_vl_vcvtsd_vvl | |
| 9703 | .{ .tag = @enumFromInt(2266), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9704 | // __builtin_ve_vl_vcvtsd_vvvl | |
| 9705 | .{ .tag = @enumFromInt(2267), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9706 | // __builtin_ve_vl_vcvtsw_vvl | |
| 9707 | .{ .tag = @enumFromInt(2268), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9708 | // __builtin_ve_vl_vcvtsw_vvvl | |
| 9709 | .{ .tag = @enumFromInt(2269), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9710 | // __builtin_ve_vl_vcvtwdsx_vvl | |
| 9711 | .{ .tag = @enumFromInt(2270), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9712 | // __builtin_ve_vl_vcvtwdsx_vvmvl | |
| 9713 | .{ .tag = @enumFromInt(2271), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9714 | // __builtin_ve_vl_vcvtwdsx_vvvl | |
| 9715 | .{ .tag = @enumFromInt(2272), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9716 | // __builtin_ve_vl_vcvtwdsxrz_vvl | |
| 9717 | .{ .tag = @enumFromInt(2273), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9718 | // __builtin_ve_vl_vcvtwdsxrz_vvmvl | |
| 9719 | .{ .tag = @enumFromInt(2274), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9720 | // __builtin_ve_vl_vcvtwdsxrz_vvvl | |
| 9721 | .{ .tag = @enumFromInt(2275), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9722 | // __builtin_ve_vl_vcvtwdzx_vvl | |
| 9723 | .{ .tag = @enumFromInt(2276), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9724 | // __builtin_ve_vl_vcvtwdzx_vvmvl | |
| 9725 | .{ .tag = @enumFromInt(2277), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9726 | // __builtin_ve_vl_vcvtwdzx_vvvl | |
| 9727 | .{ .tag = @enumFromInt(2278), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9728 | // __builtin_ve_vl_vcvtwdzxrz_vvl | |
| 9729 | .{ .tag = @enumFromInt(2279), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9730 | // __builtin_ve_vl_vcvtwdzxrz_vvmvl | |
| 9731 | .{ .tag = @enumFromInt(2280), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9732 | // __builtin_ve_vl_vcvtwdzxrz_vvvl | |
| 9733 | .{ .tag = @enumFromInt(2281), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9734 | // __builtin_ve_vl_vcvtwssx_vvl | |
| 9735 | .{ .tag = @enumFromInt(2282), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9736 | // __builtin_ve_vl_vcvtwssx_vvmvl | |
| 9737 | .{ .tag = @enumFromInt(2283), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9738 | // __builtin_ve_vl_vcvtwssx_vvvl | |
| 9739 | .{ .tag = @enumFromInt(2284), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9740 | // __builtin_ve_vl_vcvtwssxrz_vvl | |
| 9741 | .{ .tag = @enumFromInt(2285), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9742 | // __builtin_ve_vl_vcvtwssxrz_vvmvl | |
| 9743 | .{ .tag = @enumFromInt(2286), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9744 | // __builtin_ve_vl_vcvtwssxrz_vvvl | |
| 9745 | .{ .tag = @enumFromInt(2287), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9746 | // __builtin_ve_vl_vcvtwszx_vvl | |
| 9747 | .{ .tag = @enumFromInt(2288), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9748 | // __builtin_ve_vl_vcvtwszx_vvmvl | |
| 9749 | .{ .tag = @enumFromInt(2289), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9750 | // __builtin_ve_vl_vcvtwszx_vvvl | |
| 9751 | .{ .tag = @enumFromInt(2290), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9752 | // __builtin_ve_vl_vcvtwszxrz_vvl | |
| 9753 | .{ .tag = @enumFromInt(2291), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9754 | // __builtin_ve_vl_vcvtwszxrz_vvmvl | |
| 9755 | .{ .tag = @enumFromInt(2292), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9756 | // __builtin_ve_vl_vcvtwszxrz_vvvl | |
| 9757 | .{ .tag = @enumFromInt(2293), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9758 | // __builtin_ve_vl_vdivsl_vsvl | |
| 9759 | .{ .tag = @enumFromInt(2294), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9760 | // __builtin_ve_vl_vdivsl_vsvmvl | |
| 9761 | .{ .tag = @enumFromInt(2295), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9762 | // __builtin_ve_vl_vdivsl_vsvvl | |
| 9763 | .{ .tag = @enumFromInt(2296), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9764 | // __builtin_ve_vl_vdivsl_vvsl | |
| 9765 | .{ .tag = @enumFromInt(2297), .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9766 | // __builtin_ve_vl_vdivsl_vvsmvl | |
| 9767 | .{ .tag = @enumFromInt(2298), .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9768 | // __builtin_ve_vl_vdivsl_vvsvl | |
| 9769 | .{ .tag = @enumFromInt(2299), .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9770 | // __builtin_ve_vl_vdivsl_vvvl | |
| 9771 | .{ .tag = @enumFromInt(2300), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9772 | // __builtin_ve_vl_vdivsl_vvvmvl | |
| 9773 | .{ .tag = @enumFromInt(2301), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9774 | // __builtin_ve_vl_vdivsl_vvvvl | |
| 9775 | .{ .tag = @enumFromInt(2302), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9776 | // __builtin_ve_vl_vdivswsx_vsvl | |
| 9777 | .{ .tag = @enumFromInt(2303), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9778 | // __builtin_ve_vl_vdivswsx_vsvmvl | |
| 9779 | .{ .tag = @enumFromInt(2304), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9780 | // __builtin_ve_vl_vdivswsx_vsvvl | |
| 9781 | .{ .tag = @enumFromInt(2305), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9782 | // __builtin_ve_vl_vdivswsx_vvsl | |
| 9783 | .{ .tag = @enumFromInt(2306), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9784 | // __builtin_ve_vl_vdivswsx_vvsmvl | |
| 9785 | .{ .tag = @enumFromInt(2307), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9786 | // __builtin_ve_vl_vdivswsx_vvsvl | |
| 9787 | .{ .tag = @enumFromInt(2308), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9788 | // __builtin_ve_vl_vdivswsx_vvvl | |
| 9789 | .{ .tag = @enumFromInt(2309), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9790 | // __builtin_ve_vl_vdivswsx_vvvmvl | |
| 9791 | .{ .tag = @enumFromInt(2310), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9792 | // __builtin_ve_vl_vdivswsx_vvvvl | |
| 9793 | .{ .tag = @enumFromInt(2311), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9794 | // __builtin_ve_vl_vdivswzx_vsvl | |
| 9795 | .{ .tag = @enumFromInt(2312), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9796 | // __builtin_ve_vl_vdivswzx_vsvmvl | |
| 9797 | .{ .tag = @enumFromInt(2313), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9798 | // __builtin_ve_vl_vdivswzx_vsvvl | |
| 9799 | .{ .tag = @enumFromInt(2314), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9800 | // __builtin_ve_vl_vdivswzx_vvsl | |
| 9801 | .{ .tag = @enumFromInt(2315), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9802 | // __builtin_ve_vl_vdivswzx_vvsmvl | |
| 9803 | .{ .tag = @enumFromInt(2316), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9804 | // __builtin_ve_vl_vdivswzx_vvsvl | |
| 9805 | .{ .tag = @enumFromInt(2317), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9806 | // __builtin_ve_vl_vdivswzx_vvvl | |
| 9807 | .{ .tag = @enumFromInt(2318), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9808 | // __builtin_ve_vl_vdivswzx_vvvmvl | |
| 9809 | .{ .tag = @enumFromInt(2319), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9810 | // __builtin_ve_vl_vdivswzx_vvvvl | |
| 9811 | .{ .tag = @enumFromInt(2320), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9812 | // __builtin_ve_vl_vdivul_vsvl | |
| 9813 | .{ .tag = @enumFromInt(2321), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9814 | // __builtin_ve_vl_vdivul_vsvmvl | |
| 9815 | .{ .tag = @enumFromInt(2322), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9816 | // __builtin_ve_vl_vdivul_vsvvl | |
| 9817 | .{ .tag = @enumFromInt(2323), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9818 | // __builtin_ve_vl_vdivul_vvsl | |
| 9819 | .{ .tag = @enumFromInt(2324), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9820 | // __builtin_ve_vl_vdivul_vvsmvl | |
| 9821 | .{ .tag = @enumFromInt(2325), .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9822 | // __builtin_ve_vl_vdivul_vvsvl | |
| 9823 | .{ .tag = @enumFromInt(2326), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9824 | // __builtin_ve_vl_vdivul_vvvl | |
| 9825 | .{ .tag = @enumFromInt(2327), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9826 | // __builtin_ve_vl_vdivul_vvvmvl | |
| 9827 | .{ .tag = @enumFromInt(2328), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9828 | // __builtin_ve_vl_vdivul_vvvvl | |
| 9829 | .{ .tag = @enumFromInt(2329), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9830 | // __builtin_ve_vl_vdivuw_vsvl | |
| 9831 | .{ .tag = @enumFromInt(2330), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9832 | // __builtin_ve_vl_vdivuw_vsvmvl | |
| 9833 | .{ .tag = @enumFromInt(2331), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9834 | // __builtin_ve_vl_vdivuw_vsvvl | |
| 9835 | .{ .tag = @enumFromInt(2332), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9836 | // __builtin_ve_vl_vdivuw_vvsl | |
| 9837 | .{ .tag = @enumFromInt(2333), .properties = .{ .param_str = "V256dV256dUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9838 | // __builtin_ve_vl_vdivuw_vvsmvl | |
| 9839 | .{ .tag = @enumFromInt(2334), .properties = .{ .param_str = "V256dV256dUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9840 | // __builtin_ve_vl_vdivuw_vvsvl | |
| 9841 | .{ .tag = @enumFromInt(2335), .properties = .{ .param_str = "V256dV256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9842 | // __builtin_ve_vl_vdivuw_vvvl | |
| 9843 | .{ .tag = @enumFromInt(2336), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9844 | // __builtin_ve_vl_vdivuw_vvvmvl | |
| 9845 | .{ .tag = @enumFromInt(2337), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9846 | // __builtin_ve_vl_vdivuw_vvvvl | |
| 9847 | .{ .tag = @enumFromInt(2338), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9848 | // __builtin_ve_vl_veqv_vsvl | |
| 9849 | .{ .tag = @enumFromInt(2339), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9850 | // __builtin_ve_vl_veqv_vsvmvl | |
| 9851 | .{ .tag = @enumFromInt(2340), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9852 | // __builtin_ve_vl_veqv_vsvvl | |
| 9853 | .{ .tag = @enumFromInt(2341), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9854 | // __builtin_ve_vl_veqv_vvvl | |
| 9855 | .{ .tag = @enumFromInt(2342), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9856 | // __builtin_ve_vl_veqv_vvvmvl | |
| 9857 | .{ .tag = @enumFromInt(2343), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9858 | // __builtin_ve_vl_veqv_vvvvl | |
| 9859 | .{ .tag = @enumFromInt(2344), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9860 | // __builtin_ve_vl_vex_vvmvl | |
| 9861 | .{ .tag = @enumFromInt(2345), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9862 | // __builtin_ve_vl_vfaddd_vsvl | |
| 9863 | .{ .tag = @enumFromInt(2346), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9864 | // __builtin_ve_vl_vfaddd_vsvmvl | |
| 9865 | .{ .tag = @enumFromInt(2347), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9866 | // __builtin_ve_vl_vfaddd_vsvvl | |
| 9867 | .{ .tag = @enumFromInt(2348), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9868 | // __builtin_ve_vl_vfaddd_vvvl | |
| 9869 | .{ .tag = @enumFromInt(2349), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9870 | // __builtin_ve_vl_vfaddd_vvvmvl | |
| 9871 | .{ .tag = @enumFromInt(2350), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9872 | // __builtin_ve_vl_vfaddd_vvvvl | |
| 9873 | .{ .tag = @enumFromInt(2351), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9874 | // __builtin_ve_vl_vfadds_vsvl | |
| 9875 | .{ .tag = @enumFromInt(2352), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9876 | // __builtin_ve_vl_vfadds_vsvmvl | |
| 9877 | .{ .tag = @enumFromInt(2353), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9878 | // __builtin_ve_vl_vfadds_vsvvl | |
| 9879 | .{ .tag = @enumFromInt(2354), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9880 | // __builtin_ve_vl_vfadds_vvvl | |
| 9881 | .{ .tag = @enumFromInt(2355), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9882 | // __builtin_ve_vl_vfadds_vvvmvl | |
| 9883 | .{ .tag = @enumFromInt(2356), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9884 | // __builtin_ve_vl_vfadds_vvvvl | |
| 9885 | .{ .tag = @enumFromInt(2357), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9886 | // __builtin_ve_vl_vfcmpd_vsvl | |
| 9887 | .{ .tag = @enumFromInt(2358), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9888 | // __builtin_ve_vl_vfcmpd_vsvmvl | |
| 9889 | .{ .tag = @enumFromInt(2359), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9890 | // __builtin_ve_vl_vfcmpd_vsvvl | |
| 9891 | .{ .tag = @enumFromInt(2360), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9892 | // __builtin_ve_vl_vfcmpd_vvvl | |
| 9893 | .{ .tag = @enumFromInt(2361), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9894 | // __builtin_ve_vl_vfcmpd_vvvmvl | |
| 9895 | .{ .tag = @enumFromInt(2362), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9896 | // __builtin_ve_vl_vfcmpd_vvvvl | |
| 9897 | .{ .tag = @enumFromInt(2363), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9898 | // __builtin_ve_vl_vfcmps_vsvl | |
| 9899 | .{ .tag = @enumFromInt(2364), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9900 | // __builtin_ve_vl_vfcmps_vsvmvl | |
| 9901 | .{ .tag = @enumFromInt(2365), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9902 | // __builtin_ve_vl_vfcmps_vsvvl | |
| 9903 | .{ .tag = @enumFromInt(2366), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9904 | // __builtin_ve_vl_vfcmps_vvvl | |
| 9905 | .{ .tag = @enumFromInt(2367), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9906 | // __builtin_ve_vl_vfcmps_vvvmvl | |
| 9907 | .{ .tag = @enumFromInt(2368), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9908 | // __builtin_ve_vl_vfcmps_vvvvl | |
| 9909 | .{ .tag = @enumFromInt(2369), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9910 | // __builtin_ve_vl_vfdivd_vsvl | |
| 9911 | .{ .tag = @enumFromInt(2370), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9912 | // __builtin_ve_vl_vfdivd_vsvmvl | |
| 9913 | .{ .tag = @enumFromInt(2371), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9914 | // __builtin_ve_vl_vfdivd_vsvvl | |
| 9915 | .{ .tag = @enumFromInt(2372), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9916 | // __builtin_ve_vl_vfdivd_vvvl | |
| 9917 | .{ .tag = @enumFromInt(2373), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9918 | // __builtin_ve_vl_vfdivd_vvvmvl | |
| 9919 | .{ .tag = @enumFromInt(2374), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9920 | // __builtin_ve_vl_vfdivd_vvvvl | |
| 9921 | .{ .tag = @enumFromInt(2375), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9922 | // __builtin_ve_vl_vfdivs_vsvl | |
| 9923 | .{ .tag = @enumFromInt(2376), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9924 | // __builtin_ve_vl_vfdivs_vsvmvl | |
| 9925 | .{ .tag = @enumFromInt(2377), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9926 | // __builtin_ve_vl_vfdivs_vsvvl | |
| 9927 | .{ .tag = @enumFromInt(2378), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9928 | // __builtin_ve_vl_vfdivs_vvvl | |
| 9929 | .{ .tag = @enumFromInt(2379), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9930 | // __builtin_ve_vl_vfdivs_vvvmvl | |
| 9931 | .{ .tag = @enumFromInt(2380), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9932 | // __builtin_ve_vl_vfdivs_vvvvl | |
| 9933 | .{ .tag = @enumFromInt(2381), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9934 | // __builtin_ve_vl_vfmadd_vsvvl | |
| 9935 | .{ .tag = @enumFromInt(2382), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9936 | // __builtin_ve_vl_vfmadd_vsvvmvl | |
| 9937 | .{ .tag = @enumFromInt(2383), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9938 | // __builtin_ve_vl_vfmadd_vsvvvl | |
| 9939 | .{ .tag = @enumFromInt(2384), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9940 | // __builtin_ve_vl_vfmadd_vvsvl | |
| 9941 | .{ .tag = @enumFromInt(2385), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9942 | // __builtin_ve_vl_vfmadd_vvsvmvl | |
| 9943 | .{ .tag = @enumFromInt(2386), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9944 | // __builtin_ve_vl_vfmadd_vvsvvl | |
| 9945 | .{ .tag = @enumFromInt(2387), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9946 | // __builtin_ve_vl_vfmadd_vvvvl | |
| 9947 | .{ .tag = @enumFromInt(2388), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9948 | // __builtin_ve_vl_vfmadd_vvvvmvl | |
| 9949 | .{ .tag = @enumFromInt(2389), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9950 | // __builtin_ve_vl_vfmadd_vvvvvl | |
| 9951 | .{ .tag = @enumFromInt(2390), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9952 | // __builtin_ve_vl_vfmads_vsvvl | |
| 9953 | .{ .tag = @enumFromInt(2391), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9954 | // __builtin_ve_vl_vfmads_vsvvmvl | |
| 9955 | .{ .tag = @enumFromInt(2392), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9956 | // __builtin_ve_vl_vfmads_vsvvvl | |
| 9957 | .{ .tag = @enumFromInt(2393), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9958 | // __builtin_ve_vl_vfmads_vvsvl | |
| 9959 | .{ .tag = @enumFromInt(2394), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9960 | // __builtin_ve_vl_vfmads_vvsvmvl | |
| 9961 | .{ .tag = @enumFromInt(2395), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9962 | // __builtin_ve_vl_vfmads_vvsvvl | |
| 9963 | .{ .tag = @enumFromInt(2396), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9964 | // __builtin_ve_vl_vfmads_vvvvl | |
| 9965 | .{ .tag = @enumFromInt(2397), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9966 | // __builtin_ve_vl_vfmads_vvvvmvl | |
| 9967 | .{ .tag = @enumFromInt(2398), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9968 | // __builtin_ve_vl_vfmads_vvvvvl | |
| 9969 | .{ .tag = @enumFromInt(2399), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9970 | // __builtin_ve_vl_vfmaxd_vsvl | |
| 9971 | .{ .tag = @enumFromInt(2400), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9972 | // __builtin_ve_vl_vfmaxd_vsvmvl | |
| 9973 | .{ .tag = @enumFromInt(2401), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9974 | // __builtin_ve_vl_vfmaxd_vsvvl | |
| 9975 | .{ .tag = @enumFromInt(2402), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9976 | // __builtin_ve_vl_vfmaxd_vvvl | |
| 9977 | .{ .tag = @enumFromInt(2403), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9978 | // __builtin_ve_vl_vfmaxd_vvvmvl | |
| 9979 | .{ .tag = @enumFromInt(2404), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9980 | // __builtin_ve_vl_vfmaxd_vvvvl | |
| 9981 | .{ .tag = @enumFromInt(2405), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9982 | // __builtin_ve_vl_vfmaxs_vsvl | |
| 9983 | .{ .tag = @enumFromInt(2406), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9984 | // __builtin_ve_vl_vfmaxs_vsvmvl | |
| 9985 | .{ .tag = @enumFromInt(2407), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9986 | // __builtin_ve_vl_vfmaxs_vsvvl | |
| 9987 | .{ .tag = @enumFromInt(2408), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9988 | // __builtin_ve_vl_vfmaxs_vvvl | |
| 9989 | .{ .tag = @enumFromInt(2409), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9990 | // __builtin_ve_vl_vfmaxs_vvvmvl | |
| 9991 | .{ .tag = @enumFromInt(2410), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9992 | // __builtin_ve_vl_vfmaxs_vvvvl | |
| 9993 | .{ .tag = @enumFromInt(2411), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9994 | // __builtin_ve_vl_vfmind_vsvl | |
| 9995 | .{ .tag = @enumFromInt(2412), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9996 | // __builtin_ve_vl_vfmind_vsvmvl | |
| 9997 | .{ .tag = @enumFromInt(2413), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 9998 | // __builtin_ve_vl_vfmind_vsvvl | |
| 9999 | .{ .tag = @enumFromInt(2414), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10000 | // __builtin_ve_vl_vfmind_vvvl | |
| 10001 | .{ .tag = @enumFromInt(2415), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10002 | // __builtin_ve_vl_vfmind_vvvmvl | |
| 10003 | .{ .tag = @enumFromInt(2416), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10004 | // __builtin_ve_vl_vfmind_vvvvl | |
| 10005 | .{ .tag = @enumFromInt(2417), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10006 | // __builtin_ve_vl_vfmins_vsvl | |
| 10007 | .{ .tag = @enumFromInt(2418), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10008 | // __builtin_ve_vl_vfmins_vsvmvl | |
| 10009 | .{ .tag = @enumFromInt(2419), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10010 | // __builtin_ve_vl_vfmins_vsvvl | |
| 10011 | .{ .tag = @enumFromInt(2420), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10012 | // __builtin_ve_vl_vfmins_vvvl | |
| 10013 | .{ .tag = @enumFromInt(2421), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10014 | // __builtin_ve_vl_vfmins_vvvmvl | |
| 10015 | .{ .tag = @enumFromInt(2422), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10016 | // __builtin_ve_vl_vfmins_vvvvl | |
| 10017 | .{ .tag = @enumFromInt(2423), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10018 | // __builtin_ve_vl_vfmkdeq_mvl | |
| 10019 | .{ .tag = @enumFromInt(2424), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10020 | // __builtin_ve_vl_vfmkdeq_mvml | |
| 10021 | .{ .tag = @enumFromInt(2425), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10022 | // __builtin_ve_vl_vfmkdeqnan_mvl | |
| 10023 | .{ .tag = @enumFromInt(2426), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10024 | // __builtin_ve_vl_vfmkdeqnan_mvml | |
| 10025 | .{ .tag = @enumFromInt(2427), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10026 | // __builtin_ve_vl_vfmkdge_mvl | |
| 10027 | .{ .tag = @enumFromInt(2428), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10028 | // __builtin_ve_vl_vfmkdge_mvml | |
| 10029 | .{ .tag = @enumFromInt(2429), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10030 | // __builtin_ve_vl_vfmkdgenan_mvl | |
| 10031 | .{ .tag = @enumFromInt(2430), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10032 | // __builtin_ve_vl_vfmkdgenan_mvml | |
| 10033 | .{ .tag = @enumFromInt(2431), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10034 | // __builtin_ve_vl_vfmkdgt_mvl | |
| 10035 | .{ .tag = @enumFromInt(2432), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10036 | // __builtin_ve_vl_vfmkdgt_mvml | |
| 10037 | .{ .tag = @enumFromInt(2433), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10038 | // __builtin_ve_vl_vfmkdgtnan_mvl | |
| 10039 | .{ .tag = @enumFromInt(2434), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10040 | // __builtin_ve_vl_vfmkdgtnan_mvml | |
| 10041 | .{ .tag = @enumFromInt(2435), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10042 | // __builtin_ve_vl_vfmkdle_mvl | |
| 10043 | .{ .tag = @enumFromInt(2436), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10044 | // __builtin_ve_vl_vfmkdle_mvml | |
| 10045 | .{ .tag = @enumFromInt(2437), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10046 | // __builtin_ve_vl_vfmkdlenan_mvl | |
| 10047 | .{ .tag = @enumFromInt(2438), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10048 | // __builtin_ve_vl_vfmkdlenan_mvml | |
| 10049 | .{ .tag = @enumFromInt(2439), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10050 | // __builtin_ve_vl_vfmkdlt_mvl | |
| 10051 | .{ .tag = @enumFromInt(2440), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10052 | // __builtin_ve_vl_vfmkdlt_mvml | |
| 10053 | .{ .tag = @enumFromInt(2441), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10054 | // __builtin_ve_vl_vfmkdltnan_mvl | |
| 10055 | .{ .tag = @enumFromInt(2442), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10056 | // __builtin_ve_vl_vfmkdltnan_mvml | |
| 10057 | .{ .tag = @enumFromInt(2443), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10058 | // __builtin_ve_vl_vfmkdnan_mvl | |
| 10059 | .{ .tag = @enumFromInt(2444), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10060 | // __builtin_ve_vl_vfmkdnan_mvml | |
| 10061 | .{ .tag = @enumFromInt(2445), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10062 | // __builtin_ve_vl_vfmkdne_mvl | |
| 10063 | .{ .tag = @enumFromInt(2446), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10064 | // __builtin_ve_vl_vfmkdne_mvml | |
| 10065 | .{ .tag = @enumFromInt(2447), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10066 | // __builtin_ve_vl_vfmkdnenan_mvl | |
| 10067 | .{ .tag = @enumFromInt(2448), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10068 | // __builtin_ve_vl_vfmkdnenan_mvml | |
| 10069 | .{ .tag = @enumFromInt(2449), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10070 | // __builtin_ve_vl_vfmkdnum_mvl | |
| 10071 | .{ .tag = @enumFromInt(2450), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10072 | // __builtin_ve_vl_vfmkdnum_mvml | |
| 10073 | .{ .tag = @enumFromInt(2451), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10074 | // __builtin_ve_vl_vfmklaf_ml | |
| 10075 | .{ .tag = @enumFromInt(2452), .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10076 | // __builtin_ve_vl_vfmklat_ml | |
| 10077 | .{ .tag = @enumFromInt(2453), .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10078 | // __builtin_ve_vl_vfmkleq_mvl | |
| 10079 | .{ .tag = @enumFromInt(2454), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10080 | // __builtin_ve_vl_vfmkleq_mvml | |
| 10081 | .{ .tag = @enumFromInt(2455), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10082 | // __builtin_ve_vl_vfmkleqnan_mvl | |
| 10083 | .{ .tag = @enumFromInt(2456), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10084 | // __builtin_ve_vl_vfmkleqnan_mvml | |
| 10085 | .{ .tag = @enumFromInt(2457), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10086 | // __builtin_ve_vl_vfmklge_mvl | |
| 10087 | .{ .tag = @enumFromInt(2458), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10088 | // __builtin_ve_vl_vfmklge_mvml | |
| 10089 | .{ .tag = @enumFromInt(2459), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10090 | // __builtin_ve_vl_vfmklgenan_mvl | |
| 10091 | .{ .tag = @enumFromInt(2460), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10092 | // __builtin_ve_vl_vfmklgenan_mvml | |
| 10093 | .{ .tag = @enumFromInt(2461), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10094 | // __builtin_ve_vl_vfmklgt_mvl | |
| 10095 | .{ .tag = @enumFromInt(2462), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10096 | // __builtin_ve_vl_vfmklgt_mvml | |
| 10097 | .{ .tag = @enumFromInt(2463), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10098 | // __builtin_ve_vl_vfmklgtnan_mvl | |
| 10099 | .{ .tag = @enumFromInt(2464), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10100 | // __builtin_ve_vl_vfmklgtnan_mvml | |
| 10101 | .{ .tag = @enumFromInt(2465), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10102 | // __builtin_ve_vl_vfmklle_mvl | |
| 10103 | .{ .tag = @enumFromInt(2466), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10104 | // __builtin_ve_vl_vfmklle_mvml | |
| 10105 | .{ .tag = @enumFromInt(2467), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10106 | // __builtin_ve_vl_vfmkllenan_mvl | |
| 10107 | .{ .tag = @enumFromInt(2468), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10108 | // __builtin_ve_vl_vfmkllenan_mvml | |
| 10109 | .{ .tag = @enumFromInt(2469), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10110 | // __builtin_ve_vl_vfmkllt_mvl | |
| 10111 | .{ .tag = @enumFromInt(2470), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10112 | // __builtin_ve_vl_vfmkllt_mvml | |
| 10113 | .{ .tag = @enumFromInt(2471), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10114 | // __builtin_ve_vl_vfmklltnan_mvl | |
| 10115 | .{ .tag = @enumFromInt(2472), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10116 | // __builtin_ve_vl_vfmklltnan_mvml | |
| 10117 | .{ .tag = @enumFromInt(2473), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10118 | // __builtin_ve_vl_vfmklnan_mvl | |
| 10119 | .{ .tag = @enumFromInt(2474), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10120 | // __builtin_ve_vl_vfmklnan_mvml | |
| 10121 | .{ .tag = @enumFromInt(2475), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10122 | // __builtin_ve_vl_vfmklne_mvl | |
| 10123 | .{ .tag = @enumFromInt(2476), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10124 | // __builtin_ve_vl_vfmklne_mvml | |
| 10125 | .{ .tag = @enumFromInt(2477), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10126 | // __builtin_ve_vl_vfmklnenan_mvl | |
| 10127 | .{ .tag = @enumFromInt(2478), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10128 | // __builtin_ve_vl_vfmklnenan_mvml | |
| 10129 | .{ .tag = @enumFromInt(2479), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10130 | // __builtin_ve_vl_vfmklnum_mvl | |
| 10131 | .{ .tag = @enumFromInt(2480), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10132 | // __builtin_ve_vl_vfmklnum_mvml | |
| 10133 | .{ .tag = @enumFromInt(2481), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10134 | // __builtin_ve_vl_vfmkseq_mvl | |
| 10135 | .{ .tag = @enumFromInt(2482), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10136 | // __builtin_ve_vl_vfmkseq_mvml | |
| 10137 | .{ .tag = @enumFromInt(2483), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10138 | // __builtin_ve_vl_vfmkseqnan_mvl | |
| 10139 | .{ .tag = @enumFromInt(2484), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10140 | // __builtin_ve_vl_vfmkseqnan_mvml | |
| 10141 | .{ .tag = @enumFromInt(2485), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10142 | // __builtin_ve_vl_vfmksge_mvl | |
| 10143 | .{ .tag = @enumFromInt(2486), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10144 | // __builtin_ve_vl_vfmksge_mvml | |
| 10145 | .{ .tag = @enumFromInt(2487), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10146 | // __builtin_ve_vl_vfmksgenan_mvl | |
| 10147 | .{ .tag = @enumFromInt(2488), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10148 | // __builtin_ve_vl_vfmksgenan_mvml | |
| 10149 | .{ .tag = @enumFromInt(2489), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10150 | // __builtin_ve_vl_vfmksgt_mvl | |
| 10151 | .{ .tag = @enumFromInt(2490), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10152 | // __builtin_ve_vl_vfmksgt_mvml | |
| 10153 | .{ .tag = @enumFromInt(2491), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10154 | // __builtin_ve_vl_vfmksgtnan_mvl | |
| 10155 | .{ .tag = @enumFromInt(2492), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10156 | // __builtin_ve_vl_vfmksgtnan_mvml | |
| 10157 | .{ .tag = @enumFromInt(2493), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10158 | // __builtin_ve_vl_vfmksle_mvl | |
| 10159 | .{ .tag = @enumFromInt(2494), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10160 | // __builtin_ve_vl_vfmksle_mvml | |
| 10161 | .{ .tag = @enumFromInt(2495), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10162 | // __builtin_ve_vl_vfmkslenan_mvl | |
| 10163 | .{ .tag = @enumFromInt(2496), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10164 | // __builtin_ve_vl_vfmkslenan_mvml | |
| 10165 | .{ .tag = @enumFromInt(2497), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10166 | // __builtin_ve_vl_vfmkslt_mvl | |
| 10167 | .{ .tag = @enumFromInt(2498), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10168 | // __builtin_ve_vl_vfmkslt_mvml | |
| 10169 | .{ .tag = @enumFromInt(2499), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10170 | // __builtin_ve_vl_vfmksltnan_mvl | |
| 10171 | .{ .tag = @enumFromInt(2500), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10172 | // __builtin_ve_vl_vfmksltnan_mvml | |
| 10173 | .{ .tag = @enumFromInt(2501), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10174 | // __builtin_ve_vl_vfmksnan_mvl | |
| 10175 | .{ .tag = @enumFromInt(2502), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10176 | // __builtin_ve_vl_vfmksnan_mvml | |
| 10177 | .{ .tag = @enumFromInt(2503), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10178 | // __builtin_ve_vl_vfmksne_mvl | |
| 10179 | .{ .tag = @enumFromInt(2504), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10180 | // __builtin_ve_vl_vfmksne_mvml | |
| 10181 | .{ .tag = @enumFromInt(2505), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10182 | // __builtin_ve_vl_vfmksnenan_mvl | |
| 10183 | .{ .tag = @enumFromInt(2506), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10184 | // __builtin_ve_vl_vfmksnenan_mvml | |
| 10185 | .{ .tag = @enumFromInt(2507), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10186 | // __builtin_ve_vl_vfmksnum_mvl | |
| 10187 | .{ .tag = @enumFromInt(2508), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10188 | // __builtin_ve_vl_vfmksnum_mvml | |
| 10189 | .{ .tag = @enumFromInt(2509), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10190 | // __builtin_ve_vl_vfmkweq_mvl | |
| 10191 | .{ .tag = @enumFromInt(2510), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10192 | // __builtin_ve_vl_vfmkweq_mvml | |
| 10193 | .{ .tag = @enumFromInt(2511), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10194 | // __builtin_ve_vl_vfmkweqnan_mvl | |
| 10195 | .{ .tag = @enumFromInt(2512), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10196 | // __builtin_ve_vl_vfmkweqnan_mvml | |
| 10197 | .{ .tag = @enumFromInt(2513), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10198 | // __builtin_ve_vl_vfmkwge_mvl | |
| 10199 | .{ .tag = @enumFromInt(2514), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10200 | // __builtin_ve_vl_vfmkwge_mvml | |
| 10201 | .{ .tag = @enumFromInt(2515), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10202 | // __builtin_ve_vl_vfmkwgenan_mvl | |
| 10203 | .{ .tag = @enumFromInt(2516), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10204 | // __builtin_ve_vl_vfmkwgenan_mvml | |
| 10205 | .{ .tag = @enumFromInt(2517), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10206 | // __builtin_ve_vl_vfmkwgt_mvl | |
| 10207 | .{ .tag = @enumFromInt(2518), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10208 | // __builtin_ve_vl_vfmkwgt_mvml | |
| 10209 | .{ .tag = @enumFromInt(2519), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10210 | // __builtin_ve_vl_vfmkwgtnan_mvl | |
| 10211 | .{ .tag = @enumFromInt(2520), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10212 | // __builtin_ve_vl_vfmkwgtnan_mvml | |
| 10213 | .{ .tag = @enumFromInt(2521), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10214 | // __builtin_ve_vl_vfmkwle_mvl | |
| 10215 | .{ .tag = @enumFromInt(2522), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10216 | // __builtin_ve_vl_vfmkwle_mvml | |
| 10217 | .{ .tag = @enumFromInt(2523), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10218 | // __builtin_ve_vl_vfmkwlenan_mvl | |
| 10219 | .{ .tag = @enumFromInt(2524), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10220 | // __builtin_ve_vl_vfmkwlenan_mvml | |
| 10221 | .{ .tag = @enumFromInt(2525), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10222 | // __builtin_ve_vl_vfmkwlt_mvl | |
| 10223 | .{ .tag = @enumFromInt(2526), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10224 | // __builtin_ve_vl_vfmkwlt_mvml | |
| 10225 | .{ .tag = @enumFromInt(2527), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10226 | // __builtin_ve_vl_vfmkwltnan_mvl | |
| 10227 | .{ .tag = @enumFromInt(2528), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10228 | // __builtin_ve_vl_vfmkwltnan_mvml | |
| 10229 | .{ .tag = @enumFromInt(2529), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10230 | // __builtin_ve_vl_vfmkwnan_mvl | |
| 10231 | .{ .tag = @enumFromInt(2530), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10232 | // __builtin_ve_vl_vfmkwnan_mvml | |
| 10233 | .{ .tag = @enumFromInt(2531), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10234 | // __builtin_ve_vl_vfmkwne_mvl | |
| 10235 | .{ .tag = @enumFromInt(2532), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10236 | // __builtin_ve_vl_vfmkwne_mvml | |
| 10237 | .{ .tag = @enumFromInt(2533), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10238 | // __builtin_ve_vl_vfmkwnenan_mvl | |
| 10239 | .{ .tag = @enumFromInt(2534), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10240 | // __builtin_ve_vl_vfmkwnenan_mvml | |
| 10241 | .{ .tag = @enumFromInt(2535), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10242 | // __builtin_ve_vl_vfmkwnum_mvl | |
| 10243 | .{ .tag = @enumFromInt(2536), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10244 | // __builtin_ve_vl_vfmkwnum_mvml | |
| 10245 | .{ .tag = @enumFromInt(2537), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10246 | // __builtin_ve_vl_vfmsbd_vsvvl | |
| 10247 | .{ .tag = @enumFromInt(2538), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10248 | // __builtin_ve_vl_vfmsbd_vsvvmvl | |
| 10249 | .{ .tag = @enumFromInt(2539), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10250 | // __builtin_ve_vl_vfmsbd_vsvvvl | |
| 10251 | .{ .tag = @enumFromInt(2540), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10252 | // __builtin_ve_vl_vfmsbd_vvsvl | |
| 10253 | .{ .tag = @enumFromInt(2541), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10254 | // __builtin_ve_vl_vfmsbd_vvsvmvl | |
| 10255 | .{ .tag = @enumFromInt(2542), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10256 | // __builtin_ve_vl_vfmsbd_vvsvvl | |
| 10257 | .{ .tag = @enumFromInt(2543), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10258 | // __builtin_ve_vl_vfmsbd_vvvvl | |
| 10259 | .{ .tag = @enumFromInt(2544), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10260 | // __builtin_ve_vl_vfmsbd_vvvvmvl | |
| 10261 | .{ .tag = @enumFromInt(2545), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10262 | // __builtin_ve_vl_vfmsbd_vvvvvl | |
| 10263 | .{ .tag = @enumFromInt(2546), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10264 | // __builtin_ve_vl_vfmsbs_vsvvl | |
| 10265 | .{ .tag = @enumFromInt(2547), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10266 | // __builtin_ve_vl_vfmsbs_vsvvmvl | |
| 10267 | .{ .tag = @enumFromInt(2548), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10268 | // __builtin_ve_vl_vfmsbs_vsvvvl | |
| 10269 | .{ .tag = @enumFromInt(2549), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10270 | // __builtin_ve_vl_vfmsbs_vvsvl | |
| 10271 | .{ .tag = @enumFromInt(2550), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10272 | // __builtin_ve_vl_vfmsbs_vvsvmvl | |
| 10273 | .{ .tag = @enumFromInt(2551), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10274 | // __builtin_ve_vl_vfmsbs_vvsvvl | |
| 10275 | .{ .tag = @enumFromInt(2552), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10276 | // __builtin_ve_vl_vfmsbs_vvvvl | |
| 10277 | .{ .tag = @enumFromInt(2553), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10278 | // __builtin_ve_vl_vfmsbs_vvvvmvl | |
| 10279 | .{ .tag = @enumFromInt(2554), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10280 | // __builtin_ve_vl_vfmsbs_vvvvvl | |
| 10281 | .{ .tag = @enumFromInt(2555), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10282 | // __builtin_ve_vl_vfmuld_vsvl | |
| 10283 | .{ .tag = @enumFromInt(2556), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10284 | // __builtin_ve_vl_vfmuld_vsvmvl | |
| 10285 | .{ .tag = @enumFromInt(2557), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10286 | // __builtin_ve_vl_vfmuld_vsvvl | |
| 10287 | .{ .tag = @enumFromInt(2558), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10288 | // __builtin_ve_vl_vfmuld_vvvl | |
| 10289 | .{ .tag = @enumFromInt(2559), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10290 | // __builtin_ve_vl_vfmuld_vvvmvl | |
| 10291 | .{ .tag = @enumFromInt(2560), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10292 | // __builtin_ve_vl_vfmuld_vvvvl | |
| 10293 | .{ .tag = @enumFromInt(2561), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10294 | // __builtin_ve_vl_vfmuls_vsvl | |
| 10295 | .{ .tag = @enumFromInt(2562), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10296 | // __builtin_ve_vl_vfmuls_vsvmvl | |
| 10297 | .{ .tag = @enumFromInt(2563), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10298 | // __builtin_ve_vl_vfmuls_vsvvl | |
| 10299 | .{ .tag = @enumFromInt(2564), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10300 | // __builtin_ve_vl_vfmuls_vvvl | |
| 10301 | .{ .tag = @enumFromInt(2565), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10302 | // __builtin_ve_vl_vfmuls_vvvmvl | |
| 10303 | .{ .tag = @enumFromInt(2566), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10304 | // __builtin_ve_vl_vfmuls_vvvvl | |
| 10305 | .{ .tag = @enumFromInt(2567), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10306 | // __builtin_ve_vl_vfnmadd_vsvvl | |
| 10307 | .{ .tag = @enumFromInt(2568), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10308 | // __builtin_ve_vl_vfnmadd_vsvvmvl | |
| 10309 | .{ .tag = @enumFromInt(2569), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10310 | // __builtin_ve_vl_vfnmadd_vsvvvl | |
| 10311 | .{ .tag = @enumFromInt(2570), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10312 | // __builtin_ve_vl_vfnmadd_vvsvl | |
| 10313 | .{ .tag = @enumFromInt(2571), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10314 | // __builtin_ve_vl_vfnmadd_vvsvmvl | |
| 10315 | .{ .tag = @enumFromInt(2572), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10316 | // __builtin_ve_vl_vfnmadd_vvsvvl | |
| 10317 | .{ .tag = @enumFromInt(2573), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10318 | // __builtin_ve_vl_vfnmadd_vvvvl | |
| 10319 | .{ .tag = @enumFromInt(2574), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10320 | // __builtin_ve_vl_vfnmadd_vvvvmvl | |
| 10321 | .{ .tag = @enumFromInt(2575), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10322 | // __builtin_ve_vl_vfnmadd_vvvvvl | |
| 10323 | .{ .tag = @enumFromInt(2576), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10324 | // __builtin_ve_vl_vfnmads_vsvvl | |
| 10325 | .{ .tag = @enumFromInt(2577), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10326 | // __builtin_ve_vl_vfnmads_vsvvmvl | |
| 10327 | .{ .tag = @enumFromInt(2578), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10328 | // __builtin_ve_vl_vfnmads_vsvvvl | |
| 10329 | .{ .tag = @enumFromInt(2579), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10330 | // __builtin_ve_vl_vfnmads_vvsvl | |
| 10331 | .{ .tag = @enumFromInt(2580), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10332 | // __builtin_ve_vl_vfnmads_vvsvmvl | |
| 10333 | .{ .tag = @enumFromInt(2581), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10334 | // __builtin_ve_vl_vfnmads_vvsvvl | |
| 10335 | .{ .tag = @enumFromInt(2582), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10336 | // __builtin_ve_vl_vfnmads_vvvvl | |
| 10337 | .{ .tag = @enumFromInt(2583), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10338 | // __builtin_ve_vl_vfnmads_vvvvmvl | |
| 10339 | .{ .tag = @enumFromInt(2584), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10340 | // __builtin_ve_vl_vfnmads_vvvvvl | |
| 10341 | .{ .tag = @enumFromInt(2585), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10342 | // __builtin_ve_vl_vfnmsbd_vsvvl | |
| 10343 | .{ .tag = @enumFromInt(2586), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10344 | // __builtin_ve_vl_vfnmsbd_vsvvmvl | |
| 10345 | .{ .tag = @enumFromInt(2587), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10346 | // __builtin_ve_vl_vfnmsbd_vsvvvl | |
| 10347 | .{ .tag = @enumFromInt(2588), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10348 | // __builtin_ve_vl_vfnmsbd_vvsvl | |
| 10349 | .{ .tag = @enumFromInt(2589), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10350 | // __builtin_ve_vl_vfnmsbd_vvsvmvl | |
| 10351 | .{ .tag = @enumFromInt(2590), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10352 | // __builtin_ve_vl_vfnmsbd_vvsvvl | |
| 10353 | .{ .tag = @enumFromInt(2591), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10354 | // __builtin_ve_vl_vfnmsbd_vvvvl | |
| 10355 | .{ .tag = @enumFromInt(2592), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10356 | // __builtin_ve_vl_vfnmsbd_vvvvmvl | |
| 10357 | .{ .tag = @enumFromInt(2593), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10358 | // __builtin_ve_vl_vfnmsbd_vvvvvl | |
| 10359 | .{ .tag = @enumFromInt(2594), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10360 | // __builtin_ve_vl_vfnmsbs_vsvvl | |
| 10361 | .{ .tag = @enumFromInt(2595), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10362 | // __builtin_ve_vl_vfnmsbs_vsvvmvl | |
| 10363 | .{ .tag = @enumFromInt(2596), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10364 | // __builtin_ve_vl_vfnmsbs_vsvvvl | |
| 10365 | .{ .tag = @enumFromInt(2597), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10366 | // __builtin_ve_vl_vfnmsbs_vvsvl | |
| 10367 | .{ .tag = @enumFromInt(2598), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10368 | // __builtin_ve_vl_vfnmsbs_vvsvmvl | |
| 10369 | .{ .tag = @enumFromInt(2599), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10370 | // __builtin_ve_vl_vfnmsbs_vvsvvl | |
| 10371 | .{ .tag = @enumFromInt(2600), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10372 | // __builtin_ve_vl_vfnmsbs_vvvvl | |
| 10373 | .{ .tag = @enumFromInt(2601), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10374 | // __builtin_ve_vl_vfnmsbs_vvvvmvl | |
| 10375 | .{ .tag = @enumFromInt(2602), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10376 | // __builtin_ve_vl_vfnmsbs_vvvvvl | |
| 10377 | .{ .tag = @enumFromInt(2603), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10378 | // __builtin_ve_vl_vfrmaxdfst_vvl | |
| 10379 | .{ .tag = @enumFromInt(2604), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10380 | // __builtin_ve_vl_vfrmaxdfst_vvvl | |
| 10381 | .{ .tag = @enumFromInt(2605), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10382 | // __builtin_ve_vl_vfrmaxdlst_vvl | |
| 10383 | .{ .tag = @enumFromInt(2606), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10384 | // __builtin_ve_vl_vfrmaxdlst_vvvl | |
| 10385 | .{ .tag = @enumFromInt(2607), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10386 | // __builtin_ve_vl_vfrmaxsfst_vvl | |
| 10387 | .{ .tag = @enumFromInt(2608), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10388 | // __builtin_ve_vl_vfrmaxsfst_vvvl | |
| 10389 | .{ .tag = @enumFromInt(2609), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10390 | // __builtin_ve_vl_vfrmaxslst_vvl | |
| 10391 | .{ .tag = @enumFromInt(2610), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10392 | // __builtin_ve_vl_vfrmaxslst_vvvl | |
| 10393 | .{ .tag = @enumFromInt(2611), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10394 | // __builtin_ve_vl_vfrmindfst_vvl | |
| 10395 | .{ .tag = @enumFromInt(2612), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10396 | // __builtin_ve_vl_vfrmindfst_vvvl | |
| 10397 | .{ .tag = @enumFromInt(2613), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10398 | // __builtin_ve_vl_vfrmindlst_vvl | |
| 10399 | .{ .tag = @enumFromInt(2614), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10400 | // __builtin_ve_vl_vfrmindlst_vvvl | |
| 10401 | .{ .tag = @enumFromInt(2615), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10402 | // __builtin_ve_vl_vfrminsfst_vvl | |
| 10403 | .{ .tag = @enumFromInt(2616), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10404 | // __builtin_ve_vl_vfrminsfst_vvvl | |
| 10405 | .{ .tag = @enumFromInt(2617), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10406 | // __builtin_ve_vl_vfrminslst_vvl | |
| 10407 | .{ .tag = @enumFromInt(2618), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10408 | // __builtin_ve_vl_vfrminslst_vvvl | |
| 10409 | .{ .tag = @enumFromInt(2619), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10410 | // __builtin_ve_vl_vfsqrtd_vvl | |
| 10411 | .{ .tag = @enumFromInt(2620), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10412 | // __builtin_ve_vl_vfsqrtd_vvvl | |
| 10413 | .{ .tag = @enumFromInt(2621), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10414 | // __builtin_ve_vl_vfsqrts_vvl | |
| 10415 | .{ .tag = @enumFromInt(2622), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10416 | // __builtin_ve_vl_vfsqrts_vvvl | |
| 10417 | .{ .tag = @enumFromInt(2623), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10418 | // __builtin_ve_vl_vfsubd_vsvl | |
| 10419 | .{ .tag = @enumFromInt(2624), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10420 | // __builtin_ve_vl_vfsubd_vsvmvl | |
| 10421 | .{ .tag = @enumFromInt(2625), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10422 | // __builtin_ve_vl_vfsubd_vsvvl | |
| 10423 | .{ .tag = @enumFromInt(2626), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10424 | // __builtin_ve_vl_vfsubd_vvvl | |
| 10425 | .{ .tag = @enumFromInt(2627), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10426 | // __builtin_ve_vl_vfsubd_vvvmvl | |
| 10427 | .{ .tag = @enumFromInt(2628), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10428 | // __builtin_ve_vl_vfsubd_vvvvl | |
| 10429 | .{ .tag = @enumFromInt(2629), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10430 | // __builtin_ve_vl_vfsubs_vsvl | |
| 10431 | .{ .tag = @enumFromInt(2630), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10432 | // __builtin_ve_vl_vfsubs_vsvmvl | |
| 10433 | .{ .tag = @enumFromInt(2631), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10434 | // __builtin_ve_vl_vfsubs_vsvvl | |
| 10435 | .{ .tag = @enumFromInt(2632), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10436 | // __builtin_ve_vl_vfsubs_vvvl | |
| 10437 | .{ .tag = @enumFromInt(2633), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10438 | // __builtin_ve_vl_vfsubs_vvvmvl | |
| 10439 | .{ .tag = @enumFromInt(2634), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10440 | // __builtin_ve_vl_vfsubs_vvvvl | |
| 10441 | .{ .tag = @enumFromInt(2635), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10442 | // __builtin_ve_vl_vfsumd_vvl | |
| 10443 | .{ .tag = @enumFromInt(2636), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10444 | // __builtin_ve_vl_vfsumd_vvml | |
| 10445 | .{ .tag = @enumFromInt(2637), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10446 | // __builtin_ve_vl_vfsums_vvl | |
| 10447 | .{ .tag = @enumFromInt(2638), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10448 | // __builtin_ve_vl_vfsums_vvml | |
| 10449 | .{ .tag = @enumFromInt(2639), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10450 | // __builtin_ve_vl_vgt_vvssl | |
| 10451 | .{ .tag = @enumFromInt(2640), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10452 | // __builtin_ve_vl_vgt_vvssml | |
| 10453 | .{ .tag = @enumFromInt(2641), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10454 | // __builtin_ve_vl_vgt_vvssmvl | |
| 10455 | .{ .tag = @enumFromInt(2642), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10456 | // __builtin_ve_vl_vgt_vvssvl | |
| 10457 | .{ .tag = @enumFromInt(2643), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10458 | // __builtin_ve_vl_vgtlsx_vvssl | |
| 10459 | .{ .tag = @enumFromInt(2644), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10460 | // __builtin_ve_vl_vgtlsx_vvssml | |
| 10461 | .{ .tag = @enumFromInt(2645), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10462 | // __builtin_ve_vl_vgtlsx_vvssmvl | |
| 10463 | .{ .tag = @enumFromInt(2646), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10464 | // __builtin_ve_vl_vgtlsx_vvssvl | |
| 10465 | .{ .tag = @enumFromInt(2647), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10466 | // __builtin_ve_vl_vgtlsxnc_vvssl | |
| 10467 | .{ .tag = @enumFromInt(2648), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10468 | // __builtin_ve_vl_vgtlsxnc_vvssml | |
| 10469 | .{ .tag = @enumFromInt(2649), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10470 | // __builtin_ve_vl_vgtlsxnc_vvssmvl | |
| 10471 | .{ .tag = @enumFromInt(2650), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10472 | // __builtin_ve_vl_vgtlsxnc_vvssvl | |
| 10473 | .{ .tag = @enumFromInt(2651), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10474 | // __builtin_ve_vl_vgtlzx_vvssl | |
| 10475 | .{ .tag = @enumFromInt(2652), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10476 | // __builtin_ve_vl_vgtlzx_vvssml | |
| 10477 | .{ .tag = @enumFromInt(2653), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10478 | // __builtin_ve_vl_vgtlzx_vvssmvl | |
| 10479 | .{ .tag = @enumFromInt(2654), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10480 | // __builtin_ve_vl_vgtlzx_vvssvl | |
| 10481 | .{ .tag = @enumFromInt(2655), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10482 | // __builtin_ve_vl_vgtlzxnc_vvssl | |
| 10483 | .{ .tag = @enumFromInt(2656), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10484 | // __builtin_ve_vl_vgtlzxnc_vvssml | |
| 10485 | .{ .tag = @enumFromInt(2657), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10486 | // __builtin_ve_vl_vgtlzxnc_vvssmvl | |
| 10487 | .{ .tag = @enumFromInt(2658), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10488 | // __builtin_ve_vl_vgtlzxnc_vvssvl | |
| 10489 | .{ .tag = @enumFromInt(2659), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10490 | // __builtin_ve_vl_vgtnc_vvssl | |
| 10491 | .{ .tag = @enumFromInt(2660), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10492 | // __builtin_ve_vl_vgtnc_vvssml | |
| 10493 | .{ .tag = @enumFromInt(2661), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10494 | // __builtin_ve_vl_vgtnc_vvssmvl | |
| 10495 | .{ .tag = @enumFromInt(2662), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10496 | // __builtin_ve_vl_vgtnc_vvssvl | |
| 10497 | .{ .tag = @enumFromInt(2663), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10498 | // __builtin_ve_vl_vgtu_vvssl | |
| 10499 | .{ .tag = @enumFromInt(2664), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10500 | // __builtin_ve_vl_vgtu_vvssml | |
| 10501 | .{ .tag = @enumFromInt(2665), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10502 | // __builtin_ve_vl_vgtu_vvssmvl | |
| 10503 | .{ .tag = @enumFromInt(2666), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10504 | // __builtin_ve_vl_vgtu_vvssvl | |
| 10505 | .{ .tag = @enumFromInt(2667), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10506 | // __builtin_ve_vl_vgtunc_vvssl | |
| 10507 | .{ .tag = @enumFromInt(2668), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10508 | // __builtin_ve_vl_vgtunc_vvssml | |
| 10509 | .{ .tag = @enumFromInt(2669), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10510 | // __builtin_ve_vl_vgtunc_vvssmvl | |
| 10511 | .{ .tag = @enumFromInt(2670), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10512 | // __builtin_ve_vl_vgtunc_vvssvl | |
| 10513 | .{ .tag = @enumFromInt(2671), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10514 | // __builtin_ve_vl_vld2d_vssl | |
| 10515 | .{ .tag = @enumFromInt(2672), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10516 | // __builtin_ve_vl_vld2d_vssvl | |
| 10517 | .{ .tag = @enumFromInt(2673), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10518 | // __builtin_ve_vl_vld2dnc_vssl | |
| 10519 | .{ .tag = @enumFromInt(2674), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10520 | // __builtin_ve_vl_vld2dnc_vssvl | |
| 10521 | .{ .tag = @enumFromInt(2675), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10522 | // __builtin_ve_vl_vld_vssl | |
| 10523 | .{ .tag = @enumFromInt(2676), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10524 | // __builtin_ve_vl_vld_vssvl | |
| 10525 | .{ .tag = @enumFromInt(2677), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10526 | // __builtin_ve_vl_vldl2dsx_vssl | |
| 10527 | .{ .tag = @enumFromInt(2678), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10528 | // __builtin_ve_vl_vldl2dsx_vssvl | |
| 10529 | .{ .tag = @enumFromInt(2679), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10530 | // __builtin_ve_vl_vldl2dsxnc_vssl | |
| 10531 | .{ .tag = @enumFromInt(2680), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10532 | // __builtin_ve_vl_vldl2dsxnc_vssvl | |
| 10533 | .{ .tag = @enumFromInt(2681), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10534 | // __builtin_ve_vl_vldl2dzx_vssl | |
| 10535 | .{ .tag = @enumFromInt(2682), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10536 | // __builtin_ve_vl_vldl2dzx_vssvl | |
| 10537 | .{ .tag = @enumFromInt(2683), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10538 | // __builtin_ve_vl_vldl2dzxnc_vssl | |
| 10539 | .{ .tag = @enumFromInt(2684), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10540 | // __builtin_ve_vl_vldl2dzxnc_vssvl | |
| 10541 | .{ .tag = @enumFromInt(2685), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10542 | // __builtin_ve_vl_vldlsx_vssl | |
| 10543 | .{ .tag = @enumFromInt(2686), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10544 | // __builtin_ve_vl_vldlsx_vssvl | |
| 10545 | .{ .tag = @enumFromInt(2687), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10546 | // __builtin_ve_vl_vldlsxnc_vssl | |
| 10547 | .{ .tag = @enumFromInt(2688), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10548 | // __builtin_ve_vl_vldlsxnc_vssvl | |
| 10549 | .{ .tag = @enumFromInt(2689), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10550 | // __builtin_ve_vl_vldlzx_vssl | |
| 10551 | .{ .tag = @enumFromInt(2690), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10552 | // __builtin_ve_vl_vldlzx_vssvl | |
| 10553 | .{ .tag = @enumFromInt(2691), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10554 | // __builtin_ve_vl_vldlzxnc_vssl | |
| 10555 | .{ .tag = @enumFromInt(2692), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10556 | // __builtin_ve_vl_vldlzxnc_vssvl | |
| 10557 | .{ .tag = @enumFromInt(2693), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10558 | // __builtin_ve_vl_vldnc_vssl | |
| 10559 | .{ .tag = @enumFromInt(2694), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10560 | // __builtin_ve_vl_vldnc_vssvl | |
| 10561 | .{ .tag = @enumFromInt(2695), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10562 | // __builtin_ve_vl_vldu2d_vssl | |
| 10563 | .{ .tag = @enumFromInt(2696), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10564 | // __builtin_ve_vl_vldu2d_vssvl | |
| 10565 | .{ .tag = @enumFromInt(2697), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10566 | // __builtin_ve_vl_vldu2dnc_vssl | |
| 10567 | .{ .tag = @enumFromInt(2698), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10568 | // __builtin_ve_vl_vldu2dnc_vssvl | |
| 10569 | .{ .tag = @enumFromInt(2699), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10570 | // __builtin_ve_vl_vldu_vssl | |
| 10571 | .{ .tag = @enumFromInt(2700), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10572 | // __builtin_ve_vl_vldu_vssvl | |
| 10573 | .{ .tag = @enumFromInt(2701), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10574 | // __builtin_ve_vl_vldunc_vssl | |
| 10575 | .{ .tag = @enumFromInt(2702), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10576 | // __builtin_ve_vl_vldunc_vssvl | |
| 10577 | .{ .tag = @enumFromInt(2703), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10578 | // __builtin_ve_vl_vldz_vvl | |
| 10579 | .{ .tag = @enumFromInt(2704), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10580 | // __builtin_ve_vl_vldz_vvmvl | |
| 10581 | .{ .tag = @enumFromInt(2705), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10582 | // __builtin_ve_vl_vldz_vvvl | |
| 10583 | .{ .tag = @enumFromInt(2706), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10584 | // __builtin_ve_vl_vmaxsl_vsvl | |
| 10585 | .{ .tag = @enumFromInt(2707), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10586 | // __builtin_ve_vl_vmaxsl_vsvmvl | |
| 10587 | .{ .tag = @enumFromInt(2708), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10588 | // __builtin_ve_vl_vmaxsl_vsvvl | |
| 10589 | .{ .tag = @enumFromInt(2709), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10590 | // __builtin_ve_vl_vmaxsl_vvvl | |
| 10591 | .{ .tag = @enumFromInt(2710), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10592 | // __builtin_ve_vl_vmaxsl_vvvmvl | |
| 10593 | .{ .tag = @enumFromInt(2711), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10594 | // __builtin_ve_vl_vmaxsl_vvvvl | |
| 10595 | .{ .tag = @enumFromInt(2712), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10596 | // __builtin_ve_vl_vmaxswsx_vsvl | |
| 10597 | .{ .tag = @enumFromInt(2713), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10598 | // __builtin_ve_vl_vmaxswsx_vsvmvl | |
| 10599 | .{ .tag = @enumFromInt(2714), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10600 | // __builtin_ve_vl_vmaxswsx_vsvvl | |
| 10601 | .{ .tag = @enumFromInt(2715), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10602 | // __builtin_ve_vl_vmaxswsx_vvvl | |
| 10603 | .{ .tag = @enumFromInt(2716), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10604 | // __builtin_ve_vl_vmaxswsx_vvvmvl | |
| 10605 | .{ .tag = @enumFromInt(2717), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10606 | // __builtin_ve_vl_vmaxswsx_vvvvl | |
| 10607 | .{ .tag = @enumFromInt(2718), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10608 | // __builtin_ve_vl_vmaxswzx_vsvl | |
| 10609 | .{ .tag = @enumFromInt(2719), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10610 | // __builtin_ve_vl_vmaxswzx_vsvmvl | |
| 10611 | .{ .tag = @enumFromInt(2720), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10612 | // __builtin_ve_vl_vmaxswzx_vsvvl | |
| 10613 | .{ .tag = @enumFromInt(2721), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10614 | // __builtin_ve_vl_vmaxswzx_vvvl | |
| 10615 | .{ .tag = @enumFromInt(2722), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10616 | // __builtin_ve_vl_vmaxswzx_vvvmvl | |
| 10617 | .{ .tag = @enumFromInt(2723), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10618 | // __builtin_ve_vl_vmaxswzx_vvvvl | |
| 10619 | .{ .tag = @enumFromInt(2724), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10620 | // __builtin_ve_vl_vminsl_vsvl | |
| 10621 | .{ .tag = @enumFromInt(2725), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10622 | // __builtin_ve_vl_vminsl_vsvmvl | |
| 10623 | .{ .tag = @enumFromInt(2726), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10624 | // __builtin_ve_vl_vminsl_vsvvl | |
| 10625 | .{ .tag = @enumFromInt(2727), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10626 | // __builtin_ve_vl_vminsl_vvvl | |
| 10627 | .{ .tag = @enumFromInt(2728), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10628 | // __builtin_ve_vl_vminsl_vvvmvl | |
| 10629 | .{ .tag = @enumFromInt(2729), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10630 | // __builtin_ve_vl_vminsl_vvvvl | |
| 10631 | .{ .tag = @enumFromInt(2730), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10632 | // __builtin_ve_vl_vminswsx_vsvl | |
| 10633 | .{ .tag = @enumFromInt(2731), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10634 | // __builtin_ve_vl_vminswsx_vsvmvl | |
| 10635 | .{ .tag = @enumFromInt(2732), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10636 | // __builtin_ve_vl_vminswsx_vsvvl | |
| 10637 | .{ .tag = @enumFromInt(2733), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10638 | // __builtin_ve_vl_vminswsx_vvvl | |
| 10639 | .{ .tag = @enumFromInt(2734), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10640 | // __builtin_ve_vl_vminswsx_vvvmvl | |
| 10641 | .{ .tag = @enumFromInt(2735), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10642 | // __builtin_ve_vl_vminswsx_vvvvl | |
| 10643 | .{ .tag = @enumFromInt(2736), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10644 | // __builtin_ve_vl_vminswzx_vsvl | |
| 10645 | .{ .tag = @enumFromInt(2737), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10646 | // __builtin_ve_vl_vminswzx_vsvmvl | |
| 10647 | .{ .tag = @enumFromInt(2738), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10648 | // __builtin_ve_vl_vminswzx_vsvvl | |
| 10649 | .{ .tag = @enumFromInt(2739), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10650 | // __builtin_ve_vl_vminswzx_vvvl | |
| 10651 | .{ .tag = @enumFromInt(2740), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10652 | // __builtin_ve_vl_vminswzx_vvvmvl | |
| 10653 | .{ .tag = @enumFromInt(2741), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10654 | // __builtin_ve_vl_vminswzx_vvvvl | |
| 10655 | .{ .tag = @enumFromInt(2742), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10656 | // __builtin_ve_vl_vmrg_vsvml | |
| 10657 | .{ .tag = @enumFromInt(2743), .properties = .{ .param_str = "V256dLUiV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10658 | // __builtin_ve_vl_vmrg_vsvmvl | |
| 10659 | .{ .tag = @enumFromInt(2744), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10660 | // __builtin_ve_vl_vmrg_vvvml | |
| 10661 | .{ .tag = @enumFromInt(2745), .properties = .{ .param_str = "V256dV256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10662 | // __builtin_ve_vl_vmrg_vvvmvl | |
| 10663 | .{ .tag = @enumFromInt(2746), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10664 | // __builtin_ve_vl_vmrgw_vsvMl | |
| 10665 | .{ .tag = @enumFromInt(2747), .properties = .{ .param_str = "V256dUiV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10666 | // __builtin_ve_vl_vmrgw_vsvMvl | |
| 10667 | .{ .tag = @enumFromInt(2748), .properties = .{ .param_str = "V256dUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10668 | // __builtin_ve_vl_vmrgw_vvvMl | |
| 10669 | .{ .tag = @enumFromInt(2749), .properties = .{ .param_str = "V256dV256dV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10670 | // __builtin_ve_vl_vmrgw_vvvMvl | |
| 10671 | .{ .tag = @enumFromInt(2750), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10672 | // __builtin_ve_vl_vmulsl_vsvl | |
| 10673 | .{ .tag = @enumFromInt(2751), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10674 | // __builtin_ve_vl_vmulsl_vsvmvl | |
| 10675 | .{ .tag = @enumFromInt(2752), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10676 | // __builtin_ve_vl_vmulsl_vsvvl | |
| 10677 | .{ .tag = @enumFromInt(2753), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10678 | // __builtin_ve_vl_vmulsl_vvvl | |
| 10679 | .{ .tag = @enumFromInt(2754), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10680 | // __builtin_ve_vl_vmulsl_vvvmvl | |
| 10681 | .{ .tag = @enumFromInt(2755), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10682 | // __builtin_ve_vl_vmulsl_vvvvl | |
| 10683 | .{ .tag = @enumFromInt(2756), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10684 | // __builtin_ve_vl_vmulslw_vsvl | |
| 10685 | .{ .tag = @enumFromInt(2757), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10686 | // __builtin_ve_vl_vmulslw_vsvvl | |
| 10687 | .{ .tag = @enumFromInt(2758), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10688 | // __builtin_ve_vl_vmulslw_vvvl | |
| 10689 | .{ .tag = @enumFromInt(2759), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10690 | // __builtin_ve_vl_vmulslw_vvvvl | |
| 10691 | .{ .tag = @enumFromInt(2760), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10692 | // __builtin_ve_vl_vmulswsx_vsvl | |
| 10693 | .{ .tag = @enumFromInt(2761), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10694 | // __builtin_ve_vl_vmulswsx_vsvmvl | |
| 10695 | .{ .tag = @enumFromInt(2762), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10696 | // __builtin_ve_vl_vmulswsx_vsvvl | |
| 10697 | .{ .tag = @enumFromInt(2763), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10698 | // __builtin_ve_vl_vmulswsx_vvvl | |
| 10699 | .{ .tag = @enumFromInt(2764), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10700 | // __builtin_ve_vl_vmulswsx_vvvmvl | |
| 10701 | .{ .tag = @enumFromInt(2765), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10702 | // __builtin_ve_vl_vmulswsx_vvvvl | |
| 10703 | .{ .tag = @enumFromInt(2766), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10704 | // __builtin_ve_vl_vmulswzx_vsvl | |
| 10705 | .{ .tag = @enumFromInt(2767), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10706 | // __builtin_ve_vl_vmulswzx_vsvmvl | |
| 10707 | .{ .tag = @enumFromInt(2768), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10708 | // __builtin_ve_vl_vmulswzx_vsvvl | |
| 10709 | .{ .tag = @enumFromInt(2769), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10710 | // __builtin_ve_vl_vmulswzx_vvvl | |
| 10711 | .{ .tag = @enumFromInt(2770), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10712 | // __builtin_ve_vl_vmulswzx_vvvmvl | |
| 10713 | .{ .tag = @enumFromInt(2771), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10714 | // __builtin_ve_vl_vmulswzx_vvvvl | |
| 10715 | .{ .tag = @enumFromInt(2772), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10716 | // __builtin_ve_vl_vmulul_vsvl | |
| 10717 | .{ .tag = @enumFromInt(2773), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10718 | // __builtin_ve_vl_vmulul_vsvmvl | |
| 10719 | .{ .tag = @enumFromInt(2774), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10720 | // __builtin_ve_vl_vmulul_vsvvl | |
| 10721 | .{ .tag = @enumFromInt(2775), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10722 | // __builtin_ve_vl_vmulul_vvvl | |
| 10723 | .{ .tag = @enumFromInt(2776), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10724 | // __builtin_ve_vl_vmulul_vvvmvl | |
| 10725 | .{ .tag = @enumFromInt(2777), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10726 | // __builtin_ve_vl_vmulul_vvvvl | |
| 10727 | .{ .tag = @enumFromInt(2778), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10728 | // __builtin_ve_vl_vmuluw_vsvl | |
| 10729 | .{ .tag = @enumFromInt(2779), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10730 | // __builtin_ve_vl_vmuluw_vsvmvl | |
| 10731 | .{ .tag = @enumFromInt(2780), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10732 | // __builtin_ve_vl_vmuluw_vsvvl | |
| 10733 | .{ .tag = @enumFromInt(2781), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10734 | // __builtin_ve_vl_vmuluw_vvvl | |
| 10735 | .{ .tag = @enumFromInt(2782), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10736 | // __builtin_ve_vl_vmuluw_vvvmvl | |
| 10737 | .{ .tag = @enumFromInt(2783), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10738 | // __builtin_ve_vl_vmuluw_vvvvl | |
| 10739 | .{ .tag = @enumFromInt(2784), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10740 | // __builtin_ve_vl_vmv_vsvl | |
| 10741 | .{ .tag = @enumFromInt(2785), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10742 | // __builtin_ve_vl_vmv_vsvmvl | |
| 10743 | .{ .tag = @enumFromInt(2786), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10744 | // __builtin_ve_vl_vmv_vsvvl | |
| 10745 | .{ .tag = @enumFromInt(2787), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10746 | // __builtin_ve_vl_vor_vsvl | |
| 10747 | .{ .tag = @enumFromInt(2788), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10748 | // __builtin_ve_vl_vor_vsvmvl | |
| 10749 | .{ .tag = @enumFromInt(2789), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10750 | // __builtin_ve_vl_vor_vsvvl | |
| 10751 | .{ .tag = @enumFromInt(2790), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10752 | // __builtin_ve_vl_vor_vvvl | |
| 10753 | .{ .tag = @enumFromInt(2791), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10754 | // __builtin_ve_vl_vor_vvvmvl | |
| 10755 | .{ .tag = @enumFromInt(2792), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10756 | // __builtin_ve_vl_vor_vvvvl | |
| 10757 | .{ .tag = @enumFromInt(2793), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10758 | // __builtin_ve_vl_vpcnt_vvl | |
| 10759 | .{ .tag = @enumFromInt(2794), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10760 | // __builtin_ve_vl_vpcnt_vvmvl | |
| 10761 | .{ .tag = @enumFromInt(2795), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10762 | // __builtin_ve_vl_vpcnt_vvvl | |
| 10763 | .{ .tag = @enumFromInt(2796), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10764 | // __builtin_ve_vl_vrand_vvl | |
| 10765 | .{ .tag = @enumFromInt(2797), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10766 | // __builtin_ve_vl_vrand_vvml | |
| 10767 | .{ .tag = @enumFromInt(2798), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10768 | // __builtin_ve_vl_vrcpd_vvl | |
| 10769 | .{ .tag = @enumFromInt(2799), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10770 | // __builtin_ve_vl_vrcpd_vvvl | |
| 10771 | .{ .tag = @enumFromInt(2800), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10772 | // __builtin_ve_vl_vrcps_vvl | |
| 10773 | .{ .tag = @enumFromInt(2801), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10774 | // __builtin_ve_vl_vrcps_vvvl | |
| 10775 | .{ .tag = @enumFromInt(2802), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10776 | // __builtin_ve_vl_vrmaxslfst_vvl | |
| 10777 | .{ .tag = @enumFromInt(2803), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10778 | // __builtin_ve_vl_vrmaxslfst_vvvl | |
| 10779 | .{ .tag = @enumFromInt(2804), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10780 | // __builtin_ve_vl_vrmaxsllst_vvl | |
| 10781 | .{ .tag = @enumFromInt(2805), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10782 | // __builtin_ve_vl_vrmaxsllst_vvvl | |
| 10783 | .{ .tag = @enumFromInt(2806), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10784 | // __builtin_ve_vl_vrmaxswfstsx_vvl | |
| 10785 | .{ .tag = @enumFromInt(2807), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10786 | // __builtin_ve_vl_vrmaxswfstsx_vvvl | |
| 10787 | .{ .tag = @enumFromInt(2808), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10788 | // __builtin_ve_vl_vrmaxswfstzx_vvl | |
| 10789 | .{ .tag = @enumFromInt(2809), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10790 | // __builtin_ve_vl_vrmaxswfstzx_vvvl | |
| 10791 | .{ .tag = @enumFromInt(2810), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10792 | // __builtin_ve_vl_vrmaxswlstsx_vvl | |
| 10793 | .{ .tag = @enumFromInt(2811), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10794 | // __builtin_ve_vl_vrmaxswlstsx_vvvl | |
| 10795 | .{ .tag = @enumFromInt(2812), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10796 | // __builtin_ve_vl_vrmaxswlstzx_vvl | |
| 10797 | .{ .tag = @enumFromInt(2813), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10798 | // __builtin_ve_vl_vrmaxswlstzx_vvvl | |
| 10799 | .{ .tag = @enumFromInt(2814), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10800 | // __builtin_ve_vl_vrminslfst_vvl | |
| 10801 | .{ .tag = @enumFromInt(2815), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10802 | // __builtin_ve_vl_vrminslfst_vvvl | |
| 10803 | .{ .tag = @enumFromInt(2816), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10804 | // __builtin_ve_vl_vrminsllst_vvl | |
| 10805 | .{ .tag = @enumFromInt(2817), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10806 | // __builtin_ve_vl_vrminsllst_vvvl | |
| 10807 | .{ .tag = @enumFromInt(2818), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10808 | // __builtin_ve_vl_vrminswfstsx_vvl | |
| 10809 | .{ .tag = @enumFromInt(2819), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10810 | // __builtin_ve_vl_vrminswfstsx_vvvl | |
| 10811 | .{ .tag = @enumFromInt(2820), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10812 | // __builtin_ve_vl_vrminswfstzx_vvl | |
| 10813 | .{ .tag = @enumFromInt(2821), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10814 | // __builtin_ve_vl_vrminswfstzx_vvvl | |
| 10815 | .{ .tag = @enumFromInt(2822), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10816 | // __builtin_ve_vl_vrminswlstsx_vvl | |
| 10817 | .{ .tag = @enumFromInt(2823), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10818 | // __builtin_ve_vl_vrminswlstsx_vvvl | |
| 10819 | .{ .tag = @enumFromInt(2824), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10820 | // __builtin_ve_vl_vrminswlstzx_vvl | |
| 10821 | .{ .tag = @enumFromInt(2825), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10822 | // __builtin_ve_vl_vrminswlstzx_vvvl | |
| 10823 | .{ .tag = @enumFromInt(2826), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10824 | // __builtin_ve_vl_vror_vvl | |
| 10825 | .{ .tag = @enumFromInt(2827), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10826 | // __builtin_ve_vl_vror_vvml | |
| 10827 | .{ .tag = @enumFromInt(2828), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10828 | // __builtin_ve_vl_vrsqrtd_vvl | |
| 10829 | .{ .tag = @enumFromInt(2829), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10830 | // __builtin_ve_vl_vrsqrtd_vvvl | |
| 10831 | .{ .tag = @enumFromInt(2830), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10832 | // __builtin_ve_vl_vrsqrtdnex_vvl | |
| 10833 | .{ .tag = @enumFromInt(2831), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10834 | // __builtin_ve_vl_vrsqrtdnex_vvvl | |
| 10835 | .{ .tag = @enumFromInt(2832), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10836 | // __builtin_ve_vl_vrsqrts_vvl | |
| 10837 | .{ .tag = @enumFromInt(2833), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10838 | // __builtin_ve_vl_vrsqrts_vvvl | |
| 10839 | .{ .tag = @enumFromInt(2834), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10840 | // __builtin_ve_vl_vrsqrtsnex_vvl | |
| 10841 | .{ .tag = @enumFromInt(2835), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10842 | // __builtin_ve_vl_vrsqrtsnex_vvvl | |
| 10843 | .{ .tag = @enumFromInt(2836), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10844 | // __builtin_ve_vl_vrxor_vvl | |
| 10845 | .{ .tag = @enumFromInt(2837), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10846 | // __builtin_ve_vl_vrxor_vvml | |
| 10847 | .{ .tag = @enumFromInt(2838), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10848 | // __builtin_ve_vl_vsc_vvssl | |
| 10849 | .{ .tag = @enumFromInt(2839), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10850 | // __builtin_ve_vl_vsc_vvssml | |
| 10851 | .{ .tag = @enumFromInt(2840), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10852 | // __builtin_ve_vl_vscl_vvssl | |
| 10853 | .{ .tag = @enumFromInt(2841), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10854 | // __builtin_ve_vl_vscl_vvssml | |
| 10855 | .{ .tag = @enumFromInt(2842), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10856 | // __builtin_ve_vl_vsclnc_vvssl | |
| 10857 | .{ .tag = @enumFromInt(2843), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10858 | // __builtin_ve_vl_vsclnc_vvssml | |
| 10859 | .{ .tag = @enumFromInt(2844), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10860 | // __builtin_ve_vl_vsclncot_vvssl | |
| 10861 | .{ .tag = @enumFromInt(2845), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10862 | // __builtin_ve_vl_vsclncot_vvssml | |
| 10863 | .{ .tag = @enumFromInt(2846), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10864 | // __builtin_ve_vl_vsclot_vvssl | |
| 10865 | .{ .tag = @enumFromInt(2847), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10866 | // __builtin_ve_vl_vsclot_vvssml | |
| 10867 | .{ .tag = @enumFromInt(2848), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10868 | // __builtin_ve_vl_vscnc_vvssl | |
| 10869 | .{ .tag = @enumFromInt(2849), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10870 | // __builtin_ve_vl_vscnc_vvssml | |
| 10871 | .{ .tag = @enumFromInt(2850), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10872 | // __builtin_ve_vl_vscncot_vvssl | |
| 10873 | .{ .tag = @enumFromInt(2851), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10874 | // __builtin_ve_vl_vscncot_vvssml | |
| 10875 | .{ .tag = @enumFromInt(2852), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10876 | // __builtin_ve_vl_vscot_vvssl | |
| 10877 | .{ .tag = @enumFromInt(2853), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10878 | // __builtin_ve_vl_vscot_vvssml | |
| 10879 | .{ .tag = @enumFromInt(2854), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10880 | // __builtin_ve_vl_vscu_vvssl | |
| 10881 | .{ .tag = @enumFromInt(2855), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10882 | // __builtin_ve_vl_vscu_vvssml | |
| 10883 | .{ .tag = @enumFromInt(2856), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10884 | // __builtin_ve_vl_vscunc_vvssl | |
| 10885 | .{ .tag = @enumFromInt(2857), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10886 | // __builtin_ve_vl_vscunc_vvssml | |
| 10887 | .{ .tag = @enumFromInt(2858), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10888 | // __builtin_ve_vl_vscuncot_vvssl | |
| 10889 | .{ .tag = @enumFromInt(2859), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10890 | // __builtin_ve_vl_vscuncot_vvssml | |
| 10891 | .{ .tag = @enumFromInt(2860), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10892 | // __builtin_ve_vl_vscuot_vvssl | |
| 10893 | .{ .tag = @enumFromInt(2861), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10894 | // __builtin_ve_vl_vscuot_vvssml | |
| 10895 | .{ .tag = @enumFromInt(2862), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10896 | // __builtin_ve_vl_vseq_vl | |
| 10897 | .{ .tag = @enumFromInt(2863), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10898 | // __builtin_ve_vl_vseq_vvl | |
| 10899 | .{ .tag = @enumFromInt(2864), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10900 | // __builtin_ve_vl_vsfa_vvssl | |
| 10901 | .{ .tag = @enumFromInt(2865), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10902 | // __builtin_ve_vl_vsfa_vvssmvl | |
| 10903 | .{ .tag = @enumFromInt(2866), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10904 | // __builtin_ve_vl_vsfa_vvssvl | |
| 10905 | .{ .tag = @enumFromInt(2867), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10906 | // __builtin_ve_vl_vshf_vvvsl | |
| 10907 | .{ .tag = @enumFromInt(2868), .properties = .{ .param_str = "V256dV256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10908 | // __builtin_ve_vl_vshf_vvvsvl | |
| 10909 | .{ .tag = @enumFromInt(2869), .properties = .{ .param_str = "V256dV256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10910 | // __builtin_ve_vl_vslal_vvsl | |
| 10911 | .{ .tag = @enumFromInt(2870), .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10912 | // __builtin_ve_vl_vslal_vvsmvl | |
| 10913 | .{ .tag = @enumFromInt(2871), .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10914 | // __builtin_ve_vl_vslal_vvsvl | |
| 10915 | .{ .tag = @enumFromInt(2872), .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10916 | // __builtin_ve_vl_vslal_vvvl | |
| 10917 | .{ .tag = @enumFromInt(2873), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10918 | // __builtin_ve_vl_vslal_vvvmvl | |
| 10919 | .{ .tag = @enumFromInt(2874), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10920 | // __builtin_ve_vl_vslal_vvvvl | |
| 10921 | .{ .tag = @enumFromInt(2875), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10922 | // __builtin_ve_vl_vslawsx_vvsl | |
| 10923 | .{ .tag = @enumFromInt(2876), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10924 | // __builtin_ve_vl_vslawsx_vvsmvl | |
| 10925 | .{ .tag = @enumFromInt(2877), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10926 | // __builtin_ve_vl_vslawsx_vvsvl | |
| 10927 | .{ .tag = @enumFromInt(2878), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10928 | // __builtin_ve_vl_vslawsx_vvvl | |
| 10929 | .{ .tag = @enumFromInt(2879), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10930 | // __builtin_ve_vl_vslawsx_vvvmvl | |
| 10931 | .{ .tag = @enumFromInt(2880), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10932 | // __builtin_ve_vl_vslawsx_vvvvl | |
| 10933 | .{ .tag = @enumFromInt(2881), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10934 | // __builtin_ve_vl_vslawzx_vvsl | |
| 10935 | .{ .tag = @enumFromInt(2882), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10936 | // __builtin_ve_vl_vslawzx_vvsmvl | |
| 10937 | .{ .tag = @enumFromInt(2883), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10938 | // __builtin_ve_vl_vslawzx_vvsvl | |
| 10939 | .{ .tag = @enumFromInt(2884), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10940 | // __builtin_ve_vl_vslawzx_vvvl | |
| 10941 | .{ .tag = @enumFromInt(2885), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10942 | // __builtin_ve_vl_vslawzx_vvvmvl | |
| 10943 | .{ .tag = @enumFromInt(2886), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10944 | // __builtin_ve_vl_vslawzx_vvvvl | |
| 10945 | .{ .tag = @enumFromInt(2887), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10946 | // __builtin_ve_vl_vsll_vvsl | |
| 10947 | .{ .tag = @enumFromInt(2888), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10948 | // __builtin_ve_vl_vsll_vvsmvl | |
| 10949 | .{ .tag = @enumFromInt(2889), .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10950 | // __builtin_ve_vl_vsll_vvsvl | |
| 10951 | .{ .tag = @enumFromInt(2890), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10952 | // __builtin_ve_vl_vsll_vvvl | |
| 10953 | .{ .tag = @enumFromInt(2891), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10954 | // __builtin_ve_vl_vsll_vvvmvl | |
| 10955 | .{ .tag = @enumFromInt(2892), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10956 | // __builtin_ve_vl_vsll_vvvvl | |
| 10957 | .{ .tag = @enumFromInt(2893), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10958 | // __builtin_ve_vl_vsral_vvsl | |
| 10959 | .{ .tag = @enumFromInt(2894), .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10960 | // __builtin_ve_vl_vsral_vvsmvl | |
| 10961 | .{ .tag = @enumFromInt(2895), .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10962 | // __builtin_ve_vl_vsral_vvsvl | |
| 10963 | .{ .tag = @enumFromInt(2896), .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10964 | // __builtin_ve_vl_vsral_vvvl | |
| 10965 | .{ .tag = @enumFromInt(2897), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10966 | // __builtin_ve_vl_vsral_vvvmvl | |
| 10967 | .{ .tag = @enumFromInt(2898), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10968 | // __builtin_ve_vl_vsral_vvvvl | |
| 10969 | .{ .tag = @enumFromInt(2899), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10970 | // __builtin_ve_vl_vsrawsx_vvsl | |
| 10971 | .{ .tag = @enumFromInt(2900), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10972 | // __builtin_ve_vl_vsrawsx_vvsmvl | |
| 10973 | .{ .tag = @enumFromInt(2901), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10974 | // __builtin_ve_vl_vsrawsx_vvsvl | |
| 10975 | .{ .tag = @enumFromInt(2902), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10976 | // __builtin_ve_vl_vsrawsx_vvvl | |
| 10977 | .{ .tag = @enumFromInt(2903), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10978 | // __builtin_ve_vl_vsrawsx_vvvmvl | |
| 10979 | .{ .tag = @enumFromInt(2904), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10980 | // __builtin_ve_vl_vsrawsx_vvvvl | |
| 10981 | .{ .tag = @enumFromInt(2905), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10982 | // __builtin_ve_vl_vsrawzx_vvsl | |
| 10983 | .{ .tag = @enumFromInt(2906), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10984 | // __builtin_ve_vl_vsrawzx_vvsmvl | |
| 10985 | .{ .tag = @enumFromInt(2907), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10986 | // __builtin_ve_vl_vsrawzx_vvsvl | |
| 10987 | .{ .tag = @enumFromInt(2908), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10988 | // __builtin_ve_vl_vsrawzx_vvvl | |
| 10989 | .{ .tag = @enumFromInt(2909), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10990 | // __builtin_ve_vl_vsrawzx_vvvmvl | |
| 10991 | .{ .tag = @enumFromInt(2910), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10992 | // __builtin_ve_vl_vsrawzx_vvvvl | |
| 10993 | .{ .tag = @enumFromInt(2911), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10994 | // __builtin_ve_vl_vsrl_vvsl | |
| 10995 | .{ .tag = @enumFromInt(2912), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10996 | // __builtin_ve_vl_vsrl_vvsmvl | |
| 10997 | .{ .tag = @enumFromInt(2913), .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10998 | // __builtin_ve_vl_vsrl_vvsvl | |
| 10999 | .{ .tag = @enumFromInt(2914), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11000 | // __builtin_ve_vl_vsrl_vvvl | |
| 11001 | .{ .tag = @enumFromInt(2915), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11002 | // __builtin_ve_vl_vsrl_vvvmvl | |
| 11003 | .{ .tag = @enumFromInt(2916), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11004 | // __builtin_ve_vl_vsrl_vvvvl | |
| 11005 | .{ .tag = @enumFromInt(2917), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11006 | // __builtin_ve_vl_vst2d_vssl | |
| 11007 | .{ .tag = @enumFromInt(2918), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11008 | // __builtin_ve_vl_vst2d_vssml | |
| 11009 | .{ .tag = @enumFromInt(2919), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11010 | // __builtin_ve_vl_vst2dnc_vssl | |
| 11011 | .{ .tag = @enumFromInt(2920), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11012 | // __builtin_ve_vl_vst2dnc_vssml | |
| 11013 | .{ .tag = @enumFromInt(2921), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11014 | // __builtin_ve_vl_vst2dncot_vssl | |
| 11015 | .{ .tag = @enumFromInt(2922), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11016 | // __builtin_ve_vl_vst2dncot_vssml | |
| 11017 | .{ .tag = @enumFromInt(2923), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11018 | // __builtin_ve_vl_vst2dot_vssl | |
| 11019 | .{ .tag = @enumFromInt(2924), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11020 | // __builtin_ve_vl_vst2dot_vssml | |
| 11021 | .{ .tag = @enumFromInt(2925), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11022 | // __builtin_ve_vl_vst_vssl | |
| 11023 | .{ .tag = @enumFromInt(2926), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11024 | // __builtin_ve_vl_vst_vssml | |
| 11025 | .{ .tag = @enumFromInt(2927), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11026 | // __builtin_ve_vl_vstl2d_vssl | |
| 11027 | .{ .tag = @enumFromInt(2928), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11028 | // __builtin_ve_vl_vstl2d_vssml | |
| 11029 | .{ .tag = @enumFromInt(2929), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11030 | // __builtin_ve_vl_vstl2dnc_vssl | |
| 11031 | .{ .tag = @enumFromInt(2930), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11032 | // __builtin_ve_vl_vstl2dnc_vssml | |
| 11033 | .{ .tag = @enumFromInt(2931), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11034 | // __builtin_ve_vl_vstl2dncot_vssl | |
| 11035 | .{ .tag = @enumFromInt(2932), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11036 | // __builtin_ve_vl_vstl2dncot_vssml | |
| 11037 | .{ .tag = @enumFromInt(2933), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11038 | // __builtin_ve_vl_vstl2dot_vssl | |
| 11039 | .{ .tag = @enumFromInt(2934), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11040 | // __builtin_ve_vl_vstl2dot_vssml | |
| 11041 | .{ .tag = @enumFromInt(2935), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11042 | // __builtin_ve_vl_vstl_vssl | |
| 11043 | .{ .tag = @enumFromInt(2936), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11044 | // __builtin_ve_vl_vstl_vssml | |
| 11045 | .{ .tag = @enumFromInt(2937), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11046 | // __builtin_ve_vl_vstlnc_vssl | |
| 11047 | .{ .tag = @enumFromInt(2938), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11048 | // __builtin_ve_vl_vstlnc_vssml | |
| 11049 | .{ .tag = @enumFromInt(2939), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11050 | // __builtin_ve_vl_vstlncot_vssl | |
| 11051 | .{ .tag = @enumFromInt(2940), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11052 | // __builtin_ve_vl_vstlncot_vssml | |
| 11053 | .{ .tag = @enumFromInt(2941), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11054 | // __builtin_ve_vl_vstlot_vssl | |
| 11055 | .{ .tag = @enumFromInt(2942), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11056 | // __builtin_ve_vl_vstlot_vssml | |
| 11057 | .{ .tag = @enumFromInt(2943), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11058 | // __builtin_ve_vl_vstnc_vssl | |
| 11059 | .{ .tag = @enumFromInt(2944), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11060 | // __builtin_ve_vl_vstnc_vssml | |
| 11061 | .{ .tag = @enumFromInt(2945), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11062 | // __builtin_ve_vl_vstncot_vssl | |
| 11063 | .{ .tag = @enumFromInt(2946), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11064 | // __builtin_ve_vl_vstncot_vssml | |
| 11065 | .{ .tag = @enumFromInt(2947), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11066 | // __builtin_ve_vl_vstot_vssl | |
| 11067 | .{ .tag = @enumFromInt(2948), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11068 | // __builtin_ve_vl_vstot_vssml | |
| 11069 | .{ .tag = @enumFromInt(2949), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11070 | // __builtin_ve_vl_vstu2d_vssl | |
| 11071 | .{ .tag = @enumFromInt(2950), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11072 | // __builtin_ve_vl_vstu2d_vssml | |
| 11073 | .{ .tag = @enumFromInt(2951), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11074 | // __builtin_ve_vl_vstu2dnc_vssl | |
| 11075 | .{ .tag = @enumFromInt(2952), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11076 | // __builtin_ve_vl_vstu2dnc_vssml | |
| 11077 | .{ .tag = @enumFromInt(2953), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11078 | // __builtin_ve_vl_vstu2dncot_vssl | |
| 11079 | .{ .tag = @enumFromInt(2954), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11080 | // __builtin_ve_vl_vstu2dncot_vssml | |
| 11081 | .{ .tag = @enumFromInt(2955), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11082 | // __builtin_ve_vl_vstu2dot_vssl | |
| 11083 | .{ .tag = @enumFromInt(2956), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11084 | // __builtin_ve_vl_vstu2dot_vssml | |
| 11085 | .{ .tag = @enumFromInt(2957), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11086 | // __builtin_ve_vl_vstu_vssl | |
| 11087 | .{ .tag = @enumFromInt(2958), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11088 | // __builtin_ve_vl_vstu_vssml | |
| 11089 | .{ .tag = @enumFromInt(2959), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11090 | // __builtin_ve_vl_vstunc_vssl | |
| 11091 | .{ .tag = @enumFromInt(2960), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11092 | // __builtin_ve_vl_vstunc_vssml | |
| 11093 | .{ .tag = @enumFromInt(2961), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11094 | // __builtin_ve_vl_vstuncot_vssl | |
| 11095 | .{ .tag = @enumFromInt(2962), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11096 | // __builtin_ve_vl_vstuncot_vssml | |
| 11097 | .{ .tag = @enumFromInt(2963), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11098 | // __builtin_ve_vl_vstuot_vssl | |
| 11099 | .{ .tag = @enumFromInt(2964), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11100 | // __builtin_ve_vl_vstuot_vssml | |
| 11101 | .{ .tag = @enumFromInt(2965), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11102 | // __builtin_ve_vl_vsubsl_vsvl | |
| 11103 | .{ .tag = @enumFromInt(2966), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11104 | // __builtin_ve_vl_vsubsl_vsvmvl | |
| 11105 | .{ .tag = @enumFromInt(2967), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11106 | // __builtin_ve_vl_vsubsl_vsvvl | |
| 11107 | .{ .tag = @enumFromInt(2968), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11108 | // __builtin_ve_vl_vsubsl_vvvl | |
| 11109 | .{ .tag = @enumFromInt(2969), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11110 | // __builtin_ve_vl_vsubsl_vvvmvl | |
| 11111 | .{ .tag = @enumFromInt(2970), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11112 | // __builtin_ve_vl_vsubsl_vvvvl | |
| 11113 | .{ .tag = @enumFromInt(2971), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11114 | // __builtin_ve_vl_vsubswsx_vsvl | |
| 11115 | .{ .tag = @enumFromInt(2972), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11116 | // __builtin_ve_vl_vsubswsx_vsvmvl | |
| 11117 | .{ .tag = @enumFromInt(2973), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11118 | // __builtin_ve_vl_vsubswsx_vsvvl | |
| 11119 | .{ .tag = @enumFromInt(2974), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11120 | // __builtin_ve_vl_vsubswsx_vvvl | |
| 11121 | .{ .tag = @enumFromInt(2975), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11122 | // __builtin_ve_vl_vsubswsx_vvvmvl | |
| 11123 | .{ .tag = @enumFromInt(2976), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11124 | // __builtin_ve_vl_vsubswsx_vvvvl | |
| 11125 | .{ .tag = @enumFromInt(2977), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11126 | // __builtin_ve_vl_vsubswzx_vsvl | |
| 11127 | .{ .tag = @enumFromInt(2978), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11128 | // __builtin_ve_vl_vsubswzx_vsvmvl | |
| 11129 | .{ .tag = @enumFromInt(2979), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11130 | // __builtin_ve_vl_vsubswzx_vsvvl | |
| 11131 | .{ .tag = @enumFromInt(2980), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11132 | // __builtin_ve_vl_vsubswzx_vvvl | |
| 11133 | .{ .tag = @enumFromInt(2981), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11134 | // __builtin_ve_vl_vsubswzx_vvvmvl | |
| 11135 | .{ .tag = @enumFromInt(2982), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11136 | // __builtin_ve_vl_vsubswzx_vvvvl | |
| 11137 | .{ .tag = @enumFromInt(2983), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11138 | // __builtin_ve_vl_vsubul_vsvl | |
| 11139 | .{ .tag = @enumFromInt(2984), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11140 | // __builtin_ve_vl_vsubul_vsvmvl | |
| 11141 | .{ .tag = @enumFromInt(2985), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11142 | // __builtin_ve_vl_vsubul_vsvvl | |
| 11143 | .{ .tag = @enumFromInt(2986), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11144 | // __builtin_ve_vl_vsubul_vvvl | |
| 11145 | .{ .tag = @enumFromInt(2987), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11146 | // __builtin_ve_vl_vsubul_vvvmvl | |
| 11147 | .{ .tag = @enumFromInt(2988), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11148 | // __builtin_ve_vl_vsubul_vvvvl | |
| 11149 | .{ .tag = @enumFromInt(2989), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11150 | // __builtin_ve_vl_vsubuw_vsvl | |
| 11151 | .{ .tag = @enumFromInt(2990), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11152 | // __builtin_ve_vl_vsubuw_vsvmvl | |
| 11153 | .{ .tag = @enumFromInt(2991), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11154 | // __builtin_ve_vl_vsubuw_vsvvl | |
| 11155 | .{ .tag = @enumFromInt(2992), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11156 | // __builtin_ve_vl_vsubuw_vvvl | |
| 11157 | .{ .tag = @enumFromInt(2993), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11158 | // __builtin_ve_vl_vsubuw_vvvmvl | |
| 11159 | .{ .tag = @enumFromInt(2994), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11160 | // __builtin_ve_vl_vsubuw_vvvvl | |
| 11161 | .{ .tag = @enumFromInt(2995), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11162 | // __builtin_ve_vl_vsuml_vvl | |
| 11163 | .{ .tag = @enumFromInt(2996), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11164 | // __builtin_ve_vl_vsuml_vvml | |
| 11165 | .{ .tag = @enumFromInt(2997), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11166 | // __builtin_ve_vl_vsumwsx_vvl | |
| 11167 | .{ .tag = @enumFromInt(2998), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11168 | // __builtin_ve_vl_vsumwsx_vvml | |
| 11169 | .{ .tag = @enumFromInt(2999), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11170 | // __builtin_ve_vl_vsumwzx_vvl | |
| 11171 | .{ .tag = @enumFromInt(3000), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11172 | // __builtin_ve_vl_vsumwzx_vvml | |
| 11173 | .{ .tag = @enumFromInt(3001), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11174 | // __builtin_ve_vl_vxor_vsvl | |
| 11175 | .{ .tag = @enumFromInt(3002), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11176 | // __builtin_ve_vl_vxor_vsvmvl | |
| 11177 | .{ .tag = @enumFromInt(3003), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11178 | // __builtin_ve_vl_vxor_vsvvl | |
| 11179 | .{ .tag = @enumFromInt(3004), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11180 | // __builtin_ve_vl_vxor_vvvl | |
| 11181 | .{ .tag = @enumFromInt(3005), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11182 | // __builtin_ve_vl_vxor_vvvmvl | |
| 11183 | .{ .tag = @enumFromInt(3006), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11184 | // __builtin_ve_vl_vxor_vvvvl | |
| 11185 | .{ .tag = @enumFromInt(3007), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11186 | // __builtin_ve_vl_xorm_MMM | |
| 11187 | .{ .tag = @enumFromInt(3008), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11188 | // __builtin_ve_vl_xorm_mmm | |
| 11189 | .{ .tag = @enumFromInt(3009), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11190 | // __builtin_vfprintf | |
| 11191 | .{ .tag = @enumFromInt(3010), .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 11192 | // __builtin_vfscanf | |
| 11193 | .{ .tag = @enumFromInt(3011), .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 11194 | // __builtin_vprintf | |
| 11195 | .{ .tag = @enumFromInt(3012), .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf } } }, | |
| 11196 | // __builtin_vscanf | |
| 11197 | .{ .tag = @enumFromInt(3013), .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf } } }, | |
| 11198 | // __builtin_vsnprintf | |
| 11199 | .{ .tag = @enumFromInt(3014), .properties = .{ .param_str = "ic*RzcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, | |
| 11200 | // __builtin_vsprintf | |
| 11201 | .{ .tag = @enumFromInt(3015), .properties = .{ .param_str = "ic*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 11202 | // __builtin_vsscanf | |
| 11203 | .{ .tag = @enumFromInt(3016), .properties = .{ .param_str = "icC*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 11204 | // __builtin_wasm_max_f32 | |
| 11205 | .{ .tag = @enumFromInt(3017), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11206 | // __builtin_wasm_max_f64 | |
| 11207 | .{ .tag = @enumFromInt(3018), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11208 | // __builtin_wasm_memory_grow | |
| 11209 | .{ .tag = @enumFromInt(3019), .properties = .{ .param_str = "zIiz", .target_set = TargetSet.initOne(.webassembly) } }, | |
| 11210 | // __builtin_wasm_memory_size | |
| 11211 | .{ .tag = @enumFromInt(3020), .properties = .{ .param_str = "zIi", .target_set = TargetSet.initOne(.webassembly) } }, | |
| 11212 | // __builtin_wasm_min_f32 | |
| 11213 | .{ .tag = @enumFromInt(3021), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11214 | // __builtin_wasm_min_f64 | |
| 11215 | .{ .tag = @enumFromInt(3022), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11216 | // __builtin_wasm_trunc_s_i32_f32 | |
| 11217 | .{ .tag = @enumFromInt(3023), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11218 | // __builtin_wasm_trunc_s_i32_f64 | |
| 11219 | .{ .tag = @enumFromInt(3024), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11220 | // __builtin_wasm_trunc_s_i64_f32 | |
| 11221 | .{ .tag = @enumFromInt(3025), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11222 | // __builtin_wasm_trunc_s_i64_f64 | |
| 11223 | .{ .tag = @enumFromInt(3026), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11224 | // __builtin_wasm_trunc_u_i32_f32 | |
| 11225 | .{ .tag = @enumFromInt(3027), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11226 | // __builtin_wasm_trunc_u_i32_f64 | |
| 11227 | .{ .tag = @enumFromInt(3028), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11228 | // __builtin_wasm_trunc_u_i64_f32 | |
| 11229 | .{ .tag = @enumFromInt(3029), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11230 | // __builtin_wasm_trunc_u_i64_f64 | |
| 11231 | .{ .tag = @enumFromInt(3030), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 11232 | // __builtin_wcschr | |
| 11233 | .{ .tag = @enumFromInt(3031), .properties = .{ .param_str = "w*wC*w", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11234 | // __builtin_wcscmp | |
| 11235 | .{ .tag = @enumFromInt(3032), .properties = .{ .param_str = "iwC*wC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11236 | // __builtin_wcslen | |
| 11237 | .{ .tag = @enumFromInt(3033), .properties = .{ .param_str = "zwC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11238 | // __builtin_wcsncmp | |
| 11239 | .{ .tag = @enumFromInt(3034), .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11240 | // __builtin_wmemchr | |
| 11241 | .{ .tag = @enumFromInt(3035), .properties = .{ .param_str = "w*wC*wz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11242 | // __builtin_wmemcmp | |
| 11243 | .{ .tag = @enumFromInt(3036), .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11244 | // __builtin_wmemcpy | |
| 11245 | .{ .tag = @enumFromInt(3037), .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11246 | // __builtin_wmemmove | |
| 11247 | .{ .tag = @enumFromInt(3038), .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 11248 | // __c11_atomic_compare_exchange_strong | |
| 11249 | .{ .tag = @enumFromInt(3039), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11250 | // __c11_atomic_compare_exchange_weak | |
| 11251 | .{ .tag = @enumFromInt(3040), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11252 | // __c11_atomic_exchange | |
| 11253 | .{ .tag = @enumFromInt(3041), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11254 | // __c11_atomic_fetch_add | |
| 11255 | .{ .tag = @enumFromInt(3042), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11256 | // __c11_atomic_fetch_and | |
| 11257 | .{ .tag = @enumFromInt(3043), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11258 | // __c11_atomic_fetch_max | |
| 11259 | .{ .tag = @enumFromInt(3044), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11260 | // __c11_atomic_fetch_min | |
| 11261 | .{ .tag = @enumFromInt(3045), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11262 | // __c11_atomic_fetch_nand | |
| 11263 | .{ .tag = @enumFromInt(3046), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11264 | // __c11_atomic_fetch_or | |
| 11265 | .{ .tag = @enumFromInt(3047), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11266 | // __c11_atomic_fetch_sub | |
| 11267 | .{ .tag = @enumFromInt(3048), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11268 | // __c11_atomic_fetch_xor | |
| 11269 | .{ .tag = @enumFromInt(3049), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11270 | // __c11_atomic_init | |
| 11271 | .{ .tag = @enumFromInt(3050), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11272 | // __c11_atomic_is_lock_free | |
| 11273 | .{ .tag = @enumFromInt(3051), .properties = .{ .param_str = "bz", .attributes = .{ .const_evaluable = true } } }, | |
| 11274 | // __c11_atomic_load | |
| 11275 | .{ .tag = @enumFromInt(3052), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11276 | // __c11_atomic_signal_fence | |
| 11277 | .{ .tag = @enumFromInt(3053), .properties = .{ .param_str = "vi" } }, | |
| 11278 | // __c11_atomic_store | |
| 11279 | .{ .tag = @enumFromInt(3054), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 11280 | // __c11_atomic_thread_fence | |
| 11281 | .{ .tag = @enumFromInt(3055), .properties = .{ .param_str = "vi" } }, | |
| 11282 | // __clear_cache | |
| 11283 | .{ .tag = @enumFromInt(3056), .properties = .{ .param_str = "vv*v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 11284 | // __cospi | |
| 11285 | .{ .tag = @enumFromInt(3057), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 11286 | // __cospif | |
| 11287 | .{ .tag = @enumFromInt(3058), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 11288 | // __debugbreak | |
| 11289 | .{ .tag = @enumFromInt(3059), .properties = .{ .param_str = "v", .language = .all_ms_languages } }, | |
| 11290 | // __dmb | |
| 11291 | .{ .tag = @enumFromInt(3060), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 11292 | // __dsb | |
| 11293 | .{ .tag = @enumFromInt(3061), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 11294 | // __emit | |
| 11295 | .{ .tag = @enumFromInt(3062), .properties = .{ .param_str = "vIUiC", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 11296 | // __exception_code | |
| 11297 | .{ .tag = @enumFromInt(3063), .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, | |
| 11298 | // __exception_info | |
| 11299 | .{ .tag = @enumFromInt(3064), .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, | |
| 11300 | // __exp10 | |
| 11301 | .{ .tag = @enumFromInt(3065), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 11302 | // __exp10f | |
| 11303 | .{ .tag = @enumFromInt(3066), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 11304 | // __fastfail | |
| 11305 | .{ .tag = @enumFromInt(3067), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .attributes = .{ .noreturn = true } } }, | |
| 11306 | // __finite | |
| 11307 | .{ .tag = @enumFromInt(3068), .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 11308 | // __finitef | |
| 11309 | .{ .tag = @enumFromInt(3069), .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 11310 | // __finitel | |
| 11311 | .{ .tag = @enumFromInt(3070), .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 11312 | // __isb | |
| 11313 | .{ .tag = @enumFromInt(3071), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 11314 | // __iso_volatile_load16 | |
| 11315 | .{ .tag = @enumFromInt(3072), .properties = .{ .param_str = "ssCD*", .language = .all_ms_languages } }, | |
| 11316 | // __iso_volatile_load32 | |
| 11317 | .{ .tag = @enumFromInt(3073), .properties = .{ .param_str = "iiCD*", .language = .all_ms_languages } }, | |
| 11318 | // __iso_volatile_load64 | |
| 11319 | .{ .tag = @enumFromInt(3074), .properties = .{ .param_str = "LLiLLiCD*", .language = .all_ms_languages } }, | |
| 11320 | // __iso_volatile_load8 | |
| 11321 | .{ .tag = @enumFromInt(3075), .properties = .{ .param_str = "ccCD*", .language = .all_ms_languages } }, | |
| 11322 | // __iso_volatile_store16 | |
| 11323 | .{ .tag = @enumFromInt(3076), .properties = .{ .param_str = "vsD*s", .language = .all_ms_languages } }, | |
| 11324 | // __iso_volatile_store32 | |
| 11325 | .{ .tag = @enumFromInt(3077), .properties = .{ .param_str = "viD*i", .language = .all_ms_languages } }, | |
| 11326 | // __iso_volatile_store64 | |
| 11327 | .{ .tag = @enumFromInt(3078), .properties = .{ .param_str = "vLLiD*LLi", .language = .all_ms_languages } }, | |
| 11328 | // __iso_volatile_store8 | |
| 11329 | .{ .tag = @enumFromInt(3079), .properties = .{ .param_str = "vcD*c", .language = .all_ms_languages } }, | |
| 11330 | // __ldrexd | |
| 11331 | .{ .tag = @enumFromInt(3080), .properties = .{ .param_str = "WiWiCD*", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 11332 | // __lzcnt | |
| 11333 | .{ .tag = @enumFromInt(3081), .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 11334 | // __lzcnt16 | |
| 11335 | .{ .tag = @enumFromInt(3082), .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 11336 | // __lzcnt64 | |
| 11337 | .{ .tag = @enumFromInt(3083), .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 11338 | // __noop | |
| 11339 | .{ .tag = @enumFromInt(3084), .properties = .{ .param_str = "i.", .language = .all_ms_languages } }, | |
| 11340 | // __nvvm_add_rm_d | |
| 11341 | .{ .tag = @enumFromInt(3085), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11342 | // __nvvm_add_rm_f | |
| 11343 | .{ .tag = @enumFromInt(3086), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11344 | // __nvvm_add_rm_ftz_f | |
| 11345 | .{ .tag = @enumFromInt(3087), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11346 | // __nvvm_add_rn_d | |
| 11347 | .{ .tag = @enumFromInt(3088), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11348 | // __nvvm_add_rn_f | |
| 11349 | .{ .tag = @enumFromInt(3089), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11350 | // __nvvm_add_rn_ftz_f | |
| 11351 | .{ .tag = @enumFromInt(3090), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11352 | // __nvvm_add_rp_d | |
| 11353 | .{ .tag = @enumFromInt(3091), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11354 | // __nvvm_add_rp_f | |
| 11355 | .{ .tag = @enumFromInt(3092), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11356 | // __nvvm_add_rp_ftz_f | |
| 11357 | .{ .tag = @enumFromInt(3093), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11358 | // __nvvm_add_rz_d | |
| 11359 | .{ .tag = @enumFromInt(3094), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11360 | // __nvvm_add_rz_f | |
| 11361 | .{ .tag = @enumFromInt(3095), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11362 | // __nvvm_add_rz_ftz_f | |
| 11363 | .{ .tag = @enumFromInt(3096), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11364 | // __nvvm_atom_add_gen_f | |
| 11365 | .{ .tag = @enumFromInt(3097), .properties = .{ .param_str = "ffD*f", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11366 | // __nvvm_atom_add_gen_i | |
| 11367 | .{ .tag = @enumFromInt(3098), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11368 | // __nvvm_atom_add_gen_l | |
| 11369 | .{ .tag = @enumFromInt(3099), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11370 | // __nvvm_atom_add_gen_ll | |
| 11371 | .{ .tag = @enumFromInt(3100), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11372 | // __nvvm_atom_and_gen_i | |
| 11373 | .{ .tag = @enumFromInt(3101), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11374 | // __nvvm_atom_and_gen_l | |
| 11375 | .{ .tag = @enumFromInt(3102), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11376 | // __nvvm_atom_and_gen_ll | |
| 11377 | .{ .tag = @enumFromInt(3103), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11378 | // __nvvm_atom_cas_gen_i | |
| 11379 | .{ .tag = @enumFromInt(3104), .properties = .{ .param_str = "iiD*ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11380 | // __nvvm_atom_cas_gen_l | |
| 11381 | .{ .tag = @enumFromInt(3105), .properties = .{ .param_str = "LiLiD*LiLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11382 | // __nvvm_atom_cas_gen_ll | |
| 11383 | .{ .tag = @enumFromInt(3106), .properties = .{ .param_str = "LLiLLiD*LLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11384 | // __nvvm_atom_dec_gen_ui | |
| 11385 | .{ .tag = @enumFromInt(3107), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11386 | // __nvvm_atom_inc_gen_ui | |
| 11387 | .{ .tag = @enumFromInt(3108), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11388 | // __nvvm_atom_max_gen_i | |
| 11389 | .{ .tag = @enumFromInt(3109), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11390 | // __nvvm_atom_max_gen_l | |
| 11391 | .{ .tag = @enumFromInt(3110), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11392 | // __nvvm_atom_max_gen_ll | |
| 11393 | .{ .tag = @enumFromInt(3111), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11394 | // __nvvm_atom_max_gen_ui | |
| 11395 | .{ .tag = @enumFromInt(3112), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11396 | // __nvvm_atom_max_gen_ul | |
| 11397 | .{ .tag = @enumFromInt(3113), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11398 | // __nvvm_atom_max_gen_ull | |
| 11399 | .{ .tag = @enumFromInt(3114), .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11400 | // __nvvm_atom_min_gen_i | |
| 11401 | .{ .tag = @enumFromInt(3115), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11402 | // __nvvm_atom_min_gen_l | |
| 11403 | .{ .tag = @enumFromInt(3116), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11404 | // __nvvm_atom_min_gen_ll | |
| 11405 | .{ .tag = @enumFromInt(3117), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11406 | // __nvvm_atom_min_gen_ui | |
| 11407 | .{ .tag = @enumFromInt(3118), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11408 | // __nvvm_atom_min_gen_ul | |
| 11409 | .{ .tag = @enumFromInt(3119), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11410 | // __nvvm_atom_min_gen_ull | |
| 11411 | .{ .tag = @enumFromInt(3120), .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11412 | // __nvvm_atom_or_gen_i | |
| 11413 | .{ .tag = @enumFromInt(3121), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11414 | // __nvvm_atom_or_gen_l | |
| 11415 | .{ .tag = @enumFromInt(3122), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11416 | // __nvvm_atom_or_gen_ll | |
| 11417 | .{ .tag = @enumFromInt(3123), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11418 | // __nvvm_atom_sub_gen_i | |
| 11419 | .{ .tag = @enumFromInt(3124), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11420 | // __nvvm_atom_sub_gen_l | |
| 11421 | .{ .tag = @enumFromInt(3125), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11422 | // __nvvm_atom_sub_gen_ll | |
| 11423 | .{ .tag = @enumFromInt(3126), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11424 | // __nvvm_atom_xchg_gen_i | |
| 11425 | .{ .tag = @enumFromInt(3127), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11426 | // __nvvm_atom_xchg_gen_l | |
| 11427 | .{ .tag = @enumFromInt(3128), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11428 | // __nvvm_atom_xchg_gen_ll | |
| 11429 | .{ .tag = @enumFromInt(3129), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11430 | // __nvvm_atom_xor_gen_i | |
| 11431 | .{ .tag = @enumFromInt(3130), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11432 | // __nvvm_atom_xor_gen_l | |
| 11433 | .{ .tag = @enumFromInt(3131), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11434 | // __nvvm_atom_xor_gen_ll | |
| 11435 | .{ .tag = @enumFromInt(3132), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11436 | // __nvvm_bar0_and | |
| 11437 | .{ .tag = @enumFromInt(3133), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11438 | // __nvvm_bar0_or | |
| 11439 | .{ .tag = @enumFromInt(3134), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11440 | // __nvvm_bar0_popc | |
| 11441 | .{ .tag = @enumFromInt(3135), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11442 | // __nvvm_bar_sync | |
| 11443 | .{ .tag = @enumFromInt(3136), .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11444 | // __nvvm_bitcast_d2ll | |
| 11445 | .{ .tag = @enumFromInt(3137), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11446 | // __nvvm_bitcast_f2i | |
| 11447 | .{ .tag = @enumFromInt(3138), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11448 | // __nvvm_bitcast_i2f | |
| 11449 | .{ .tag = @enumFromInt(3139), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11450 | // __nvvm_bitcast_ll2d | |
| 11451 | .{ .tag = @enumFromInt(3140), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11452 | // __nvvm_ceil_d | |
| 11453 | .{ .tag = @enumFromInt(3141), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11454 | // __nvvm_ceil_f | |
| 11455 | .{ .tag = @enumFromInt(3142), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11456 | // __nvvm_ceil_ftz_f | |
| 11457 | .{ .tag = @enumFromInt(3143), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11458 | // __nvvm_compiler_error | |
| 11459 | .{ .tag = @enumFromInt(3144), .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11460 | // __nvvm_compiler_warn | |
| 11461 | .{ .tag = @enumFromInt(3145), .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11462 | // __nvvm_cos_approx_f | |
| 11463 | .{ .tag = @enumFromInt(3146), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11464 | // __nvvm_cos_approx_ftz_f | |
| 11465 | .{ .tag = @enumFromInt(3147), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11466 | // __nvvm_d2f_rm | |
| 11467 | .{ .tag = @enumFromInt(3148), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11468 | // __nvvm_d2f_rm_ftz | |
| 11469 | .{ .tag = @enumFromInt(3149), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11470 | // __nvvm_d2f_rn | |
| 11471 | .{ .tag = @enumFromInt(3150), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11472 | // __nvvm_d2f_rn_ftz | |
| 11473 | .{ .tag = @enumFromInt(3151), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11474 | // __nvvm_d2f_rp | |
| 11475 | .{ .tag = @enumFromInt(3152), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11476 | // __nvvm_d2f_rp_ftz | |
| 11477 | .{ .tag = @enumFromInt(3153), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11478 | // __nvvm_d2f_rz | |
| 11479 | .{ .tag = @enumFromInt(3154), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11480 | // __nvvm_d2f_rz_ftz | |
| 11481 | .{ .tag = @enumFromInt(3155), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11482 | // __nvvm_d2i_hi | |
| 11483 | .{ .tag = @enumFromInt(3156), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11484 | // __nvvm_d2i_lo | |
| 11485 | .{ .tag = @enumFromInt(3157), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11486 | // __nvvm_d2i_rm | |
| 11487 | .{ .tag = @enumFromInt(3158), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11488 | // __nvvm_d2i_rn | |
| 11489 | .{ .tag = @enumFromInt(3159), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11490 | // __nvvm_d2i_rp | |
| 11491 | .{ .tag = @enumFromInt(3160), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11492 | // __nvvm_d2i_rz | |
| 11493 | .{ .tag = @enumFromInt(3161), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11494 | // __nvvm_d2ll_rm | |
| 11495 | .{ .tag = @enumFromInt(3162), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11496 | // __nvvm_d2ll_rn | |
| 11497 | .{ .tag = @enumFromInt(3163), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11498 | // __nvvm_d2ll_rp | |
| 11499 | .{ .tag = @enumFromInt(3164), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11500 | // __nvvm_d2ll_rz | |
| 11501 | .{ .tag = @enumFromInt(3165), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11502 | // __nvvm_d2ui_rm | |
| 11503 | .{ .tag = @enumFromInt(3166), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11504 | // __nvvm_d2ui_rn | |
| 11505 | .{ .tag = @enumFromInt(3167), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11506 | // __nvvm_d2ui_rp | |
| 11507 | .{ .tag = @enumFromInt(3168), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11508 | // __nvvm_d2ui_rz | |
| 11509 | .{ .tag = @enumFromInt(3169), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11510 | // __nvvm_d2ull_rm | |
| 11511 | .{ .tag = @enumFromInt(3170), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11512 | // __nvvm_d2ull_rn | |
| 11513 | .{ .tag = @enumFromInt(3171), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11514 | // __nvvm_d2ull_rp | |
| 11515 | .{ .tag = @enumFromInt(3172), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11516 | // __nvvm_d2ull_rz | |
| 11517 | .{ .tag = @enumFromInt(3173), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11518 | // __nvvm_div_approx_f | |
| 11519 | .{ .tag = @enumFromInt(3174), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11520 | // __nvvm_div_approx_ftz_f | |
| 11521 | .{ .tag = @enumFromInt(3175), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11522 | // __nvvm_div_rm_d | |
| 11523 | .{ .tag = @enumFromInt(3176), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11524 | // __nvvm_div_rm_f | |
| 11525 | .{ .tag = @enumFromInt(3177), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11526 | // __nvvm_div_rm_ftz_f | |
| 11527 | .{ .tag = @enumFromInt(3178), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11528 | // __nvvm_div_rn_d | |
| 11529 | .{ .tag = @enumFromInt(3179), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11530 | // __nvvm_div_rn_f | |
| 11531 | .{ .tag = @enumFromInt(3180), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11532 | // __nvvm_div_rn_ftz_f | |
| 11533 | .{ .tag = @enumFromInt(3181), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11534 | // __nvvm_div_rp_d | |
| 11535 | .{ .tag = @enumFromInt(3182), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11536 | // __nvvm_div_rp_f | |
| 11537 | .{ .tag = @enumFromInt(3183), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11538 | // __nvvm_div_rp_ftz_f | |
| 11539 | .{ .tag = @enumFromInt(3184), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11540 | // __nvvm_div_rz_d | |
| 11541 | .{ .tag = @enumFromInt(3185), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11542 | // __nvvm_div_rz_f | |
| 11543 | .{ .tag = @enumFromInt(3186), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11544 | // __nvvm_div_rz_ftz_f | |
| 11545 | .{ .tag = @enumFromInt(3187), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11546 | // __nvvm_ex2_approx_d | |
| 11547 | .{ .tag = @enumFromInt(3188), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11548 | // __nvvm_ex2_approx_f | |
| 11549 | .{ .tag = @enumFromInt(3189), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11550 | // __nvvm_ex2_approx_ftz_f | |
| 11551 | .{ .tag = @enumFromInt(3190), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11552 | // __nvvm_f2h_rn | |
| 11553 | .{ .tag = @enumFromInt(3191), .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11554 | // __nvvm_f2h_rn_ftz | |
| 11555 | .{ .tag = @enumFromInt(3192), .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11556 | // __nvvm_f2i_rm | |
| 11557 | .{ .tag = @enumFromInt(3193), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11558 | // __nvvm_f2i_rm_ftz | |
| 11559 | .{ .tag = @enumFromInt(3194), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11560 | // __nvvm_f2i_rn | |
| 11561 | .{ .tag = @enumFromInt(3195), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11562 | // __nvvm_f2i_rn_ftz | |
| 11563 | .{ .tag = @enumFromInt(3196), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11564 | // __nvvm_f2i_rp | |
| 11565 | .{ .tag = @enumFromInt(3197), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11566 | // __nvvm_f2i_rp_ftz | |
| 11567 | .{ .tag = @enumFromInt(3198), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11568 | // __nvvm_f2i_rz | |
| 11569 | .{ .tag = @enumFromInt(3199), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11570 | // __nvvm_f2i_rz_ftz | |
| 11571 | .{ .tag = @enumFromInt(3200), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11572 | // __nvvm_f2ll_rm | |
| 11573 | .{ .tag = @enumFromInt(3201), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11574 | // __nvvm_f2ll_rm_ftz | |
| 11575 | .{ .tag = @enumFromInt(3202), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11576 | // __nvvm_f2ll_rn | |
| 11577 | .{ .tag = @enumFromInt(3203), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11578 | // __nvvm_f2ll_rn_ftz | |
| 11579 | .{ .tag = @enumFromInt(3204), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11580 | // __nvvm_f2ll_rp | |
| 11581 | .{ .tag = @enumFromInt(3205), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11582 | // __nvvm_f2ll_rp_ftz | |
| 11583 | .{ .tag = @enumFromInt(3206), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11584 | // __nvvm_f2ll_rz | |
| 11585 | .{ .tag = @enumFromInt(3207), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11586 | // __nvvm_f2ll_rz_ftz | |
| 11587 | .{ .tag = @enumFromInt(3208), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11588 | // __nvvm_f2ui_rm | |
| 11589 | .{ .tag = @enumFromInt(3209), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11590 | // __nvvm_f2ui_rm_ftz | |
| 11591 | .{ .tag = @enumFromInt(3210), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11592 | // __nvvm_f2ui_rn | |
| 11593 | .{ .tag = @enumFromInt(3211), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11594 | // __nvvm_f2ui_rn_ftz | |
| 11595 | .{ .tag = @enumFromInt(3212), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11596 | // __nvvm_f2ui_rp | |
| 11597 | .{ .tag = @enumFromInt(3213), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11598 | // __nvvm_f2ui_rp_ftz | |
| 11599 | .{ .tag = @enumFromInt(3214), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11600 | // __nvvm_f2ui_rz | |
| 11601 | .{ .tag = @enumFromInt(3215), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11602 | // __nvvm_f2ui_rz_ftz | |
| 11603 | .{ .tag = @enumFromInt(3216), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11604 | // __nvvm_f2ull_rm | |
| 11605 | .{ .tag = @enumFromInt(3217), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11606 | // __nvvm_f2ull_rm_ftz | |
| 11607 | .{ .tag = @enumFromInt(3218), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11608 | // __nvvm_f2ull_rn | |
| 11609 | .{ .tag = @enumFromInt(3219), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11610 | // __nvvm_f2ull_rn_ftz | |
| 11611 | .{ .tag = @enumFromInt(3220), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11612 | // __nvvm_f2ull_rp | |
| 11613 | .{ .tag = @enumFromInt(3221), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11614 | // __nvvm_f2ull_rp_ftz | |
| 11615 | .{ .tag = @enumFromInt(3222), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11616 | // __nvvm_f2ull_rz | |
| 11617 | .{ .tag = @enumFromInt(3223), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11618 | // __nvvm_f2ull_rz_ftz | |
| 11619 | .{ .tag = @enumFromInt(3224), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11620 | // __nvvm_fabs_d | |
| 11621 | .{ .tag = @enumFromInt(3225), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11622 | // __nvvm_fabs_f | |
| 11623 | .{ .tag = @enumFromInt(3226), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11624 | // __nvvm_fabs_ftz_f | |
| 11625 | .{ .tag = @enumFromInt(3227), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11626 | // __nvvm_floor_d | |
| 11627 | .{ .tag = @enumFromInt(3228), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11628 | // __nvvm_floor_f | |
| 11629 | .{ .tag = @enumFromInt(3229), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11630 | // __nvvm_floor_ftz_f | |
| 11631 | .{ .tag = @enumFromInt(3230), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11632 | // __nvvm_fma_rm_d | |
| 11633 | .{ .tag = @enumFromInt(3231), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11634 | // __nvvm_fma_rm_f | |
| 11635 | .{ .tag = @enumFromInt(3232), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11636 | // __nvvm_fma_rm_ftz_f | |
| 11637 | .{ .tag = @enumFromInt(3233), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11638 | // __nvvm_fma_rn_d | |
| 11639 | .{ .tag = @enumFromInt(3234), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11640 | // __nvvm_fma_rn_f | |
| 11641 | .{ .tag = @enumFromInt(3235), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11642 | // __nvvm_fma_rn_ftz_f | |
| 11643 | .{ .tag = @enumFromInt(3236), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11644 | // __nvvm_fma_rp_d | |
| 11645 | .{ .tag = @enumFromInt(3237), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11646 | // __nvvm_fma_rp_f | |
| 11647 | .{ .tag = @enumFromInt(3238), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11648 | // __nvvm_fma_rp_ftz_f | |
| 11649 | .{ .tag = @enumFromInt(3239), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11650 | // __nvvm_fma_rz_d | |
| 11651 | .{ .tag = @enumFromInt(3240), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11652 | // __nvvm_fma_rz_f | |
| 11653 | .{ .tag = @enumFromInt(3241), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11654 | // __nvvm_fma_rz_ftz_f | |
| 11655 | .{ .tag = @enumFromInt(3242), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11656 | // __nvvm_fmax_d | |
| 11657 | .{ .tag = @enumFromInt(3243), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11658 | // __nvvm_fmax_f | |
| 11659 | .{ .tag = @enumFromInt(3244), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11660 | // __nvvm_fmax_ftz_f | |
| 11661 | .{ .tag = @enumFromInt(3245), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11662 | // __nvvm_fmin_d | |
| 11663 | .{ .tag = @enumFromInt(3246), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11664 | // __nvvm_fmin_f | |
| 11665 | .{ .tag = @enumFromInt(3247), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11666 | // __nvvm_fmin_ftz_f | |
| 11667 | .{ .tag = @enumFromInt(3248), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11668 | // __nvvm_i2d_rm | |
| 11669 | .{ .tag = @enumFromInt(3249), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11670 | // __nvvm_i2d_rn | |
| 11671 | .{ .tag = @enumFromInt(3250), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11672 | // __nvvm_i2d_rp | |
| 11673 | .{ .tag = @enumFromInt(3251), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11674 | // __nvvm_i2d_rz | |
| 11675 | .{ .tag = @enumFromInt(3252), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11676 | // __nvvm_i2f_rm | |
| 11677 | .{ .tag = @enumFromInt(3253), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11678 | // __nvvm_i2f_rn | |
| 11679 | .{ .tag = @enumFromInt(3254), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11680 | // __nvvm_i2f_rp | |
| 11681 | .{ .tag = @enumFromInt(3255), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11682 | // __nvvm_i2f_rz | |
| 11683 | .{ .tag = @enumFromInt(3256), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11684 | // __nvvm_isspacep_const | |
| 11685 | .{ .tag = @enumFromInt(3257), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11686 | // __nvvm_isspacep_global | |
| 11687 | .{ .tag = @enumFromInt(3258), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11688 | // __nvvm_isspacep_local | |
| 11689 | .{ .tag = @enumFromInt(3259), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11690 | // __nvvm_isspacep_shared | |
| 11691 | .{ .tag = @enumFromInt(3260), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11692 | // __nvvm_ldg_c | |
| 11693 | .{ .tag = @enumFromInt(3261), .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11694 | // __nvvm_ldg_c2 | |
| 11695 | .{ .tag = @enumFromInt(3262), .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11696 | // __nvvm_ldg_c4 | |
| 11697 | .{ .tag = @enumFromInt(3263), .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11698 | // __nvvm_ldg_d | |
| 11699 | .{ .tag = @enumFromInt(3264), .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11700 | // __nvvm_ldg_d2 | |
| 11701 | .{ .tag = @enumFromInt(3265), .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11702 | // __nvvm_ldg_f | |
| 11703 | .{ .tag = @enumFromInt(3266), .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11704 | // __nvvm_ldg_f2 | |
| 11705 | .{ .tag = @enumFromInt(3267), .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11706 | // __nvvm_ldg_f4 | |
| 11707 | .{ .tag = @enumFromInt(3268), .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11708 | // __nvvm_ldg_h | |
| 11709 | .{ .tag = @enumFromInt(3269), .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11710 | // __nvvm_ldg_h2 | |
| 11711 | .{ .tag = @enumFromInt(3270), .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11712 | // __nvvm_ldg_i | |
| 11713 | .{ .tag = @enumFromInt(3271), .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11714 | // __nvvm_ldg_i2 | |
| 11715 | .{ .tag = @enumFromInt(3272), .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11716 | // __nvvm_ldg_i4 | |
| 11717 | .{ .tag = @enumFromInt(3273), .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11718 | // __nvvm_ldg_l | |
| 11719 | .{ .tag = @enumFromInt(3274), .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11720 | // __nvvm_ldg_l2 | |
| 11721 | .{ .tag = @enumFromInt(3275), .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11722 | // __nvvm_ldg_ll | |
| 11723 | .{ .tag = @enumFromInt(3276), .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11724 | // __nvvm_ldg_ll2 | |
| 11725 | .{ .tag = @enumFromInt(3277), .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11726 | // __nvvm_ldg_s | |
| 11727 | .{ .tag = @enumFromInt(3278), .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11728 | // __nvvm_ldg_s2 | |
| 11729 | .{ .tag = @enumFromInt(3279), .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11730 | // __nvvm_ldg_s4 | |
| 11731 | .{ .tag = @enumFromInt(3280), .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11732 | // __nvvm_ldg_sc | |
| 11733 | .{ .tag = @enumFromInt(3281), .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11734 | // __nvvm_ldg_sc2 | |
| 11735 | .{ .tag = @enumFromInt(3282), .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11736 | // __nvvm_ldg_sc4 | |
| 11737 | .{ .tag = @enumFromInt(3283), .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11738 | // __nvvm_ldg_uc | |
| 11739 | .{ .tag = @enumFromInt(3284), .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11740 | // __nvvm_ldg_uc2 | |
| 11741 | .{ .tag = @enumFromInt(3285), .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11742 | // __nvvm_ldg_uc4 | |
| 11743 | .{ .tag = @enumFromInt(3286), .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11744 | // __nvvm_ldg_ui | |
| 11745 | .{ .tag = @enumFromInt(3287), .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11746 | // __nvvm_ldg_ui2 | |
| 11747 | .{ .tag = @enumFromInt(3288), .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11748 | // __nvvm_ldg_ui4 | |
| 11749 | .{ .tag = @enumFromInt(3289), .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11750 | // __nvvm_ldg_ul | |
| 11751 | .{ .tag = @enumFromInt(3290), .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11752 | // __nvvm_ldg_ul2 | |
| 11753 | .{ .tag = @enumFromInt(3291), .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11754 | // __nvvm_ldg_ull | |
| 11755 | .{ .tag = @enumFromInt(3292), .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11756 | // __nvvm_ldg_ull2 | |
| 11757 | .{ .tag = @enumFromInt(3293), .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11758 | // __nvvm_ldg_us | |
| 11759 | .{ .tag = @enumFromInt(3294), .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11760 | // __nvvm_ldg_us2 | |
| 11761 | .{ .tag = @enumFromInt(3295), .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11762 | // __nvvm_ldg_us4 | |
| 11763 | .{ .tag = @enumFromInt(3296), .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11764 | // __nvvm_ldu_c | |
| 11765 | .{ .tag = @enumFromInt(3297), .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11766 | // __nvvm_ldu_c2 | |
| 11767 | .{ .tag = @enumFromInt(3298), .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11768 | // __nvvm_ldu_c4 | |
| 11769 | .{ .tag = @enumFromInt(3299), .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11770 | // __nvvm_ldu_d | |
| 11771 | .{ .tag = @enumFromInt(3300), .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11772 | // __nvvm_ldu_d2 | |
| 11773 | .{ .tag = @enumFromInt(3301), .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11774 | // __nvvm_ldu_f | |
| 11775 | .{ .tag = @enumFromInt(3302), .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11776 | // __nvvm_ldu_f2 | |
| 11777 | .{ .tag = @enumFromInt(3303), .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11778 | // __nvvm_ldu_f4 | |
| 11779 | .{ .tag = @enumFromInt(3304), .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11780 | // __nvvm_ldu_h | |
| 11781 | .{ .tag = @enumFromInt(3305), .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11782 | // __nvvm_ldu_h2 | |
| 11783 | .{ .tag = @enumFromInt(3306), .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11784 | // __nvvm_ldu_i | |
| 11785 | .{ .tag = @enumFromInt(3307), .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11786 | // __nvvm_ldu_i2 | |
| 11787 | .{ .tag = @enumFromInt(3308), .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11788 | // __nvvm_ldu_i4 | |
| 11789 | .{ .tag = @enumFromInt(3309), .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11790 | // __nvvm_ldu_l | |
| 11791 | .{ .tag = @enumFromInt(3310), .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11792 | // __nvvm_ldu_l2 | |
| 11793 | .{ .tag = @enumFromInt(3311), .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11794 | // __nvvm_ldu_ll | |
| 11795 | .{ .tag = @enumFromInt(3312), .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11796 | // __nvvm_ldu_ll2 | |
| 11797 | .{ .tag = @enumFromInt(3313), .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11798 | // __nvvm_ldu_s | |
| 11799 | .{ .tag = @enumFromInt(3314), .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11800 | // __nvvm_ldu_s2 | |
| 11801 | .{ .tag = @enumFromInt(3315), .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11802 | // __nvvm_ldu_s4 | |
| 11803 | .{ .tag = @enumFromInt(3316), .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11804 | // __nvvm_ldu_sc | |
| 11805 | .{ .tag = @enumFromInt(3317), .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11806 | // __nvvm_ldu_sc2 | |
| 11807 | .{ .tag = @enumFromInt(3318), .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11808 | // __nvvm_ldu_sc4 | |
| 11809 | .{ .tag = @enumFromInt(3319), .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11810 | // __nvvm_ldu_uc | |
| 11811 | .{ .tag = @enumFromInt(3320), .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11812 | // __nvvm_ldu_uc2 | |
| 11813 | .{ .tag = @enumFromInt(3321), .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11814 | // __nvvm_ldu_uc4 | |
| 11815 | .{ .tag = @enumFromInt(3322), .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11816 | // __nvvm_ldu_ui | |
| 11817 | .{ .tag = @enumFromInt(3323), .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11818 | // __nvvm_ldu_ui2 | |
| 11819 | .{ .tag = @enumFromInt(3324), .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11820 | // __nvvm_ldu_ui4 | |
| 11821 | .{ .tag = @enumFromInt(3325), .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11822 | // __nvvm_ldu_ul | |
| 11823 | .{ .tag = @enumFromInt(3326), .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11824 | // __nvvm_ldu_ul2 | |
| 11825 | .{ .tag = @enumFromInt(3327), .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11826 | // __nvvm_ldu_ull | |
| 11827 | .{ .tag = @enumFromInt(3328), .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11828 | // __nvvm_ldu_ull2 | |
| 11829 | .{ .tag = @enumFromInt(3329), .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11830 | // __nvvm_ldu_us | |
| 11831 | .{ .tag = @enumFromInt(3330), .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11832 | // __nvvm_ldu_us2 | |
| 11833 | .{ .tag = @enumFromInt(3331), .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11834 | // __nvvm_ldu_us4 | |
| 11835 | .{ .tag = @enumFromInt(3332), .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11836 | // __nvvm_lg2_approx_d | |
| 11837 | .{ .tag = @enumFromInt(3333), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11838 | // __nvvm_lg2_approx_f | |
| 11839 | .{ .tag = @enumFromInt(3334), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11840 | // __nvvm_lg2_approx_ftz_f | |
| 11841 | .{ .tag = @enumFromInt(3335), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11842 | // __nvvm_ll2d_rm | |
| 11843 | .{ .tag = @enumFromInt(3336), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11844 | // __nvvm_ll2d_rn | |
| 11845 | .{ .tag = @enumFromInt(3337), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11846 | // __nvvm_ll2d_rp | |
| 11847 | .{ .tag = @enumFromInt(3338), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11848 | // __nvvm_ll2d_rz | |
| 11849 | .{ .tag = @enumFromInt(3339), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11850 | // __nvvm_ll2f_rm | |
| 11851 | .{ .tag = @enumFromInt(3340), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11852 | // __nvvm_ll2f_rn | |
| 11853 | .{ .tag = @enumFromInt(3341), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11854 | // __nvvm_ll2f_rp | |
| 11855 | .{ .tag = @enumFromInt(3342), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11856 | // __nvvm_ll2f_rz | |
| 11857 | .{ .tag = @enumFromInt(3343), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11858 | // __nvvm_lohi_i2d | |
| 11859 | .{ .tag = @enumFromInt(3344), .properties = .{ .param_str = "dii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11860 | // __nvvm_membar_cta | |
| 11861 | .{ .tag = @enumFromInt(3345), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11862 | // __nvvm_membar_gl | |
| 11863 | .{ .tag = @enumFromInt(3346), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11864 | // __nvvm_membar_sys | |
| 11865 | .{ .tag = @enumFromInt(3347), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11866 | // __nvvm_memcpy | |
| 11867 | .{ .tag = @enumFromInt(3348), .properties = .{ .param_str = "vUc*Uc*zi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11868 | // __nvvm_memset | |
| 11869 | .{ .tag = @enumFromInt(3349), .properties = .{ .param_str = "vUc*Uczi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11870 | // __nvvm_mul24_i | |
| 11871 | .{ .tag = @enumFromInt(3350), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11872 | // __nvvm_mul24_ui | |
| 11873 | .{ .tag = @enumFromInt(3351), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11874 | // __nvvm_mul_rm_d | |
| 11875 | .{ .tag = @enumFromInt(3352), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11876 | // __nvvm_mul_rm_f | |
| 11877 | .{ .tag = @enumFromInt(3353), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11878 | // __nvvm_mul_rm_ftz_f | |
| 11879 | .{ .tag = @enumFromInt(3354), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11880 | // __nvvm_mul_rn_d | |
| 11881 | .{ .tag = @enumFromInt(3355), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11882 | // __nvvm_mul_rn_f | |
| 11883 | .{ .tag = @enumFromInt(3356), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11884 | // __nvvm_mul_rn_ftz_f | |
| 11885 | .{ .tag = @enumFromInt(3357), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11886 | // __nvvm_mul_rp_d | |
| 11887 | .{ .tag = @enumFromInt(3358), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11888 | // __nvvm_mul_rp_f | |
| 11889 | .{ .tag = @enumFromInt(3359), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11890 | // __nvvm_mul_rp_ftz_f | |
| 11891 | .{ .tag = @enumFromInt(3360), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11892 | // __nvvm_mul_rz_d | |
| 11893 | .{ .tag = @enumFromInt(3361), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11894 | // __nvvm_mul_rz_f | |
| 11895 | .{ .tag = @enumFromInt(3362), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11896 | // __nvvm_mul_rz_ftz_f | |
| 11897 | .{ .tag = @enumFromInt(3363), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11898 | // __nvvm_mulhi_i | |
| 11899 | .{ .tag = @enumFromInt(3364), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11900 | // __nvvm_mulhi_ll | |
| 11901 | .{ .tag = @enumFromInt(3365), .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11902 | // __nvvm_mulhi_ui | |
| 11903 | .{ .tag = @enumFromInt(3366), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11904 | // __nvvm_mulhi_ull | |
| 11905 | .{ .tag = @enumFromInt(3367), .properties = .{ .param_str = "ULLiULLiULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11906 | // __nvvm_prmt | |
| 11907 | .{ .tag = @enumFromInt(3368), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11908 | // __nvvm_rcp_approx_ftz_d | |
| 11909 | .{ .tag = @enumFromInt(3369), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11910 | // __nvvm_rcp_approx_ftz_f | |
| 11911 | .{ .tag = @enumFromInt(3370), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11912 | // __nvvm_rcp_rm_d | |
| 11913 | .{ .tag = @enumFromInt(3371), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11914 | // __nvvm_rcp_rm_f | |
| 11915 | .{ .tag = @enumFromInt(3372), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11916 | // __nvvm_rcp_rm_ftz_f | |
| 11917 | .{ .tag = @enumFromInt(3373), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11918 | // __nvvm_rcp_rn_d | |
| 11919 | .{ .tag = @enumFromInt(3374), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11920 | // __nvvm_rcp_rn_f | |
| 11921 | .{ .tag = @enumFromInt(3375), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11922 | // __nvvm_rcp_rn_ftz_f | |
| 11923 | .{ .tag = @enumFromInt(3376), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11924 | // __nvvm_rcp_rp_d | |
| 11925 | .{ .tag = @enumFromInt(3377), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11926 | // __nvvm_rcp_rp_f | |
| 11927 | .{ .tag = @enumFromInt(3378), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11928 | // __nvvm_rcp_rp_ftz_f | |
| 11929 | .{ .tag = @enumFromInt(3379), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11930 | // __nvvm_rcp_rz_d | |
| 11931 | .{ .tag = @enumFromInt(3380), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11932 | // __nvvm_rcp_rz_f | |
| 11933 | .{ .tag = @enumFromInt(3381), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11934 | // __nvvm_rcp_rz_ftz_f | |
| 11935 | .{ .tag = @enumFromInt(3382), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11936 | // __nvvm_read_ptx_sreg_clock | |
| 11937 | .{ .tag = @enumFromInt(3383), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11938 | // __nvvm_read_ptx_sreg_clock64 | |
| 11939 | .{ .tag = @enumFromInt(3384), .properties = .{ .param_str = "LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11940 | // __nvvm_read_ptx_sreg_ctaid_w | |
| 11941 | .{ .tag = @enumFromInt(3385), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11942 | // __nvvm_read_ptx_sreg_ctaid_x | |
| 11943 | .{ .tag = @enumFromInt(3386), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11944 | // __nvvm_read_ptx_sreg_ctaid_y | |
| 11945 | .{ .tag = @enumFromInt(3387), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11946 | // __nvvm_read_ptx_sreg_ctaid_z | |
| 11947 | .{ .tag = @enumFromInt(3388), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11948 | // __nvvm_read_ptx_sreg_gridid | |
| 11949 | .{ .tag = @enumFromInt(3389), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11950 | // __nvvm_read_ptx_sreg_laneid | |
| 11951 | .{ .tag = @enumFromInt(3390), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11952 | // __nvvm_read_ptx_sreg_lanemask_eq | |
| 11953 | .{ .tag = @enumFromInt(3391), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11954 | // __nvvm_read_ptx_sreg_lanemask_ge | |
| 11955 | .{ .tag = @enumFromInt(3392), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11956 | // __nvvm_read_ptx_sreg_lanemask_gt | |
| 11957 | .{ .tag = @enumFromInt(3393), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11958 | // __nvvm_read_ptx_sreg_lanemask_le | |
| 11959 | .{ .tag = @enumFromInt(3394), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11960 | // __nvvm_read_ptx_sreg_lanemask_lt | |
| 11961 | .{ .tag = @enumFromInt(3395), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11962 | // __nvvm_read_ptx_sreg_nctaid_w | |
| 11963 | .{ .tag = @enumFromInt(3396), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11964 | // __nvvm_read_ptx_sreg_nctaid_x | |
| 11965 | .{ .tag = @enumFromInt(3397), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11966 | // __nvvm_read_ptx_sreg_nctaid_y | |
| 11967 | .{ .tag = @enumFromInt(3398), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11968 | // __nvvm_read_ptx_sreg_nctaid_z | |
| 11969 | .{ .tag = @enumFromInt(3399), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11970 | // __nvvm_read_ptx_sreg_nsmid | |
| 11971 | .{ .tag = @enumFromInt(3400), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11972 | // __nvvm_read_ptx_sreg_ntid_w | |
| 11973 | .{ .tag = @enumFromInt(3401), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11974 | // __nvvm_read_ptx_sreg_ntid_x | |
| 11975 | .{ .tag = @enumFromInt(3402), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11976 | // __nvvm_read_ptx_sreg_ntid_y | |
| 11977 | .{ .tag = @enumFromInt(3403), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11978 | // __nvvm_read_ptx_sreg_ntid_z | |
| 11979 | .{ .tag = @enumFromInt(3404), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11980 | // __nvvm_read_ptx_sreg_nwarpid | |
| 11981 | .{ .tag = @enumFromInt(3405), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11982 | // __nvvm_read_ptx_sreg_pm0 | |
| 11983 | .{ .tag = @enumFromInt(3406), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11984 | // __nvvm_read_ptx_sreg_pm1 | |
| 11985 | .{ .tag = @enumFromInt(3407), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11986 | // __nvvm_read_ptx_sreg_pm2 | |
| 11987 | .{ .tag = @enumFromInt(3408), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11988 | // __nvvm_read_ptx_sreg_pm3 | |
| 11989 | .{ .tag = @enumFromInt(3409), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 11990 | // __nvvm_read_ptx_sreg_smid | |
| 11991 | .{ .tag = @enumFromInt(3410), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11992 | // __nvvm_read_ptx_sreg_tid_w | |
| 11993 | .{ .tag = @enumFromInt(3411), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11994 | // __nvvm_read_ptx_sreg_tid_x | |
| 11995 | .{ .tag = @enumFromInt(3412), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11996 | // __nvvm_read_ptx_sreg_tid_y | |
| 11997 | .{ .tag = @enumFromInt(3413), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 11998 | // __nvvm_read_ptx_sreg_tid_z | |
| 11999 | .{ .tag = @enumFromInt(3414), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12000 | // __nvvm_read_ptx_sreg_warpid | |
| 12001 | .{ .tag = @enumFromInt(3415), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12002 | // __nvvm_round_d | |
| 12003 | .{ .tag = @enumFromInt(3416), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12004 | // __nvvm_round_f | |
| 12005 | .{ .tag = @enumFromInt(3417), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12006 | // __nvvm_round_ftz_f | |
| 12007 | .{ .tag = @enumFromInt(3418), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12008 | // __nvvm_rsqrt_approx_d | |
| 12009 | .{ .tag = @enumFromInt(3419), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12010 | // __nvvm_rsqrt_approx_f | |
| 12011 | .{ .tag = @enumFromInt(3420), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12012 | // __nvvm_rsqrt_approx_ftz_f | |
| 12013 | .{ .tag = @enumFromInt(3421), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12014 | // __nvvm_sad_i | |
| 12015 | .{ .tag = @enumFromInt(3422), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12016 | // __nvvm_sad_ui | |
| 12017 | .{ .tag = @enumFromInt(3423), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12018 | // __nvvm_saturate_d | |
| 12019 | .{ .tag = @enumFromInt(3424), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12020 | // __nvvm_saturate_f | |
| 12021 | .{ .tag = @enumFromInt(3425), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12022 | // __nvvm_saturate_ftz_f | |
| 12023 | .{ .tag = @enumFromInt(3426), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12024 | // __nvvm_shfl_bfly_f32 | |
| 12025 | .{ .tag = @enumFromInt(3427), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12026 | // __nvvm_shfl_bfly_i32 | |
| 12027 | .{ .tag = @enumFromInt(3428), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12028 | // __nvvm_shfl_down_f32 | |
| 12029 | .{ .tag = @enumFromInt(3429), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12030 | // __nvvm_shfl_down_i32 | |
| 12031 | .{ .tag = @enumFromInt(3430), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12032 | // __nvvm_shfl_idx_f32 | |
| 12033 | .{ .tag = @enumFromInt(3431), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12034 | // __nvvm_shfl_idx_i32 | |
| 12035 | .{ .tag = @enumFromInt(3432), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12036 | // __nvvm_shfl_up_f32 | |
| 12037 | .{ .tag = @enumFromInt(3433), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12038 | // __nvvm_shfl_up_i32 | |
| 12039 | .{ .tag = @enumFromInt(3434), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12040 | // __nvvm_sin_approx_f | |
| 12041 | .{ .tag = @enumFromInt(3435), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12042 | // __nvvm_sin_approx_ftz_f | |
| 12043 | .{ .tag = @enumFromInt(3436), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12044 | // __nvvm_sqrt_approx_f | |
| 12045 | .{ .tag = @enumFromInt(3437), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12046 | // __nvvm_sqrt_approx_ftz_f | |
| 12047 | .{ .tag = @enumFromInt(3438), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12048 | // __nvvm_sqrt_rm_d | |
| 12049 | .{ .tag = @enumFromInt(3439), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12050 | // __nvvm_sqrt_rm_f | |
| 12051 | .{ .tag = @enumFromInt(3440), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12052 | // __nvvm_sqrt_rm_ftz_f | |
| 12053 | .{ .tag = @enumFromInt(3441), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12054 | // __nvvm_sqrt_rn_d | |
| 12055 | .{ .tag = @enumFromInt(3442), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12056 | // __nvvm_sqrt_rn_f | |
| 12057 | .{ .tag = @enumFromInt(3443), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12058 | // __nvvm_sqrt_rn_ftz_f | |
| 12059 | .{ .tag = @enumFromInt(3444), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12060 | // __nvvm_sqrt_rp_d | |
| 12061 | .{ .tag = @enumFromInt(3445), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12062 | // __nvvm_sqrt_rp_f | |
| 12063 | .{ .tag = @enumFromInt(3446), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12064 | // __nvvm_sqrt_rp_ftz_f | |
| 12065 | .{ .tag = @enumFromInt(3447), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12066 | // __nvvm_sqrt_rz_d | |
| 12067 | .{ .tag = @enumFromInt(3448), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12068 | // __nvvm_sqrt_rz_f | |
| 12069 | .{ .tag = @enumFromInt(3449), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12070 | // __nvvm_sqrt_rz_ftz_f | |
| 12071 | .{ .tag = @enumFromInt(3450), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12072 | // __nvvm_trunc_d | |
| 12073 | .{ .tag = @enumFromInt(3451), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12074 | // __nvvm_trunc_f | |
| 12075 | .{ .tag = @enumFromInt(3452), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12076 | // __nvvm_trunc_ftz_f | |
| 12077 | .{ .tag = @enumFromInt(3453), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12078 | // __nvvm_ui2d_rm | |
| 12079 | .{ .tag = @enumFromInt(3454), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12080 | // __nvvm_ui2d_rn | |
| 12081 | .{ .tag = @enumFromInt(3455), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12082 | // __nvvm_ui2d_rp | |
| 12083 | .{ .tag = @enumFromInt(3456), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12084 | // __nvvm_ui2d_rz | |
| 12085 | .{ .tag = @enumFromInt(3457), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12086 | // __nvvm_ui2f_rm | |
| 12087 | .{ .tag = @enumFromInt(3458), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12088 | // __nvvm_ui2f_rn | |
| 12089 | .{ .tag = @enumFromInt(3459), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12090 | // __nvvm_ui2f_rp | |
| 12091 | .{ .tag = @enumFromInt(3460), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12092 | // __nvvm_ui2f_rz | |
| 12093 | .{ .tag = @enumFromInt(3461), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12094 | // __nvvm_ull2d_rm | |
| 12095 | .{ .tag = @enumFromInt(3462), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12096 | // __nvvm_ull2d_rn | |
| 12097 | .{ .tag = @enumFromInt(3463), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12098 | // __nvvm_ull2d_rp | |
| 12099 | .{ .tag = @enumFromInt(3464), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12100 | // __nvvm_ull2d_rz | |
| 12101 | .{ .tag = @enumFromInt(3465), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12102 | // __nvvm_ull2f_rm | |
| 12103 | .{ .tag = @enumFromInt(3466), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12104 | // __nvvm_ull2f_rn | |
| 12105 | .{ .tag = @enumFromInt(3467), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12106 | // __nvvm_ull2f_rp | |
| 12107 | .{ .tag = @enumFromInt(3468), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12108 | // __nvvm_ull2f_rz | |
| 12109 | .{ .tag = @enumFromInt(3469), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12110 | // __nvvm_vote_all | |
| 12111 | .{ .tag = @enumFromInt(3470), .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12112 | // __nvvm_vote_any | |
| 12113 | .{ .tag = @enumFromInt(3471), .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12114 | // __nvvm_vote_ballot | |
| 12115 | .{ .tag = @enumFromInt(3472), .properties = .{ .param_str = "Uib", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12116 | // __nvvm_vote_uni | |
| 12117 | .{ .tag = @enumFromInt(3473), .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12118 | // __popcnt | |
| 12119 | .{ .tag = @enumFromInt(3474), .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12120 | // __popcnt16 | |
| 12121 | .{ .tag = @enumFromInt(3475), .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12122 | // __popcnt64 | |
| 12123 | .{ .tag = @enumFromInt(3476), .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12124 | // __rdtsc | |
| 12125 | .{ .tag = @enumFromInt(3477), .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, | |
| 12126 | // __sev | |
| 12127 | .{ .tag = @enumFromInt(3478), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12128 | // __sevl | |
| 12129 | .{ .tag = @enumFromInt(3479), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12130 | // __sigsetjmp | |
| 12131 | .{ .tag = @enumFromInt(3480), .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12132 | // __sinpi | |
| 12133 | .{ .tag = @enumFromInt(3481), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12134 | // __sinpif | |
| 12135 | .{ .tag = @enumFromInt(3482), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12136 | // __sync_add_and_fetch | |
| 12137 | .{ .tag = @enumFromInt(3483), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12138 | // __sync_add_and_fetch_1 | |
| 12139 | .{ .tag = @enumFromInt(3484), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12140 | // __sync_add_and_fetch_16 | |
| 12141 | .{ .tag = @enumFromInt(3485), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12142 | // __sync_add_and_fetch_2 | |
| 12143 | .{ .tag = @enumFromInt(3486), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12144 | // __sync_add_and_fetch_4 | |
| 12145 | .{ .tag = @enumFromInt(3487), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12146 | // __sync_add_and_fetch_8 | |
| 12147 | .{ .tag = @enumFromInt(3488), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12148 | // __sync_and_and_fetch | |
| 12149 | .{ .tag = @enumFromInt(3489), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12150 | // __sync_and_and_fetch_1 | |
| 12151 | .{ .tag = @enumFromInt(3490), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12152 | // __sync_and_and_fetch_16 | |
| 12153 | .{ .tag = @enumFromInt(3491), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12154 | // __sync_and_and_fetch_2 | |
| 12155 | .{ .tag = @enumFromInt(3492), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12156 | // __sync_and_and_fetch_4 | |
| 12157 | .{ .tag = @enumFromInt(3493), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12158 | // __sync_and_and_fetch_8 | |
| 12159 | .{ .tag = @enumFromInt(3494), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12160 | // __sync_bool_compare_and_swap | |
| 12161 | .{ .tag = @enumFromInt(3495), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12162 | // __sync_bool_compare_and_swap_1 | |
| 12163 | .{ .tag = @enumFromInt(3496), .properties = .{ .param_str = "bcD*cc.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12164 | // __sync_bool_compare_and_swap_16 | |
| 12165 | .{ .tag = @enumFromInt(3497), .properties = .{ .param_str = "bLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12166 | // __sync_bool_compare_and_swap_2 | |
| 12167 | .{ .tag = @enumFromInt(3498), .properties = .{ .param_str = "bsD*ss.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12168 | // __sync_bool_compare_and_swap_4 | |
| 12169 | .{ .tag = @enumFromInt(3499), .properties = .{ .param_str = "biD*ii.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12170 | // __sync_bool_compare_and_swap_8 | |
| 12171 | .{ .tag = @enumFromInt(3500), .properties = .{ .param_str = "bLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12172 | // __sync_fetch_and_add | |
| 12173 | .{ .tag = @enumFromInt(3501), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12174 | // __sync_fetch_and_add_1 | |
| 12175 | .{ .tag = @enumFromInt(3502), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12176 | // __sync_fetch_and_add_16 | |
| 12177 | .{ .tag = @enumFromInt(3503), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12178 | // __sync_fetch_and_add_2 | |
| 12179 | .{ .tag = @enumFromInt(3504), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12180 | // __sync_fetch_and_add_4 | |
| 12181 | .{ .tag = @enumFromInt(3505), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12182 | // __sync_fetch_and_add_8 | |
| 12183 | .{ .tag = @enumFromInt(3506), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12184 | // __sync_fetch_and_and | |
| 12185 | .{ .tag = @enumFromInt(3507), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12186 | // __sync_fetch_and_and_1 | |
| 12187 | .{ .tag = @enumFromInt(3508), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12188 | // __sync_fetch_and_and_16 | |
| 12189 | .{ .tag = @enumFromInt(3509), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12190 | // __sync_fetch_and_and_2 | |
| 12191 | .{ .tag = @enumFromInt(3510), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12192 | // __sync_fetch_and_and_4 | |
| 12193 | .{ .tag = @enumFromInt(3511), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12194 | // __sync_fetch_and_and_8 | |
| 12195 | .{ .tag = @enumFromInt(3512), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12196 | // __sync_fetch_and_max | |
| 12197 | .{ .tag = @enumFromInt(3513), .properties = .{ .param_str = "iiD*i" } }, | |
| 12198 | // __sync_fetch_and_min | |
| 12199 | .{ .tag = @enumFromInt(3514), .properties = .{ .param_str = "iiD*i" } }, | |
| 12200 | // __sync_fetch_and_nand | |
| 12201 | .{ .tag = @enumFromInt(3515), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12202 | // __sync_fetch_and_nand_1 | |
| 12203 | .{ .tag = @enumFromInt(3516), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12204 | // __sync_fetch_and_nand_16 | |
| 12205 | .{ .tag = @enumFromInt(3517), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12206 | // __sync_fetch_and_nand_2 | |
| 12207 | .{ .tag = @enumFromInt(3518), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12208 | // __sync_fetch_and_nand_4 | |
| 12209 | .{ .tag = @enumFromInt(3519), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12210 | // __sync_fetch_and_nand_8 | |
| 12211 | .{ .tag = @enumFromInt(3520), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12212 | // __sync_fetch_and_or | |
| 12213 | .{ .tag = @enumFromInt(3521), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12214 | // __sync_fetch_and_or_1 | |
| 12215 | .{ .tag = @enumFromInt(3522), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12216 | // __sync_fetch_and_or_16 | |
| 12217 | .{ .tag = @enumFromInt(3523), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12218 | // __sync_fetch_and_or_2 | |
| 12219 | .{ .tag = @enumFromInt(3524), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12220 | // __sync_fetch_and_or_4 | |
| 12221 | .{ .tag = @enumFromInt(3525), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12222 | // __sync_fetch_and_or_8 | |
| 12223 | .{ .tag = @enumFromInt(3526), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12224 | // __sync_fetch_and_sub | |
| 12225 | .{ .tag = @enumFromInt(3527), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12226 | // __sync_fetch_and_sub_1 | |
| 12227 | .{ .tag = @enumFromInt(3528), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12228 | // __sync_fetch_and_sub_16 | |
| 12229 | .{ .tag = @enumFromInt(3529), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12230 | // __sync_fetch_and_sub_2 | |
| 12231 | .{ .tag = @enumFromInt(3530), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12232 | // __sync_fetch_and_sub_4 | |
| 12233 | .{ .tag = @enumFromInt(3531), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12234 | // __sync_fetch_and_sub_8 | |
| 12235 | .{ .tag = @enumFromInt(3532), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12236 | // __sync_fetch_and_umax | |
| 12237 | .{ .tag = @enumFromInt(3533), .properties = .{ .param_str = "UiUiD*Ui" } }, | |
| 12238 | // __sync_fetch_and_umin | |
| 12239 | .{ .tag = @enumFromInt(3534), .properties = .{ .param_str = "UiUiD*Ui" } }, | |
| 12240 | // __sync_fetch_and_xor | |
| 12241 | .{ .tag = @enumFromInt(3535), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12242 | // __sync_fetch_and_xor_1 | |
| 12243 | .{ .tag = @enumFromInt(3536), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12244 | // __sync_fetch_and_xor_16 | |
| 12245 | .{ .tag = @enumFromInt(3537), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12246 | // __sync_fetch_and_xor_2 | |
| 12247 | .{ .tag = @enumFromInt(3538), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12248 | // __sync_fetch_and_xor_4 | |
| 12249 | .{ .tag = @enumFromInt(3539), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12250 | // __sync_fetch_and_xor_8 | |
| 12251 | .{ .tag = @enumFromInt(3540), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12252 | // __sync_lock_release | |
| 12253 | .{ .tag = @enumFromInt(3541), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12254 | // __sync_lock_release_1 | |
| 12255 | .{ .tag = @enumFromInt(3542), .properties = .{ .param_str = "vcD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12256 | // __sync_lock_release_16 | |
| 12257 | .{ .tag = @enumFromInt(3543), .properties = .{ .param_str = "vLLLiD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12258 | // __sync_lock_release_2 | |
| 12259 | .{ .tag = @enumFromInt(3544), .properties = .{ .param_str = "vsD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12260 | // __sync_lock_release_4 | |
| 12261 | .{ .tag = @enumFromInt(3545), .properties = .{ .param_str = "viD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12262 | // __sync_lock_release_8 | |
| 12263 | .{ .tag = @enumFromInt(3546), .properties = .{ .param_str = "vLLiD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12264 | // __sync_lock_test_and_set | |
| 12265 | .{ .tag = @enumFromInt(3547), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12266 | // __sync_lock_test_and_set_1 | |
| 12267 | .{ .tag = @enumFromInt(3548), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12268 | // __sync_lock_test_and_set_16 | |
| 12269 | .{ .tag = @enumFromInt(3549), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12270 | // __sync_lock_test_and_set_2 | |
| 12271 | .{ .tag = @enumFromInt(3550), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12272 | // __sync_lock_test_and_set_4 | |
| 12273 | .{ .tag = @enumFromInt(3551), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12274 | // __sync_lock_test_and_set_8 | |
| 12275 | .{ .tag = @enumFromInt(3552), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12276 | // __sync_nand_and_fetch | |
| 12277 | .{ .tag = @enumFromInt(3553), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12278 | // __sync_nand_and_fetch_1 | |
| 12279 | .{ .tag = @enumFromInt(3554), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12280 | // __sync_nand_and_fetch_16 | |
| 12281 | .{ .tag = @enumFromInt(3555), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12282 | // __sync_nand_and_fetch_2 | |
| 12283 | .{ .tag = @enumFromInt(3556), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12284 | // __sync_nand_and_fetch_4 | |
| 12285 | .{ .tag = @enumFromInt(3557), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12286 | // __sync_nand_and_fetch_8 | |
| 12287 | .{ .tag = @enumFromInt(3558), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12288 | // __sync_or_and_fetch | |
| 12289 | .{ .tag = @enumFromInt(3559), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12290 | // __sync_or_and_fetch_1 | |
| 12291 | .{ .tag = @enumFromInt(3560), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12292 | // __sync_or_and_fetch_16 | |
| 12293 | .{ .tag = @enumFromInt(3561), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12294 | // __sync_or_and_fetch_2 | |
| 12295 | .{ .tag = @enumFromInt(3562), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12296 | // __sync_or_and_fetch_4 | |
| 12297 | .{ .tag = @enumFromInt(3563), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12298 | // __sync_or_and_fetch_8 | |
| 12299 | .{ .tag = @enumFromInt(3564), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12300 | // __sync_sub_and_fetch | |
| 12301 | .{ .tag = @enumFromInt(3565), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12302 | // __sync_sub_and_fetch_1 | |
| 12303 | .{ .tag = @enumFromInt(3566), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12304 | // __sync_sub_and_fetch_16 | |
| 12305 | .{ .tag = @enumFromInt(3567), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12306 | // __sync_sub_and_fetch_2 | |
| 12307 | .{ .tag = @enumFromInt(3568), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12308 | // __sync_sub_and_fetch_4 | |
| 12309 | .{ .tag = @enumFromInt(3569), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12310 | // __sync_sub_and_fetch_8 | |
| 12311 | .{ .tag = @enumFromInt(3570), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12312 | // __sync_swap | |
| 12313 | .{ .tag = @enumFromInt(3571), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12314 | // __sync_swap_1 | |
| 12315 | .{ .tag = @enumFromInt(3572), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12316 | // __sync_swap_16 | |
| 12317 | .{ .tag = @enumFromInt(3573), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12318 | // __sync_swap_2 | |
| 12319 | .{ .tag = @enumFromInt(3574), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12320 | // __sync_swap_4 | |
| 12321 | .{ .tag = @enumFromInt(3575), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12322 | // __sync_swap_8 | |
| 12323 | .{ .tag = @enumFromInt(3576), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12324 | // __sync_synchronize | |
| 12325 | .{ .tag = @enumFromInt(3577), .properties = .{ .param_str = "v" } }, | |
| 12326 | // __sync_val_compare_and_swap | |
| 12327 | .{ .tag = @enumFromInt(3578), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12328 | // __sync_val_compare_and_swap_1 | |
| 12329 | .{ .tag = @enumFromInt(3579), .properties = .{ .param_str = "ccD*cc.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12330 | // __sync_val_compare_and_swap_16 | |
| 12331 | .{ .tag = @enumFromInt(3580), .properties = .{ .param_str = "LLLiLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12332 | // __sync_val_compare_and_swap_2 | |
| 12333 | .{ .tag = @enumFromInt(3581), .properties = .{ .param_str = "ssD*ss.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12334 | // __sync_val_compare_and_swap_4 | |
| 12335 | .{ .tag = @enumFromInt(3582), .properties = .{ .param_str = "iiD*ii.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12336 | // __sync_val_compare_and_swap_8 | |
| 12337 | .{ .tag = @enumFromInt(3583), .properties = .{ .param_str = "LLiLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12338 | // __sync_xor_and_fetch | |
| 12339 | .{ .tag = @enumFromInt(3584), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12340 | // __sync_xor_and_fetch_1 | |
| 12341 | .{ .tag = @enumFromInt(3585), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12342 | // __sync_xor_and_fetch_16 | |
| 12343 | .{ .tag = @enumFromInt(3586), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12344 | // __sync_xor_and_fetch_2 | |
| 12345 | .{ .tag = @enumFromInt(3587), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12346 | // __sync_xor_and_fetch_4 | |
| 12347 | .{ .tag = @enumFromInt(3588), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12348 | // __sync_xor_and_fetch_8 | |
| 12349 | .{ .tag = @enumFromInt(3589), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12350 | // __syncthreads | |
| 12351 | .{ .tag = @enumFromInt(3590), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12352 | // __tanpi | |
| 12353 | .{ .tag = @enumFromInt(3591), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12354 | // __tanpif | |
| 12355 | .{ .tag = @enumFromInt(3592), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12356 | // __va_start | |
| 12357 | .{ .tag = @enumFromInt(3593), .properties = .{ .param_str = "vc**.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true } } }, | |
| 12358 | // __warn_memset_zero_len | |
| 12359 | .{ .tag = @enumFromInt(3594), .properties = .{ .param_str = "v", .attributes = .{ .pure = true } } }, | |
| 12360 | // __wfe | |
| 12361 | .{ .tag = @enumFromInt(3595), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12362 | // __wfi | |
| 12363 | .{ .tag = @enumFromInt(3596), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12364 | // __xray_customevent | |
| 12365 | .{ .tag = @enumFromInt(3597), .properties = .{ .param_str = "vcC*z" } }, | |
| 12366 | // __xray_typedevent | |
| 12367 | .{ .tag = @enumFromInt(3598), .properties = .{ .param_str = "vzcC*z" } }, | |
| 12368 | // __yield | |
| 12369 | .{ .tag = @enumFromInt(3599), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12370 | // _abnormal_termination | |
| 12371 | .{ .tag = @enumFromInt(3600), .properties = .{ .param_str = "i", .language = .all_ms_languages } }, | |
| 12372 | // _alloca | |
| 12373 | .{ .tag = @enumFromInt(3601), .properties = .{ .param_str = "v*z", .language = .all_ms_languages } }, | |
| 12374 | // _bittest | |
| 12375 | .{ .tag = @enumFromInt(3602), .properties = .{ .param_str = "UcNiC*Ni", .language = .all_ms_languages } }, | |
| 12376 | // _bittest64 | |
| 12377 | .{ .tag = @enumFromInt(3603), .properties = .{ .param_str = "UcWiC*Wi", .language = .all_ms_languages } }, | |
| 12378 | // _bittestandcomplement | |
| 12379 | .{ .tag = @enumFromInt(3604), .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, | |
| 12380 | // _bittestandcomplement64 | |
| 12381 | .{ .tag = @enumFromInt(3605), .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, | |
| 12382 | // _bittestandreset | |
| 12383 | .{ .tag = @enumFromInt(3606), .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, | |
| 12384 | // _bittestandreset64 | |
| 12385 | .{ .tag = @enumFromInt(3607), .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, | |
| 12386 | // _bittestandset | |
| 12387 | .{ .tag = @enumFromInt(3608), .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, | |
| 12388 | // _bittestandset64 | |
| 12389 | .{ .tag = @enumFromInt(3609), .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, | |
| 12390 | // _byteswap_uint64 | |
| 12391 | .{ .tag = @enumFromInt(3610), .properties = .{ .param_str = "ULLiULLi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12392 | // _byteswap_ulong | |
| 12393 | .{ .tag = @enumFromInt(3611), .properties = .{ .param_str = "UNiUNi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12394 | // _byteswap_ushort | |
| 12395 | .{ .tag = @enumFromInt(3612), .properties = .{ .param_str = "UsUs", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12396 | // _exception_code | |
| 12397 | .{ .tag = @enumFromInt(3613), .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, | |
| 12398 | // _exception_info | |
| 12399 | .{ .tag = @enumFromInt(3614), .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, | |
| 12400 | // _exit | |
| 12401 | .{ .tag = @enumFromInt(3615), .properties = .{ .param_str = "vi", .header = .unistd, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 12402 | // _interlockedbittestandreset | |
| 12403 | .{ .tag = @enumFromInt(3616), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12404 | // _interlockedbittestandreset64 | |
| 12405 | .{ .tag = @enumFromInt(3617), .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, | |
| 12406 | // _interlockedbittestandreset_acq | |
| 12407 | .{ .tag = @enumFromInt(3618), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12408 | // _interlockedbittestandreset_nf | |
| 12409 | .{ .tag = @enumFromInt(3619), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12410 | // _interlockedbittestandreset_rel | |
| 12411 | .{ .tag = @enumFromInt(3620), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12412 | // _interlockedbittestandset | |
| 12413 | .{ .tag = @enumFromInt(3621), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12414 | // _interlockedbittestandset64 | |
| 12415 | .{ .tag = @enumFromInt(3622), .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, | |
| 12416 | // _interlockedbittestandset_acq | |
| 12417 | .{ .tag = @enumFromInt(3623), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12418 | // _interlockedbittestandset_nf | |
| 12419 | .{ .tag = @enumFromInt(3624), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12420 | // _interlockedbittestandset_rel | |
| 12421 | .{ .tag = @enumFromInt(3625), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12422 | // _longjmp | |
| 12423 | .{ .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 } } }, | |
| 12424 | // _lrotl | |
| 12425 | .{ .tag = @enumFromInt(3627), .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12426 | // _lrotr | |
| 12427 | .{ .tag = @enumFromInt(3628), .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12428 | // _rotl | |
| 12429 | .{ .tag = @enumFromInt(3629), .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12430 | // _rotl16 | |
| 12431 | .{ .tag = @enumFromInt(3630), .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12432 | // _rotl64 | |
| 12433 | .{ .tag = @enumFromInt(3631), .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12434 | // _rotl8 | |
| 12435 | .{ .tag = @enumFromInt(3632), .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12436 | // _rotr | |
| 12437 | .{ .tag = @enumFromInt(3633), .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12438 | // _rotr16 | |
| 12439 | .{ .tag = @enumFromInt(3634), .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12440 | // _rotr64 | |
| 12441 | .{ .tag = @enumFromInt(3635), .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12442 | // _rotr8 | |
| 12443 | .{ .tag = @enumFromInt(3636), .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12444 | // _setjmp | |
| 12445 | .{ .tag = @enumFromInt(3637), .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12446 | // _setjmpex | |
| 12447 | .{ .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 } } }, | |
| 12448 | // abort | |
| 12449 | .{ .tag = @enumFromInt(3639), .properties = .{ .param_str = "v", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 12450 | // abs | |
| 12451 | .{ .tag = @enumFromInt(3640), .properties = .{ .param_str = "ii", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12452 | // acos | |
| 12453 | .{ .tag = @enumFromInt(3641), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12454 | // acosf | |
| 12455 | .{ .tag = @enumFromInt(3642), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12456 | // acosh | |
| 12457 | .{ .tag = @enumFromInt(3643), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12458 | // acoshf | |
| 12459 | .{ .tag = @enumFromInt(3644), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12460 | // acoshl | |
| 12461 | .{ .tag = @enumFromInt(3645), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12462 | // acosl | |
| 12463 | .{ .tag = @enumFromInt(3646), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12464 | // aligned_alloc | |
| 12465 | .{ .tag = @enumFromInt(3647), .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12466 | // alloca | |
| 12467 | .{ .tag = @enumFromInt(3648), .properties = .{ .param_str = "v*z", .header = .stdlib, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12468 | // asin | |
| 12469 | .{ .tag = @enumFromInt(3649), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12470 | // asinf | |
| 12471 | .{ .tag = @enumFromInt(3650), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12472 | // asinh | |
| 12473 | .{ .tag = @enumFromInt(3651), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12474 | // asinhf | |
| 12475 | .{ .tag = @enumFromInt(3652), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12476 | // asinhl | |
| 12477 | .{ .tag = @enumFromInt(3653), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12478 | // asinl | |
| 12479 | .{ .tag = @enumFromInt(3654), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12480 | // atan | |
| 12481 | .{ .tag = @enumFromInt(3655), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12482 | // atan2 | |
| 12483 | .{ .tag = @enumFromInt(3656), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12484 | // atan2f | |
| 12485 | .{ .tag = @enumFromInt(3657), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12486 | // atan2l | |
| 12487 | .{ .tag = @enumFromInt(3658), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12488 | // atanf | |
| 12489 | .{ .tag = @enumFromInt(3659), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12490 | // atanh | |
| 12491 | .{ .tag = @enumFromInt(3660), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12492 | // atanhf | |
| 12493 | .{ .tag = @enumFromInt(3661), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12494 | // atanhl | |
| 12495 | .{ .tag = @enumFromInt(3662), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12496 | // atanl | |
| 12497 | .{ .tag = @enumFromInt(3663), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12498 | // bcmp | |
| 12499 | .{ .tag = @enumFromInt(3664), .properties = .{ .param_str = "ivC*vC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 12500 | // bcopy | |
| 12501 | .{ .tag = @enumFromInt(3665), .properties = .{ .param_str = "vvC*v*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12502 | // bzero | |
| 12503 | .{ .tag = @enumFromInt(3666), .properties = .{ .param_str = "vv*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12504 | // cabs | |
| 12505 | .{ .tag = @enumFromInt(3667), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12506 | // cabsf | |
| 12507 | .{ .tag = @enumFromInt(3668), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12508 | // cabsl | |
| 12509 | .{ .tag = @enumFromInt(3669), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12510 | // cacos | |
| 12511 | .{ .tag = @enumFromInt(3670), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12512 | // cacosf | |
| 12513 | .{ .tag = @enumFromInt(3671), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12514 | // cacosh | |
| 12515 | .{ .tag = @enumFromInt(3672), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12516 | // cacoshf | |
| 12517 | .{ .tag = @enumFromInt(3673), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12518 | // cacoshl | |
| 12519 | .{ .tag = @enumFromInt(3674), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12520 | // cacosl | |
| 12521 | .{ .tag = @enumFromInt(3675), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12522 | // calloc | |
| 12523 | .{ .tag = @enumFromInt(3676), .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12524 | // carg | |
| 12525 | .{ .tag = @enumFromInt(3677), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12526 | // cargf | |
| 12527 | .{ .tag = @enumFromInt(3678), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12528 | // cargl | |
| 12529 | .{ .tag = @enumFromInt(3679), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12530 | // casin | |
| 12531 | .{ .tag = @enumFromInt(3680), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12532 | // casinf | |
| 12533 | .{ .tag = @enumFromInt(3681), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12534 | // casinh | |
| 12535 | .{ .tag = @enumFromInt(3682), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12536 | // casinhf | |
| 12537 | .{ .tag = @enumFromInt(3683), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12538 | // casinhl | |
| 12539 | .{ .tag = @enumFromInt(3684), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12540 | // casinl | |
| 12541 | .{ .tag = @enumFromInt(3685), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12542 | // catan | |
| 12543 | .{ .tag = @enumFromInt(3686), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12544 | // catanf | |
| 12545 | .{ .tag = @enumFromInt(3687), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12546 | // catanh | |
| 12547 | .{ .tag = @enumFromInt(3688), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12548 | // catanhf | |
| 12549 | .{ .tag = @enumFromInt(3689), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12550 | // catanhl | |
| 12551 | .{ .tag = @enumFromInt(3690), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12552 | // catanl | |
| 12553 | .{ .tag = @enumFromInt(3691), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12554 | // cbrt | |
| 12555 | .{ .tag = @enumFromInt(3692), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12556 | // cbrtf | |
| 12557 | .{ .tag = @enumFromInt(3693), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12558 | // cbrtl | |
| 12559 | .{ .tag = @enumFromInt(3694), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12560 | // ccos | |
| 12561 | .{ .tag = @enumFromInt(3695), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12562 | // ccosf | |
| 12563 | .{ .tag = @enumFromInt(3696), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12564 | // ccosh | |
| 12565 | .{ .tag = @enumFromInt(3697), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12566 | // ccoshf | |
| 12567 | .{ .tag = @enumFromInt(3698), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12568 | // ccoshl | |
| 12569 | .{ .tag = @enumFromInt(3699), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12570 | // ccosl | |
| 12571 | .{ .tag = @enumFromInt(3700), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12572 | // ceil | |
| 12573 | .{ .tag = @enumFromInt(3701), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12574 | // ceilf | |
| 12575 | .{ .tag = @enumFromInt(3702), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12576 | // ceill | |
| 12577 | .{ .tag = @enumFromInt(3703), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12578 | // cexp | |
| 12579 | .{ .tag = @enumFromInt(3704), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12580 | // cexpf | |
| 12581 | .{ .tag = @enumFromInt(3705), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12582 | // cexpl | |
| 12583 | .{ .tag = @enumFromInt(3706), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12584 | // cimag | |
| 12585 | .{ .tag = @enumFromInt(3707), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12586 | // cimagf | |
| 12587 | .{ .tag = @enumFromInt(3708), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12588 | // cimagl | |
| 12589 | .{ .tag = @enumFromInt(3709), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12590 | // clog | |
| 12591 | .{ .tag = @enumFromInt(3710), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12592 | // clogf | |
| 12593 | .{ .tag = @enumFromInt(3711), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12594 | // clogl | |
| 12595 | .{ .tag = @enumFromInt(3712), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12596 | // conj | |
| 12597 | .{ .tag = @enumFromInt(3713), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12598 | // conjf | |
| 12599 | .{ .tag = @enumFromInt(3714), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12600 | // conjl | |
| 12601 | .{ .tag = @enumFromInt(3715), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12602 | // copysign | |
| 12603 | .{ .tag = @enumFromInt(3716), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12604 | // copysignf | |
| 12605 | .{ .tag = @enumFromInt(3717), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12606 | // copysignl | |
| 12607 | .{ .tag = @enumFromInt(3718), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12608 | // cos | |
| 12609 | .{ .tag = @enumFromInt(3719), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12610 | // cosf | |
| 12611 | .{ .tag = @enumFromInt(3720), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12612 | // cosh | |
| 12613 | .{ .tag = @enumFromInt(3721), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12614 | // coshf | |
| 12615 | .{ .tag = @enumFromInt(3722), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12616 | // coshl | |
| 12617 | .{ .tag = @enumFromInt(3723), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12618 | // cosl | |
| 12619 | .{ .tag = @enumFromInt(3724), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12620 | // cpow | |
| 12621 | .{ .tag = @enumFromInt(3725), .properties = .{ .param_str = "XdXdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12622 | // cpowf | |
| 12623 | .{ .tag = @enumFromInt(3726), .properties = .{ .param_str = "XfXfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12624 | // cpowl | |
| 12625 | .{ .tag = @enumFromInt(3727), .properties = .{ .param_str = "XLdXLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12626 | // cproj | |
| 12627 | .{ .tag = @enumFromInt(3728), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12628 | // cprojf | |
| 12629 | .{ .tag = @enumFromInt(3729), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12630 | // cprojl | |
| 12631 | .{ .tag = @enumFromInt(3730), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12632 | // creal | |
| 12633 | .{ .tag = @enumFromInt(3731), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12634 | // crealf | |
| 12635 | .{ .tag = @enumFromInt(3732), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12636 | // creall | |
| 12637 | .{ .tag = @enumFromInt(3733), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12638 | // csin | |
| 12639 | .{ .tag = @enumFromInt(3734), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12640 | // csinf | |
| 12641 | .{ .tag = @enumFromInt(3735), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12642 | // csinh | |
| 12643 | .{ .tag = @enumFromInt(3736), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12644 | // csinhf | |
| 12645 | .{ .tag = @enumFromInt(3737), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12646 | // csinhl | |
| 12647 | .{ .tag = @enumFromInt(3738), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12648 | // csinl | |
| 12649 | .{ .tag = @enumFromInt(3739), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12650 | // csqrt | |
| 12651 | .{ .tag = @enumFromInt(3740), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12652 | // csqrtf | |
| 12653 | .{ .tag = @enumFromInt(3741), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12654 | // csqrtl | |
| 12655 | .{ .tag = @enumFromInt(3742), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12656 | // ctan | |
| 12657 | .{ .tag = @enumFromInt(3743), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12658 | // ctanf | |
| 12659 | .{ .tag = @enumFromInt(3744), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12660 | // ctanh | |
| 12661 | .{ .tag = @enumFromInt(3745), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12662 | // ctanhf | |
| 12663 | .{ .tag = @enumFromInt(3746), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12664 | // ctanhl | |
| 12665 | .{ .tag = @enumFromInt(3747), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12666 | // ctanl | |
| 12667 | .{ .tag = @enumFromInt(3748), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12668 | // erf | |
| 12669 | .{ .tag = @enumFromInt(3749), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12670 | // erfc | |
| 12671 | .{ .tag = @enumFromInt(3750), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12672 | // erfcf | |
| 12673 | .{ .tag = @enumFromInt(3751), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12674 | // erfcl | |
| 12675 | .{ .tag = @enumFromInt(3752), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12676 | // erff | |
| 12677 | .{ .tag = @enumFromInt(3753), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12678 | // erfl | |
| 12679 | .{ .tag = @enumFromInt(3754), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12680 | // exit | |
| 12681 | .{ .tag = @enumFromInt(3755), .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 12682 | // exp | |
| 12683 | .{ .tag = @enumFromInt(3756), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12684 | // exp2 | |
| 12685 | .{ .tag = @enumFromInt(3757), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12686 | // exp2f | |
| 12687 | .{ .tag = @enumFromInt(3758), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12688 | // exp2l | |
| 12689 | .{ .tag = @enumFromInt(3759), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12690 | // expf | |
| 12691 | .{ .tag = @enumFromInt(3760), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12692 | // expl | |
| 12693 | .{ .tag = @enumFromInt(3761), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12694 | // expm1 | |
| 12695 | .{ .tag = @enumFromInt(3762), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12696 | // expm1f | |
| 12697 | .{ .tag = @enumFromInt(3763), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12698 | // expm1l | |
| 12699 | .{ .tag = @enumFromInt(3764), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12700 | // fabs | |
| 12701 | .{ .tag = @enumFromInt(3765), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12702 | // fabsf | |
| 12703 | .{ .tag = @enumFromInt(3766), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12704 | // fabsl | |
| 12705 | .{ .tag = @enumFromInt(3767), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12706 | // fdim | |
| 12707 | .{ .tag = @enumFromInt(3768), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12708 | // fdimf | |
| 12709 | .{ .tag = @enumFromInt(3769), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12710 | // fdiml | |
| 12711 | .{ .tag = @enumFromInt(3770), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12712 | // finite | |
| 12713 | .{ .tag = @enumFromInt(3771), .properties = .{ .param_str = "id", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12714 | // finitef | |
| 12715 | .{ .tag = @enumFromInt(3772), .properties = .{ .param_str = "if", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12716 | // finitel | |
| 12717 | .{ .tag = @enumFromInt(3773), .properties = .{ .param_str = "iLd", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12718 | // floor | |
| 12719 | .{ .tag = @enumFromInt(3774), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12720 | // floorf | |
| 12721 | .{ .tag = @enumFromInt(3775), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12722 | // floorl | |
| 12723 | .{ .tag = @enumFromInt(3776), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12724 | // fma | |
| 12725 | .{ .tag = @enumFromInt(3777), .properties = .{ .param_str = "dddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12726 | // fmaf | |
| 12727 | .{ .tag = @enumFromInt(3778), .properties = .{ .param_str = "ffff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12728 | // fmal | |
| 12729 | .{ .tag = @enumFromInt(3779), .properties = .{ .param_str = "LdLdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12730 | // fmax | |
| 12731 | .{ .tag = @enumFromInt(3780), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12732 | // fmaxf | |
| 12733 | .{ .tag = @enumFromInt(3781), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12734 | // fmaxl | |
| 12735 | .{ .tag = @enumFromInt(3782), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12736 | // fmin | |
| 12737 | .{ .tag = @enumFromInt(3783), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12738 | // fminf | |
| 12739 | .{ .tag = @enumFromInt(3784), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12740 | // fminl | |
| 12741 | .{ .tag = @enumFromInt(3785), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12742 | // fmod | |
| 12743 | .{ .tag = @enumFromInt(3786), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12744 | // fmodf | |
| 12745 | .{ .tag = @enumFromInt(3787), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12746 | // fmodl | |
| 12747 | .{ .tag = @enumFromInt(3788), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12748 | // fopen | |
| 12749 | .{ .tag = @enumFromInt(3789), .properties = .{ .param_str = "P*cC*cC*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12750 | // fprintf | |
| 12751 | .{ .tag = @enumFromInt(3790), .properties = .{ .param_str = "iP*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 12752 | // fread | |
| 12753 | .{ .tag = @enumFromInt(3791), .properties = .{ .param_str = "zv*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12754 | // free | |
| 12755 | .{ .tag = @enumFromInt(3792), .properties = .{ .param_str = "vv*", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12756 | // frexp | |
| 12757 | .{ .tag = @enumFromInt(3793), .properties = .{ .param_str = "ddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12758 | // frexpf | |
| 12759 | .{ .tag = @enumFromInt(3794), .properties = .{ .param_str = "ffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12760 | // frexpl | |
| 12761 | .{ .tag = @enumFromInt(3795), .properties = .{ .param_str = "LdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12762 | // fscanf | |
| 12763 | .{ .tag = @enumFromInt(3796), .properties = .{ .param_str = "iP*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 12764 | // fwrite | |
| 12765 | .{ .tag = @enumFromInt(3797), .properties = .{ .param_str = "zvC*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12766 | // getcontext | |
| 12767 | .{ .tag = @enumFromInt(3798), .properties = .{ .param_str = "iK*", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12768 | // hypot | |
| 12769 | .{ .tag = @enumFromInt(3799), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12770 | // hypotf | |
| 12771 | .{ .tag = @enumFromInt(3800), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12772 | // hypotl | |
| 12773 | .{ .tag = @enumFromInt(3801), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12774 | // ilogb | |
| 12775 | .{ .tag = @enumFromInt(3802), .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12776 | // ilogbf | |
| 12777 | .{ .tag = @enumFromInt(3803), .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12778 | // ilogbl | |
| 12779 | .{ .tag = @enumFromInt(3804), .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12780 | // index | |
| 12781 | .{ .tag = @enumFromInt(3805), .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12782 | // isalnum | |
| 12783 | .{ .tag = @enumFromInt(3806), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12784 | // isalpha | |
| 12785 | .{ .tag = @enumFromInt(3807), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12786 | // isblank | |
| 12787 | .{ .tag = @enumFromInt(3808), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12788 | // iscntrl | |
| 12789 | .{ .tag = @enumFromInt(3809), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12790 | // isdigit | |
| 12791 | .{ .tag = @enumFromInt(3810), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12792 | // isgraph | |
| 12793 | .{ .tag = @enumFromInt(3811), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12794 | // islower | |
| 12795 | .{ .tag = @enumFromInt(3812), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12796 | // isprint | |
| 12797 | .{ .tag = @enumFromInt(3813), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12798 | // ispunct | |
| 12799 | .{ .tag = @enumFromInt(3814), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12800 | // isspace | |
| 12801 | .{ .tag = @enumFromInt(3815), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12802 | // isupper | |
| 12803 | .{ .tag = @enumFromInt(3816), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12804 | // isxdigit | |
| 12805 | .{ .tag = @enumFromInt(3817), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12806 | // labs | |
| 12807 | .{ .tag = @enumFromInt(3818), .properties = .{ .param_str = "LiLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12808 | // ldexp | |
| 12809 | .{ .tag = @enumFromInt(3819), .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12810 | // ldexpf | |
| 12811 | .{ .tag = @enumFromInt(3820), .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12812 | // ldexpl | |
| 12813 | .{ .tag = @enumFromInt(3821), .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12814 | // lgamma | |
| 12815 | .{ .tag = @enumFromInt(3822), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12816 | // lgammaf | |
| 12817 | .{ .tag = @enumFromInt(3823), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12818 | // lgammal | |
| 12819 | .{ .tag = @enumFromInt(3824), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12820 | // llabs | |
| 12821 | .{ .tag = @enumFromInt(3825), .properties = .{ .param_str = "LLiLLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12822 | // llrint | |
| 12823 | .{ .tag = @enumFromInt(3826), .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12824 | // llrintf | |
| 12825 | .{ .tag = @enumFromInt(3827), .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12826 | // llrintl | |
| 12827 | .{ .tag = @enumFromInt(3828), .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12828 | // llround | |
| 12829 | .{ .tag = @enumFromInt(3829), .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12830 | // llroundf | |
| 12831 | .{ .tag = @enumFromInt(3830), .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12832 | // llroundl | |
| 12833 | .{ .tag = @enumFromInt(3831), .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12834 | // log | |
| 12835 | .{ .tag = @enumFromInt(3832), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12836 | // log10 | |
| 12837 | .{ .tag = @enumFromInt(3833), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12838 | // log10f | |
| 12839 | .{ .tag = @enumFromInt(3834), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12840 | // log10l | |
| 12841 | .{ .tag = @enumFromInt(3835), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12842 | // log1p | |
| 12843 | .{ .tag = @enumFromInt(3836), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12844 | // log1pf | |
| 12845 | .{ .tag = @enumFromInt(3837), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12846 | // log1pl | |
| 12847 | .{ .tag = @enumFromInt(3838), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12848 | // log2 | |
| 12849 | .{ .tag = @enumFromInt(3839), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12850 | // log2f | |
| 12851 | .{ .tag = @enumFromInt(3840), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12852 | // log2l | |
| 12853 | .{ .tag = @enumFromInt(3841), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12854 | // logb | |
| 12855 | .{ .tag = @enumFromInt(3842), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12856 | // logbf | |
| 12857 | .{ .tag = @enumFromInt(3843), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12858 | // logbl | |
| 12859 | .{ .tag = @enumFromInt(3844), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12860 | // logf | |
| 12861 | .{ .tag = @enumFromInt(3845), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12862 | // logl | |
| 12863 | .{ .tag = @enumFromInt(3846), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12864 | // longjmp | |
| 12865 | .{ .tag = @enumFromInt(3847), .properties = .{ .param_str = "vJi", .header = .setjmp, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, | |
| 12866 | // lrint | |
| 12867 | .{ .tag = @enumFromInt(3848), .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12868 | // lrintf | |
| 12869 | .{ .tag = @enumFromInt(3849), .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12870 | // lrintl | |
| 12871 | .{ .tag = @enumFromInt(3850), .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12872 | // lround | |
| 12873 | .{ .tag = @enumFromInt(3851), .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12874 | // lroundf | |
| 12875 | .{ .tag = @enumFromInt(3852), .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12876 | // lroundl | |
| 12877 | .{ .tag = @enumFromInt(3853), .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12878 | // malloc | |
| 12879 | .{ .tag = @enumFromInt(3854), .properties = .{ .param_str = "v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12880 | // memalign | |
| 12881 | .{ .tag = @enumFromInt(3855), .properties = .{ .param_str = "v*zz", .header = .malloc, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12882 | // memccpy | |
| 12883 | .{ .tag = @enumFromInt(3856), .properties = .{ .param_str = "v*v*vC*iz", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12884 | // memchr | |
| 12885 | .{ .tag = @enumFromInt(3857), .properties = .{ .param_str = "v*vC*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 12886 | // memcmp | |
| 12887 | .{ .tag = @enumFromInt(3858), .properties = .{ .param_str = "ivC*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 12888 | // memcpy | |
| 12889 | .{ .tag = @enumFromInt(3859), .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 12890 | // memmove | |
| 12891 | .{ .tag = @enumFromInt(3860), .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 12892 | // mempcpy | |
| 12893 | .{ .tag = @enumFromInt(3861), .properties = .{ .param_str = "v*v*vC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12894 | // memset | |
| 12895 | .{ .tag = @enumFromInt(3862), .properties = .{ .param_str = "v*v*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12896 | // modf | |
| 12897 | .{ .tag = @enumFromInt(3863), .properties = .{ .param_str = "ddd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12898 | // modff | |
| 12899 | .{ .tag = @enumFromInt(3864), .properties = .{ .param_str = "fff*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12900 | // modfl | |
| 12901 | .{ .tag = @enumFromInt(3865), .properties = .{ .param_str = "LdLdLd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12902 | // nan | |
| 12903 | .{ .tag = @enumFromInt(3866), .properties = .{ .param_str = "dcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12904 | // nanf | |
| 12905 | .{ .tag = @enumFromInt(3867), .properties = .{ .param_str = "fcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12906 | // nanl | |
| 12907 | .{ .tag = @enumFromInt(3868), .properties = .{ .param_str = "LdcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 12908 | // nearbyint | |
| 12909 | .{ .tag = @enumFromInt(3869), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12910 | // nearbyintf | |
| 12911 | .{ .tag = @enumFromInt(3870), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12912 | // nearbyintl | |
| 12913 | .{ .tag = @enumFromInt(3871), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12914 | // nextafter | |
| 12915 | .{ .tag = @enumFromInt(3872), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12916 | // nextafterf | |
| 12917 | .{ .tag = @enumFromInt(3873), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12918 | // nextafterl | |
| 12919 | .{ .tag = @enumFromInt(3874), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12920 | // nexttoward | |
| 12921 | .{ .tag = @enumFromInt(3875), .properties = .{ .param_str = "ddLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12922 | // nexttowardf | |
| 12923 | .{ .tag = @enumFromInt(3876), .properties = .{ .param_str = "ffLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12924 | // nexttowardl | |
| 12925 | .{ .tag = @enumFromInt(3877), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12926 | // pow | |
| 12927 | .{ .tag = @enumFromInt(3878), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12928 | // powf | |
| 12929 | .{ .tag = @enumFromInt(3879), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12930 | // powl | |
| 12931 | .{ .tag = @enumFromInt(3880), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12932 | // printf | |
| 12933 | .{ .tag = @enumFromInt(3881), .properties = .{ .param_str = "icC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf } } }, | |
| 12934 | // realloc | |
| 12935 | .{ .tag = @enumFromInt(3882), .properties = .{ .param_str = "v*v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12936 | // remainder | |
| 12937 | .{ .tag = @enumFromInt(3883), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12938 | // remainderf | |
| 12939 | .{ .tag = @enumFromInt(3884), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12940 | // remainderl | |
| 12941 | .{ .tag = @enumFromInt(3885), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12942 | // remquo | |
| 12943 | .{ .tag = @enumFromInt(3886), .properties = .{ .param_str = "dddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12944 | // remquof | |
| 12945 | .{ .tag = @enumFromInt(3887), .properties = .{ .param_str = "fffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12946 | // remquol | |
| 12947 | .{ .tag = @enumFromInt(3888), .properties = .{ .param_str = "LdLdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12948 | // rindex | |
| 12949 | .{ .tag = @enumFromInt(3889), .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12950 | // rint | |
| 12951 | .{ .tag = @enumFromInt(3890), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, | |
| 12952 | // rintf | |
| 12953 | .{ .tag = @enumFromInt(3891), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, | |
| 12954 | // rintl | |
| 12955 | .{ .tag = @enumFromInt(3892), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, | |
| 12956 | // round | |
| 12957 | .{ .tag = @enumFromInt(3893), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12958 | // roundeven | |
| 12959 | .{ .tag = @enumFromInt(3894), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12960 | // roundevenf | |
| 12961 | .{ .tag = @enumFromInt(3895), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12962 | // roundevenl | |
| 12963 | .{ .tag = @enumFromInt(3896), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12964 | // roundf | |
| 12965 | .{ .tag = @enumFromInt(3897), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12966 | // roundl | |
| 12967 | .{ .tag = @enumFromInt(3898), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12968 | // savectx | |
| 12969 | .{ .tag = @enumFromInt(3899), .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12970 | // scalbln | |
| 12971 | .{ .tag = @enumFromInt(3900), .properties = .{ .param_str = "ddLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12972 | // scalblnf | |
| 12973 | .{ .tag = @enumFromInt(3901), .properties = .{ .param_str = "ffLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12974 | // scalblnl | |
| 12975 | .{ .tag = @enumFromInt(3902), .properties = .{ .param_str = "LdLdLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12976 | // scalbn | |
| 12977 | .{ .tag = @enumFromInt(3903), .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12978 | // scalbnf | |
| 12979 | .{ .tag = @enumFromInt(3904), .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12980 | // scalbnl | |
| 12981 | .{ .tag = @enumFromInt(3905), .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12982 | // scanf | |
| 12983 | .{ .tag = @enumFromInt(3906), .properties = .{ .param_str = "icC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf } } }, | |
| 12984 | // setjmp | |
| 12985 | .{ .tag = @enumFromInt(3907), .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12986 | // siglongjmp | |
| 12987 | .{ .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 } } }, | |
| 12988 | // sigsetjmp | |
| 12989 | .{ .tag = @enumFromInt(3909), .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12990 | // sin | |
| 12991 | .{ .tag = @enumFromInt(3910), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12992 | // sinf | |
| 12993 | .{ .tag = @enumFromInt(3911), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12994 | // sinh | |
| 12995 | .{ .tag = @enumFromInt(3912), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12996 | // sinhf | |
| 12997 | .{ .tag = @enumFromInt(3913), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12998 | // sinhl | |
| 12999 | .{ .tag = @enumFromInt(3914), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13000 | // sinl | |
| 13001 | .{ .tag = @enumFromInt(3915), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13002 | // snprintf | |
| 13003 | .{ .tag = @enumFromInt(3916), .properties = .{ .param_str = "ic*zcC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, | |
| 13004 | // sprintf | |
| 13005 | .{ .tag = @enumFromInt(3917), .properties = .{ .param_str = "ic*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 13006 | // sqrt | |
| 13007 | .{ .tag = @enumFromInt(3918), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13008 | // sqrtf | |
| 13009 | .{ .tag = @enumFromInt(3919), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13010 | // sqrtl | |
| 13011 | .{ .tag = @enumFromInt(3920), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13012 | // sscanf | |
| 13013 | .{ .tag = @enumFromInt(3921), .properties = .{ .param_str = "icC*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 13014 | // stpcpy | |
| 13015 | .{ .tag = @enumFromInt(3922), .properties = .{ .param_str = "c*c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13016 | // stpncpy | |
| 13017 | .{ .tag = @enumFromInt(3923), .properties = .{ .param_str = "c*c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13018 | // strcasecmp | |
| 13019 | .{ .tag = @enumFromInt(3924), .properties = .{ .param_str = "icC*cC*", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13020 | // strcat | |
| 13021 | .{ .tag = @enumFromInt(3925), .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13022 | // strchr | |
| 13023 | .{ .tag = @enumFromInt(3926), .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13024 | // strcmp | |
| 13025 | .{ .tag = @enumFromInt(3927), .properties = .{ .param_str = "icC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13026 | // strcpy | |
| 13027 | .{ .tag = @enumFromInt(3928), .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13028 | // strcspn | |
| 13029 | .{ .tag = @enumFromInt(3929), .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13030 | // strdup | |
| 13031 | .{ .tag = @enumFromInt(3930), .properties = .{ .param_str = "c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13032 | // strerror | |
| 13033 | .{ .tag = @enumFromInt(3931), .properties = .{ .param_str = "c*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13034 | // strlcat | |
| 13035 | .{ .tag = @enumFromInt(3932), .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13036 | // strlcpy | |
| 13037 | .{ .tag = @enumFromInt(3933), .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13038 | // strlen | |
| 13039 | .{ .tag = @enumFromInt(3934), .properties = .{ .param_str = "zcC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13040 | // strncasecmp | |
| 13041 | .{ .tag = @enumFromInt(3935), .properties = .{ .param_str = "icC*cC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13042 | // strncat | |
| 13043 | .{ .tag = @enumFromInt(3936), .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13044 | // strncmp | |
| 13045 | .{ .tag = @enumFromInt(3937), .properties = .{ .param_str = "icC*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13046 | // strncpy | |
| 13047 | .{ .tag = @enumFromInt(3938), .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13048 | // strndup | |
| 13049 | .{ .tag = @enumFromInt(3939), .properties = .{ .param_str = "c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13050 | // strpbrk | |
| 13051 | .{ .tag = @enumFromInt(3940), .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13052 | // strrchr | |
| 13053 | .{ .tag = @enumFromInt(3941), .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13054 | // strspn | |
| 13055 | .{ .tag = @enumFromInt(3942), .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13056 | // strstr | |
| 13057 | .{ .tag = @enumFromInt(3943), .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13058 | // strtod | |
| 13059 | .{ .tag = @enumFromInt(3944), .properties = .{ .param_str = "dcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13060 | // strtof | |
| 13061 | .{ .tag = @enumFromInt(3945), .properties = .{ .param_str = "fcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13062 | // strtok | |
| 13063 | .{ .tag = @enumFromInt(3946), .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13064 | // strtol | |
| 13065 | .{ .tag = @enumFromInt(3947), .properties = .{ .param_str = "LicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13066 | // strtold | |
| 13067 | .{ .tag = @enumFromInt(3948), .properties = .{ .param_str = "LdcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13068 | // strtoll | |
| 13069 | .{ .tag = @enumFromInt(3949), .properties = .{ .param_str = "LLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13070 | // strtoul | |
| 13071 | .{ .tag = @enumFromInt(3950), .properties = .{ .param_str = "ULicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13072 | // strtoull | |
| 13073 | .{ .tag = @enumFromInt(3951), .properties = .{ .param_str = "ULLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13074 | // strxfrm | |
| 13075 | .{ .tag = @enumFromInt(3952), .properties = .{ .param_str = "zc*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13076 | // tan | |
| 13077 | .{ .tag = @enumFromInt(3953), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13078 | // tanf | |
| 13079 | .{ .tag = @enumFromInt(3954), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13080 | // tanh | |
| 13081 | .{ .tag = @enumFromInt(3955), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13082 | // tanhf | |
| 13083 | .{ .tag = @enumFromInt(3956), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13084 | // tanhl | |
| 13085 | .{ .tag = @enumFromInt(3957), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13086 | // tanl | |
| 13087 | .{ .tag = @enumFromInt(3958), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13088 | // tgamma | |
| 13089 | .{ .tag = @enumFromInt(3959), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13090 | // tgammaf | |
| 13091 | .{ .tag = @enumFromInt(3960), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13092 | // tgammal | |
| 13093 | .{ .tag = @enumFromInt(3961), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13094 | // tolower | |
| 13095 | .{ .tag = @enumFromInt(3962), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13096 | // toupper | |
| 13097 | .{ .tag = @enumFromInt(3963), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13098 | // trunc | |
| 13099 | .{ .tag = @enumFromInt(3964), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13100 | // truncf | |
| 13101 | .{ .tag = @enumFromInt(3965), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13102 | // truncl | |
| 13103 | .{ .tag = @enumFromInt(3966), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13104 | // va_copy | |
| 13105 | .{ .tag = @enumFromInt(3967), .properties = .{ .param_str = "vAA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13106 | // va_end | |
| 13107 | .{ .tag = @enumFromInt(3968), .properties = .{ .param_str = "vA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13108 | // va_start | |
| 13109 | .{ .tag = @enumFromInt(3969), .properties = .{ .param_str = "vA.", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13110 | // vfork | |
| 13111 | .{ .tag = @enumFromInt(3970), .properties = .{ .param_str = "p", .header = .unistd, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 13112 | // vfprintf | |
| 13113 | .{ .tag = @enumFromInt(3971), .properties = .{ .param_str = "iP*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 13114 | // vfscanf | |
| 13115 | .{ .tag = @enumFromInt(3972), .properties = .{ .param_str = "iP*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 13116 | // vprintf | |
| 13117 | .{ .tag = @enumFromInt(3973), .properties = .{ .param_str = "icC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf } } }, | |
| 13118 | // vscanf | |
| 13119 | .{ .tag = @enumFromInt(3974), .properties = .{ .param_str = "icC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf } } }, | |
| 13120 | // vsnprintf | |
| 13121 | .{ .tag = @enumFromInt(3975), .properties = .{ .param_str = "ic*zcC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, | |
| 13122 | // vsprintf | |
| 13123 | .{ .tag = @enumFromInt(3976), .properties = .{ .param_str = "ic*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 13124 | // vsscanf | |
| 13125 | .{ .tag = @enumFromInt(3977), .properties = .{ .param_str = "icC*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 13126 | // wcschr | |
| 13127 | .{ .tag = @enumFromInt(3978), .properties = .{ .param_str = "w*wC*w", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13128 | // wcscmp | |
| 13129 | .{ .tag = @enumFromInt(3979), .properties = .{ .param_str = "iwC*wC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13130 | // wcslen | |
| 13131 | .{ .tag = @enumFromInt(3980), .properties = .{ .param_str = "zwC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13132 | // wcsncmp | |
| 13133 | .{ .tag = @enumFromInt(3981), .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13134 | // wmemchr | |
| 13135 | .{ .tag = @enumFromInt(3982), .properties = .{ .param_str = "w*wC*wz", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13136 | // wmemcmp | |
| 13137 | .{ .tag = @enumFromInt(3983), .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13138 | // wmemcpy | |
| 13139 | .{ .tag = @enumFromInt(3984), .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13140 | // wmemmove | |
| 13141 | .{ .tag = @enumFromInt(3985), .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 9197 | .{ .tag = ._Block_object_assign, .properties = .{ .param_str = "vv*vC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 9198 | .{ .tag = ._Block_object_dispose, .properties = .{ .param_str = "vvC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 9199 | .{ .tag = ._Exit, .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 9200 | .{ .tag = ._InterlockedAnd, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 9201 | .{ .tag = ._InterlockedAnd16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 9202 | .{ .tag = ._InterlockedAnd8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 9203 | .{ .tag = ._InterlockedCompareExchange, .properties = .{ .param_str = "NiNiD*NiNi", .language = .all_ms_languages } }, | |
| 9204 | .{ .tag = ._InterlockedCompareExchange16, .properties = .{ .param_str = "ssD*ss", .language = .all_ms_languages } }, | |
| 9205 | .{ .tag = ._InterlockedCompareExchange64, .properties = .{ .param_str = "LLiLLiD*LLiLLi", .language = .all_ms_languages } }, | |
| 9206 | .{ .tag = ._InterlockedCompareExchange8, .properties = .{ .param_str = "ccD*cc", .language = .all_ms_languages } }, | |
| 9207 | .{ .tag = ._InterlockedCompareExchangePointer, .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, | |
| 9208 | .{ .tag = ._InterlockedCompareExchangePointer_nf, .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, | |
| 9209 | .{ .tag = ._InterlockedDecrement, .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, | |
| 9210 | .{ .tag = ._InterlockedDecrement16, .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, | |
| 9211 | .{ .tag = ._InterlockedExchange, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 9212 | .{ .tag = ._InterlockedExchange16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 9213 | .{ .tag = ._InterlockedExchange8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 9214 | .{ .tag = ._InterlockedExchangeAdd, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 9215 | .{ .tag = ._InterlockedExchangeAdd16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 9216 | .{ .tag = ._InterlockedExchangeAdd8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 9217 | .{ .tag = ._InterlockedExchangePointer, .properties = .{ .param_str = "v*v*D*v*", .language = .all_ms_languages } }, | |
| 9218 | .{ .tag = ._InterlockedExchangeSub, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 9219 | .{ .tag = ._InterlockedExchangeSub16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 9220 | .{ .tag = ._InterlockedExchangeSub8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 9221 | .{ .tag = ._InterlockedIncrement, .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, | |
| 9222 | .{ .tag = ._InterlockedIncrement16, .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, | |
| 9223 | .{ .tag = ._InterlockedOr, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 9224 | .{ .tag = ._InterlockedOr16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 9225 | .{ .tag = ._InterlockedOr8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 9226 | .{ .tag = ._InterlockedXor, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, | |
| 9227 | .{ .tag = ._InterlockedXor16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, | |
| 9228 | .{ .tag = ._InterlockedXor8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, | |
| 9229 | .{ .tag = ._MoveFromCoprocessor, .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 9230 | .{ .tag = ._MoveFromCoprocessor2, .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 9231 | .{ .tag = ._MoveToCoprocessor, .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 9232 | .{ .tag = ._MoveToCoprocessor2, .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 9233 | .{ .tag = ._ReturnAddress, .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, | |
| 9234 | .{ .tag = .__GetExceptionInfo, .properties = .{ .param_str = "v*.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true, .eval_args = false } } }, | |
| 9235 | .{ .tag = .__abnormal_termination, .properties = .{ .param_str = "i", .language = .all_ms_languages } }, | |
| 9236 | .{ .tag = .__annotation, .properties = .{ .param_str = "wC*.", .language = .all_ms_languages } }, | |
| 9237 | .{ .tag = .__arithmetic_fence, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9238 | .{ .tag = .__assume, .properties = .{ .param_str = "vb", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 9239 | .{ .tag = .__atomic_add_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9240 | .{ .tag = .__atomic_always_lock_free, .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, | |
| 9241 | .{ .tag = .__atomic_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9242 | .{ .tag = .__atomic_clear, .properties = .{ .param_str = "vvD*i" } }, | |
| 9243 | .{ .tag = .__atomic_compare_exchange, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9244 | .{ .tag = .__atomic_compare_exchange_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9245 | .{ .tag = .__atomic_exchange, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9246 | .{ .tag = .__atomic_exchange_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9247 | .{ .tag = .__atomic_fetch_add, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9248 | .{ .tag = .__atomic_fetch_and, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9249 | .{ .tag = .__atomic_fetch_max, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9250 | .{ .tag = .__atomic_fetch_min, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9251 | .{ .tag = .__atomic_fetch_nand, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9252 | .{ .tag = .__atomic_fetch_or, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9253 | .{ .tag = .__atomic_fetch_sub, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9254 | .{ .tag = .__atomic_fetch_xor, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9255 | .{ .tag = .__atomic_is_lock_free, .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, | |
| 9256 | .{ .tag = .__atomic_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9257 | .{ .tag = .__atomic_load_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9258 | .{ .tag = .__atomic_max_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9259 | .{ .tag = .__atomic_min_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9260 | .{ .tag = .__atomic_nand_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9261 | .{ .tag = .__atomic_or_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9262 | .{ .tag = .__atomic_signal_fence, .properties = .{ .param_str = "vi" } }, | |
| 9263 | .{ .tag = .__atomic_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9264 | .{ .tag = .__atomic_store_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9265 | .{ .tag = .__atomic_sub_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9266 | .{ .tag = .__atomic_test_and_set, .properties = .{ .param_str = "bvD*i" } }, | |
| 9267 | .{ .tag = .__atomic_thread_fence, .properties = .{ .param_str = "vi" } }, | |
| 9268 | .{ .tag = .__atomic_xor_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9269 | .{ .tag = .__builtin___CFStringMakeConstantString, .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9270 | .{ .tag = .__builtin___NSStringMakeConstantString, .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9271 | .{ .tag = .__builtin___clear_cache, .properties = .{ .param_str = "vc*c*" } }, | |
| 9272 | .{ .tag = .__builtin___fprintf_chk, .properties = .{ .param_str = "iP*RicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, | |
| 9273 | .{ .tag = .__builtin___get_unsafe_stack_bottom, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9274 | .{ .tag = .__builtin___get_unsafe_stack_ptr, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9275 | .{ .tag = .__builtin___get_unsafe_stack_start, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9276 | .{ .tag = .__builtin___get_unsafe_stack_top, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9277 | .{ .tag = .__builtin___memccpy_chk, .properties = .{ .param_str = "v*v*vC*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9278 | .{ .tag = .__builtin___memcpy_chk, .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9279 | .{ .tag = .__builtin___memmove_chk, .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9280 | .{ .tag = .__builtin___mempcpy_chk, .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9281 | .{ .tag = .__builtin___memset_chk, .properties = .{ .param_str = "v*v*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9282 | .{ .tag = .__builtin___printf_chk, .properties = .{ .param_str = "iicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 9283 | .{ .tag = .__builtin___snprintf_chk, .properties = .{ .param_str = "ic*RzizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 4 } } }, | |
| 9284 | .{ .tag = .__builtin___sprintf_chk, .properties = .{ .param_str = "ic*RizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 3 } } }, | |
| 9285 | .{ .tag = .__builtin___stpcpy_chk, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9286 | .{ .tag = .__builtin___stpncpy_chk, .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9287 | .{ .tag = .__builtin___strcat_chk, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9288 | .{ .tag = .__builtin___strcpy_chk, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9289 | .{ .tag = .__builtin___strlcat_chk, .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9290 | .{ .tag = .__builtin___strlcpy_chk, .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9291 | .{ .tag = .__builtin___strncat_chk, .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9292 | .{ .tag = .__builtin___strncpy_chk, .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9293 | .{ .tag = .__builtin___vfprintf_chk, .properties = .{ .param_str = "iP*RicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, | |
| 9294 | .{ .tag = .__builtin___vprintf_chk, .properties = .{ .param_str = "iicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 9295 | .{ .tag = .__builtin___vsnprintf_chk, .properties = .{ .param_str = "ic*RzizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 4 } } }, | |
| 9296 | .{ .tag = .__builtin___vsprintf_chk, .properties = .{ .param_str = "ic*RizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 3 } } }, | |
| 9297 | .{ .tag = .__builtin_abort, .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9298 | .{ .tag = .__builtin_abs, .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9299 | .{ .tag = .__builtin_acos, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9300 | .{ .tag = .__builtin_acosf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9301 | .{ .tag = .__builtin_acosf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9302 | .{ .tag = .__builtin_acosh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9303 | .{ .tag = .__builtin_acoshf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9304 | .{ .tag = .__builtin_acoshf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9305 | .{ .tag = .__builtin_acoshl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9306 | .{ .tag = .__builtin_acosl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9307 | .{ .tag = .__builtin_add_overflow, .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9308 | .{ .tag = .__builtin_addc, .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, | |
| 9309 | .{ .tag = .__builtin_addcb, .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, | |
| 9310 | .{ .tag = .__builtin_addcl, .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, | |
| 9311 | .{ .tag = .__builtin_addcll, .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, | |
| 9312 | .{ .tag = .__builtin_addcs, .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, | |
| 9313 | .{ .tag = .__builtin_align_down, .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9314 | .{ .tag = .__builtin_align_up, .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9315 | .{ .tag = .__builtin_alloca, .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9316 | .{ .tag = .__builtin_alloca_uninitialized, .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9317 | .{ .tag = .__builtin_alloca_with_align, .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9318 | .{ .tag = .__builtin_alloca_with_align_uninitialized, .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9319 | .{ .tag = .__builtin_amdgcn_alignbit, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9320 | .{ .tag = .__builtin_amdgcn_alignbyte, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9321 | .{ .tag = .__builtin_amdgcn_atomic_dec32, .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9322 | .{ .tag = .__builtin_amdgcn_atomic_dec64, .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9323 | .{ .tag = .__builtin_amdgcn_atomic_inc32, .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9324 | .{ .tag = .__builtin_amdgcn_atomic_inc64, .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9325 | .{ .tag = .__builtin_amdgcn_buffer_wbinvl1, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9326 | .{ .tag = .__builtin_amdgcn_class, .properties = .{ .param_str = "bdi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9327 | .{ .tag = .__builtin_amdgcn_classf, .properties = .{ .param_str = "bfi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9328 | .{ .tag = .__builtin_amdgcn_cosf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9329 | .{ .tag = .__builtin_amdgcn_cubeid, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9330 | .{ .tag = .__builtin_amdgcn_cubema, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9331 | .{ .tag = .__builtin_amdgcn_cubesc, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9332 | .{ .tag = .__builtin_amdgcn_cubetc, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9333 | .{ .tag = .__builtin_amdgcn_cvt_pk_i16, .properties = .{ .param_str = "E2sii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9334 | .{ .tag = .__builtin_amdgcn_cvt_pk_u16, .properties = .{ .param_str = "E2UsUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9335 | .{ .tag = .__builtin_amdgcn_cvt_pk_u8_f32, .properties = .{ .param_str = "UifUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9336 | .{ .tag = .__builtin_amdgcn_cvt_pknorm_i16, .properties = .{ .param_str = "E2sff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9337 | .{ .tag = .__builtin_amdgcn_cvt_pknorm_u16, .properties = .{ .param_str = "E2Usff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9338 | .{ .tag = .__builtin_amdgcn_cvt_pkrtz, .properties = .{ .param_str = "E2hff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9339 | .{ .tag = .__builtin_amdgcn_dispatch_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9340 | .{ .tag = .__builtin_amdgcn_div_fixup, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9341 | .{ .tag = .__builtin_amdgcn_div_fixupf, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9342 | .{ .tag = .__builtin_amdgcn_div_fmas, .properties = .{ .param_str = "ddddb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9343 | .{ .tag = .__builtin_amdgcn_div_fmasf, .properties = .{ .param_str = "ffffb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9344 | .{ .tag = .__builtin_amdgcn_div_scale, .properties = .{ .param_str = "dddbb*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9345 | .{ .tag = .__builtin_amdgcn_div_scalef, .properties = .{ .param_str = "fffbb*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9346 | .{ .tag = .__builtin_amdgcn_ds_append, .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9347 | .{ .tag = .__builtin_amdgcn_ds_bpermute, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9348 | .{ .tag = .__builtin_amdgcn_ds_consume, .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9349 | .{ .tag = .__builtin_amdgcn_ds_faddf, .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9350 | .{ .tag = .__builtin_amdgcn_ds_fmaxf, .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9351 | .{ .tag = .__builtin_amdgcn_ds_fminf, .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9352 | .{ .tag = .__builtin_amdgcn_ds_permute, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9353 | .{ .tag = .__builtin_amdgcn_ds_swizzle, .properties = .{ .param_str = "iiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9354 | .{ .tag = .__builtin_amdgcn_endpgm, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .noreturn = true } } }, | |
| 9355 | .{ .tag = .__builtin_amdgcn_exp2f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9356 | .{ .tag = .__builtin_amdgcn_fcmp, .properties = .{ .param_str = "WUiddIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9357 | .{ .tag = .__builtin_amdgcn_fcmpf, .properties = .{ .param_str = "WUiffIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9358 | .{ .tag = .__builtin_amdgcn_fence, .properties = .{ .param_str = "vUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9359 | .{ .tag = .__builtin_amdgcn_fmed3f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9360 | .{ .tag = .__builtin_amdgcn_fract, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9361 | .{ .tag = .__builtin_amdgcn_fractf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9362 | .{ .tag = .__builtin_amdgcn_frexp_exp, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9363 | .{ .tag = .__builtin_amdgcn_frexp_expf, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9364 | .{ .tag = .__builtin_amdgcn_frexp_mant, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9365 | .{ .tag = .__builtin_amdgcn_frexp_mantf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9366 | .{ .tag = .__builtin_amdgcn_grid_size_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9367 | .{ .tag = .__builtin_amdgcn_grid_size_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9368 | .{ .tag = .__builtin_amdgcn_grid_size_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9369 | .{ .tag = .__builtin_amdgcn_groupstaticsize, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9370 | .{ .tag = .__builtin_amdgcn_iglp_opt, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9371 | .{ .tag = .__builtin_amdgcn_implicitarg_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9372 | .{ .tag = .__builtin_amdgcn_interp_mov, .properties = .{ .param_str = "fUiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9373 | .{ .tag = .__builtin_amdgcn_interp_p1, .properties = .{ .param_str = "ffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9374 | .{ .tag = .__builtin_amdgcn_interp_p1_f16, .properties = .{ .param_str = "ffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9375 | .{ .tag = .__builtin_amdgcn_interp_p2, .properties = .{ .param_str = "fffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9376 | .{ .tag = .__builtin_amdgcn_interp_p2_f16, .properties = .{ .param_str = "hffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9377 | .{ .tag = .__builtin_amdgcn_is_private, .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9378 | .{ .tag = .__builtin_amdgcn_is_shared, .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9379 | .{ .tag = .__builtin_amdgcn_kernarg_segment_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9380 | .{ .tag = .__builtin_amdgcn_ldexp, .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9381 | .{ .tag = .__builtin_amdgcn_ldexpf, .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9382 | .{ .tag = .__builtin_amdgcn_lerp, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9383 | .{ .tag = .__builtin_amdgcn_log_clampf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9384 | .{ .tag = .__builtin_amdgcn_logf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9385 | .{ .tag = .__builtin_amdgcn_mbcnt_hi, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9386 | .{ .tag = .__builtin_amdgcn_mbcnt_lo, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9387 | .{ .tag = .__builtin_amdgcn_mqsad_pk_u16_u8, .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9388 | .{ .tag = .__builtin_amdgcn_mqsad_u32_u8, .properties = .{ .param_str = "V4UiWUiUiV4Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9389 | .{ .tag = .__builtin_amdgcn_msad_u8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9390 | .{ .tag = .__builtin_amdgcn_qsad_pk_u16_u8, .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9391 | .{ .tag = .__builtin_amdgcn_queue_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9392 | .{ .tag = .__builtin_amdgcn_rcp, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9393 | .{ .tag = .__builtin_amdgcn_rcpf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9394 | .{ .tag = .__builtin_amdgcn_read_exec, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9395 | .{ .tag = .__builtin_amdgcn_read_exec_hi, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9396 | .{ .tag = .__builtin_amdgcn_read_exec_lo, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9397 | .{ .tag = .__builtin_amdgcn_readfirstlane, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9398 | .{ .tag = .__builtin_amdgcn_readlane, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9399 | .{ .tag = .__builtin_amdgcn_rsq, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9400 | .{ .tag = .__builtin_amdgcn_rsq_clamp, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9401 | .{ .tag = .__builtin_amdgcn_rsq_clampf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9402 | .{ .tag = .__builtin_amdgcn_rsqf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9403 | .{ .tag = .__builtin_amdgcn_s_barrier, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9404 | .{ .tag = .__builtin_amdgcn_s_dcache_inv, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9405 | .{ .tag = .__builtin_amdgcn_s_decperflevel, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9406 | .{ .tag = .__builtin_amdgcn_s_getpc, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9407 | .{ .tag = .__builtin_amdgcn_s_getreg, .properties = .{ .param_str = "UiIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9408 | .{ .tag = .__builtin_amdgcn_s_incperflevel, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9409 | .{ .tag = .__builtin_amdgcn_s_sendmsg, .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9410 | .{ .tag = .__builtin_amdgcn_s_sendmsghalt, .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9411 | .{ .tag = .__builtin_amdgcn_s_setprio, .properties = .{ .param_str = "vIs", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9412 | .{ .tag = .__builtin_amdgcn_s_setreg, .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9413 | .{ .tag = .__builtin_amdgcn_s_sleep, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9414 | .{ .tag = .__builtin_amdgcn_s_waitcnt, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9415 | .{ .tag = .__builtin_amdgcn_sad_hi_u8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9416 | .{ .tag = .__builtin_amdgcn_sad_u16, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9417 | .{ .tag = .__builtin_amdgcn_sad_u8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9418 | .{ .tag = .__builtin_amdgcn_sbfe, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9419 | .{ .tag = .__builtin_amdgcn_sched_barrier, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9420 | .{ .tag = .__builtin_amdgcn_sched_group_barrier, .properties = .{ .param_str = "vIiIiIi", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9421 | .{ .tag = .__builtin_amdgcn_sicmp, .properties = .{ .param_str = "WUiiiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9422 | .{ .tag = .__builtin_amdgcn_sicmpl, .properties = .{ .param_str = "WUiWiWiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9423 | .{ .tag = .__builtin_amdgcn_sinf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9424 | .{ .tag = .__builtin_amdgcn_sqrt, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9425 | .{ .tag = .__builtin_amdgcn_sqrtf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9426 | .{ .tag = .__builtin_amdgcn_trig_preop, .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9427 | .{ .tag = .__builtin_amdgcn_trig_preopf, .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9428 | .{ .tag = .__builtin_amdgcn_ubfe, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9429 | .{ .tag = .__builtin_amdgcn_uicmp, .properties = .{ .param_str = "WUiUiUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9430 | .{ .tag = .__builtin_amdgcn_uicmpl, .properties = .{ .param_str = "WUiWUiWUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9431 | .{ .tag = .__builtin_amdgcn_wave_barrier, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, | |
| 9432 | .{ .tag = .__builtin_amdgcn_workgroup_id_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9433 | .{ .tag = .__builtin_amdgcn_workgroup_id_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9434 | .{ .tag = .__builtin_amdgcn_workgroup_id_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9435 | .{ .tag = .__builtin_amdgcn_workgroup_size_x, .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9436 | .{ .tag = .__builtin_amdgcn_workgroup_size_y, .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9437 | .{ .tag = .__builtin_amdgcn_workgroup_size_z, .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9438 | .{ .tag = .__builtin_amdgcn_workitem_id_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9439 | .{ .tag = .__builtin_amdgcn_workitem_id_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9440 | .{ .tag = .__builtin_amdgcn_workitem_id_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 9441 | .{ .tag = .__builtin_annotation, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9442 | .{ .tag = .__builtin_arm_cdp, .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9443 | .{ .tag = .__builtin_arm_cdp2, .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9444 | .{ .tag = .__builtin_arm_clrex, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9445 | .{ .tag = .__builtin_arm_cls, .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9446 | .{ .tag = .__builtin_arm_cls64, .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9447 | .{ .tag = .__builtin_arm_clz, .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9448 | .{ .tag = .__builtin_arm_clz64, .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9449 | .{ .tag = .__builtin_arm_cmse_TT, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9450 | .{ .tag = .__builtin_arm_cmse_TTA, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9451 | .{ .tag = .__builtin_arm_cmse_TTAT, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9452 | .{ .tag = .__builtin_arm_cmse_TTT, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9453 | .{ .tag = .__builtin_arm_dbg, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9454 | .{ .tag = .__builtin_arm_dmb, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9455 | .{ .tag = .__builtin_arm_dsb, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9456 | .{ .tag = .__builtin_arm_get_fpscr, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9457 | .{ .tag = .__builtin_arm_isb, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9458 | .{ .tag = .__builtin_arm_ldaex, .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 9459 | .{ .tag = .__builtin_arm_ldc, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9460 | .{ .tag = .__builtin_arm_ldc2, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9461 | .{ .tag = .__builtin_arm_ldc2l, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9462 | .{ .tag = .__builtin_arm_ldcl, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9463 | .{ .tag = .__builtin_arm_ldrex, .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 9464 | .{ .tag = .__builtin_arm_ldrexd, .properties = .{ .param_str = "LLUiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9465 | .{ .tag = .__builtin_arm_mcr, .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9466 | .{ .tag = .__builtin_arm_mcr2, .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9467 | .{ .tag = .__builtin_arm_mcrr, .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9468 | .{ .tag = .__builtin_arm_mcrr2, .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9469 | .{ .tag = .__builtin_arm_mrc, .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9470 | .{ .tag = .__builtin_arm_mrc2, .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9471 | .{ .tag = .__builtin_arm_mrrc, .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9472 | .{ .tag = .__builtin_arm_mrrc2, .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, | |
| 9473 | .{ .tag = .__builtin_arm_nop, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9474 | .{ .tag = .__builtin_arm_prefetch, .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9475 | .{ .tag = .__builtin_arm_qadd, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9476 | .{ .tag = .__builtin_arm_qadd16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9477 | .{ .tag = .__builtin_arm_qadd8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9478 | .{ .tag = .__builtin_arm_qasx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9479 | .{ .tag = .__builtin_arm_qdbl, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9480 | .{ .tag = .__builtin_arm_qsax, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9481 | .{ .tag = .__builtin_arm_qsub, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9482 | .{ .tag = .__builtin_arm_qsub16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9483 | .{ .tag = .__builtin_arm_qsub8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9484 | .{ .tag = .__builtin_arm_rbit, .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9485 | .{ .tag = .__builtin_arm_rbit64, .properties = .{ .param_str = "WUiWUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, | |
| 9486 | .{ .tag = .__builtin_arm_rsr, .properties = .{ .param_str = "UicC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9487 | .{ .tag = .__builtin_arm_rsr64, .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9488 | .{ .tag = .__builtin_arm_rsrp, .properties = .{ .param_str = "v*cC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9489 | .{ .tag = .__builtin_arm_sadd16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9490 | .{ .tag = .__builtin_arm_sadd8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9491 | .{ .tag = .__builtin_arm_sasx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9492 | .{ .tag = .__builtin_arm_sel, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9493 | .{ .tag = .__builtin_arm_set_fpscr, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9494 | .{ .tag = .__builtin_arm_sev, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9495 | .{ .tag = .__builtin_arm_sevl, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9496 | .{ .tag = .__builtin_arm_shadd16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9497 | .{ .tag = .__builtin_arm_shadd8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9498 | .{ .tag = .__builtin_arm_shasx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9499 | .{ .tag = .__builtin_arm_shsax, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9500 | .{ .tag = .__builtin_arm_shsub16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9501 | .{ .tag = .__builtin_arm_shsub8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9502 | .{ .tag = .__builtin_arm_smlabb, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9503 | .{ .tag = .__builtin_arm_smlabt, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9504 | .{ .tag = .__builtin_arm_smlad, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9505 | .{ .tag = .__builtin_arm_smladx, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9506 | .{ .tag = .__builtin_arm_smlald, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9507 | .{ .tag = .__builtin_arm_smlaldx, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9508 | .{ .tag = .__builtin_arm_smlatb, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9509 | .{ .tag = .__builtin_arm_smlatt, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9510 | .{ .tag = .__builtin_arm_smlawb, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9511 | .{ .tag = .__builtin_arm_smlawt, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9512 | .{ .tag = .__builtin_arm_smlsd, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9513 | .{ .tag = .__builtin_arm_smlsdx, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9514 | .{ .tag = .__builtin_arm_smlsld, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9515 | .{ .tag = .__builtin_arm_smlsldx, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9516 | .{ .tag = .__builtin_arm_smuad, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9517 | .{ .tag = .__builtin_arm_smuadx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9518 | .{ .tag = .__builtin_arm_smulbb, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9519 | .{ .tag = .__builtin_arm_smulbt, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9520 | .{ .tag = .__builtin_arm_smultb, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9521 | .{ .tag = .__builtin_arm_smultt, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9522 | .{ .tag = .__builtin_arm_smulwb, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9523 | .{ .tag = .__builtin_arm_smulwt, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9524 | .{ .tag = .__builtin_arm_smusd, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9525 | .{ .tag = .__builtin_arm_smusdx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9526 | .{ .tag = .__builtin_arm_ssat, .properties = .{ .param_str = "iiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9527 | .{ .tag = .__builtin_arm_ssat16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9528 | .{ .tag = .__builtin_arm_ssax, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9529 | .{ .tag = .__builtin_arm_ssub16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9530 | .{ .tag = .__builtin_arm_ssub8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9531 | .{ .tag = .__builtin_arm_stc, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9532 | .{ .tag = .__builtin_arm_stc2, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9533 | .{ .tag = .__builtin_arm_stc2l, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9534 | .{ .tag = .__builtin_arm_stcl, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9535 | .{ .tag = .__builtin_arm_stlex, .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 9536 | .{ .tag = .__builtin_arm_strex, .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, | |
| 9537 | .{ .tag = .__builtin_arm_strexd, .properties = .{ .param_str = "iLLUiv*", .target_set = TargetSet.initOne(.arm) } }, | |
| 9538 | .{ .tag = .__builtin_arm_sxtab16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9539 | .{ .tag = .__builtin_arm_sxtb16, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9540 | .{ .tag = .__builtin_arm_tcancel, .properties = .{ .param_str = "vWUIi", .target_set = TargetSet.initOne(.aarch64) } }, | |
| 9541 | .{ .tag = .__builtin_arm_tcommit, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.aarch64) } }, | |
| 9542 | .{ .tag = .__builtin_arm_tstart, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .returns_twice = true } } }, | |
| 9543 | .{ .tag = .__builtin_arm_ttest, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, | |
| 9544 | .{ .tag = .__builtin_arm_uadd16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9545 | .{ .tag = .__builtin_arm_uadd8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9546 | .{ .tag = .__builtin_arm_uasx, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9547 | .{ .tag = .__builtin_arm_uhadd16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9548 | .{ .tag = .__builtin_arm_uhadd8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9549 | .{ .tag = .__builtin_arm_uhasx, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9550 | .{ .tag = .__builtin_arm_uhsax, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9551 | .{ .tag = .__builtin_arm_uhsub16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9552 | .{ .tag = .__builtin_arm_uhsub8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9553 | .{ .tag = .__builtin_arm_uqadd16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9554 | .{ .tag = .__builtin_arm_uqadd8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9555 | .{ .tag = .__builtin_arm_uqasx, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9556 | .{ .tag = .__builtin_arm_uqsax, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9557 | .{ .tag = .__builtin_arm_uqsub16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9558 | .{ .tag = .__builtin_arm_uqsub8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9559 | .{ .tag = .__builtin_arm_usad8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9560 | .{ .tag = .__builtin_arm_usada8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9561 | .{ .tag = .__builtin_arm_usat, .properties = .{ .param_str = "UiiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9562 | .{ .tag = .__builtin_arm_usat16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9563 | .{ .tag = .__builtin_arm_usax, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9564 | .{ .tag = .__builtin_arm_usub16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9565 | .{ .tag = .__builtin_arm_usub8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9566 | .{ .tag = .__builtin_arm_uxtab16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9567 | .{ .tag = .__builtin_arm_uxtb16, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9568 | .{ .tag = .__builtin_arm_vcvtr_d, .properties = .{ .param_str = "fdi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9569 | .{ .tag = .__builtin_arm_vcvtr_f, .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, | |
| 9570 | .{ .tag = .__builtin_arm_wfe, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9571 | .{ .tag = .__builtin_arm_wfi, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9572 | .{ .tag = .__builtin_arm_wsr, .properties = .{ .param_str = "vcC*Ui", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9573 | .{ .tag = .__builtin_arm_wsr64, .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9574 | .{ .tag = .__builtin_arm_wsrp, .properties = .{ .param_str = "vcC*vC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 9575 | .{ .tag = .__builtin_arm_yield, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 9576 | .{ .tag = .__builtin_asin, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9577 | .{ .tag = .__builtin_asinf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9578 | .{ .tag = .__builtin_asinf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9579 | .{ .tag = .__builtin_asinh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9580 | .{ .tag = .__builtin_asinhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9581 | .{ .tag = .__builtin_asinhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9582 | .{ .tag = .__builtin_asinhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9583 | .{ .tag = .__builtin_asinl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9584 | .{ .tag = .__builtin_assume, .properties = .{ .param_str = "vb", .attributes = .{ .const_evaluable = true } } }, | |
| 9585 | .{ .tag = .__builtin_assume_aligned, .properties = .{ .param_str = "v*vC*z.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9586 | .{ .tag = .__builtin_assume_separate_storage, .properties = .{ .param_str = "vvCD*vCD*", .attributes = .{ .const_evaluable = true } } }, | |
| 9587 | .{ .tag = .__builtin_atan, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9588 | .{ .tag = .__builtin_atan2, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9589 | .{ .tag = .__builtin_atan2f, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9590 | .{ .tag = .__builtin_atan2f128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9591 | .{ .tag = .__builtin_atan2l, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9592 | .{ .tag = .__builtin_atanf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9593 | .{ .tag = .__builtin_atanf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9594 | .{ .tag = .__builtin_atanh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9595 | .{ .tag = .__builtin_atanhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9596 | .{ .tag = .__builtin_atanhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9597 | .{ .tag = .__builtin_atanhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9598 | .{ .tag = .__builtin_atanl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9599 | .{ .tag = .__builtin_bcmp, .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9600 | .{ .tag = .__builtin_bcopy, .properties = .{ .param_str = "vvC*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9601 | .{ .tag = .__builtin_bitoffsetof, .properties = .{ .param_str = "z.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9602 | .{ .tag = .__builtin_bitrev, .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, | |
| 9603 | .{ .tag = .__builtin_bitreverse16, .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9604 | .{ .tag = .__builtin_bitreverse32, .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9605 | .{ .tag = .__builtin_bitreverse64, .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9606 | .{ .tag = .__builtin_bitreverse8, .properties = .{ .param_str = "UcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9607 | .{ .tag = .__builtin_bswap16, .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9608 | .{ .tag = .__builtin_bswap32, .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9609 | .{ .tag = .__builtin_bswap64, .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9610 | .{ .tag = .__builtin_bzero, .properties = .{ .param_str = "vv*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9611 | .{ .tag = .__builtin_cabs, .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9612 | .{ .tag = .__builtin_cabsf, .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9613 | .{ .tag = .__builtin_cabsl, .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9614 | .{ .tag = .__builtin_cacos, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9615 | .{ .tag = .__builtin_cacosf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9616 | .{ .tag = .__builtin_cacosh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9617 | .{ .tag = .__builtin_cacoshf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9618 | .{ .tag = .__builtin_cacoshl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9619 | .{ .tag = .__builtin_cacosl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9620 | .{ .tag = .__builtin_call_with_static_chain, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9621 | .{ .tag = .__builtin_calloc, .properties = .{ .param_str = "v*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9622 | .{ .tag = .__builtin_canonicalize, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true } } }, | |
| 9623 | .{ .tag = .__builtin_canonicalizef, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true } } }, | |
| 9624 | .{ .tag = .__builtin_canonicalizef16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true } } }, | |
| 9625 | .{ .tag = .__builtin_canonicalizel, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true } } }, | |
| 9626 | .{ .tag = .__builtin_carg, .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9627 | .{ .tag = .__builtin_cargf, .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9628 | .{ .tag = .__builtin_cargl, .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9629 | .{ .tag = .__builtin_casin, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9630 | .{ .tag = .__builtin_casinf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9631 | .{ .tag = .__builtin_casinh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9632 | .{ .tag = .__builtin_casinhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9633 | .{ .tag = .__builtin_casinhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9634 | .{ .tag = .__builtin_casinl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9635 | .{ .tag = .__builtin_catan, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9636 | .{ .tag = .__builtin_catanf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9637 | .{ .tag = .__builtin_catanh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9638 | .{ .tag = .__builtin_catanhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9639 | .{ .tag = .__builtin_catanhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9640 | .{ .tag = .__builtin_catanl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9641 | .{ .tag = .__builtin_cbrt, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9642 | .{ .tag = .__builtin_cbrtf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9643 | .{ .tag = .__builtin_cbrtf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9644 | .{ .tag = .__builtin_cbrtl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9645 | .{ .tag = .__builtin_ccos, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9646 | .{ .tag = .__builtin_ccosf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9647 | .{ .tag = .__builtin_ccosh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9648 | .{ .tag = .__builtin_ccoshf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9649 | .{ .tag = .__builtin_ccoshl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9650 | .{ .tag = .__builtin_ccosl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9651 | .{ .tag = .__builtin_ceil, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9652 | .{ .tag = .__builtin_ceilf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9653 | .{ .tag = .__builtin_ceilf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9654 | .{ .tag = .__builtin_ceilf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9655 | .{ .tag = .__builtin_ceill, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9656 | .{ .tag = .__builtin_cexp, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9657 | .{ .tag = .__builtin_cexpf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9658 | .{ .tag = .__builtin_cexpl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9659 | .{ .tag = .__builtin_char_memchr, .properties = .{ .param_str = "c*cC*iz", .attributes = .{ .const_evaluable = true } } }, | |
| 9660 | .{ .tag = .__builtin_choose_expr, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9661 | .{ .tag = .__builtin_cimag, .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9662 | .{ .tag = .__builtin_cimagf, .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9663 | .{ .tag = .__builtin_cimagl, .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9664 | .{ .tag = .__builtin_classify_type, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, | |
| 9665 | .{ .tag = .__builtin_clog, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9666 | .{ .tag = .__builtin_clogf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9667 | .{ .tag = .__builtin_clogl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9668 | .{ .tag = .__builtin_clrsb, .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9669 | .{ .tag = .__builtin_clrsbl, .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9670 | .{ .tag = .__builtin_clrsbll, .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9671 | .{ .tag = .__builtin_clz, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9672 | .{ .tag = .__builtin_clzl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9673 | .{ .tag = .__builtin_clzll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9674 | .{ .tag = .__builtin_clzs, .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9675 | .{ .tag = .__builtin_complex, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9676 | .{ .tag = .__builtin_conj, .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9677 | .{ .tag = .__builtin_conjf, .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9678 | .{ .tag = .__builtin_conjl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9679 | .{ .tag = .__builtin_constant_p, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, | |
| 9680 | .{ .tag = .__builtin_convertvector, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9681 | .{ .tag = .__builtin_copysign, .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9682 | .{ .tag = .__builtin_copysignf, .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9683 | .{ .tag = .__builtin_copysignf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9684 | .{ .tag = .__builtin_copysignf16, .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9685 | .{ .tag = .__builtin_copysignl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9686 | .{ .tag = .__builtin_cos, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9687 | .{ .tag = .__builtin_cosf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9688 | .{ .tag = .__builtin_cosf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9689 | .{ .tag = .__builtin_cosf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9690 | .{ .tag = .__builtin_cosh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9691 | .{ .tag = .__builtin_coshf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9692 | .{ .tag = .__builtin_coshf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9693 | .{ .tag = .__builtin_coshl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9694 | .{ .tag = .__builtin_cosl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9695 | .{ .tag = .__builtin_cpow, .properties = .{ .param_str = "XdXdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9696 | .{ .tag = .__builtin_cpowf, .properties = .{ .param_str = "XfXfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9697 | .{ .tag = .__builtin_cpowl, .properties = .{ .param_str = "XLdXLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9698 | .{ .tag = .__builtin_cproj, .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9699 | .{ .tag = .__builtin_cprojf, .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9700 | .{ .tag = .__builtin_cprojl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9701 | .{ .tag = .__builtin_cpu_init, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.x86) } }, | |
| 9702 | .{ .tag = .__builtin_cpu_is, .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, | |
| 9703 | .{ .tag = .__builtin_cpu_supports, .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, | |
| 9704 | .{ .tag = .__builtin_creal, .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9705 | .{ .tag = .__builtin_crealf, .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9706 | .{ .tag = .__builtin_creall, .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9707 | .{ .tag = .__builtin_csin, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9708 | .{ .tag = .__builtin_csinf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9709 | .{ .tag = .__builtin_csinh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9710 | .{ .tag = .__builtin_csinhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9711 | .{ .tag = .__builtin_csinhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9712 | .{ .tag = .__builtin_csinl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9713 | .{ .tag = .__builtin_csqrt, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9714 | .{ .tag = .__builtin_csqrtf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9715 | .{ .tag = .__builtin_csqrtl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9716 | .{ .tag = .__builtin_ctan, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9717 | .{ .tag = .__builtin_ctanf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9718 | .{ .tag = .__builtin_ctanh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9719 | .{ .tag = .__builtin_ctanhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9720 | .{ .tag = .__builtin_ctanhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9721 | .{ .tag = .__builtin_ctanl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9722 | .{ .tag = .__builtin_ctz, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9723 | .{ .tag = .__builtin_ctzl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9724 | .{ .tag = .__builtin_ctzll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9725 | .{ .tag = .__builtin_ctzs, .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9726 | .{ .tag = .__builtin_dcbf, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 9727 | .{ .tag = .__builtin_debugtrap, .properties = .{ .param_str = "v" } }, | |
| 9728 | .{ .tag = .__builtin_dump_struct, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 9729 | .{ .tag = .__builtin_dwarf_cfa, .properties = .{ .param_str = "v*" } }, | |
| 9730 | .{ .tag = .__builtin_dwarf_sp_column, .properties = .{ .param_str = "Ui" } }, | |
| 9731 | .{ .tag = .__builtin_dynamic_object_size, .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, | |
| 9732 | .{ .tag = .__builtin_eh_return, .properties = .{ .param_str = "vzv*", .attributes = .{ .noreturn = true } } }, | |
| 9733 | .{ .tag = .__builtin_eh_return_data_regno, .properties = .{ .param_str = "iIi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9734 | .{ .tag = .__builtin_elementwise_abs, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9735 | .{ .tag = .__builtin_elementwise_add_sat, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9736 | .{ .tag = .__builtin_elementwise_bitreverse, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9737 | .{ .tag = .__builtin_elementwise_canonicalize, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9738 | .{ .tag = .__builtin_elementwise_ceil, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9739 | .{ .tag = .__builtin_elementwise_copysign, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9740 | .{ .tag = .__builtin_elementwise_cos, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9741 | .{ .tag = .__builtin_elementwise_exp, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9742 | .{ .tag = .__builtin_elementwise_exp2, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9743 | .{ .tag = .__builtin_elementwise_floor, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9744 | .{ .tag = .__builtin_elementwise_fma, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9745 | .{ .tag = .__builtin_elementwise_log, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9746 | .{ .tag = .__builtin_elementwise_log10, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9747 | .{ .tag = .__builtin_elementwise_log2, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9748 | .{ .tag = .__builtin_elementwise_max, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9749 | .{ .tag = .__builtin_elementwise_min, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9750 | .{ .tag = .__builtin_elementwise_nearbyint, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9751 | .{ .tag = .__builtin_elementwise_pow, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9752 | .{ .tag = .__builtin_elementwise_rint, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9753 | .{ .tag = .__builtin_elementwise_round, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9754 | .{ .tag = .__builtin_elementwise_roundeven, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9755 | .{ .tag = .__builtin_elementwise_sin, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9756 | .{ .tag = .__builtin_elementwise_sqrt, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9757 | .{ .tag = .__builtin_elementwise_sub_sat, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9758 | .{ .tag = .__builtin_elementwise_trunc, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 9759 | .{ .tag = .__builtin_erf, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9760 | .{ .tag = .__builtin_erfc, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9761 | .{ .tag = .__builtin_erfcf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9762 | .{ .tag = .__builtin_erfcf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9763 | .{ .tag = .__builtin_erfcl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9764 | .{ .tag = .__builtin_erff, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9765 | .{ .tag = .__builtin_erff128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9766 | .{ .tag = .__builtin_erfl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9767 | .{ .tag = .__builtin_exp, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9768 | .{ .tag = .__builtin_exp10, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9769 | .{ .tag = .__builtin_exp10f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9770 | .{ .tag = .__builtin_exp10f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9771 | .{ .tag = .__builtin_exp10f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9772 | .{ .tag = .__builtin_exp10l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9773 | .{ .tag = .__builtin_exp2, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9774 | .{ .tag = .__builtin_exp2f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9775 | .{ .tag = .__builtin_exp2f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9776 | .{ .tag = .__builtin_exp2f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9777 | .{ .tag = .__builtin_exp2l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9778 | .{ .tag = .__builtin_expect, .properties = .{ .param_str = "LiLiLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9779 | .{ .tag = .__builtin_expect_with_probability, .properties = .{ .param_str = "LiLiLid", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9780 | .{ .tag = .__builtin_expf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9781 | .{ .tag = .__builtin_expf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9782 | .{ .tag = .__builtin_expf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9783 | .{ .tag = .__builtin_expl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9784 | .{ .tag = .__builtin_expm1, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9785 | .{ .tag = .__builtin_expm1f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9786 | .{ .tag = .__builtin_expm1f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9787 | .{ .tag = .__builtin_expm1l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9788 | .{ .tag = .__builtin_extend_pointer, .properties = .{ .param_str = "ULLiv*" } }, | |
| 9789 | .{ .tag = .__builtin_extract_return_addr, .properties = .{ .param_str = "v*v*" } }, | |
| 9790 | .{ .tag = .__builtin_fabs, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9791 | .{ .tag = .__builtin_fabsf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9792 | .{ .tag = .__builtin_fabsf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9793 | .{ .tag = .__builtin_fabsf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9794 | .{ .tag = .__builtin_fabsl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9795 | .{ .tag = .__builtin_fdim, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9796 | .{ .tag = .__builtin_fdimf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9797 | .{ .tag = .__builtin_fdimf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9798 | .{ .tag = .__builtin_fdiml, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9799 | .{ .tag = .__builtin_ffs, .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9800 | .{ .tag = .__builtin_ffsl, .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9801 | .{ .tag = .__builtin_ffsll, .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9802 | .{ .tag = .__builtin_floor, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9803 | .{ .tag = .__builtin_floorf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9804 | .{ .tag = .__builtin_floorf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9805 | .{ .tag = .__builtin_floorf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9806 | .{ .tag = .__builtin_floorl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9807 | .{ .tag = .__builtin_flt_rounds, .properties = .{ .param_str = "i" } }, | |
| 9808 | .{ .tag = .__builtin_fma, .properties = .{ .param_str = "dddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9809 | .{ .tag = .__builtin_fmaf, .properties = .{ .param_str = "ffff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9810 | .{ .tag = .__builtin_fmaf128, .properties = .{ .param_str = "LLdLLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9811 | .{ .tag = .__builtin_fmaf16, .properties = .{ .param_str = "hhhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9812 | .{ .tag = .__builtin_fmal, .properties = .{ .param_str = "LdLdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9813 | .{ .tag = .__builtin_fmax, .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9814 | .{ .tag = .__builtin_fmaxf, .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9815 | .{ .tag = .__builtin_fmaxf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9816 | .{ .tag = .__builtin_fmaxf16, .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9817 | .{ .tag = .__builtin_fmaxl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9818 | .{ .tag = .__builtin_fmin, .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9819 | .{ .tag = .__builtin_fminf, .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9820 | .{ .tag = .__builtin_fminf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9821 | .{ .tag = .__builtin_fminf16, .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9822 | .{ .tag = .__builtin_fminl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9823 | .{ .tag = .__builtin_fmod, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9824 | .{ .tag = .__builtin_fmodf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9825 | .{ .tag = .__builtin_fmodf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9826 | .{ .tag = .__builtin_fmodf16, .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9827 | .{ .tag = .__builtin_fmodl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9828 | .{ .tag = .__builtin_fpclassify, .properties = .{ .param_str = "iiiiii.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9829 | .{ .tag = .__builtin_fprintf, .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 9830 | .{ .tag = .__builtin_frame_address, .properties = .{ .param_str = "v*IUi" } }, | |
| 9831 | .{ .tag = .__builtin_free, .properties = .{ .param_str = "vv*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9832 | .{ .tag = .__builtin_frexp, .properties = .{ .param_str = "ddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9833 | .{ .tag = .__builtin_frexpf, .properties = .{ .param_str = "ffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9834 | .{ .tag = .__builtin_frexpf128, .properties = .{ .param_str = "LLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9835 | .{ .tag = .__builtin_frexpf16, .properties = .{ .param_str = "hhi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9836 | .{ .tag = .__builtin_frexpl, .properties = .{ .param_str = "LdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9837 | .{ .tag = .__builtin_frob_return_addr, .properties = .{ .param_str = "v*v*" } }, | |
| 9838 | .{ .tag = .__builtin_fscanf, .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 9839 | .{ .tag = .__builtin_getid, .properties = .{ .param_str = "Si", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, | |
| 9840 | .{ .tag = .__builtin_getps, .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore) } }, | |
| 9841 | .{ .tag = .__builtin_huge_val, .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9842 | .{ .tag = .__builtin_huge_valf, .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9843 | .{ .tag = .__builtin_huge_valf128, .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9844 | .{ .tag = .__builtin_huge_valf16, .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9845 | .{ .tag = .__builtin_huge_vall, .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9846 | .{ .tag = .__builtin_hypot, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9847 | .{ .tag = .__builtin_hypotf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9848 | .{ .tag = .__builtin_hypotf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9849 | .{ .tag = .__builtin_hypotl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9850 | .{ .tag = .__builtin_ia32_rdpmc, .properties = .{ .param_str = "UOii", .target_set = TargetSet.initOne(.x86) } }, | |
| 9851 | .{ .tag = .__builtin_ia32_rdtsc, .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, | |
| 9852 | .{ .tag = .__builtin_ia32_rdtscp, .properties = .{ .param_str = "UOiUi*", .target_set = TargetSet.initOne(.x86) } }, | |
| 9853 | .{ .tag = .__builtin_ilogb, .properties = .{ .param_str = "id", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9854 | .{ .tag = .__builtin_ilogbf, .properties = .{ .param_str = "if", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9855 | .{ .tag = .__builtin_ilogbf128, .properties = .{ .param_str = "iLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9856 | .{ .tag = .__builtin_ilogbl, .properties = .{ .param_str = "iLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9857 | .{ .tag = .__builtin_index, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9858 | .{ .tag = .__builtin_inf, .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9859 | .{ .tag = .__builtin_inff, .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9860 | .{ .tag = .__builtin_inff128, .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9861 | .{ .tag = .__builtin_inff16, .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9862 | .{ .tag = .__builtin_infl, .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 9863 | .{ .tag = .__builtin_init_dwarf_reg_size_table, .properties = .{ .param_str = "vv*" } }, | |
| 9864 | .{ .tag = .__builtin_is_aligned, .properties = .{ .param_str = "bvC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9865 | .{ .tag = .__builtin_isfinite, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9866 | .{ .tag = .__builtin_isfpclass, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9867 | .{ .tag = .__builtin_isgreater, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9868 | .{ .tag = .__builtin_isgreaterequal, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9869 | .{ .tag = .__builtin_isinf, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9870 | .{ .tag = .__builtin_isinf_sign, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9871 | .{ .tag = .__builtin_isless, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9872 | .{ .tag = .__builtin_islessequal, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9873 | .{ .tag = .__builtin_islessgreater, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9874 | .{ .tag = .__builtin_isnan, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9875 | .{ .tag = .__builtin_isnormal, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9876 | .{ .tag = .__builtin_isunordered, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9877 | .{ .tag = .__builtin_labs, .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9878 | .{ .tag = .__builtin_launder, .properties = .{ .param_str = "v*v*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 9879 | .{ .tag = .__builtin_ldexp, .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9880 | .{ .tag = .__builtin_ldexpf, .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9881 | .{ .tag = .__builtin_ldexpf128, .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9882 | .{ .tag = .__builtin_ldexpf16, .properties = .{ .param_str = "hhi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9883 | .{ .tag = .__builtin_ldexpl, .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9884 | .{ .tag = .__builtin_lgamma, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9885 | .{ .tag = .__builtin_lgammaf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9886 | .{ .tag = .__builtin_lgammaf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9887 | .{ .tag = .__builtin_lgammal, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9888 | .{ .tag = .__builtin_llabs, .properties = .{ .param_str = "LLiLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9889 | .{ .tag = .__builtin_llrint, .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9890 | .{ .tag = .__builtin_llrintf, .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9891 | .{ .tag = .__builtin_llrintf128, .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9892 | .{ .tag = .__builtin_llrintl, .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9893 | .{ .tag = .__builtin_llround, .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9894 | .{ .tag = .__builtin_llroundf, .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9895 | .{ .tag = .__builtin_llroundf128, .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9896 | .{ .tag = .__builtin_llroundl, .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9897 | .{ .tag = .__builtin_log, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9898 | .{ .tag = .__builtin_log10, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9899 | .{ .tag = .__builtin_log10f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9900 | .{ .tag = .__builtin_log10f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9901 | .{ .tag = .__builtin_log10f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9902 | .{ .tag = .__builtin_log10l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9903 | .{ .tag = .__builtin_log1p, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9904 | .{ .tag = .__builtin_log1pf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9905 | .{ .tag = .__builtin_log1pf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9906 | .{ .tag = .__builtin_log1pl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9907 | .{ .tag = .__builtin_log2, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9908 | .{ .tag = .__builtin_log2f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9909 | .{ .tag = .__builtin_log2f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9910 | .{ .tag = .__builtin_log2f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9911 | .{ .tag = .__builtin_log2l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9912 | .{ .tag = .__builtin_logb, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9913 | .{ .tag = .__builtin_logbf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9914 | .{ .tag = .__builtin_logbf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9915 | .{ .tag = .__builtin_logbl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9916 | .{ .tag = .__builtin_logf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9917 | .{ .tag = .__builtin_logf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9918 | .{ .tag = .__builtin_logf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9919 | .{ .tag = .__builtin_logl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9920 | .{ .tag = .__builtin_longjmp, .properties = .{ .param_str = "vv**i", .attributes = .{ .noreturn = true } } }, | |
| 9921 | .{ .tag = .__builtin_lrint, .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9922 | .{ .tag = .__builtin_lrintf, .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9923 | .{ .tag = .__builtin_lrintf128, .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9924 | .{ .tag = .__builtin_lrintl, .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9925 | .{ .tag = .__builtin_lround, .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9926 | .{ .tag = .__builtin_lroundf, .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9927 | .{ .tag = .__builtin_lroundf128, .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9928 | .{ .tag = .__builtin_lroundl, .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 9929 | .{ .tag = .__builtin_malloc, .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9930 | .{ .tag = .__builtin_matrix_column_major_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9931 | .{ .tag = .__builtin_matrix_column_major_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9932 | .{ .tag = .__builtin_matrix_transpose, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 9933 | .{ .tag = .__builtin_memchr, .properties = .{ .param_str = "v*vC*iz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9934 | .{ .tag = .__builtin_memcmp, .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9935 | .{ .tag = .__builtin_memcpy, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9936 | .{ .tag = .__builtin_memcpy_inline, .properties = .{ .param_str = "vv*vC*Iz" } }, | |
| 9937 | .{ .tag = .__builtin_memmove, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 9938 | .{ .tag = .__builtin_mempcpy, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9939 | .{ .tag = .__builtin_memset, .properties = .{ .param_str = "v*v*iz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 9940 | .{ .tag = .__builtin_memset_inline, .properties = .{ .param_str = "vv*iIz" } }, | |
| 9941 | .{ .tag = .__builtin_mips_absq_s_ph, .properties = .{ .param_str = "V2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9942 | .{ .tag = .__builtin_mips_absq_s_qb, .properties = .{ .param_str = "V4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9943 | .{ .tag = .__builtin_mips_absq_s_w, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9944 | .{ .tag = .__builtin_mips_addq_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9945 | .{ .tag = .__builtin_mips_addq_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9946 | .{ .tag = .__builtin_mips_addq_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9947 | .{ .tag = .__builtin_mips_addqh_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9948 | .{ .tag = .__builtin_mips_addqh_r_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9949 | .{ .tag = .__builtin_mips_addqh_r_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9950 | .{ .tag = .__builtin_mips_addqh_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9951 | .{ .tag = .__builtin_mips_addsc, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9952 | .{ .tag = .__builtin_mips_addu_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9953 | .{ .tag = .__builtin_mips_addu_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9954 | .{ .tag = .__builtin_mips_addu_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9955 | .{ .tag = .__builtin_mips_addu_s_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9956 | .{ .tag = .__builtin_mips_adduh_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9957 | .{ .tag = .__builtin_mips_adduh_r_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9958 | .{ .tag = .__builtin_mips_addwc, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9959 | .{ .tag = .__builtin_mips_append, .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9960 | .{ .tag = .__builtin_mips_balign, .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9961 | .{ .tag = .__builtin_mips_bitrev, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9962 | .{ .tag = .__builtin_mips_bposge32, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.mips) } }, | |
| 9963 | .{ .tag = .__builtin_mips_cmp_eq_ph, .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9964 | .{ .tag = .__builtin_mips_cmp_le_ph, .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9965 | .{ .tag = .__builtin_mips_cmp_lt_ph, .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9966 | .{ .tag = .__builtin_mips_cmpgdu_eq_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9967 | .{ .tag = .__builtin_mips_cmpgdu_le_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9968 | .{ .tag = .__builtin_mips_cmpgdu_lt_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9969 | .{ .tag = .__builtin_mips_cmpgu_eq_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9970 | .{ .tag = .__builtin_mips_cmpgu_le_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9971 | .{ .tag = .__builtin_mips_cmpgu_lt_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9972 | .{ .tag = .__builtin_mips_cmpu_eq_qb, .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9973 | .{ .tag = .__builtin_mips_cmpu_le_qb, .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9974 | .{ .tag = .__builtin_mips_cmpu_lt_qb, .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 9975 | .{ .tag = .__builtin_mips_dpa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9976 | .{ .tag = .__builtin_mips_dpaq_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9977 | .{ .tag = .__builtin_mips_dpaq_sa_l_w, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9978 | .{ .tag = .__builtin_mips_dpaqx_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9979 | .{ .tag = .__builtin_mips_dpaqx_sa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9980 | .{ .tag = .__builtin_mips_dpau_h_qbl, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9981 | .{ .tag = .__builtin_mips_dpau_h_qbr, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9982 | .{ .tag = .__builtin_mips_dpax_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9983 | .{ .tag = .__builtin_mips_dps_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9984 | .{ .tag = .__builtin_mips_dpsq_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9985 | .{ .tag = .__builtin_mips_dpsq_sa_l_w, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9986 | .{ .tag = .__builtin_mips_dpsqx_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9987 | .{ .tag = .__builtin_mips_dpsqx_sa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 9988 | .{ .tag = .__builtin_mips_dpsu_h_qbl, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9989 | .{ .tag = .__builtin_mips_dpsu_h_qbr, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9990 | .{ .tag = .__builtin_mips_dpsx_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 9991 | .{ .tag = .__builtin_mips_extp, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9992 | .{ .tag = .__builtin_mips_extpdp, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9993 | .{ .tag = .__builtin_mips_extr_r_w, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9994 | .{ .tag = .__builtin_mips_extr_rs_w, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9995 | .{ .tag = .__builtin_mips_extr_s_h, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9996 | .{ .tag = .__builtin_mips_extr_w, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9997 | .{ .tag = .__builtin_mips_insv, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 9998 | .{ .tag = .__builtin_mips_lbux, .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, | |
| 9999 | .{ .tag = .__builtin_mips_lhx, .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, | |
| 10000 | .{ .tag = .__builtin_mips_lwx, .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, | |
| 10001 | .{ .tag = .__builtin_mips_madd, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10002 | .{ .tag = .__builtin_mips_maddu, .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10003 | .{ .tag = .__builtin_mips_maq_s_w_phl, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10004 | .{ .tag = .__builtin_mips_maq_s_w_phr, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10005 | .{ .tag = .__builtin_mips_maq_sa_w_phl, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10006 | .{ .tag = .__builtin_mips_maq_sa_w_phr, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10007 | .{ .tag = .__builtin_mips_modsub, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10008 | .{ .tag = .__builtin_mips_msub, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10009 | .{ .tag = .__builtin_mips_msubu, .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10010 | .{ .tag = .__builtin_mips_mthlip, .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10011 | .{ .tag = .__builtin_mips_mul_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10012 | .{ .tag = .__builtin_mips_mul_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10013 | .{ .tag = .__builtin_mips_muleq_s_w_phl, .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10014 | .{ .tag = .__builtin_mips_muleq_s_w_phr, .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10015 | .{ .tag = .__builtin_mips_muleu_s_ph_qbl, .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10016 | .{ .tag = .__builtin_mips_muleu_s_ph_qbr, .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10017 | .{ .tag = .__builtin_mips_mulq_rs_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10018 | .{ .tag = .__builtin_mips_mulq_rs_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10019 | .{ .tag = .__builtin_mips_mulq_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10020 | .{ .tag = .__builtin_mips_mulq_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10021 | .{ .tag = .__builtin_mips_mulsa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10022 | .{ .tag = .__builtin_mips_mulsaq_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10023 | .{ .tag = .__builtin_mips_mult, .properties = .{ .param_str = "LLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10024 | .{ .tag = .__builtin_mips_multu, .properties = .{ .param_str = "LLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10025 | .{ .tag = .__builtin_mips_packrl_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10026 | .{ .tag = .__builtin_mips_pick_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10027 | .{ .tag = .__builtin_mips_pick_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 10028 | .{ .tag = .__builtin_mips_preceq_w_phl, .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10029 | .{ .tag = .__builtin_mips_preceq_w_phr, .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10030 | .{ .tag = .__builtin_mips_precequ_ph_qbl, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10031 | .{ .tag = .__builtin_mips_precequ_ph_qbla, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10032 | .{ .tag = .__builtin_mips_precequ_ph_qbr, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10033 | .{ .tag = .__builtin_mips_precequ_ph_qbra, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10034 | .{ .tag = .__builtin_mips_preceu_ph_qbl, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10035 | .{ .tag = .__builtin_mips_preceu_ph_qbla, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10036 | .{ .tag = .__builtin_mips_preceu_ph_qbr, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10037 | .{ .tag = .__builtin_mips_preceu_ph_qbra, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10038 | .{ .tag = .__builtin_mips_precr_qb_ph, .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10039 | .{ .tag = .__builtin_mips_precr_sra_ph_w, .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10040 | .{ .tag = .__builtin_mips_precr_sra_r_ph_w, .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10041 | .{ .tag = .__builtin_mips_precrq_ph_w, .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10042 | .{ .tag = .__builtin_mips_precrq_qb_ph, .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10043 | .{ .tag = .__builtin_mips_precrq_rs_ph_w, .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10044 | .{ .tag = .__builtin_mips_precrqu_s_qb_ph, .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10045 | .{ .tag = .__builtin_mips_prepend, .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10046 | .{ .tag = .__builtin_mips_raddu_w_qb, .properties = .{ .param_str = "iV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10047 | .{ .tag = .__builtin_mips_rddsp, .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, | |
| 10048 | .{ .tag = .__builtin_mips_repl_ph, .properties = .{ .param_str = "V2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10049 | .{ .tag = .__builtin_mips_repl_qb, .properties = .{ .param_str = "V4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10050 | .{ .tag = .__builtin_mips_shilo, .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10051 | .{ .tag = .__builtin_mips_shll_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, | |
| 10052 | .{ .tag = .__builtin_mips_shll_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips) } }, | |
| 10053 | .{ .tag = .__builtin_mips_shll_s_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, | |
| 10054 | .{ .tag = .__builtin_mips_shll_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10055 | .{ .tag = .__builtin_mips_shra_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10056 | .{ .tag = .__builtin_mips_shra_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10057 | .{ .tag = .__builtin_mips_shra_r_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10058 | .{ .tag = .__builtin_mips_shra_r_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10059 | .{ .tag = .__builtin_mips_shra_r_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10060 | .{ .tag = .__builtin_mips_shrl_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10061 | .{ .tag = .__builtin_mips_shrl_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10062 | .{ .tag = .__builtin_mips_subq_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10063 | .{ .tag = .__builtin_mips_subq_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10064 | .{ .tag = .__builtin_mips_subq_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10065 | .{ .tag = .__builtin_mips_subqh_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10066 | .{ .tag = .__builtin_mips_subqh_r_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10067 | .{ .tag = .__builtin_mips_subqh_r_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10068 | .{ .tag = .__builtin_mips_subqh_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10069 | .{ .tag = .__builtin_mips_subu_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10070 | .{ .tag = .__builtin_mips_subu_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 10071 | .{ .tag = .__builtin_mips_subu_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, | |
| 10072 | .{ .tag = .__builtin_mips_subu_s_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, | |
| 10073 | .{ .tag = .__builtin_mips_subuh_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10074 | .{ .tag = .__builtin_mips_subuh_r_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10075 | .{ .tag = .__builtin_mips_wrdsp, .properties = .{ .param_str = "viIi", .target_set = TargetSet.initOne(.mips) } }, | |
| 10076 | .{ .tag = .__builtin_modf, .properties = .{ .param_str = "ddd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10077 | .{ .tag = .__builtin_modff, .properties = .{ .param_str = "fff*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10078 | .{ .tag = .__builtin_modff128, .properties = .{ .param_str = "LLdLLdLLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10079 | .{ .tag = .__builtin_modfl, .properties = .{ .param_str = "LdLdLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10080 | .{ .tag = .__builtin_msa_add_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10081 | .{ .tag = .__builtin_msa_add_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10082 | .{ .tag = .__builtin_msa_add_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10083 | .{ .tag = .__builtin_msa_add_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10084 | .{ .tag = .__builtin_msa_adds_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10085 | .{ .tag = .__builtin_msa_adds_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10086 | .{ .tag = .__builtin_msa_adds_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10087 | .{ .tag = .__builtin_msa_adds_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10088 | .{ .tag = .__builtin_msa_adds_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10089 | .{ .tag = .__builtin_msa_adds_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10090 | .{ .tag = .__builtin_msa_adds_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10091 | .{ .tag = .__builtin_msa_adds_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10092 | .{ .tag = .__builtin_msa_adds_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10093 | .{ .tag = .__builtin_msa_adds_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10094 | .{ .tag = .__builtin_msa_adds_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10095 | .{ .tag = .__builtin_msa_adds_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10096 | .{ .tag = .__builtin_msa_addv_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10097 | .{ .tag = .__builtin_msa_addv_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10098 | .{ .tag = .__builtin_msa_addv_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10099 | .{ .tag = .__builtin_msa_addv_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10100 | .{ .tag = .__builtin_msa_addvi_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10101 | .{ .tag = .__builtin_msa_addvi_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10102 | .{ .tag = .__builtin_msa_addvi_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10103 | .{ .tag = .__builtin_msa_addvi_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10104 | .{ .tag = .__builtin_msa_and_v, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10105 | .{ .tag = .__builtin_msa_andi_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10106 | .{ .tag = .__builtin_msa_asub_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10107 | .{ .tag = .__builtin_msa_asub_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10108 | .{ .tag = .__builtin_msa_asub_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10109 | .{ .tag = .__builtin_msa_asub_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10110 | .{ .tag = .__builtin_msa_asub_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10111 | .{ .tag = .__builtin_msa_asub_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10112 | .{ .tag = .__builtin_msa_asub_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10113 | .{ .tag = .__builtin_msa_asub_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10114 | .{ .tag = .__builtin_msa_ave_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10115 | .{ .tag = .__builtin_msa_ave_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10116 | .{ .tag = .__builtin_msa_ave_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10117 | .{ .tag = .__builtin_msa_ave_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10118 | .{ .tag = .__builtin_msa_ave_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10119 | .{ .tag = .__builtin_msa_ave_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10120 | .{ .tag = .__builtin_msa_ave_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10121 | .{ .tag = .__builtin_msa_ave_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10122 | .{ .tag = .__builtin_msa_aver_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10123 | .{ .tag = .__builtin_msa_aver_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10124 | .{ .tag = .__builtin_msa_aver_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10125 | .{ .tag = .__builtin_msa_aver_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10126 | .{ .tag = .__builtin_msa_aver_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10127 | .{ .tag = .__builtin_msa_aver_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10128 | .{ .tag = .__builtin_msa_aver_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10129 | .{ .tag = .__builtin_msa_aver_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10130 | .{ .tag = .__builtin_msa_bclr_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10131 | .{ .tag = .__builtin_msa_bclr_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10132 | .{ .tag = .__builtin_msa_bclr_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10133 | .{ .tag = .__builtin_msa_bclr_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10134 | .{ .tag = .__builtin_msa_bclri_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10135 | .{ .tag = .__builtin_msa_bclri_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10136 | .{ .tag = .__builtin_msa_bclri_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10137 | .{ .tag = .__builtin_msa_bclri_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10138 | .{ .tag = .__builtin_msa_binsl_b, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10139 | .{ .tag = .__builtin_msa_binsl_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10140 | .{ .tag = .__builtin_msa_binsl_h, .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10141 | .{ .tag = .__builtin_msa_binsl_w, .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10142 | .{ .tag = .__builtin_msa_binsli_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10143 | .{ .tag = .__builtin_msa_binsli_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10144 | .{ .tag = .__builtin_msa_binsli_h, .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10145 | .{ .tag = .__builtin_msa_binsli_w, .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10146 | .{ .tag = .__builtin_msa_binsr_b, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10147 | .{ .tag = .__builtin_msa_binsr_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10148 | .{ .tag = .__builtin_msa_binsr_h, .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10149 | .{ .tag = .__builtin_msa_binsr_w, .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10150 | .{ .tag = .__builtin_msa_binsri_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10151 | .{ .tag = .__builtin_msa_binsri_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10152 | .{ .tag = .__builtin_msa_binsri_h, .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10153 | .{ .tag = .__builtin_msa_binsri_w, .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10154 | .{ .tag = .__builtin_msa_bmnz_v, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10155 | .{ .tag = .__builtin_msa_bmnzi_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10156 | .{ .tag = .__builtin_msa_bmz_v, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10157 | .{ .tag = .__builtin_msa_bmzi_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10158 | .{ .tag = .__builtin_msa_bneg_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10159 | .{ .tag = .__builtin_msa_bneg_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10160 | .{ .tag = .__builtin_msa_bneg_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10161 | .{ .tag = .__builtin_msa_bneg_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10162 | .{ .tag = .__builtin_msa_bnegi_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10163 | .{ .tag = .__builtin_msa_bnegi_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10164 | .{ .tag = .__builtin_msa_bnegi_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10165 | .{ .tag = .__builtin_msa_bnegi_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10166 | .{ .tag = .__builtin_msa_bnz_b, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10167 | .{ .tag = .__builtin_msa_bnz_d, .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10168 | .{ .tag = .__builtin_msa_bnz_h, .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10169 | .{ .tag = .__builtin_msa_bnz_v, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10170 | .{ .tag = .__builtin_msa_bnz_w, .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10171 | .{ .tag = .__builtin_msa_bsel_v, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10172 | .{ .tag = .__builtin_msa_bseli_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10173 | .{ .tag = .__builtin_msa_bset_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10174 | .{ .tag = .__builtin_msa_bset_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10175 | .{ .tag = .__builtin_msa_bset_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10176 | .{ .tag = .__builtin_msa_bset_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10177 | .{ .tag = .__builtin_msa_bseti_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10178 | .{ .tag = .__builtin_msa_bseti_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10179 | .{ .tag = .__builtin_msa_bseti_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10180 | .{ .tag = .__builtin_msa_bseti_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10181 | .{ .tag = .__builtin_msa_bz_b, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10182 | .{ .tag = .__builtin_msa_bz_d, .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10183 | .{ .tag = .__builtin_msa_bz_h, .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10184 | .{ .tag = .__builtin_msa_bz_v, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10185 | .{ .tag = .__builtin_msa_bz_w, .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10186 | .{ .tag = .__builtin_msa_ceq_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10187 | .{ .tag = .__builtin_msa_ceq_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10188 | .{ .tag = .__builtin_msa_ceq_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10189 | .{ .tag = .__builtin_msa_ceq_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10190 | .{ .tag = .__builtin_msa_ceqi_b, .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10191 | .{ .tag = .__builtin_msa_ceqi_d, .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10192 | .{ .tag = .__builtin_msa_ceqi_h, .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10193 | .{ .tag = .__builtin_msa_ceqi_w, .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10194 | .{ .tag = .__builtin_msa_cfcmsa, .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, | |
| 10195 | .{ .tag = .__builtin_msa_cle_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10196 | .{ .tag = .__builtin_msa_cle_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10197 | .{ .tag = .__builtin_msa_cle_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10198 | .{ .tag = .__builtin_msa_cle_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10199 | .{ .tag = .__builtin_msa_cle_u_b, .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10200 | .{ .tag = .__builtin_msa_cle_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10201 | .{ .tag = .__builtin_msa_cle_u_h, .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10202 | .{ .tag = .__builtin_msa_cle_u_w, .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10203 | .{ .tag = .__builtin_msa_clei_s_b, .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10204 | .{ .tag = .__builtin_msa_clei_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10205 | .{ .tag = .__builtin_msa_clei_s_h, .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10206 | .{ .tag = .__builtin_msa_clei_s_w, .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10207 | .{ .tag = .__builtin_msa_clei_u_b, .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10208 | .{ .tag = .__builtin_msa_clei_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10209 | .{ .tag = .__builtin_msa_clei_u_h, .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10210 | .{ .tag = .__builtin_msa_clei_u_w, .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10211 | .{ .tag = .__builtin_msa_clt_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10212 | .{ .tag = .__builtin_msa_clt_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10213 | .{ .tag = .__builtin_msa_clt_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10214 | .{ .tag = .__builtin_msa_clt_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10215 | .{ .tag = .__builtin_msa_clt_u_b, .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10216 | .{ .tag = .__builtin_msa_clt_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10217 | .{ .tag = .__builtin_msa_clt_u_h, .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10218 | .{ .tag = .__builtin_msa_clt_u_w, .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10219 | .{ .tag = .__builtin_msa_clti_s_b, .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10220 | .{ .tag = .__builtin_msa_clti_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10221 | .{ .tag = .__builtin_msa_clti_s_h, .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10222 | .{ .tag = .__builtin_msa_clti_s_w, .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10223 | .{ .tag = .__builtin_msa_clti_u_b, .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10224 | .{ .tag = .__builtin_msa_clti_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10225 | .{ .tag = .__builtin_msa_clti_u_h, .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10226 | .{ .tag = .__builtin_msa_clti_u_w, .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10227 | .{ .tag = .__builtin_msa_copy_s_b, .properties = .{ .param_str = "iV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10228 | .{ .tag = .__builtin_msa_copy_s_d, .properties = .{ .param_str = "LLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10229 | .{ .tag = .__builtin_msa_copy_s_h, .properties = .{ .param_str = "iV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10230 | .{ .tag = .__builtin_msa_copy_s_w, .properties = .{ .param_str = "iV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10231 | .{ .tag = .__builtin_msa_copy_u_b, .properties = .{ .param_str = "iV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10232 | .{ .tag = .__builtin_msa_copy_u_d, .properties = .{ .param_str = "LLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10233 | .{ .tag = .__builtin_msa_copy_u_h, .properties = .{ .param_str = "iV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10234 | .{ .tag = .__builtin_msa_copy_u_w, .properties = .{ .param_str = "iV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10235 | .{ .tag = .__builtin_msa_ctcmsa, .properties = .{ .param_str = "vIii", .target_set = TargetSet.initOne(.mips) } }, | |
| 10236 | .{ .tag = .__builtin_msa_div_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10237 | .{ .tag = .__builtin_msa_div_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10238 | .{ .tag = .__builtin_msa_div_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10239 | .{ .tag = .__builtin_msa_div_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10240 | .{ .tag = .__builtin_msa_div_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10241 | .{ .tag = .__builtin_msa_div_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10242 | .{ .tag = .__builtin_msa_div_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10243 | .{ .tag = .__builtin_msa_div_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10244 | .{ .tag = .__builtin_msa_dotp_s_d, .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10245 | .{ .tag = .__builtin_msa_dotp_s_h, .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10246 | .{ .tag = .__builtin_msa_dotp_s_w, .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10247 | .{ .tag = .__builtin_msa_dotp_u_d, .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10248 | .{ .tag = .__builtin_msa_dotp_u_h, .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10249 | .{ .tag = .__builtin_msa_dotp_u_w, .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10250 | .{ .tag = .__builtin_msa_dpadd_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10251 | .{ .tag = .__builtin_msa_dpadd_s_h, .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10252 | .{ .tag = .__builtin_msa_dpadd_s_w, .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10253 | .{ .tag = .__builtin_msa_dpadd_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10254 | .{ .tag = .__builtin_msa_dpadd_u_h, .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10255 | .{ .tag = .__builtin_msa_dpadd_u_w, .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10256 | .{ .tag = .__builtin_msa_dpsub_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10257 | .{ .tag = .__builtin_msa_dpsub_s_h, .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10258 | .{ .tag = .__builtin_msa_dpsub_s_w, .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10259 | .{ .tag = .__builtin_msa_dpsub_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10260 | .{ .tag = .__builtin_msa_dpsub_u_h, .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10261 | .{ .tag = .__builtin_msa_dpsub_u_w, .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10262 | .{ .tag = .__builtin_msa_fadd_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10263 | .{ .tag = .__builtin_msa_fadd_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10264 | .{ .tag = .__builtin_msa_fcaf_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10265 | .{ .tag = .__builtin_msa_fcaf_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10266 | .{ .tag = .__builtin_msa_fceq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10267 | .{ .tag = .__builtin_msa_fceq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10268 | .{ .tag = .__builtin_msa_fclass_d, .properties = .{ .param_str = "V2LLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10269 | .{ .tag = .__builtin_msa_fclass_w, .properties = .{ .param_str = "V4iV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10270 | .{ .tag = .__builtin_msa_fcle_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10271 | .{ .tag = .__builtin_msa_fcle_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10272 | .{ .tag = .__builtin_msa_fclt_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10273 | .{ .tag = .__builtin_msa_fclt_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10274 | .{ .tag = .__builtin_msa_fcne_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10275 | .{ .tag = .__builtin_msa_fcne_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10276 | .{ .tag = .__builtin_msa_fcor_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10277 | .{ .tag = .__builtin_msa_fcor_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10278 | .{ .tag = .__builtin_msa_fcueq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10279 | .{ .tag = .__builtin_msa_fcueq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10280 | .{ .tag = .__builtin_msa_fcule_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10281 | .{ .tag = .__builtin_msa_fcule_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10282 | .{ .tag = .__builtin_msa_fcult_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10283 | .{ .tag = .__builtin_msa_fcult_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10284 | .{ .tag = .__builtin_msa_fcun_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10285 | .{ .tag = .__builtin_msa_fcun_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10286 | .{ .tag = .__builtin_msa_fcune_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10287 | .{ .tag = .__builtin_msa_fcune_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10288 | .{ .tag = .__builtin_msa_fdiv_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10289 | .{ .tag = .__builtin_msa_fdiv_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10290 | .{ .tag = .__builtin_msa_fexdo_h, .properties = .{ .param_str = "V8hV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10291 | .{ .tag = .__builtin_msa_fexdo_w, .properties = .{ .param_str = "V4fV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10292 | .{ .tag = .__builtin_msa_fexp2_d, .properties = .{ .param_str = "V2dV2dV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10293 | .{ .tag = .__builtin_msa_fexp2_w, .properties = .{ .param_str = "V4fV4fV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10294 | .{ .tag = .__builtin_msa_fexupl_d, .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10295 | .{ .tag = .__builtin_msa_fexupl_w, .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10296 | .{ .tag = .__builtin_msa_fexupr_d, .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10297 | .{ .tag = .__builtin_msa_fexupr_w, .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10298 | .{ .tag = .__builtin_msa_ffint_s_d, .properties = .{ .param_str = "V2dV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10299 | .{ .tag = .__builtin_msa_ffint_s_w, .properties = .{ .param_str = "V4fV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10300 | .{ .tag = .__builtin_msa_ffint_u_d, .properties = .{ .param_str = "V2dV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10301 | .{ .tag = .__builtin_msa_ffint_u_w, .properties = .{ .param_str = "V4fV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10302 | .{ .tag = .__builtin_msa_ffql_d, .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10303 | .{ .tag = .__builtin_msa_ffql_w, .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10304 | .{ .tag = .__builtin_msa_ffqr_d, .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10305 | .{ .tag = .__builtin_msa_ffqr_w, .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10306 | .{ .tag = .__builtin_msa_fill_b, .properties = .{ .param_str = "V16Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10307 | .{ .tag = .__builtin_msa_fill_d, .properties = .{ .param_str = "V2SLLiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10308 | .{ .tag = .__builtin_msa_fill_h, .properties = .{ .param_str = "V8Ssi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10309 | .{ .tag = .__builtin_msa_fill_w, .properties = .{ .param_str = "V4Sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10310 | .{ .tag = .__builtin_msa_flog2_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10311 | .{ .tag = .__builtin_msa_flog2_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10312 | .{ .tag = .__builtin_msa_fmadd_d, .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10313 | .{ .tag = .__builtin_msa_fmadd_w, .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10314 | .{ .tag = .__builtin_msa_fmax_a_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10315 | .{ .tag = .__builtin_msa_fmax_a_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10316 | .{ .tag = .__builtin_msa_fmax_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10317 | .{ .tag = .__builtin_msa_fmax_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10318 | .{ .tag = .__builtin_msa_fmin_a_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10319 | .{ .tag = .__builtin_msa_fmin_a_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10320 | .{ .tag = .__builtin_msa_fmin_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10321 | .{ .tag = .__builtin_msa_fmin_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10322 | .{ .tag = .__builtin_msa_fmsub_d, .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10323 | .{ .tag = .__builtin_msa_fmsub_w, .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10324 | .{ .tag = .__builtin_msa_fmul_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10325 | .{ .tag = .__builtin_msa_fmul_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10326 | .{ .tag = .__builtin_msa_frcp_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10327 | .{ .tag = .__builtin_msa_frcp_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10328 | .{ .tag = .__builtin_msa_frint_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10329 | .{ .tag = .__builtin_msa_frint_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10330 | .{ .tag = .__builtin_msa_frsqrt_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10331 | .{ .tag = .__builtin_msa_frsqrt_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10332 | .{ .tag = .__builtin_msa_fsaf_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10333 | .{ .tag = .__builtin_msa_fsaf_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10334 | .{ .tag = .__builtin_msa_fseq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10335 | .{ .tag = .__builtin_msa_fseq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10336 | .{ .tag = .__builtin_msa_fsle_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10337 | .{ .tag = .__builtin_msa_fsle_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10338 | .{ .tag = .__builtin_msa_fslt_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10339 | .{ .tag = .__builtin_msa_fslt_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10340 | .{ .tag = .__builtin_msa_fsne_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10341 | .{ .tag = .__builtin_msa_fsne_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10342 | .{ .tag = .__builtin_msa_fsor_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10343 | .{ .tag = .__builtin_msa_fsor_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10344 | .{ .tag = .__builtin_msa_fsqrt_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10345 | .{ .tag = .__builtin_msa_fsqrt_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10346 | .{ .tag = .__builtin_msa_fsub_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10347 | .{ .tag = .__builtin_msa_fsub_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10348 | .{ .tag = .__builtin_msa_fsueq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10349 | .{ .tag = .__builtin_msa_fsueq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10350 | .{ .tag = .__builtin_msa_fsule_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10351 | .{ .tag = .__builtin_msa_fsule_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10352 | .{ .tag = .__builtin_msa_fsult_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10353 | .{ .tag = .__builtin_msa_fsult_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10354 | .{ .tag = .__builtin_msa_fsun_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10355 | .{ .tag = .__builtin_msa_fsun_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10356 | .{ .tag = .__builtin_msa_fsune_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10357 | .{ .tag = .__builtin_msa_fsune_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10358 | .{ .tag = .__builtin_msa_ftint_s_d, .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10359 | .{ .tag = .__builtin_msa_ftint_s_w, .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10360 | .{ .tag = .__builtin_msa_ftint_u_d, .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10361 | .{ .tag = .__builtin_msa_ftint_u_w, .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10362 | .{ .tag = .__builtin_msa_ftq_h, .properties = .{ .param_str = "V4UiV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10363 | .{ .tag = .__builtin_msa_ftq_w, .properties = .{ .param_str = "V2ULLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10364 | .{ .tag = .__builtin_msa_ftrunc_s_d, .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10365 | .{ .tag = .__builtin_msa_ftrunc_s_w, .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10366 | .{ .tag = .__builtin_msa_ftrunc_u_d, .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10367 | .{ .tag = .__builtin_msa_ftrunc_u_w, .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10368 | .{ .tag = .__builtin_msa_hadd_s_d, .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10369 | .{ .tag = .__builtin_msa_hadd_s_h, .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10370 | .{ .tag = .__builtin_msa_hadd_s_w, .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10371 | .{ .tag = .__builtin_msa_hadd_u_d, .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10372 | .{ .tag = .__builtin_msa_hadd_u_h, .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10373 | .{ .tag = .__builtin_msa_hadd_u_w, .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10374 | .{ .tag = .__builtin_msa_hsub_s_d, .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10375 | .{ .tag = .__builtin_msa_hsub_s_h, .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10376 | .{ .tag = .__builtin_msa_hsub_s_w, .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10377 | .{ .tag = .__builtin_msa_hsub_u_d, .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10378 | .{ .tag = .__builtin_msa_hsub_u_h, .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10379 | .{ .tag = .__builtin_msa_hsub_u_w, .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10380 | .{ .tag = .__builtin_msa_ilvev_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10381 | .{ .tag = .__builtin_msa_ilvev_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10382 | .{ .tag = .__builtin_msa_ilvev_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10383 | .{ .tag = .__builtin_msa_ilvev_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10384 | .{ .tag = .__builtin_msa_ilvl_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10385 | .{ .tag = .__builtin_msa_ilvl_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10386 | .{ .tag = .__builtin_msa_ilvl_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10387 | .{ .tag = .__builtin_msa_ilvl_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10388 | .{ .tag = .__builtin_msa_ilvod_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10389 | .{ .tag = .__builtin_msa_ilvod_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10390 | .{ .tag = .__builtin_msa_ilvod_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10391 | .{ .tag = .__builtin_msa_ilvod_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10392 | .{ .tag = .__builtin_msa_ilvr_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10393 | .{ .tag = .__builtin_msa_ilvr_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10394 | .{ .tag = .__builtin_msa_ilvr_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10395 | .{ .tag = .__builtin_msa_ilvr_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10396 | .{ .tag = .__builtin_msa_insert_b, .properties = .{ .param_str = "V16ScV16ScIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10397 | .{ .tag = .__builtin_msa_insert_d, .properties = .{ .param_str = "V2SLLiV2SLLiIUiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10398 | .{ .tag = .__builtin_msa_insert_h, .properties = .{ .param_str = "V8SsV8SsIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10399 | .{ .tag = .__builtin_msa_insert_w, .properties = .{ .param_str = "V4SiV4SiIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10400 | .{ .tag = .__builtin_msa_insve_b, .properties = .{ .param_str = "V16ScV16ScIUiV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10401 | .{ .tag = .__builtin_msa_insve_d, .properties = .{ .param_str = "V2SLLiV2SLLiIUiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10402 | .{ .tag = .__builtin_msa_insve_h, .properties = .{ .param_str = "V8SsV8SsIUiV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10403 | .{ .tag = .__builtin_msa_insve_w, .properties = .{ .param_str = "V4SiV4SiIUiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10404 | .{ .tag = .__builtin_msa_ld_b, .properties = .{ .param_str = "V16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10405 | .{ .tag = .__builtin_msa_ld_d, .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10406 | .{ .tag = .__builtin_msa_ld_h, .properties = .{ .param_str = "V8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10407 | .{ .tag = .__builtin_msa_ld_w, .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10408 | .{ .tag = .__builtin_msa_ldi_b, .properties = .{ .param_str = "V16cIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10409 | .{ .tag = .__builtin_msa_ldi_d, .properties = .{ .param_str = "V2LLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10410 | .{ .tag = .__builtin_msa_ldi_h, .properties = .{ .param_str = "V8sIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10411 | .{ .tag = .__builtin_msa_ldi_w, .properties = .{ .param_str = "V4iIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10412 | .{ .tag = .__builtin_msa_ldr_d, .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10413 | .{ .tag = .__builtin_msa_ldr_w, .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10414 | .{ .tag = .__builtin_msa_madd_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10415 | .{ .tag = .__builtin_msa_madd_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10416 | .{ .tag = .__builtin_msa_maddr_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10417 | .{ .tag = .__builtin_msa_maddr_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10418 | .{ .tag = .__builtin_msa_maddv_b, .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10419 | .{ .tag = .__builtin_msa_maddv_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10420 | .{ .tag = .__builtin_msa_maddv_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10421 | .{ .tag = .__builtin_msa_maddv_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10422 | .{ .tag = .__builtin_msa_max_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10423 | .{ .tag = .__builtin_msa_max_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10424 | .{ .tag = .__builtin_msa_max_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10425 | .{ .tag = .__builtin_msa_max_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10426 | .{ .tag = .__builtin_msa_max_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10427 | .{ .tag = .__builtin_msa_max_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10428 | .{ .tag = .__builtin_msa_max_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10429 | .{ .tag = .__builtin_msa_max_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10430 | .{ .tag = .__builtin_msa_max_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10431 | .{ .tag = .__builtin_msa_max_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10432 | .{ .tag = .__builtin_msa_max_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10433 | .{ .tag = .__builtin_msa_max_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10434 | .{ .tag = .__builtin_msa_maxi_s_b, .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10435 | .{ .tag = .__builtin_msa_maxi_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10436 | .{ .tag = .__builtin_msa_maxi_s_h, .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10437 | .{ .tag = .__builtin_msa_maxi_s_w, .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10438 | .{ .tag = .__builtin_msa_maxi_u_b, .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10439 | .{ .tag = .__builtin_msa_maxi_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10440 | .{ .tag = .__builtin_msa_maxi_u_h, .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10441 | .{ .tag = .__builtin_msa_maxi_u_w, .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10442 | .{ .tag = .__builtin_msa_min_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10443 | .{ .tag = .__builtin_msa_min_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10444 | .{ .tag = .__builtin_msa_min_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10445 | .{ .tag = .__builtin_msa_min_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10446 | .{ .tag = .__builtin_msa_min_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10447 | .{ .tag = .__builtin_msa_min_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10448 | .{ .tag = .__builtin_msa_min_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10449 | .{ .tag = .__builtin_msa_min_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10450 | .{ .tag = .__builtin_msa_min_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10451 | .{ .tag = .__builtin_msa_min_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10452 | .{ .tag = .__builtin_msa_min_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10453 | .{ .tag = .__builtin_msa_min_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10454 | .{ .tag = .__builtin_msa_mini_s_b, .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10455 | .{ .tag = .__builtin_msa_mini_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10456 | .{ .tag = .__builtin_msa_mini_s_h, .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10457 | .{ .tag = .__builtin_msa_mini_s_w, .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10458 | .{ .tag = .__builtin_msa_mini_u_b, .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10459 | .{ .tag = .__builtin_msa_mini_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10460 | .{ .tag = .__builtin_msa_mini_u_h, .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10461 | .{ .tag = .__builtin_msa_mini_u_w, .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10462 | .{ .tag = .__builtin_msa_mod_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10463 | .{ .tag = .__builtin_msa_mod_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10464 | .{ .tag = .__builtin_msa_mod_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10465 | .{ .tag = .__builtin_msa_mod_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10466 | .{ .tag = .__builtin_msa_mod_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10467 | .{ .tag = .__builtin_msa_mod_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10468 | .{ .tag = .__builtin_msa_mod_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10469 | .{ .tag = .__builtin_msa_mod_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10470 | .{ .tag = .__builtin_msa_move_v, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10471 | .{ .tag = .__builtin_msa_msub_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10472 | .{ .tag = .__builtin_msa_msub_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10473 | .{ .tag = .__builtin_msa_msubr_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10474 | .{ .tag = .__builtin_msa_msubr_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10475 | .{ .tag = .__builtin_msa_msubv_b, .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10476 | .{ .tag = .__builtin_msa_msubv_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10477 | .{ .tag = .__builtin_msa_msubv_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10478 | .{ .tag = .__builtin_msa_msubv_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10479 | .{ .tag = .__builtin_msa_mul_q_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10480 | .{ .tag = .__builtin_msa_mul_q_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10481 | .{ .tag = .__builtin_msa_mulr_q_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10482 | .{ .tag = .__builtin_msa_mulr_q_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10483 | .{ .tag = .__builtin_msa_mulv_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10484 | .{ .tag = .__builtin_msa_mulv_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10485 | .{ .tag = .__builtin_msa_mulv_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10486 | .{ .tag = .__builtin_msa_mulv_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10487 | .{ .tag = .__builtin_msa_nloc_b, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10488 | .{ .tag = .__builtin_msa_nloc_d, .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10489 | .{ .tag = .__builtin_msa_nloc_h, .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10490 | .{ .tag = .__builtin_msa_nloc_w, .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10491 | .{ .tag = .__builtin_msa_nlzc_b, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10492 | .{ .tag = .__builtin_msa_nlzc_d, .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10493 | .{ .tag = .__builtin_msa_nlzc_h, .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10494 | .{ .tag = .__builtin_msa_nlzc_w, .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10495 | .{ .tag = .__builtin_msa_nor_v, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10496 | .{ .tag = .__builtin_msa_nori_b, .properties = .{ .param_str = "V16UcV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10497 | .{ .tag = .__builtin_msa_or_v, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10498 | .{ .tag = .__builtin_msa_ori_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10499 | .{ .tag = .__builtin_msa_pckev_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10500 | .{ .tag = .__builtin_msa_pckev_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10501 | .{ .tag = .__builtin_msa_pckev_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10502 | .{ .tag = .__builtin_msa_pckev_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10503 | .{ .tag = .__builtin_msa_pckod_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10504 | .{ .tag = .__builtin_msa_pckod_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10505 | .{ .tag = .__builtin_msa_pckod_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10506 | .{ .tag = .__builtin_msa_pckod_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10507 | .{ .tag = .__builtin_msa_pcnt_b, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10508 | .{ .tag = .__builtin_msa_pcnt_d, .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10509 | .{ .tag = .__builtin_msa_pcnt_h, .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10510 | .{ .tag = .__builtin_msa_pcnt_w, .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10511 | .{ .tag = .__builtin_msa_sat_s_b, .properties = .{ .param_str = "V16ScV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10512 | .{ .tag = .__builtin_msa_sat_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10513 | .{ .tag = .__builtin_msa_sat_s_h, .properties = .{ .param_str = "V8SsV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10514 | .{ .tag = .__builtin_msa_sat_s_w, .properties = .{ .param_str = "V4SiV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10515 | .{ .tag = .__builtin_msa_sat_u_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10516 | .{ .tag = .__builtin_msa_sat_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10517 | .{ .tag = .__builtin_msa_sat_u_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10518 | .{ .tag = .__builtin_msa_sat_u_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10519 | .{ .tag = .__builtin_msa_shf_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10520 | .{ .tag = .__builtin_msa_shf_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10521 | .{ .tag = .__builtin_msa_shf_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10522 | .{ .tag = .__builtin_msa_sld_b, .properties = .{ .param_str = "V16cV16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10523 | .{ .tag = .__builtin_msa_sld_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10524 | .{ .tag = .__builtin_msa_sld_h, .properties = .{ .param_str = "V8sV8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10525 | .{ .tag = .__builtin_msa_sld_w, .properties = .{ .param_str = "V4iV4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10526 | .{ .tag = .__builtin_msa_sldi_b, .properties = .{ .param_str = "V16cV16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10527 | .{ .tag = .__builtin_msa_sldi_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10528 | .{ .tag = .__builtin_msa_sldi_h, .properties = .{ .param_str = "V8sV8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10529 | .{ .tag = .__builtin_msa_sldi_w, .properties = .{ .param_str = "V4iV4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10530 | .{ .tag = .__builtin_msa_sll_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10531 | .{ .tag = .__builtin_msa_sll_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10532 | .{ .tag = .__builtin_msa_sll_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10533 | .{ .tag = .__builtin_msa_sll_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10534 | .{ .tag = .__builtin_msa_slli_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10535 | .{ .tag = .__builtin_msa_slli_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10536 | .{ .tag = .__builtin_msa_slli_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10537 | .{ .tag = .__builtin_msa_slli_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10538 | .{ .tag = .__builtin_msa_splat_b, .properties = .{ .param_str = "V16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10539 | .{ .tag = .__builtin_msa_splat_d, .properties = .{ .param_str = "V2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10540 | .{ .tag = .__builtin_msa_splat_h, .properties = .{ .param_str = "V8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10541 | .{ .tag = .__builtin_msa_splat_w, .properties = .{ .param_str = "V4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10542 | .{ .tag = .__builtin_msa_splati_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10543 | .{ .tag = .__builtin_msa_splati_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10544 | .{ .tag = .__builtin_msa_splati_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10545 | .{ .tag = .__builtin_msa_splati_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10546 | .{ .tag = .__builtin_msa_sra_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10547 | .{ .tag = .__builtin_msa_sra_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10548 | .{ .tag = .__builtin_msa_sra_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10549 | .{ .tag = .__builtin_msa_sra_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10550 | .{ .tag = .__builtin_msa_srai_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10551 | .{ .tag = .__builtin_msa_srai_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10552 | .{ .tag = .__builtin_msa_srai_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10553 | .{ .tag = .__builtin_msa_srai_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10554 | .{ .tag = .__builtin_msa_srar_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10555 | .{ .tag = .__builtin_msa_srar_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10556 | .{ .tag = .__builtin_msa_srar_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10557 | .{ .tag = .__builtin_msa_srar_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10558 | .{ .tag = .__builtin_msa_srari_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10559 | .{ .tag = .__builtin_msa_srari_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10560 | .{ .tag = .__builtin_msa_srari_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10561 | .{ .tag = .__builtin_msa_srari_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10562 | .{ .tag = .__builtin_msa_srl_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10563 | .{ .tag = .__builtin_msa_srl_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10564 | .{ .tag = .__builtin_msa_srl_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10565 | .{ .tag = .__builtin_msa_srl_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10566 | .{ .tag = .__builtin_msa_srli_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10567 | .{ .tag = .__builtin_msa_srli_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10568 | .{ .tag = .__builtin_msa_srli_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10569 | .{ .tag = .__builtin_msa_srli_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10570 | .{ .tag = .__builtin_msa_srlr_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10571 | .{ .tag = .__builtin_msa_srlr_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10572 | .{ .tag = .__builtin_msa_srlr_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10573 | .{ .tag = .__builtin_msa_srlr_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10574 | .{ .tag = .__builtin_msa_srlri_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10575 | .{ .tag = .__builtin_msa_srlri_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10576 | .{ .tag = .__builtin_msa_srlri_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10577 | .{ .tag = .__builtin_msa_srlri_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10578 | .{ .tag = .__builtin_msa_st_b, .properties = .{ .param_str = "vV16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10579 | .{ .tag = .__builtin_msa_st_d, .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10580 | .{ .tag = .__builtin_msa_st_h, .properties = .{ .param_str = "vV8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10581 | .{ .tag = .__builtin_msa_st_w, .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10582 | .{ .tag = .__builtin_msa_str_d, .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10583 | .{ .tag = .__builtin_msa_str_w, .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10584 | .{ .tag = .__builtin_msa_subs_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10585 | .{ .tag = .__builtin_msa_subs_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10586 | .{ .tag = .__builtin_msa_subs_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10587 | .{ .tag = .__builtin_msa_subs_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10588 | .{ .tag = .__builtin_msa_subs_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10589 | .{ .tag = .__builtin_msa_subs_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10590 | .{ .tag = .__builtin_msa_subs_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10591 | .{ .tag = .__builtin_msa_subs_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10592 | .{ .tag = .__builtin_msa_subsus_u_b, .properties = .{ .param_str = "V16UcV16UcV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10593 | .{ .tag = .__builtin_msa_subsus_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10594 | .{ .tag = .__builtin_msa_subsus_u_h, .properties = .{ .param_str = "V8UsV8UsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10595 | .{ .tag = .__builtin_msa_subsus_u_w, .properties = .{ .param_str = "V4UiV4UiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10596 | .{ .tag = .__builtin_msa_subsuu_s_b, .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10597 | .{ .tag = .__builtin_msa_subsuu_s_d, .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10598 | .{ .tag = .__builtin_msa_subsuu_s_h, .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10599 | .{ .tag = .__builtin_msa_subsuu_s_w, .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10600 | .{ .tag = .__builtin_msa_subv_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10601 | .{ .tag = .__builtin_msa_subv_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10602 | .{ .tag = .__builtin_msa_subv_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10603 | .{ .tag = .__builtin_msa_subv_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10604 | .{ .tag = .__builtin_msa_subvi_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10605 | .{ .tag = .__builtin_msa_subvi_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10606 | .{ .tag = .__builtin_msa_subvi_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10607 | .{ .tag = .__builtin_msa_subvi_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10608 | .{ .tag = .__builtin_msa_vshf_b, .properties = .{ .param_str = "V16cV16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10609 | .{ .tag = .__builtin_msa_vshf_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10610 | .{ .tag = .__builtin_msa_vshf_h, .properties = .{ .param_str = "V8sV8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10611 | .{ .tag = .__builtin_msa_vshf_w, .properties = .{ .param_str = "V4iV4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10612 | .{ .tag = .__builtin_msa_xor_v, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10613 | .{ .tag = .__builtin_msa_xori_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, | |
| 10614 | .{ .tag = .__builtin_mul_overflow, .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 10615 | .{ .tag = .__builtin_nan, .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10616 | .{ .tag = .__builtin_nanf, .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10617 | .{ .tag = .__builtin_nanf128, .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10618 | .{ .tag = .__builtin_nanf16, .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10619 | .{ .tag = .__builtin_nanl, .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10620 | .{ .tag = .__builtin_nans, .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10621 | .{ .tag = .__builtin_nansf, .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10622 | .{ .tag = .__builtin_nansf128, .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10623 | .{ .tag = .__builtin_nansf16, .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10624 | .{ .tag = .__builtin_nansl, .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10625 | .{ .tag = .__builtin_nearbyint, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10626 | .{ .tag = .__builtin_nearbyintf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10627 | .{ .tag = .__builtin_nearbyintf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10628 | .{ .tag = .__builtin_nearbyintl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10629 | .{ .tag = .__builtin_nextafter, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10630 | .{ .tag = .__builtin_nextafterf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10631 | .{ .tag = .__builtin_nextafterf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10632 | .{ .tag = .__builtin_nextafterl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10633 | .{ .tag = .__builtin_nexttoward, .properties = .{ .param_str = "ddLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10634 | .{ .tag = .__builtin_nexttowardf, .properties = .{ .param_str = "ffLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10635 | .{ .tag = .__builtin_nexttowardf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10636 | .{ .tag = .__builtin_nexttowardl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10637 | .{ .tag = .__builtin_nondeterministic_value, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10638 | .{ .tag = .__builtin_nontemporal_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10639 | .{ .tag = .__builtin_nontemporal_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10640 | .{ .tag = .__builtin_objc_memmove_collectable, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10641 | .{ .tag = .__builtin_object_size, .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, | |
| 10642 | .{ .tag = .__builtin_offsetof, .properties = .{ .param_str = "z.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10643 | .{ .tag = .__builtin_operator_delete, .properties = .{ .param_str = "vv*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 10644 | .{ .tag = .__builtin_operator_new, .properties = .{ .param_str = "v*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, | |
| 10645 | .{ .tag = .__builtin_os_log_format, .properties = .{ .param_str = "v*v*cC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf } } }, | |
| 10646 | .{ .tag = .__builtin_os_log_format_buffer_size, .properties = .{ .param_str = "zcC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf, .eval_args = false, .const_evaluable = true } } }, | |
| 10647 | .{ .tag = .__builtin_pack_longdouble, .properties = .{ .param_str = "Lddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10648 | .{ .tag = .__builtin_parity, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10649 | .{ .tag = .__builtin_parityl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10650 | .{ .tag = .__builtin_parityll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10651 | .{ .tag = .__builtin_popcount, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10652 | .{ .tag = .__builtin_popcountl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10653 | .{ .tag = .__builtin_popcountll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10654 | .{ .tag = .__builtin_pow, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10655 | .{ .tag = .__builtin_powf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10656 | .{ .tag = .__builtin_powf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10657 | .{ .tag = .__builtin_powf16, .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10658 | .{ .tag = .__builtin_powi, .properties = .{ .param_str = "ddi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10659 | .{ .tag = .__builtin_powif, .properties = .{ .param_str = "ffi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10660 | .{ .tag = .__builtin_powil, .properties = .{ .param_str = "LdLdi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10661 | .{ .tag = .__builtin_powl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10662 | .{ .tag = .__builtin_ppc_alignx, .properties = .{ .param_str = "vIivC*", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, | |
| 10663 | .{ .tag = .__builtin_ppc_cmpb, .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10664 | .{ .tag = .__builtin_ppc_compare_and_swap, .properties = .{ .param_str = "iiD*i*i", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10665 | .{ .tag = .__builtin_ppc_compare_and_swaplp, .properties = .{ .param_str = "iLiD*Li*Li", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10666 | .{ .tag = .__builtin_ppc_dcbfl, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10667 | .{ .tag = .__builtin_ppc_dcbflp, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10668 | .{ .tag = .__builtin_ppc_dcbst, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10669 | .{ .tag = .__builtin_ppc_dcbt, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10670 | .{ .tag = .__builtin_ppc_dcbtst, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10671 | .{ .tag = .__builtin_ppc_dcbtstt, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10672 | .{ .tag = .__builtin_ppc_dcbtt, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10673 | .{ .tag = .__builtin_ppc_dcbz, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10674 | .{ .tag = .__builtin_ppc_eieio, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10675 | .{ .tag = .__builtin_ppc_fcfid, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10676 | .{ .tag = .__builtin_ppc_fcfud, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10677 | .{ .tag = .__builtin_ppc_fctid, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10678 | .{ .tag = .__builtin_ppc_fctidz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10679 | .{ .tag = .__builtin_ppc_fctiw, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10680 | .{ .tag = .__builtin_ppc_fctiwz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10681 | .{ .tag = .__builtin_ppc_fctudz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10682 | .{ .tag = .__builtin_ppc_fctuwz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10683 | .{ .tag = .__builtin_ppc_fetch_and_add, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10684 | .{ .tag = .__builtin_ppc_fetch_and_addlp, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10685 | .{ .tag = .__builtin_ppc_fetch_and_and, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10686 | .{ .tag = .__builtin_ppc_fetch_and_andlp, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10687 | .{ .tag = .__builtin_ppc_fetch_and_or, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10688 | .{ .tag = .__builtin_ppc_fetch_and_orlp, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10689 | .{ .tag = .__builtin_ppc_fetch_and_swap, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10690 | .{ .tag = .__builtin_ppc_fetch_and_swaplp, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10691 | .{ .tag = .__builtin_ppc_fmsub, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10692 | .{ .tag = .__builtin_ppc_fmsubs, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10693 | .{ .tag = .__builtin_ppc_fnabs, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10694 | .{ .tag = .__builtin_ppc_fnabss, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10695 | .{ .tag = .__builtin_ppc_fnmadd, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10696 | .{ .tag = .__builtin_ppc_fnmadds, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10697 | .{ .tag = .__builtin_ppc_fnmsub, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10698 | .{ .tag = .__builtin_ppc_fnmsubs, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10699 | .{ .tag = .__builtin_ppc_fre, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10700 | .{ .tag = .__builtin_ppc_fres, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10701 | .{ .tag = .__builtin_ppc_fric, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10702 | .{ .tag = .__builtin_ppc_frim, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10703 | .{ .tag = .__builtin_ppc_frims, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10704 | .{ .tag = .__builtin_ppc_frin, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10705 | .{ .tag = .__builtin_ppc_frins, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10706 | .{ .tag = .__builtin_ppc_frip, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10707 | .{ .tag = .__builtin_ppc_frips, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10708 | .{ .tag = .__builtin_ppc_friz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10709 | .{ .tag = .__builtin_ppc_frizs, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10710 | .{ .tag = .__builtin_ppc_frsqrte, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10711 | .{ .tag = .__builtin_ppc_frsqrtes, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10712 | .{ .tag = .__builtin_ppc_fsel, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10713 | .{ .tag = .__builtin_ppc_fsels, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10714 | .{ .tag = .__builtin_ppc_fsqrt, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10715 | .{ .tag = .__builtin_ppc_fsqrts, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10716 | .{ .tag = .__builtin_ppc_get_timebase, .properties = .{ .param_str = "ULLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10717 | .{ .tag = .__builtin_ppc_iospace_eieio, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10718 | .{ .tag = .__builtin_ppc_iospace_lwsync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10719 | .{ .tag = .__builtin_ppc_iospace_sync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10720 | .{ .tag = .__builtin_ppc_isync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10721 | .{ .tag = .__builtin_ppc_ldarx, .properties = .{ .param_str = "LiLiD*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10722 | .{ .tag = .__builtin_ppc_load2r, .properties = .{ .param_str = "UsUs*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10723 | .{ .tag = .__builtin_ppc_load4r, .properties = .{ .param_str = "UiUi*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10724 | .{ .tag = .__builtin_ppc_lwarx, .properties = .{ .param_str = "iiD*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10725 | .{ .tag = .__builtin_ppc_lwsync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10726 | .{ .tag = .__builtin_ppc_maxfe, .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 10727 | .{ .tag = .__builtin_ppc_maxfl, .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 10728 | .{ .tag = .__builtin_ppc_maxfs, .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 10729 | .{ .tag = .__builtin_ppc_mfmsr, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10730 | .{ .tag = .__builtin_ppc_mfspr, .properties = .{ .param_str = "ULiIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10731 | .{ .tag = .__builtin_ppc_mftbu, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10732 | .{ .tag = .__builtin_ppc_minfe, .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 10733 | .{ .tag = .__builtin_ppc_minfl, .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 10734 | .{ .tag = .__builtin_ppc_minfs, .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, | |
| 10735 | .{ .tag = .__builtin_ppc_mtfsb0, .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10736 | .{ .tag = .__builtin_ppc_mtfsb1, .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10737 | .{ .tag = .__builtin_ppc_mtfsf, .properties = .{ .param_str = "vUIiUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10738 | .{ .tag = .__builtin_ppc_mtfsfi, .properties = .{ .param_str = "vUIiUIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10739 | .{ .tag = .__builtin_ppc_mtmsr, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10740 | .{ .tag = .__builtin_ppc_mtspr, .properties = .{ .param_str = "vIiULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10741 | .{ .tag = .__builtin_ppc_mulhd, .properties = .{ .param_str = "LLiLiLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10742 | .{ .tag = .__builtin_ppc_mulhdu, .properties = .{ .param_str = "ULLiULiULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10743 | .{ .tag = .__builtin_ppc_mulhw, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10744 | .{ .tag = .__builtin_ppc_mulhwu, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10745 | .{ .tag = .__builtin_ppc_popcntb, .properties = .{ .param_str = "ULiULi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10746 | .{ .tag = .__builtin_ppc_poppar4, .properties = .{ .param_str = "iUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10747 | .{ .tag = .__builtin_ppc_poppar8, .properties = .{ .param_str = "iULLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10748 | .{ .tag = .__builtin_ppc_rdlam, .properties = .{ .param_str = "UWiUWiUWiUWIi", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, | |
| 10749 | .{ .tag = .__builtin_ppc_recipdivd, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10750 | .{ .tag = .__builtin_ppc_recipdivf, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10751 | .{ .tag = .__builtin_ppc_rldimi, .properties = .{ .param_str = "ULLiULLiULLiIUiIULLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10752 | .{ .tag = .__builtin_ppc_rlwimi, .properties = .{ .param_str = "UiUiUiIUiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10753 | .{ .tag = .__builtin_ppc_rlwnm, .properties = .{ .param_str = "UiUiUiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10754 | .{ .tag = .__builtin_ppc_rsqrtd, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10755 | .{ .tag = .__builtin_ppc_rsqrtf, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10756 | .{ .tag = .__builtin_ppc_stdcx, .properties = .{ .param_str = "iLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10757 | .{ .tag = .__builtin_ppc_stfiw, .properties = .{ .param_str = "viC*d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10758 | .{ .tag = .__builtin_ppc_store2r, .properties = .{ .param_str = "vUiUs*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10759 | .{ .tag = .__builtin_ppc_store4r, .properties = .{ .param_str = "vUiUi*", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10760 | .{ .tag = .__builtin_ppc_stwcx, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10761 | .{ .tag = .__builtin_ppc_swdiv, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10762 | .{ .tag = .__builtin_ppc_swdiv_nochk, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10763 | .{ .tag = .__builtin_ppc_swdivs, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10764 | .{ .tag = .__builtin_ppc_swdivs_nochk, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10765 | .{ .tag = .__builtin_ppc_sync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10766 | .{ .tag = .__builtin_ppc_tdw, .properties = .{ .param_str = "vLLiLLiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10767 | .{ .tag = .__builtin_ppc_trap, .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10768 | .{ .tag = .__builtin_ppc_trapd, .properties = .{ .param_str = "vLi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10769 | .{ .tag = .__builtin_ppc_tw, .properties = .{ .param_str = "viiIUi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10770 | .{ .tag = .__builtin_prefetch, .properties = .{ .param_str = "vvC*.", .attributes = .{ .@"const" = true } } }, | |
| 10771 | .{ .tag = .__builtin_preserve_access_index, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10772 | .{ .tag = .__builtin_printf, .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf } } }, | |
| 10773 | .{ .tag = .__builtin_ptx_get_image_channel_data_typei_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10774 | .{ .tag = .__builtin_ptx_get_image_channel_orderi_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10775 | .{ .tag = .__builtin_ptx_get_image_depthi_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10776 | .{ .tag = .__builtin_ptx_get_image_heighti_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10777 | .{ .tag = .__builtin_ptx_get_image_widthi_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10778 | .{ .tag = .__builtin_ptx_read_image2Dff_, .properties = .{ .param_str = "V4fiiff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10779 | .{ .tag = .__builtin_ptx_read_image2Dfi_, .properties = .{ .param_str = "V4fiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10780 | .{ .tag = .__builtin_ptx_read_image2Dif_, .properties = .{ .param_str = "V4iiiff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10781 | .{ .tag = .__builtin_ptx_read_image2Dii_, .properties = .{ .param_str = "V4iiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10782 | .{ .tag = .__builtin_ptx_read_image3Dff_, .properties = .{ .param_str = "V4fiiffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10783 | .{ .tag = .__builtin_ptx_read_image3Dfi_, .properties = .{ .param_str = "V4fiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10784 | .{ .tag = .__builtin_ptx_read_image3Dif_, .properties = .{ .param_str = "V4iiiffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10785 | .{ .tag = .__builtin_ptx_read_image3Dii_, .properties = .{ .param_str = "V4iiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10786 | .{ .tag = .__builtin_ptx_write_image2Df_, .properties = .{ .param_str = "viiiffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10787 | .{ .tag = .__builtin_ptx_write_image2Di_, .properties = .{ .param_str = "viiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10788 | .{ .tag = .__builtin_ptx_write_image2Dui_, .properties = .{ .param_str = "viiiUiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 10789 | .{ .tag = .__builtin_r600_implicitarg_ptr, .properties = .{ .param_str = "Uc*7", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10790 | .{ .tag = .__builtin_r600_read_tgid_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10791 | .{ .tag = .__builtin_r600_read_tgid_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10792 | .{ .tag = .__builtin_r600_read_tgid_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10793 | .{ .tag = .__builtin_r600_read_tidig_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10794 | .{ .tag = .__builtin_r600_read_tidig_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10795 | .{ .tag = .__builtin_r600_read_tidig_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10796 | .{ .tag = .__builtin_r600_recipsqrt_ieee, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10797 | .{ .tag = .__builtin_r600_recipsqrt_ieeef, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, | |
| 10798 | .{ .tag = .__builtin_readcyclecounter, .properties = .{ .param_str = "ULLi" } }, | |
| 10799 | .{ .tag = .__builtin_readflm, .properties = .{ .param_str = "d", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10800 | .{ .tag = .__builtin_realloc, .properties = .{ .param_str = "v*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10801 | .{ .tag = .__builtin_reduce_add, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10802 | .{ .tag = .__builtin_reduce_and, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10803 | .{ .tag = .__builtin_reduce_max, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10804 | .{ .tag = .__builtin_reduce_min, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10805 | .{ .tag = .__builtin_reduce_mul, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10806 | .{ .tag = .__builtin_reduce_or, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10807 | .{ .tag = .__builtin_reduce_xor, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10808 | .{ .tag = .__builtin_remainder, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10809 | .{ .tag = .__builtin_remainderf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10810 | .{ .tag = .__builtin_remainderf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10811 | .{ .tag = .__builtin_remainderl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10812 | .{ .tag = .__builtin_remquo, .properties = .{ .param_str = "dddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10813 | .{ .tag = .__builtin_remquof, .properties = .{ .param_str = "fffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10814 | .{ .tag = .__builtin_remquof128, .properties = .{ .param_str = "LLdLLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10815 | .{ .tag = .__builtin_remquol, .properties = .{ .param_str = "LdLdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10816 | .{ .tag = .__builtin_return_address, .properties = .{ .param_str = "v*IUi" } }, | |
| 10817 | .{ .tag = .__builtin_rindex, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10818 | .{ .tag = .__builtin_rint, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10819 | .{ .tag = .__builtin_rintf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10820 | .{ .tag = .__builtin_rintf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10821 | .{ .tag = .__builtin_rintf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10822 | .{ .tag = .__builtin_rintl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10823 | .{ .tag = .__builtin_rotateleft16, .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10824 | .{ .tag = .__builtin_rotateleft32, .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10825 | .{ .tag = .__builtin_rotateleft64, .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10826 | .{ .tag = .__builtin_rotateleft8, .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10827 | .{ .tag = .__builtin_rotateright16, .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10828 | .{ .tag = .__builtin_rotateright32, .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10829 | .{ .tag = .__builtin_rotateright64, .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10830 | .{ .tag = .__builtin_rotateright8, .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 10831 | .{ .tag = .__builtin_round, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10832 | .{ .tag = .__builtin_roundeven, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10833 | .{ .tag = .__builtin_roundevenf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10834 | .{ .tag = .__builtin_roundevenf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10835 | .{ .tag = .__builtin_roundevenf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10836 | .{ .tag = .__builtin_roundevenl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10837 | .{ .tag = .__builtin_roundf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10838 | .{ .tag = .__builtin_roundf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10839 | .{ .tag = .__builtin_roundf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10840 | .{ .tag = .__builtin_roundl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10841 | .{ .tag = .__builtin_sadd_overflow, .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10842 | .{ .tag = .__builtin_saddl_overflow, .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10843 | .{ .tag = .__builtin_saddll_overflow, .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10844 | .{ .tag = .__builtin_scalbln, .properties = .{ .param_str = "ddLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10845 | .{ .tag = .__builtin_scalblnf, .properties = .{ .param_str = "ffLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10846 | .{ .tag = .__builtin_scalblnf128, .properties = .{ .param_str = "LLdLLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10847 | .{ .tag = .__builtin_scalblnl, .properties = .{ .param_str = "LdLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10848 | .{ .tag = .__builtin_scalbn, .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10849 | .{ .tag = .__builtin_scalbnf, .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10850 | .{ .tag = .__builtin_scalbnf128, .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10851 | .{ .tag = .__builtin_scalbnl, .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10852 | .{ .tag = .__builtin_scanf, .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf } } }, | |
| 10853 | .{ .tag = .__builtin_set_flt_rounds, .properties = .{ .param_str = "vi" } }, | |
| 10854 | .{ .tag = .__builtin_setflm, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10855 | .{ .tag = .__builtin_setjmp, .properties = .{ .param_str = "iv**", .attributes = .{ .returns_twice = true } } }, | |
| 10856 | .{ .tag = .__builtin_setps, .properties = .{ .param_str = "vUiUi", .target_set = TargetSet.initOne(.xcore) } }, | |
| 10857 | .{ .tag = .__builtin_setrnd, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10858 | .{ .tag = .__builtin_shufflevector, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, | |
| 10859 | .{ .tag = .__builtin_signbit, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10860 | .{ .tag = .__builtin_signbitf, .properties = .{ .param_str = "if", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10861 | .{ .tag = .__builtin_signbitl, .properties = .{ .param_str = "iLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10862 | .{ .tag = .__builtin_sin, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10863 | .{ .tag = .__builtin_sinf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10864 | .{ .tag = .__builtin_sinf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10865 | .{ .tag = .__builtin_sinf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10866 | .{ .tag = .__builtin_sinh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10867 | .{ .tag = .__builtin_sinhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10868 | .{ .tag = .__builtin_sinhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10869 | .{ .tag = .__builtin_sinhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10870 | .{ .tag = .__builtin_sinl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10871 | .{ .tag = .__builtin_smul_overflow, .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10872 | .{ .tag = .__builtin_smull_overflow, .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10873 | .{ .tag = .__builtin_smulll_overflow, .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10874 | .{ .tag = .__builtin_snprintf, .properties = .{ .param_str = "ic*RzcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, | |
| 10875 | .{ .tag = .__builtin_sponentry, .properties = .{ .param_str = "v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 10876 | .{ .tag = .__builtin_sprintf, .properties = .{ .param_str = "ic*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 10877 | .{ .tag = .__builtin_sqrt, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10878 | .{ .tag = .__builtin_sqrtf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10879 | .{ .tag = .__builtin_sqrtf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10880 | .{ .tag = .__builtin_sqrtf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10881 | .{ .tag = .__builtin_sqrtl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10882 | .{ .tag = .__builtin_sscanf, .properties = .{ .param_str = "icC*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 10883 | .{ .tag = .__builtin_ssub_overflow, .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10884 | .{ .tag = .__builtin_ssubl_overflow, .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10885 | .{ .tag = .__builtin_ssubll_overflow, .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10886 | .{ .tag = .__builtin_stdarg_start, .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10887 | .{ .tag = .__builtin_stpcpy, .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10888 | .{ .tag = .__builtin_stpncpy, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10889 | .{ .tag = .__builtin_strcasecmp, .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10890 | .{ .tag = .__builtin_strcat, .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10891 | .{ .tag = .__builtin_strchr, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10892 | .{ .tag = .__builtin_strcmp, .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10893 | .{ .tag = .__builtin_strcpy, .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10894 | .{ .tag = .__builtin_strcspn, .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10895 | .{ .tag = .__builtin_strdup, .properties = .{ .param_str = "c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10896 | .{ .tag = .__builtin_strlen, .properties = .{ .param_str = "zcC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10897 | .{ .tag = .__builtin_strncasecmp, .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10898 | .{ .tag = .__builtin_strncat, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10899 | .{ .tag = .__builtin_strncmp, .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 10900 | .{ .tag = .__builtin_strncpy, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10901 | .{ .tag = .__builtin_strndup, .properties = .{ .param_str = "c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10902 | .{ .tag = .__builtin_strpbrk, .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10903 | .{ .tag = .__builtin_strrchr, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10904 | .{ .tag = .__builtin_strspn, .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10905 | .{ .tag = .__builtin_strstr, .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, | |
| 10906 | .{ .tag = .__builtin_sub_overflow, .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, | |
| 10907 | .{ .tag = .__builtin_subc, .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, | |
| 10908 | .{ .tag = .__builtin_subcb, .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, | |
| 10909 | .{ .tag = .__builtin_subcl, .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, | |
| 10910 | .{ .tag = .__builtin_subcll, .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, | |
| 10911 | .{ .tag = .__builtin_subcs, .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, | |
| 10912 | .{ .tag = .__builtin_tan, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10913 | .{ .tag = .__builtin_tanf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10914 | .{ .tag = .__builtin_tanf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10915 | .{ .tag = .__builtin_tanh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10916 | .{ .tag = .__builtin_tanhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10917 | .{ .tag = .__builtin_tanhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10918 | .{ .tag = .__builtin_tanhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10919 | .{ .tag = .__builtin_tanl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10920 | .{ .tag = .__builtin_tgamma, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10921 | .{ .tag = .__builtin_tgammaf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10922 | .{ .tag = .__builtin_tgammaf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10923 | .{ .tag = .__builtin_tgammal, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 10924 | .{ .tag = .__builtin_thread_pointer, .properties = .{ .param_str = "v*", .attributes = .{ .@"const" = true } } }, | |
| 10925 | .{ .tag = .__builtin_trap, .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, | |
| 10926 | .{ .tag = .__builtin_trunc, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10927 | .{ .tag = .__builtin_truncf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10928 | .{ .tag = .__builtin_truncf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10929 | .{ .tag = .__builtin_truncf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10930 | .{ .tag = .__builtin_truncl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, | |
| 10931 | .{ .tag = .__builtin_types_compatible_p, .properties = .{ .param_str = "i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10932 | .{ .tag = .__builtin_uadd_overflow, .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10933 | .{ .tag = .__builtin_uaddl_overflow, .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10934 | .{ .tag = .__builtin_uaddll_overflow, .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10935 | .{ .tag = .__builtin_umul_overflow, .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10936 | .{ .tag = .__builtin_umull_overflow, .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10937 | .{ .tag = .__builtin_umulll_overflow, .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10938 | .{ .tag = .__builtin_unpack_longdouble, .properties = .{ .param_str = "dLdIi", .target_set = TargetSet.initOne(.ppc) } }, | |
| 10939 | .{ .tag = .__builtin_unpredictable, .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true } } }, | |
| 10940 | .{ .tag = .__builtin_unreachable, .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, | |
| 10941 | .{ .tag = .__builtin_unwind_init, .properties = .{ .param_str = "v" } }, | |
| 10942 | .{ .tag = .__builtin_usub_overflow, .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10943 | .{ .tag = .__builtin_usubl_overflow, .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10944 | .{ .tag = .__builtin_usubll_overflow, .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, | |
| 10945 | .{ .tag = .__builtin_va_arg, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10946 | .{ .tag = .__builtin_va_copy, .properties = .{ .param_str = "vAA" } }, | |
| 10947 | .{ .tag = .__builtin_va_end, .properties = .{ .param_str = "vA" } }, | |
| 10948 | .{ .tag = .__builtin_va_start, .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, | |
| 10949 | .{ .tag = .__builtin_ve_vl_andm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10950 | .{ .tag = .__builtin_ve_vl_andm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10951 | .{ .tag = .__builtin_ve_vl_eqvm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10952 | .{ .tag = .__builtin_ve_vl_eqvm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10953 | .{ .tag = .__builtin_ve_vl_extract_vm512l, .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, | |
| 10954 | .{ .tag = .__builtin_ve_vl_extract_vm512u, .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, | |
| 10955 | .{ .tag = .__builtin_ve_vl_fencec_s, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10956 | .{ .tag = .__builtin_ve_vl_fencei, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10957 | .{ .tag = .__builtin_ve_vl_fencem_s, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10958 | .{ .tag = .__builtin_ve_vl_fidcr_sss, .properties = .{ .param_str = "LUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10959 | .{ .tag = .__builtin_ve_vl_insert_vm512l, .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, | |
| 10960 | .{ .tag = .__builtin_ve_vl_insert_vm512u, .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, | |
| 10961 | .{ .tag = .__builtin_ve_vl_lcr_sss, .properties = .{ .param_str = "LUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10962 | .{ .tag = .__builtin_ve_vl_lsv_vvss, .properties = .{ .param_str = "V256dV256dUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10963 | .{ .tag = .__builtin_ve_vl_lvm_MMss, .properties = .{ .param_str = "V512bV512bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10964 | .{ .tag = .__builtin_ve_vl_lvm_mmss, .properties = .{ .param_str = "V256bV256bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10965 | .{ .tag = .__builtin_ve_vl_lvsd_svs, .properties = .{ .param_str = "dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10966 | .{ .tag = .__builtin_ve_vl_lvsl_svs, .properties = .{ .param_str = "LUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10967 | .{ .tag = .__builtin_ve_vl_lvss_svs, .properties = .{ .param_str = "fV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10968 | .{ .tag = .__builtin_ve_vl_lzvm_sml, .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10969 | .{ .tag = .__builtin_ve_vl_negm_MM, .properties = .{ .param_str = "V512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10970 | .{ .tag = .__builtin_ve_vl_negm_mm, .properties = .{ .param_str = "V256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10971 | .{ .tag = .__builtin_ve_vl_nndm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10972 | .{ .tag = .__builtin_ve_vl_nndm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10973 | .{ .tag = .__builtin_ve_vl_orm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10974 | .{ .tag = .__builtin_ve_vl_orm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10975 | .{ .tag = .__builtin_ve_vl_pack_f32a, .properties = .{ .param_str = "ULifC*", .target_set = TargetSet.initOne(.ve) } }, | |
| 10976 | .{ .tag = .__builtin_ve_vl_pack_f32p, .properties = .{ .param_str = "ULifC*fC*", .target_set = TargetSet.initOne(.ve) } }, | |
| 10977 | .{ .tag = .__builtin_ve_vl_pcvm_sml, .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10978 | .{ .tag = .__builtin_ve_vl_pfchv_ssl, .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10979 | .{ .tag = .__builtin_ve_vl_pfchvnc_ssl, .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10980 | .{ .tag = .__builtin_ve_vl_pvadds_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10981 | .{ .tag = .__builtin_ve_vl_pvadds_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10982 | .{ .tag = .__builtin_ve_vl_pvadds_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10983 | .{ .tag = .__builtin_ve_vl_pvadds_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10984 | .{ .tag = .__builtin_ve_vl_pvadds_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10985 | .{ .tag = .__builtin_ve_vl_pvadds_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10986 | .{ .tag = .__builtin_ve_vl_pvaddu_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10987 | .{ .tag = .__builtin_ve_vl_pvaddu_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10988 | .{ .tag = .__builtin_ve_vl_pvaddu_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10989 | .{ .tag = .__builtin_ve_vl_pvaddu_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10990 | .{ .tag = .__builtin_ve_vl_pvaddu_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10991 | .{ .tag = .__builtin_ve_vl_pvaddu_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10992 | .{ .tag = .__builtin_ve_vl_pvand_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10993 | .{ .tag = .__builtin_ve_vl_pvand_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10994 | .{ .tag = .__builtin_ve_vl_pvand_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10995 | .{ .tag = .__builtin_ve_vl_pvand_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10996 | .{ .tag = .__builtin_ve_vl_pvand_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10997 | .{ .tag = .__builtin_ve_vl_pvand_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10998 | .{ .tag = .__builtin_ve_vl_pvbrd_vsMvl, .properties = .{ .param_str = "V256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 10999 | .{ .tag = .__builtin_ve_vl_pvbrd_vsl, .properties = .{ .param_str = "V256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11000 | .{ .tag = .__builtin_ve_vl_pvbrd_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11001 | .{ .tag = .__builtin_ve_vl_pvbrv_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11002 | .{ .tag = .__builtin_ve_vl_pvbrv_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11003 | .{ .tag = .__builtin_ve_vl_pvbrv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11004 | .{ .tag = .__builtin_ve_vl_pvbrvlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11005 | .{ .tag = .__builtin_ve_vl_pvbrvlo_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11006 | .{ .tag = .__builtin_ve_vl_pvbrvlo_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11007 | .{ .tag = .__builtin_ve_vl_pvbrvup_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11008 | .{ .tag = .__builtin_ve_vl_pvbrvup_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11009 | .{ .tag = .__builtin_ve_vl_pvbrvup_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11010 | .{ .tag = .__builtin_ve_vl_pvcmps_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11011 | .{ .tag = .__builtin_ve_vl_pvcmps_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11012 | .{ .tag = .__builtin_ve_vl_pvcmps_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11013 | .{ .tag = .__builtin_ve_vl_pvcmps_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11014 | .{ .tag = .__builtin_ve_vl_pvcmps_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11015 | .{ .tag = .__builtin_ve_vl_pvcmps_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11016 | .{ .tag = .__builtin_ve_vl_pvcmpu_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11017 | .{ .tag = .__builtin_ve_vl_pvcmpu_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11018 | .{ .tag = .__builtin_ve_vl_pvcmpu_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11019 | .{ .tag = .__builtin_ve_vl_pvcmpu_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11020 | .{ .tag = .__builtin_ve_vl_pvcmpu_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11021 | .{ .tag = .__builtin_ve_vl_pvcmpu_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11022 | .{ .tag = .__builtin_ve_vl_pvcvtsw_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11023 | .{ .tag = .__builtin_ve_vl_pvcvtsw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11024 | .{ .tag = .__builtin_ve_vl_pvcvtws_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11025 | .{ .tag = .__builtin_ve_vl_pvcvtws_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11026 | .{ .tag = .__builtin_ve_vl_pvcvtws_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11027 | .{ .tag = .__builtin_ve_vl_pvcvtwsrz_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11028 | .{ .tag = .__builtin_ve_vl_pvcvtwsrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11029 | .{ .tag = .__builtin_ve_vl_pvcvtwsrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11030 | .{ .tag = .__builtin_ve_vl_pveqv_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11031 | .{ .tag = .__builtin_ve_vl_pveqv_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11032 | .{ .tag = .__builtin_ve_vl_pveqv_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11033 | .{ .tag = .__builtin_ve_vl_pveqv_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11034 | .{ .tag = .__builtin_ve_vl_pveqv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11035 | .{ .tag = .__builtin_ve_vl_pveqv_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11036 | .{ .tag = .__builtin_ve_vl_pvfadd_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11037 | .{ .tag = .__builtin_ve_vl_pvfadd_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11038 | .{ .tag = .__builtin_ve_vl_pvfadd_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11039 | .{ .tag = .__builtin_ve_vl_pvfadd_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11040 | .{ .tag = .__builtin_ve_vl_pvfadd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11041 | .{ .tag = .__builtin_ve_vl_pvfadd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11042 | .{ .tag = .__builtin_ve_vl_pvfcmp_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11043 | .{ .tag = .__builtin_ve_vl_pvfcmp_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11044 | .{ .tag = .__builtin_ve_vl_pvfcmp_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11045 | .{ .tag = .__builtin_ve_vl_pvfcmp_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11046 | .{ .tag = .__builtin_ve_vl_pvfcmp_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11047 | .{ .tag = .__builtin_ve_vl_pvfcmp_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11048 | .{ .tag = .__builtin_ve_vl_pvfmad_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11049 | .{ .tag = .__builtin_ve_vl_pvfmad_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11050 | .{ .tag = .__builtin_ve_vl_pvfmad_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11051 | .{ .tag = .__builtin_ve_vl_pvfmad_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11052 | .{ .tag = .__builtin_ve_vl_pvfmad_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11053 | .{ .tag = .__builtin_ve_vl_pvfmad_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11054 | .{ .tag = .__builtin_ve_vl_pvfmad_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11055 | .{ .tag = .__builtin_ve_vl_pvfmad_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11056 | .{ .tag = .__builtin_ve_vl_pvfmad_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11057 | .{ .tag = .__builtin_ve_vl_pvfmax_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11058 | .{ .tag = .__builtin_ve_vl_pvfmax_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11059 | .{ .tag = .__builtin_ve_vl_pvfmax_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11060 | .{ .tag = .__builtin_ve_vl_pvfmax_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11061 | .{ .tag = .__builtin_ve_vl_pvfmax_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11062 | .{ .tag = .__builtin_ve_vl_pvfmax_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11063 | .{ .tag = .__builtin_ve_vl_pvfmin_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11064 | .{ .tag = .__builtin_ve_vl_pvfmin_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11065 | .{ .tag = .__builtin_ve_vl_pvfmin_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11066 | .{ .tag = .__builtin_ve_vl_pvfmin_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11067 | .{ .tag = .__builtin_ve_vl_pvfmin_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11068 | .{ .tag = .__builtin_ve_vl_pvfmin_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11069 | .{ .tag = .__builtin_ve_vl_pvfmkaf_Ml, .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11070 | .{ .tag = .__builtin_ve_vl_pvfmkat_Ml, .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11071 | .{ .tag = .__builtin_ve_vl_pvfmkseq_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11072 | .{ .tag = .__builtin_ve_vl_pvfmkseq_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11073 | .{ .tag = .__builtin_ve_vl_pvfmkseqnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11074 | .{ .tag = .__builtin_ve_vl_pvfmkseqnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11075 | .{ .tag = .__builtin_ve_vl_pvfmksge_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11076 | .{ .tag = .__builtin_ve_vl_pvfmksge_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11077 | .{ .tag = .__builtin_ve_vl_pvfmksgenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11078 | .{ .tag = .__builtin_ve_vl_pvfmksgenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11079 | .{ .tag = .__builtin_ve_vl_pvfmksgt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11080 | .{ .tag = .__builtin_ve_vl_pvfmksgt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11081 | .{ .tag = .__builtin_ve_vl_pvfmksgtnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11082 | .{ .tag = .__builtin_ve_vl_pvfmksgtnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11083 | .{ .tag = .__builtin_ve_vl_pvfmksle_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11084 | .{ .tag = .__builtin_ve_vl_pvfmksle_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11085 | .{ .tag = .__builtin_ve_vl_pvfmkslenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11086 | .{ .tag = .__builtin_ve_vl_pvfmkslenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11087 | .{ .tag = .__builtin_ve_vl_pvfmksloeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11088 | .{ .tag = .__builtin_ve_vl_pvfmksloeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11089 | .{ .tag = .__builtin_ve_vl_pvfmksloeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11090 | .{ .tag = .__builtin_ve_vl_pvfmksloeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11091 | .{ .tag = .__builtin_ve_vl_pvfmksloge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11092 | .{ .tag = .__builtin_ve_vl_pvfmksloge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11093 | .{ .tag = .__builtin_ve_vl_pvfmkslogenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11094 | .{ .tag = .__builtin_ve_vl_pvfmkslogenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11095 | .{ .tag = .__builtin_ve_vl_pvfmkslogt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11096 | .{ .tag = .__builtin_ve_vl_pvfmkslogt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11097 | .{ .tag = .__builtin_ve_vl_pvfmkslogtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11098 | .{ .tag = .__builtin_ve_vl_pvfmkslogtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11099 | .{ .tag = .__builtin_ve_vl_pvfmkslole_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11100 | .{ .tag = .__builtin_ve_vl_pvfmkslole_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11101 | .{ .tag = .__builtin_ve_vl_pvfmkslolenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11102 | .{ .tag = .__builtin_ve_vl_pvfmkslolenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11103 | .{ .tag = .__builtin_ve_vl_pvfmkslolt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11104 | .{ .tag = .__builtin_ve_vl_pvfmkslolt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11105 | .{ .tag = .__builtin_ve_vl_pvfmksloltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11106 | .{ .tag = .__builtin_ve_vl_pvfmksloltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11107 | .{ .tag = .__builtin_ve_vl_pvfmkslonan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11108 | .{ .tag = .__builtin_ve_vl_pvfmkslonan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11109 | .{ .tag = .__builtin_ve_vl_pvfmkslone_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11110 | .{ .tag = .__builtin_ve_vl_pvfmkslone_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11111 | .{ .tag = .__builtin_ve_vl_pvfmkslonenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11112 | .{ .tag = .__builtin_ve_vl_pvfmkslonenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11113 | .{ .tag = .__builtin_ve_vl_pvfmkslonum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11114 | .{ .tag = .__builtin_ve_vl_pvfmkslonum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11115 | .{ .tag = .__builtin_ve_vl_pvfmkslt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11116 | .{ .tag = .__builtin_ve_vl_pvfmkslt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11117 | .{ .tag = .__builtin_ve_vl_pvfmksltnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11118 | .{ .tag = .__builtin_ve_vl_pvfmksltnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11119 | .{ .tag = .__builtin_ve_vl_pvfmksnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11120 | .{ .tag = .__builtin_ve_vl_pvfmksnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11121 | .{ .tag = .__builtin_ve_vl_pvfmksne_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11122 | .{ .tag = .__builtin_ve_vl_pvfmksne_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11123 | .{ .tag = .__builtin_ve_vl_pvfmksnenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11124 | .{ .tag = .__builtin_ve_vl_pvfmksnenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11125 | .{ .tag = .__builtin_ve_vl_pvfmksnum_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11126 | .{ .tag = .__builtin_ve_vl_pvfmksnum_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11127 | .{ .tag = .__builtin_ve_vl_pvfmksupeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11128 | .{ .tag = .__builtin_ve_vl_pvfmksupeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11129 | .{ .tag = .__builtin_ve_vl_pvfmksupeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11130 | .{ .tag = .__builtin_ve_vl_pvfmksupeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11131 | .{ .tag = .__builtin_ve_vl_pvfmksupge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11132 | .{ .tag = .__builtin_ve_vl_pvfmksupge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11133 | .{ .tag = .__builtin_ve_vl_pvfmksupgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11134 | .{ .tag = .__builtin_ve_vl_pvfmksupgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11135 | .{ .tag = .__builtin_ve_vl_pvfmksupgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11136 | .{ .tag = .__builtin_ve_vl_pvfmksupgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11137 | .{ .tag = .__builtin_ve_vl_pvfmksupgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11138 | .{ .tag = .__builtin_ve_vl_pvfmksupgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11139 | .{ .tag = .__builtin_ve_vl_pvfmksuple_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11140 | .{ .tag = .__builtin_ve_vl_pvfmksuple_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11141 | .{ .tag = .__builtin_ve_vl_pvfmksuplenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11142 | .{ .tag = .__builtin_ve_vl_pvfmksuplenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11143 | .{ .tag = .__builtin_ve_vl_pvfmksuplt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11144 | .{ .tag = .__builtin_ve_vl_pvfmksuplt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11145 | .{ .tag = .__builtin_ve_vl_pvfmksupltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11146 | .{ .tag = .__builtin_ve_vl_pvfmksupltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11147 | .{ .tag = .__builtin_ve_vl_pvfmksupnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11148 | .{ .tag = .__builtin_ve_vl_pvfmksupnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11149 | .{ .tag = .__builtin_ve_vl_pvfmksupne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11150 | .{ .tag = .__builtin_ve_vl_pvfmksupne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11151 | .{ .tag = .__builtin_ve_vl_pvfmksupnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11152 | .{ .tag = .__builtin_ve_vl_pvfmksupnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11153 | .{ .tag = .__builtin_ve_vl_pvfmksupnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11154 | .{ .tag = .__builtin_ve_vl_pvfmksupnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11155 | .{ .tag = .__builtin_ve_vl_pvfmkweq_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11156 | .{ .tag = .__builtin_ve_vl_pvfmkweq_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11157 | .{ .tag = .__builtin_ve_vl_pvfmkweqnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11158 | .{ .tag = .__builtin_ve_vl_pvfmkweqnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11159 | .{ .tag = .__builtin_ve_vl_pvfmkwge_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11160 | .{ .tag = .__builtin_ve_vl_pvfmkwge_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11161 | .{ .tag = .__builtin_ve_vl_pvfmkwgenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11162 | .{ .tag = .__builtin_ve_vl_pvfmkwgenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11163 | .{ .tag = .__builtin_ve_vl_pvfmkwgt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11164 | .{ .tag = .__builtin_ve_vl_pvfmkwgt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11165 | .{ .tag = .__builtin_ve_vl_pvfmkwgtnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11166 | .{ .tag = .__builtin_ve_vl_pvfmkwgtnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11167 | .{ .tag = .__builtin_ve_vl_pvfmkwle_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11168 | .{ .tag = .__builtin_ve_vl_pvfmkwle_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11169 | .{ .tag = .__builtin_ve_vl_pvfmkwlenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11170 | .{ .tag = .__builtin_ve_vl_pvfmkwlenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11171 | .{ .tag = .__builtin_ve_vl_pvfmkwloeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11172 | .{ .tag = .__builtin_ve_vl_pvfmkwloeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11173 | .{ .tag = .__builtin_ve_vl_pvfmkwloeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11174 | .{ .tag = .__builtin_ve_vl_pvfmkwloeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11175 | .{ .tag = .__builtin_ve_vl_pvfmkwloge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11176 | .{ .tag = .__builtin_ve_vl_pvfmkwloge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11177 | .{ .tag = .__builtin_ve_vl_pvfmkwlogenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11178 | .{ .tag = .__builtin_ve_vl_pvfmkwlogenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11179 | .{ .tag = .__builtin_ve_vl_pvfmkwlogt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11180 | .{ .tag = .__builtin_ve_vl_pvfmkwlogt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11181 | .{ .tag = .__builtin_ve_vl_pvfmkwlogtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11182 | .{ .tag = .__builtin_ve_vl_pvfmkwlogtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11183 | .{ .tag = .__builtin_ve_vl_pvfmkwlole_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11184 | .{ .tag = .__builtin_ve_vl_pvfmkwlole_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11185 | .{ .tag = .__builtin_ve_vl_pvfmkwlolenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11186 | .{ .tag = .__builtin_ve_vl_pvfmkwlolenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11187 | .{ .tag = .__builtin_ve_vl_pvfmkwlolt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11188 | .{ .tag = .__builtin_ve_vl_pvfmkwlolt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11189 | .{ .tag = .__builtin_ve_vl_pvfmkwloltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11190 | .{ .tag = .__builtin_ve_vl_pvfmkwloltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11191 | .{ .tag = .__builtin_ve_vl_pvfmkwlonan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11192 | .{ .tag = .__builtin_ve_vl_pvfmkwlonan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11193 | .{ .tag = .__builtin_ve_vl_pvfmkwlone_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11194 | .{ .tag = .__builtin_ve_vl_pvfmkwlone_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11195 | .{ .tag = .__builtin_ve_vl_pvfmkwlonenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11196 | .{ .tag = .__builtin_ve_vl_pvfmkwlonenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11197 | .{ .tag = .__builtin_ve_vl_pvfmkwlonum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11198 | .{ .tag = .__builtin_ve_vl_pvfmkwlonum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11199 | .{ .tag = .__builtin_ve_vl_pvfmkwlt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11200 | .{ .tag = .__builtin_ve_vl_pvfmkwlt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11201 | .{ .tag = .__builtin_ve_vl_pvfmkwltnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11202 | .{ .tag = .__builtin_ve_vl_pvfmkwltnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11203 | .{ .tag = .__builtin_ve_vl_pvfmkwnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11204 | .{ .tag = .__builtin_ve_vl_pvfmkwnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11205 | .{ .tag = .__builtin_ve_vl_pvfmkwne_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11206 | .{ .tag = .__builtin_ve_vl_pvfmkwne_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11207 | .{ .tag = .__builtin_ve_vl_pvfmkwnenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11208 | .{ .tag = .__builtin_ve_vl_pvfmkwnenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11209 | .{ .tag = .__builtin_ve_vl_pvfmkwnum_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11210 | .{ .tag = .__builtin_ve_vl_pvfmkwnum_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11211 | .{ .tag = .__builtin_ve_vl_pvfmkwupeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11212 | .{ .tag = .__builtin_ve_vl_pvfmkwupeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11213 | .{ .tag = .__builtin_ve_vl_pvfmkwupeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11214 | .{ .tag = .__builtin_ve_vl_pvfmkwupeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11215 | .{ .tag = .__builtin_ve_vl_pvfmkwupge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11216 | .{ .tag = .__builtin_ve_vl_pvfmkwupge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11217 | .{ .tag = .__builtin_ve_vl_pvfmkwupgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11218 | .{ .tag = .__builtin_ve_vl_pvfmkwupgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11219 | .{ .tag = .__builtin_ve_vl_pvfmkwupgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11220 | .{ .tag = .__builtin_ve_vl_pvfmkwupgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11221 | .{ .tag = .__builtin_ve_vl_pvfmkwupgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11222 | .{ .tag = .__builtin_ve_vl_pvfmkwupgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11223 | .{ .tag = .__builtin_ve_vl_pvfmkwuple_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11224 | .{ .tag = .__builtin_ve_vl_pvfmkwuple_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11225 | .{ .tag = .__builtin_ve_vl_pvfmkwuplenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11226 | .{ .tag = .__builtin_ve_vl_pvfmkwuplenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11227 | .{ .tag = .__builtin_ve_vl_pvfmkwuplt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11228 | .{ .tag = .__builtin_ve_vl_pvfmkwuplt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11229 | .{ .tag = .__builtin_ve_vl_pvfmkwupltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11230 | .{ .tag = .__builtin_ve_vl_pvfmkwupltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11231 | .{ .tag = .__builtin_ve_vl_pvfmkwupnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11232 | .{ .tag = .__builtin_ve_vl_pvfmkwupnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11233 | .{ .tag = .__builtin_ve_vl_pvfmkwupne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11234 | .{ .tag = .__builtin_ve_vl_pvfmkwupne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11235 | .{ .tag = .__builtin_ve_vl_pvfmkwupnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11236 | .{ .tag = .__builtin_ve_vl_pvfmkwupnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11237 | .{ .tag = .__builtin_ve_vl_pvfmkwupnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11238 | .{ .tag = .__builtin_ve_vl_pvfmkwupnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11239 | .{ .tag = .__builtin_ve_vl_pvfmsb_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11240 | .{ .tag = .__builtin_ve_vl_pvfmsb_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11241 | .{ .tag = .__builtin_ve_vl_pvfmsb_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11242 | .{ .tag = .__builtin_ve_vl_pvfmsb_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11243 | .{ .tag = .__builtin_ve_vl_pvfmsb_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11244 | .{ .tag = .__builtin_ve_vl_pvfmsb_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11245 | .{ .tag = .__builtin_ve_vl_pvfmsb_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11246 | .{ .tag = .__builtin_ve_vl_pvfmsb_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11247 | .{ .tag = .__builtin_ve_vl_pvfmsb_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11248 | .{ .tag = .__builtin_ve_vl_pvfmul_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11249 | .{ .tag = .__builtin_ve_vl_pvfmul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11250 | .{ .tag = .__builtin_ve_vl_pvfmul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11251 | .{ .tag = .__builtin_ve_vl_pvfmul_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11252 | .{ .tag = .__builtin_ve_vl_pvfmul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11253 | .{ .tag = .__builtin_ve_vl_pvfmul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11254 | .{ .tag = .__builtin_ve_vl_pvfnmad_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11255 | .{ .tag = .__builtin_ve_vl_pvfnmad_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11256 | .{ .tag = .__builtin_ve_vl_pvfnmad_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11257 | .{ .tag = .__builtin_ve_vl_pvfnmad_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11258 | .{ .tag = .__builtin_ve_vl_pvfnmad_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11259 | .{ .tag = .__builtin_ve_vl_pvfnmad_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11260 | .{ .tag = .__builtin_ve_vl_pvfnmad_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11261 | .{ .tag = .__builtin_ve_vl_pvfnmad_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11262 | .{ .tag = .__builtin_ve_vl_pvfnmad_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11263 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11264 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11265 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11266 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11267 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11268 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11269 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11270 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11271 | .{ .tag = .__builtin_ve_vl_pvfnmsb_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11272 | .{ .tag = .__builtin_ve_vl_pvfsub_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11273 | .{ .tag = .__builtin_ve_vl_pvfsub_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11274 | .{ .tag = .__builtin_ve_vl_pvfsub_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11275 | .{ .tag = .__builtin_ve_vl_pvfsub_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11276 | .{ .tag = .__builtin_ve_vl_pvfsub_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11277 | .{ .tag = .__builtin_ve_vl_pvfsub_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11278 | .{ .tag = .__builtin_ve_vl_pvldz_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11279 | .{ .tag = .__builtin_ve_vl_pvldz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11280 | .{ .tag = .__builtin_ve_vl_pvldz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11281 | .{ .tag = .__builtin_ve_vl_pvldzlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11282 | .{ .tag = .__builtin_ve_vl_pvldzlo_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11283 | .{ .tag = .__builtin_ve_vl_pvldzlo_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11284 | .{ .tag = .__builtin_ve_vl_pvldzup_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11285 | .{ .tag = .__builtin_ve_vl_pvldzup_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11286 | .{ .tag = .__builtin_ve_vl_pvldzup_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11287 | .{ .tag = .__builtin_ve_vl_pvmaxs_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11288 | .{ .tag = .__builtin_ve_vl_pvmaxs_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11289 | .{ .tag = .__builtin_ve_vl_pvmaxs_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11290 | .{ .tag = .__builtin_ve_vl_pvmaxs_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11291 | .{ .tag = .__builtin_ve_vl_pvmaxs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11292 | .{ .tag = .__builtin_ve_vl_pvmaxs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11293 | .{ .tag = .__builtin_ve_vl_pvmins_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11294 | .{ .tag = .__builtin_ve_vl_pvmins_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11295 | .{ .tag = .__builtin_ve_vl_pvmins_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11296 | .{ .tag = .__builtin_ve_vl_pvmins_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11297 | .{ .tag = .__builtin_ve_vl_pvmins_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11298 | .{ .tag = .__builtin_ve_vl_pvmins_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11299 | .{ .tag = .__builtin_ve_vl_pvor_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11300 | .{ .tag = .__builtin_ve_vl_pvor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11301 | .{ .tag = .__builtin_ve_vl_pvor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11302 | .{ .tag = .__builtin_ve_vl_pvor_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11303 | .{ .tag = .__builtin_ve_vl_pvor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11304 | .{ .tag = .__builtin_ve_vl_pvor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11305 | .{ .tag = .__builtin_ve_vl_pvpcnt_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11306 | .{ .tag = .__builtin_ve_vl_pvpcnt_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11307 | .{ .tag = .__builtin_ve_vl_pvpcnt_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11308 | .{ .tag = .__builtin_ve_vl_pvpcntlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11309 | .{ .tag = .__builtin_ve_vl_pvpcntlo_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11310 | .{ .tag = .__builtin_ve_vl_pvpcntlo_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11311 | .{ .tag = .__builtin_ve_vl_pvpcntup_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11312 | .{ .tag = .__builtin_ve_vl_pvpcntup_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11313 | .{ .tag = .__builtin_ve_vl_pvpcntup_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11314 | .{ .tag = .__builtin_ve_vl_pvrcp_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11315 | .{ .tag = .__builtin_ve_vl_pvrcp_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11316 | .{ .tag = .__builtin_ve_vl_pvrsqrt_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11317 | .{ .tag = .__builtin_ve_vl_pvrsqrt_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11318 | .{ .tag = .__builtin_ve_vl_pvrsqrtnex_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11319 | .{ .tag = .__builtin_ve_vl_pvrsqrtnex_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11320 | .{ .tag = .__builtin_ve_vl_pvseq_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11321 | .{ .tag = .__builtin_ve_vl_pvseq_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11322 | .{ .tag = .__builtin_ve_vl_pvseqlo_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11323 | .{ .tag = .__builtin_ve_vl_pvseqlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11324 | .{ .tag = .__builtin_ve_vl_pvsequp_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11325 | .{ .tag = .__builtin_ve_vl_pvsequp_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11326 | .{ .tag = .__builtin_ve_vl_pvsla_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11327 | .{ .tag = .__builtin_ve_vl_pvsla_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11328 | .{ .tag = .__builtin_ve_vl_pvsla_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11329 | .{ .tag = .__builtin_ve_vl_pvsla_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11330 | .{ .tag = .__builtin_ve_vl_pvsla_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11331 | .{ .tag = .__builtin_ve_vl_pvsla_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11332 | .{ .tag = .__builtin_ve_vl_pvsll_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11333 | .{ .tag = .__builtin_ve_vl_pvsll_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11334 | .{ .tag = .__builtin_ve_vl_pvsll_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11335 | .{ .tag = .__builtin_ve_vl_pvsll_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11336 | .{ .tag = .__builtin_ve_vl_pvsll_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11337 | .{ .tag = .__builtin_ve_vl_pvsll_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11338 | .{ .tag = .__builtin_ve_vl_pvsra_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11339 | .{ .tag = .__builtin_ve_vl_pvsra_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11340 | .{ .tag = .__builtin_ve_vl_pvsra_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11341 | .{ .tag = .__builtin_ve_vl_pvsra_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11342 | .{ .tag = .__builtin_ve_vl_pvsra_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11343 | .{ .tag = .__builtin_ve_vl_pvsra_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11344 | .{ .tag = .__builtin_ve_vl_pvsrl_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11345 | .{ .tag = .__builtin_ve_vl_pvsrl_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11346 | .{ .tag = .__builtin_ve_vl_pvsrl_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11347 | .{ .tag = .__builtin_ve_vl_pvsrl_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11348 | .{ .tag = .__builtin_ve_vl_pvsrl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11349 | .{ .tag = .__builtin_ve_vl_pvsrl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11350 | .{ .tag = .__builtin_ve_vl_pvsubs_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11351 | .{ .tag = .__builtin_ve_vl_pvsubs_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11352 | .{ .tag = .__builtin_ve_vl_pvsubs_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11353 | .{ .tag = .__builtin_ve_vl_pvsubs_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11354 | .{ .tag = .__builtin_ve_vl_pvsubs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11355 | .{ .tag = .__builtin_ve_vl_pvsubs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11356 | .{ .tag = .__builtin_ve_vl_pvsubu_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11357 | .{ .tag = .__builtin_ve_vl_pvsubu_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11358 | .{ .tag = .__builtin_ve_vl_pvsubu_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11359 | .{ .tag = .__builtin_ve_vl_pvsubu_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11360 | .{ .tag = .__builtin_ve_vl_pvsubu_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11361 | .{ .tag = .__builtin_ve_vl_pvsubu_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11362 | .{ .tag = .__builtin_ve_vl_pvxor_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11363 | .{ .tag = .__builtin_ve_vl_pvxor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11364 | .{ .tag = .__builtin_ve_vl_pvxor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11365 | .{ .tag = .__builtin_ve_vl_pvxor_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11366 | .{ .tag = .__builtin_ve_vl_pvxor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11367 | .{ .tag = .__builtin_ve_vl_pvxor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11368 | .{ .tag = .__builtin_ve_vl_scr_sss, .properties = .{ .param_str = "vLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11369 | .{ .tag = .__builtin_ve_vl_svm_sMs, .properties = .{ .param_str = "LUiV512bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11370 | .{ .tag = .__builtin_ve_vl_svm_sms, .properties = .{ .param_str = "LUiV256bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11371 | .{ .tag = .__builtin_ve_vl_svob, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11372 | .{ .tag = .__builtin_ve_vl_tovm_sml, .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11373 | .{ .tag = .__builtin_ve_vl_tscr_ssss, .properties = .{ .param_str = "LUiLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11374 | .{ .tag = .__builtin_ve_vl_vaddsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11375 | .{ .tag = .__builtin_ve_vl_vaddsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11376 | .{ .tag = .__builtin_ve_vl_vaddsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11377 | .{ .tag = .__builtin_ve_vl_vaddsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11378 | .{ .tag = .__builtin_ve_vl_vaddsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11379 | .{ .tag = .__builtin_ve_vl_vaddsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11380 | .{ .tag = .__builtin_ve_vl_vaddswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11381 | .{ .tag = .__builtin_ve_vl_vaddswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11382 | .{ .tag = .__builtin_ve_vl_vaddswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11383 | .{ .tag = .__builtin_ve_vl_vaddswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11384 | .{ .tag = .__builtin_ve_vl_vaddswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11385 | .{ .tag = .__builtin_ve_vl_vaddswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11386 | .{ .tag = .__builtin_ve_vl_vaddswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11387 | .{ .tag = .__builtin_ve_vl_vaddswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11388 | .{ .tag = .__builtin_ve_vl_vaddswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11389 | .{ .tag = .__builtin_ve_vl_vaddswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11390 | .{ .tag = .__builtin_ve_vl_vaddswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11391 | .{ .tag = .__builtin_ve_vl_vaddswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11392 | .{ .tag = .__builtin_ve_vl_vaddul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11393 | .{ .tag = .__builtin_ve_vl_vaddul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11394 | .{ .tag = .__builtin_ve_vl_vaddul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11395 | .{ .tag = .__builtin_ve_vl_vaddul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11396 | .{ .tag = .__builtin_ve_vl_vaddul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11397 | .{ .tag = .__builtin_ve_vl_vaddul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11398 | .{ .tag = .__builtin_ve_vl_vadduw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11399 | .{ .tag = .__builtin_ve_vl_vadduw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11400 | .{ .tag = .__builtin_ve_vl_vadduw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11401 | .{ .tag = .__builtin_ve_vl_vadduw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11402 | .{ .tag = .__builtin_ve_vl_vadduw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11403 | .{ .tag = .__builtin_ve_vl_vadduw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11404 | .{ .tag = .__builtin_ve_vl_vand_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11405 | .{ .tag = .__builtin_ve_vl_vand_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11406 | .{ .tag = .__builtin_ve_vl_vand_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11407 | .{ .tag = .__builtin_ve_vl_vand_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11408 | .{ .tag = .__builtin_ve_vl_vand_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11409 | .{ .tag = .__builtin_ve_vl_vand_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11410 | .{ .tag = .__builtin_ve_vl_vbrdd_vsl, .properties = .{ .param_str = "V256ddUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11411 | .{ .tag = .__builtin_ve_vl_vbrdd_vsmvl, .properties = .{ .param_str = "V256ddV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11412 | .{ .tag = .__builtin_ve_vl_vbrdd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11413 | .{ .tag = .__builtin_ve_vl_vbrdl_vsl, .properties = .{ .param_str = "V256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11414 | .{ .tag = .__builtin_ve_vl_vbrdl_vsmvl, .properties = .{ .param_str = "V256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11415 | .{ .tag = .__builtin_ve_vl_vbrdl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11416 | .{ .tag = .__builtin_ve_vl_vbrds_vsl, .properties = .{ .param_str = "V256dfUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11417 | .{ .tag = .__builtin_ve_vl_vbrds_vsmvl, .properties = .{ .param_str = "V256dfV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11418 | .{ .tag = .__builtin_ve_vl_vbrds_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11419 | .{ .tag = .__builtin_ve_vl_vbrdw_vsl, .properties = .{ .param_str = "V256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11420 | .{ .tag = .__builtin_ve_vl_vbrdw_vsmvl, .properties = .{ .param_str = "V256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11421 | .{ .tag = .__builtin_ve_vl_vbrdw_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11422 | .{ .tag = .__builtin_ve_vl_vbrv_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11423 | .{ .tag = .__builtin_ve_vl_vbrv_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11424 | .{ .tag = .__builtin_ve_vl_vbrv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11425 | .{ .tag = .__builtin_ve_vl_vcmpsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11426 | .{ .tag = .__builtin_ve_vl_vcmpsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11427 | .{ .tag = .__builtin_ve_vl_vcmpsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11428 | .{ .tag = .__builtin_ve_vl_vcmpsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11429 | .{ .tag = .__builtin_ve_vl_vcmpsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11430 | .{ .tag = .__builtin_ve_vl_vcmpsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11431 | .{ .tag = .__builtin_ve_vl_vcmpswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11432 | .{ .tag = .__builtin_ve_vl_vcmpswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11433 | .{ .tag = .__builtin_ve_vl_vcmpswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11434 | .{ .tag = .__builtin_ve_vl_vcmpswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11435 | .{ .tag = .__builtin_ve_vl_vcmpswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11436 | .{ .tag = .__builtin_ve_vl_vcmpswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11437 | .{ .tag = .__builtin_ve_vl_vcmpswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11438 | .{ .tag = .__builtin_ve_vl_vcmpswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11439 | .{ .tag = .__builtin_ve_vl_vcmpswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11440 | .{ .tag = .__builtin_ve_vl_vcmpswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11441 | .{ .tag = .__builtin_ve_vl_vcmpswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11442 | .{ .tag = .__builtin_ve_vl_vcmpswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11443 | .{ .tag = .__builtin_ve_vl_vcmpul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11444 | .{ .tag = .__builtin_ve_vl_vcmpul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11445 | .{ .tag = .__builtin_ve_vl_vcmpul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11446 | .{ .tag = .__builtin_ve_vl_vcmpul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11447 | .{ .tag = .__builtin_ve_vl_vcmpul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11448 | .{ .tag = .__builtin_ve_vl_vcmpul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11449 | .{ .tag = .__builtin_ve_vl_vcmpuw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11450 | .{ .tag = .__builtin_ve_vl_vcmpuw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11451 | .{ .tag = .__builtin_ve_vl_vcmpuw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11452 | .{ .tag = .__builtin_ve_vl_vcmpuw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11453 | .{ .tag = .__builtin_ve_vl_vcmpuw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11454 | .{ .tag = .__builtin_ve_vl_vcmpuw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11455 | .{ .tag = .__builtin_ve_vl_vcp_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11456 | .{ .tag = .__builtin_ve_vl_vcvtdl_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11457 | .{ .tag = .__builtin_ve_vl_vcvtdl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11458 | .{ .tag = .__builtin_ve_vl_vcvtds_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11459 | .{ .tag = .__builtin_ve_vl_vcvtds_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11460 | .{ .tag = .__builtin_ve_vl_vcvtdw_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11461 | .{ .tag = .__builtin_ve_vl_vcvtdw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11462 | .{ .tag = .__builtin_ve_vl_vcvtld_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11463 | .{ .tag = .__builtin_ve_vl_vcvtld_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11464 | .{ .tag = .__builtin_ve_vl_vcvtld_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11465 | .{ .tag = .__builtin_ve_vl_vcvtldrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11466 | .{ .tag = .__builtin_ve_vl_vcvtldrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11467 | .{ .tag = .__builtin_ve_vl_vcvtldrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11468 | .{ .tag = .__builtin_ve_vl_vcvtsd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11469 | .{ .tag = .__builtin_ve_vl_vcvtsd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11470 | .{ .tag = .__builtin_ve_vl_vcvtsw_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11471 | .{ .tag = .__builtin_ve_vl_vcvtsw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11472 | .{ .tag = .__builtin_ve_vl_vcvtwdsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11473 | .{ .tag = .__builtin_ve_vl_vcvtwdsx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11474 | .{ .tag = .__builtin_ve_vl_vcvtwdsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11475 | .{ .tag = .__builtin_ve_vl_vcvtwdsxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11476 | .{ .tag = .__builtin_ve_vl_vcvtwdsxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11477 | .{ .tag = .__builtin_ve_vl_vcvtwdsxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11478 | .{ .tag = .__builtin_ve_vl_vcvtwdzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11479 | .{ .tag = .__builtin_ve_vl_vcvtwdzx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11480 | .{ .tag = .__builtin_ve_vl_vcvtwdzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11481 | .{ .tag = .__builtin_ve_vl_vcvtwdzxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11482 | .{ .tag = .__builtin_ve_vl_vcvtwdzxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11483 | .{ .tag = .__builtin_ve_vl_vcvtwdzxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11484 | .{ .tag = .__builtin_ve_vl_vcvtwssx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11485 | .{ .tag = .__builtin_ve_vl_vcvtwssx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11486 | .{ .tag = .__builtin_ve_vl_vcvtwssx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11487 | .{ .tag = .__builtin_ve_vl_vcvtwssxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11488 | .{ .tag = .__builtin_ve_vl_vcvtwssxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11489 | .{ .tag = .__builtin_ve_vl_vcvtwssxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11490 | .{ .tag = .__builtin_ve_vl_vcvtwszx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11491 | .{ .tag = .__builtin_ve_vl_vcvtwszx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11492 | .{ .tag = .__builtin_ve_vl_vcvtwszx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11493 | .{ .tag = .__builtin_ve_vl_vcvtwszxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11494 | .{ .tag = .__builtin_ve_vl_vcvtwszxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11495 | .{ .tag = .__builtin_ve_vl_vcvtwszxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11496 | .{ .tag = .__builtin_ve_vl_vdivsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11497 | .{ .tag = .__builtin_ve_vl_vdivsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11498 | .{ .tag = .__builtin_ve_vl_vdivsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11499 | .{ .tag = .__builtin_ve_vl_vdivsl_vvsl, .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11500 | .{ .tag = .__builtin_ve_vl_vdivsl_vvsmvl, .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11501 | .{ .tag = .__builtin_ve_vl_vdivsl_vvsvl, .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11502 | .{ .tag = .__builtin_ve_vl_vdivsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11503 | .{ .tag = .__builtin_ve_vl_vdivsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11504 | .{ .tag = .__builtin_ve_vl_vdivsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11505 | .{ .tag = .__builtin_ve_vl_vdivswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11506 | .{ .tag = .__builtin_ve_vl_vdivswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11507 | .{ .tag = .__builtin_ve_vl_vdivswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11508 | .{ .tag = .__builtin_ve_vl_vdivswsx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11509 | .{ .tag = .__builtin_ve_vl_vdivswsx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11510 | .{ .tag = .__builtin_ve_vl_vdivswsx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11511 | .{ .tag = .__builtin_ve_vl_vdivswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11512 | .{ .tag = .__builtin_ve_vl_vdivswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11513 | .{ .tag = .__builtin_ve_vl_vdivswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11514 | .{ .tag = .__builtin_ve_vl_vdivswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11515 | .{ .tag = .__builtin_ve_vl_vdivswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11516 | .{ .tag = .__builtin_ve_vl_vdivswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11517 | .{ .tag = .__builtin_ve_vl_vdivswzx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11518 | .{ .tag = .__builtin_ve_vl_vdivswzx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11519 | .{ .tag = .__builtin_ve_vl_vdivswzx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11520 | .{ .tag = .__builtin_ve_vl_vdivswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11521 | .{ .tag = .__builtin_ve_vl_vdivswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11522 | .{ .tag = .__builtin_ve_vl_vdivswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11523 | .{ .tag = .__builtin_ve_vl_vdivul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11524 | .{ .tag = .__builtin_ve_vl_vdivul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11525 | .{ .tag = .__builtin_ve_vl_vdivul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11526 | .{ .tag = .__builtin_ve_vl_vdivul_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11527 | .{ .tag = .__builtin_ve_vl_vdivul_vvsmvl, .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11528 | .{ .tag = .__builtin_ve_vl_vdivul_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11529 | .{ .tag = .__builtin_ve_vl_vdivul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11530 | .{ .tag = .__builtin_ve_vl_vdivul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11531 | .{ .tag = .__builtin_ve_vl_vdivul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11532 | .{ .tag = .__builtin_ve_vl_vdivuw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11533 | .{ .tag = .__builtin_ve_vl_vdivuw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11534 | .{ .tag = .__builtin_ve_vl_vdivuw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11535 | .{ .tag = .__builtin_ve_vl_vdivuw_vvsl, .properties = .{ .param_str = "V256dV256dUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11536 | .{ .tag = .__builtin_ve_vl_vdivuw_vvsmvl, .properties = .{ .param_str = "V256dV256dUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11537 | .{ .tag = .__builtin_ve_vl_vdivuw_vvsvl, .properties = .{ .param_str = "V256dV256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11538 | .{ .tag = .__builtin_ve_vl_vdivuw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11539 | .{ .tag = .__builtin_ve_vl_vdivuw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11540 | .{ .tag = .__builtin_ve_vl_vdivuw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11541 | .{ .tag = .__builtin_ve_vl_veqv_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11542 | .{ .tag = .__builtin_ve_vl_veqv_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11543 | .{ .tag = .__builtin_ve_vl_veqv_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11544 | .{ .tag = .__builtin_ve_vl_veqv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11545 | .{ .tag = .__builtin_ve_vl_veqv_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11546 | .{ .tag = .__builtin_ve_vl_veqv_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11547 | .{ .tag = .__builtin_ve_vl_vex_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11548 | .{ .tag = .__builtin_ve_vl_vfaddd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11549 | .{ .tag = .__builtin_ve_vl_vfaddd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11550 | .{ .tag = .__builtin_ve_vl_vfaddd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11551 | .{ .tag = .__builtin_ve_vl_vfaddd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11552 | .{ .tag = .__builtin_ve_vl_vfaddd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11553 | .{ .tag = .__builtin_ve_vl_vfaddd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11554 | .{ .tag = .__builtin_ve_vl_vfadds_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11555 | .{ .tag = .__builtin_ve_vl_vfadds_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11556 | .{ .tag = .__builtin_ve_vl_vfadds_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11557 | .{ .tag = .__builtin_ve_vl_vfadds_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11558 | .{ .tag = .__builtin_ve_vl_vfadds_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11559 | .{ .tag = .__builtin_ve_vl_vfadds_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11560 | .{ .tag = .__builtin_ve_vl_vfcmpd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11561 | .{ .tag = .__builtin_ve_vl_vfcmpd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11562 | .{ .tag = .__builtin_ve_vl_vfcmpd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11563 | .{ .tag = .__builtin_ve_vl_vfcmpd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11564 | .{ .tag = .__builtin_ve_vl_vfcmpd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11565 | .{ .tag = .__builtin_ve_vl_vfcmpd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11566 | .{ .tag = .__builtin_ve_vl_vfcmps_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11567 | .{ .tag = .__builtin_ve_vl_vfcmps_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11568 | .{ .tag = .__builtin_ve_vl_vfcmps_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11569 | .{ .tag = .__builtin_ve_vl_vfcmps_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11570 | .{ .tag = .__builtin_ve_vl_vfcmps_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11571 | .{ .tag = .__builtin_ve_vl_vfcmps_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11572 | .{ .tag = .__builtin_ve_vl_vfdivd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11573 | .{ .tag = .__builtin_ve_vl_vfdivd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11574 | .{ .tag = .__builtin_ve_vl_vfdivd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11575 | .{ .tag = .__builtin_ve_vl_vfdivd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11576 | .{ .tag = .__builtin_ve_vl_vfdivd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11577 | .{ .tag = .__builtin_ve_vl_vfdivd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11578 | .{ .tag = .__builtin_ve_vl_vfdivs_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11579 | .{ .tag = .__builtin_ve_vl_vfdivs_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11580 | .{ .tag = .__builtin_ve_vl_vfdivs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11581 | .{ .tag = .__builtin_ve_vl_vfdivs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11582 | .{ .tag = .__builtin_ve_vl_vfdivs_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11583 | .{ .tag = .__builtin_ve_vl_vfdivs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11584 | .{ .tag = .__builtin_ve_vl_vfmadd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11585 | .{ .tag = .__builtin_ve_vl_vfmadd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11586 | .{ .tag = .__builtin_ve_vl_vfmadd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11587 | .{ .tag = .__builtin_ve_vl_vfmadd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11588 | .{ .tag = .__builtin_ve_vl_vfmadd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11589 | .{ .tag = .__builtin_ve_vl_vfmadd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11590 | .{ .tag = .__builtin_ve_vl_vfmadd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11591 | .{ .tag = .__builtin_ve_vl_vfmadd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11592 | .{ .tag = .__builtin_ve_vl_vfmadd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11593 | .{ .tag = .__builtin_ve_vl_vfmads_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11594 | .{ .tag = .__builtin_ve_vl_vfmads_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11595 | .{ .tag = .__builtin_ve_vl_vfmads_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11596 | .{ .tag = .__builtin_ve_vl_vfmads_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11597 | .{ .tag = .__builtin_ve_vl_vfmads_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11598 | .{ .tag = .__builtin_ve_vl_vfmads_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11599 | .{ .tag = .__builtin_ve_vl_vfmads_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11600 | .{ .tag = .__builtin_ve_vl_vfmads_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11601 | .{ .tag = .__builtin_ve_vl_vfmads_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11602 | .{ .tag = .__builtin_ve_vl_vfmaxd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11603 | .{ .tag = .__builtin_ve_vl_vfmaxd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11604 | .{ .tag = .__builtin_ve_vl_vfmaxd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11605 | .{ .tag = .__builtin_ve_vl_vfmaxd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11606 | .{ .tag = .__builtin_ve_vl_vfmaxd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11607 | .{ .tag = .__builtin_ve_vl_vfmaxd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11608 | .{ .tag = .__builtin_ve_vl_vfmaxs_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11609 | .{ .tag = .__builtin_ve_vl_vfmaxs_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11610 | .{ .tag = .__builtin_ve_vl_vfmaxs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11611 | .{ .tag = .__builtin_ve_vl_vfmaxs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11612 | .{ .tag = .__builtin_ve_vl_vfmaxs_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11613 | .{ .tag = .__builtin_ve_vl_vfmaxs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11614 | .{ .tag = .__builtin_ve_vl_vfmind_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11615 | .{ .tag = .__builtin_ve_vl_vfmind_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11616 | .{ .tag = .__builtin_ve_vl_vfmind_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11617 | .{ .tag = .__builtin_ve_vl_vfmind_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11618 | .{ .tag = .__builtin_ve_vl_vfmind_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11619 | .{ .tag = .__builtin_ve_vl_vfmind_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11620 | .{ .tag = .__builtin_ve_vl_vfmins_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11621 | .{ .tag = .__builtin_ve_vl_vfmins_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11622 | .{ .tag = .__builtin_ve_vl_vfmins_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11623 | .{ .tag = .__builtin_ve_vl_vfmins_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11624 | .{ .tag = .__builtin_ve_vl_vfmins_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11625 | .{ .tag = .__builtin_ve_vl_vfmins_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11626 | .{ .tag = .__builtin_ve_vl_vfmkdeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11627 | .{ .tag = .__builtin_ve_vl_vfmkdeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11628 | .{ .tag = .__builtin_ve_vl_vfmkdeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11629 | .{ .tag = .__builtin_ve_vl_vfmkdeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11630 | .{ .tag = .__builtin_ve_vl_vfmkdge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11631 | .{ .tag = .__builtin_ve_vl_vfmkdge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11632 | .{ .tag = .__builtin_ve_vl_vfmkdgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11633 | .{ .tag = .__builtin_ve_vl_vfmkdgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11634 | .{ .tag = .__builtin_ve_vl_vfmkdgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11635 | .{ .tag = .__builtin_ve_vl_vfmkdgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11636 | .{ .tag = .__builtin_ve_vl_vfmkdgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11637 | .{ .tag = .__builtin_ve_vl_vfmkdgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11638 | .{ .tag = .__builtin_ve_vl_vfmkdle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11639 | .{ .tag = .__builtin_ve_vl_vfmkdle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11640 | .{ .tag = .__builtin_ve_vl_vfmkdlenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11641 | .{ .tag = .__builtin_ve_vl_vfmkdlenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11642 | .{ .tag = .__builtin_ve_vl_vfmkdlt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11643 | .{ .tag = .__builtin_ve_vl_vfmkdlt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11644 | .{ .tag = .__builtin_ve_vl_vfmkdltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11645 | .{ .tag = .__builtin_ve_vl_vfmkdltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11646 | .{ .tag = .__builtin_ve_vl_vfmkdnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11647 | .{ .tag = .__builtin_ve_vl_vfmkdnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11648 | .{ .tag = .__builtin_ve_vl_vfmkdne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11649 | .{ .tag = .__builtin_ve_vl_vfmkdne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11650 | .{ .tag = .__builtin_ve_vl_vfmkdnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11651 | .{ .tag = .__builtin_ve_vl_vfmkdnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11652 | .{ .tag = .__builtin_ve_vl_vfmkdnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11653 | .{ .tag = .__builtin_ve_vl_vfmkdnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11654 | .{ .tag = .__builtin_ve_vl_vfmklaf_ml, .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11655 | .{ .tag = .__builtin_ve_vl_vfmklat_ml, .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11656 | .{ .tag = .__builtin_ve_vl_vfmkleq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11657 | .{ .tag = .__builtin_ve_vl_vfmkleq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11658 | .{ .tag = .__builtin_ve_vl_vfmkleqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11659 | .{ .tag = .__builtin_ve_vl_vfmkleqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11660 | .{ .tag = .__builtin_ve_vl_vfmklge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11661 | .{ .tag = .__builtin_ve_vl_vfmklge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11662 | .{ .tag = .__builtin_ve_vl_vfmklgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11663 | .{ .tag = .__builtin_ve_vl_vfmklgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11664 | .{ .tag = .__builtin_ve_vl_vfmklgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11665 | .{ .tag = .__builtin_ve_vl_vfmklgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11666 | .{ .tag = .__builtin_ve_vl_vfmklgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11667 | .{ .tag = .__builtin_ve_vl_vfmklgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11668 | .{ .tag = .__builtin_ve_vl_vfmklle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11669 | .{ .tag = .__builtin_ve_vl_vfmklle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11670 | .{ .tag = .__builtin_ve_vl_vfmkllenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11671 | .{ .tag = .__builtin_ve_vl_vfmkllenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11672 | .{ .tag = .__builtin_ve_vl_vfmkllt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11673 | .{ .tag = .__builtin_ve_vl_vfmkllt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11674 | .{ .tag = .__builtin_ve_vl_vfmklltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11675 | .{ .tag = .__builtin_ve_vl_vfmklltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11676 | .{ .tag = .__builtin_ve_vl_vfmklnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11677 | .{ .tag = .__builtin_ve_vl_vfmklnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11678 | .{ .tag = .__builtin_ve_vl_vfmklne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11679 | .{ .tag = .__builtin_ve_vl_vfmklne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11680 | .{ .tag = .__builtin_ve_vl_vfmklnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11681 | .{ .tag = .__builtin_ve_vl_vfmklnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11682 | .{ .tag = .__builtin_ve_vl_vfmklnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11683 | .{ .tag = .__builtin_ve_vl_vfmklnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11684 | .{ .tag = .__builtin_ve_vl_vfmkseq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11685 | .{ .tag = .__builtin_ve_vl_vfmkseq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11686 | .{ .tag = .__builtin_ve_vl_vfmkseqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11687 | .{ .tag = .__builtin_ve_vl_vfmkseqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11688 | .{ .tag = .__builtin_ve_vl_vfmksge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11689 | .{ .tag = .__builtin_ve_vl_vfmksge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11690 | .{ .tag = .__builtin_ve_vl_vfmksgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11691 | .{ .tag = .__builtin_ve_vl_vfmksgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11692 | .{ .tag = .__builtin_ve_vl_vfmksgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11693 | .{ .tag = .__builtin_ve_vl_vfmksgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11694 | .{ .tag = .__builtin_ve_vl_vfmksgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11695 | .{ .tag = .__builtin_ve_vl_vfmksgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11696 | .{ .tag = .__builtin_ve_vl_vfmksle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11697 | .{ .tag = .__builtin_ve_vl_vfmksle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11698 | .{ .tag = .__builtin_ve_vl_vfmkslenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11699 | .{ .tag = .__builtin_ve_vl_vfmkslenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11700 | .{ .tag = .__builtin_ve_vl_vfmkslt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11701 | .{ .tag = .__builtin_ve_vl_vfmkslt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11702 | .{ .tag = .__builtin_ve_vl_vfmksltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11703 | .{ .tag = .__builtin_ve_vl_vfmksltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11704 | .{ .tag = .__builtin_ve_vl_vfmksnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11705 | .{ .tag = .__builtin_ve_vl_vfmksnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11706 | .{ .tag = .__builtin_ve_vl_vfmksne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11707 | .{ .tag = .__builtin_ve_vl_vfmksne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11708 | .{ .tag = .__builtin_ve_vl_vfmksnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11709 | .{ .tag = .__builtin_ve_vl_vfmksnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11710 | .{ .tag = .__builtin_ve_vl_vfmksnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11711 | .{ .tag = .__builtin_ve_vl_vfmksnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11712 | .{ .tag = .__builtin_ve_vl_vfmkweq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11713 | .{ .tag = .__builtin_ve_vl_vfmkweq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11714 | .{ .tag = .__builtin_ve_vl_vfmkweqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11715 | .{ .tag = .__builtin_ve_vl_vfmkweqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11716 | .{ .tag = .__builtin_ve_vl_vfmkwge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11717 | .{ .tag = .__builtin_ve_vl_vfmkwge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11718 | .{ .tag = .__builtin_ve_vl_vfmkwgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11719 | .{ .tag = .__builtin_ve_vl_vfmkwgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11720 | .{ .tag = .__builtin_ve_vl_vfmkwgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11721 | .{ .tag = .__builtin_ve_vl_vfmkwgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11722 | .{ .tag = .__builtin_ve_vl_vfmkwgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11723 | .{ .tag = .__builtin_ve_vl_vfmkwgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11724 | .{ .tag = .__builtin_ve_vl_vfmkwle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11725 | .{ .tag = .__builtin_ve_vl_vfmkwle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11726 | .{ .tag = .__builtin_ve_vl_vfmkwlenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11727 | .{ .tag = .__builtin_ve_vl_vfmkwlenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11728 | .{ .tag = .__builtin_ve_vl_vfmkwlt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11729 | .{ .tag = .__builtin_ve_vl_vfmkwlt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11730 | .{ .tag = .__builtin_ve_vl_vfmkwltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11731 | .{ .tag = .__builtin_ve_vl_vfmkwltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11732 | .{ .tag = .__builtin_ve_vl_vfmkwnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11733 | .{ .tag = .__builtin_ve_vl_vfmkwnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11734 | .{ .tag = .__builtin_ve_vl_vfmkwne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11735 | .{ .tag = .__builtin_ve_vl_vfmkwne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11736 | .{ .tag = .__builtin_ve_vl_vfmkwnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11737 | .{ .tag = .__builtin_ve_vl_vfmkwnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11738 | .{ .tag = .__builtin_ve_vl_vfmkwnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11739 | .{ .tag = .__builtin_ve_vl_vfmkwnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11740 | .{ .tag = .__builtin_ve_vl_vfmsbd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11741 | .{ .tag = .__builtin_ve_vl_vfmsbd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11742 | .{ .tag = .__builtin_ve_vl_vfmsbd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11743 | .{ .tag = .__builtin_ve_vl_vfmsbd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11744 | .{ .tag = .__builtin_ve_vl_vfmsbd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11745 | .{ .tag = .__builtin_ve_vl_vfmsbd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11746 | .{ .tag = .__builtin_ve_vl_vfmsbd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11747 | .{ .tag = .__builtin_ve_vl_vfmsbd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11748 | .{ .tag = .__builtin_ve_vl_vfmsbd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11749 | .{ .tag = .__builtin_ve_vl_vfmsbs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11750 | .{ .tag = .__builtin_ve_vl_vfmsbs_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11751 | .{ .tag = .__builtin_ve_vl_vfmsbs_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11752 | .{ .tag = .__builtin_ve_vl_vfmsbs_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11753 | .{ .tag = .__builtin_ve_vl_vfmsbs_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11754 | .{ .tag = .__builtin_ve_vl_vfmsbs_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11755 | .{ .tag = .__builtin_ve_vl_vfmsbs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11756 | .{ .tag = .__builtin_ve_vl_vfmsbs_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11757 | .{ .tag = .__builtin_ve_vl_vfmsbs_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11758 | .{ .tag = .__builtin_ve_vl_vfmuld_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11759 | .{ .tag = .__builtin_ve_vl_vfmuld_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11760 | .{ .tag = .__builtin_ve_vl_vfmuld_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11761 | .{ .tag = .__builtin_ve_vl_vfmuld_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11762 | .{ .tag = .__builtin_ve_vl_vfmuld_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11763 | .{ .tag = .__builtin_ve_vl_vfmuld_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11764 | .{ .tag = .__builtin_ve_vl_vfmuls_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11765 | .{ .tag = .__builtin_ve_vl_vfmuls_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11766 | .{ .tag = .__builtin_ve_vl_vfmuls_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11767 | .{ .tag = .__builtin_ve_vl_vfmuls_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11768 | .{ .tag = .__builtin_ve_vl_vfmuls_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11769 | .{ .tag = .__builtin_ve_vl_vfmuls_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11770 | .{ .tag = .__builtin_ve_vl_vfnmadd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11771 | .{ .tag = .__builtin_ve_vl_vfnmadd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11772 | .{ .tag = .__builtin_ve_vl_vfnmadd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11773 | .{ .tag = .__builtin_ve_vl_vfnmadd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11774 | .{ .tag = .__builtin_ve_vl_vfnmadd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11775 | .{ .tag = .__builtin_ve_vl_vfnmadd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11776 | .{ .tag = .__builtin_ve_vl_vfnmadd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11777 | .{ .tag = .__builtin_ve_vl_vfnmadd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11778 | .{ .tag = .__builtin_ve_vl_vfnmadd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11779 | .{ .tag = .__builtin_ve_vl_vfnmads_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11780 | .{ .tag = .__builtin_ve_vl_vfnmads_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11781 | .{ .tag = .__builtin_ve_vl_vfnmads_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11782 | .{ .tag = .__builtin_ve_vl_vfnmads_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11783 | .{ .tag = .__builtin_ve_vl_vfnmads_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11784 | .{ .tag = .__builtin_ve_vl_vfnmads_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11785 | .{ .tag = .__builtin_ve_vl_vfnmads_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11786 | .{ .tag = .__builtin_ve_vl_vfnmads_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11787 | .{ .tag = .__builtin_ve_vl_vfnmads_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11788 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11789 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11790 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11791 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11792 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11793 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11794 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11795 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11796 | .{ .tag = .__builtin_ve_vl_vfnmsbd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11797 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11798 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11799 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11800 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11801 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11802 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11803 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11804 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11805 | .{ .tag = .__builtin_ve_vl_vfnmsbs_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11806 | .{ .tag = .__builtin_ve_vl_vfrmaxdfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11807 | .{ .tag = .__builtin_ve_vl_vfrmaxdfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11808 | .{ .tag = .__builtin_ve_vl_vfrmaxdlst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11809 | .{ .tag = .__builtin_ve_vl_vfrmaxdlst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11810 | .{ .tag = .__builtin_ve_vl_vfrmaxsfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11811 | .{ .tag = .__builtin_ve_vl_vfrmaxsfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11812 | .{ .tag = .__builtin_ve_vl_vfrmaxslst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11813 | .{ .tag = .__builtin_ve_vl_vfrmaxslst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11814 | .{ .tag = .__builtin_ve_vl_vfrmindfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11815 | .{ .tag = .__builtin_ve_vl_vfrmindfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11816 | .{ .tag = .__builtin_ve_vl_vfrmindlst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11817 | .{ .tag = .__builtin_ve_vl_vfrmindlst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11818 | .{ .tag = .__builtin_ve_vl_vfrminsfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11819 | .{ .tag = .__builtin_ve_vl_vfrminsfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11820 | .{ .tag = .__builtin_ve_vl_vfrminslst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11821 | .{ .tag = .__builtin_ve_vl_vfrminslst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11822 | .{ .tag = .__builtin_ve_vl_vfsqrtd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11823 | .{ .tag = .__builtin_ve_vl_vfsqrtd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11824 | .{ .tag = .__builtin_ve_vl_vfsqrts_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11825 | .{ .tag = .__builtin_ve_vl_vfsqrts_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11826 | .{ .tag = .__builtin_ve_vl_vfsubd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11827 | .{ .tag = .__builtin_ve_vl_vfsubd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11828 | .{ .tag = .__builtin_ve_vl_vfsubd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11829 | .{ .tag = .__builtin_ve_vl_vfsubd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11830 | .{ .tag = .__builtin_ve_vl_vfsubd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11831 | .{ .tag = .__builtin_ve_vl_vfsubd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11832 | .{ .tag = .__builtin_ve_vl_vfsubs_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11833 | .{ .tag = .__builtin_ve_vl_vfsubs_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11834 | .{ .tag = .__builtin_ve_vl_vfsubs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11835 | .{ .tag = .__builtin_ve_vl_vfsubs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11836 | .{ .tag = .__builtin_ve_vl_vfsubs_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11837 | .{ .tag = .__builtin_ve_vl_vfsubs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11838 | .{ .tag = .__builtin_ve_vl_vfsumd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11839 | .{ .tag = .__builtin_ve_vl_vfsumd_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11840 | .{ .tag = .__builtin_ve_vl_vfsums_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11841 | .{ .tag = .__builtin_ve_vl_vfsums_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11842 | .{ .tag = .__builtin_ve_vl_vgt_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11843 | .{ .tag = .__builtin_ve_vl_vgt_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11844 | .{ .tag = .__builtin_ve_vl_vgt_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11845 | .{ .tag = .__builtin_ve_vl_vgt_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11846 | .{ .tag = .__builtin_ve_vl_vgtlsx_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11847 | .{ .tag = .__builtin_ve_vl_vgtlsx_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11848 | .{ .tag = .__builtin_ve_vl_vgtlsx_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11849 | .{ .tag = .__builtin_ve_vl_vgtlsx_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11850 | .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11851 | .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11852 | .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11853 | .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11854 | .{ .tag = .__builtin_ve_vl_vgtlzx_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11855 | .{ .tag = .__builtin_ve_vl_vgtlzx_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11856 | .{ .tag = .__builtin_ve_vl_vgtlzx_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11857 | .{ .tag = .__builtin_ve_vl_vgtlzx_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11858 | .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11859 | .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11860 | .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11861 | .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11862 | .{ .tag = .__builtin_ve_vl_vgtnc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11863 | .{ .tag = .__builtin_ve_vl_vgtnc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11864 | .{ .tag = .__builtin_ve_vl_vgtnc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11865 | .{ .tag = .__builtin_ve_vl_vgtnc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11866 | .{ .tag = .__builtin_ve_vl_vgtu_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11867 | .{ .tag = .__builtin_ve_vl_vgtu_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11868 | .{ .tag = .__builtin_ve_vl_vgtu_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11869 | .{ .tag = .__builtin_ve_vl_vgtu_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11870 | .{ .tag = .__builtin_ve_vl_vgtunc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11871 | .{ .tag = .__builtin_ve_vl_vgtunc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11872 | .{ .tag = .__builtin_ve_vl_vgtunc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11873 | .{ .tag = .__builtin_ve_vl_vgtunc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11874 | .{ .tag = .__builtin_ve_vl_vld2d_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11875 | .{ .tag = .__builtin_ve_vl_vld2d_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11876 | .{ .tag = .__builtin_ve_vl_vld2dnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11877 | .{ .tag = .__builtin_ve_vl_vld2dnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11878 | .{ .tag = .__builtin_ve_vl_vld_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11879 | .{ .tag = .__builtin_ve_vl_vld_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11880 | .{ .tag = .__builtin_ve_vl_vldl2dsx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11881 | .{ .tag = .__builtin_ve_vl_vldl2dsx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11882 | .{ .tag = .__builtin_ve_vl_vldl2dsxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11883 | .{ .tag = .__builtin_ve_vl_vldl2dsxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11884 | .{ .tag = .__builtin_ve_vl_vldl2dzx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11885 | .{ .tag = .__builtin_ve_vl_vldl2dzx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11886 | .{ .tag = .__builtin_ve_vl_vldl2dzxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11887 | .{ .tag = .__builtin_ve_vl_vldl2dzxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11888 | .{ .tag = .__builtin_ve_vl_vldlsx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11889 | .{ .tag = .__builtin_ve_vl_vldlsx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11890 | .{ .tag = .__builtin_ve_vl_vldlsxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11891 | .{ .tag = .__builtin_ve_vl_vldlsxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11892 | .{ .tag = .__builtin_ve_vl_vldlzx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11893 | .{ .tag = .__builtin_ve_vl_vldlzx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11894 | .{ .tag = .__builtin_ve_vl_vldlzxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11895 | .{ .tag = .__builtin_ve_vl_vldlzxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11896 | .{ .tag = .__builtin_ve_vl_vldnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11897 | .{ .tag = .__builtin_ve_vl_vldnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11898 | .{ .tag = .__builtin_ve_vl_vldu2d_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11899 | .{ .tag = .__builtin_ve_vl_vldu2d_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11900 | .{ .tag = .__builtin_ve_vl_vldu2dnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11901 | .{ .tag = .__builtin_ve_vl_vldu2dnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11902 | .{ .tag = .__builtin_ve_vl_vldu_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11903 | .{ .tag = .__builtin_ve_vl_vldu_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11904 | .{ .tag = .__builtin_ve_vl_vldunc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11905 | .{ .tag = .__builtin_ve_vl_vldunc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11906 | .{ .tag = .__builtin_ve_vl_vldz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11907 | .{ .tag = .__builtin_ve_vl_vldz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11908 | .{ .tag = .__builtin_ve_vl_vldz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11909 | .{ .tag = .__builtin_ve_vl_vmaxsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11910 | .{ .tag = .__builtin_ve_vl_vmaxsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11911 | .{ .tag = .__builtin_ve_vl_vmaxsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11912 | .{ .tag = .__builtin_ve_vl_vmaxsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11913 | .{ .tag = .__builtin_ve_vl_vmaxsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11914 | .{ .tag = .__builtin_ve_vl_vmaxsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11915 | .{ .tag = .__builtin_ve_vl_vmaxswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11916 | .{ .tag = .__builtin_ve_vl_vmaxswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11917 | .{ .tag = .__builtin_ve_vl_vmaxswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11918 | .{ .tag = .__builtin_ve_vl_vmaxswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11919 | .{ .tag = .__builtin_ve_vl_vmaxswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11920 | .{ .tag = .__builtin_ve_vl_vmaxswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11921 | .{ .tag = .__builtin_ve_vl_vmaxswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11922 | .{ .tag = .__builtin_ve_vl_vmaxswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11923 | .{ .tag = .__builtin_ve_vl_vmaxswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11924 | .{ .tag = .__builtin_ve_vl_vmaxswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11925 | .{ .tag = .__builtin_ve_vl_vmaxswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11926 | .{ .tag = .__builtin_ve_vl_vmaxswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11927 | .{ .tag = .__builtin_ve_vl_vminsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11928 | .{ .tag = .__builtin_ve_vl_vminsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11929 | .{ .tag = .__builtin_ve_vl_vminsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11930 | .{ .tag = .__builtin_ve_vl_vminsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11931 | .{ .tag = .__builtin_ve_vl_vminsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11932 | .{ .tag = .__builtin_ve_vl_vminsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11933 | .{ .tag = .__builtin_ve_vl_vminswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11934 | .{ .tag = .__builtin_ve_vl_vminswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11935 | .{ .tag = .__builtin_ve_vl_vminswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11936 | .{ .tag = .__builtin_ve_vl_vminswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11937 | .{ .tag = .__builtin_ve_vl_vminswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11938 | .{ .tag = .__builtin_ve_vl_vminswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11939 | .{ .tag = .__builtin_ve_vl_vminswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11940 | .{ .tag = .__builtin_ve_vl_vminswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11941 | .{ .tag = .__builtin_ve_vl_vminswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11942 | .{ .tag = .__builtin_ve_vl_vminswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11943 | .{ .tag = .__builtin_ve_vl_vminswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11944 | .{ .tag = .__builtin_ve_vl_vminswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11945 | .{ .tag = .__builtin_ve_vl_vmrg_vsvml, .properties = .{ .param_str = "V256dLUiV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11946 | .{ .tag = .__builtin_ve_vl_vmrg_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11947 | .{ .tag = .__builtin_ve_vl_vmrg_vvvml, .properties = .{ .param_str = "V256dV256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11948 | .{ .tag = .__builtin_ve_vl_vmrg_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11949 | .{ .tag = .__builtin_ve_vl_vmrgw_vsvMl, .properties = .{ .param_str = "V256dUiV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11950 | .{ .tag = .__builtin_ve_vl_vmrgw_vsvMvl, .properties = .{ .param_str = "V256dUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11951 | .{ .tag = .__builtin_ve_vl_vmrgw_vvvMl, .properties = .{ .param_str = "V256dV256dV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11952 | .{ .tag = .__builtin_ve_vl_vmrgw_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11953 | .{ .tag = .__builtin_ve_vl_vmulsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11954 | .{ .tag = .__builtin_ve_vl_vmulsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11955 | .{ .tag = .__builtin_ve_vl_vmulsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11956 | .{ .tag = .__builtin_ve_vl_vmulsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11957 | .{ .tag = .__builtin_ve_vl_vmulsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11958 | .{ .tag = .__builtin_ve_vl_vmulsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11959 | .{ .tag = .__builtin_ve_vl_vmulslw_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11960 | .{ .tag = .__builtin_ve_vl_vmulslw_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11961 | .{ .tag = .__builtin_ve_vl_vmulslw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11962 | .{ .tag = .__builtin_ve_vl_vmulslw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11963 | .{ .tag = .__builtin_ve_vl_vmulswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11964 | .{ .tag = .__builtin_ve_vl_vmulswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11965 | .{ .tag = .__builtin_ve_vl_vmulswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11966 | .{ .tag = .__builtin_ve_vl_vmulswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11967 | .{ .tag = .__builtin_ve_vl_vmulswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11968 | .{ .tag = .__builtin_ve_vl_vmulswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11969 | .{ .tag = .__builtin_ve_vl_vmulswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11970 | .{ .tag = .__builtin_ve_vl_vmulswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11971 | .{ .tag = .__builtin_ve_vl_vmulswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11972 | .{ .tag = .__builtin_ve_vl_vmulswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11973 | .{ .tag = .__builtin_ve_vl_vmulswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11974 | .{ .tag = .__builtin_ve_vl_vmulswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11975 | .{ .tag = .__builtin_ve_vl_vmulul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11976 | .{ .tag = .__builtin_ve_vl_vmulul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11977 | .{ .tag = .__builtin_ve_vl_vmulul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11978 | .{ .tag = .__builtin_ve_vl_vmulul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11979 | .{ .tag = .__builtin_ve_vl_vmulul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11980 | .{ .tag = .__builtin_ve_vl_vmulul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11981 | .{ .tag = .__builtin_ve_vl_vmuluw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11982 | .{ .tag = .__builtin_ve_vl_vmuluw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11983 | .{ .tag = .__builtin_ve_vl_vmuluw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11984 | .{ .tag = .__builtin_ve_vl_vmuluw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11985 | .{ .tag = .__builtin_ve_vl_vmuluw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11986 | .{ .tag = .__builtin_ve_vl_vmuluw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11987 | .{ .tag = .__builtin_ve_vl_vmv_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11988 | .{ .tag = .__builtin_ve_vl_vmv_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11989 | .{ .tag = .__builtin_ve_vl_vmv_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11990 | .{ .tag = .__builtin_ve_vl_vor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11991 | .{ .tag = .__builtin_ve_vl_vor_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11992 | .{ .tag = .__builtin_ve_vl_vor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11993 | .{ .tag = .__builtin_ve_vl_vor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11994 | .{ .tag = .__builtin_ve_vl_vor_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11995 | .{ .tag = .__builtin_ve_vl_vor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11996 | .{ .tag = .__builtin_ve_vl_vpcnt_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11997 | .{ .tag = .__builtin_ve_vl_vpcnt_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11998 | .{ .tag = .__builtin_ve_vl_vpcnt_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 11999 | .{ .tag = .__builtin_ve_vl_vrand_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12000 | .{ .tag = .__builtin_ve_vl_vrand_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12001 | .{ .tag = .__builtin_ve_vl_vrcpd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12002 | .{ .tag = .__builtin_ve_vl_vrcpd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12003 | .{ .tag = .__builtin_ve_vl_vrcps_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12004 | .{ .tag = .__builtin_ve_vl_vrcps_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12005 | .{ .tag = .__builtin_ve_vl_vrmaxslfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12006 | .{ .tag = .__builtin_ve_vl_vrmaxslfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12007 | .{ .tag = .__builtin_ve_vl_vrmaxsllst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12008 | .{ .tag = .__builtin_ve_vl_vrmaxsllst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12009 | .{ .tag = .__builtin_ve_vl_vrmaxswfstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12010 | .{ .tag = .__builtin_ve_vl_vrmaxswfstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12011 | .{ .tag = .__builtin_ve_vl_vrmaxswfstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12012 | .{ .tag = .__builtin_ve_vl_vrmaxswfstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12013 | .{ .tag = .__builtin_ve_vl_vrmaxswlstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12014 | .{ .tag = .__builtin_ve_vl_vrmaxswlstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12015 | .{ .tag = .__builtin_ve_vl_vrmaxswlstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12016 | .{ .tag = .__builtin_ve_vl_vrmaxswlstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12017 | .{ .tag = .__builtin_ve_vl_vrminslfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12018 | .{ .tag = .__builtin_ve_vl_vrminslfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12019 | .{ .tag = .__builtin_ve_vl_vrminsllst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12020 | .{ .tag = .__builtin_ve_vl_vrminsllst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12021 | .{ .tag = .__builtin_ve_vl_vrminswfstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12022 | .{ .tag = .__builtin_ve_vl_vrminswfstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12023 | .{ .tag = .__builtin_ve_vl_vrminswfstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12024 | .{ .tag = .__builtin_ve_vl_vrminswfstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12025 | .{ .tag = .__builtin_ve_vl_vrminswlstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12026 | .{ .tag = .__builtin_ve_vl_vrminswlstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12027 | .{ .tag = .__builtin_ve_vl_vrminswlstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12028 | .{ .tag = .__builtin_ve_vl_vrminswlstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12029 | .{ .tag = .__builtin_ve_vl_vror_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12030 | .{ .tag = .__builtin_ve_vl_vror_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12031 | .{ .tag = .__builtin_ve_vl_vrsqrtd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12032 | .{ .tag = .__builtin_ve_vl_vrsqrtd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12033 | .{ .tag = .__builtin_ve_vl_vrsqrtdnex_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12034 | .{ .tag = .__builtin_ve_vl_vrsqrtdnex_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12035 | .{ .tag = .__builtin_ve_vl_vrsqrts_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12036 | .{ .tag = .__builtin_ve_vl_vrsqrts_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12037 | .{ .tag = .__builtin_ve_vl_vrsqrtsnex_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12038 | .{ .tag = .__builtin_ve_vl_vrsqrtsnex_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12039 | .{ .tag = .__builtin_ve_vl_vrxor_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12040 | .{ .tag = .__builtin_ve_vl_vrxor_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12041 | .{ .tag = .__builtin_ve_vl_vsc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12042 | .{ .tag = .__builtin_ve_vl_vsc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12043 | .{ .tag = .__builtin_ve_vl_vscl_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12044 | .{ .tag = .__builtin_ve_vl_vscl_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12045 | .{ .tag = .__builtin_ve_vl_vsclnc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12046 | .{ .tag = .__builtin_ve_vl_vsclnc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12047 | .{ .tag = .__builtin_ve_vl_vsclncot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12048 | .{ .tag = .__builtin_ve_vl_vsclncot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12049 | .{ .tag = .__builtin_ve_vl_vsclot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12050 | .{ .tag = .__builtin_ve_vl_vsclot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12051 | .{ .tag = .__builtin_ve_vl_vscnc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12052 | .{ .tag = .__builtin_ve_vl_vscnc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12053 | .{ .tag = .__builtin_ve_vl_vscncot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12054 | .{ .tag = .__builtin_ve_vl_vscncot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12055 | .{ .tag = .__builtin_ve_vl_vscot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12056 | .{ .tag = .__builtin_ve_vl_vscot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12057 | .{ .tag = .__builtin_ve_vl_vscu_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12058 | .{ .tag = .__builtin_ve_vl_vscu_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12059 | .{ .tag = .__builtin_ve_vl_vscunc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12060 | .{ .tag = .__builtin_ve_vl_vscunc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12061 | .{ .tag = .__builtin_ve_vl_vscuncot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12062 | .{ .tag = .__builtin_ve_vl_vscuncot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12063 | .{ .tag = .__builtin_ve_vl_vscuot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12064 | .{ .tag = .__builtin_ve_vl_vscuot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12065 | .{ .tag = .__builtin_ve_vl_vseq_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12066 | .{ .tag = .__builtin_ve_vl_vseq_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12067 | .{ .tag = .__builtin_ve_vl_vsfa_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12068 | .{ .tag = .__builtin_ve_vl_vsfa_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12069 | .{ .tag = .__builtin_ve_vl_vsfa_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12070 | .{ .tag = .__builtin_ve_vl_vshf_vvvsl, .properties = .{ .param_str = "V256dV256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12071 | .{ .tag = .__builtin_ve_vl_vshf_vvvsvl, .properties = .{ .param_str = "V256dV256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12072 | .{ .tag = .__builtin_ve_vl_vslal_vvsl, .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12073 | .{ .tag = .__builtin_ve_vl_vslal_vvsmvl, .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12074 | .{ .tag = .__builtin_ve_vl_vslal_vvsvl, .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12075 | .{ .tag = .__builtin_ve_vl_vslal_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12076 | .{ .tag = .__builtin_ve_vl_vslal_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12077 | .{ .tag = .__builtin_ve_vl_vslal_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12078 | .{ .tag = .__builtin_ve_vl_vslawsx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12079 | .{ .tag = .__builtin_ve_vl_vslawsx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12080 | .{ .tag = .__builtin_ve_vl_vslawsx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12081 | .{ .tag = .__builtin_ve_vl_vslawsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12082 | .{ .tag = .__builtin_ve_vl_vslawsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12083 | .{ .tag = .__builtin_ve_vl_vslawsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12084 | .{ .tag = .__builtin_ve_vl_vslawzx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12085 | .{ .tag = .__builtin_ve_vl_vslawzx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12086 | .{ .tag = .__builtin_ve_vl_vslawzx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12087 | .{ .tag = .__builtin_ve_vl_vslawzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12088 | .{ .tag = .__builtin_ve_vl_vslawzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12089 | .{ .tag = .__builtin_ve_vl_vslawzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12090 | .{ .tag = .__builtin_ve_vl_vsll_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12091 | .{ .tag = .__builtin_ve_vl_vsll_vvsmvl, .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12092 | .{ .tag = .__builtin_ve_vl_vsll_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12093 | .{ .tag = .__builtin_ve_vl_vsll_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12094 | .{ .tag = .__builtin_ve_vl_vsll_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12095 | .{ .tag = .__builtin_ve_vl_vsll_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12096 | .{ .tag = .__builtin_ve_vl_vsral_vvsl, .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12097 | .{ .tag = .__builtin_ve_vl_vsral_vvsmvl, .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12098 | .{ .tag = .__builtin_ve_vl_vsral_vvsvl, .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12099 | .{ .tag = .__builtin_ve_vl_vsral_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12100 | .{ .tag = .__builtin_ve_vl_vsral_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12101 | .{ .tag = .__builtin_ve_vl_vsral_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12102 | .{ .tag = .__builtin_ve_vl_vsrawsx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12103 | .{ .tag = .__builtin_ve_vl_vsrawsx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12104 | .{ .tag = .__builtin_ve_vl_vsrawsx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12105 | .{ .tag = .__builtin_ve_vl_vsrawsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12106 | .{ .tag = .__builtin_ve_vl_vsrawsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12107 | .{ .tag = .__builtin_ve_vl_vsrawsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12108 | .{ .tag = .__builtin_ve_vl_vsrawzx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12109 | .{ .tag = .__builtin_ve_vl_vsrawzx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12110 | .{ .tag = .__builtin_ve_vl_vsrawzx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12111 | .{ .tag = .__builtin_ve_vl_vsrawzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12112 | .{ .tag = .__builtin_ve_vl_vsrawzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12113 | .{ .tag = .__builtin_ve_vl_vsrawzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12114 | .{ .tag = .__builtin_ve_vl_vsrl_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12115 | .{ .tag = .__builtin_ve_vl_vsrl_vvsmvl, .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12116 | .{ .tag = .__builtin_ve_vl_vsrl_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12117 | .{ .tag = .__builtin_ve_vl_vsrl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12118 | .{ .tag = .__builtin_ve_vl_vsrl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12119 | .{ .tag = .__builtin_ve_vl_vsrl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12120 | .{ .tag = .__builtin_ve_vl_vst2d_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12121 | .{ .tag = .__builtin_ve_vl_vst2d_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12122 | .{ .tag = .__builtin_ve_vl_vst2dnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12123 | .{ .tag = .__builtin_ve_vl_vst2dnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12124 | .{ .tag = .__builtin_ve_vl_vst2dncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12125 | .{ .tag = .__builtin_ve_vl_vst2dncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12126 | .{ .tag = .__builtin_ve_vl_vst2dot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12127 | .{ .tag = .__builtin_ve_vl_vst2dot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12128 | .{ .tag = .__builtin_ve_vl_vst_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12129 | .{ .tag = .__builtin_ve_vl_vst_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12130 | .{ .tag = .__builtin_ve_vl_vstl2d_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12131 | .{ .tag = .__builtin_ve_vl_vstl2d_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12132 | .{ .tag = .__builtin_ve_vl_vstl2dnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12133 | .{ .tag = .__builtin_ve_vl_vstl2dnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12134 | .{ .tag = .__builtin_ve_vl_vstl2dncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12135 | .{ .tag = .__builtin_ve_vl_vstl2dncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12136 | .{ .tag = .__builtin_ve_vl_vstl2dot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12137 | .{ .tag = .__builtin_ve_vl_vstl2dot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12138 | .{ .tag = .__builtin_ve_vl_vstl_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12139 | .{ .tag = .__builtin_ve_vl_vstl_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12140 | .{ .tag = .__builtin_ve_vl_vstlnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12141 | .{ .tag = .__builtin_ve_vl_vstlnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12142 | .{ .tag = .__builtin_ve_vl_vstlncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12143 | .{ .tag = .__builtin_ve_vl_vstlncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12144 | .{ .tag = .__builtin_ve_vl_vstlot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12145 | .{ .tag = .__builtin_ve_vl_vstlot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12146 | .{ .tag = .__builtin_ve_vl_vstnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12147 | .{ .tag = .__builtin_ve_vl_vstnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12148 | .{ .tag = .__builtin_ve_vl_vstncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12149 | .{ .tag = .__builtin_ve_vl_vstncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12150 | .{ .tag = .__builtin_ve_vl_vstot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12151 | .{ .tag = .__builtin_ve_vl_vstot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12152 | .{ .tag = .__builtin_ve_vl_vstu2d_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12153 | .{ .tag = .__builtin_ve_vl_vstu2d_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12154 | .{ .tag = .__builtin_ve_vl_vstu2dnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12155 | .{ .tag = .__builtin_ve_vl_vstu2dnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12156 | .{ .tag = .__builtin_ve_vl_vstu2dncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12157 | .{ .tag = .__builtin_ve_vl_vstu2dncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12158 | .{ .tag = .__builtin_ve_vl_vstu2dot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12159 | .{ .tag = .__builtin_ve_vl_vstu2dot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12160 | .{ .tag = .__builtin_ve_vl_vstu_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12161 | .{ .tag = .__builtin_ve_vl_vstu_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12162 | .{ .tag = .__builtin_ve_vl_vstunc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12163 | .{ .tag = .__builtin_ve_vl_vstunc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12164 | .{ .tag = .__builtin_ve_vl_vstuncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12165 | .{ .tag = .__builtin_ve_vl_vstuncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12166 | .{ .tag = .__builtin_ve_vl_vstuot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12167 | .{ .tag = .__builtin_ve_vl_vstuot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12168 | .{ .tag = .__builtin_ve_vl_vsubsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12169 | .{ .tag = .__builtin_ve_vl_vsubsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12170 | .{ .tag = .__builtin_ve_vl_vsubsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12171 | .{ .tag = .__builtin_ve_vl_vsubsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12172 | .{ .tag = .__builtin_ve_vl_vsubsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12173 | .{ .tag = .__builtin_ve_vl_vsubsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12174 | .{ .tag = .__builtin_ve_vl_vsubswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12175 | .{ .tag = .__builtin_ve_vl_vsubswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12176 | .{ .tag = .__builtin_ve_vl_vsubswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12177 | .{ .tag = .__builtin_ve_vl_vsubswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12178 | .{ .tag = .__builtin_ve_vl_vsubswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12179 | .{ .tag = .__builtin_ve_vl_vsubswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12180 | .{ .tag = .__builtin_ve_vl_vsubswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12181 | .{ .tag = .__builtin_ve_vl_vsubswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12182 | .{ .tag = .__builtin_ve_vl_vsubswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12183 | .{ .tag = .__builtin_ve_vl_vsubswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12184 | .{ .tag = .__builtin_ve_vl_vsubswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12185 | .{ .tag = .__builtin_ve_vl_vsubswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12186 | .{ .tag = .__builtin_ve_vl_vsubul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12187 | .{ .tag = .__builtin_ve_vl_vsubul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12188 | .{ .tag = .__builtin_ve_vl_vsubul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12189 | .{ .tag = .__builtin_ve_vl_vsubul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12190 | .{ .tag = .__builtin_ve_vl_vsubul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12191 | .{ .tag = .__builtin_ve_vl_vsubul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12192 | .{ .tag = .__builtin_ve_vl_vsubuw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12193 | .{ .tag = .__builtin_ve_vl_vsubuw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12194 | .{ .tag = .__builtin_ve_vl_vsubuw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12195 | .{ .tag = .__builtin_ve_vl_vsubuw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12196 | .{ .tag = .__builtin_ve_vl_vsubuw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12197 | .{ .tag = .__builtin_ve_vl_vsubuw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12198 | .{ .tag = .__builtin_ve_vl_vsuml_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12199 | .{ .tag = .__builtin_ve_vl_vsuml_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12200 | .{ .tag = .__builtin_ve_vl_vsumwsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12201 | .{ .tag = .__builtin_ve_vl_vsumwsx_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12202 | .{ .tag = .__builtin_ve_vl_vsumwzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12203 | .{ .tag = .__builtin_ve_vl_vsumwzx_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12204 | .{ .tag = .__builtin_ve_vl_vxor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12205 | .{ .tag = .__builtin_ve_vl_vxor_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12206 | .{ .tag = .__builtin_ve_vl_vxor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12207 | .{ .tag = .__builtin_ve_vl_vxor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12208 | .{ .tag = .__builtin_ve_vl_vxor_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12209 | .{ .tag = .__builtin_ve_vl_vxor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12210 | .{ .tag = .__builtin_ve_vl_xorm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12211 | .{ .tag = .__builtin_ve_vl_xorm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, | |
| 12212 | .{ .tag = .__builtin_vfprintf, .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 12213 | .{ .tag = .__builtin_vfscanf, .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 12214 | .{ .tag = .__builtin_vprintf, .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf } } }, | |
| 12215 | .{ .tag = .__builtin_vscanf, .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf } } }, | |
| 12216 | .{ .tag = .__builtin_vsnprintf, .properties = .{ .param_str = "ic*RzcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, | |
| 12217 | .{ .tag = .__builtin_vsprintf, .properties = .{ .param_str = "ic*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 12218 | .{ .tag = .__builtin_vsscanf, .properties = .{ .param_str = "icC*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 12219 | .{ .tag = .__builtin_wasm_max_f32, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12220 | .{ .tag = .__builtin_wasm_max_f64, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12221 | .{ .tag = .__builtin_wasm_memory_grow, .properties = .{ .param_str = "zIiz", .target_set = TargetSet.initOne(.webassembly) } }, | |
| 12222 | .{ .tag = .__builtin_wasm_memory_size, .properties = .{ .param_str = "zIi", .target_set = TargetSet.initOne(.webassembly) } }, | |
| 12223 | .{ .tag = .__builtin_wasm_min_f32, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12224 | .{ .tag = .__builtin_wasm_min_f64, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12225 | .{ .tag = .__builtin_wasm_trunc_s_i32_f32, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12226 | .{ .tag = .__builtin_wasm_trunc_s_i32_f64, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12227 | .{ .tag = .__builtin_wasm_trunc_s_i64_f32, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12228 | .{ .tag = .__builtin_wasm_trunc_s_i64_f64, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12229 | .{ .tag = .__builtin_wasm_trunc_u_i32_f32, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12230 | .{ .tag = .__builtin_wasm_trunc_u_i32_f64, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12231 | .{ .tag = .__builtin_wasm_trunc_u_i64_f32, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12232 | .{ .tag = .__builtin_wasm_trunc_u_i64_f64, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, | |
| 12233 | .{ .tag = .__builtin_wcschr, .properties = .{ .param_str = "w*wC*w", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12234 | .{ .tag = .__builtin_wcscmp, .properties = .{ .param_str = "iwC*wC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12235 | .{ .tag = .__builtin_wcslen, .properties = .{ .param_str = "zwC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12236 | .{ .tag = .__builtin_wcsncmp, .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12237 | .{ .tag = .__builtin_wmemchr, .properties = .{ .param_str = "w*wC*wz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12238 | .{ .tag = .__builtin_wmemcmp, .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12239 | .{ .tag = .__builtin_wmemcpy, .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12240 | .{ .tag = .__builtin_wmemmove, .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, | |
| 12241 | .{ .tag = .__c11_atomic_compare_exchange_strong, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12242 | .{ .tag = .__c11_atomic_compare_exchange_weak, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12243 | .{ .tag = .__c11_atomic_exchange, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12244 | .{ .tag = .__c11_atomic_fetch_add, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12245 | .{ .tag = .__c11_atomic_fetch_and, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12246 | .{ .tag = .__c11_atomic_fetch_max, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12247 | .{ .tag = .__c11_atomic_fetch_min, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12248 | .{ .tag = .__c11_atomic_fetch_nand, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12249 | .{ .tag = .__c11_atomic_fetch_or, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12250 | .{ .tag = .__c11_atomic_fetch_sub, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12251 | .{ .tag = .__c11_atomic_fetch_xor, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12252 | .{ .tag = .__c11_atomic_init, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12253 | .{ .tag = .__c11_atomic_is_lock_free, .properties = .{ .param_str = "bz", .attributes = .{ .const_evaluable = true } } }, | |
| 12254 | .{ .tag = .__c11_atomic_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12255 | .{ .tag = .__c11_atomic_signal_fence, .properties = .{ .param_str = "vi" } }, | |
| 12256 | .{ .tag = .__c11_atomic_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12257 | .{ .tag = .__c11_atomic_thread_fence, .properties = .{ .param_str = "vi" } }, | |
| 12258 | .{ .tag = .__clear_cache, .properties = .{ .param_str = "vv*v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12259 | .{ .tag = .__cospi, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12260 | .{ .tag = .__cospif, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12261 | .{ .tag = .__debugbreak, .properties = .{ .param_str = "v", .language = .all_ms_languages } }, | |
| 12262 | .{ .tag = .__dmb, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 12263 | .{ .tag = .__dsb, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 12264 | .{ .tag = .__emit, .properties = .{ .param_str = "vIUiC", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 12265 | .{ .tag = .__exception_code, .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, | |
| 12266 | .{ .tag = .__exception_info, .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, | |
| 12267 | .{ .tag = .__exp10, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12268 | .{ .tag = .__exp10f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12269 | .{ .tag = .__fastfail, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .attributes = .{ .noreturn = true } } }, | |
| 12270 | .{ .tag = .__finite, .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12271 | .{ .tag = .__finitef, .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12272 | .{ .tag = .__finitel, .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12273 | .{ .tag = .__isb, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, | |
| 12274 | .{ .tag = .__iso_volatile_load16, .properties = .{ .param_str = "ssCD*", .language = .all_ms_languages } }, | |
| 12275 | .{ .tag = .__iso_volatile_load32, .properties = .{ .param_str = "iiCD*", .language = .all_ms_languages } }, | |
| 12276 | .{ .tag = .__iso_volatile_load64, .properties = .{ .param_str = "LLiLLiCD*", .language = .all_ms_languages } }, | |
| 12277 | .{ .tag = .__iso_volatile_load8, .properties = .{ .param_str = "ccCD*", .language = .all_ms_languages } }, | |
| 12278 | .{ .tag = .__iso_volatile_store16, .properties = .{ .param_str = "vsD*s", .language = .all_ms_languages } }, | |
| 12279 | .{ .tag = .__iso_volatile_store32, .properties = .{ .param_str = "viD*i", .language = .all_ms_languages } }, | |
| 12280 | .{ .tag = .__iso_volatile_store64, .properties = .{ .param_str = "vLLiD*LLi", .language = .all_ms_languages } }, | |
| 12281 | .{ .tag = .__iso_volatile_store8, .properties = .{ .param_str = "vcD*c", .language = .all_ms_languages } }, | |
| 12282 | .{ .tag = .__ldrexd, .properties = .{ .param_str = "WiWiCD*", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, | |
| 12283 | .{ .tag = .__lzcnt, .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12284 | .{ .tag = .__lzcnt16, .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12285 | .{ .tag = .__lzcnt64, .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12286 | .{ .tag = .__noop, .properties = .{ .param_str = "i.", .language = .all_ms_languages } }, | |
| 12287 | .{ .tag = .__nvvm_add_rm_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12288 | .{ .tag = .__nvvm_add_rm_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12289 | .{ .tag = .__nvvm_add_rm_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12290 | .{ .tag = .__nvvm_add_rn_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12291 | .{ .tag = .__nvvm_add_rn_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12292 | .{ .tag = .__nvvm_add_rn_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12293 | .{ .tag = .__nvvm_add_rp_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12294 | .{ .tag = .__nvvm_add_rp_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12295 | .{ .tag = .__nvvm_add_rp_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12296 | .{ .tag = .__nvvm_add_rz_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12297 | .{ .tag = .__nvvm_add_rz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12298 | .{ .tag = .__nvvm_add_rz_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12299 | .{ .tag = .__nvvm_atom_add_gen_f, .properties = .{ .param_str = "ffD*f", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12300 | .{ .tag = .__nvvm_atom_add_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12301 | .{ .tag = .__nvvm_atom_add_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12302 | .{ .tag = .__nvvm_atom_add_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12303 | .{ .tag = .__nvvm_atom_and_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12304 | .{ .tag = .__nvvm_atom_and_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12305 | .{ .tag = .__nvvm_atom_and_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12306 | .{ .tag = .__nvvm_atom_cas_gen_i, .properties = .{ .param_str = "iiD*ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12307 | .{ .tag = .__nvvm_atom_cas_gen_l, .properties = .{ .param_str = "LiLiD*LiLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12308 | .{ .tag = .__nvvm_atom_cas_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12309 | .{ .tag = .__nvvm_atom_dec_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12310 | .{ .tag = .__nvvm_atom_inc_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12311 | .{ .tag = .__nvvm_atom_max_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12312 | .{ .tag = .__nvvm_atom_max_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12313 | .{ .tag = .__nvvm_atom_max_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12314 | .{ .tag = .__nvvm_atom_max_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12315 | .{ .tag = .__nvvm_atom_max_gen_ul, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12316 | .{ .tag = .__nvvm_atom_max_gen_ull, .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12317 | .{ .tag = .__nvvm_atom_min_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12318 | .{ .tag = .__nvvm_atom_min_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12319 | .{ .tag = .__nvvm_atom_min_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12320 | .{ .tag = .__nvvm_atom_min_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12321 | .{ .tag = .__nvvm_atom_min_gen_ul, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12322 | .{ .tag = .__nvvm_atom_min_gen_ull, .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12323 | .{ .tag = .__nvvm_atom_or_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12324 | .{ .tag = .__nvvm_atom_or_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12325 | .{ .tag = .__nvvm_atom_or_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12326 | .{ .tag = .__nvvm_atom_sub_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12327 | .{ .tag = .__nvvm_atom_sub_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12328 | .{ .tag = .__nvvm_atom_sub_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12329 | .{ .tag = .__nvvm_atom_xchg_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12330 | .{ .tag = .__nvvm_atom_xchg_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12331 | .{ .tag = .__nvvm_atom_xchg_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12332 | .{ .tag = .__nvvm_atom_xor_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12333 | .{ .tag = .__nvvm_atom_xor_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12334 | .{ .tag = .__nvvm_atom_xor_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12335 | .{ .tag = .__nvvm_bar0_and, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12336 | .{ .tag = .__nvvm_bar0_or, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12337 | .{ .tag = .__nvvm_bar0_popc, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12338 | .{ .tag = .__nvvm_bar_sync, .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12339 | .{ .tag = .__nvvm_bitcast_d2ll, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12340 | .{ .tag = .__nvvm_bitcast_f2i, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12341 | .{ .tag = .__nvvm_bitcast_i2f, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12342 | .{ .tag = .__nvvm_bitcast_ll2d, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12343 | .{ .tag = .__nvvm_ceil_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12344 | .{ .tag = .__nvvm_ceil_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12345 | .{ .tag = .__nvvm_ceil_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12346 | .{ .tag = .__nvvm_compiler_error, .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12347 | .{ .tag = .__nvvm_compiler_warn, .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12348 | .{ .tag = .__nvvm_cos_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12349 | .{ .tag = .__nvvm_cos_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12350 | .{ .tag = .__nvvm_d2f_rm, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12351 | .{ .tag = .__nvvm_d2f_rm_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12352 | .{ .tag = .__nvvm_d2f_rn, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12353 | .{ .tag = .__nvvm_d2f_rn_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12354 | .{ .tag = .__nvvm_d2f_rp, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12355 | .{ .tag = .__nvvm_d2f_rp_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12356 | .{ .tag = .__nvvm_d2f_rz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12357 | .{ .tag = .__nvvm_d2f_rz_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12358 | .{ .tag = .__nvvm_d2i_hi, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12359 | .{ .tag = .__nvvm_d2i_lo, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12360 | .{ .tag = .__nvvm_d2i_rm, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12361 | .{ .tag = .__nvvm_d2i_rn, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12362 | .{ .tag = .__nvvm_d2i_rp, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12363 | .{ .tag = .__nvvm_d2i_rz, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12364 | .{ .tag = .__nvvm_d2ll_rm, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12365 | .{ .tag = .__nvvm_d2ll_rn, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12366 | .{ .tag = .__nvvm_d2ll_rp, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12367 | .{ .tag = .__nvvm_d2ll_rz, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12368 | .{ .tag = .__nvvm_d2ui_rm, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12369 | .{ .tag = .__nvvm_d2ui_rn, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12370 | .{ .tag = .__nvvm_d2ui_rp, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12371 | .{ .tag = .__nvvm_d2ui_rz, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12372 | .{ .tag = .__nvvm_d2ull_rm, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12373 | .{ .tag = .__nvvm_d2ull_rn, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12374 | .{ .tag = .__nvvm_d2ull_rp, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12375 | .{ .tag = .__nvvm_d2ull_rz, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12376 | .{ .tag = .__nvvm_div_approx_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12377 | .{ .tag = .__nvvm_div_approx_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12378 | .{ .tag = .__nvvm_div_rm_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12379 | .{ .tag = .__nvvm_div_rm_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12380 | .{ .tag = .__nvvm_div_rm_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12381 | .{ .tag = .__nvvm_div_rn_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12382 | .{ .tag = .__nvvm_div_rn_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12383 | .{ .tag = .__nvvm_div_rn_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12384 | .{ .tag = .__nvvm_div_rp_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12385 | .{ .tag = .__nvvm_div_rp_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12386 | .{ .tag = .__nvvm_div_rp_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12387 | .{ .tag = .__nvvm_div_rz_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12388 | .{ .tag = .__nvvm_div_rz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12389 | .{ .tag = .__nvvm_div_rz_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12390 | .{ .tag = .__nvvm_ex2_approx_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12391 | .{ .tag = .__nvvm_ex2_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12392 | .{ .tag = .__nvvm_ex2_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12393 | .{ .tag = .__nvvm_f2h_rn, .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12394 | .{ .tag = .__nvvm_f2h_rn_ftz, .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12395 | .{ .tag = .__nvvm_f2i_rm, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12396 | .{ .tag = .__nvvm_f2i_rm_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12397 | .{ .tag = .__nvvm_f2i_rn, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12398 | .{ .tag = .__nvvm_f2i_rn_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12399 | .{ .tag = .__nvvm_f2i_rp, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12400 | .{ .tag = .__nvvm_f2i_rp_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12401 | .{ .tag = .__nvvm_f2i_rz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12402 | .{ .tag = .__nvvm_f2i_rz_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12403 | .{ .tag = .__nvvm_f2ll_rm, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12404 | .{ .tag = .__nvvm_f2ll_rm_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12405 | .{ .tag = .__nvvm_f2ll_rn, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12406 | .{ .tag = .__nvvm_f2ll_rn_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12407 | .{ .tag = .__nvvm_f2ll_rp, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12408 | .{ .tag = .__nvvm_f2ll_rp_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12409 | .{ .tag = .__nvvm_f2ll_rz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12410 | .{ .tag = .__nvvm_f2ll_rz_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12411 | .{ .tag = .__nvvm_f2ui_rm, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12412 | .{ .tag = .__nvvm_f2ui_rm_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12413 | .{ .tag = .__nvvm_f2ui_rn, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12414 | .{ .tag = .__nvvm_f2ui_rn_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12415 | .{ .tag = .__nvvm_f2ui_rp, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12416 | .{ .tag = .__nvvm_f2ui_rp_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12417 | .{ .tag = .__nvvm_f2ui_rz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12418 | .{ .tag = .__nvvm_f2ui_rz_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12419 | .{ .tag = .__nvvm_f2ull_rm, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12420 | .{ .tag = .__nvvm_f2ull_rm_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12421 | .{ .tag = .__nvvm_f2ull_rn, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12422 | .{ .tag = .__nvvm_f2ull_rn_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12423 | .{ .tag = .__nvvm_f2ull_rp, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12424 | .{ .tag = .__nvvm_f2ull_rp_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12425 | .{ .tag = .__nvvm_f2ull_rz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12426 | .{ .tag = .__nvvm_f2ull_rz_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12427 | .{ .tag = .__nvvm_fabs_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12428 | .{ .tag = .__nvvm_fabs_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12429 | .{ .tag = .__nvvm_fabs_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12430 | .{ .tag = .__nvvm_floor_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12431 | .{ .tag = .__nvvm_floor_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12432 | .{ .tag = .__nvvm_floor_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12433 | .{ .tag = .__nvvm_fma_rm_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12434 | .{ .tag = .__nvvm_fma_rm_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12435 | .{ .tag = .__nvvm_fma_rm_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12436 | .{ .tag = .__nvvm_fma_rn_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12437 | .{ .tag = .__nvvm_fma_rn_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12438 | .{ .tag = .__nvvm_fma_rn_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12439 | .{ .tag = .__nvvm_fma_rp_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12440 | .{ .tag = .__nvvm_fma_rp_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12441 | .{ .tag = .__nvvm_fma_rp_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12442 | .{ .tag = .__nvvm_fma_rz_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12443 | .{ .tag = .__nvvm_fma_rz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12444 | .{ .tag = .__nvvm_fma_rz_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12445 | .{ .tag = .__nvvm_fmax_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12446 | .{ .tag = .__nvvm_fmax_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12447 | .{ .tag = .__nvvm_fmax_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12448 | .{ .tag = .__nvvm_fmin_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12449 | .{ .tag = .__nvvm_fmin_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12450 | .{ .tag = .__nvvm_fmin_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12451 | .{ .tag = .__nvvm_i2d_rm, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12452 | .{ .tag = .__nvvm_i2d_rn, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12453 | .{ .tag = .__nvvm_i2d_rp, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12454 | .{ .tag = .__nvvm_i2d_rz, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12455 | .{ .tag = .__nvvm_i2f_rm, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12456 | .{ .tag = .__nvvm_i2f_rn, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12457 | .{ .tag = .__nvvm_i2f_rp, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12458 | .{ .tag = .__nvvm_i2f_rz, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12459 | .{ .tag = .__nvvm_isspacep_const, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12460 | .{ .tag = .__nvvm_isspacep_global, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12461 | .{ .tag = .__nvvm_isspacep_local, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12462 | .{ .tag = .__nvvm_isspacep_shared, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12463 | .{ .tag = .__nvvm_ldg_c, .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12464 | .{ .tag = .__nvvm_ldg_c2, .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12465 | .{ .tag = .__nvvm_ldg_c4, .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12466 | .{ .tag = .__nvvm_ldg_d, .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12467 | .{ .tag = .__nvvm_ldg_d2, .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12468 | .{ .tag = .__nvvm_ldg_f, .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12469 | .{ .tag = .__nvvm_ldg_f2, .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12470 | .{ .tag = .__nvvm_ldg_f4, .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12471 | .{ .tag = .__nvvm_ldg_h, .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12472 | .{ .tag = .__nvvm_ldg_h2, .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12473 | .{ .tag = .__nvvm_ldg_i, .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12474 | .{ .tag = .__nvvm_ldg_i2, .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12475 | .{ .tag = .__nvvm_ldg_i4, .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12476 | .{ .tag = .__nvvm_ldg_l, .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12477 | .{ .tag = .__nvvm_ldg_l2, .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12478 | .{ .tag = .__nvvm_ldg_ll, .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12479 | .{ .tag = .__nvvm_ldg_ll2, .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12480 | .{ .tag = .__nvvm_ldg_s, .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12481 | .{ .tag = .__nvvm_ldg_s2, .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12482 | .{ .tag = .__nvvm_ldg_s4, .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12483 | .{ .tag = .__nvvm_ldg_sc, .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12484 | .{ .tag = .__nvvm_ldg_sc2, .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12485 | .{ .tag = .__nvvm_ldg_sc4, .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12486 | .{ .tag = .__nvvm_ldg_uc, .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12487 | .{ .tag = .__nvvm_ldg_uc2, .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12488 | .{ .tag = .__nvvm_ldg_uc4, .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12489 | .{ .tag = .__nvvm_ldg_ui, .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12490 | .{ .tag = .__nvvm_ldg_ui2, .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12491 | .{ .tag = .__nvvm_ldg_ui4, .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12492 | .{ .tag = .__nvvm_ldg_ul, .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12493 | .{ .tag = .__nvvm_ldg_ul2, .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12494 | .{ .tag = .__nvvm_ldg_ull, .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12495 | .{ .tag = .__nvvm_ldg_ull2, .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12496 | .{ .tag = .__nvvm_ldg_us, .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12497 | .{ .tag = .__nvvm_ldg_us2, .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12498 | .{ .tag = .__nvvm_ldg_us4, .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12499 | .{ .tag = .__nvvm_ldu_c, .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12500 | .{ .tag = .__nvvm_ldu_c2, .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12501 | .{ .tag = .__nvvm_ldu_c4, .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12502 | .{ .tag = .__nvvm_ldu_d, .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12503 | .{ .tag = .__nvvm_ldu_d2, .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12504 | .{ .tag = .__nvvm_ldu_f, .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12505 | .{ .tag = .__nvvm_ldu_f2, .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12506 | .{ .tag = .__nvvm_ldu_f4, .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12507 | .{ .tag = .__nvvm_ldu_h, .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12508 | .{ .tag = .__nvvm_ldu_h2, .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12509 | .{ .tag = .__nvvm_ldu_i, .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12510 | .{ .tag = .__nvvm_ldu_i2, .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12511 | .{ .tag = .__nvvm_ldu_i4, .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12512 | .{ .tag = .__nvvm_ldu_l, .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12513 | .{ .tag = .__nvvm_ldu_l2, .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12514 | .{ .tag = .__nvvm_ldu_ll, .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12515 | .{ .tag = .__nvvm_ldu_ll2, .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12516 | .{ .tag = .__nvvm_ldu_s, .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12517 | .{ .tag = .__nvvm_ldu_s2, .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12518 | .{ .tag = .__nvvm_ldu_s4, .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12519 | .{ .tag = .__nvvm_ldu_sc, .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12520 | .{ .tag = .__nvvm_ldu_sc2, .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12521 | .{ .tag = .__nvvm_ldu_sc4, .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12522 | .{ .tag = .__nvvm_ldu_uc, .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12523 | .{ .tag = .__nvvm_ldu_uc2, .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12524 | .{ .tag = .__nvvm_ldu_uc4, .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12525 | .{ .tag = .__nvvm_ldu_ui, .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12526 | .{ .tag = .__nvvm_ldu_ui2, .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12527 | .{ .tag = .__nvvm_ldu_ui4, .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12528 | .{ .tag = .__nvvm_ldu_ul, .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12529 | .{ .tag = .__nvvm_ldu_ul2, .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12530 | .{ .tag = .__nvvm_ldu_ull, .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12531 | .{ .tag = .__nvvm_ldu_ull2, .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12532 | .{ .tag = .__nvvm_ldu_us, .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12533 | .{ .tag = .__nvvm_ldu_us2, .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12534 | .{ .tag = .__nvvm_ldu_us4, .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12535 | .{ .tag = .__nvvm_lg2_approx_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12536 | .{ .tag = .__nvvm_lg2_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12537 | .{ .tag = .__nvvm_lg2_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12538 | .{ .tag = .__nvvm_ll2d_rm, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12539 | .{ .tag = .__nvvm_ll2d_rn, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12540 | .{ .tag = .__nvvm_ll2d_rp, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12541 | .{ .tag = .__nvvm_ll2d_rz, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12542 | .{ .tag = .__nvvm_ll2f_rm, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12543 | .{ .tag = .__nvvm_ll2f_rn, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12544 | .{ .tag = .__nvvm_ll2f_rp, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12545 | .{ .tag = .__nvvm_ll2f_rz, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12546 | .{ .tag = .__nvvm_lohi_i2d, .properties = .{ .param_str = "dii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12547 | .{ .tag = .__nvvm_membar_cta, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12548 | .{ .tag = .__nvvm_membar_gl, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12549 | .{ .tag = .__nvvm_membar_sys, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12550 | .{ .tag = .__nvvm_memcpy, .properties = .{ .param_str = "vUc*Uc*zi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12551 | .{ .tag = .__nvvm_memset, .properties = .{ .param_str = "vUc*Uczi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12552 | .{ .tag = .__nvvm_mul24_i, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12553 | .{ .tag = .__nvvm_mul24_ui, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12554 | .{ .tag = .__nvvm_mul_rm_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12555 | .{ .tag = .__nvvm_mul_rm_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12556 | .{ .tag = .__nvvm_mul_rm_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12557 | .{ .tag = .__nvvm_mul_rn_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12558 | .{ .tag = .__nvvm_mul_rn_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12559 | .{ .tag = .__nvvm_mul_rn_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12560 | .{ .tag = .__nvvm_mul_rp_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12561 | .{ .tag = .__nvvm_mul_rp_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12562 | .{ .tag = .__nvvm_mul_rp_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12563 | .{ .tag = .__nvvm_mul_rz_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12564 | .{ .tag = .__nvvm_mul_rz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12565 | .{ .tag = .__nvvm_mul_rz_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12566 | .{ .tag = .__nvvm_mulhi_i, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12567 | .{ .tag = .__nvvm_mulhi_ll, .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12568 | .{ .tag = .__nvvm_mulhi_ui, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12569 | .{ .tag = .__nvvm_mulhi_ull, .properties = .{ .param_str = "ULLiULLiULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12570 | .{ .tag = .__nvvm_prmt, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12571 | .{ .tag = .__nvvm_rcp_approx_ftz_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12572 | .{ .tag = .__nvvm_rcp_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12573 | .{ .tag = .__nvvm_rcp_rm_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12574 | .{ .tag = .__nvvm_rcp_rm_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12575 | .{ .tag = .__nvvm_rcp_rm_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12576 | .{ .tag = .__nvvm_rcp_rn_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12577 | .{ .tag = .__nvvm_rcp_rn_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12578 | .{ .tag = .__nvvm_rcp_rn_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12579 | .{ .tag = .__nvvm_rcp_rp_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12580 | .{ .tag = .__nvvm_rcp_rp_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12581 | .{ .tag = .__nvvm_rcp_rp_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12582 | .{ .tag = .__nvvm_rcp_rz_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12583 | .{ .tag = .__nvvm_rcp_rz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12584 | .{ .tag = .__nvvm_rcp_rz_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12585 | .{ .tag = .__nvvm_read_ptx_sreg_clock, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12586 | .{ .tag = .__nvvm_read_ptx_sreg_clock64, .properties = .{ .param_str = "LLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12587 | .{ .tag = .__nvvm_read_ptx_sreg_ctaid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12588 | .{ .tag = .__nvvm_read_ptx_sreg_ctaid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12589 | .{ .tag = .__nvvm_read_ptx_sreg_ctaid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12590 | .{ .tag = .__nvvm_read_ptx_sreg_ctaid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12591 | .{ .tag = .__nvvm_read_ptx_sreg_gridid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12592 | .{ .tag = .__nvvm_read_ptx_sreg_laneid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12593 | .{ .tag = .__nvvm_read_ptx_sreg_lanemask_eq, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12594 | .{ .tag = .__nvvm_read_ptx_sreg_lanemask_ge, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12595 | .{ .tag = .__nvvm_read_ptx_sreg_lanemask_gt, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12596 | .{ .tag = .__nvvm_read_ptx_sreg_lanemask_le, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12597 | .{ .tag = .__nvvm_read_ptx_sreg_lanemask_lt, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12598 | .{ .tag = .__nvvm_read_ptx_sreg_nctaid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12599 | .{ .tag = .__nvvm_read_ptx_sreg_nctaid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12600 | .{ .tag = .__nvvm_read_ptx_sreg_nctaid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12601 | .{ .tag = .__nvvm_read_ptx_sreg_nctaid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12602 | .{ .tag = .__nvvm_read_ptx_sreg_nsmid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12603 | .{ .tag = .__nvvm_read_ptx_sreg_ntid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12604 | .{ .tag = .__nvvm_read_ptx_sreg_ntid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12605 | .{ .tag = .__nvvm_read_ptx_sreg_ntid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12606 | .{ .tag = .__nvvm_read_ptx_sreg_ntid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12607 | .{ .tag = .__nvvm_read_ptx_sreg_nwarpid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12608 | .{ .tag = .__nvvm_read_ptx_sreg_pm0, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12609 | .{ .tag = .__nvvm_read_ptx_sreg_pm1, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12610 | .{ .tag = .__nvvm_read_ptx_sreg_pm2, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12611 | .{ .tag = .__nvvm_read_ptx_sreg_pm3, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12612 | .{ .tag = .__nvvm_read_ptx_sreg_smid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12613 | .{ .tag = .__nvvm_read_ptx_sreg_tid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12614 | .{ .tag = .__nvvm_read_ptx_sreg_tid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12615 | .{ .tag = .__nvvm_read_ptx_sreg_tid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12616 | .{ .tag = .__nvvm_read_ptx_sreg_tid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12617 | .{ .tag = .__nvvm_read_ptx_sreg_warpid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, | |
| 12618 | .{ .tag = .__nvvm_round_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12619 | .{ .tag = .__nvvm_round_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12620 | .{ .tag = .__nvvm_round_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12621 | .{ .tag = .__nvvm_rsqrt_approx_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12622 | .{ .tag = .__nvvm_rsqrt_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12623 | .{ .tag = .__nvvm_rsqrt_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12624 | .{ .tag = .__nvvm_sad_i, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12625 | .{ .tag = .__nvvm_sad_ui, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12626 | .{ .tag = .__nvvm_saturate_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12627 | .{ .tag = .__nvvm_saturate_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12628 | .{ .tag = .__nvvm_saturate_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12629 | .{ .tag = .__nvvm_shfl_bfly_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12630 | .{ .tag = .__nvvm_shfl_bfly_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12631 | .{ .tag = .__nvvm_shfl_down_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12632 | .{ .tag = .__nvvm_shfl_down_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12633 | .{ .tag = .__nvvm_shfl_idx_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12634 | .{ .tag = .__nvvm_shfl_idx_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12635 | .{ .tag = .__nvvm_shfl_up_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12636 | .{ .tag = .__nvvm_shfl_up_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12637 | .{ .tag = .__nvvm_sin_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12638 | .{ .tag = .__nvvm_sin_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12639 | .{ .tag = .__nvvm_sqrt_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12640 | .{ .tag = .__nvvm_sqrt_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12641 | .{ .tag = .__nvvm_sqrt_rm_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12642 | .{ .tag = .__nvvm_sqrt_rm_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12643 | .{ .tag = .__nvvm_sqrt_rm_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12644 | .{ .tag = .__nvvm_sqrt_rn_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12645 | .{ .tag = .__nvvm_sqrt_rn_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12646 | .{ .tag = .__nvvm_sqrt_rn_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12647 | .{ .tag = .__nvvm_sqrt_rp_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12648 | .{ .tag = .__nvvm_sqrt_rp_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12649 | .{ .tag = .__nvvm_sqrt_rp_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12650 | .{ .tag = .__nvvm_sqrt_rz_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12651 | .{ .tag = .__nvvm_sqrt_rz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12652 | .{ .tag = .__nvvm_sqrt_rz_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12653 | .{ .tag = .__nvvm_trunc_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12654 | .{ .tag = .__nvvm_trunc_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12655 | .{ .tag = .__nvvm_trunc_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12656 | .{ .tag = .__nvvm_ui2d_rm, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12657 | .{ .tag = .__nvvm_ui2d_rn, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12658 | .{ .tag = .__nvvm_ui2d_rp, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12659 | .{ .tag = .__nvvm_ui2d_rz, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12660 | .{ .tag = .__nvvm_ui2f_rm, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12661 | .{ .tag = .__nvvm_ui2f_rn, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12662 | .{ .tag = .__nvvm_ui2f_rp, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12663 | .{ .tag = .__nvvm_ui2f_rz, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12664 | .{ .tag = .__nvvm_ull2d_rm, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12665 | .{ .tag = .__nvvm_ull2d_rn, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12666 | .{ .tag = .__nvvm_ull2d_rp, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12667 | .{ .tag = .__nvvm_ull2d_rz, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12668 | .{ .tag = .__nvvm_ull2f_rm, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12669 | .{ .tag = .__nvvm_ull2f_rn, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12670 | .{ .tag = .__nvvm_ull2f_rp, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12671 | .{ .tag = .__nvvm_ull2f_rz, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12672 | .{ .tag = .__nvvm_vote_all, .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12673 | .{ .tag = .__nvvm_vote_any, .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12674 | .{ .tag = .__nvvm_vote_ballot, .properties = .{ .param_str = "Uib", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12675 | .{ .tag = .__nvvm_vote_uni, .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12676 | .{ .tag = .__popcnt, .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12677 | .{ .tag = .__popcnt16, .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12678 | .{ .tag = .__popcnt64, .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, | |
| 12679 | .{ .tag = .__rdtsc, .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, | |
| 12680 | .{ .tag = .__sev, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12681 | .{ .tag = .__sevl, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12682 | .{ .tag = .__sigsetjmp, .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12683 | .{ .tag = .__sinpi, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12684 | .{ .tag = .__sinpif, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12685 | .{ .tag = .__sync_add_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12686 | .{ .tag = .__sync_add_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12687 | .{ .tag = .__sync_add_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12688 | .{ .tag = .__sync_add_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12689 | .{ .tag = .__sync_add_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12690 | .{ .tag = .__sync_add_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12691 | .{ .tag = .__sync_and_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12692 | .{ .tag = .__sync_and_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12693 | .{ .tag = .__sync_and_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12694 | .{ .tag = .__sync_and_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12695 | .{ .tag = .__sync_and_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12696 | .{ .tag = .__sync_and_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12697 | .{ .tag = .__sync_bool_compare_and_swap, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12698 | .{ .tag = .__sync_bool_compare_and_swap_1, .properties = .{ .param_str = "bcD*cc.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12699 | .{ .tag = .__sync_bool_compare_and_swap_16, .properties = .{ .param_str = "bLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12700 | .{ .tag = .__sync_bool_compare_and_swap_2, .properties = .{ .param_str = "bsD*ss.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12701 | .{ .tag = .__sync_bool_compare_and_swap_4, .properties = .{ .param_str = "biD*ii.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12702 | .{ .tag = .__sync_bool_compare_and_swap_8, .properties = .{ .param_str = "bLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12703 | .{ .tag = .__sync_fetch_and_add, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12704 | .{ .tag = .__sync_fetch_and_add_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12705 | .{ .tag = .__sync_fetch_and_add_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12706 | .{ .tag = .__sync_fetch_and_add_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12707 | .{ .tag = .__sync_fetch_and_add_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12708 | .{ .tag = .__sync_fetch_and_add_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12709 | .{ .tag = .__sync_fetch_and_and, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12710 | .{ .tag = .__sync_fetch_and_and_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12711 | .{ .tag = .__sync_fetch_and_and_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12712 | .{ .tag = .__sync_fetch_and_and_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12713 | .{ .tag = .__sync_fetch_and_and_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12714 | .{ .tag = .__sync_fetch_and_and_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12715 | .{ .tag = .__sync_fetch_and_max, .properties = .{ .param_str = "iiD*i" } }, | |
| 12716 | .{ .tag = .__sync_fetch_and_min, .properties = .{ .param_str = "iiD*i" } }, | |
| 12717 | .{ .tag = .__sync_fetch_and_nand, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12718 | .{ .tag = .__sync_fetch_and_nand_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12719 | .{ .tag = .__sync_fetch_and_nand_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12720 | .{ .tag = .__sync_fetch_and_nand_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12721 | .{ .tag = .__sync_fetch_and_nand_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12722 | .{ .tag = .__sync_fetch_and_nand_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12723 | .{ .tag = .__sync_fetch_and_or, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12724 | .{ .tag = .__sync_fetch_and_or_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12725 | .{ .tag = .__sync_fetch_and_or_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12726 | .{ .tag = .__sync_fetch_and_or_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12727 | .{ .tag = .__sync_fetch_and_or_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12728 | .{ .tag = .__sync_fetch_and_or_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12729 | .{ .tag = .__sync_fetch_and_sub, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12730 | .{ .tag = .__sync_fetch_and_sub_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12731 | .{ .tag = .__sync_fetch_and_sub_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12732 | .{ .tag = .__sync_fetch_and_sub_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12733 | .{ .tag = .__sync_fetch_and_sub_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12734 | .{ .tag = .__sync_fetch_and_sub_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12735 | .{ .tag = .__sync_fetch_and_umax, .properties = .{ .param_str = "UiUiD*Ui" } }, | |
| 12736 | .{ .tag = .__sync_fetch_and_umin, .properties = .{ .param_str = "UiUiD*Ui" } }, | |
| 12737 | .{ .tag = .__sync_fetch_and_xor, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12738 | .{ .tag = .__sync_fetch_and_xor_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12739 | .{ .tag = .__sync_fetch_and_xor_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12740 | .{ .tag = .__sync_fetch_and_xor_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12741 | .{ .tag = .__sync_fetch_and_xor_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12742 | .{ .tag = .__sync_fetch_and_xor_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12743 | .{ .tag = .__sync_lock_release, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12744 | .{ .tag = .__sync_lock_release_1, .properties = .{ .param_str = "vcD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12745 | .{ .tag = .__sync_lock_release_16, .properties = .{ .param_str = "vLLLiD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12746 | .{ .tag = .__sync_lock_release_2, .properties = .{ .param_str = "vsD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12747 | .{ .tag = .__sync_lock_release_4, .properties = .{ .param_str = "viD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12748 | .{ .tag = .__sync_lock_release_8, .properties = .{ .param_str = "vLLiD*.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12749 | .{ .tag = .__sync_lock_test_and_set, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12750 | .{ .tag = .__sync_lock_test_and_set_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12751 | .{ .tag = .__sync_lock_test_and_set_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12752 | .{ .tag = .__sync_lock_test_and_set_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12753 | .{ .tag = .__sync_lock_test_and_set_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12754 | .{ .tag = .__sync_lock_test_and_set_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12755 | .{ .tag = .__sync_nand_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12756 | .{ .tag = .__sync_nand_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12757 | .{ .tag = .__sync_nand_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12758 | .{ .tag = .__sync_nand_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12759 | .{ .tag = .__sync_nand_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12760 | .{ .tag = .__sync_nand_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12761 | .{ .tag = .__sync_or_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12762 | .{ .tag = .__sync_or_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12763 | .{ .tag = .__sync_or_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12764 | .{ .tag = .__sync_or_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12765 | .{ .tag = .__sync_or_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12766 | .{ .tag = .__sync_or_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12767 | .{ .tag = .__sync_sub_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12768 | .{ .tag = .__sync_sub_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12769 | .{ .tag = .__sync_sub_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12770 | .{ .tag = .__sync_sub_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12771 | .{ .tag = .__sync_sub_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12772 | .{ .tag = .__sync_sub_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12773 | .{ .tag = .__sync_swap, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12774 | .{ .tag = .__sync_swap_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12775 | .{ .tag = .__sync_swap_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12776 | .{ .tag = .__sync_swap_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12777 | .{ .tag = .__sync_swap_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12778 | .{ .tag = .__sync_swap_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12779 | .{ .tag = .__sync_synchronize, .properties = .{ .param_str = "v" } }, | |
| 12780 | .{ .tag = .__sync_val_compare_and_swap, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12781 | .{ .tag = .__sync_val_compare_and_swap_1, .properties = .{ .param_str = "ccD*cc.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12782 | .{ .tag = .__sync_val_compare_and_swap_16, .properties = .{ .param_str = "LLLiLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12783 | .{ .tag = .__sync_val_compare_and_swap_2, .properties = .{ .param_str = "ssD*ss.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12784 | .{ .tag = .__sync_val_compare_and_swap_4, .properties = .{ .param_str = "iiD*ii.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12785 | .{ .tag = .__sync_val_compare_and_swap_8, .properties = .{ .param_str = "LLiLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12786 | .{ .tag = .__sync_xor_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12787 | .{ .tag = .__sync_xor_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12788 | .{ .tag = .__sync_xor_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12789 | .{ .tag = .__sync_xor_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12790 | .{ .tag = .__sync_xor_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12791 | .{ .tag = .__sync_xor_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, | |
| 12792 | .{ .tag = .__syncthreads, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, | |
| 12793 | .{ .tag = .__tanpi, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12794 | .{ .tag = .__tanpif, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12795 | .{ .tag = .__va_start, .properties = .{ .param_str = "vc**.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true } } }, | |
| 12796 | .{ .tag = .__warn_memset_zero_len, .properties = .{ .param_str = "v", .attributes = .{ .pure = true } } }, | |
| 12797 | .{ .tag = .__wfe, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12798 | .{ .tag = .__wfi, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12799 | .{ .tag = .__xray_customevent, .properties = .{ .param_str = "vcC*z" } }, | |
| 12800 | .{ .tag = .__xray_typedevent, .properties = .{ .param_str = "vzcC*z" } }, | |
| 12801 | .{ .tag = .__yield, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, | |
| 12802 | .{ .tag = ._abnormal_termination, .properties = .{ .param_str = "i", .language = .all_ms_languages } }, | |
| 12803 | .{ .tag = ._alloca, .properties = .{ .param_str = "v*z", .language = .all_ms_languages } }, | |
| 12804 | .{ .tag = ._bittest, .properties = .{ .param_str = "UcNiC*Ni", .language = .all_ms_languages } }, | |
| 12805 | .{ .tag = ._bittest64, .properties = .{ .param_str = "UcWiC*Wi", .language = .all_ms_languages } }, | |
| 12806 | .{ .tag = ._bittestandcomplement, .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, | |
| 12807 | .{ .tag = ._bittestandcomplement64, .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, | |
| 12808 | .{ .tag = ._bittestandreset, .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, | |
| 12809 | .{ .tag = ._bittestandreset64, .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, | |
| 12810 | .{ .tag = ._bittestandset, .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, | |
| 12811 | .{ .tag = ._bittestandset64, .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, | |
| 12812 | .{ .tag = ._byteswap_uint64, .properties = .{ .param_str = "ULLiULLi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12813 | .{ .tag = ._byteswap_ulong, .properties = .{ .param_str = "UNiUNi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12814 | .{ .tag = ._byteswap_ushort, .properties = .{ .param_str = "UsUs", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12815 | .{ .tag = ._exception_code, .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, | |
| 12816 | .{ .tag = ._exception_info, .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, | |
| 12817 | .{ .tag = ._exit, .properties = .{ .param_str = "vi", .header = .unistd, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 12818 | .{ .tag = ._interlockedbittestandreset, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12819 | .{ .tag = ._interlockedbittestandreset64, .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, | |
| 12820 | .{ .tag = ._interlockedbittestandreset_acq, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12821 | .{ .tag = ._interlockedbittestandreset_nf, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12822 | .{ .tag = ._interlockedbittestandreset_rel, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12823 | .{ .tag = ._interlockedbittestandset, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12824 | .{ .tag = ._interlockedbittestandset64, .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, | |
| 12825 | .{ .tag = ._interlockedbittestandset_acq, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12826 | .{ .tag = ._interlockedbittestandset_nf, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12827 | .{ .tag = ._interlockedbittestandset_rel, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, | |
| 12828 | .{ .tag = ._longjmp, .properties = .{ .param_str = "vJi", .header = .setjmp, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, | |
| 12829 | .{ .tag = ._lrotl, .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12830 | .{ .tag = ._lrotr, .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12831 | .{ .tag = ._rotl, .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12832 | .{ .tag = ._rotl16, .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12833 | .{ .tag = ._rotl64, .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12834 | .{ .tag = ._rotl8, .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12835 | .{ .tag = ._rotr, .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12836 | .{ .tag = ._rotr16, .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12837 | .{ .tag = ._rotr64, .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12838 | .{ .tag = ._rotr8, .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, | |
| 12839 | .{ .tag = ._setjmp, .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 12840 | .{ .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 } } }, | |
| 12841 | .{ .tag = .abort, .properties = .{ .param_str = "v", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 12842 | .{ .tag = .abs, .properties = .{ .param_str = "ii", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12843 | .{ .tag = .acos, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12844 | .{ .tag = .acosf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12845 | .{ .tag = .acosh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12846 | .{ .tag = .acoshf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12847 | .{ .tag = .acoshl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12848 | .{ .tag = .acosl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12849 | .{ .tag = .aligned_alloc, .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12850 | .{ .tag = .alloca, .properties = .{ .param_str = "v*z", .header = .stdlib, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12851 | .{ .tag = .asin, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12852 | .{ .tag = .asinf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12853 | .{ .tag = .asinh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12854 | .{ .tag = .asinhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12855 | .{ .tag = .asinhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12856 | .{ .tag = .asinl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12857 | .{ .tag = .atan, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12858 | .{ .tag = .atan2, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12859 | .{ .tag = .atan2f, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12860 | .{ .tag = .atan2l, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12861 | .{ .tag = .atanf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12862 | .{ .tag = .atanh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12863 | .{ .tag = .atanhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12864 | .{ .tag = .atanhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12865 | .{ .tag = .atanl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12866 | .{ .tag = .bcmp, .properties = .{ .param_str = "ivC*vC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 12867 | .{ .tag = .bcopy, .properties = .{ .param_str = "vvC*v*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12868 | .{ .tag = .bzero, .properties = .{ .param_str = "vv*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12869 | .{ .tag = .cabs, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12870 | .{ .tag = .cabsf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12871 | .{ .tag = .cabsl, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12872 | .{ .tag = .cacos, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12873 | .{ .tag = .cacosf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12874 | .{ .tag = .cacosh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12875 | .{ .tag = .cacoshf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12876 | .{ .tag = .cacoshl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12877 | .{ .tag = .cacosl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12878 | .{ .tag = .calloc, .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12879 | .{ .tag = .carg, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12880 | .{ .tag = .cargf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12881 | .{ .tag = .cargl, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12882 | .{ .tag = .casin, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12883 | .{ .tag = .casinf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12884 | .{ .tag = .casinh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12885 | .{ .tag = .casinhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12886 | .{ .tag = .casinhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12887 | .{ .tag = .casinl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12888 | .{ .tag = .catan, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12889 | .{ .tag = .catanf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12890 | .{ .tag = .catanh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12891 | .{ .tag = .catanhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12892 | .{ .tag = .catanhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12893 | .{ .tag = .catanl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12894 | .{ .tag = .cbrt, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12895 | .{ .tag = .cbrtf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12896 | .{ .tag = .cbrtl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12897 | .{ .tag = .ccos, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12898 | .{ .tag = .ccosf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12899 | .{ .tag = .ccosh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12900 | .{ .tag = .ccoshf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12901 | .{ .tag = .ccoshl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12902 | .{ .tag = .ccosl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12903 | .{ .tag = .ceil, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12904 | .{ .tag = .ceilf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12905 | .{ .tag = .ceill, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12906 | .{ .tag = .cexp, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12907 | .{ .tag = .cexpf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12908 | .{ .tag = .cexpl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12909 | .{ .tag = .cimag, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12910 | .{ .tag = .cimagf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12911 | .{ .tag = .cimagl, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12912 | .{ .tag = .clog, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12913 | .{ .tag = .clogf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12914 | .{ .tag = .clogl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12915 | .{ .tag = .conj, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12916 | .{ .tag = .conjf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12917 | .{ .tag = .conjl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12918 | .{ .tag = .copysign, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12919 | .{ .tag = .copysignf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12920 | .{ .tag = .copysignl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12921 | .{ .tag = .cos, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12922 | .{ .tag = .cosf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12923 | .{ .tag = .cosh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12924 | .{ .tag = .coshf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12925 | .{ .tag = .coshl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12926 | .{ .tag = .cosl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12927 | .{ .tag = .cpow, .properties = .{ .param_str = "XdXdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12928 | .{ .tag = .cpowf, .properties = .{ .param_str = "XfXfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12929 | .{ .tag = .cpowl, .properties = .{ .param_str = "XLdXLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12930 | .{ .tag = .cproj, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12931 | .{ .tag = .cprojf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12932 | .{ .tag = .cprojl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12933 | .{ .tag = .creal, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12934 | .{ .tag = .crealf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12935 | .{ .tag = .creall, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12936 | .{ .tag = .csin, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12937 | .{ .tag = .csinf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12938 | .{ .tag = .csinh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12939 | .{ .tag = .csinhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12940 | .{ .tag = .csinhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12941 | .{ .tag = .csinl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12942 | .{ .tag = .csqrt, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12943 | .{ .tag = .csqrtf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12944 | .{ .tag = .csqrtl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12945 | .{ .tag = .ctan, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12946 | .{ .tag = .ctanf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12947 | .{ .tag = .ctanh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12948 | .{ .tag = .ctanhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12949 | .{ .tag = .ctanhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12950 | .{ .tag = .ctanl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12951 | .{ .tag = .erf, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12952 | .{ .tag = .erfc, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12953 | .{ .tag = .erfcf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12954 | .{ .tag = .erfcl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12955 | .{ .tag = .erff, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12956 | .{ .tag = .erfl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12957 | .{ .tag = .exit, .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, | |
| 12958 | .{ .tag = .exp, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12959 | .{ .tag = .exp2, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12960 | .{ .tag = .exp2f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12961 | .{ .tag = .exp2l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12962 | .{ .tag = .expf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12963 | .{ .tag = .expl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12964 | .{ .tag = .expm1, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12965 | .{ .tag = .expm1f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12966 | .{ .tag = .expm1l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12967 | .{ .tag = .fabs, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12968 | .{ .tag = .fabsf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12969 | .{ .tag = .fabsl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12970 | .{ .tag = .fdim, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12971 | .{ .tag = .fdimf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12972 | .{ .tag = .fdiml, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12973 | .{ .tag = .finite, .properties = .{ .param_str = "id", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12974 | .{ .tag = .finitef, .properties = .{ .param_str = "if", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12975 | .{ .tag = .finitel, .properties = .{ .param_str = "iLd", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12976 | .{ .tag = .floor, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12977 | .{ .tag = .floorf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12978 | .{ .tag = .floorl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12979 | .{ .tag = .fma, .properties = .{ .param_str = "dddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12980 | .{ .tag = .fmaf, .properties = .{ .param_str = "ffff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12981 | .{ .tag = .fmal, .properties = .{ .param_str = "LdLdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12982 | .{ .tag = .fmax, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12983 | .{ .tag = .fmaxf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12984 | .{ .tag = .fmaxl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12985 | .{ .tag = .fmin, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12986 | .{ .tag = .fminf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12987 | .{ .tag = .fminl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 12988 | .{ .tag = .fmod, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12989 | .{ .tag = .fmodf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12990 | .{ .tag = .fmodl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 12991 | .{ .tag = .fopen, .properties = .{ .param_str = "P*cC*cC*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12992 | .{ .tag = .fprintf, .properties = .{ .param_str = "iP*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 12993 | .{ .tag = .fread, .properties = .{ .param_str = "zv*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12994 | .{ .tag = .free, .properties = .{ .param_str = "vv*", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12995 | .{ .tag = .frexp, .properties = .{ .param_str = "ddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12996 | .{ .tag = .frexpf, .properties = .{ .param_str = "ffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12997 | .{ .tag = .frexpl, .properties = .{ .param_str = "LdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 12998 | .{ .tag = .fscanf, .properties = .{ .param_str = "iP*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 12999 | .{ .tag = .fwrite, .properties = .{ .param_str = "zvC*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13000 | .{ .tag = .getcontext, .properties = .{ .param_str = "iK*", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 13001 | .{ .tag = .hypot, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13002 | .{ .tag = .hypotf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13003 | .{ .tag = .hypotl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13004 | .{ .tag = .ilogb, .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13005 | .{ .tag = .ilogbf, .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13006 | .{ .tag = .ilogbl, .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13007 | .{ .tag = .index, .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13008 | .{ .tag = .isalnum, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13009 | .{ .tag = .isalpha, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13010 | .{ .tag = .isblank, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13011 | .{ .tag = .iscntrl, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13012 | .{ .tag = .isdigit, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13013 | .{ .tag = .isgraph, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13014 | .{ .tag = .islower, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13015 | .{ .tag = .isprint, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13016 | .{ .tag = .ispunct, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13017 | .{ .tag = .isspace, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13018 | .{ .tag = .isupper, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13019 | .{ .tag = .isxdigit, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13020 | .{ .tag = .labs, .properties = .{ .param_str = "LiLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13021 | .{ .tag = .ldexp, .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13022 | .{ .tag = .ldexpf, .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13023 | .{ .tag = .ldexpl, .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13024 | .{ .tag = .lgamma, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13025 | .{ .tag = .lgammaf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13026 | .{ .tag = .lgammal, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13027 | .{ .tag = .llabs, .properties = .{ .param_str = "LLiLLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13028 | .{ .tag = .llrint, .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13029 | .{ .tag = .llrintf, .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13030 | .{ .tag = .llrintl, .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13031 | .{ .tag = .llround, .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13032 | .{ .tag = .llroundf, .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13033 | .{ .tag = .llroundl, .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13034 | .{ .tag = .log, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13035 | .{ .tag = .log10, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13036 | .{ .tag = .log10f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13037 | .{ .tag = .log10l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13038 | .{ .tag = .log1p, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13039 | .{ .tag = .log1pf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13040 | .{ .tag = .log1pl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13041 | .{ .tag = .log2, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13042 | .{ .tag = .log2f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13043 | .{ .tag = .log2l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13044 | .{ .tag = .logb, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13045 | .{ .tag = .logbf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13046 | .{ .tag = .logbl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13047 | .{ .tag = .logf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13048 | .{ .tag = .logl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13049 | .{ .tag = .longjmp, .properties = .{ .param_str = "vJi", .header = .setjmp, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, | |
| 13050 | .{ .tag = .lrint, .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13051 | .{ .tag = .lrintf, .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13052 | .{ .tag = .lrintl, .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13053 | .{ .tag = .lround, .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13054 | .{ .tag = .lroundf, .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13055 | .{ .tag = .lroundl, .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13056 | .{ .tag = .malloc, .properties = .{ .param_str = "v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13057 | .{ .tag = .memalign, .properties = .{ .param_str = "v*zz", .header = .malloc, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13058 | .{ .tag = .memccpy, .properties = .{ .param_str = "v*v*vC*iz", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13059 | .{ .tag = .memchr, .properties = .{ .param_str = "v*vC*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13060 | .{ .tag = .memcmp, .properties = .{ .param_str = "ivC*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13061 | .{ .tag = .memcpy, .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13062 | .{ .tag = .memmove, .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13063 | .{ .tag = .mempcpy, .properties = .{ .param_str = "v*v*vC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13064 | .{ .tag = .memset, .properties = .{ .param_str = "v*v*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13065 | .{ .tag = .modf, .properties = .{ .param_str = "ddd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13066 | .{ .tag = .modff, .properties = .{ .param_str = "fff*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13067 | .{ .tag = .modfl, .properties = .{ .param_str = "LdLdLd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13068 | .{ .tag = .nan, .properties = .{ .param_str = "dcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13069 | .{ .tag = .nanf, .properties = .{ .param_str = "fcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13070 | .{ .tag = .nanl, .properties = .{ .param_str = "LdcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13071 | .{ .tag = .nearbyint, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13072 | .{ .tag = .nearbyintf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13073 | .{ .tag = .nearbyintl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13074 | .{ .tag = .nextafter, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13075 | .{ .tag = .nextafterf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13076 | .{ .tag = .nextafterl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13077 | .{ .tag = .nexttoward, .properties = .{ .param_str = "ddLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13078 | .{ .tag = .nexttowardf, .properties = .{ .param_str = "ffLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13079 | .{ .tag = .nexttowardl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13080 | .{ .tag = .pow, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13081 | .{ .tag = .powf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13082 | .{ .tag = .powl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13083 | .{ .tag = .printf, .properties = .{ .param_str = "icC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf } } }, | |
| 13084 | .{ .tag = .realloc, .properties = .{ .param_str = "v*v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13085 | .{ .tag = .remainder, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13086 | .{ .tag = .remainderf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13087 | .{ .tag = .remainderl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13088 | .{ .tag = .remquo, .properties = .{ .param_str = "dddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13089 | .{ .tag = .remquof, .properties = .{ .param_str = "fffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13090 | .{ .tag = .remquol, .properties = .{ .param_str = "LdLdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13091 | .{ .tag = .rindex, .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13092 | .{ .tag = .rint, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, | |
| 13093 | .{ .tag = .rintf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, | |
| 13094 | .{ .tag = .rintl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, | |
| 13095 | .{ .tag = .round, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13096 | .{ .tag = .roundeven, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13097 | .{ .tag = .roundevenf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13098 | .{ .tag = .roundevenl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13099 | .{ .tag = .roundf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13100 | .{ .tag = .roundl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13101 | .{ .tag = .savectx, .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 13102 | .{ .tag = .scalbln, .properties = .{ .param_str = "ddLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13103 | .{ .tag = .scalblnf, .properties = .{ .param_str = "ffLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13104 | .{ .tag = .scalblnl, .properties = .{ .param_str = "LdLdLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13105 | .{ .tag = .scalbn, .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13106 | .{ .tag = .scalbnf, .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13107 | .{ .tag = .scalbnl, .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13108 | .{ .tag = .scanf, .properties = .{ .param_str = "icC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf } } }, | |
| 13109 | .{ .tag = .setjmp, .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 13110 | .{ .tag = .siglongjmp, .properties = .{ .param_str = "vSJi", .header = .setjmp, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, | |
| 13111 | .{ .tag = .sigsetjmp, .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 13112 | .{ .tag = .sin, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13113 | .{ .tag = .sinf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13114 | .{ .tag = .sinh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13115 | .{ .tag = .sinhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13116 | .{ .tag = .sinhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13117 | .{ .tag = .sinl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13118 | .{ .tag = .snprintf, .properties = .{ .param_str = "ic*zcC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, | |
| 13119 | .{ .tag = .sprintf, .properties = .{ .param_str = "ic*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, | |
| 13120 | .{ .tag = .sqrt, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13121 | .{ .tag = .sqrtf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13122 | .{ .tag = .sqrtl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13123 | .{ .tag = .sscanf, .properties = .{ .param_str = "icC*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, | |
| 13124 | .{ .tag = .stpcpy, .properties = .{ .param_str = "c*c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13125 | .{ .tag = .stpncpy, .properties = .{ .param_str = "c*c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13126 | .{ .tag = .strcasecmp, .properties = .{ .param_str = "icC*cC*", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13127 | .{ .tag = .strcat, .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13128 | .{ .tag = .strchr, .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13129 | .{ .tag = .strcmp, .properties = .{ .param_str = "icC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13130 | .{ .tag = .strcpy, .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13131 | .{ .tag = .strcspn, .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13132 | .{ .tag = .strdup, .properties = .{ .param_str = "c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13133 | .{ .tag = .strerror, .properties = .{ .param_str = "c*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13134 | .{ .tag = .strlcat, .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13135 | .{ .tag = .strlcpy, .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13136 | .{ .tag = .strlen, .properties = .{ .param_str = "zcC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13137 | .{ .tag = .strncasecmp, .properties = .{ .param_str = "icC*cC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13138 | .{ .tag = .strncat, .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13139 | .{ .tag = .strncmp, .properties = .{ .param_str = "icC*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13140 | .{ .tag = .strncpy, .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13141 | .{ .tag = .strndup, .properties = .{ .param_str = "c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13142 | .{ .tag = .strpbrk, .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13143 | .{ .tag = .strrchr, .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13144 | .{ .tag = .strspn, .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13145 | .{ .tag = .strstr, .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13146 | .{ .tag = .strtod, .properties = .{ .param_str = "dcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13147 | .{ .tag = .strtof, .properties = .{ .param_str = "fcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13148 | .{ .tag = .strtok, .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13149 | .{ .tag = .strtol, .properties = .{ .param_str = "LicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13150 | .{ .tag = .strtold, .properties = .{ .param_str = "LdcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13151 | .{ .tag = .strtoll, .properties = .{ .param_str = "LLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13152 | .{ .tag = .strtoul, .properties = .{ .param_str = "ULicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13153 | .{ .tag = .strtoull, .properties = .{ .param_str = "ULLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13154 | .{ .tag = .strxfrm, .properties = .{ .param_str = "zc*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13155 | .{ .tag = .tan, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13156 | .{ .tag = .tanf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13157 | .{ .tag = .tanh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13158 | .{ .tag = .tanhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13159 | .{ .tag = .tanhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13160 | .{ .tag = .tanl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13161 | .{ .tag = .tgamma, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13162 | .{ .tag = .tgammaf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13163 | .{ .tag = .tgammal, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, | |
| 13164 | .{ .tag = .tolower, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13165 | .{ .tag = .toupper, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, | |
| 13166 | .{ .tag = .trunc, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13167 | .{ .tag = .truncf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13168 | .{ .tag = .truncl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, | |
| 13169 | .{ .tag = .va_copy, .properties = .{ .param_str = "vAA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13170 | .{ .tag = .va_end, .properties = .{ .param_str = "vA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13171 | .{ .tag = .va_start, .properties = .{ .param_str = "vA.", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, | |
| 13172 | .{ .tag = .vfork, .properties = .{ .param_str = "p", .header = .unistd, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, | |
| 13173 | .{ .tag = .vfprintf, .properties = .{ .param_str = "iP*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 13174 | .{ .tag = .vfscanf, .properties = .{ .param_str = "iP*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 13175 | .{ .tag = .vprintf, .properties = .{ .param_str = "icC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf } } }, | |
| 13176 | .{ .tag = .vscanf, .properties = .{ .param_str = "icC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf } } }, | |
| 13177 | .{ .tag = .vsnprintf, .properties = .{ .param_str = "ic*zcC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, | |
| 13178 | .{ .tag = .vsprintf, .properties = .{ .param_str = "ic*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, | |
| 13179 | .{ .tag = .vsscanf, .properties = .{ .param_str = "icC*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, | |
| 13180 | .{ .tag = .wcschr, .properties = .{ .param_str = "w*wC*w", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13181 | .{ .tag = .wcscmp, .properties = .{ .param_str = "iwC*wC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13182 | .{ .tag = .wcslen, .properties = .{ .param_str = "zwC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13183 | .{ .tag = .wcsncmp, .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13184 | .{ .tag = .wmemchr, .properties = .{ .param_str = "w*wC*wz", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13185 | .{ .tag = .wmemcmp, .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13186 | .{ .tag = .wmemcpy, .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13187 | .{ .tag = .wmemmove, .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, | |
| 13142 | 13188 | }; |
| 13143 | 13189 | }; |
| 13144 | 13190 | }; |
lib/compiler/aro/aro/Builtins/eval.zig+20-19| ... | ... | @@ -5,8 +5,9 @@ const Builtins = @import("../Builtins.zig"); |
| 5 | 5 | const Builtin = Builtins.Builtin; |
| 6 | 6 | const Parser = @import("../Parser.zig"); |
| 7 | 7 | const Tree = @import("../Tree.zig"); |
| 8 | const NodeIndex = Tree.NodeIndex; | |
| 9 | const Type = @import("../Type.zig"); | |
| 8 | const TypeStore = @import("../TypeStore.zig"); | |
| 9 | const Type = TypeStore.Type; | |
| 10 | const QualType = TypeStore.QualType; | |
| 10 | 11 | const Value = @import("../Value.zig"); |
| 11 | 12 | |
| 12 | 13 | fn makeNan(comptime T: type, str: []const u8) T { |
| ... | ... | @@ -22,22 +23,22 @@ fn makeNan(comptime T: type, str: []const u8) T { |
| 22 | 23 | return @bitCast(@as(UnsignedSameSize, bits) | @as(UnsignedSameSize, @bitCast(std.math.nan(T)))); |
| 23 | 24 | } |
| 24 | 25 | |
| 25 | pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const NodeIndex) !Value { | |
| 26 | pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const Tree.Node.Index) !Value { | |
| 26 | 27 | const builtin = Builtin.fromTag(tag); |
| 27 | 28 | if (!builtin.properties.attributes.const_evaluable) return .{}; |
| 28 | 29 | |
| 29 | 30 | switch (tag) { |
| 30 | Builtin.tagFromName("__builtin_inff").?, | |
| 31 | Builtin.tagFromName("__builtin_inf").?, | |
| 32 | Builtin.tagFromName("__builtin_infl").?, | |
| 31 | .__builtin_inff, | |
| 32 | .__builtin_inf, | |
| 33 | .__builtin_infl, | |
| 33 | 34 | => { |
| 34 | const ty: Type = switch (tag) { | |
| 35 | Builtin.tagFromName("__builtin_inff").? => .{ .specifier = .float }, | |
| 36 | Builtin.tagFromName("__builtin_inf").? => .{ .specifier = .double }, | |
| 37 | Builtin.tagFromName("__builtin_infl").? => .{ .specifier = .long_double }, | |
| 35 | const qt: QualType = switch (tag) { | |
| 36 | .__builtin_inff => .float, | |
| 37 | .__builtin_inf => .double, | |
| 38 | .__builtin_infl => .long_double, | |
| 38 | 39 | else => unreachable, |
| 39 | 40 | }; |
| 40 | const f: Interner.Key.Float = switch (ty.bitSizeof(p.comp).?) { | |
| 41 | const f: Interner.Key.Float = switch (qt.bitSizeof(p.comp)) { | |
| 41 | 42 | 32 => .{ .f32 = std.math.inf(f32) }, |
| 42 | 43 | 64 => .{ .f64 = std.math.inf(f64) }, |
| 43 | 44 | 80 => .{ .f80 = std.math.inf(f80) }, |
| ... | ... | @@ -46,14 +47,14 @@ pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const NodeIndex) !Value { |
| 46 | 47 | }; |
| 47 | 48 | return Value.intern(p.comp, .{ .float = f }); |
| 48 | 49 | }, |
| 49 | Builtin.tagFromName("__builtin_isinf").? => blk: { | |
| 50 | .__builtin_isinf => blk: { | |
| 50 | 51 | if (args.len == 0) break :blk; |
| 51 | const val = p.value_map.get(args[0]) orelse break :blk; | |
| 52 | const val = p.tree.value_map.get(args[0]) orelse break :blk; | |
| 52 | 53 | return Value.fromBool(val.isInf(p.comp)); |
| 53 | 54 | }, |
| 54 | Builtin.tagFromName("__builtin_isinf_sign").? => blk: { | |
| 55 | .__builtin_isinf_sign => blk: { | |
| 55 | 56 | if (args.len == 0) break :blk; |
| 56 | const val = p.value_map.get(args[0]) orelse break :blk; | |
| 57 | const val = p.tree.value_map.get(args[0]) orelse break :blk; | |
| 57 | 58 | switch (val.isInfSign(p.comp)) { |
| 58 | 59 | .unknown => {}, |
| 59 | 60 | .finite => return Value.zero, |
| ... | ... | @@ -61,17 +62,17 @@ pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const NodeIndex) !Value { |
| 61 | 62 | .negative => return Value.int(@as(i64, -1), p.comp), |
| 62 | 63 | } |
| 63 | 64 | }, |
| 64 | Builtin.tagFromName("__builtin_isnan").? => blk: { | |
| 65 | .__builtin_isnan => blk: { | |
| 65 | 66 | if (args.len == 0) break :blk; |
| 66 | const val = p.value_map.get(args[0]) orelse break :blk; | |
| 67 | const val = p.tree.value_map.get(args[0]) orelse break :blk; | |
| 67 | 68 | return Value.fromBool(val.isNan(p.comp)); |
| 68 | 69 | }, |
| 69 | Builtin.tagFromName("__builtin_nan").? => blk: { | |
| 70 | .__builtin_nan => blk: { | |
| 70 | 71 | if (args.len == 0) break :blk; |
| 71 | 72 | const val = p.getDecayedStringLiteral(args[0]) orelse break :blk; |
| 72 | 73 | const bytes = p.comp.interner.get(val.ref()).bytes; |
| 73 | 74 | |
| 74 | const f: Interner.Key.Float = switch ((Type{ .specifier = .double }).bitSizeof(p.comp).?) { | |
| 75 | const f: Interner.Key.Float = switch (Type.Float.double.bits(p.comp)) { | |
| 75 | 76 | 32 => .{ .f32 = makeNan(f32, bytes) }, |
| 76 | 77 | 64 => .{ .f64 = makeNan(f64, bytes) }, |
| 77 | 78 | 80 => .{ .f80 = makeNan(f80, bytes) }, |
lib/compiler/aro/aro/CodeGen.zig+491-586| ... | ... | @@ -1,18 +1,19 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const Allocator = std.mem.Allocator; |
| 3 | 3 | const assert = std.debug.assert; |
| 4 | ||
| 4 | 5 | const backend = @import("../backend.zig"); |
| 5 | 6 | const Interner = backend.Interner; |
| 6 | 7 | const Ir = backend.Ir; |
| 8 | const Builder = Ir.Builder; | |
| 9 | ||
| 7 | 10 | const Builtins = @import("Builtins.zig"); |
| 8 | 11 | const Builtin = Builtins.Builtin; |
| 9 | 12 | const Compilation = @import("Compilation.zig"); |
| 10 | const Builder = Ir.Builder; | |
| 11 | const StrInt = @import("StringInterner.zig"); | |
| 12 | const StringId = StrInt.StringId; | |
| 13 | const StringId = @import("StringInterner.zig").StringId; | |
| 13 | 14 | const Tree = @import("Tree.zig"); |
| 14 | const NodeIndex = Tree.NodeIndex; | |
| 15 | const Type = @import("Type.zig"); | |
| 15 | const Node = Tree.Node; | |
| 16 | const QualType = @import("TypeStore.zig").QualType; | |
| 16 | 17 | const Value = @import("Value.zig"); |
| 17 | 18 | |
| 18 | 19 | const WipSwitch = struct { |
| ... | ... | @@ -35,18 +36,15 @@ const Error = Compilation.Error; |
| 35 | 36 | |
| 36 | 37 | const CodeGen = @This(); |
| 37 | 38 | |
| 38 | tree: Tree, | |
| 39 | tree: *const Tree, | |
| 39 | 40 | comp: *Compilation, |
| 40 | 41 | builder: Builder, |
| 41 | node_tag: []const Tree.Tag, | |
| 42 | node_data: []const Tree.Node.Data, | |
| 43 | node_ty: []const Type, | |
| 44 | 42 | wip_switch: *WipSwitch = undefined, |
| 45 | symbols: std.ArrayListUnmanaged(Symbol) = .empty, | |
| 46 | ret_nodes: std.ArrayListUnmanaged(Ir.Inst.Phi.Input) = .empty, | |
| 47 | phi_nodes: std.ArrayListUnmanaged(Ir.Inst.Phi.Input) = .empty, | |
| 48 | record_elem_buf: std.ArrayListUnmanaged(Interner.Ref) = .empty, | |
| 49 | record_cache: std.AutoHashMapUnmanaged(*Type.Record, Interner.Ref) = .empty, | |
| 43 | symbols: std.ArrayList(Symbol) = .empty, | |
| 44 | ret_nodes: std.ArrayList(Ir.Inst.Phi.Input) = .empty, | |
| 45 | phi_nodes: std.ArrayList(Ir.Inst.Phi.Input) = .empty, | |
| 46 | record_elem_buf: std.ArrayList(Interner.Ref) = .empty, | |
| 47 | record_cache: std.AutoHashMapUnmanaged(QualType, Interner.Ref) = .empty, | |
| 50 | 48 | cond_dummy_ty: ?Interner.Ref = null, |
| 51 | 49 | bool_invert: bool = false, |
| 52 | 50 | bool_end_label: Ir.Ref = .none, |
| ... | ... | @@ -54,19 +52,22 @@ cond_dummy_ref: Ir.Ref = undefined, |
| 54 | 52 | continue_label: Ir.Ref = undefined, |
| 55 | 53 | break_label: Ir.Ref = undefined, |
| 56 | 54 | return_label: Ir.Ref = undefined, |
| 55 | compound_assign_dummy: ?Ir.Ref = null, | |
| 57 | 56 | |
| 58 | 57 | fn fail(c: *CodeGen, comptime fmt: []const u8, args: anytype) error{ FatalError, OutOfMemory } { |
| 59 | try c.comp.diagnostics.list.append(c.comp.gpa, .{ | |
| 60 | .tag = .cli_error, | |
| 61 | .kind = .@"fatal error", | |
| 62 | .extra = .{ .str = try std.fmt.allocPrint(c.comp.diagnostics.arena.allocator(), fmt, args) }, | |
| 63 | }); | |
| 58 | var sf = std.heap.stackFallback(1024, c.comp.gpa); | |
| 59 | const allocator = sf.get(); | |
| 60 | var buf: std.ArrayList(u8) = .empty; | |
| 61 | defer buf.deinit(allocator); | |
| 62 | ||
| 63 | try buf.print(allocator, fmt, args); | |
| 64 | try c.comp.diagnostics.add(.{ .text = buf.items, .kind = .@"fatal error", .location = null }); | |
| 64 | 65 | return error.FatalError; |
| 65 | 66 | } |
| 66 | 67 | |
| 67 | pub fn genIr(tree: Tree) Compilation.Error!Ir { | |
| 68 | pub fn genIr(tree: *const Tree) Compilation.Error!Ir { | |
| 68 | 69 | const gpa = tree.comp.gpa; |
| 69 | var c = CodeGen{ | |
| 70 | var c: CodeGen = .{ | |
| 70 | 71 | .builder = .{ |
| 71 | 72 | .gpa = tree.comp.gpa, |
| 72 | 73 | .interner = &tree.comp.interner, |
| ... | ... | @@ -74,9 +75,6 @@ pub fn genIr(tree: Tree) Compilation.Error!Ir { |
| 74 | 75 | }, |
| 75 | 76 | .tree = tree, |
| 76 | 77 | .comp = tree.comp, |
| 77 | .node_tag = tree.nodes.items(.tag), | |
| 78 | .node_data = tree.nodes.items(.data), | |
| 79 | .node_ty = tree.nodes.items(.ty), | |
| 80 | 78 | }; |
| 81 | 79 | defer c.symbols.deinit(gpa); |
| 82 | 80 | defer c.ret_nodes.deinit(gpa); |
| ... | ... | @@ -85,44 +83,31 @@ pub fn genIr(tree: Tree) Compilation.Error!Ir { |
| 85 | 83 | defer c.record_cache.deinit(gpa); |
| 86 | 84 | defer c.builder.deinit(); |
| 87 | 85 | |
| 88 | const node_tags = tree.nodes.items(.tag); | |
| 89 | for (tree.root_decls) |decl| { | |
| 86 | for (tree.root_decls.items) |decl| { | |
| 90 | 87 | c.builder.arena.deinit(); |
| 91 | 88 | c.builder.arena = std.heap.ArenaAllocator.init(gpa); |
| 92 | 89 | |
| 93 | switch (node_tags[@intFromEnum(decl)]) { | |
| 90 | switch (decl.get(c.tree)) { | |
| 91 | .empty_decl, | |
| 94 | 92 | .static_assert, |
| 95 | 93 | .typedef, |
| 96 | .struct_decl_two, | |
| 97 | .union_decl_two, | |
| 98 | .enum_decl_two, | |
| 99 | 94 | .struct_decl, |
| 100 | 95 | .union_decl, |
| 101 | 96 | .enum_decl, |
| 97 | .struct_forward_decl, | |
| 98 | .union_forward_decl, | |
| 99 | .enum_forward_decl, | |
| 102 | 100 | => {}, |
| 103 | 101 | |
| 104 | .fn_proto, | |
| 105 | .static_fn_proto, | |
| 106 | .inline_fn_proto, | |
| 107 | .inline_static_fn_proto, | |
| 108 | .extern_var, | |
| 109 | .threadlocal_extern_var, | |
| 110 | => {}, | |
| 111 | ||
| 112 | .fn_def, | |
| 113 | .static_fn_def, | |
| 114 | .inline_fn_def, | |
| 115 | .inline_static_fn_def, | |
| 116 | => c.genFn(decl) catch |err| switch (err) { | |
| 117 | error.FatalError => return error.FatalError, | |
| 118 | error.OutOfMemory => return error.OutOfMemory, | |
| 102 | .function => |function| { | |
| 103 | if (function.body == null) continue; | |
| 104 | c.genFn(function) catch |err| switch (err) { | |
| 105 | error.FatalError => return error.FatalError, | |
| 106 | error.OutOfMemory => return error.OutOfMemory, | |
| 107 | }; | |
| 119 | 108 | }, |
| 120 | 109 | |
| 121 | .@"var", | |
| 122 | .static_var, | |
| 123 | .threadlocal_var, | |
| 124 | .threadlocal_static_var, | |
| 125 | => c.genVar(decl) catch |err| switch (err) { | |
| 110 | .variable => |variable| c.genVar(variable) catch |err| switch (err) { | |
| 126 | 111 | error.FatalError => return error.FatalError, |
| 127 | 112 | error.OutOfMemory => return error.OutOfMemory, |
| 128 | 113 | }, |
| ... | ... | @@ -132,70 +117,78 @@ pub fn genIr(tree: Tree) Compilation.Error!Ir { |
| 132 | 117 | return c.builder.finish(); |
| 133 | 118 | } |
| 134 | 119 | |
| 135 | fn genType(c: *CodeGen, base_ty: Type) !Interner.Ref { | |
| 136 | var key: Interner.Key = undefined; | |
| 137 | const ty = base_ty.canonicalize(.standard); | |
| 138 | switch (ty.specifier) { | |
| 120 | fn genType(c: *CodeGen, qt: QualType) !Interner.Ref { | |
| 121 | const base = qt.base(c.comp); | |
| 122 | const key: Interner.Key = switch (base.type) { | |
| 139 | 123 | .void => return .void, |
| 140 | 124 | .bool => return .i1, |
| 141 | .@"struct" => { | |
| 142 | if (c.record_cache.get(ty.data.record)) |some| return some; | |
| 125 | .@"struct" => |record| { | |
| 126 | if (c.record_cache.get(base.qt.unqualified())) |some| return some; | |
| 143 | 127 | |
| 144 | 128 | const elem_buf_top = c.record_elem_buf.items.len; |
| 145 | 129 | defer c.record_elem_buf.items.len = elem_buf_top; |
| 146 | 130 | |
| 147 | for (ty.data.record.fields) |field| { | |
| 148 | if (!field.isRegularField()) { | |
| 131 | for (record.fields) |field| { | |
| 132 | if (field.bit_width != .null) { | |
| 149 | 133 | return c.fail("TODO lower struct bitfields", .{}); |
| 150 | 134 | } |
| 151 | 135 | // TODO handle padding bits |
| 152 | const field_ref = try c.genType(field.ty); | |
| 136 | const field_ref = try c.genType(field.qt); | |
| 153 | 137 | try c.record_elem_buf.append(c.builder.gpa, field_ref); |
| 154 | 138 | } |
| 155 | 139 | |
| 156 | return c.builder.interner.put(c.builder.gpa, .{ | |
| 140 | const recrd_ty = try c.builder.interner.put(c.builder.gpa, .{ | |
| 157 | 141 | .record_ty = c.record_elem_buf.items[elem_buf_top..], |
| 158 | 142 | }); |
| 143 | try c.record_cache.put(c.comp.gpa, base.qt.unqualified(), recrd_ty); | |
| 144 | return recrd_ty; | |
| 159 | 145 | }, |
| 160 | 146 | .@"union" => { |
| 161 | 147 | return c.fail("TODO lower union types", .{}); |
| 162 | 148 | }, |
| 163 | else => {}, | |
| 164 | } | |
| 165 | if (ty.isPtr()) return .ptr; | |
| 166 | if (ty.isFunc()) return .func; | |
| 167 | if (!ty.isReal()) return c.fail("TODO lower complex types", .{}); | |
| 168 | if (ty.isInt()) { | |
| 169 | const bits = ty.bitSizeof(c.comp).?; | |
| 170 | key = .{ .int_ty = @intCast(bits) }; | |
| 171 | } else if (ty.isFloat()) { | |
| 172 | const bits = ty.bitSizeof(c.comp).?; | |
| 173 | key = .{ .float_ty = @intCast(bits) }; | |
| 174 | } else if (ty.isArray()) { | |
| 175 | const elem = try c.genType(ty.elemType()); | |
| 176 | key = .{ .array_ty = .{ .child = elem, .len = ty.arrayLen().? } }; | |
| 177 | } else if (ty.specifier == .vector) { | |
| 178 | const elem = try c.genType(ty.elemType()); | |
| 179 | key = .{ .vector_ty = .{ .child = elem, .len = @intCast(ty.data.array.len) } }; | |
| 180 | } else if (ty.is(.nullptr_t)) { | |
| 181 | return c.fail("TODO lower nullptr_t", .{}); | |
| 182 | } | |
| 149 | .pointer => return .ptr, | |
| 150 | .func => return .func, | |
| 151 | .complex => return c.fail("TODO lower complex types", .{}), | |
| 152 | .atomic => return c.fail("TODO lower atomic types", .{}), | |
| 153 | .@"enum" => |@"enum"| return c.genType(@"enum".tag.?), | |
| 154 | .int => |int| .{ .int_ty = int.bits(c.comp) }, | |
| 155 | .bit_int => |bit_int| .{ .int_ty = bit_int.bits }, | |
| 156 | .float => |float| .{ .float_ty = float.bits(c.comp) }, | |
| 157 | .array => |array| blk: { | |
| 158 | switch (array.len) { | |
| 159 | .fixed, .static => |len| { | |
| 160 | const elem = try c.genType(array.elem); | |
| 161 | break :blk .{ .array_ty = .{ .child = elem, .len = len } }; | |
| 162 | }, | |
| 163 | .variable, .unspecified_variable => return c.fail("TODO VLAs", .{}), | |
| 164 | .incomplete => unreachable, | |
| 165 | } | |
| 166 | }, | |
| 167 | .vector => |vector| blk: { | |
| 168 | const elem = try c.genType(vector.elem); | |
| 169 | break :blk .{ .vector_ty = .{ .child = elem, .len = vector.len } }; | |
| 170 | }, | |
| 171 | .nullptr_t => { | |
| 172 | return c.fail("TODO lower nullptr_t", .{}); | |
| 173 | }, | |
| 174 | .attributed, .typeof, .typedef => unreachable, | |
| 175 | }; | |
| 183 | 176 | return c.builder.interner.put(c.builder.gpa, key); |
| 184 | 177 | } |
| 185 | 178 | |
| 186 | fn genFn(c: *CodeGen, decl: NodeIndex) Error!void { | |
| 187 | const name = c.tree.tokSlice(c.node_data[@intFromEnum(decl)].decl.name); | |
| 188 | const func_ty = c.node_ty[@intFromEnum(decl)].canonicalize(.standard); | |
| 179 | fn genFn(c: *CodeGen, function: Node.Function) Error!void { | |
| 180 | const name = c.tree.tokSlice(function.name_tok); | |
| 181 | const func_ty = function.qt.base(c.comp).type.func; | |
| 189 | 182 | c.ret_nodes.items.len = 0; |
| 190 | 183 | |
| 191 | 184 | try c.builder.startFn(); |
| 192 | 185 | |
| 193 | for (func_ty.data.func.params) |param| { | |
| 186 | for (func_ty.params) |param| { | |
| 194 | 187 | // TODO handle calling convention here |
| 195 | const arg = try c.builder.addArg(try c.genType(param.ty)); | |
| 188 | const arg = try c.builder.addArg(try c.genType(param.qt)); | |
| 196 | 189 | |
| 197 | const size: u32 = @intCast(param.ty.sizeof(c.comp).?); // TODO add error in parser | |
| 198 | const @"align" = param.ty.alignof(c.comp); | |
| 190 | const size: u32 = @intCast(param.qt.sizeof(c.comp)); // TODO add error in parser | |
| 191 | const @"align" = param.qt.alignof(c.comp); | |
| 199 | 192 | const alloc = try c.builder.addAlloc(size, @"align"); |
| 200 | 193 | try c.builder.addStore(alloc, arg); |
| 201 | 194 | try c.symbols.append(c.comp.gpa, .{ .name = param.name, .val = alloc }); |
| ... | ... | @@ -203,7 +196,7 @@ fn genFn(c: *CodeGen, decl: NodeIndex) Error!void { |
| 203 | 196 | |
| 204 | 197 | // Generate body |
| 205 | 198 | c.return_label = try c.builder.makeLabel("return"); |
| 206 | try c.genStmt(c.node_data[@intFromEnum(decl)].decl.node); | |
| 199 | try c.genStmt(function.body.?); | |
| 207 | 200 | |
| 208 | 201 | // Relocate returns |
| 209 | 202 | if (c.ret_nodes.items.len == 0) { |
| ... | ... | @@ -213,19 +206,19 @@ fn genFn(c: *CodeGen, decl: NodeIndex) Error!void { |
| 213 | 206 | _ = try c.builder.addInst(.ret, .{ .un = c.ret_nodes.items[0].value }, .noreturn); |
| 214 | 207 | } else { |
| 215 | 208 | try c.builder.startBlock(c.return_label); |
| 216 | const phi = try c.builder.addPhi(c.ret_nodes.items, try c.genType(func_ty.returnType())); | |
| 209 | const phi = try c.builder.addPhi(c.ret_nodes.items, try c.genType(func_ty.return_type)); | |
| 217 | 210 | _ = try c.builder.addInst(.ret, .{ .un = phi }, .noreturn); |
| 218 | 211 | } |
| 219 | 212 | |
| 220 | 213 | try c.builder.finishFn(name); |
| 221 | 214 | } |
| 222 | 215 | |
| 223 | fn addUn(c: *CodeGen, tag: Ir.Inst.Tag, operand: Ir.Ref, ty: Type) !Ir.Ref { | |
| 224 | return c.builder.addInst(tag, .{ .un = operand }, try c.genType(ty)); | |
| 216 | fn addUn(c: *CodeGen, tag: Ir.Inst.Tag, operand: Ir.Ref, qt: QualType) !Ir.Ref { | |
| 217 | return c.builder.addInst(tag, .{ .un = operand }, try c.genType(qt)); | |
| 225 | 218 | } |
| 226 | 219 | |
| 227 | fn addBin(c: *CodeGen, tag: Ir.Inst.Tag, lhs: Ir.Ref, rhs: Ir.Ref, ty: Type) !Ir.Ref { | |
| 228 | return c.builder.addInst(tag, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, try c.genType(ty)); | |
| 220 | fn addBin(c: *CodeGen, tag: Ir.Inst.Tag, lhs: Ir.Ref, rhs: Ir.Ref, qt: QualType) !Ir.Ref { | |
| 221 | return c.builder.addInst(tag, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, try c.genType(qt)); | |
| 229 | 222 | } |
| 230 | 223 | |
| 231 | 224 | 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 { |
| 247 | 240 | try c.phi_nodes.append(c.comp.gpa, .{ .label = c.builder.current_label, .value = val }); |
| 248 | 241 | } |
| 249 | 242 | |
| 250 | fn genStmt(c: *CodeGen, node: NodeIndex) Error!void { | |
| 243 | fn genStmt(c: *CodeGen, node: Node.Index) Error!void { | |
| 251 | 244 | _ = try c.genExpr(node); |
| 252 | 245 | } |
| 253 | 246 | |
| 254 | fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { | |
| 255 | std.debug.assert(node != .none); | |
| 256 | const ty = c.node_ty[@intFromEnum(node)]; | |
| 257 | if (c.tree.value_map.get(node)) |val| { | |
| 258 | return c.builder.addConstant(val.ref(), try c.genType(ty)); | |
| 247 | fn genExpr(c: *CodeGen, node_index: Node.Index) Error!Ir.Ref { | |
| 248 | if (c.tree.value_map.get(node_index)) |val| { | |
| 249 | return c.builder.addConstant(val.ref(), try c.genType(node_index.qt(c.tree))); | |
| 259 | 250 | } |
| 260 | const data = c.node_data[@intFromEnum(node)]; | |
| 261 | switch (c.node_tag[@intFromEnum(node)]) { | |
| 251 | const node = node_index.get(c.tree); | |
| 252 | switch (node) { | |
| 262 | 253 | .enumeration_ref, |
| 263 | 254 | .bool_literal, |
| 264 | 255 | .int_literal, |
| ... | ... | @@ -268,96 +259,74 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 268 | 259 | .string_literal_expr, |
| 269 | 260 | .alignof_expr, |
| 270 | 261 | => unreachable, // These should have an entry in value_map. |
| 271 | .fn_def, | |
| 272 | .static_fn_def, | |
| 273 | .inline_fn_def, | |
| 274 | .inline_static_fn_def, | |
| 275 | .invalid, | |
| 276 | .threadlocal_var, | |
| 277 | => unreachable, | |
| 278 | 262 | .static_assert, |
| 279 | .fn_proto, | |
| 280 | .static_fn_proto, | |
| 281 | .inline_fn_proto, | |
| 282 | .inline_static_fn_proto, | |
| 283 | .extern_var, | |
| 284 | .threadlocal_extern_var, | |
| 263 | .function, | |
| 285 | 264 | .typedef, |
| 286 | .struct_decl_two, | |
| 287 | .union_decl_two, | |
| 288 | .enum_decl_two, | |
| 289 | 265 | .struct_decl, |
| 290 | 266 | .union_decl, |
| 291 | 267 | .enum_decl, |
| 292 | .enum_field_decl, | |
| 293 | .record_field_decl, | |
| 294 | .indirect_record_field_decl, | |
| 268 | .enum_field, | |
| 269 | .record_field, | |
| 295 | 270 | .struct_forward_decl, |
| 296 | 271 | .union_forward_decl, |
| 297 | 272 | .enum_forward_decl, |
| 298 | 273 | .null_stmt, |
| 299 | 274 | => {}, |
| 300 | .static_var, | |
| 301 | .implicit_static_var, | |
| 302 | .threadlocal_static_var, | |
| 303 | => try c.genVar(node), // TODO | |
| 304 | .@"var" => { | |
| 305 | const size: u32 = @intCast(ty.sizeof(c.comp).?); // TODO add error in parser | |
| 306 | const @"align" = ty.alignof(c.comp); | |
| 275 | .variable => |variable| { | |
| 276 | if (variable.storage_class == .@"extern" or variable.storage_class == .static) { | |
| 277 | try c.genVar(variable); | |
| 278 | return .none; | |
| 279 | } | |
| 280 | const size: u32 = @intCast(variable.qt.sizeof(c.comp)); // TODO add error in parser | |
| 281 | const @"align" = variable.qt.alignof(c.comp); | |
| 307 | 282 | const alloc = try c.builder.addAlloc(size, @"align"); |
| 308 | const name = try StrInt.intern(c.comp, c.tree.tokSlice(data.decl.name)); | |
| 283 | const name = try c.comp.internString(c.tree.tokSlice(variable.name_tok)); | |
| 309 | 284 | try c.symbols.append(c.comp.gpa, .{ .name = name, .val = alloc }); |
| 310 | if (data.decl.node != .none) { | |
| 311 | try c.genInitializer(alloc, ty, data.decl.node); | |
| 285 | if (variable.initializer) |init| { | |
| 286 | try c.genInitializer(alloc, variable.qt, init); | |
| 312 | 287 | } |
| 313 | 288 | }, |
| 314 | .labeled_stmt => { | |
| 289 | .labeled_stmt => |labeled| { | |
| 315 | 290 | const label = try c.builder.makeLabel("label"); |
| 316 | 291 | try c.builder.startBlock(label); |
| 317 | try c.genStmt(data.decl.node); | |
| 292 | try c.genStmt(labeled.body); | |
| 318 | 293 | }, |
| 319 | .compound_stmt_two => { | |
| 294 | .compound_stmt => |compound| { | |
| 320 | 295 | const old_sym_len = c.symbols.items.len; |
| 321 | 296 | c.symbols.items.len = old_sym_len; |
| 322 | 297 | |
| 323 | if (data.bin.lhs != .none) try c.genStmt(data.bin.lhs); | |
| 324 | if (data.bin.rhs != .none) try c.genStmt(data.bin.rhs); | |
| 298 | for (compound.body) |stmt| try c.genStmt(stmt); | |
| 325 | 299 | }, |
| 326 | .compound_stmt => { | |
| 327 | const old_sym_len = c.symbols.items.len; | |
| 328 | c.symbols.items.len = old_sym_len; | |
| 329 | ||
| 330 | for (c.tree.data[data.range.start..data.range.end]) |stmt| try c.genStmt(stmt); | |
| 331 | }, | |
| 332 | .if_then_else_stmt => { | |
| 300 | .if_stmt => |@"if"| { | |
| 333 | 301 | const then_label = try c.builder.makeLabel("if.then"); |
| 302 | ||
| 303 | const else_body = @"if".else_body orelse { | |
| 304 | const end_label = try c.builder.makeLabel("if.end"); | |
| 305 | try c.genBoolExpr(@"if".cond, then_label, end_label); | |
| 306 | ||
| 307 | try c.builder.startBlock(then_label); | |
| 308 | try c.genStmt(@"if".then_body); | |
| 309 | try c.builder.startBlock(end_label); | |
| 310 | return .none; | |
| 311 | }; | |
| 312 | ||
| 334 | 313 | const else_label = try c.builder.makeLabel("if.else"); |
| 335 | 314 | const end_label = try c.builder.makeLabel("if.end"); |
| 336 | 315 | |
| 337 | try c.genBoolExpr(data.if3.cond, then_label, else_label); | |
| 316 | try c.genBoolExpr(@"if".cond, then_label, else_label); | |
| 338 | 317 | |
| 339 | 318 | try c.builder.startBlock(then_label); |
| 340 | try c.genStmt(c.tree.data[data.if3.body]); // then | |
| 319 | try c.genStmt(@"if".then_body); | |
| 341 | 320 | try c.builder.addJump(end_label); |
| 342 | 321 | |
| 343 | 322 | try c.builder.startBlock(else_label); |
| 344 | try c.genStmt(c.tree.data[data.if3.body + 1]); // else | |
| 323 | try c.genStmt(else_body); | |
| 345 | 324 | |
| 346 | 325 | try c.builder.startBlock(end_label); |
| 347 | 326 | }, |
| 348 | .if_then_stmt => { | |
| 349 | const then_label = try c.builder.makeLabel("if.then"); | |
| 350 | const end_label = try c.builder.makeLabel("if.end"); | |
| 351 | ||
| 352 | try c.genBoolExpr(data.bin.lhs, then_label, end_label); | |
| 353 | ||
| 354 | try c.builder.startBlock(then_label); | |
| 355 | try c.genStmt(data.bin.rhs); // then | |
| 356 | try c.builder.startBlock(end_label); | |
| 357 | }, | |
| 358 | .switch_stmt => { | |
| 327 | .switch_stmt => |@"switch"| { | |
| 359 | 328 | var wip_switch = WipSwitch{ |
| 360 | .size = c.node_ty[@intFromEnum(data.bin.lhs)].sizeof(c.comp).?, | |
| 329 | .size = @"switch".cond.qt(c.tree).sizeof(c.comp), | |
| 361 | 330 | }; |
| 362 | 331 | defer wip_switch.cases.deinit(c.builder.gpa); |
| 363 | 332 | |
| ... | ... | @@ -370,11 +339,11 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 370 | 339 | const end_ref = try c.builder.makeLabel("switch.end"); |
| 371 | 340 | c.break_label = end_ref; |
| 372 | 341 | |
| 373 | const cond = try c.genExpr(data.bin.lhs); | |
| 342 | const cond = try c.genExpr(@"switch".cond); | |
| 374 | 343 | const switch_index = c.builder.instructions.len; |
| 375 | 344 | _ = try c.builder.addInst(.@"switch", undefined, .noreturn); |
| 376 | 345 | |
| 377 | try c.genStmt(data.bin.rhs); // body | |
| 346 | try c.genStmt(@"switch".body); | |
| 378 | 347 | |
| 379 | 348 | const default_ref = wip_switch.default orelse end_ref; |
| 380 | 349 | try c.builder.startBlock(end_ref); |
| ... | ... | @@ -390,23 +359,24 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 390 | 359 | }; |
| 391 | 360 | c.builder.instructions.items(.data)[switch_index] = .{ .@"switch" = switch_data }; |
| 392 | 361 | }, |
| 393 | .case_stmt => { | |
| 394 | const val = c.tree.value_map.get(data.bin.lhs).?; | |
| 362 | .case_stmt => |case| { | |
| 363 | if (case.end != null) return c.fail("TODO CodeGen.genStmt case range\n", .{}); | |
| 364 | const val = c.tree.value_map.get(case.start).?; | |
| 395 | 365 | const label = try c.builder.makeLabel("case"); |
| 396 | 366 | try c.builder.startBlock(label); |
| 397 | 367 | try c.wip_switch.cases.append(c.builder.gpa, .{ |
| 398 | 368 | .val = val.ref(), |
| 399 | 369 | .label = label, |
| 400 | 370 | }); |
| 401 | try c.genStmt(data.bin.rhs); | |
| 371 | try c.genStmt(case.body); | |
| 402 | 372 | }, |
| 403 | .default_stmt => { | |
| 404 | const default = try c.builder.makeLabel("default"); | |
| 405 | try c.builder.startBlock(default); | |
| 406 | c.wip_switch.default = default; | |
| 407 | try c.genStmt(data.un); | |
| 373 | .default_stmt => |default| { | |
| 374 | const default_label = try c.builder.makeLabel("default"); | |
| 375 | try c.builder.startBlock(default_label); | |
| 376 | c.wip_switch.default = default_label; | |
| 377 | try c.genStmt(default.body); | |
| 408 | 378 | }, |
| 409 | .while_stmt => { | |
| 379 | .while_stmt => |@"while"| { | |
| 410 | 380 | const old_break_label = c.break_label; |
| 411 | 381 | defer c.break_label = old_break_label; |
| 412 | 382 | |
| ... | ... | @@ -421,14 +391,14 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 421 | 391 | c.break_label = end_label; |
| 422 | 392 | |
| 423 | 393 | try c.builder.startBlock(cond_label); |
| 424 | try c.genBoolExpr(data.bin.lhs, then_label, end_label); | |
| 394 | try c.genBoolExpr(@"while".cond, then_label, end_label); | |
| 425 | 395 | |
| 426 | 396 | try c.builder.startBlock(then_label); |
| 427 | try c.genStmt(data.bin.rhs); | |
| 397 | try c.genStmt(@"while".body); | |
| 428 | 398 | try c.builder.addJump(cond_label); |
| 429 | 399 | try c.builder.startBlock(end_label); |
| 430 | 400 | }, |
| 431 | .do_while_stmt => { | |
| 401 | .do_while_stmt => |do_while| { | |
| 432 | 402 | const old_break_label = c.break_label; |
| 433 | 403 | defer c.break_label = old_break_label; |
| 434 | 404 | |
| ... | ... | @@ -443,70 +413,45 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 443 | 413 | c.break_label = end_label; |
| 444 | 414 | |
| 445 | 415 | try c.builder.startBlock(then_label); |
| 446 | try c.genStmt(data.bin.rhs); | |
| 416 | try c.genStmt(do_while.body); | |
| 447 | 417 | |
| 448 | 418 | try c.builder.startBlock(cond_label); |
| 449 | try c.genBoolExpr(data.bin.lhs, then_label, end_label); | |
| 419 | try c.genBoolExpr(do_while.cond, then_label, end_label); | |
| 450 | 420 | |
| 451 | 421 | try c.builder.startBlock(end_label); |
| 452 | 422 | }, |
| 453 | .for_decl_stmt => { | |
| 423 | .for_stmt => |@"for"| { | |
| 454 | 424 | const old_break_label = c.break_label; |
| 455 | 425 | defer c.break_label = old_break_label; |
| 456 | 426 | |
| 457 | 427 | const old_continue_label = c.continue_label; |
| 458 | 428 | defer c.continue_label = old_continue_label; |
| 459 | 429 | |
| 460 | const for_decl = data.forDecl(&c.tree); | |
| 461 | for (for_decl.decls) |decl| try c.genStmt(decl); | |
| 462 | ||
| 463 | const then_label = try c.builder.makeLabel("for.then"); | |
| 464 | var cond_label = then_label; | |
| 465 | const cont_label = try c.builder.makeLabel("for.cont"); | |
| 466 | const end_label = try c.builder.makeLabel("for.end"); | |
| 467 | ||
| 468 | c.continue_label = cont_label; | |
| 469 | c.break_label = end_label; | |
| 470 | ||
| 471 | if (for_decl.cond != .none) { | |
| 472 | cond_label = try c.builder.makeLabel("for.cond"); | |
| 473 | try c.builder.startBlock(cond_label); | |
| 474 | try c.genBoolExpr(for_decl.cond, then_label, end_label); | |
| 475 | } | |
| 476 | try c.builder.startBlock(then_label); | |
| 477 | try c.genStmt(for_decl.body); | |
| 478 | if (for_decl.incr != .none) { | |
| 479 | _ = try c.genExpr(for_decl.incr); | |
| 430 | switch (@"for".init) { | |
| 431 | .decls => |decls| { | |
| 432 | for (decls) |decl| try c.genStmt(decl); | |
| 433 | }, | |
| 434 | .expr => |maybe_init| { | |
| 435 | if (maybe_init) |init| _ = try c.genExpr(init); | |
| 436 | }, | |
| 480 | 437 | } |
| 481 | try c.builder.addJump(cond_label); | |
| 482 | try c.builder.startBlock(end_label); | |
| 483 | }, | |
| 484 | .forever_stmt => { | |
| 485 | const old_break_label = c.break_label; | |
| 486 | defer c.break_label = old_break_label; | |
| 487 | ||
| 488 | const old_continue_label = c.continue_label; | |
| 489 | defer c.continue_label = old_continue_label; | |
| 490 | ||
| 491 | const then_label = try c.builder.makeLabel("for.then"); | |
| 492 | const end_label = try c.builder.makeLabel("for.end"); | |
| 493 | 438 | |
| 494 | c.continue_label = then_label; | |
| 495 | c.break_label = end_label; | |
| 439 | const cond = @"for".cond orelse { | |
| 440 | const then_label = try c.builder.makeLabel("for.then"); | |
| 441 | const end_label = try c.builder.makeLabel("for.end"); | |
| 496 | 442 | |
| 497 | try c.builder.startBlock(then_label); | |
| 498 | try c.genStmt(data.un); | |
| 499 | try c.builder.startBlock(end_label); | |
| 500 | }, | |
| 501 | .for_stmt => { | |
| 502 | const old_break_label = c.break_label; | |
| 503 | defer c.break_label = old_break_label; | |
| 443 | c.continue_label = then_label; | |
| 444 | c.break_label = end_label; | |
| 504 | 445 | |
| 505 | const old_continue_label = c.continue_label; | |
| 506 | defer c.continue_label = old_continue_label; | |
| 507 | ||
| 508 | const for_stmt = data.forStmt(&c.tree); | |
| 509 | if (for_stmt.init != .none) _ = try c.genExpr(for_stmt.init); | |
| 446 | try c.builder.startBlock(then_label); | |
| 447 | try c.genStmt(@"for".body); | |
| 448 | if (@"for".incr) |incr| { | |
| 449 | _ = try c.genExpr(incr); | |
| 450 | } | |
| 451 | try c.builder.addJump(then_label); | |
| 452 | try c.builder.startBlock(end_label); | |
| 453 | return .none; | |
| 454 | }; | |
| 510 | 455 | |
| 511 | 456 | const then_label = try c.builder.makeLabel("for.then"); |
| 512 | 457 | var cond_label = then_label; |
| ... | ... | @@ -516,212 +461,213 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 516 | 461 | c.continue_label = cont_label; |
| 517 | 462 | c.break_label = end_label; |
| 518 | 463 | |
| 519 | if (for_stmt.cond != .none) { | |
| 520 | cond_label = try c.builder.makeLabel("for.cond"); | |
| 521 | try c.builder.startBlock(cond_label); | |
| 522 | try c.genBoolExpr(for_stmt.cond, then_label, end_label); | |
| 523 | } | |
| 464 | cond_label = try c.builder.makeLabel("for.cond"); | |
| 465 | ||
| 466 | try c.builder.startBlock(cond_label); | |
| 467 | try c.genBoolExpr(cond, then_label, end_label); | |
| 468 | ||
| 524 | 469 | try c.builder.startBlock(then_label); |
| 525 | try c.genStmt(for_stmt.body); | |
| 526 | if (for_stmt.incr != .none) { | |
| 527 | _ = try c.genExpr(for_stmt.incr); | |
| 470 | try c.genStmt(@"for".body); | |
| 471 | if (@"for".incr) |incr| { | |
| 472 | _ = try c.genExpr(incr); | |
| 528 | 473 | } |
| 529 | 474 | try c.builder.addJump(cond_label); |
| 530 | 475 | try c.builder.startBlock(end_label); |
| 531 | 476 | }, |
| 532 | 477 | .continue_stmt => try c.builder.addJump(c.continue_label), |
| 533 | 478 | .break_stmt => try c.builder.addJump(c.break_label), |
| 534 | .return_stmt => { | |
| 535 | if (data.un != .none) { | |
| 536 | const operand = try c.genExpr(data.un); | |
| 537 | try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); | |
| 479 | .return_stmt => |@"return"| { | |
| 480 | switch (@"return".operand) { | |
| 481 | .expr => |expr| { | |
| 482 | const operand = try c.genExpr(expr); | |
| 483 | try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); | |
| 484 | }, | |
| 485 | .none => {}, | |
| 486 | .implicit => |zeroes| { | |
| 487 | if (zeroes) { | |
| 488 | const operand = try c.builder.addConstant(.zero, try c.genType(@"return".return_qt)); | |
| 489 | try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); | |
| 490 | } | |
| 491 | // No need to emit a jump since an implicit return_stmt is always the last statement. | |
| 492 | return .none; | |
| 493 | }, | |
| 538 | 494 | } |
| 539 | 495 | try c.builder.addJump(c.return_label); |
| 540 | 496 | }, |
| 541 | .implicit_return => { | |
| 542 | if (data.return_zero) { | |
| 543 | const operand = try c.builder.addConstant(.zero, try c.genType(ty)); | |
| 544 | try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); | |
| 545 | } | |
| 546 | // No need to emit a jump since implicit_return is always the last instruction. | |
| 547 | }, | |
| 548 | .case_range_stmt, | |
| 549 | 497 | .goto_stmt, |
| 550 | 498 | .computed_goto_stmt, |
| 551 | 499 | .nullptr_literal, |
| 552 | => return c.fail("TODO CodeGen.genStmt {}\n", .{c.node_tag[@intFromEnum(node)]}), | |
| 553 | .comma_expr => { | |
| 554 | _ = try c.genExpr(data.bin.lhs); | |
| 555 | return c.genExpr(data.bin.rhs); | |
| 556 | }, | |
| 557 | .assign_expr => { | |
| 558 | const rhs = try c.genExpr(data.bin.rhs); | |
| 559 | const lhs = try c.genLval(data.bin.lhs); | |
| 500 | => return c.fail("TODO CodeGen.genStmt {s}\n", .{@tagName(node)}), | |
| 501 | .comma_expr => |bin| { | |
| 502 | _ = try c.genExpr(bin.lhs); | |
| 503 | return c.genExpr(bin.rhs); | |
| 504 | }, | |
| 505 | .assign_expr => |bin| { | |
| 506 | const rhs = try c.genExpr(bin.rhs); | |
| 507 | const lhs = try c.genLval(bin.lhs); | |
| 560 | 508 | try c.builder.addStore(lhs, rhs); |
| 561 | 509 | return rhs; |
| 562 | 510 | }, |
| 563 | .mul_assign_expr => return c.genCompoundAssign(node, .mul), | |
| 564 | .div_assign_expr => return c.genCompoundAssign(node, .div), | |
| 565 | .mod_assign_expr => return c.genCompoundAssign(node, .mod), | |
| 566 | .add_assign_expr => return c.genCompoundAssign(node, .add), | |
| 567 | .sub_assign_expr => return c.genCompoundAssign(node, .sub), | |
| 568 | .shl_assign_expr => return c.genCompoundAssign(node, .bit_shl), | |
| 569 | .shr_assign_expr => return c.genCompoundAssign(node, .bit_shr), | |
| 570 | .bit_and_assign_expr => return c.genCompoundAssign(node, .bit_and), | |
| 571 | .bit_xor_assign_expr => return c.genCompoundAssign(node, .bit_xor), | |
| 572 | .bit_or_assign_expr => return c.genCompoundAssign(node, .bit_or), | |
| 573 | .bit_or_expr => return c.genBinOp(node, .bit_or), | |
| 574 | .bit_xor_expr => return c.genBinOp(node, .bit_xor), | |
| 575 | .bit_and_expr => return c.genBinOp(node, .bit_and), | |
| 576 | .equal_expr => { | |
| 577 | const cmp = try c.genComparison(node, .cmp_eq); | |
| 578 | return c.addUn(.zext, cmp, ty); | |
| 579 | }, | |
| 580 | .not_equal_expr => { | |
| 581 | const cmp = try c.genComparison(node, .cmp_ne); | |
| 582 | return c.addUn(.zext, cmp, ty); | |
| 583 | }, | |
| 584 | .less_than_expr => { | |
| 585 | const cmp = try c.genComparison(node, .cmp_lt); | |
| 586 | return c.addUn(.zext, cmp, ty); | |
| 587 | }, | |
| 588 | .less_than_equal_expr => { | |
| 589 | const cmp = try c.genComparison(node, .cmp_lte); | |
| 590 | return c.addUn(.zext, cmp, ty); | |
| 591 | }, | |
| 592 | .greater_than_expr => { | |
| 593 | const cmp = try c.genComparison(node, .cmp_gt); | |
| 594 | return c.addUn(.zext, cmp, ty); | |
| 595 | }, | |
| 596 | .greater_than_equal_expr => { | |
| 597 | const cmp = try c.genComparison(node, .cmp_gte); | |
| 598 | return c.addUn(.zext, cmp, ty); | |
| 599 | }, | |
| 600 | .shl_expr => return c.genBinOp(node, .bit_shl), | |
| 601 | .shr_expr => return c.genBinOp(node, .bit_shr), | |
| 602 | .add_expr => { | |
| 603 | if (ty.isPtr()) { | |
| 604 | const lhs_ty = c.node_ty[@intFromEnum(data.bin.lhs)]; | |
| 605 | if (lhs_ty.isPtr()) { | |
| 606 | const ptr = try c.genExpr(data.bin.lhs); | |
| 607 | const offset = try c.genExpr(data.bin.rhs); | |
| 608 | const offset_ty = c.node_ty[@intFromEnum(data.bin.rhs)]; | |
| 609 | return c.genPtrArithmetic(ptr, offset, offset_ty, ty); | |
| 511 | .mul_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 512 | .div_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 513 | .mod_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 514 | .add_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 515 | .sub_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 516 | .shl_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 517 | .shr_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 518 | .bit_and_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 519 | .bit_xor_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 520 | .bit_or_assign_expr => |bin| return c.genCompoundAssign(bin), | |
| 521 | .bit_or_expr => |bin| return c.genBinOp(bin, .bit_or), | |
| 522 | .bit_xor_expr => |bin| return c.genBinOp(bin, .bit_xor), | |
| 523 | .bit_and_expr => |bin| return c.genBinOp(bin, .bit_and), | |
| 524 | .equal_expr => |bin| { | |
| 525 | const cmp = try c.genComparison(bin, .cmp_eq); | |
| 526 | return c.addUn(.zext, cmp, bin.qt); | |
| 527 | }, | |
| 528 | .not_equal_expr => |bin| { | |
| 529 | const cmp = try c.genComparison(bin, .cmp_ne); | |
| 530 | return c.addUn(.zext, cmp, bin.qt); | |
| 531 | }, | |
| 532 | .less_than_expr => |bin| { | |
| 533 | const cmp = try c.genComparison(bin, .cmp_lt); | |
| 534 | return c.addUn(.zext, cmp, bin.qt); | |
| 535 | }, | |
| 536 | .less_than_equal_expr => |bin| { | |
| 537 | const cmp = try c.genComparison(bin, .cmp_lte); | |
| 538 | return c.addUn(.zext, cmp, bin.qt); | |
| 539 | }, | |
| 540 | .greater_than_expr => |bin| { | |
| 541 | const cmp = try c.genComparison(bin, .cmp_gt); | |
| 542 | return c.addUn(.zext, cmp, bin.qt); | |
| 543 | }, | |
| 544 | .greater_than_equal_expr => |bin| { | |
| 545 | const cmp = try c.genComparison(bin, .cmp_gte); | |
| 546 | return c.addUn(.zext, cmp, bin.qt); | |
| 547 | }, | |
| 548 | .shl_expr => |bin| return c.genBinOp(bin, .bit_shl), | |
| 549 | .shr_expr => |bin| return c.genBinOp(bin, .bit_shr), | |
| 550 | .add_expr => |bin| { | |
| 551 | if (bin.qt.is(c.comp, .pointer)) { | |
| 552 | const lhs_qt = bin.lhs.qt(c.tree); | |
| 553 | if (lhs_qt.is(c.comp, .pointer)) { | |
| 554 | const ptr = try c.genExpr(bin.lhs); | |
| 555 | const offset = try c.genExpr(bin.rhs); | |
| 556 | return c.genPtrArithmetic(ptr, offset, bin.rhs.qt(c.tree), bin.qt); | |
| 610 | 557 | } else { |
| 611 | const offset = try c.genExpr(data.bin.lhs); | |
| 612 | const ptr = try c.genExpr(data.bin.rhs); | |
| 613 | const offset_ty = lhs_ty; | |
| 614 | return c.genPtrArithmetic(ptr, offset, offset_ty, ty); | |
| 558 | const offset = try c.genExpr(bin.lhs); | |
| 559 | const ptr = try c.genExpr(bin.rhs); | |
| 560 | const offset_ty = lhs_qt; | |
| 561 | return c.genPtrArithmetic(ptr, offset, offset_ty, bin.qt); | |
| 615 | 562 | } |
| 616 | 563 | } |
| 617 | return c.genBinOp(node, .add); | |
| 564 | return c.genBinOp(bin, .add); | |
| 618 | 565 | }, |
| 619 | .sub_expr => { | |
| 620 | if (ty.isPtr()) { | |
| 621 | const ptr = try c.genExpr(data.bin.lhs); | |
| 622 | const offset = try c.genExpr(data.bin.rhs); | |
| 623 | const offset_ty = c.node_ty[@intFromEnum(data.bin.rhs)]; | |
| 624 | return c.genPtrArithmetic(ptr, offset, offset_ty, ty); | |
| 566 | .sub_expr => |bin| { | |
| 567 | if (bin.qt.is(c.comp, .pointer)) { | |
| 568 | const ptr = try c.genExpr(bin.lhs); | |
| 569 | const offset = try c.genExpr(bin.rhs); | |
| 570 | return c.genPtrArithmetic(ptr, offset, bin.rhs.qt(c.tree), bin.qt); | |
| 625 | 571 | } |
| 626 | return c.genBinOp(node, .sub); | |
| 627 | }, | |
| 628 | .mul_expr => return c.genBinOp(node, .mul), | |
| 629 | .div_expr => return c.genBinOp(node, .div), | |
| 630 | .mod_expr => return c.genBinOp(node, .mod), | |
| 631 | .addr_of_expr => return try c.genLval(data.un), | |
| 632 | .deref_expr => { | |
| 633 | const un_data = c.node_data[@intFromEnum(data.un)]; | |
| 634 | if (c.node_tag[@intFromEnum(data.un)] == .implicit_cast and un_data.cast.kind == .function_to_pointer) { | |
| 635 | return c.genExpr(data.un); | |
| 572 | return c.genBinOp(bin, .sub); | |
| 573 | }, | |
| 574 | .mul_expr => |bin| return c.genBinOp(bin, .mul), | |
| 575 | .div_expr => |bin| return c.genBinOp(bin, .div), | |
| 576 | .mod_expr => |bin| return c.genBinOp(bin, .mod), | |
| 577 | .addr_of_expr => |un| return try c.genLval(un.operand), | |
| 578 | .deref_expr => |un| { | |
| 579 | const operand_node = un.operand.get(c.tree); | |
| 580 | if (operand_node == .cast and operand_node.cast.kind == .function_to_pointer) { | |
| 581 | return c.genExpr(un.operand); | |
| 636 | 582 | } |
| 637 | const operand = try c.genLval(data.un); | |
| 638 | return c.addUn(.load, operand, ty); | |
| 639 | }, | |
| 640 | .plus_expr => return c.genExpr(data.un), | |
| 641 | .negate_expr => { | |
| 642 | const zero = try c.builder.addConstant(.zero, try c.genType(ty)); | |
| 643 | const operand = try c.genExpr(data.un); | |
| 644 | return c.addBin(.sub, zero, operand, ty); | |
| 645 | }, | |
| 646 | .bit_not_expr => { | |
| 647 | const operand = try c.genExpr(data.un); | |
| 648 | return c.addUn(.bit_not, operand, ty); | |
| 649 | }, | |
| 650 | .bool_not_expr => { | |
| 651 | const zero = try c.builder.addConstant(.zero, try c.genType(ty)); | |
| 652 | const operand = try c.genExpr(data.un); | |
| 653 | return c.addBin(.cmp_ne, zero, operand, ty); | |
| 654 | }, | |
| 655 | .pre_inc_expr => { | |
| 656 | const operand = try c.genLval(data.un); | |
| 657 | const val = try c.addUn(.load, operand, ty); | |
| 658 | const one = try c.builder.addConstant(.one, try c.genType(ty)); | |
| 659 | const plus_one = try c.addBin(.add, val, one, ty); | |
| 583 | const operand = try c.genLval(un.operand); | |
| 584 | return c.addUn(.load, operand, un.qt); | |
| 585 | }, | |
| 586 | .plus_expr => |un| return c.genExpr(un.operand), | |
| 587 | .negate_expr => |un| { | |
| 588 | const zero = try c.builder.addConstant(.zero, try c.genType(un.qt)); | |
| 589 | const operand = try c.genExpr(un.operand); | |
| 590 | return c.addBin(.sub, zero, operand, un.qt); | |
| 591 | }, | |
| 592 | .bit_not_expr => |un| { | |
| 593 | const operand = try c.genExpr(un.operand); | |
| 594 | return c.addUn(.bit_not, operand, un.qt); | |
| 595 | }, | |
| 596 | .bool_not_expr => |un| { | |
| 597 | const zero = try c.builder.addConstant(.zero, try c.genType(un.qt)); | |
| 598 | const operand = try c.genExpr(un.operand); | |
| 599 | return c.addBin(.cmp_ne, zero, operand, un.qt); | |
| 600 | }, | |
| 601 | .pre_inc_expr => |un| { | |
| 602 | const operand = try c.genLval(un.operand); | |
| 603 | const val = try c.addUn(.load, operand, un.qt); | |
| 604 | const one = try c.builder.addConstant(.one, try c.genType(un.qt)); | |
| 605 | const plus_one = try c.addBin(.add, val, one, un.qt); | |
| 660 | 606 | try c.builder.addStore(operand, plus_one); |
| 661 | 607 | return plus_one; |
| 662 | 608 | }, |
| 663 | .pre_dec_expr => { | |
| 664 | const operand = try c.genLval(data.un); | |
| 665 | const val = try c.addUn(.load, operand, ty); | |
| 666 | const one = try c.builder.addConstant(.one, try c.genType(ty)); | |
| 667 | const plus_one = try c.addBin(.sub, val, one, ty); | |
| 609 | .pre_dec_expr => |un| { | |
| 610 | const operand = try c.genLval(un.operand); | |
| 611 | const val = try c.addUn(.load, operand, un.qt); | |
| 612 | const one = try c.builder.addConstant(.one, try c.genType(un.qt)); | |
| 613 | const plus_one = try c.addBin(.sub, val, one, un.qt); | |
| 668 | 614 | try c.builder.addStore(operand, plus_one); |
| 669 | 615 | return plus_one; |
| 670 | 616 | }, |
| 671 | .post_inc_expr => { | |
| 672 | const operand = try c.genLval(data.un); | |
| 673 | const val = try c.addUn(.load, operand, ty); | |
| 674 | const one = try c.builder.addConstant(.one, try c.genType(ty)); | |
| 675 | const plus_one = try c.addBin(.add, val, one, ty); | |
| 617 | .post_inc_expr => |un| { | |
| 618 | const operand = try c.genLval(un.operand); | |
| 619 | const val = try c.addUn(.load, operand, un.qt); | |
| 620 | const one = try c.builder.addConstant(.one, try c.genType(un.qt)); | |
| 621 | const plus_one = try c.addBin(.add, val, one, un.qt); | |
| 676 | 622 | try c.builder.addStore(operand, plus_one); |
| 677 | 623 | return val; |
| 678 | 624 | }, |
| 679 | .post_dec_expr => { | |
| 680 | const operand = try c.genLval(data.un); | |
| 681 | const val = try c.addUn(.load, operand, ty); | |
| 682 | const one = try c.builder.addConstant(.one, try c.genType(ty)); | |
| 683 | const plus_one = try c.addBin(.sub, val, one, ty); | |
| 625 | .post_dec_expr => |un| { | |
| 626 | const operand = try c.genLval(un.operand); | |
| 627 | const val = try c.addUn(.load, operand, un.qt); | |
| 628 | const one = try c.builder.addConstant(.one, try c.genType(un.qt)); | |
| 629 | const plus_one = try c.addBin(.sub, val, one, un.qt); | |
| 684 | 630 | try c.builder.addStore(operand, plus_one); |
| 685 | 631 | return val; |
| 686 | 632 | }, |
| 687 | .paren_expr => return c.genExpr(data.un), | |
| 633 | .paren_expr => |un| return c.genExpr(un.operand), | |
| 688 | 634 | .decl_ref_expr => unreachable, // Lval expression. |
| 689 | .explicit_cast, .implicit_cast => switch (data.cast.kind) { | |
| 690 | .no_op => return c.genExpr(data.cast.operand), | |
| 635 | .cast => |cast| switch (cast.kind) { | |
| 636 | .no_op => return c.genExpr(cast.operand), | |
| 691 | 637 | .to_void => { |
| 692 | _ = try c.genExpr(data.cast.operand); | |
| 638 | _ = try c.genExpr(cast.operand); | |
| 693 | 639 | return .none; |
| 694 | 640 | }, |
| 695 | 641 | .lval_to_rval => { |
| 696 | const operand = try c.genLval(data.cast.operand); | |
| 697 | return c.addUn(.load, operand, ty); | |
| 642 | const operand = try c.genLval(cast.operand); | |
| 643 | return c.addUn(.load, operand, cast.qt); | |
| 698 | 644 | }, |
| 699 | 645 | .function_to_pointer, .array_to_pointer => { |
| 700 | return c.genLval(data.cast.operand); | |
| 646 | return c.genLval(cast.operand); | |
| 701 | 647 | }, |
| 702 | 648 | .int_cast => { |
| 703 | const operand = try c.genExpr(data.cast.operand); | |
| 704 | const src_ty = c.node_ty[@intFromEnum(data.cast.operand)]; | |
| 705 | const src_bits = src_ty.bitSizeof(c.comp).?; | |
| 706 | const dest_bits = ty.bitSizeof(c.comp).?; | |
| 649 | const operand = try c.genExpr(cast.operand); | |
| 650 | const src_qt = cast.operand.qt(c.tree); | |
| 651 | const src_bits = src_qt.bitSizeof(c.comp); | |
| 652 | const dest_bits = cast.qt.bitSizeof(c.comp); | |
| 707 | 653 | if (src_bits == dest_bits) { |
| 708 | 654 | return operand; |
| 709 | 655 | } else if (src_bits < dest_bits) { |
| 710 | if (src_ty.isUnsignedInt(c.comp)) | |
| 711 | return c.addUn(.zext, operand, ty) | |
| 656 | if (src_qt.signedness(c.comp) == .unsigned) | |
| 657 | return c.addUn(.zext, operand, cast.qt) | |
| 712 | 658 | else |
| 713 | return c.addUn(.sext, operand, ty); | |
| 659 | return c.addUn(.sext, operand, cast.qt); | |
| 714 | 660 | } else { |
| 715 | return c.addUn(.trunc, operand, ty); | |
| 661 | return c.addUn(.trunc, operand, cast.qt); | |
| 716 | 662 | } |
| 717 | 663 | }, |
| 718 | 664 | .bool_to_int => { |
| 719 | const operand = try c.genExpr(data.cast.operand); | |
| 720 | return c.addUn(.zext, operand, ty); | |
| 665 | const operand = try c.genExpr(cast.operand); | |
| 666 | return c.addUn(.zext, operand, cast.qt); | |
| 721 | 667 | }, |
| 722 | 668 | .pointer_to_bool, .int_to_bool, .float_to_bool => { |
| 723 | const lhs = try c.genExpr(data.cast.operand); | |
| 724 | const rhs = try c.builder.addConstant(.zero, try c.genType(c.node_ty[@intFromEnum(node)])); | |
| 669 | const lhs = try c.genExpr(cast.operand); | |
| 670 | const rhs = try c.builder.addConstant(.zero, try c.genType(cast.qt)); | |
| 725 | 671 | return c.builder.addInst(.cmp_ne, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, .i1); |
| 726 | 672 | }, |
| 727 | 673 | .bitcast, |
| ... | ... | @@ -743,40 +689,42 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 743 | 689 | .null_to_pointer, |
| 744 | 690 | .union_cast, |
| 745 | 691 | .vector_splat, |
| 746 | => return c.fail("TODO CodeGen gen CastKind {}\n", .{data.cast.kind}), | |
| 692 | .atomic_to_non_atomic, | |
| 693 | .non_atomic_to_atomic, | |
| 694 | => return c.fail("TODO CodeGen gen CastKind {}\n", .{cast.kind}), | |
| 747 | 695 | }, |
| 748 | .binary_cond_expr => { | |
| 749 | if (c.tree.value_map.get(data.if3.cond)) |cond| { | |
| 696 | .binary_cond_expr => |conditional| { | |
| 697 | if (c.tree.value_map.get(conditional.cond)) |cond| { | |
| 750 | 698 | if (cond.toBool(c.comp)) { |
| 751 | c.cond_dummy_ref = try c.genExpr(data.if3.cond); | |
| 752 | return c.genExpr(c.tree.data[data.if3.body]); // then | |
| 699 | c.cond_dummy_ref = try c.genExpr(conditional.cond); | |
| 700 | return c.genExpr(conditional.then_expr); | |
| 753 | 701 | } else { |
| 754 | return c.genExpr(c.tree.data[data.if3.body + 1]); // else | |
| 702 | return c.genExpr(conditional.else_expr); | |
| 755 | 703 | } |
| 756 | 704 | } |
| 757 | 705 | |
| 758 | 706 | const then_label = try c.builder.makeLabel("ternary.then"); |
| 759 | 707 | const else_label = try c.builder.makeLabel("ternary.else"); |
| 760 | 708 | const end_label = try c.builder.makeLabel("ternary.end"); |
| 761 | const cond_ty = c.node_ty[@intFromEnum(data.if3.cond)]; | |
| 709 | const cond_qt = conditional.cond.qt(c.tree); | |
| 762 | 710 | { |
| 763 | 711 | const old_cond_dummy_ty = c.cond_dummy_ty; |
| 764 | 712 | defer c.cond_dummy_ty = old_cond_dummy_ty; |
| 765 | c.cond_dummy_ty = try c.genType(cond_ty); | |
| 713 | c.cond_dummy_ty = try c.genType(cond_qt); | |
| 766 | 714 | |
| 767 | try c.genBoolExpr(data.if3.cond, then_label, else_label); | |
| 715 | try c.genBoolExpr(conditional.cond, then_label, else_label); | |
| 768 | 716 | } |
| 769 | 717 | |
| 770 | 718 | try c.builder.startBlock(then_label); |
| 771 | 719 | if (c.builder.instructions.items(.ty)[@intFromEnum(c.cond_dummy_ref)] == .i1) { |
| 772 | c.cond_dummy_ref = try c.addUn(.zext, c.cond_dummy_ref, cond_ty); | |
| 720 | c.cond_dummy_ref = try c.addUn(.zext, c.cond_dummy_ref, cond_qt); | |
| 773 | 721 | } |
| 774 | const then_val = try c.genExpr(c.tree.data[data.if3.body]); // then | |
| 722 | const then_val = try c.genExpr(conditional.then_expr); | |
| 775 | 723 | try c.builder.addJump(end_label); |
| 776 | 724 | const then_exit = c.builder.current_label; |
| 777 | 725 | |
| 778 | 726 | try c.builder.startBlock(else_label); |
| 779 | const else_val = try c.genExpr(c.tree.data[data.if3.body + 1]); // else | |
| 727 | const else_val = try c.genExpr(conditional.else_expr); | |
| 780 | 728 | const else_exit = c.builder.current_label; |
| 781 | 729 | |
| 782 | 730 | try c.builder.startBlock(end_label); |
| ... | ... | @@ -785,15 +733,15 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 785 | 733 | .{ .value = then_val, .label = then_exit }, |
| 786 | 734 | .{ .value = else_val, .label = else_exit }, |
| 787 | 735 | }; |
| 788 | return c.builder.addPhi(&phi_buf, try c.genType(ty)); | |
| 736 | return c.builder.addPhi(&phi_buf, try c.genType(conditional.qt)); | |
| 789 | 737 | }, |
| 790 | 738 | .cond_dummy_expr => return c.cond_dummy_ref, |
| 791 | .cond_expr => { | |
| 792 | if (c.tree.value_map.get(data.if3.cond)) |cond| { | |
| 739 | .cond_expr => |conditional| { | |
| 740 | if (c.tree.value_map.get(conditional.cond)) |cond| { | |
| 793 | 741 | if (cond.toBool(c.comp)) { |
| 794 | return c.genExpr(c.tree.data[data.if3.body]); // then | |
| 742 | return c.genExpr(conditional.then_expr); | |
| 795 | 743 | } else { |
| 796 | return c.genExpr(c.tree.data[data.if3.body + 1]); // else | |
| 744 | return c.genExpr(conditional.else_expr); | |
| 797 | 745 | } |
| 798 | 746 | } |
| 799 | 747 | |
| ... | ... | @@ -801,15 +749,15 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 801 | 749 | const else_label = try c.builder.makeLabel("ternary.else"); |
| 802 | 750 | const end_label = try c.builder.makeLabel("ternary.end"); |
| 803 | 751 | |
| 804 | try c.genBoolExpr(data.if3.cond, then_label, else_label); | |
| 752 | try c.genBoolExpr(conditional.cond, then_label, else_label); | |
| 805 | 753 | |
| 806 | 754 | try c.builder.startBlock(then_label); |
| 807 | const then_val = try c.genExpr(c.tree.data[data.if3.body]); // then | |
| 755 | const then_val = try c.genExpr(conditional.then_expr); | |
| 808 | 756 | try c.builder.addJump(end_label); |
| 809 | 757 | const then_exit = c.builder.current_label; |
| 810 | 758 | |
| 811 | 759 | try c.builder.startBlock(else_label); |
| 812 | const else_val = try c.genExpr(c.tree.data[data.if3.body + 1]); // else | |
| 760 | const else_val = try c.genExpr(conditional.else_expr); | |
| 813 | 761 | const else_exit = c.builder.current_label; |
| 814 | 762 | |
| 815 | 763 | try c.builder.startBlock(end_label); |
| ... | ... | @@ -818,22 +766,15 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 818 | 766 | .{ .value = then_val, .label = then_exit }, |
| 819 | 767 | .{ .value = else_val, .label = else_exit }, |
| 820 | 768 | }; |
| 821 | return c.builder.addPhi(&phi_buf, try c.genType(ty)); | |
| 822 | }, | |
| 823 | .call_expr_one => if (data.bin.rhs == .none) { | |
| 824 | return c.genCall(data.bin.lhs, &.{}, ty); | |
| 825 | } else { | |
| 826 | return c.genCall(data.bin.lhs, &.{data.bin.rhs}, ty); | |
| 827 | }, | |
| 828 | .call_expr => { | |
| 829 | return c.genCall(c.tree.data[data.range.start], c.tree.data[data.range.start + 1 .. data.range.end], ty); | |
| 769 | return c.builder.addPhi(&phi_buf, try c.genType(conditional.qt)); | |
| 830 | 770 | }, |
| 831 | .bool_or_expr => { | |
| 832 | if (c.tree.value_map.get(data.bin.lhs)) |lhs| { | |
| 771 | .call_expr => |call| return c.genCall(call), | |
| 772 | .bool_or_expr => |bin| { | |
| 773 | if (c.tree.value_map.get(bin.lhs)) |lhs| { | |
| 833 | 774 | if (!lhs.toBool(c.comp)) { |
| 834 | return c.builder.addConstant(.one, try c.genType(ty)); | |
| 775 | return c.builder.addConstant(.one, try c.genType(bin.qt)); | |
| 835 | 776 | } |
| 836 | return c.genExpr(data.bin.rhs); | |
| 777 | return c.genExpr(bin.rhs); | |
| 837 | 778 | } |
| 838 | 779 | |
| 839 | 780 | const false_label = try c.builder.makeLabel("bool_false"); |
| ... | ... | @@ -846,22 +787,22 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 846 | 787 | const phi_nodes_top = c.phi_nodes.items.len; |
| 847 | 788 | defer c.phi_nodes.items.len = phi_nodes_top; |
| 848 | 789 | |
| 849 | try c.genBoolExpr(data.bin.lhs, exit_label, false_label); | |
| 790 | try c.genBoolExpr(bin.lhs, exit_label, false_label); | |
| 850 | 791 | |
| 851 | 792 | try c.builder.startBlock(false_label); |
| 852 | try c.genBoolExpr(data.bin.rhs, exit_label, exit_label); | |
| 793 | try c.genBoolExpr(bin.rhs, exit_label, exit_label); | |
| 853 | 794 | |
| 854 | 795 | try c.builder.startBlock(exit_label); |
| 855 | 796 | |
| 856 | 797 | const phi = try c.builder.addPhi(c.phi_nodes.items[phi_nodes_top..], .i1); |
| 857 | return c.addUn(.zext, phi, ty); | |
| 798 | return c.addUn(.zext, phi, bin.qt); | |
| 858 | 799 | }, |
| 859 | .bool_and_expr => { | |
| 860 | if (c.tree.value_map.get(data.bin.lhs)) |lhs| { | |
| 800 | .bool_and_expr => |bin| { | |
| 801 | if (c.tree.value_map.get(bin.lhs)) |lhs| { | |
| 861 | 802 | if (!lhs.toBool(c.comp)) { |
| 862 | return c.builder.addConstant(.zero, try c.genType(ty)); | |
| 803 | return c.builder.addConstant(.zero, try c.genType(bin.qt)); | |
| 863 | 804 | } |
| 864 | return c.genExpr(data.bin.rhs); | |
| 805 | return c.genExpr(bin.rhs); | |
| 865 | 806 | } |
| 866 | 807 | |
| 867 | 808 | const true_label = try c.builder.makeLabel("bool_true"); |
| ... | ... | @@ -874,102 +815,73 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 874 | 815 | const phi_nodes_top = c.phi_nodes.items.len; |
| 875 | 816 | defer c.phi_nodes.items.len = phi_nodes_top; |
| 876 | 817 | |
| 877 | try c.genBoolExpr(data.bin.lhs, true_label, exit_label); | |
| 818 | try c.genBoolExpr(bin.lhs, true_label, exit_label); | |
| 878 | 819 | |
| 879 | 820 | try c.builder.startBlock(true_label); |
| 880 | try c.genBoolExpr(data.bin.rhs, exit_label, exit_label); | |
| 821 | try c.genBoolExpr(bin.rhs, exit_label, exit_label); | |
| 881 | 822 | |
| 882 | 823 | try c.builder.startBlock(exit_label); |
| 883 | 824 | |
| 884 | 825 | const phi = try c.builder.addPhi(c.phi_nodes.items[phi_nodes_top..], .i1); |
| 885 | return c.addUn(.zext, phi, ty); | |
| 826 | return c.addUn(.zext, phi, bin.qt); | |
| 886 | 827 | }, |
| 887 | .builtin_choose_expr => { | |
| 888 | const cond = c.tree.value_map.get(data.if3.cond).?; | |
| 828 | .builtin_choose_expr => |conditional| { | |
| 829 | const cond = c.tree.value_map.get(conditional.cond).?; | |
| 889 | 830 | if (cond.toBool(c.comp)) { |
| 890 | return c.genExpr(c.tree.data[data.if3.body]); | |
| 831 | return c.genExpr(conditional.then_expr); | |
| 891 | 832 | } else { |
| 892 | return c.genExpr(c.tree.data[data.if3.body + 1]); | |
| 833 | return c.genExpr(conditional.else_expr); | |
| 893 | 834 | } |
| 894 | 835 | }, |
| 895 | .generic_expr_one => { | |
| 896 | const index = @intFromEnum(data.bin.rhs); | |
| 897 | switch (c.node_tag[index]) { | |
| 898 | .generic_association_expr, .generic_default_expr => { | |
| 899 | return c.genExpr(c.node_data[index].un); | |
| 836 | .generic_expr => |generic| { | |
| 837 | const chosen = generic.chosen.get(c.tree); | |
| 838 | switch (chosen) { | |
| 839 | .generic_association_expr => |assoc| { | |
| 840 | return c.genExpr(assoc.expr); | |
| 900 | 841 | }, |
| 901 | else => unreachable, | |
| 902 | } | |
| 903 | }, | |
| 904 | .generic_expr => { | |
| 905 | const index = @intFromEnum(c.tree.data[data.range.start + 1]); | |
| 906 | switch (c.node_tag[index]) { | |
| 907 | .generic_association_expr, .generic_default_expr => { | |
| 908 | return c.genExpr(c.node_data[index].un); | |
| 842 | .generic_default_expr => |default| { | |
| 843 | return c.genExpr(default.expr); | |
| 909 | 844 | }, |
| 910 | 845 | else => unreachable, |
| 911 | 846 | } |
| 912 | 847 | }, |
| 913 | 848 | .generic_association_expr, .generic_default_expr => unreachable, |
| 914 | .stmt_expr => switch (c.node_tag[@intFromEnum(data.un)]) { | |
| 915 | .compound_stmt_two => { | |
| 916 | const old_sym_len = c.symbols.items.len; | |
| 917 | c.symbols.items.len = old_sym_len; | |
| 918 | ||
| 919 | const stmt_data = c.node_data[@intFromEnum(data.un)]; | |
| 920 | if (stmt_data.bin.rhs == .none) return c.genExpr(stmt_data.bin.lhs); | |
| 921 | try c.genStmt(stmt_data.bin.lhs); | |
| 922 | return c.genExpr(stmt_data.bin.rhs); | |
| 923 | }, | |
| 924 | .compound_stmt => { | |
| 925 | const old_sym_len = c.symbols.items.len; | |
| 926 | c.symbols.items.len = old_sym_len; | |
| 849 | .stmt_expr => |un| { | |
| 850 | const compound_stmt = un.operand.get(c.tree).compound_stmt; | |
| 927 | 851 | |
| 928 | const stmt_data = c.node_data[@intFromEnum(data.un)]; | |
| 929 | for (c.tree.data[stmt_data.range.start .. stmt_data.range.end - 1]) |stmt| try c.genStmt(stmt); | |
| 930 | return c.genExpr(c.tree.data[stmt_data.range.end]); | |
| 931 | }, | |
| 932 | else => unreachable, | |
| 933 | }, | |
| 934 | .builtin_call_expr_one => { | |
| 935 | const name = c.tree.tokSlice(data.decl.name); | |
| 936 | const builtin = c.comp.builtins.lookup(name).builtin; | |
| 937 | if (data.decl.node == .none) { | |
| 938 | return c.genBuiltinCall(builtin, &.{}, ty); | |
| 939 | } else { | |
| 940 | return c.genBuiltinCall(builtin, &.{data.decl.node}, ty); | |
| 941 | } | |
| 852 | const old_sym_len = c.symbols.items.len; | |
| 853 | c.symbols.items.len = old_sym_len; | |
| 854 | ||
| 855 | for (compound_stmt.body[0..compound_stmt.body.len -| 1]) |stmt| try c.genStmt(stmt); | |
| 856 | return c.genExpr(compound_stmt.body[compound_stmt.body.len - 1]); | |
| 942 | 857 | }, |
| 943 | .builtin_call_expr => { | |
| 944 | const name_node_idx = c.tree.data[data.range.start]; | |
| 945 | const name = c.tree.tokSlice(@intFromEnum(name_node_idx)); | |
| 858 | .builtin_call_expr => |call| { | |
| 859 | const name = c.tree.tokSlice(call.builtin_tok); | |
| 946 | 860 | const builtin = c.comp.builtins.lookup(name).builtin; |
| 947 | return c.genBuiltinCall(builtin, c.tree.data[data.range.start + 1 .. data.range.end], ty); | |
| 861 | return c.genBuiltinCall(builtin, call.args, call.qt); | |
| 948 | 862 | }, |
| 949 | 863 | .addr_of_label, |
| 950 | 864 | .imag_expr, |
| 951 | 865 | .real_expr, |
| 952 | 866 | .sizeof_expr, |
| 953 | .special_builtin_call_one, | |
| 954 | => return c.fail("TODO CodeGen.genExpr {}\n", .{c.node_tag[@intFromEnum(node)]}), | |
| 867 | => return c.fail("TODO CodeGen.genExpr {s}\n", .{@tagName(node)}), | |
| 955 | 868 | else => unreachable, // Not an expression. |
| 956 | 869 | } |
| 957 | 870 | return .none; |
| 958 | 871 | } |
| 959 | 872 | |
| 960 | fn genLval(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { | |
| 961 | std.debug.assert(node != .none); | |
| 962 | assert(c.tree.isLval(node)); | |
| 963 | const data = c.node_data[@intFromEnum(node)]; | |
| 964 | switch (c.node_tag[@intFromEnum(node)]) { | |
| 873 | fn genLval(c: *CodeGen, node_index: Node.Index) Error!Ir.Ref { | |
| 874 | assert(c.tree.isLval(node_index)); | |
| 875 | const node = node_index.get(c.tree); | |
| 876 | switch (node) { | |
| 965 | 877 | .string_literal_expr => { |
| 966 | const val = c.tree.value_map.get(node).?; | |
| 878 | const val = c.tree.value_map.get(node_index).?; | |
| 967 | 879 | return c.builder.addConstant(val.ref(), .ptr); |
| 968 | 880 | }, |
| 969 | .paren_expr => return c.genLval(data.un), | |
| 970 | .decl_ref_expr => { | |
| 971 | const slice = c.tree.tokSlice(data.decl_ref); | |
| 972 | const name = try StrInt.intern(c.comp, slice); | |
| 881 | .paren_expr => |un| return c.genLval(un.operand), | |
| 882 | .decl_ref_expr => |decl_ref| { | |
| 883 | const slice = c.tree.tokSlice(decl_ref.name_tok); | |
| 884 | const name = try c.comp.internString(slice); | |
| 973 | 885 | var i = c.symbols.items.len; |
| 974 | 886 | while (i > 0) { |
| 975 | 887 | i -= 1; |
| ... | ... | @@ -983,160 +895,159 @@ fn genLval(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { |
| 983 | 895 | try c.builder.instructions.append(c.builder.gpa, .{ .tag = .symbol, .data = .{ .label = duped_name }, .ty = .ptr }); |
| 984 | 896 | return ref; |
| 985 | 897 | }, |
| 986 | .deref_expr => return c.genExpr(data.un), | |
| 987 | .compound_literal_expr => { | |
| 988 | const ty = c.node_ty[@intFromEnum(node)]; | |
| 989 | const size: u32 = @intCast(ty.sizeof(c.comp).?); // TODO add error in parser | |
| 990 | const @"align" = ty.alignof(c.comp); | |
| 898 | .deref_expr => |un| return c.genExpr(un.operand), | |
| 899 | .compound_literal_expr => |literal| { | |
| 900 | if (literal.storage_class == .static or literal.thread_local) { | |
| 901 | return c.fail("TODO CodeGen.compound_literal_expr static or thread_local\n", .{}); | |
| 902 | } | |
| 903 | const size: u32 = @intCast(literal.qt.sizeof(c.comp)); // TODO add error in parser | |
| 904 | const @"align" = literal.qt.alignof(c.comp); | |
| 991 | 905 | const alloc = try c.builder.addAlloc(size, @"align"); |
| 992 | try c.genInitializer(alloc, ty, data.un); | |
| 906 | try c.genInitializer(alloc, literal.qt, literal.initializer); | |
| 993 | 907 | return alloc; |
| 994 | 908 | }, |
| 995 | .builtin_choose_expr => { | |
| 996 | const cond = c.tree.value_map.get(data.if3.cond).?; | |
| 909 | .builtin_choose_expr => |conditional| { | |
| 910 | const cond = c.tree.value_map.get(conditional.cond).?; | |
| 997 | 911 | if (cond.toBool(c.comp)) { |
| 998 | return c.genLval(c.tree.data[data.if3.body]); | |
| 912 | return c.genLval(conditional.then_expr); | |
| 999 | 913 | } else { |
| 1000 | return c.genLval(c.tree.data[data.if3.body + 1]); | |
| 914 | return c.genLval(conditional.else_expr); | |
| 1001 | 915 | } |
| 1002 | 916 | }, |
| 917 | .compound_assign_dummy_expr => { | |
| 918 | return c.compound_assign_dummy.?; | |
| 919 | }, | |
| 1003 | 920 | .member_access_expr, |
| 1004 | 921 | .member_access_ptr_expr, |
| 1005 | 922 | .array_access_expr, |
| 1006 | .static_compound_literal_expr, | |
| 1007 | .thread_local_compound_literal_expr, | |
| 1008 | .static_thread_local_compound_literal_expr, | |
| 1009 | => return c.fail("TODO CodeGen.genLval {}\n", .{c.node_tag[@intFromEnum(node)]}), | |
| 923 | => return c.fail("TODO CodeGen.genLval {s}\n", .{@tagName(node)}), | |
| 1010 | 924 | else => unreachable, // Not an lval expression. |
| 1011 | 925 | } |
| 1012 | 926 | } |
| 1013 | 927 | |
| 1014 | fn genBoolExpr(c: *CodeGen, base: NodeIndex, true_label: Ir.Ref, false_label: Ir.Ref) Error!void { | |
| 928 | fn genBoolExpr(c: *CodeGen, base: Node.Index, true_label: Ir.Ref, false_label: Ir.Ref) Error!void { | |
| 1015 | 929 | var node = base; |
| 1016 | while (true) switch (c.node_tag[@intFromEnum(node)]) { | |
| 1017 | .paren_expr => { | |
| 1018 | node = c.node_data[@intFromEnum(node)].un; | |
| 1019 | }, | |
| 930 | while (true) switch (node.get(c.tree)) { | |
| 931 | .paren_expr => |un| node = un.operand, | |
| 1020 | 932 | else => break, |
| 1021 | 933 | }; |
| 1022 | 934 | |
| 1023 | const data = c.node_data[@intFromEnum(node)]; | |
| 1024 | switch (c.node_tag[@intFromEnum(node)]) { | |
| 1025 | .bool_or_expr => { | |
| 1026 | if (c.tree.value_map.get(data.bin.lhs)) |lhs| { | |
| 935 | switch (node.get(c.tree)) { | |
| 936 | .bool_or_expr => |bin| { | |
| 937 | if (c.tree.value_map.get(bin.lhs)) |lhs| { | |
| 1027 | 938 | if (lhs.toBool(c.comp)) { |
| 1028 | 939 | if (true_label == c.bool_end_label) { |
| 1029 | 940 | return c.addBoolPhi(!c.bool_invert); |
| 1030 | 941 | } |
| 1031 | 942 | return c.builder.addJump(true_label); |
| 1032 | 943 | } |
| 1033 | return c.genBoolExpr(data.bin.rhs, true_label, false_label); | |
| 944 | return c.genBoolExpr(bin.rhs, true_label, false_label); | |
| 1034 | 945 | } |
| 1035 | 946 | |
| 1036 | 947 | const new_false_label = try c.builder.makeLabel("bool_false"); |
| 1037 | try c.genBoolExpr(data.bin.lhs, true_label, new_false_label); | |
| 948 | try c.genBoolExpr(bin.lhs, true_label, new_false_label); | |
| 1038 | 949 | try c.builder.startBlock(new_false_label); |
| 1039 | 950 | |
| 1040 | 951 | if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); |
| 1041 | return c.genBoolExpr(data.bin.rhs, true_label, false_label); | |
| 952 | return c.genBoolExpr(bin.rhs, true_label, false_label); | |
| 1042 | 953 | }, |
| 1043 | .bool_and_expr => { | |
| 1044 | if (c.tree.value_map.get(data.bin.lhs)) |lhs| { | |
| 954 | .bool_and_expr => |bin| { | |
| 955 | if (c.tree.value_map.get(bin.lhs)) |lhs| { | |
| 1045 | 956 | if (!lhs.toBool(c.comp)) { |
| 1046 | 957 | if (false_label == c.bool_end_label) { |
| 1047 | 958 | return c.addBoolPhi(c.bool_invert); |
| 1048 | 959 | } |
| 1049 | 960 | return c.builder.addJump(false_label); |
| 1050 | 961 | } |
| 1051 | return c.genBoolExpr(data.bin.rhs, true_label, false_label); | |
| 962 | return c.genBoolExpr(bin.rhs, true_label, false_label); | |
| 1052 | 963 | } |
| 1053 | 964 | |
| 1054 | 965 | const new_true_label = try c.builder.makeLabel("bool_true"); |
| 1055 | try c.genBoolExpr(data.bin.lhs, new_true_label, false_label); | |
| 966 | try c.genBoolExpr(bin.lhs, new_true_label, false_label); | |
| 1056 | 967 | try c.builder.startBlock(new_true_label); |
| 1057 | 968 | |
| 1058 | 969 | if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); |
| 1059 | return c.genBoolExpr(data.bin.rhs, true_label, false_label); | |
| 970 | return c.genBoolExpr(bin.rhs, true_label, false_label); | |
| 1060 | 971 | }, |
| 1061 | .bool_not_expr => { | |
| 972 | .bool_not_expr => |un| { | |
| 1062 | 973 | c.bool_invert = !c.bool_invert; |
| 1063 | 974 | defer c.bool_invert = !c.bool_invert; |
| 1064 | 975 | |
| 1065 | 976 | if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.zero, ty); |
| 1066 | return c.genBoolExpr(data.un, false_label, true_label); | |
| 977 | return c.genBoolExpr(un.operand, false_label, true_label); | |
| 1067 | 978 | }, |
| 1068 | .equal_expr => { | |
| 1069 | const cmp = try c.genComparison(node, .cmp_eq); | |
| 979 | .equal_expr => |bin| { | |
| 980 | const cmp = try c.genComparison(bin, .cmp_eq); | |
| 1070 | 981 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1071 | 982 | return c.addBranch(cmp, true_label, false_label); |
| 1072 | 983 | }, |
| 1073 | .not_equal_expr => { | |
| 1074 | const cmp = try c.genComparison(node, .cmp_ne); | |
| 984 | .not_equal_expr => |bin| { | |
| 985 | const cmp = try c.genComparison(bin, .cmp_ne); | |
| 1075 | 986 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1076 | 987 | return c.addBranch(cmp, true_label, false_label); |
| 1077 | 988 | }, |
| 1078 | .less_than_expr => { | |
| 1079 | const cmp = try c.genComparison(node, .cmp_lt); | |
| 989 | .less_than_expr => |bin| { | |
| 990 | const cmp = try c.genComparison(bin, .cmp_lt); | |
| 1080 | 991 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1081 | 992 | return c.addBranch(cmp, true_label, false_label); |
| 1082 | 993 | }, |
| 1083 | .less_than_equal_expr => { | |
| 1084 | const cmp = try c.genComparison(node, .cmp_lte); | |
| 994 | .less_than_equal_expr => |bin| { | |
| 995 | const cmp = try c.genComparison(bin, .cmp_lte); | |
| 1085 | 996 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1086 | 997 | return c.addBranch(cmp, true_label, false_label); |
| 1087 | 998 | }, |
| 1088 | .greater_than_expr => { | |
| 1089 | const cmp = try c.genComparison(node, .cmp_gt); | |
| 999 | .greater_than_expr => |bin| { | |
| 1000 | const cmp = try c.genComparison(bin, .cmp_gt); | |
| 1090 | 1001 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1091 | 1002 | return c.addBranch(cmp, true_label, false_label); |
| 1092 | 1003 | }, |
| 1093 | .greater_than_equal_expr => { | |
| 1094 | const cmp = try c.genComparison(node, .cmp_gte); | |
| 1004 | .greater_than_equal_expr => |bin| { | |
| 1005 | const cmp = try c.genComparison(bin, .cmp_gte); | |
| 1095 | 1006 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1096 | 1007 | return c.addBranch(cmp, true_label, false_label); |
| 1097 | 1008 | }, |
| 1098 | .explicit_cast, .implicit_cast => switch (data.cast.kind) { | |
| 1009 | .cast => |cast| switch (cast.kind) { | |
| 1099 | 1010 | .bool_to_int => { |
| 1100 | const operand = try c.genExpr(data.cast.operand); | |
| 1011 | const operand = try c.genExpr(cast.operand); | |
| 1101 | 1012 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = operand; |
| 1102 | 1013 | return c.addBranch(operand, true_label, false_label); |
| 1103 | 1014 | }, |
| 1104 | 1015 | else => {}, |
| 1105 | 1016 | }, |
| 1106 | .binary_cond_expr => { | |
| 1107 | if (c.tree.value_map.get(data.if3.cond)) |cond| { | |
| 1017 | .binary_cond_expr => |conditional| { | |
| 1018 | if (c.tree.value_map.get(conditional.cond)) |cond| { | |
| 1108 | 1019 | if (cond.toBool(c.comp)) { |
| 1109 | return c.genBoolExpr(c.tree.data[data.if3.body], true_label, false_label); // then | |
| 1020 | return c.genBoolExpr(conditional.then_expr, true_label, false_label); | |
| 1110 | 1021 | } else { |
| 1111 | return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else | |
| 1022 | return c.genBoolExpr(conditional.else_expr, true_label, false_label); | |
| 1112 | 1023 | } |
| 1113 | 1024 | } |
| 1114 | 1025 | |
| 1115 | 1026 | const new_false_label = try c.builder.makeLabel("ternary.else"); |
| 1116 | try c.genBoolExpr(data.if3.cond, true_label, new_false_label); | |
| 1027 | try c.genBoolExpr(conditional.cond, true_label, new_false_label); | |
| 1117 | 1028 | |
| 1118 | 1029 | try c.builder.startBlock(new_false_label); |
| 1119 | 1030 | if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); |
| 1120 | return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else | |
| 1031 | return c.genBoolExpr(conditional.else_expr, true_label, false_label); | |
| 1121 | 1032 | }, |
| 1122 | .cond_expr => { | |
| 1123 | if (c.tree.value_map.get(data.if3.cond)) |cond| { | |
| 1033 | .cond_expr => |conditional| { | |
| 1034 | if (c.tree.value_map.get(conditional.cond)) |cond| { | |
| 1124 | 1035 | if (cond.toBool(c.comp)) { |
| 1125 | return c.genBoolExpr(c.tree.data[data.if3.body], true_label, false_label); // then | |
| 1036 | return c.genBoolExpr(conditional.then_expr, true_label, false_label); | |
| 1126 | 1037 | } else { |
| 1127 | return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else | |
| 1038 | return c.genBoolExpr(conditional.else_expr, true_label, false_label); | |
| 1128 | 1039 | } |
| 1129 | 1040 | } |
| 1130 | 1041 | |
| 1131 | 1042 | const new_true_label = try c.builder.makeLabel("ternary.then"); |
| 1132 | 1043 | const new_false_label = try c.builder.makeLabel("ternary.else"); |
| 1133 | try c.genBoolExpr(data.if3.cond, new_true_label, new_false_label); | |
| 1044 | try c.genBoolExpr(conditional.cond, new_true_label, new_false_label); | |
| 1134 | 1045 | |
| 1135 | 1046 | try c.builder.startBlock(new_true_label); |
| 1136 | try c.genBoolExpr(c.tree.data[data.if3.body], true_label, false_label); // then | |
| 1047 | try c.genBoolExpr(conditional.then_expr, true_label, false_label); | |
| 1137 | 1048 | try c.builder.startBlock(new_false_label); |
| 1138 | 1049 | if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); |
| 1139 | return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else | |
| 1050 | return c.genBoolExpr(conditional.else_expr, true_label, false_label); | |
| 1140 | 1051 | }, |
| 1141 | 1052 | else => {}, |
| 1142 | 1053 | } |
| ... | ... | @@ -1157,46 +1068,43 @@ fn genBoolExpr(c: *CodeGen, base: NodeIndex, true_label: Ir.Ref, false_label: Ir |
| 1157 | 1068 | |
| 1158 | 1069 | // Assume int operand. |
| 1159 | 1070 | const lhs = try c.genExpr(node); |
| 1160 | const rhs = try c.builder.addConstant(.zero, try c.genType(c.node_ty[@intFromEnum(node)])); | |
| 1071 | const rhs = try c.builder.addConstant(.zero, try c.genType(node.qt(c.tree))); | |
| 1161 | 1072 | const cmp = try c.builder.addInst(.cmp_ne, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, .i1); |
| 1162 | 1073 | if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; |
| 1163 | 1074 | try c.addBranch(cmp, true_label, false_label); |
| 1164 | 1075 | } |
| 1165 | 1076 | |
| 1166 | fn genBuiltinCall(c: *CodeGen, builtin: Builtin, arg_nodes: []const NodeIndex, ty: Type) Error!Ir.Ref { | |
| 1077 | fn genBuiltinCall(c: *CodeGen, builtin: Builtin, arg_nodes: []const Node.Index, qt: QualType) Error!Ir.Ref { | |
| 1167 | 1078 | _ = arg_nodes; |
| 1168 | _ = ty; | |
| 1079 | _ = qt; | |
| 1169 | 1080 | return c.fail("TODO CodeGen.genBuiltinCall {s}\n", .{Builtin.nameFromTag(builtin.tag).span()}); |
| 1170 | 1081 | } |
| 1171 | 1082 | |
| 1172 | fn genCall(c: *CodeGen, fn_node: NodeIndex, arg_nodes: []const NodeIndex, ty: Type) Error!Ir.Ref { | |
| 1083 | fn genCall(c: *CodeGen, call: Node.Call) Error!Ir.Ref { | |
| 1173 | 1084 | // Detect direct calls. |
| 1174 | 1085 | const fn_ref = blk: { |
| 1175 | const data = c.node_data[@intFromEnum(fn_node)]; | |
| 1176 | if (c.node_tag[@intFromEnum(fn_node)] != .implicit_cast or data.cast.kind != .function_to_pointer) { | |
| 1177 | break :blk try c.genExpr(fn_node); | |
| 1086 | const callee = call.callee.get(c.tree); | |
| 1087 | if (callee != .cast or callee.cast.kind != .function_to_pointer) { | |
| 1088 | break :blk try c.genExpr(call.callee); | |
| 1178 | 1089 | } |
| 1179 | 1090 | |
| 1180 | var cur = @intFromEnum(data.cast.operand); | |
| 1181 | while (true) switch (c.node_tag[cur]) { | |
| 1182 | .paren_expr, .addr_of_expr, .deref_expr => { | |
| 1183 | cur = @intFromEnum(c.node_data[cur].un); | |
| 1184 | }, | |
| 1185 | .implicit_cast => { | |
| 1186 | const cast = c.node_data[cur].cast; | |
| 1091 | var cur = callee.cast.operand; | |
| 1092 | while (true) switch (cur.get(c.tree)) { | |
| 1093 | .paren_expr, .addr_of_expr, .deref_expr => |un| cur = un.operand, | |
| 1094 | .cast => |cast| { | |
| 1187 | 1095 | if (cast.kind != .function_to_pointer) { |
| 1188 | break :blk try c.genExpr(fn_node); | |
| 1096 | break :blk try c.genExpr(call.callee); | |
| 1189 | 1097 | } |
| 1190 | cur = @intFromEnum(cast.operand); | |
| 1098 | cur = cast.operand; | |
| 1191 | 1099 | }, |
| 1192 | .decl_ref_expr => { | |
| 1193 | const slice = c.tree.tokSlice(c.node_data[cur].decl_ref); | |
| 1194 | const name = try StrInt.intern(c.comp, slice); | |
| 1100 | .decl_ref_expr => |decl_ref| { | |
| 1101 | const slice = c.tree.tokSlice(decl_ref.name_tok); | |
| 1102 | const name = try c.comp.internString(slice); | |
| 1195 | 1103 | var i = c.symbols.items.len; |
| 1196 | 1104 | while (i > 0) { |
| 1197 | 1105 | i -= 1; |
| 1198 | 1106 | if (c.symbols.items[i].name == name) { |
| 1199 | break :blk try c.genExpr(fn_node); | |
| 1107 | break :blk try c.genExpr(call.callee); | |
| 1200 | 1108 | } |
| 1201 | 1109 | } |
| 1202 | 1110 | |
| ... | ... | @@ -1205,56 +1113,55 @@ fn genCall(c: *CodeGen, fn_node: NodeIndex, arg_nodes: []const NodeIndex, ty: Ty |
| 1205 | 1113 | try c.builder.instructions.append(c.builder.gpa, .{ .tag = .symbol, .data = .{ .label = duped_name }, .ty = .ptr }); |
| 1206 | 1114 | break :blk ref; |
| 1207 | 1115 | }, |
| 1208 | else => break :blk try c.genExpr(fn_node), | |
| 1116 | else => break :blk try c.genExpr(call.callee), | |
| 1209 | 1117 | }; |
| 1210 | 1118 | }; |
| 1211 | 1119 | |
| 1212 | const args = try c.builder.arena.allocator().alloc(Ir.Ref, arg_nodes.len); | |
| 1213 | for (arg_nodes, args) |node, *arg| { | |
| 1120 | const args = try c.builder.arena.allocator().alloc(Ir.Ref, call.args.len); | |
| 1121 | for (call.args, args) |node, *arg| { | |
| 1214 | 1122 | // TODO handle calling convention here |
| 1215 | 1123 | arg.* = try c.genExpr(node); |
| 1216 | 1124 | } |
| 1217 | 1125 | // TODO handle variadic call |
| 1218 | const call = try c.builder.arena.allocator().create(Ir.Inst.Call); | |
| 1219 | call.* = .{ | |
| 1126 | const call_inst = try c.builder.arena.allocator().create(Ir.Inst.Call); | |
| 1127 | call_inst.* = .{ | |
| 1220 | 1128 | .func = fn_ref, |
| 1221 | 1129 | .args_len = @intCast(args.len), |
| 1222 | 1130 | .args_ptr = args.ptr, |
| 1223 | 1131 | }; |
| 1224 | return c.builder.addInst(.call, .{ .call = call }, try c.genType(ty)); | |
| 1132 | return c.builder.addInst(.call, .{ .call = call_inst }, try c.genType(call.qt)); | |
| 1225 | 1133 | } |
| 1226 | 1134 | |
| 1227 | fn genCompoundAssign(c: *CodeGen, node: NodeIndex, tag: Ir.Inst.Tag) Error!Ir.Ref { | |
| 1228 | const bin = c.node_data[@intFromEnum(node)].bin; | |
| 1229 | const ty = c.node_ty[@intFromEnum(node)]; | |
| 1230 | const rhs = try c.genExpr(bin.rhs); | |
| 1135 | fn genCompoundAssign(c: *CodeGen, bin: Node.Binary) Error!Ir.Ref { | |
| 1231 | 1136 | const lhs = try c.genLval(bin.lhs); |
| 1232 | const res = try c.addBin(tag, lhs, rhs, ty); | |
| 1233 | try c.builder.addStore(lhs, res); | |
| 1234 | return res; | |
| 1137 | ||
| 1138 | const old_dummy = c.compound_assign_dummy; | |
| 1139 | defer c.compound_assign_dummy = old_dummy; | |
| 1140 | c.compound_assign_dummy = lhs; | |
| 1141 | ||
| 1142 | const rhs = try c.genExpr(bin.rhs); | |
| 1143 | try c.builder.addStore(lhs, rhs); | |
| 1144 | return rhs; | |
| 1235 | 1145 | } |
| 1236 | 1146 | |
| 1237 | fn genBinOp(c: *CodeGen, node: NodeIndex, tag: Ir.Inst.Tag) Error!Ir.Ref { | |
| 1238 | const bin = c.node_data[@intFromEnum(node)].bin; | |
| 1239 | const ty = c.node_ty[@intFromEnum(node)]; | |
| 1147 | fn genBinOp(c: *CodeGen, bin: Node.Binary, tag: Ir.Inst.Tag) Error!Ir.Ref { | |
| 1240 | 1148 | const lhs = try c.genExpr(bin.lhs); |
| 1241 | 1149 | const rhs = try c.genExpr(bin.rhs); |
| 1242 | return c.addBin(tag, lhs, rhs, ty); | |
| 1150 | return c.addBin(tag, lhs, rhs, bin.qt); | |
| 1243 | 1151 | } |
| 1244 | 1152 | |
| 1245 | fn genComparison(c: *CodeGen, node: NodeIndex, tag: Ir.Inst.Tag) Error!Ir.Ref { | |
| 1246 | const bin = c.node_data[@intFromEnum(node)].bin; | |
| 1153 | fn genComparison(c: *CodeGen, bin: Node.Binary, tag: Ir.Inst.Tag) Error!Ir.Ref { | |
| 1247 | 1154 | const lhs = try c.genExpr(bin.lhs); |
| 1248 | 1155 | const rhs = try c.genExpr(bin.rhs); |
| 1249 | 1156 | |
| 1250 | 1157 | return c.builder.addInst(tag, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, .i1); |
| 1251 | 1158 | } |
| 1252 | 1159 | |
| 1253 | fn genPtrArithmetic(c: *CodeGen, ptr: Ir.Ref, offset: Ir.Ref, offset_ty: Type, ty: Type) Error!Ir.Ref { | |
| 1160 | fn genPtrArithmetic(c: *CodeGen, ptr: Ir.Ref, offset: Ir.Ref, offset_ty: QualType, qt: QualType) Error!Ir.Ref { | |
| 1254 | 1161 | // TODO consider adding a getelemptr instruction |
| 1255 | const size = ty.elemType().sizeof(c.comp).?; | |
| 1162 | const size = qt.childType(c.comp).sizeof(c.comp); | |
| 1256 | 1163 | if (size == 1) { |
| 1257 | return c.builder.addInst(.add, .{ .bin = .{ .lhs = ptr, .rhs = offset } }, try c.genType(ty)); | |
| 1164 | return c.builder.addInst(.add, .{ .bin = .{ .lhs = ptr, .rhs = offset } }, try c.genType(qt)); | |
| 1258 | 1165 | } |
| 1259 | 1166 | |
| 1260 | 1167 | 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 |
| 1262 | 1169 | return c.addBin(.add, ptr, offset_inst, offset_ty); |
| 1263 | 1170 | } |
| 1264 | 1171 | |
| 1265 | fn genInitializer(c: *CodeGen, ptr: Ir.Ref, dest_ty: Type, initializer: NodeIndex) Error!void { | |
| 1266 | std.debug.assert(initializer != .none); | |
| 1267 | switch (c.node_tag[@intFromEnum(initializer)]) { | |
| 1268 | .array_init_expr_two, | |
| 1172 | fn genInitializer(c: *CodeGen, ptr: Ir.Ref, dest_ty: QualType, initializer: Node.Index) Error!void { | |
| 1173 | const node = initializer.get(c.tree); | |
| 1174 | switch (node) { | |
| 1269 | 1175 | .array_init_expr, |
| 1270 | .struct_init_expr_two, | |
| 1271 | 1176 | .struct_init_expr, |
| 1272 | 1177 | .union_init_expr, |
| 1273 | 1178 | .array_filler_expr, |
| 1274 | 1179 | .default_init_expr, |
| 1275 | => return c.fail("TODO CodeGen.genInitializer {}\n", .{c.node_tag[@intFromEnum(initializer)]}), | |
| 1180 | => return c.fail("TODO CodeGen.genInitializer {s}\n", .{@tagName(node)}), | |
| 1276 | 1181 | .string_literal_expr => { |
| 1277 | 1182 | const val = c.tree.value_map.get(initializer).?; |
| 1278 | 1183 | const str_ptr = try c.builder.addConstant(val.ref(), .ptr); |
| 1279 | if (dest_ty.isArray()) { | |
| 1184 | if (dest_ty.is(c.comp, .array)) { | |
| 1280 | 1185 | return c.fail("TODO memcpy\n", .{}); |
| 1281 | 1186 | } else { |
| 1282 | 1187 | try c.builder.addStore(ptr, str_ptr); |
| ... | ... | @@ -1289,7 +1194,7 @@ fn genInitializer(c: *CodeGen, ptr: Ir.Ref, dest_ty: Type, initializer: NodeInde |
| 1289 | 1194 | } |
| 1290 | 1195 | } |
| 1291 | 1196 | |
| 1292 | fn genVar(c: *CodeGen, decl: NodeIndex) Error!void { | |
| 1197 | fn genVar(c: *CodeGen, decl: Node.Variable) Error!void { | |
| 1293 | 1198 | _ = decl; |
| 1294 | 1199 | return c.fail("TODO CodeGen.genVar\n", .{}); |
| 1295 | 1200 | } |
lib/compiler/aro/aro/Compilation.zig+1258-809| ... | ... | @@ -1,27 +1,34 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const Allocator = mem.Allocator; | |
| 3 | 2 | const assert = std.debug.assert; |
| 4 | 3 | const EpochSeconds = std.time.epoch.EpochSeconds; |
| 5 | 4 | const mem = std.mem; |
| 6 | const Interner = @import("../backend.zig").Interner; | |
| 5 | const Allocator = mem.Allocator; | |
| 6 | ||
| 7 | const backend = @import("../backend.zig"); | |
| 8 | const Interner = backend.Interner; | |
| 9 | const CodeGenOptions = backend.CodeGenOptions; | |
| 10 | ||
| 7 | 11 | const Builtins = @import("Builtins.zig"); |
| 8 | 12 | const Builtin = Builtins.Builtin; |
| 9 | 13 | const Diagnostics = @import("Diagnostics.zig"); |
| 14 | const DepFile = @import("DepFile.zig"); | |
| 10 | 15 | const LangOpts = @import("LangOpts.zig"); |
| 11 | const Source = @import("Source.zig"); | |
| 12 | const Tokenizer = @import("Tokenizer.zig"); | |
| 13 | const Token = Tokenizer.Token; | |
| 14 | const Type = @import("Type.zig"); | |
| 15 | 16 | const Pragma = @import("Pragma.zig"); |
| 16 | const StrInt = @import("StringInterner.zig"); | |
| 17 | 17 | const record_layout = @import("record_layout.zig"); |
| 18 | const Source = @import("Source.zig"); | |
| 19 | const StringInterner = @import("StringInterner.zig"); | |
| 18 | 20 | const target_util = @import("target.zig"); |
| 19 | const Writer = std.Io.Writer; | |
| 21 | const Tokenizer = @import("Tokenizer.zig"); | |
| 22 | const Token = Tokenizer.Token; | |
| 23 | const TypeStore = @import("TypeStore.zig"); | |
| 24 | const Type = TypeStore.Type; | |
| 25 | const QualType = TypeStore.QualType; | |
| 20 | 26 | |
| 21 | 27 | pub const Error = error{ |
| 22 | 28 | /// A fatal error has ocurred and compilation has stopped. |
| 23 | 29 | FatalError, |
| 24 | 30 | } || Allocator.Error; |
| 31 | pub const AddSourceError = Error || error{FileTooBig}; | |
| 25 | 32 | |
| 26 | 33 | pub const bit_int_max_bits = std.math.maxInt(u16); |
| 27 | 34 | const path_buf_stack_limit = 1024; |
| ... | ... | @@ -53,9 +60,20 @@ pub const Environment = struct { |
| 53 | 60 | /// TODO: not implemented yet |
| 54 | 61 | c_include_path: ?[]const u8 = null, |
| 55 | 62 | |
| 56 | /// UNIX timestamp to be used instead of the current date and time in the __DATE__ and __TIME__ macros | |
| 63 | /// UNIX timestamp to be used instead of the current date and time in the __DATE__ and __TIME__ macros, and instead of the | |
| 64 | /// file modification time in the __TIMESTAMP__ macro | |
| 57 | 65 | source_date_epoch: ?[]const u8 = null, |
| 58 | 66 | |
| 67 | pub const SourceEpoch = union(enum) { | |
| 68 | /// Represents system time when aro is invoked; used for __DATE__ and __TIME__ macros | |
| 69 | system: u64, | |
| 70 | /// Represents a user-provided time (typically via the SOURCE_DATE_EPOCH environment variable) | |
| 71 | /// used for __DATE__, __TIME__, and __TIMESTAMP__ | |
| 72 | provided: u64, | |
| 73 | ||
| 74 | pub const default: @This() = .{ .provided = 0 }; | |
| 75 | }; | |
| 76 | ||
| 59 | 77 | /// 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 |
| 60 | 78 | /// See https://github.com/ziglang/zig/issues/4524 |
| 61 | 79 | pub fn loadAll(allocator: std.mem.Allocator) !Environment { |
| ... | ... | @@ -86,68 +104,76 @@ pub const Environment = struct { |
| 86 | 104 | } |
| 87 | 105 | self.* = undefined; |
| 88 | 106 | } |
| 107 | ||
| 108 | pub fn sourceEpoch(self: *const Environment) !SourceEpoch { | |
| 109 | const max_timestamp = 253402300799; // Dec 31 9999 23:59:59 | |
| 110 | ||
| 111 | if (self.source_date_epoch) |epoch| { | |
| 112 | const parsed = std.fmt.parseInt(u64, epoch, 10) catch return error.InvalidEpoch; | |
| 113 | if (parsed > max_timestamp) return error.InvalidEpoch; | |
| 114 | return .{ .provided = parsed }; | |
| 115 | } else { | |
| 116 | const timestamp = std.math.cast(u64, std.time.timestamp()) orelse return error.InvalidEpoch; | |
| 117 | return .{ .system = std.math.clamp(timestamp, 0, max_timestamp) }; | |
| 118 | } | |
| 119 | } | |
| 89 | 120 | }; |
| 90 | 121 | |
| 91 | 122 | const Compilation = @This(); |
| 92 | 123 | |
| 93 | 124 | gpa: Allocator, |
| 94 | diagnostics: Diagnostics, | |
| 125 | /// Allocations in this arena live all the way until `Compilation.deinit`. | |
| 126 | arena: Allocator, | |
| 127 | diagnostics: *Diagnostics, | |
| 95 | 128 | |
| 129 | code_gen_options: CodeGenOptions = .default, | |
| 96 | 130 | environment: Environment = .{}, |
| 97 | 131 | sources: std.StringArrayHashMapUnmanaged(Source) = .empty, |
| 98 | include_dirs: std.ArrayListUnmanaged([]const u8) = .empty, | |
| 99 | system_include_dirs: std.ArrayListUnmanaged([]const u8) = .empty, | |
| 132 | /// Allocated into `gpa`, but keys are externally managed. | |
| 133 | include_dirs: std.ArrayList([]const u8) = .empty, | |
| 134 | /// Allocated into `gpa`, but keys are externally managed. | |
| 135 | iquote_include_dirs: std.ArrayList([]const u8) = .empty, | |
| 136 | /// Allocated into `gpa`, but keys are externally managed. | |
| 137 | system_include_dirs: std.ArrayList([]const u8) = .empty, | |
| 138 | /// Allocated into `gpa`, but keys are externally managed. | |
| 139 | after_include_dirs: std.ArrayList([]const u8) = .empty, | |
| 140 | /// Allocated into `gpa`, but keys are externally managed. | |
| 141 | framework_dirs: std.ArrayList([]const u8) = .empty, | |
| 142 | /// Allocated into `gpa`, but keys are externally managed. | |
| 143 | system_framework_dirs: std.ArrayList([]const u8) = .empty, | |
| 144 | /// Allocated into `gpa`, but keys are externally managed. | |
| 145 | embed_dirs: std.ArrayList([]const u8) = .empty, | |
| 100 | 146 | target: std.Target = @import("builtin").target, |
| 147 | cmodel: std.builtin.CodeModel = .default, | |
| 101 | 148 | pragma_handlers: std.StringArrayHashMapUnmanaged(*Pragma) = .empty, |
| 102 | 149 | langopts: LangOpts = .{}, |
| 103 | generated_buf: std.ArrayListUnmanaged(u8) = .empty, | |
| 150 | generated_buf: std.ArrayList(u8) = .empty, | |
| 104 | 151 | builtins: Builtins = .{}, |
| 105 | types: struct { | |
| 106 | wchar: Type = undefined, | |
| 107 | uint_least16_t: Type = undefined, | |
| 108 | uint_least32_t: Type = undefined, | |
| 109 | ptrdiff: Type = undefined, | |
| 110 | size: Type = undefined, | |
| 111 | va_list: Type = undefined, | |
| 112 | pid_t: Type = undefined, | |
| 113 | ns_constant_string: struct { | |
| 114 | ty: Type = undefined, | |
| 115 | record: Type.Record = undefined, | |
| 116 | fields: [4]Type.Record.Field = undefined, | |
| 117 | int_ty: Type = .{ .specifier = .int, .qual = .{ .@"const" = true } }, | |
| 118 | char_ty: Type = .{ .specifier = .char, .qual = .{ .@"const" = true } }, | |
| 119 | } = .{}, | |
| 120 | file: Type = .{ .specifier = .invalid }, | |
| 121 | jmp_buf: Type = .{ .specifier = .invalid }, | |
| 122 | sigjmp_buf: Type = .{ .specifier = .invalid }, | |
| 123 | ucontext_t: Type = .{ .specifier = .invalid }, | |
| 124 | intmax: Type = .{ .specifier = .invalid }, | |
| 125 | intptr: Type = .{ .specifier = .invalid }, | |
| 126 | int16: Type = .{ .specifier = .invalid }, | |
| 127 | int64: Type = .{ .specifier = .invalid }, | |
| 128 | } = .{}, | |
| 129 | string_interner: StrInt = .{}, | |
| 152 | string_interner: StringInterner = .{}, | |
| 130 | 153 | interner: Interner = .{}, |
| 154 | type_store: TypeStore = .{}, | |
| 131 | 155 | /// If this is not null, the directory containing the specified Source will be searched for includes |
| 132 | 156 | /// Used by MS extensions which allow searching for includes relative to the directory of the main source file. |
| 133 | 157 | ms_cwd_source_id: ?Source.Id = null, |
| 134 | 158 | cwd: std.fs.Dir, |
| 135 | 159 | |
| 136 | pub fn init(gpa: Allocator, cwd: std.fs.Dir) Compilation { | |
| 160 | pub fn init(gpa: Allocator, arena: Allocator, diagnostics: *Diagnostics, cwd: std.fs.Dir) Compilation { | |
| 137 | 161 | return .{ |
| 138 | 162 | .gpa = gpa, |
| 139 | .diagnostics = Diagnostics.init(gpa), | |
| 163 | .arena = arena, | |
| 164 | .diagnostics = diagnostics, | |
| 140 | 165 | .cwd = cwd, |
| 141 | 166 | }; |
| 142 | 167 | } |
| 143 | 168 | |
| 144 | 169 | /// Initialize Compilation with default environment, |
| 145 | 170 | /// pragma handlers and emulation mode set to target. |
| 146 | pub fn initDefault(gpa: Allocator, cwd: std.fs.Dir) !Compilation { | |
| 171 | pub fn initDefault(gpa: Allocator, arena: Allocator, diagnostics: *Diagnostics, cwd: std.fs.Dir) !Compilation { | |
| 147 | 172 | var comp: Compilation = .{ |
| 148 | 173 | .gpa = gpa, |
| 174 | .arena = arena, | |
| 175 | .diagnostics = diagnostics, | |
| 149 | 176 | .environment = try Environment.loadAll(gpa), |
| 150 | .diagnostics = Diagnostics.init(gpa), | |
| 151 | 177 | .cwd = cwd, |
| 152 | 178 | }; |
| 153 | 179 | errdefer comp.deinit(); |
| ... | ... | @@ -157,82 +183,35 @@ pub fn initDefault(gpa: Allocator, cwd: std.fs.Dir) !Compilation { |
| 157 | 183 | } |
| 158 | 184 | |
| 159 | 185 | pub fn deinit(comp: *Compilation) void { |
| 186 | const gpa = comp.gpa; | |
| 160 | 187 | for (comp.pragma_handlers.values()) |pragma| { |
| 161 | 188 | pragma.deinit(pragma, comp); |
| 162 | 189 | } |
| 163 | 190 | for (comp.sources.values()) |source| { |
| 164 | comp.gpa.free(source.path); | |
| 165 | comp.gpa.free(source.buf); | |
| 166 | comp.gpa.free(source.splice_locs); | |
| 191 | gpa.free(source.path); | |
| 192 | gpa.free(source.buf); | |
| 193 | gpa.free(source.splice_locs); | |
| 167 | 194 | } |
| 168 | comp.sources.deinit(comp.gpa); | |
| 169 | comp.diagnostics.deinit(); | |
| 170 | comp.include_dirs.deinit(comp.gpa); | |
| 171 | for (comp.system_include_dirs.items) |path| comp.gpa.free(path); | |
| 172 | comp.system_include_dirs.deinit(comp.gpa); | |
| 173 | comp.pragma_handlers.deinit(comp.gpa); | |
| 174 | comp.generated_buf.deinit(comp.gpa); | |
| 175 | comp.builtins.deinit(comp.gpa); | |
| 176 | comp.string_interner.deinit(comp.gpa); | |
| 177 | comp.interner.deinit(comp.gpa); | |
| 178 | comp.environment.deinit(comp.gpa); | |
| 179 | } | |
| 180 | ||
| 181 | pub fn getSourceEpoch(self: *const Compilation, max: i64) !?i64 { | |
| 182 | const provided = self.environment.source_date_epoch orelse return null; | |
| 183 | const parsed = std.fmt.parseInt(i64, provided, 10) catch return error.InvalidEpoch; | |
| 184 | if (parsed < 0 or parsed > max) return error.InvalidEpoch; | |
| 185 | return parsed; | |
| 195 | comp.sources.deinit(gpa); | |
| 196 | comp.include_dirs.deinit(gpa); | |
| 197 | comp.iquote_include_dirs.deinit(gpa); | |
| 198 | comp.system_include_dirs.deinit(gpa); | |
| 199 | comp.after_include_dirs.deinit(gpa); | |
| 200 | comp.framework_dirs.deinit(gpa); | |
| 201 | comp.system_framework_dirs.deinit(gpa); | |
| 202 | comp.embed_dirs.deinit(gpa); | |
| 203 | comp.pragma_handlers.deinit(gpa); | |
| 204 | comp.generated_buf.deinit(gpa); | |
| 205 | comp.builtins.deinit(gpa); | |
| 206 | comp.string_interner.deinit(gpa); | |
| 207 | comp.interner.deinit(gpa); | |
| 208 | comp.environment.deinit(gpa); | |
| 209 | comp.type_store.deinit(gpa); | |
| 210 | comp.* = undefined; | |
| 186 | 211 | } |
| 187 | 212 | |
| 188 | /// Dec 31 9999 23:59:59 | |
| 189 | const max_timestamp = 253402300799; | |
| 190 | ||
| 191 | fn getTimestamp(comp: *Compilation) !u47 { | |
| 192 | const provided: ?i64 = comp.getSourceEpoch(max_timestamp) catch blk: { | |
| 193 | try comp.addDiagnostic(.{ | |
| 194 | .tag = .invalid_source_epoch, | |
| 195 | .loc = .{ .id = .unused, .byte_offset = 0, .line = 0 }, | |
| 196 | }, &.{}); | |
| 197 | break :blk null; | |
| 198 | }; | |
| 199 | const timestamp = provided orelse std.time.timestamp(); | |
| 200 | return @intCast(std.math.clamp(timestamp, 0, max_timestamp)); | |
| 201 | } | |
| 202 | ||
| 203 | fn generateDateAndTime(w: *Writer, timestamp: u47) !void { | |
| 204 | const epoch_seconds = EpochSeconds{ .secs = timestamp }; | |
| 205 | const epoch_day = epoch_seconds.getEpochDay(); | |
| 206 | const day_seconds = epoch_seconds.getDaySeconds(); | |
| 207 | const year_day = epoch_day.calculateYearDay(); | |
| 208 | const month_day = year_day.calculateMonthDay(); | |
| 209 | ||
| 210 | const month_names = [_][]const u8{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; | |
| 211 | std.debug.assert(std.time.epoch.Month.jan.numeric() == 1); | |
| 212 | ||
| 213 | const month_name = month_names[month_day.month.numeric() - 1]; | |
| 214 | try w.print("#define __DATE__ \"{s} {d: >2} {d}\"\n", .{ | |
| 215 | month_name, | |
| 216 | month_day.day_index + 1, | |
| 217 | year_day.year, | |
| 218 | }); | |
| 219 | try w.print("#define __TIME__ \"{d:0>2}:{d:0>2}:{d:0>2}\"\n", .{ | |
| 220 | day_seconds.getHoursIntoDay(), | |
| 221 | day_seconds.getMinutesIntoHour(), | |
| 222 | day_seconds.getSecondsIntoMinute(), | |
| 223 | }); | |
| 224 | ||
| 225 | const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; | |
| 226 | const day_name = day_names[@intCast((epoch_day.day + 3) % 7)]; | |
| 227 | try w.print("#define __TIMESTAMP__ \"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"\n", .{ | |
| 228 | day_name, | |
| 229 | month_name, | |
| 230 | month_day.day_index + 1, | |
| 231 | day_seconds.getHoursIntoDay(), | |
| 232 | day_seconds.getMinutesIntoHour(), | |
| 233 | day_seconds.getSecondsIntoMinute(), | |
| 234 | year_day.year, | |
| 235 | }); | |
| 213 | pub fn internString(comp: *Compilation, str: []const u8) !StringInterner.StringId { | |
| 214 | return comp.string_interner.intern(comp.gpa, str); | |
| 236 | 215 | } |
| 237 | 216 | |
| 238 | 217 | /// Which set of system defines to generate via generateBuiltinMacros |
| ... | ... | @@ -243,54 +222,133 @@ pub const SystemDefinesMode = enum { |
| 243 | 222 | include_system_defines, |
| 244 | 223 | }; |
| 245 | 224 | |
| 246 | fn generateSystemDefines(comp: *Compilation, w: *Writer) !void { | |
| 225 | fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void { | |
| 226 | const define = struct { | |
| 227 | fn define(_w: *std.Io.Writer, name: []const u8) !void { | |
| 228 | try _w.print("#define {s} 1\n", .{name}); | |
| 229 | } | |
| 230 | }.define; | |
| 231 | const defineStd = struct { | |
| 232 | fn defineStd(_w: *std.Io.Writer, name: []const u8, is_gnu: bool) !void { | |
| 233 | if (is_gnu) { | |
| 234 | try _w.print("#define {s} 1\n", .{name}); | |
| 235 | } | |
| 236 | try _w.print( | |
| 237 | \\#define __{s} 1 | |
| 238 | \\#define __{s}__ 1 | |
| 239 | \\ | |
| 240 | , .{ name, name }); | |
| 241 | } | |
| 242 | }.defineStd; | |
| 247 | 243 | const ptr_width = comp.target.ptrBitWidth(); |
| 244 | const is_gnu = comp.langopts.standard.isGNU(); | |
| 245 | ||
| 246 | const gnuc_version = comp.langopts.gnuc_version orelse comp.langopts.emulate.defaultGccVersion(); | |
| 247 | if (gnuc_version > 0) { | |
| 248 | try w.print("#define __GNUC__ {d}\n", .{gnuc_version / 10_000}); | |
| 249 | try w.print("#define __GNUC_MINOR__ {d}\n", .{gnuc_version / 100 % 100}); | |
| 250 | try w.print("#define __GNUC_PATCHLEVEL__ {d}\n", .{gnuc_version % 100}); | |
| 251 | } | |
| 252 | ||
| 253 | try w.writeAll( | |
| 254 | \\#define __ARO_EMULATE_CLANG__ 1 | |
| 255 | \\#define __ARO_EMULATE_GCC__ 2 | |
| 256 | \\#define __ARO_EMULATE_MSVC__ 3 | |
| 257 | \\ | |
| 258 | ); | |
| 259 | const emulated = switch (comp.langopts.emulate) { | |
| 260 | .clang => "__ARO_EMULATE_CLANG__", | |
| 261 | .gcc => "__ARO_EMULATE_GCC__", | |
| 262 | .msvc => "__ARO_EMULATE_MSVC__", | |
| 263 | }; | |
| 264 | try w.print("#define __ARO_EMULATE__ {s}\n", .{emulated}); | |
| 248 | 265 | |
| 249 | if (comp.langopts.gnuc_version > 0) { | |
| 250 | try w.print("#define __GNUC__ {d}\n", .{comp.langopts.gnuc_version / 10_000}); | |
| 251 | try w.print("#define __GNUC_MINOR__ {d}\n", .{comp.langopts.gnuc_version / 100 % 100}); | |
| 252 | try w.print("#define __GNUC_PATCHLEVEL__ {d}\n", .{comp.langopts.gnuc_version % 100}); | |
| 266 | if (comp.code_gen_options.optimization_level.hasAnyOptimizations()) { | |
| 267 | try define(w, "__OPTIMIZE__"); | |
| 268 | } | |
| 269 | if (comp.code_gen_options.optimization_level.isSizeOptimized()) { | |
| 270 | try define(w, "__OPTIMIZE_SIZE__"); | |
| 253 | 271 | } |
| 254 | 272 | |
| 255 | 273 | // os macros |
| 256 | 274 | switch (comp.target.os.tag) { |
| 257 | .linux => try w.writeAll( | |
| 258 | \\#define linux 1 | |
| 259 | \\#define __linux 1 | |
| 260 | \\#define __linux__ 1 | |
| 261 | \\ | |
| 262 | ), | |
| 263 | .windows => if (ptr_width == 32) try w.writeAll( | |
| 264 | \\#define WIN32 1 | |
| 265 | \\#define _WIN32 1 | |
| 266 | \\#define __WIN32 1 | |
| 267 | \\#define __WIN32__ 1 | |
| 268 | \\ | |
| 269 | ) else try w.writeAll( | |
| 270 | \\#define WIN32 1 | |
| 271 | \\#define WIN64 1 | |
| 272 | \\#define _WIN32 1 | |
| 273 | \\#define _WIN64 1 | |
| 274 | \\#define __WIN32 1 | |
| 275 | \\#define __WIN64 1 | |
| 276 | \\#define __WIN32__ 1 | |
| 277 | \\#define __WIN64__ 1 | |
| 278 | \\ | |
| 279 | ), | |
| 280 | .freebsd => try w.print("#define __FreeBSD__ {d}\n", .{comp.target.os.version_range.semver.min.major}), | |
| 281 | .netbsd => try w.writeAll("#define __NetBSD__ 1\n"), | |
| 282 | .openbsd => try w.writeAll("#define __OpenBSD__ 1\n"), | |
| 283 | .dragonfly => try w.writeAll("#define __DragonFly__ 1\n"), | |
| 284 | .solaris => try w.writeAll( | |
| 285 | \\#define sun 1 | |
| 286 | \\#define __sun 1 | |
| 287 | \\ | |
| 288 | ), | |
| 289 | .macos => try w.writeAll( | |
| 290 | \\#define __APPLE__ 1 | |
| 291 | \\#define __MACH__ 1 | |
| 292 | \\ | |
| 293 | ), | |
| 275 | .linux => try defineStd(w, "linux", is_gnu), | |
| 276 | .windows => { | |
| 277 | try define(w, "_WIN32"); | |
| 278 | if (ptr_width == 64) { | |
| 279 | try define(w, "_WIN64"); | |
| 280 | } | |
| 281 | ||
| 282 | if (comp.target.abi.isGnu()) { | |
| 283 | try defineStd(w, "WIN32", is_gnu); | |
| 284 | try defineStd(w, "WINNT", is_gnu); | |
| 285 | if (ptr_width == 64) { | |
| 286 | try defineStd(w, "WIN64", is_gnu); | |
| 287 | try define(w, "__MINGW64__"); | |
| 288 | } | |
| 289 | try define(w, "__MSVCRT__"); | |
| 290 | try define(w, "__MINGW32__"); | |
| 291 | } else if (comp.target.abi == .cygnus) { | |
| 292 | try define(w, "__CYGWIN__"); | |
| 293 | if (ptr_width == 64) { | |
| 294 | try define(w, "__CYGWIN64__"); | |
| 295 | } else { | |
| 296 | try define(w, "__CYGWIN32__"); | |
| 297 | } | |
| 298 | } | |
| 299 | ||
| 300 | if (comp.target.abi.isGnu() or comp.target.abi == .cygnus) { | |
| 301 | // MinGW and Cygwin define __declspec(a) to __attribute((a)). | |
| 302 | // Like Clang we make the define no op if -fdeclspec is enabled. | |
| 303 | if (comp.langopts.declspec_attrs) { | |
| 304 | try w.writeAll("#define __declspec __declspec\n"); | |
| 305 | } else { | |
| 306 | try w.writeAll("#define __declspec(a) __attribute__((a))\n"); | |
| 307 | } | |
| 308 | if (!comp.langopts.ms_extensions) { | |
| 309 | // Provide aliases for the calling convention keywords. | |
| 310 | for ([_][]const u8{ "cdecl", "stdcall", "fastcall", "thiscall" }) |keyword| { | |
| 311 | try w.print( | |
| 312 | \\#define _{[0]s} __attribute__((__{[0]s}__)) | |
| 313 | \\#define __{[0]s} __attribute__((__{[0]s}__)) | |
| 314 | \\ | |
| 315 | , .{keyword}); | |
| 316 | } | |
| 317 | } | |
| 318 | } | |
| 319 | }, | |
| 320 | .uefi => try define(w, "__UEFI__"), | |
| 321 | .freebsd => { | |
| 322 | const release = comp.target.os.version_range.semver.min.major; | |
| 323 | const cc_version = release * 10_000 + 1; | |
| 324 | try w.print( | |
| 325 | \\#define __FreeBSD__ {d} | |
| 326 | \\#define __FreeBSD_cc_version {d} | |
| 327 | \\ | |
| 328 | , .{ release, cc_version }); | |
| 329 | }, | |
| 330 | .ps4, .ps5 => { | |
| 331 | try w.writeAll( | |
| 332 | \\#define __FreeBSD__ 9 | |
| 333 | \\#define __FreeBSD_cc_version 900001 | |
| 334 | \\ | |
| 335 | ); | |
| 336 | }, | |
| 337 | .netbsd => try define(w, "__NetBSD__"), | |
| 338 | .openbsd => try define(w, "__OpenBSD__"), | |
| 339 | .dragonfly => try define(w, "__DragonFly__"), | |
| 340 | .solaris => try defineStd(w, "sun", is_gnu), | |
| 341 | .macos, | |
| 342 | .tvos, | |
| 343 | .ios, | |
| 344 | .driverkit, | |
| 345 | .visionos, | |
| 346 | .watchos, | |
| 347 | => try define(w, "__APPLE__"), | |
| 348 | .wasi => try define(w, "__wasi__"), | |
| 349 | .emscripten => try define(w, "__EMSCRIPTEN__"), | |
| 350 | .@"3ds" => try define(w, "__3DS__"), | |
| 351 | .vita => try define(w, "__vita__"), | |
| 294 | 352 | else => {}, |
| 295 | 353 | } |
| 296 | 354 | |
| ... | ... | @@ -301,107 +359,440 @@ fn generateSystemDefines(comp: *Compilation, w: *Writer) !void { |
| 301 | 359 | .openbsd, |
| 302 | 360 | .dragonfly, |
| 303 | 361 | .linux, |
| 304 | => try w.writeAll( | |
| 305 | \\#define unix 1 | |
| 306 | \\#define __unix 1 | |
| 307 | \\#define __unix__ 1 | |
| 308 | \\ | |
| 309 | ), | |
| 362 | .haiku, | |
| 363 | .hurd, | |
| 364 | .solaris, | |
| 365 | .aix, | |
| 366 | .emscripten, | |
| 367 | .ps4, | |
| 368 | .ps5, | |
| 369 | => try defineStd(w, "unix", is_gnu), | |
| 370 | .windows => if (comp.target.abi.isGnu() or comp.target.abi == .cygnus) { | |
| 371 | try defineStd(w, "unix", is_gnu); | |
| 372 | }, | |
| 310 | 373 | else => {}, |
| 311 | 374 | } |
| 312 | 375 | if (comp.target.abi.isAndroid()) { |
| 313 | try w.writeAll("#define __ANDROID__ 1\n"); | |
| 376 | try define(w, "__ANDROID__"); | |
| 314 | 377 | } |
| 315 | 378 | |
| 316 | 379 | // architecture macros |
| 317 | 380 | switch (comp.target.cpu.arch) { |
| 318 | .x86_64 => try w.writeAll( | |
| 319 | \\#define __amd64__ 1 | |
| 320 | \\#define __amd64 1 | |
| 321 | \\#define __x86_64 1 | |
| 322 | \\#define __x86_64__ 1 | |
| 323 | \\ | |
| 324 | ), | |
| 325 | .x86 => try w.writeAll( | |
| 326 | \\#define i386 1 | |
| 327 | \\#define __i386 1 | |
| 328 | \\#define __i386__ 1 | |
| 329 | \\ | |
| 330 | ), | |
| 381 | .x86, .x86_64 => { | |
| 382 | try w.print("#define __code_model_{s}__ 1\n", .{switch (comp.cmodel) { | |
| 383 | .default => "small", | |
| 384 | else => @tagName(comp.cmodel), | |
| 385 | }}); | |
| 386 | ||
| 387 | if (comp.target.cpu.arch == .x86_64) { | |
| 388 | try define(w, "__amd64__"); | |
| 389 | try define(w, "__amd64"); | |
| 390 | try define(w, "__x86_64__"); | |
| 391 | try define(w, "__x86_64"); | |
| 392 | ||
| 393 | if (comp.target.os.tag == .windows and comp.target.abi == .msvc) { | |
| 394 | try w.writeAll( | |
| 395 | \\#define _M_X64 100 | |
| 396 | \\#define _M_AMD64 100 | |
| 397 | \\ | |
| 398 | ); | |
| 399 | } | |
| 400 | } else { | |
| 401 | try defineStd(w, "i386", is_gnu); | |
| 402 | ||
| 403 | if (comp.target.os.tag == .windows and comp.target.abi == .msvc) { | |
| 404 | try w.print("#define _M_IX86 {d}\n", .{blk: { | |
| 405 | if (comp.target.cpu.model == &std.Target.x86.cpu.i386) break :blk 300; | |
| 406 | if (comp.target.cpu.model == &std.Target.x86.cpu.i486) break :blk 400; | |
| 407 | if (comp.target.cpu.model == &std.Target.x86.cpu.i586) break :blk 500; | |
| 408 | break :blk @as(u32, 600); | |
| 409 | }}); | |
| 410 | } | |
| 411 | } | |
| 412 | try define(w, "__SEG_GS"); | |
| 413 | try define(w, "__SEG_FS"); | |
| 414 | try w.writeAll( | |
| 415 | \\#define __seg_gs __attribute__((address_space(256))) | |
| 416 | \\#define __seg_fs __attribute__((address_space(257))) | |
| 417 | \\ | |
| 418 | ); | |
| 419 | ||
| 420 | if (comp.target.cpu.has(.x86, .sahf) or (comp.langopts.emulate == .clang and comp.target.cpu.arch == .x86)) { | |
| 421 | try define(w, "__LAHF_SAHF__"); | |
| 422 | } | |
| 423 | ||
| 424 | const features = comp.target.cpu.features; | |
| 425 | for ([_]struct { std.Target.x86.Feature, []const u8 }{ | |
| 426 | .{ .aes, "__AES__" }, | |
| 427 | .{ .vaes, "__VAES__" }, | |
| 428 | .{ .pclmul, "__PCLMUL__" }, | |
| 429 | .{ .vpclmulqdq, "__VPCLMULQDQ__" }, | |
| 430 | .{ .lzcnt, "__LZCNT__" }, | |
| 431 | .{ .rdrnd, "__RDRND__" }, | |
| 432 | .{ .fsgsbase, "__FSGSBASE__" }, | |
| 433 | .{ .bmi, "__BMI__" }, | |
| 434 | .{ .bmi2, "__BMI2__" }, | |
| 435 | .{ .popcnt, "__POPCNT__" }, | |
| 436 | .{ .rtm, "__RTM__" }, | |
| 437 | .{ .prfchw, "__PRFCHW__" }, | |
| 438 | .{ .rdseed, "__RDSEED__" }, | |
| 439 | .{ .adx, "__ADX__" }, | |
| 440 | .{ .tbm, "__TBM__" }, | |
| 441 | .{ .lwp, "__LWP__" }, | |
| 442 | .{ .mwaitx, "__MWAITX__" }, | |
| 443 | .{ .movbe, "__MOVBE__" }, | |
| 444 | ||
| 445 | .{ .xop, "__XOP__" }, | |
| 446 | .{ .fma4, "__FMA4__" }, | |
| 447 | .{ .sse4a, "__SSE4A__" }, | |
| 448 | ||
| 449 | .{ .fma, "__FMA__" }, | |
| 450 | .{ .f16c, "__F16C__" }, | |
| 451 | .{ .gfni, "__GFNI__" }, | |
| 452 | .{ .evex512, "__EVEX512__" }, | |
| 453 | ||
| 454 | .{ .avx10_1, "__AVX10_1__" }, | |
| 455 | .{ .avx10_1, "__AVX10_1_512__" }, | |
| 456 | ||
| 457 | .{ .avx10_2, "__AVX10_2__" }, | |
| 458 | .{ .avx10_2, "__AVX10_2_512__" }, | |
| 459 | ||
| 460 | .{ .avx512cd, "__AVX512CD__" }, | |
| 461 | .{ .avx512vpopcntdq, "__AVX512VPOPCNTDQ__" }, | |
| 462 | .{ .avx512vnni, "__AVX512VNNI__" }, | |
| 463 | .{ .avx512bf16, "__AVX512BF16__" }, | |
| 464 | .{ .avx512fp16, "__AVX512FP16__" }, | |
| 465 | .{ .avx512dq, "__AVX512DQ__" }, | |
| 466 | .{ .avx512bitalg, "__AVX512BITALG__" }, | |
| 467 | .{ .avx512bw, "__AVX512BW__" }, | |
| 468 | ||
| 469 | .{ .avx512vl, "__AVX512VL__" }, | |
| 470 | .{ .avx512vl, "__EVEX256__" }, | |
| 471 | ||
| 472 | .{ .avx512vbmi, "__AVX512VBMI__" }, | |
| 473 | .{ .avx512vbmi2, "__AVX512VBMI2__" }, | |
| 474 | .{ .avx512ifma, "__AVX512IFMA__" }, | |
| 475 | .{ .avx512vp2intersect, "__AVX512VP2INTERSECT__" }, | |
| 476 | .{ .sha, "__SHA__" }, | |
| 477 | .{ .sha512, "__SHA512__" }, | |
| 478 | .{ .fxsr, "__FXSR__" }, | |
| 479 | .{ .xsave, "__XSAVE__" }, | |
| 480 | .{ .xsaveopt, "__XSAVEOPT__" }, | |
| 481 | .{ .xsavec, "__XSAVEC__" }, | |
| 482 | .{ .xsaves, "__XSAVES__" }, | |
| 483 | .{ .pku, "__PKU__" }, | |
| 484 | .{ .clflushopt, "__CLFLUSHOPT__" }, | |
| 485 | .{ .clwb, "__CLWB__" }, | |
| 486 | .{ .wbnoinvd, "__WBNOINVD__" }, | |
| 487 | .{ .shstk, "__SHSTK__" }, | |
| 488 | .{ .sgx, "__SGX__" }, | |
| 489 | .{ .sm3, "__SM3__" }, | |
| 490 | .{ .sm4, "__SM4__" }, | |
| 491 | .{ .prefetchi, "__PREFETCHI__" }, | |
| 492 | .{ .clzero, "__CLZERO__" }, | |
| 493 | .{ .kl, "__KL__" }, | |
| 494 | .{ .widekl, "__WIDEKL__" }, | |
| 495 | .{ .rdpid, "__RDPID__" }, | |
| 496 | .{ .rdpru, "__RDPRU__" }, | |
| 497 | .{ .cldemote, "__CLDEMOTE__" }, | |
| 498 | .{ .waitpkg, "__WAITPKG__" }, | |
| 499 | .{ .movdiri, "__MOVDIRI__" }, | |
| 500 | .{ .movdir64b, "__MOVDIR64B__" }, | |
| 501 | .{ .movrs, "__MOVRS__" }, | |
| 502 | .{ .pconfig, "__PCONFIG__" }, | |
| 503 | .{ .ptwrite, "__PTWRITE__" }, | |
| 504 | .{ .invpcid, "__INVPCID__" }, | |
| 505 | .{ .enqcmd, "__ENQCMD__" }, | |
| 506 | .{ .hreset, "__HRESET__" }, | |
| 507 | .{ .amx_tile, "__AMX_TILE__" }, | |
| 508 | .{ .amx_int8, "__AMX_INT8__" }, | |
| 509 | .{ .amx_bf16, "__AMX_BF16__" }, | |
| 510 | .{ .amx_fp16, "__AMX_FP16__" }, | |
| 511 | .{ .amx_complex, "__AMX_COMPLEX__" }, | |
| 512 | .{ .amx_fp8, "__AMX_FP8__" }, | |
| 513 | .{ .amx_movrs, "__AMX_MOVRS__" }, | |
| 514 | .{ .amx_transpose, "__AMX_TRANSPOSE__" }, | |
| 515 | .{ .amx_avx512, "__AMX_AVX512__" }, | |
| 516 | .{ .amx_tf32, "__AMX_TF32__" }, | |
| 517 | .{ .cmpccxadd, "__CMPCCXADD__" }, | |
| 518 | .{ .raoint, "__RAOINT__" }, | |
| 519 | .{ .avxifma, "__AVXIFMA__" }, | |
| 520 | .{ .avxneconvert, "__AVXNECONVERT__" }, | |
| 521 | .{ .avxvnni, "__AVXVNNI__" }, | |
| 522 | .{ .avxvnniint16, "__AVXVNNIINT16__" }, | |
| 523 | .{ .avxvnniint8, "__AVXVNNIINT8__" }, | |
| 524 | .{ .serialize, "__SERIALIZE__" }, | |
| 525 | .{ .tsxldtrk, "__TSXLDTRK__" }, | |
| 526 | .{ .uintr, "__UINTR__" }, | |
| 527 | .{ .usermsr, "__USERMSR__" }, | |
| 528 | .{ .crc32, "__CRC32__" }, | |
| 529 | .{ .egpr, "__EGPR__" }, | |
| 530 | .{ .push2pop2, "__PUSH2POP2__" }, | |
| 531 | .{ .ppx, "__PPX__" }, | |
| 532 | .{ .ndd, "__NDD__" }, | |
| 533 | .{ .ccmp, "__CCMP__" }, | |
| 534 | .{ .nf, "__NF__" }, | |
| 535 | .{ .cf, "__CF__" }, | |
| 536 | .{ .zu, "__ZU__" }, | |
| 537 | ||
| 538 | .{ .avx512f, "__AVX512F__" }, | |
| 539 | .{ .avx2, "__AVX2__" }, | |
| 540 | .{ .avx, "__AVX__" }, | |
| 541 | .{ .sse4_2, "__SSE4_2__" }, | |
| 542 | .{ .sse4_1, "__SSE4_1__" }, | |
| 543 | .{ .ssse3, "__SSSE3__" }, | |
| 544 | .{ .sse3, "__SSE3__" }, | |
| 545 | .{ .sse2, "__SSE2__" }, | |
| 546 | .{ .sse, "__SSE__" }, | |
| 547 | .{ .sse, "__SSE_MATH__" }, | |
| 548 | ||
| 549 | .{ .mmx, "__MMX__" }, | |
| 550 | }) |fs| { | |
| 551 | if (features.isEnabled(@intFromEnum(fs[0]))) { | |
| 552 | try define(w, fs[1]); | |
| 553 | } | |
| 554 | } | |
| 555 | ||
| 556 | if (comp.langopts.ms_extensions and comp.target.cpu.arch == .x86) { | |
| 557 | const level = if (comp.target.cpu.has(.x86, .sse2)) | |
| 558 | "2" | |
| 559 | else if (comp.target.cpu.has(.x86, .sse)) | |
| 560 | "1" | |
| 561 | else | |
| 562 | "0"; | |
| 563 | ||
| 564 | try w.print("#define _M_IX86_FP {s}\n", .{level}); | |
| 565 | } | |
| 566 | ||
| 567 | if (comp.target.cpu.hasAll(.x86, &.{ .egpr, .push2pop2, .ppx, .ndd, .ccmp, .nf, .cf, .zu })) { | |
| 568 | try define(w, "__APX_F__"); | |
| 569 | } | |
| 570 | ||
| 571 | if (comp.target.cpu.hasAll(.x86, &.{ .egpr, .inline_asm_use_gpr32 })) { | |
| 572 | try define(w, "__APX_INLINE_ASM_USE_GPR32__"); | |
| 573 | } | |
| 574 | ||
| 575 | if (comp.target.cpu.has(.x86, .cx8)) { | |
| 576 | try define(w, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); | |
| 577 | } | |
| 578 | if (comp.target.cpu.has(.x86, .cx16) and comp.target.cpu.arch == .x86_64) { | |
| 579 | try define(w, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); | |
| 580 | } | |
| 581 | ||
| 582 | if (comp.hasFloat128()) { | |
| 583 | try w.writeAll("#define __SIZEOF_FLOAT128__ 16\n"); | |
| 584 | } | |
| 585 | }, | |
| 331 | 586 | .mips, |
| 332 | 587 | .mipsel, |
| 333 | 588 | .mips64, |
| 334 | 589 | .mips64el, |
| 335 | => try w.writeAll( | |
| 336 | \\#define __mips__ 1 | |
| 337 | \\#define mips 1 | |
| 338 | \\ | |
| 339 | ), | |
| 590 | => { | |
| 591 | try define(w, "__mips__"); | |
| 592 | try define(w, "_mips"); | |
| 593 | }, | |
| 340 | 594 | .powerpc, |
| 341 | 595 | .powerpcle, |
| 342 | => try w.writeAll( | |
| 343 | \\#define __powerpc__ 1 | |
| 344 | \\#define __POWERPC__ 1 | |
| 345 | \\#define __ppc__ 1 | |
| 346 | \\#define __PPC__ 1 | |
| 347 | \\#define _ARCH_PPC 1 | |
| 348 | \\ | |
| 349 | ), | |
| 596 | => { | |
| 597 | try define(w, "__powerpc__"); | |
| 598 | try define(w, "__POWERPC__"); | |
| 599 | try define(w, "__ppc__"); | |
| 600 | try define(w, "__PPC__"); | |
| 601 | try define(w, "_ARCH_PPC"); | |
| 602 | }, | |
| 350 | 603 | .powerpc64, |
| 351 | 604 | .powerpc64le, |
| 352 | => try w.writeAll( | |
| 353 | \\#define __powerpc 1 | |
| 354 | \\#define __powerpc__ 1 | |
| 355 | \\#define __powerpc64__ 1 | |
| 356 | \\#define __POWERPC__ 1 | |
| 357 | \\#define __ppc__ 1 | |
| 358 | \\#define __ppc64__ 1 | |
| 359 | \\#define __PPC__ 1 | |
| 360 | \\#define __PPC64__ 1 | |
| 361 | \\#define _ARCH_PPC 1 | |
| 362 | \\#define _ARCH_PPC64 1 | |
| 363 | \\ | |
| 364 | ), | |
| 365 | .sparc64 => try w.writeAll( | |
| 366 | \\#define __sparc__ 1 | |
| 367 | \\#define __sparc 1 | |
| 368 | \\#define __sparc_v9__ 1 | |
| 369 | \\ | |
| 370 | ), | |
| 371 | .sparc => try w.writeAll( | |
| 372 | \\#define __sparc__ 1 | |
| 373 | \\#define __sparc 1 | |
| 374 | \\ | |
| 375 | ), | |
| 376 | .arm, .armeb => try w.writeAll( | |
| 377 | \\#define __arm__ 1 | |
| 378 | \\#define __arm 1 | |
| 379 | \\ | |
| 380 | ), | |
| 381 | .thumb, .thumbeb => try w.writeAll( | |
| 382 | \\#define __arm__ 1 | |
| 383 | \\#define __arm 1 | |
| 384 | \\#define __thumb__ 1 | |
| 385 | \\ | |
| 386 | ), | |
| 387 | .aarch64, .aarch64_be => try w.writeAll("#define __aarch64__ 1\n"), | |
| 388 | .msp430 => try w.writeAll( | |
| 389 | \\#define MSP430 1 | |
| 390 | \\#define __MSP430__ 1 | |
| 391 | \\ | |
| 392 | ), | |
| 605 | => { | |
| 606 | try define(w, "__powerpc"); | |
| 607 | try define(w, "__powerpc__"); | |
| 608 | try define(w, "__powerpc64__"); | |
| 609 | try define(w, "__POWERPC__"); | |
| 610 | try define(w, "__ppc__"); | |
| 611 | try define(w, "__ppc64__"); | |
| 612 | try define(w, "__PPC__"); | |
| 613 | try define(w, "__PPC64__"); | |
| 614 | try define(w, "_ARCH_PPC"); | |
| 615 | try define(w, "_ARCH_PPC64"); | |
| 616 | }, | |
| 617 | .sparc64 => { | |
| 618 | try defineStd(w, "sparc", is_gnu); | |
| 619 | try define(w, "__sparc_v9__"); | |
| 620 | try define(w, "__arch64__"); | |
| 621 | if (comp.target.os.tag != .solaris) { | |
| 622 | try define(w, "__sparc64__"); | |
| 623 | try define(w, "__sparc_v9__"); | |
| 624 | try define(w, "__sparcv9__"); | |
| 625 | } | |
| 626 | }, | |
| 627 | .sparc => { | |
| 628 | try defineStd(w, "sparc", is_gnu); | |
| 629 | if (comp.target.os.tag == .solaris) { | |
| 630 | try define(w, "__sparcv8"); | |
| 631 | } | |
| 632 | }, | |
| 633 | .arm, .armeb, .thumb, .thumbeb => { | |
| 634 | try define(w, "__arm__"); | |
| 635 | try define(w, "__arm"); | |
| 636 | if (comp.target.cpu.arch.isThumb()) { | |
| 637 | try define(w, "__thumb__"); | |
| 638 | } | |
| 639 | }, | |
| 640 | .aarch64, .aarch64_be => { | |
| 641 | try define(w, "__aarch64__"); | |
| 642 | if (comp.target.os.tag == .macos) { | |
| 643 | try define(w, "__AARCH64_SIMD__"); | |
| 644 | if (ptr_width == 32) { | |
| 645 | try define(w, "__ARM64_ARCH_8_32__"); | |
| 646 | } else { | |
| 647 | try define(w, "__ARM64_ARCH_8__"); | |
| 648 | } | |
| 649 | try define(w, "__ARM_NEON__"); | |
| 650 | try define(w, "__arm64"); | |
| 651 | try define(w, "__arm64__"); | |
| 652 | } | |
| 653 | if (comp.target.os.tag == .windows and comp.target.abi == .msvc) { | |
| 654 | try w.writeAll("#define _M_ARM64 1\n"); | |
| 655 | } | |
| 656 | ||
| 657 | { | |
| 658 | const cmodel = switch (comp.cmodel) { | |
| 659 | .default => "small", | |
| 660 | else => @tagName(comp.cmodel), | |
| 661 | }; | |
| 662 | try w.writeAll("#define __AARCH64_CMODEL_"); | |
| 663 | for (cmodel) |c| { | |
| 664 | try w.writeByte(std.ascii.toUpper(c)); | |
| 665 | } | |
| 666 | try w.writeAll("__ 1\n"); | |
| 667 | } | |
| 668 | ||
| 669 | if (comp.target.cpu.has(.aarch64, .fp_armv8)) { | |
| 670 | try w.writeAll("#define __ARM_FP 0xE\n"); | |
| 671 | } | |
| 672 | if (comp.target.cpu.has(.aarch64, .neon)) { | |
| 673 | try define(w, "__ARM_NEON"); | |
| 674 | try w.writeAll("#define __ARM_NEON_FP 0xE\n"); | |
| 675 | } | |
| 676 | if (comp.target.cpu.has(.aarch64, .bf16)) { | |
| 677 | try define(w, "__ARM_FEATURE_BF16"); | |
| 678 | try define(w, "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC"); | |
| 679 | try define(w, "__ARM_BF16_FORMAT_ALTERNATIVE"); | |
| 680 | try define(w, "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC"); | |
| 681 | if (comp.target.cpu.has(.aarch64, .sve)) { | |
| 682 | try define(w, "__ARM_FEATURE_SVE_BF16"); | |
| 683 | } | |
| 684 | } | |
| 685 | if (comp.target.cpu.hasAll(.aarch64, &.{ .sve2, .sve_aes })) { | |
| 686 | try define(w, "__ARM_FEATURE_SVE2_AES"); | |
| 687 | } | |
| 688 | if (comp.target.cpu.hasAll(.aarch64, &.{ .sve2, .sve_bitperm })) { | |
| 689 | try define(w, "__ARM_FEATURE_SVE2_BITPERM"); | |
| 690 | } | |
| 691 | if (comp.target.cpu.has(.aarch64, .sme)) { | |
| 692 | try define(w, "__ARM_FEATURE_SME"); | |
| 693 | try define(w, "__ARM_FEATURE_LOCALLY_STREAMING"); | |
| 694 | } | |
| 695 | if (comp.target.cpu.has(.aarch64, .fmv)) { | |
| 696 | try define(w, "__HAVE_FUNCTION_MULTI_VERSIONING"); | |
| 697 | } | |
| 698 | if (comp.target.cpu.has(.aarch64, .sha3)) { | |
| 699 | try define(w, "__ARM_FEATURE_SHA3"); | |
| 700 | try define(w, "__ARM_FEATURE_SHA512"); | |
| 701 | } | |
| 702 | if (comp.target.cpu.has(.aarch64, .sm4)) { | |
| 703 | try define(w, "__ARM_FEATURE_SM3"); | |
| 704 | try define(w, "__ARM_FEATURE_SM4"); | |
| 705 | } | |
| 706 | if (!comp.target.cpu.has(.aarch64, .strict_align)) { | |
| 707 | try define(w, "__ARM_FEATURE_UNALIGNED"); | |
| 708 | } | |
| 709 | if (comp.target.cpu.hasAll(.aarch64, &.{ .neon, .fullfp16 })) { | |
| 710 | try define(w, "__ARM_FEATURE_FP16_VECTOR_ARITHMETIC"); | |
| 711 | } | |
| 712 | if (comp.target.cpu.has(.aarch64, .rcpc3)) { | |
| 713 | try w.writeAll("#define __ARM_FEATURE_RCPC 3\n"); | |
| 714 | } else if (comp.target.cpu.has(.aarch64, .rcpc)) { | |
| 715 | try define(w, "__ARM_FEATURE_RCPC"); | |
| 716 | } | |
| 717 | ||
| 718 | const features = comp.target.cpu.features; | |
| 719 | for ([_]struct { std.Target.aarch64.Feature, []const u8 }{ | |
| 720 | .{ .sve, "SVE" }, | |
| 721 | .{ .sve2, "SVE2" }, | |
| 722 | .{ .sve2p1, "SVE2p1" }, | |
| 723 | .{ .sve2_sha3, "SVE2_SHA3" }, | |
| 724 | .{ .sve2_sm4, "SVE2_SM4" }, | |
| 725 | .{ .sve_b16b16, "SVE_B16B16" }, | |
| 726 | .{ .sme2, "SME2" }, | |
| 727 | .{ .sme2p1, "SME2p1" }, | |
| 728 | .{ .sme_f16f16, "SME_F16F16" }, | |
| 729 | .{ .sme_b16b16, "SME_B16B16" }, | |
| 730 | .{ .crc, "CRC32" }, | |
| 731 | .{ .aes, "AES" }, | |
| 732 | .{ .sha2, "SHA2" }, | |
| 733 | .{ .pauth, "PAUTH" }, | |
| 734 | .{ .pauth_lr, "PAUTH_LR" }, | |
| 735 | .{ .bti, "BTI" }, | |
| 736 | .{ .fullfp16, "FP16_SCALAR_ARITHMETIC" }, | |
| 737 | .{ .dotprod, "DOTPROD" }, | |
| 738 | .{ .mte, "MEMORY_TAGGING" }, | |
| 739 | .{ .tme, "TME" }, | |
| 740 | .{ .i8mm, "MATMUL_INT8" }, | |
| 741 | .{ .lse, "ATOMICS" }, | |
| 742 | .{ .f64mm, "SVE_MATMUL_FP64" }, | |
| 743 | .{ .f32mm, "SVE_MATMUL_FP32" }, | |
| 744 | .{ .i8mm, "SVE_MATMUL_INT8" }, | |
| 745 | .{ .fp16fml, "FP16_FML" }, | |
| 746 | .{ .ls64, "LS64" }, | |
| 747 | .{ .rand, "RNG" }, | |
| 748 | .{ .mops, "MOPS" }, | |
| 749 | .{ .d128, "SYSREG128" }, | |
| 750 | .{ .gcs, "GCS" }, | |
| 751 | }) |fs| { | |
| 752 | if (features.isEnabled(@intFromEnum(fs[0]))) { | |
| 753 | try w.print("#define __ARM_FEATURE_{s} 1\n", .{fs[1]}); | |
| 754 | } | |
| 755 | } | |
| 756 | }, | |
| 757 | .msp430 => { | |
| 758 | try define(w, "MSP430"); | |
| 759 | try define(w, "__MSP430__"); | |
| 760 | }, | |
| 761 | .arc => { | |
| 762 | try define(w, "__arc__"); | |
| 763 | }, | |
| 764 | .wasm32, .wasm64 => { | |
| 765 | try define(w, "__wasm"); | |
| 766 | try define(w, "__wasm__"); | |
| 767 | if (comp.target.cpu.arch == .wasm32) { | |
| 768 | try define(w, "__wasm32"); | |
| 769 | try define(w, "__wasm32__"); | |
| 770 | } else { | |
| 771 | try define(w, "__wasm64"); | |
| 772 | try define(w, "__wasm64__"); | |
| 773 | } | |
| 774 | ||
| 775 | for (comp.target.cpu.arch.allFeaturesList()) |feature| { | |
| 776 | if (!comp.target.cpu.features.isEnabled(feature.index)) continue; | |
| 777 | try w.print("#define __wasm_{s}__ 1\n", .{feature.name}); | |
| 778 | } | |
| 779 | }, | |
| 393 | 780 | else => {}, |
| 394 | 781 | } |
| 395 | 782 | |
| 396 | if (comp.target.os.tag != .windows) switch (ptr_width) { | |
| 397 | 64 => try w.writeAll( | |
| 398 | \\#define _LP64 1 | |
| 399 | \\#define __LP64__ 1 | |
| 400 | \\ | |
| 401 | ), | |
| 402 | 32 => try w.writeAll("#define _ILP32 1\n"), | |
| 403 | else => {}, | |
| 404 | }; | |
| 783 | if (ptr_width == 64 and comp.target.cTypeBitSize(.long) == 32) { | |
| 784 | try define(w, "_LP64"); | |
| 785 | try define(w, "__LP64__"); | |
| 786 | } else if (ptr_width == 32 and comp.target.cTypeBitSize(.long) == 32 and | |
| 787 | comp.target.cTypeBitSize(.int) == 32) | |
| 788 | { | |
| 789 | try define(w, "_ILP32"); | |
| 790 | try define(w, "__ILP32__"); | |
| 791 | } | |
| 792 | ||
| 793 | if (comp.hasFloat128()) { | |
| 794 | try define(w, "__FLOAT128__"); | |
| 795 | } | |
| 405 | 796 | |
| 406 | 797 | try w.writeAll( |
| 407 | 798 | \\#define __ORDER_LITTLE_ENDIAN__ 1234 |
| ... | ... | @@ -419,6 +810,21 @@ fn generateSystemDefines(comp: *Compilation, w: *Writer) !void { |
| 419 | 810 | \\ |
| 420 | 811 | ); |
| 421 | 812 | |
| 813 | switch (comp.target.ofmt) { | |
| 814 | .elf => try define(w, "__ELF__"), | |
| 815 | .macho => try define(w, "__MACH__"), | |
| 816 | else => {}, | |
| 817 | } | |
| 818 | ||
| 819 | if (comp.target.os.tag.isDarwin()) { | |
| 820 | try w.writeAll( | |
| 821 | \\#define __nonnull _Nonnull | |
| 822 | \\#define __null_unspecified _Null_unspecified | |
| 823 | \\#define __nullable _Nullable | |
| 824 | \\ | |
| 825 | ); | |
| 826 | } | |
| 827 | ||
| 422 | 828 | // atomics |
| 423 | 829 | try w.writeAll( |
| 424 | 830 | \\#define __ATOMIC_RELAXED 0 |
| ... | ... | @@ -454,62 +860,61 @@ fn generateSystemDefines(comp: *Compilation, w: *Writer) !void { |
| 454 | 860 | try w.writeAll("#define __CHAR_BIT__ 8\n"); |
| 455 | 861 | |
| 456 | 862 | // int maxs |
| 457 | try comp.generateIntWidth(w, "BOOL", .{ .specifier = .bool }); | |
| 458 | try comp.generateIntMaxAndWidth(w, "SCHAR", .{ .specifier = .schar }); | |
| 459 | try comp.generateIntMaxAndWidth(w, "SHRT", .{ .specifier = .short }); | |
| 460 | try comp.generateIntMaxAndWidth(w, "INT", .{ .specifier = .int }); | |
| 461 | try comp.generateIntMaxAndWidth(w, "LONG", .{ .specifier = .long }); | |
| 462 | try comp.generateIntMaxAndWidth(w, "LONG_LONG", .{ .specifier = .long_long }); | |
| 463 | try comp.generateIntMaxAndWidth(w, "WCHAR", comp.types.wchar); | |
| 464 | // try comp.generateIntMax(w, "WINT", comp.types.wchar); | |
| 465 | try comp.generateIntMaxAndWidth(w, "INTMAX", comp.types.intmax); | |
| 466 | try comp.generateIntMaxAndWidth(w, "SIZE", comp.types.size); | |
| 467 | try comp.generateIntMaxAndWidth(w, "UINTMAX", comp.types.intmax.makeIntegerUnsigned()); | |
| 468 | try comp.generateIntMaxAndWidth(w, "PTRDIFF", comp.types.ptrdiff); | |
| 469 | try comp.generateIntMaxAndWidth(w, "INTPTR", comp.types.intptr); | |
| 470 | try comp.generateIntMaxAndWidth(w, "UINTPTR", comp.types.intptr.makeIntegerUnsigned()); | |
| 863 | try comp.generateIntWidth(w, "BOOL", .bool); | |
| 864 | try comp.generateIntMaxAndWidth(w, "SCHAR", .schar); | |
| 865 | try comp.generateIntMaxAndWidth(w, "SHRT", .short); | |
| 866 | try comp.generateIntMaxAndWidth(w, "INT", .int); | |
| 867 | try comp.generateIntMaxAndWidth(w, "LONG", .long); | |
| 868 | try comp.generateIntMaxAndWidth(w, "LONG_LONG", .long_long); | |
| 869 | try comp.generateIntMaxAndWidth(w, "WCHAR", comp.type_store.wchar); | |
| 870 | // try comp.generateIntMax(w, "WINT", comp.type_store.wchar); | |
| 871 | try comp.generateIntMaxAndWidth(w, "INTMAX", comp.type_store.intmax); | |
| 872 | try comp.generateIntMaxAndWidth(w, "SIZE", comp.type_store.size); | |
| 873 | try comp.generateIntMaxAndWidth(w, "UINTMAX", try comp.type_store.intmax.makeIntUnsigned(comp)); | |
| 874 | try comp.generateIntMaxAndWidth(w, "PTRDIFF", comp.type_store.ptrdiff); | |
| 875 | try comp.generateIntMaxAndWidth(w, "INTPTR", comp.type_store.intptr); | |
| 876 | try comp.generateIntMaxAndWidth(w, "UINTPTR", try comp.type_store.intptr.makeIntUnsigned(comp)); | |
| 471 | 877 | try comp.generateIntMaxAndWidth(w, "SIG_ATOMIC", target_util.sigAtomicType(comp.target)); |
| 472 | 878 | |
| 473 | 879 | // int widths |
| 474 | 880 | try w.print("#define __BITINT_MAXWIDTH__ {d}\n", .{bit_int_max_bits}); |
| 475 | 881 | |
| 476 | 882 | // sizeof types |
| 477 | try comp.generateSizeofType(w, "__SIZEOF_FLOAT__", .{ .specifier = .float }); | |
| 478 | try comp.generateSizeofType(w, "__SIZEOF_DOUBLE__", .{ .specifier = .double }); | |
| 479 | try comp.generateSizeofType(w, "__SIZEOF_LONG_DOUBLE__", .{ .specifier = .long_double }); | |
| 480 | try comp.generateSizeofType(w, "__SIZEOF_SHORT__", .{ .specifier = .short }); | |
| 481 | try comp.generateSizeofType(w, "__SIZEOF_INT__", .{ .specifier = .int }); | |
| 482 | try comp.generateSizeofType(w, "__SIZEOF_LONG__", .{ .specifier = .long }); | |
| 483 | try comp.generateSizeofType(w, "__SIZEOF_LONG_LONG__", .{ .specifier = .long_long }); | |
| 484 | try comp.generateSizeofType(w, "__SIZEOF_POINTER__", .{ .specifier = .pointer }); | |
| 485 | try comp.generateSizeofType(w, "__SIZEOF_PTRDIFF_T__", comp.types.ptrdiff); | |
| 486 | try comp.generateSizeofType(w, "__SIZEOF_SIZE_T__", comp.types.size); | |
| 487 | try comp.generateSizeofType(w, "__SIZEOF_WCHAR_T__", comp.types.wchar); | |
| 488 | // try comp.generateSizeofType(w, "__SIZEOF_WINT_T__", .{ .specifier = .pointer }); | |
| 883 | try comp.generateSizeofType(w, "__SIZEOF_FLOAT__", .float); | |
| 884 | try comp.generateSizeofType(w, "__SIZEOF_DOUBLE__", .double); | |
| 885 | try comp.generateSizeofType(w, "__SIZEOF_LONG_DOUBLE__", .long_double); | |
| 886 | try comp.generateSizeofType(w, "__SIZEOF_SHORT__", .short); | |
| 887 | try comp.generateSizeofType(w, "__SIZEOF_INT__", .int); | |
| 888 | try comp.generateSizeofType(w, "__SIZEOF_LONG__", .long); | |
| 889 | try comp.generateSizeofType(w, "__SIZEOF_LONG_LONG__", .long_long); | |
| 890 | try comp.generateSizeofType(w, "__SIZEOF_POINTER__", .void_pointer); | |
| 891 | try comp.generateSizeofType(w, "__SIZEOF_PTRDIFF_T__", comp.type_store.ptrdiff); | |
| 892 | try comp.generateSizeofType(w, "__SIZEOF_SIZE_T__", comp.type_store.size); | |
| 893 | try comp.generateSizeofType(w, "__SIZEOF_WCHAR_T__", comp.type_store.wchar); | |
| 894 | // try comp.generateSizeofType(w, "__SIZEOF_WINT_T__", .void_pointer); | |
| 489 | 895 | |
| 490 | 896 | if (target_util.hasInt128(comp.target)) { |
| 491 | try comp.generateSizeofType(w, "__SIZEOF_INT128__", .{ .specifier = .int128 }); | |
| 897 | try comp.generateSizeofType(w, "__SIZEOF_INT128__", .int128); | |
| 492 | 898 | } |
| 493 | 899 | |
| 494 | 900 | // various int types |
| 495 | const mapper = comp.string_interner.getSlowTypeMapper(); | |
| 496 | try generateTypeMacro(w, mapper, "__INTPTR_TYPE__", comp.types.intptr, comp.langopts); | |
| 497 | try generateTypeMacro(w, mapper, "__UINTPTR_TYPE__", comp.types.intptr.makeIntegerUnsigned(), comp.langopts); | |
| 901 | try comp.generateTypeMacro(w, "__INTPTR_TYPE__", comp.type_store.intptr); | |
| 902 | try comp.generateTypeMacro(w, "__UINTPTR_TYPE__", try comp.type_store.intptr.makeIntUnsigned(comp)); | |
| 498 | 903 | |
| 499 | try generateTypeMacro(w, mapper, "__INTMAX_TYPE__", comp.types.intmax, comp.langopts); | |
| 500 | try comp.generateSuffixMacro("__INTMAX", w, comp.types.intptr); | |
| 904 | try comp.generateTypeMacro(w, "__INTMAX_TYPE__", comp.type_store.intmax); | |
| 905 | try comp.generateSuffixMacro("__INTMAX", w, comp.type_store.intptr); | |
| 501 | 906 | |
| 502 | try generateTypeMacro(w, mapper, "__UINTMAX_TYPE__", comp.types.intmax.makeIntegerUnsigned(), comp.langopts); | |
| 503 | try comp.generateSuffixMacro("__UINTMAX", w, comp.types.intptr.makeIntegerUnsigned()); | |
| 907 | try comp.generateTypeMacro(w, "__UINTMAX_TYPE__", try comp.type_store.intmax.makeIntUnsigned(comp)); | |
| 908 | try comp.generateSuffixMacro("__UINTMAX", w, try comp.type_store.intptr.makeIntUnsigned(comp)); | |
| 504 | 909 | |
| 505 | try generateTypeMacro(w, mapper, "__PTRDIFF_TYPE__", comp.types.ptrdiff, comp.langopts); | |
| 506 | try generateTypeMacro(w, mapper, "__SIZE_TYPE__", comp.types.size, comp.langopts); | |
| 507 | try generateTypeMacro(w, mapper, "__WCHAR_TYPE__", comp.types.wchar, comp.langopts); | |
| 508 | try generateTypeMacro(w, mapper, "__CHAR16_TYPE__", comp.types.uint_least16_t, comp.langopts); | |
| 509 | try generateTypeMacro(w, mapper, "__CHAR32_TYPE__", comp.types.uint_least32_t, comp.langopts); | |
| 910 | try comp.generateTypeMacro(w, "__PTRDIFF_TYPE__", comp.type_store.ptrdiff); | |
| 911 | try comp.generateTypeMacro(w, "__SIZE_TYPE__", comp.type_store.size); | |
| 912 | try comp.generateTypeMacro(w, "__WCHAR_TYPE__", comp.type_store.wchar); | |
| 913 | try comp.generateTypeMacro(w, "__CHAR16_TYPE__", comp.type_store.uint_least16_t); | |
| 914 | try comp.generateTypeMacro(w, "__CHAR32_TYPE__", comp.type_store.uint_least32_t); | |
| 510 | 915 | |
| 511 | try comp.generateExactWidthTypes(w, mapper); | |
| 512 | try comp.generateFastAndLeastWidthTypes(w, mapper); | |
| 916 | try comp.generateExactWidthTypes(w); | |
| 917 | try comp.generateFastAndLeastWidthTypes(w); | |
| 513 | 918 | |
| 514 | 919 | if (target_util.FPSemantics.halfPrecisionType(comp.target)) |half| { |
| 515 | 920 | try generateFloatMacros(w, "FLT16", half, "F16"); |
| ... | ... | @@ -528,26 +933,47 @@ fn generateSystemDefines(comp: *Compilation, w: *Writer) !void { |
| 528 | 933 | \\#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__ |
| 529 | 934 | \\ |
| 530 | 935 | ); |
| 936 | ||
| 937 | switch (comp.code_gen_options.pic_level) { | |
| 938 | .none => {}, | |
| 939 | .one, .two => { | |
| 940 | try w.print( | |
| 941 | \\#define __pic__ {0d} | |
| 942 | \\#define __PIC__ {0d} | |
| 943 | \\ | |
| 944 | , .{@intFromEnum(comp.code_gen_options.pic_level)}); | |
| 945 | if (comp.code_gen_options.is_pie) { | |
| 946 | try w.print( | |
| 947 | \\#define __pie__ {0d} | |
| 948 | \\#define __PIE__ {0d} | |
| 949 | \\ | |
| 950 | , .{@intFromEnum(comp.code_gen_options.pic_level)}); | |
| 951 | } | |
| 952 | }, | |
| 953 | } | |
| 531 | 954 | } |
| 532 | 955 | |
| 533 | 956 | /// Generate builtin macros that will be available to each source file. |
| 534 | pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefinesMode) !Source { | |
| 535 | try comp.generateBuiltinTypes(); | |
| 957 | pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefinesMode) AddSourceError!Source { | |
| 958 | try comp.type_store.initNamedTypes(comp); | |
| 536 | 959 | |
| 537 | var allocating: std.Io.Writer.Allocating = .init(comp.gpa); | |
| 960 | var allocating: std.Io.Writer.Allocating = try .initCapacity(comp.gpa, 2 << 13); | |
| 538 | 961 | defer allocating.deinit(); |
| 539 | 962 | |
| 540 | generateBuiltinMacrosWriter(comp, system_defines_mode, &allocating.writer) catch |err| switch (err) { | |
| 541 | error.WriteFailed => return error.OutOfMemory, | |
| 542 | else => |e| return e, | |
| 963 | comp.writeBuiltinMacros(system_defines_mode, &allocating.writer) catch |err| switch (err) { | |
| 964 | error.WriteFailed, error.OutOfMemory => return error.OutOfMemory, | |
| 543 | 965 | }; |
| 544 | 966 | |
| 545 | return comp.addSourceFromBuffer("<builtin>", allocating.written()); | |
| 967 | if (allocating.written().len > std.math.maxInt(u32)) return error.FileTooBig; | |
| 968 | ||
| 969 | const contents = try allocating.toOwnedSlice(); | |
| 970 | errdefer comp.gpa.free(contents); | |
| 971 | return comp.addSourceFromOwnedBuffer("<builtin>", contents, .user); | |
| 546 | 972 | } |
| 547 | 973 | |
| 548 | pub fn generateBuiltinMacrosWriter(comp: *Compilation, system_defines_mode: SystemDefinesMode, buf: *Writer) !void { | |
| 974 | fn writeBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefinesMode, w: *std.Io.Writer) !void { | |
| 549 | 975 | if (system_defines_mode == .include_system_defines) { |
| 550 | try buf.writeAll( | |
| 976 | try w.writeAll( | |
| 551 | 977 | \\#define __VERSION__ "Aro |
| 552 | 978 | ++ " " ++ @import("../backend.zig").version_str ++ "\"\n" ++ |
| 553 | 979 | \\#define __Aro__ |
| ... | ... | @@ -555,14 +981,13 @@ pub fn generateBuiltinMacrosWriter(comp: *Compilation, system_defines_mode: Syst |
| 555 | 981 | ); |
| 556 | 982 | } |
| 557 | 983 | |
| 558 | try buf.writeAll("#define __STDC__ 1\n"); | |
| 559 | try buf.print("#define __STDC_HOSTED__ {d}\n", .{@intFromBool(comp.target.os.tag != .freestanding)}); | |
| 984 | if (comp.langopts.emulate != .msvc) { | |
| 985 | try w.writeAll("#define __STDC__ 1\n"); | |
| 986 | } | |
| 987 | try w.print("#define __STDC_HOSTED__ {d}\n", .{@intFromBool(comp.target.os.tag != .freestanding)}); | |
| 560 | 988 | |
| 561 | 989 | // standard macros |
| 562 | try buf.writeAll( | |
| 563 | \\#define __STDC_NO_COMPLEX__ 1 | |
| 564 | \\#define __STDC_NO_THREADS__ 1 | |
| 565 | \\#define __STDC_NO_VLA__ 1 | |
| 990 | try w.writeAll( | |
| 566 | 991 | \\#define __STDC_UTF_16__ 1 |
| 567 | 992 | \\#define __STDC_UTF_32__ 1 |
| 568 | 993 | \\#define __STDC_EMBED_NOT_FOUND__ 0 |
| ... | ... | @@ -570,22 +995,38 @@ pub fn generateBuiltinMacrosWriter(comp: *Compilation, system_defines_mode: Syst |
| 570 | 995 | \\#define __STDC_EMBED_EMPTY__ 2 |
| 571 | 996 | \\ |
| 572 | 997 | ); |
| 998 | if (comp.langopts.standard.atLeast(.c11)) switch (comp.target.os.tag) { | |
| 999 | .openbsd, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => { | |
| 1000 | try w.writeAll("#define __STDC_NO_THREADS__ 1\n"); | |
| 1001 | }, | |
| 1002 | .ps4, .ps5 => { | |
| 1003 | try w.writeAll( | |
| 1004 | \\#define __STDC_NO_THREADS__ 1 | |
| 1005 | \\#define __STDC_NO_COMPLEX__ 1 | |
| 1006 | \\ | |
| 1007 | ); | |
| 1008 | }, | |
| 1009 | .aix => { | |
| 1010 | try w.writeAll( | |
| 1011 | \\#define __STDC_NO_THREADS__ 1 | |
| 1012 | \\#define __STDC_NO_ATOMICS__ 1 | |
| 1013 | \\ | |
| 1014 | ); | |
| 1015 | }, | |
| 1016 | else => {}, | |
| 1017 | }; | |
| 573 | 1018 | if (comp.langopts.standard.StdCVersionMacro()) |stdc_version| { |
| 574 | try buf.writeAll("#define __STDC_VERSION__ "); | |
| 575 | try buf.writeAll(stdc_version); | |
| 576 | try buf.writeByte('\n'); | |
| 1019 | try w.writeAll("#define __STDC_VERSION__ "); | |
| 1020 | try w.writeAll(stdc_version); | |
| 1021 | try w.writeByte('\n'); | |
| 577 | 1022 | } |
| 578 | 1023 | |
| 579 | // timestamps | |
| 580 | const timestamp = try comp.getTimestamp(); | |
| 581 | try generateDateAndTime(buf, timestamp); | |
| 582 | ||
| 583 | 1024 | if (system_defines_mode == .include_system_defines) { |
| 584 | try comp.generateSystemDefines(buf); | |
| 1025 | try comp.generateSystemDefines(w); | |
| 585 | 1026 | } |
| 586 | 1027 | } |
| 587 | 1028 | |
| 588 | fn generateFloatMacros(w: *Writer, prefix: []const u8, semantics: target_util.FPSemantics, ext: []const u8) !void { | |
| 1029 | fn generateFloatMacros(w: *std.Io.Writer, prefix: []const u8, semantics: target_util.FPSemantics, ext: []const u8) !void { | |
| 589 | 1030 | const denormMin = semantics.chooseValue( |
| 590 | 1031 | []const u8, |
| 591 | 1032 | .{ |
| ... | ... | @@ -641,137 +1082,61 @@ fn generateFloatMacros(w: *Writer, prefix: []const u8, semantics: target_util.FP |
| 641 | 1082 | }, |
| 642 | 1083 | ); |
| 643 | 1084 | |
| 644 | var def_prefix_buf: [32]u8 = undefined; | |
| 645 | const prefix_slice = std.fmt.bufPrint(&def_prefix_buf, "__{s}_", .{prefix}) catch | |
| 646 | return error.OutOfMemory; | |
| 647 | ||
| 648 | try w.print("#define {s}DENORM_MIN__ {s}{s}\n", .{ prefix_slice, denormMin, ext }); | |
| 649 | try w.print("#define {s}HAS_DENORM__\n", .{prefix_slice}); | |
| 650 | try w.print("#define {s}DIG__ {d}\n", .{ prefix_slice, digits }); | |
| 651 | try w.print("#define {s}DECIMAL_DIG__ {d}\n", .{ prefix_slice, decimalDigits }); | |
| 1085 | try w.print("#define __{s}_DENORM_MIN__ {s}{s}\n", .{ prefix, denormMin, ext }); | |
| 1086 | try w.print("#define __{s}_HAS_DENORM__\n", .{prefix}); | |
| 1087 | try w.print("#define __{s}_DIG__ {d}\n", .{ prefix, digits }); | |
| 1088 | try w.print("#define __{s}_DECIMAL_DIG__ {d}\n", .{ prefix, decimalDigits }); | |
| 652 | 1089 | |
| 653 | try w.print("#define {s}EPSILON__ {s}{s}\n", .{ prefix_slice, epsilon, ext }); | |
| 654 | try w.print("#define {s}HAS_INFINITY__\n", .{prefix_slice}); | |
| 655 | try w.print("#define {s}HAS_QUIET_NAN__\n", .{prefix_slice}); | |
| 656 | try w.print("#define {s}MANT_DIG__ {d}\n", .{ prefix_slice, mantissaDigits }); | |
| 1090 | try w.print("#define __{s}_EPSILON__ {s}{s}\n", .{ prefix, epsilon, ext }); | |
| 1091 | try w.print("#define __{s}_HAS_INFINITY__\n", .{prefix}); | |
| 1092 | try w.print("#define __{s}_HAS_QUIET_NAN__\n", .{prefix}); | |
| 1093 | try w.print("#define __{s}_MANT_DIG__ {d}\n", .{ prefix, mantissaDigits }); | |
| 657 | 1094 | |
| 658 | try w.print("#define {s}MAX_10_EXP__ {d}\n", .{ prefix_slice, max10Exp }); | |
| 659 | try w.print("#define {s}MAX_EXP__ {d}\n", .{ prefix_slice, maxExp }); | |
| 660 | try w.print("#define {s}MAX__ {s}{s}\n", .{ prefix_slice, max, ext }); | |
| 1095 | try w.print("#define __{s}_MAX_10_EXP__ {d}\n", .{ prefix, max10Exp }); | |
| 1096 | try w.print("#define __{s}_MAX_EXP__ {d}\n", .{ prefix, maxExp }); | |
| 1097 | try w.print("#define __{s}_MAX__ {s}{s}\n", .{ prefix, max, ext }); | |
| 661 | 1098 | |
| 662 | try w.print("#define {s}MIN_10_EXP__ ({d})\n", .{ prefix_slice, min10Exp }); | |
| 663 | try w.print("#define {s}MIN_EXP__ ({d})\n", .{ prefix_slice, minExp }); | |
| 664 | try w.print("#define {s}MIN__ {s}{s}\n", .{ prefix_slice, min, ext }); | |
| 1099 | try w.print("#define __{s}_MIN_10_EXP__ ({d})\n", .{ prefix, min10Exp }); | |
| 1100 | try w.print("#define __{s}_MIN_EXP__ ({d})\n", .{ prefix, minExp }); | |
| 1101 | try w.print("#define __{s}_MIN__ {s}{s}\n", .{ prefix, min, ext }); | |
| 665 | 1102 | } |
| 666 | 1103 | |
| 667 | fn generateTypeMacro(w: *Writer, mapper: StrInt.TypeMapper, name: []const u8, ty: Type, langopts: LangOpts) !void { | |
| 1104 | fn generateTypeMacro(comp: *const Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { | |
| 668 | 1105 | try w.print("#define {s} ", .{name}); |
| 669 | try ty.print(mapper, langopts, w); | |
| 1106 | try qt.print(comp, w); | |
| 670 | 1107 | try w.writeByte('\n'); |
| 671 | 1108 | } |
| 672 | 1109 | |
| 673 | fn generateBuiltinTypes(comp: *Compilation) !void { | |
| 674 | const os = comp.target.os.tag; | |
| 675 | const wchar: Type = switch (comp.target.cpu.arch) { | |
| 676 | .xcore => .{ .specifier = .uchar }, | |
| 677 | .ve, .msp430 => .{ .specifier = .uint }, | |
| 678 | .arm, .armeb, .thumb, .thumbeb => .{ | |
| 679 | .specifier = if (os != .windows and os != .netbsd and os != .openbsd) .uint else .int, | |
| 680 | }, | |
| 681 | .aarch64, .aarch64_be => .{ | |
| 682 | .specifier = if (!os.isDarwin() and os != .netbsd) .uint else .int, | |
| 683 | }, | |
| 684 | .x86_64, .x86 => .{ .specifier = if (os == .windows) .ushort else .int }, | |
| 685 | else => .{ .specifier = .int }, | |
| 686 | }; | |
| 687 | ||
| 688 | const ptr_width = comp.target.ptrBitWidth(); | |
| 689 | const ptrdiff = if (os == .windows and ptr_width == 64) | |
| 690 | Type{ .specifier = .long_long } | |
| 691 | else switch (ptr_width) { | |
| 692 | 16 => Type{ .specifier = .int }, | |
| 693 | 32 => Type{ .specifier = .int }, | |
| 694 | 64 => Type{ .specifier = .long }, | |
| 695 | else => unreachable, | |
| 696 | }; | |
| 697 | ||
| 698 | const size = if (os == .windows and ptr_width == 64) | |
| 699 | Type{ .specifier = .ulong_long } | |
| 700 | else switch (ptr_width) { | |
| 701 | 16 => Type{ .specifier = .uint }, | |
| 702 | 32 => Type{ .specifier = .uint }, | |
| 703 | 64 => Type{ .specifier = .ulong }, | |
| 704 | else => unreachable, | |
| 705 | }; | |
| 706 | ||
| 707 | const va_list = try comp.generateVaListType(); | |
| 708 | ||
| 709 | const pid_t: Type = switch (os) { | |
| 710 | .haiku => .{ .specifier = .long }, | |
| 711 | // Todo: pid_t is required to "a signed integer type"; are there any systems | |
| 712 | // on which it is `short int`? | |
| 713 | else => .{ .specifier = .int }, | |
| 714 | }; | |
| 715 | ||
| 716 | const intmax = target_util.intMaxType(comp.target); | |
| 717 | const intptr = target_util.intPtrType(comp.target); | |
| 718 | const int16 = target_util.int16Type(comp.target); | |
| 719 | const int64 = target_util.int64Type(comp.target); | |
| 720 | ||
| 721 | comp.types = .{ | |
| 722 | .wchar = wchar, | |
| 723 | .ptrdiff = ptrdiff, | |
| 724 | .size = size, | |
| 725 | .va_list = va_list, | |
| 726 | .pid_t = pid_t, | |
| 727 | .intmax = intmax, | |
| 728 | .intptr = intptr, | |
| 729 | .int16 = int16, | |
| 730 | .int64 = int64, | |
| 731 | .uint_least16_t = comp.intLeastN(16, .unsigned), | |
| 732 | .uint_least32_t = comp.intLeastN(32, .unsigned), | |
| 733 | }; | |
| 734 | ||
| 735 | try comp.generateNsConstantStringType(); | |
| 736 | } | |
| 737 | ||
| 738 | pub fn float80Type(comp: *const Compilation) ?Type { | |
| 1110 | pub fn float80Type(comp: *const Compilation) ?QualType { | |
| 739 | 1111 | if (comp.langopts.emulate != .gcc) return null; |
| 740 | 1112 | return target_util.float80Type(comp.target); |
| 741 | 1113 | } |
| 742 | 1114 | |
| 743 | 1115 | /// Smallest integer type with at least N bits |
| 744 | pub fn intLeastN(comp: *const Compilation, bits: usize, signedness: std.builtin.Signedness) Type { | |
| 1116 | pub fn intLeastN(comp: *const Compilation, bits: usize, signedness: std.builtin.Signedness) QualType { | |
| 745 | 1117 | if (bits == 64 and (comp.target.os.tag.isDarwin() or comp.target.cpu.arch.isWasm())) { |
| 746 | 1118 | // WebAssembly and Darwin use `long long` for `int_least64_t` and `int_fast64_t`. |
| 747 | return .{ .specifier = if (signedness == .signed) .long_long else .ulong_long }; | |
| 1119 | return if (signedness == .signed) .long_long else .ulong_long; | |
| 748 | 1120 | } |
| 749 | 1121 | if (bits == 16 and comp.target.cpu.arch == .avr) { |
| 750 | 1122 | // AVR uses int for int_least16_t and int_fast16_t. |
| 751 | return .{ .specifier = if (signedness == .signed) .int else .uint }; | |
| 1123 | return if (signedness == .signed) .int else .uint; | |
| 752 | 1124 | } |
| 753 | const candidates = switch (signedness) { | |
| 754 | .signed => &[_]Type.Specifier{ .schar, .short, .int, .long, .long_long }, | |
| 755 | .unsigned => &[_]Type.Specifier{ .uchar, .ushort, .uint, .ulong, .ulong_long }, | |
| 1125 | const candidates: [5]QualType = switch (signedness) { | |
| 1126 | .signed => .{ .schar, .short, .int, .long, .long_long }, | |
| 1127 | .unsigned => .{ .uchar, .ushort, .uint, .ulong, .ulong_long }, | |
| 756 | 1128 | }; |
| 757 | for (candidates) |specifier| { | |
| 758 | const ty: Type = .{ .specifier = specifier }; | |
| 759 | if (ty.sizeof(comp).? * 8 >= bits) return ty; | |
| 1129 | for (candidates) |qt| { | |
| 1130 | if (qt.bitSizeof(comp) >= bits) return qt; | |
| 760 | 1131 | } else unreachable; |
| 761 | 1132 | } |
| 762 | 1133 | |
| 763 | fn intSize(comp: *const Compilation, specifier: Type.Specifier) u64 { | |
| 764 | const ty = Type{ .specifier = specifier }; | |
| 765 | return ty.sizeof(comp).?; | |
| 766 | } | |
| 767 | ||
| 768 | 1134 | fn generateFastOrLeastType( |
| 769 | 1135 | comp: *Compilation, |
| 770 | 1136 | bits: usize, |
| 771 | 1137 | kind: enum { least, fast }, |
| 772 | 1138 | signedness: std.builtin.Signedness, |
| 773 | w: *Writer, | |
| 774 | mapper: StrInt.TypeMapper, | |
| 1139 | w: *std.Io.Writer, | |
| 775 | 1140 | ) !void { |
| 776 | 1141 | const ty = comp.intLeastN(bits, signedness); // defining the fast types as the least types is permitted |
| 777 | 1142 | |
| ... | ... | @@ -788,9 +1153,9 @@ fn generateFastOrLeastType( |
| 788 | 1153 | |
| 789 | 1154 | const full = std.fmt.bufPrint(&buf, "{s}{s}{d}{s}", .{ |
| 790 | 1155 | base_name, kind_str, bits, suffix, |
| 791 | }) catch return error.OutOfMemory; | |
| 1156 | }) catch unreachable; | |
| 792 | 1157 | |
| 793 | try generateTypeMacro(w, mapper, full, ty, comp.langopts); | |
| 1158 | try comp.generateTypeMacro(w, full, ty); | |
| 794 | 1159 | |
| 795 | 1160 | const prefix = full[2 .. full.len - suffix.len]; // remove "__" and "_TYPE__" |
| 796 | 1161 | |
| ... | ... | @@ -801,104 +1166,104 @@ fn generateFastOrLeastType( |
| 801 | 1166 | try comp.generateFmt(prefix, w, ty); |
| 802 | 1167 | } |
| 803 | 1168 | |
| 804 | fn generateFastAndLeastWidthTypes(comp: *Compilation, w: *Writer, mapper: StrInt.TypeMapper) !void { | |
| 1169 | fn generateFastAndLeastWidthTypes(comp: *Compilation, w: *std.Io.Writer) !void { | |
| 805 | 1170 | const sizes = [_]usize{ 8, 16, 32, 64 }; |
| 806 | 1171 | for (sizes) |size| { |
| 807 | try comp.generateFastOrLeastType(size, .least, .signed, w, mapper); | |
| 808 | try comp.generateFastOrLeastType(size, .least, .unsigned, w, mapper); | |
| 809 | try comp.generateFastOrLeastType(size, .fast, .signed, w, mapper); | |
| 810 | try comp.generateFastOrLeastType(size, .fast, .unsigned, w, mapper); | |
| 1172 | try comp.generateFastOrLeastType(size, .least, .signed, w); | |
| 1173 | try comp.generateFastOrLeastType(size, .least, .unsigned, w); | |
| 1174 | try comp.generateFastOrLeastType(size, .fast, .signed, w); | |
| 1175 | try comp.generateFastOrLeastType(size, .fast, .unsigned, w); | |
| 811 | 1176 | } |
| 812 | 1177 | } |
| 813 | 1178 | |
| 814 | fn generateExactWidthTypes(comp: *const Compilation, w: *Writer, mapper: StrInt.TypeMapper) !void { | |
| 815 | try comp.generateExactWidthType(w, mapper, .schar); | |
| 1179 | fn generateExactWidthTypes(comp: *Compilation, w: *std.Io.Writer) !void { | |
| 1180 | try comp.generateExactWidthType(w, .schar); | |
| 816 | 1181 | |
| 817 | if (comp.intSize(.short) > comp.intSize(.char)) { | |
| 818 | try comp.generateExactWidthType(w, mapper, .short); | |
| 1182 | if (QualType.short.sizeof(comp) > QualType.char.sizeof(comp)) { | |
| 1183 | try comp.generateExactWidthType(w, .short); | |
| 819 | 1184 | } |
| 820 | 1185 | |
| 821 | if (comp.intSize(.int) > comp.intSize(.short)) { | |
| 822 | try comp.generateExactWidthType(w, mapper, .int); | |
| 1186 | if (QualType.int.sizeof(comp) > QualType.short.sizeof(comp)) { | |
| 1187 | try comp.generateExactWidthType(w, .int); | |
| 823 | 1188 | } |
| 824 | 1189 | |
| 825 | if (comp.intSize(.long) > comp.intSize(.int)) { | |
| 826 | try comp.generateExactWidthType(w, mapper, .long); | |
| 1190 | if (QualType.long.sizeof(comp) > QualType.int.sizeof(comp)) { | |
| 1191 | try comp.generateExactWidthType(w, .long); | |
| 827 | 1192 | } |
| 828 | 1193 | |
| 829 | if (comp.intSize(.long_long) > comp.intSize(.long)) { | |
| 830 | try comp.generateExactWidthType(w, mapper, .long_long); | |
| 1194 | if (QualType.long_long.sizeof(comp) > QualType.long.sizeof(comp)) { | |
| 1195 | try comp.generateExactWidthType(w, .long_long); | |
| 831 | 1196 | } |
| 832 | 1197 | |
| 833 | try comp.generateExactWidthType(w, mapper, .uchar); | |
| 1198 | try comp.generateExactWidthType(w, .uchar); | |
| 834 | 1199 | try comp.generateExactWidthIntMax(w, .uchar); |
| 835 | 1200 | try comp.generateExactWidthIntMax(w, .schar); |
| 836 | 1201 | |
| 837 | if (comp.intSize(.short) > comp.intSize(.char)) { | |
| 838 | try comp.generateExactWidthType(w, mapper, .ushort); | |
| 1202 | if (QualType.short.sizeof(comp) > QualType.char.sizeof(comp)) { | |
| 1203 | try comp.generateExactWidthType(w, .ushort); | |
| 839 | 1204 | try comp.generateExactWidthIntMax(w, .ushort); |
| 840 | 1205 | try comp.generateExactWidthIntMax(w, .short); |
| 841 | 1206 | } |
| 842 | 1207 | |
| 843 | if (comp.intSize(.int) > comp.intSize(.short)) { | |
| 844 | try comp.generateExactWidthType(w, mapper, .uint); | |
| 1208 | if (QualType.int.sizeof(comp) > QualType.short.sizeof(comp)) { | |
| 1209 | try comp.generateExactWidthType(w, .uint); | |
| 845 | 1210 | try comp.generateExactWidthIntMax(w, .uint); |
| 846 | 1211 | try comp.generateExactWidthIntMax(w, .int); |
| 847 | 1212 | } |
| 848 | 1213 | |
| 849 | if (comp.intSize(.long) > comp.intSize(.int)) { | |
| 850 | try comp.generateExactWidthType(w, mapper, .ulong); | |
| 1214 | if (QualType.long.sizeof(comp) > QualType.int.sizeof(comp)) { | |
| 1215 | try comp.generateExactWidthType(w, .ulong); | |
| 851 | 1216 | try comp.generateExactWidthIntMax(w, .ulong); |
| 852 | 1217 | try comp.generateExactWidthIntMax(w, .long); |
| 853 | 1218 | } |
| 854 | 1219 | |
| 855 | if (comp.intSize(.long_long) > comp.intSize(.long)) { | |
| 856 | try comp.generateExactWidthType(w, mapper, .ulong_long); | |
| 1220 | if (QualType.long_long.sizeof(comp) > QualType.long.sizeof(comp)) { | |
| 1221 | try comp.generateExactWidthType(w, .ulong_long); | |
| 857 | 1222 | try comp.generateExactWidthIntMax(w, .ulong_long); |
| 858 | 1223 | try comp.generateExactWidthIntMax(w, .long_long); |
| 859 | 1224 | } |
| 860 | 1225 | } |
| 861 | 1226 | |
| 862 | fn generateFmt(comp: *const Compilation, prefix: []const u8, w: *Writer, ty: Type) !void { | |
| 863 | const unsigned = ty.isUnsignedInt(comp); | |
| 864 | const modifier = ty.formatModifier(); | |
| 1227 | fn generateFmt(comp: *const Compilation, prefix: []const u8, w: *std.Io.Writer, qt: QualType) !void { | |
| 1228 | const unsigned = qt.signedness(comp) == .unsigned; | |
| 1229 | const modifier = qt.formatModifier(comp); | |
| 865 | 1230 | const formats = if (unsigned) "ouxX" else "di"; |
| 866 | 1231 | for (formats) |c| { |
| 867 | 1232 | try w.print("#define {s}_FMT{c}__ \"{s}{c}\"\n", .{ prefix, c, modifier, c }); |
| 868 | 1233 | } |
| 869 | 1234 | } |
| 870 | 1235 | |
| 871 | fn generateSuffixMacro(comp: *const Compilation, prefix: []const u8, w: *Writer, ty: Type) !void { | |
| 872 | return w.print("#define {s}_C_SUFFIX__ {s}\n", .{ prefix, ty.intValueSuffix(comp) }); | |
| 1236 | fn generateSuffixMacro(comp: *const Compilation, prefix: []const u8, w: *std.Io.Writer, qt: QualType) !void { | |
| 1237 | return w.print("#define {s}_C_SUFFIX__ {s}\n", .{ prefix, qt.intValueSuffix(comp) }); | |
| 873 | 1238 | } |
| 874 | 1239 | |
| 875 | /// Generate the following for ty: | |
| 1240 | /// Generate the following for a type: | |
| 876 | 1241 | /// Name macro (e.g. #define __UINT32_TYPE__ unsigned int) |
| 877 | 1242 | /// Format strings (e.g. #define __UINT32_FMTu__ "u") |
| 878 | 1243 | /// Suffix macro (e.g. #define __UINT32_C_SUFFIX__ U) |
| 879 | fn generateExactWidthType(comp: *const Compilation, w: *Writer, mapper: StrInt.TypeMapper, specifier: Type.Specifier) !void { | |
| 880 | var ty = Type{ .specifier = specifier }; | |
| 881 | const width = 8 * ty.sizeof(comp).?; | |
| 882 | const unsigned = ty.isUnsignedInt(comp); | |
| 1244 | fn generateExactWidthType(comp: *Compilation, w: *std.Io.Writer, original_qt: QualType) !void { | |
| 1245 | var qt = original_qt; | |
| 1246 | const width = qt.sizeof(comp) * 8; | |
| 1247 | const unsigned = qt.signedness(comp) == .unsigned; | |
| 883 | 1248 | |
| 884 | 1249 | if (width == 16) { |
| 885 | ty = if (unsigned) comp.types.int16.makeIntegerUnsigned() else comp.types.int16; | |
| 1250 | qt = if (unsigned) try comp.type_store.int16.makeIntUnsigned(comp) else comp.type_store.int16; | |
| 886 | 1251 | } else if (width == 64) { |
| 887 | ty = if (unsigned) comp.types.int64.makeIntegerUnsigned() else comp.types.int64; | |
| 1252 | qt = if (unsigned) try comp.type_store.int64.makeIntUnsigned(comp) else comp.type_store.int64; | |
| 888 | 1253 | } |
| 889 | 1254 | |
| 890 | 1255 | var buffer: [16]u8 = undefined; |
| 891 | 1256 | const suffix = "_TYPE__"; |
| 892 | 1257 | const full = std.fmt.bufPrint(&buffer, "{s}{d}{s}", .{ |
| 893 | 1258 | if (unsigned) "__UINT" else "__INT", width, suffix, |
| 894 | }) catch return error.OutOfMemory; | |
| 1259 | }) catch unreachable; | |
| 895 | 1260 | |
| 896 | try generateTypeMacro(w, mapper, full, ty, comp.langopts); | |
| 1261 | try comp.generateTypeMacro(w, full, qt); | |
| 897 | 1262 | |
| 898 | 1263 | const prefix = full[0 .. full.len - suffix.len]; // remove "_TYPE__" |
| 899 | 1264 | |
| 900 | try comp.generateFmt(prefix, w, ty); | |
| 901 | try comp.generateSuffixMacro(prefix, w, ty); | |
| 1265 | try comp.generateFmt(prefix, w, qt); | |
| 1266 | try comp.generateSuffixMacro(prefix, w, qt); | |
| 902 | 1267 | } |
| 903 | 1268 | |
| 904 | 1269 | pub fn hasFloat128(comp: *const Compilation) bool { |
| ... | ... | @@ -909,107 +1274,9 @@ pub fn hasHalfPrecisionFloatABI(comp: *const Compilation) bool { |
| 909 | 1274 | return comp.langopts.allow_half_args_and_returns or target_util.hasHalfPrecisionFloatABI(comp.target); |
| 910 | 1275 | } |
| 911 | 1276 | |
| 912 | fn generateNsConstantStringType(comp: *Compilation) !void { | |
| 913 | comp.types.ns_constant_string.record = .{ | |
| 914 | .name = try StrInt.intern(comp, "__NSConstantString_tag"), | |
| 915 | .fields = &comp.types.ns_constant_string.fields, | |
| 916 | .field_attributes = null, | |
| 917 | .type_layout = undefined, | |
| 918 | }; | |
| 919 | const const_int_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = &comp.types.ns_constant_string.int_ty } }; | |
| 920 | const const_char_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = &comp.types.ns_constant_string.char_ty } }; | |
| 921 | ||
| 922 | comp.types.ns_constant_string.fields[0] = .{ .name = try StrInt.intern(comp, "isa"), .ty = const_int_ptr }; | |
| 923 | comp.types.ns_constant_string.fields[1] = .{ .name = try StrInt.intern(comp, "flags"), .ty = .{ .specifier = .int } }; | |
| 924 | comp.types.ns_constant_string.fields[2] = .{ .name = try StrInt.intern(comp, "str"), .ty = const_char_ptr }; | |
| 925 | comp.types.ns_constant_string.fields[3] = .{ .name = try StrInt.intern(comp, "length"), .ty = .{ .specifier = .long } }; | |
| 926 | comp.types.ns_constant_string.ty = .{ .specifier = .@"struct", .data = .{ .record = &comp.types.ns_constant_string.record } }; | |
| 927 | record_layout.compute(&comp.types.ns_constant_string.record, comp.types.ns_constant_string.ty, comp, null) catch unreachable; | |
| 928 | } | |
| 929 | ||
| 930 | fn generateVaListType(comp: *Compilation) !Type { | |
| 931 | const Kind = enum { char_ptr, void_ptr, aarch64_va_list, x86_64_va_list }; | |
| 932 | const kind: Kind = switch (comp.target.cpu.arch) { | |
| 933 | .aarch64 => switch (comp.target.os.tag) { | |
| 934 | .windows => @as(Kind, .char_ptr), | |
| 935 | .ios, .macos, .tvos, .watchos => .char_ptr, | |
| 936 | else => .aarch64_va_list, | |
| 937 | }, | |
| 938 | .sparc, .wasm32, .wasm64, .bpfel, .bpfeb, .riscv32, .riscv32be, .riscv64, .riscv64be, .avr, .spirv32, .spirv64 => .void_ptr, | |
| 939 | .powerpc => switch (comp.target.os.tag) { | |
| 940 | .ios, .macos, .tvos, .watchos, .aix => @as(Kind, .char_ptr), | |
| 941 | else => return Type{ .specifier = .void }, // unknown | |
| 942 | }, | |
| 943 | .x86, .msp430 => .char_ptr, | |
| 944 | .x86_64 => switch (comp.target.os.tag) { | |
| 945 | .windows => @as(Kind, .char_ptr), | |
| 946 | else => .x86_64_va_list, | |
| 947 | }, | |
| 948 | else => return Type{ .specifier = .void }, // unknown | |
| 949 | }; | |
| 950 | ||
| 951 | // TODO this might be bad? | |
| 952 | const arena = comp.diagnostics.arena.allocator(); | |
| 953 | ||
| 954 | var ty: Type = undefined; | |
| 955 | switch (kind) { | |
| 956 | .char_ptr => ty = .{ .specifier = .char }, | |
| 957 | .void_ptr => ty = .{ .specifier = .void }, | |
| 958 | .aarch64_va_list => { | |
| 959 | const record_ty = try arena.create(Type.Record); | |
| 960 | record_ty.* = .{ | |
| 961 | .name = try StrInt.intern(comp, "__va_list_tag"), | |
| 962 | .fields = try arena.alloc(Type.Record.Field, 5), | |
| 963 | .field_attributes = null, | |
| 964 | .type_layout = undefined, // computed below | |
| 965 | }; | |
| 966 | const void_ty = try arena.create(Type); | |
| 967 | void_ty.* = .{ .specifier = .void }; | |
| 968 | const void_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = void_ty } }; | |
| 969 | record_ty.fields[0] = .{ .name = try StrInt.intern(comp, "__stack"), .ty = void_ptr }; | |
| 970 | record_ty.fields[1] = .{ .name = try StrInt.intern(comp, "__gr_top"), .ty = void_ptr }; | |
| 971 | record_ty.fields[2] = .{ .name = try StrInt.intern(comp, "__vr_top"), .ty = void_ptr }; | |
| 972 | record_ty.fields[3] = .{ .name = try StrInt.intern(comp, "__gr_offs"), .ty = .{ .specifier = .int } }; | |
| 973 | record_ty.fields[4] = .{ .name = try StrInt.intern(comp, "__vr_offs"), .ty = .{ .specifier = .int } }; | |
| 974 | ty = .{ .specifier = .@"struct", .data = .{ .record = record_ty } }; | |
| 975 | record_layout.compute(record_ty, ty, comp, null) catch unreachable; | |
| 976 | }, | |
| 977 | .x86_64_va_list => { | |
| 978 | const record_ty = try arena.create(Type.Record); | |
| 979 | record_ty.* = .{ | |
| 980 | .name = try StrInt.intern(comp, "__va_list_tag"), | |
| 981 | .fields = try arena.alloc(Type.Record.Field, 4), | |
| 982 | .field_attributes = null, | |
| 983 | .type_layout = undefined, // computed below | |
| 984 | }; | |
| 985 | const void_ty = try arena.create(Type); | |
| 986 | void_ty.* = .{ .specifier = .void }; | |
| 987 | const void_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = void_ty } }; | |
| 988 | record_ty.fields[0] = .{ .name = try StrInt.intern(comp, "gp_offset"), .ty = .{ .specifier = .uint } }; | |
| 989 | record_ty.fields[1] = .{ .name = try StrInt.intern(comp, "fp_offset"), .ty = .{ .specifier = .uint } }; | |
| 990 | record_ty.fields[2] = .{ .name = try StrInt.intern(comp, "overflow_arg_area"), .ty = void_ptr }; | |
| 991 | record_ty.fields[3] = .{ .name = try StrInt.intern(comp, "reg_save_area"), .ty = void_ptr }; | |
| 992 | ty = .{ .specifier = .@"struct", .data = .{ .record = record_ty } }; | |
| 993 | record_layout.compute(record_ty, ty, comp, null) catch unreachable; | |
| 994 | }, | |
| 995 | } | |
| 996 | if (kind == .char_ptr or kind == .void_ptr) { | |
| 997 | const elem_ty = try arena.create(Type); | |
| 998 | elem_ty.* = ty; | |
| 999 | ty = Type{ .specifier = .pointer, .data = .{ .sub_type = elem_ty } }; | |
| 1000 | } else { | |
| 1001 | const arr_ty = try arena.create(Type.Array); | |
| 1002 | arr_ty.* = .{ .len = 1, .elem = ty }; | |
| 1003 | ty = Type{ .specifier = .array, .data = .{ .array = arr_ty } }; | |
| 1004 | } | |
| 1005 | ||
| 1006 | return ty; | |
| 1007 | } | |
| 1008 | ||
| 1009 | fn generateIntMax(comp: *const Compilation, w: *Writer, name: []const u8, ty: Type) !void { | |
| 1010 | const bit_count: u8 = @intCast(ty.sizeof(comp).? * 8); | |
| 1011 | const unsigned = ty.isUnsignedInt(comp); | |
| 1012 | const max: u128 = switch (bit_count) { | |
| 1277 | fn generateIntMax(comp: *const Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { | |
| 1278 | const unsigned = qt.signedness(comp) == .unsigned; | |
| 1279 | const max: u128 = switch (qt.bitSizeof(comp)) { | |
| 1013 | 1280 | 8 => if (unsigned) std.math.maxInt(u8) else std.math.maxInt(i8), |
| 1014 | 1281 | 16 => if (unsigned) std.math.maxInt(u16) else std.math.maxInt(i16), |
| 1015 | 1282 | 32 => if (unsigned) std.math.maxInt(u32) else std.math.maxInt(i32), |
| ... | ... | @@ -1017,13 +1284,13 @@ fn generateIntMax(comp: *const Compilation, w: *Writer, name: []const u8, ty: Ty |
| 1017 | 1284 | 128 => if (unsigned) std.math.maxInt(u128) else std.math.maxInt(i128), |
| 1018 | 1285 | else => unreachable, |
| 1019 | 1286 | }; |
| 1020 | try w.print("#define __{s}_MAX__ {d}{s}\n", .{ name, max, ty.intValueSuffix(comp) }); | |
| 1287 | try w.print("#define __{s}_MAX__ {d}{s}\n", .{ name, max, qt.intValueSuffix(comp) }); | |
| 1021 | 1288 | } |
| 1022 | 1289 | |
| 1023 | 1290 | /// Largest value that can be stored in wchar_t |
| 1024 | 1291 | pub fn wcharMax(comp: *const Compilation) u32 { |
| 1025 | const unsigned = comp.types.wchar.isUnsignedInt(comp); | |
| 1026 | return switch (comp.types.wchar.bitSizeof(comp).?) { | |
| 1292 | const unsigned = comp.type_store.wchar.signedness(comp) == .unsigned; | |
| 1293 | return switch (comp.type_store.wchar.bitSizeof(comp)) { | |
| 1027 | 1294 | 8 => if (unsigned) std.math.maxInt(u8) else std.math.maxInt(i8), |
| 1028 | 1295 | 16 => if (unsigned) std.math.maxInt(u16) else std.math.maxInt(i16), |
| 1029 | 1296 | 32 => if (unsigned) std.math.maxInt(u32) else std.math.maxInt(i32), |
| ... | ... | @@ -1031,46 +1298,46 @@ pub fn wcharMax(comp: *const Compilation) u32 { |
| 1031 | 1298 | }; |
| 1032 | 1299 | } |
| 1033 | 1300 | |
| 1034 | fn generateExactWidthIntMax(comp: *const Compilation, w: *Writer, specifier: Type.Specifier) !void { | |
| 1035 | var ty = Type{ .specifier = specifier }; | |
| 1036 | const bit_count: u8 = @intCast(ty.sizeof(comp).? * 8); | |
| 1037 | const unsigned = ty.isUnsignedInt(comp); | |
| 1301 | fn generateExactWidthIntMax(comp: *Compilation, w: *std.Io.Writer, original_qt: QualType) !void { | |
| 1302 | var qt = original_qt; | |
| 1303 | const bit_count: u8 = @intCast(qt.sizeof(comp) * 8); | |
| 1304 | const unsigned = qt.signedness(comp) == .unsigned; | |
| 1038 | 1305 | |
| 1039 | 1306 | if (bit_count == 64) { |
| 1040 | ty = if (unsigned) comp.types.int64.makeIntegerUnsigned() else comp.types.int64; | |
| 1307 | qt = if (unsigned) try comp.type_store.int64.makeIntUnsigned(comp) else comp.type_store.int64; | |
| 1041 | 1308 | } |
| 1042 | 1309 | |
| 1043 | 1310 | var name_buffer: [6]u8 = undefined; |
| 1044 | 1311 | const name = std.fmt.bufPrint(&name_buffer, "{s}{d}", .{ |
| 1045 | 1312 | if (unsigned) "UINT" else "INT", bit_count, |
| 1046 | }) catch return error.OutOfMemory; | |
| 1313 | }) catch unreachable; | |
| 1047 | 1314 | |
| 1048 | return comp.generateIntMax(w, name, ty); | |
| 1315 | return comp.generateIntMax(w, name, qt); | |
| 1049 | 1316 | } |
| 1050 | 1317 | |
| 1051 | fn generateIntWidth(comp: *Compilation, w: *Writer, name: []const u8, ty: Type) !void { | |
| 1052 | try w.print("#define __{s}_WIDTH__ {d}\n", .{ name, 8 * ty.sizeof(comp).? }); | |
| 1318 | fn generateIntWidth(comp: *Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { | |
| 1319 | try w.print("#define __{s}_WIDTH__ {d}\n", .{ name, qt.sizeof(comp) * 8 }); | |
| 1053 | 1320 | } |
| 1054 | 1321 | |
| 1055 | fn generateIntMaxAndWidth(comp: *Compilation, w: *Writer, name: []const u8, ty: Type) !void { | |
| 1056 | try comp.generateIntMax(w, name, ty); | |
| 1057 | try comp.generateIntWidth(w, name, ty); | |
| 1322 | fn generateIntMaxAndWidth(comp: *Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { | |
| 1323 | try comp.generateIntMax(w, name, qt); | |
| 1324 | try comp.generateIntWidth(w, name, qt); | |
| 1058 | 1325 | } |
| 1059 | 1326 | |
| 1060 | fn generateSizeofType(comp: *Compilation, w: *Writer, name: []const u8, ty: Type) !void { | |
| 1061 | try w.print("#define {s} {d}\n", .{ name, ty.sizeof(comp).? }); | |
| 1327 | fn generateSizeofType(comp: *Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { | |
| 1328 | try w.print("#define {s} {d}\n", .{ name, qt.sizeof(comp) }); | |
| 1062 | 1329 | } |
| 1063 | 1330 | |
| 1064 | pub fn nextLargestIntSameSign(comp: *const Compilation, ty: Type) ?Type { | |
| 1065 | assert(ty.isInt()); | |
| 1066 | const specifiers = if (ty.isUnsignedInt(comp)) | |
| 1067 | [_]Type.Specifier{ .short, .int, .long, .long_long } | |
| 1331 | pub fn nextLargestIntSameSign(comp: *const Compilation, qt: QualType) ?QualType { | |
| 1332 | assert(qt.isInt(comp)); | |
| 1333 | const candidates: [4]QualType = if (qt.signedness(comp) == .signed) | |
| 1334 | .{ .short, .int, .long, .long_long } | |
| 1068 | 1335 | else |
| 1069 | [_]Type.Specifier{ .ushort, .uint, .ulong, .ulong_long }; | |
| 1070 | const size = ty.sizeof(comp).?; | |
| 1071 | for (specifiers) |specifier| { | |
| 1072 | const candidate = Type{ .specifier = specifier }; | |
| 1073 | if (candidate.sizeof(comp).? > size) return candidate; | |
| 1336 | .{ .ushort, .uint, .ulong, .ulong_long }; | |
| 1337 | ||
| 1338 | const size = qt.sizeof(comp); | |
| 1339 | for (candidates) |candidate| { | |
| 1340 | if (candidate.sizeof(comp) > size) return candidate; | |
| 1074 | 1341 | } |
| 1075 | 1342 | return null; |
| 1076 | 1343 | } |
| ... | ... | @@ -1085,7 +1352,7 @@ pub fn maxArrayBytes(comp: *const Compilation) u64 { |
| 1085 | 1352 | /// __attribute__((packed)) or the range of values of the corresponding enumerator constants, |
| 1086 | 1353 | /// specify it here. |
| 1087 | 1354 | /// TODO: likely incomplete |
| 1088 | pub fn fixedEnumTagSpecifier(comp: *const Compilation) ?Type.Specifier { | |
| 1355 | pub fn fixedEnumTagType(comp: *const Compilation) ?QualType { | |
| 1089 | 1356 | switch (comp.langopts.emulate) { |
| 1090 | 1357 | .msvc => return .int, |
| 1091 | 1358 | .clang => if (comp.target.os.tag == .windows) return .int, |
| ... | ... | @@ -1099,24 +1366,27 @@ pub fn getCharSignedness(comp: *const Compilation) std.builtin.Signedness { |
| 1099 | 1366 | } |
| 1100 | 1367 | |
| 1101 | 1368 | /// Add built-in aro headers directory to system include paths |
| 1102 | pub fn addBuiltinIncludeDir(comp: *Compilation, aro_dir: []const u8) !void { | |
| 1369 | pub fn addBuiltinIncludeDir(comp: *Compilation, aro_dir: []const u8, override_resource_dir: ?[]const u8) !void { | |
| 1370 | const gpa = comp.gpa; | |
| 1371 | const arena = comp.arena; | |
| 1372 | try comp.system_include_dirs.ensureUnusedCapacity(gpa, 1); | |
| 1373 | if (override_resource_dir) |resource_dir| { | |
| 1374 | comp.system_include_dirs.appendAssumeCapacity(try std.fs.path.join(arena, &.{ resource_dir, "include" })); | |
| 1375 | return; | |
| 1376 | } | |
| 1103 | 1377 | var search_path = aro_dir; |
| 1104 | 1378 | while (std.fs.path.dirname(search_path)) |dirname| : (search_path = dirname) { |
| 1105 | 1379 | var base_dir = comp.cwd.openDir(dirname, .{}) catch continue; |
| 1106 | 1380 | defer base_dir.close(); |
| 1107 | 1381 | |
| 1108 | 1382 | base_dir.access("include/stddef.h", .{}) catch continue; |
| 1109 | const path = try std.fs.path.join(comp.gpa, &.{ dirname, "include" }); | |
| 1110 | errdefer comp.gpa.free(path); | |
| 1111 | try comp.system_include_dirs.append(comp.gpa, path); | |
| 1383 | comp.system_include_dirs.appendAssumeCapacity(try std.fs.path.join(arena, &.{ dirname, "include" })); | |
| 1112 | 1384 | break; |
| 1113 | 1385 | } else return error.AroIncludeNotFound; |
| 1114 | 1386 | } |
| 1115 | 1387 | |
| 1116 | 1388 | pub fn addSystemIncludeDir(comp: *Compilation, path: []const u8) !void { |
| 1117 | const duped = try comp.gpa.dupe(u8, path); | |
| 1118 | errdefer comp.gpa.free(duped); | |
| 1119 | try comp.system_include_dirs.append(comp.gpa, duped); | |
| 1389 | try comp.system_include_dirs.append(comp.gpa, try comp.arena.dupe(u8, path)); | |
| 1120 | 1390 | } |
| 1121 | 1391 | |
| 1122 | 1392 | pub fn getSource(comp: *const Compilation, id: Source.Id) Source { |
| ... | ... | @@ -1130,29 +1400,22 @@ pub fn getSource(comp: *const Compilation, id: Source.Id) Source { |
| 1130 | 1400 | return comp.sources.values()[@intFromEnum(id) - 2]; |
| 1131 | 1401 | } |
| 1132 | 1402 | |
| 1133 | /// Creates a Source from the contents of `reader` and adds it to the Compilation | |
| 1134 | pub fn addSourceFromReader(comp: *Compilation, reader: anytype, path: []const u8, kind: Source.Kind) !Source { | |
| 1135 | const contents = try reader.readAllAlloc(comp.gpa, std.math.maxInt(u32)); | |
| 1136 | errdefer comp.gpa.free(contents); | |
| 1137 | return comp.addSourceFromOwnedBuffer(contents, path, kind); | |
| 1138 | } | |
| 1139 | ||
| 1140 | 1403 | /// Creates a Source from `buf` and adds it to the Compilation |
| 1141 | 1404 | /// Performs newline splicing and line-ending normalization to '\n' |
| 1142 | 1405 | /// `buf` will be modified and the allocation will be resized if newline splicing |
| 1143 | 1406 | /// or line-ending changes happen. |
| 1144 | 1407 | /// caller retains ownership of `path` |
| 1145 | /// To add the contents of an arbitrary reader as a Source, see addSourceFromReader | |
| 1146 | 1408 | /// To add a file's contents given its path, see addSourceFromPath |
| 1147 | pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, kind: Source.Kind) !Source { | |
| 1409 | pub fn addSourceFromOwnedBuffer(comp: *Compilation, path: []const u8, buf: []u8, kind: Source.Kind) !Source { | |
| 1410 | assert(buf.len <= std.math.maxInt(u32)); | |
| 1148 | 1411 | try comp.sources.ensureUnusedCapacity(comp.gpa, 1); |
| 1149 | 1412 | |
| 1150 | 1413 | var contents = buf; |
| 1151 | 1414 | const duped_path = try comp.gpa.dupe(u8, path); |
| 1152 | 1415 | errdefer comp.gpa.free(duped_path); |
| 1153 | 1416 | |
| 1154 | var splice_list = std.array_list.Managed(u32).init(comp.gpa); | |
| 1155 | defer splice_list.deinit(); | |
| 1417 | var splice_list: std.ArrayList(u32) = .empty; | |
| 1418 | defer splice_list.deinit(comp.gpa); | |
| 1156 | 1419 | |
| 1157 | 1420 | const source_id: Source.Id = @enumFromInt(comp.sources.count() + 2); |
| 1158 | 1421 | |
| ... | ... | @@ -1185,12 +1448,9 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, |
| 1185 | 1448 | }, |
| 1186 | 1449 | .back_slash, .trailing_ws, .back_slash_cr => { |
| 1187 | 1450 | i = backslash_loc; |
| 1188 | try splice_list.append(i); | |
| 1451 | try splice_list.append(comp.gpa, i); | |
| 1189 | 1452 | if (state == .trailing_ws) { |
| 1190 | try comp.addDiagnostic(.{ | |
| 1191 | .tag = .backslash_newline_escape, | |
| 1192 | .loc = .{ .id = source_id, .byte_offset = i, .line = line }, | |
| 1193 | }, &.{}); | |
| 1453 | try comp.addNewlineEscapeError(path, buf, splice_list.items, i, line, kind); | |
| 1194 | 1454 | } |
| 1195 | 1455 | state = if (state == .back_slash_cr) .cr else .back_slash_cr; |
| 1196 | 1456 | }, |
| ... | ... | @@ -1208,13 +1468,10 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, |
| 1208 | 1468 | .back_slash, .trailing_ws => { |
| 1209 | 1469 | i = backslash_loc; |
| 1210 | 1470 | if (state == .back_slash or state == .trailing_ws) { |
| 1211 | try splice_list.append(i); | |
| 1471 | try splice_list.append(comp.gpa, i); | |
| 1212 | 1472 | } |
| 1213 | 1473 | if (state == .trailing_ws) { |
| 1214 | try comp.addDiagnostic(.{ | |
| 1215 | .tag = .backslash_newline_escape, | |
| 1216 | .loc = .{ .id = source_id, .byte_offset = i, .line = line }, | |
| 1217 | }, &.{}); | |
| 1474 | try comp.addNewlineEscapeError(path, buf, splice_list.items, i, line, kind); | |
| 1218 | 1475 | } |
| 1219 | 1476 | }, |
| 1220 | 1477 | .bom1, .bom2 => break, |
| ... | ... | @@ -1264,13 +1521,19 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, |
| 1264 | 1521 | } |
| 1265 | 1522 | } |
| 1266 | 1523 | |
| 1267 | const splice_locs = try splice_list.toOwnedSlice(); | |
| 1524 | const splice_locs = try splice_list.toOwnedSlice(comp.gpa); | |
| 1268 | 1525 | errdefer comp.gpa.free(splice_locs); |
| 1269 | 1526 | |
| 1270 | if (i != contents.len) contents = try comp.gpa.realloc(contents, i); | |
| 1527 | if (i != contents.len) { | |
| 1528 | var list: std.ArrayList(u8) = .{ | |
| 1529 | .items = contents[0..i], | |
| 1530 | .capacity = contents.len, | |
| 1531 | }; | |
| 1532 | contents = try list.toOwnedSlice(comp.gpa); | |
| 1533 | } | |
| 1271 | 1534 | errdefer @compileError("errdefers in callers would possibly free the realloced slice using the original len"); |
| 1272 | 1535 | |
| 1273 | const source = Source{ | |
| 1536 | const source: Source = .{ | |
| 1274 | 1537 | .id = source_id, |
| 1275 | 1538 | .path = duped_path, |
| 1276 | 1539 | .buf = contents, |
| ... | ... | @@ -1282,17 +1545,49 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, |
| 1282 | 1545 | return source; |
| 1283 | 1546 | } |
| 1284 | 1547 | |
| 1548 | fn addNewlineEscapeError( | |
| 1549 | comp: *Compilation, | |
| 1550 | path: []const u8, | |
| 1551 | buf: []const u8, | |
| 1552 | splice_locs: []const u32, | |
| 1553 | byte_offset: u32, | |
| 1554 | line: u32, | |
| 1555 | kind: Source.Kind, | |
| 1556 | ) !void { | |
| 1557 | // Temporary source for getting the location for errors. | |
| 1558 | var tmp_source: Source = .{ | |
| 1559 | .path = path, | |
| 1560 | .buf = buf, | |
| 1561 | .id = undefined, | |
| 1562 | .kind = kind, | |
| 1563 | .splice_locs = splice_locs, | |
| 1564 | }; | |
| 1565 | ||
| 1566 | const diagnostic: Diagnostic = .backslash_newline_escape; | |
| 1567 | var loc = tmp_source.lineCol(.{ .id = undefined, .byte_offset = byte_offset, .line = line }); | |
| 1568 | loc.line = loc.line[0 .. loc.line.len - 1]; | |
| 1569 | loc.width += 1; | |
| 1570 | loc.col += 1; | |
| 1571 | ||
| 1572 | try comp.diagnostics.add(.{ | |
| 1573 | .text = diagnostic.fmt, | |
| 1574 | .kind = diagnostic.kind, | |
| 1575 | .opt = diagnostic.opt, | |
| 1576 | .location = loc, | |
| 1577 | }); | |
| 1578 | } | |
| 1579 | ||
| 1285 | 1580 | /// Caller retains ownership of `path` and `buf`. |
| 1286 | 1581 | /// Dupes the source buffer; if it is acceptable to modify the source buffer and possibly resize |
| 1287 | 1582 | /// the allocation, please use `addSourceFromOwnedBuffer` |
| 1288 | pub fn addSourceFromBuffer(comp: *Compilation, path: []const u8, buf: []const u8) !Source { | |
| 1583 | pub fn addSourceFromBuffer(comp: *Compilation, path: []const u8, buf: []const u8) AddSourceError!Source { | |
| 1289 | 1584 | if (comp.sources.get(path)) |some| return some; |
| 1290 | if (@as(u64, buf.len) > std.math.maxInt(u32)) return error.StreamTooLong; | |
| 1585 | if (buf.len > std.math.maxInt(u32)) return error.FileTooBig; | |
| 1291 | 1586 | |
| 1292 | 1587 | const contents = try comp.gpa.dupe(u8, buf); |
| 1293 | 1588 | errdefer comp.gpa.free(contents); |
| 1294 | 1589 | |
| 1295 | return comp.addSourceFromOwnedBuffer(contents, path, .user); | |
| 1590 | return comp.addSourceFromOwnedBuffer(path, contents, .user); | |
| 1296 | 1591 | } |
| 1297 | 1592 | |
| 1298 | 1593 | /// Caller retains ownership of `path`. |
| ... | ... | @@ -1308,109 +1603,197 @@ fn addSourceFromPathExtra(comp: *Compilation, path: []const u8, kind: Source.Kin |
| 1308 | 1603 | return error.FileNotFound; |
| 1309 | 1604 | } |
| 1310 | 1605 | |
| 1311 | const contents = try comp.cwd.readFileAlloc(path, comp.gpa, .limited(std.math.maxInt(u32))); | |
| 1606 | const file = try comp.cwd.openFile(path, .{}); | |
| 1607 | defer file.close(); | |
| 1608 | return comp.addSourceFromFile(file, path, kind); | |
| 1609 | } | |
| 1610 | ||
| 1611 | pub fn addSourceFromFile(comp: *Compilation, file: std.fs.File, path: []const u8, kind: Source.Kind) !Source { | |
| 1612 | const contents = try comp.getFileContents(file, .unlimited); | |
| 1312 | 1613 | errdefer comp.gpa.free(contents); |
| 1614 | return comp.addSourceFromOwnedBuffer(path, contents, kind); | |
| 1615 | } | |
| 1313 | 1616 | |
| 1314 | return comp.addSourceFromOwnedBuffer(contents, path, kind); | |
| 1617 | pub fn hasInclude( | |
| 1618 | comp: *Compilation, | |
| 1619 | filename: []const u8, | |
| 1620 | includer_token_source: Source.Id, | |
| 1621 | /// angle bracket vs quotes | |
| 1622 | include_type: IncludeType, | |
| 1623 | /// __has_include vs __has_include_next | |
| 1624 | which: WhichInclude, | |
| 1625 | opt_dep_file: ?*DepFile, | |
| 1626 | ) Compilation.Error!bool { | |
| 1627 | if (try FindInclude.run(comp, filename, include_type, switch (which) { | |
| 1628 | .next => .{ .only_search_after_dir = comp.getSource(includer_token_source).path }, | |
| 1629 | .first => switch (include_type) { | |
| 1630 | .quotes => .{ .allow_same_dir = comp.getSource(includer_token_source).path }, | |
| 1631 | .angle_brackets => .only_search, | |
| 1632 | }, | |
| 1633 | })) |found| { | |
| 1634 | if (opt_dep_file) |dep_file| { | |
| 1635 | const source = comp.getSource(found.source); | |
| 1636 | try dep_file.addDependency(comp.gpa, source.path); | |
| 1637 | } | |
| 1638 | return true; | |
| 1639 | } else { | |
| 1640 | return false; | |
| 1641 | } | |
| 1315 | 1642 | } |
| 1316 | 1643 | |
| 1317 | pub const IncludeDirIterator = struct { | |
| 1318 | comp: *const Compilation, | |
| 1319 | cwd_source_id: ?Source.Id, | |
| 1320 | include_dirs_idx: usize = 0, | |
| 1321 | sys_include_dirs_idx: usize = 0, | |
| 1322 | tried_ms_cwd: bool = false, | |
| 1644 | const FindInclude = struct { | |
| 1645 | comp: *Compilation, | |
| 1646 | include_path: []const u8, | |
| 1647 | /// We won't actually consider any include directories until after this directory. | |
| 1648 | wait_for: ?[]const u8, | |
| 1323 | 1649 | |
| 1324 | const FoundSource = struct { | |
| 1325 | path: []const u8, | |
| 1650 | const Result = struct { | |
| 1651 | source: Source.Id, | |
| 1326 | 1652 | kind: Source.Kind, |
| 1653 | used_ms_search_rule: bool, | |
| 1327 | 1654 | }; |
| 1328 | 1655 | |
| 1329 | fn next(self: *IncludeDirIterator) ?FoundSource { | |
| 1330 | if (self.cwd_source_id) |source_id| { | |
| 1331 | self.cwd_source_id = null; | |
| 1332 | const path = self.comp.getSource(source_id).path; | |
| 1333 | return .{ .path = std.fs.path.dirname(path) orelse ".", .kind = .user }; | |
| 1656 | fn run( | |
| 1657 | comp: *Compilation, | |
| 1658 | include_path: []const u8, | |
| 1659 | include_type: IncludeType, | |
| 1660 | search_strat: union(enum) { | |
| 1661 | allow_same_dir: []const u8, | |
| 1662 | only_search, | |
| 1663 | only_search_after_dir: []const u8, | |
| 1664 | }, | |
| 1665 | ) Allocator.Error!?Result { | |
| 1666 | var find: FindInclude = .{ | |
| 1667 | .comp = comp, | |
| 1668 | .include_path = include_path, | |
| 1669 | .wait_for = null, | |
| 1670 | }; | |
| 1671 | ||
| 1672 | if (std.fs.path.isAbsolute(include_path)) { | |
| 1673 | switch (search_strat) { | |
| 1674 | .allow_same_dir, .only_search => {}, | |
| 1675 | .only_search_after_dir => return null, | |
| 1676 | } | |
| 1677 | return find.check("{s}", .{include_path}, .user, false); | |
| 1678 | } | |
| 1679 | ||
| 1680 | switch (search_strat) { | |
| 1681 | .allow_same_dir => |other_file| { | |
| 1682 | const dir = std.fs.path.dirname(other_file) orelse "."; | |
| 1683 | if (try find.checkIncludeDir(dir, .user)) |res| return res; | |
| 1684 | }, | |
| 1685 | .only_search => {}, | |
| 1686 | .only_search_after_dir => |other_file| { | |
| 1687 | // TODO: this is not the correct interpretation of `#include_next` and friends, | |
| 1688 | // because a file might not be directly inside of an include directory. To implement | |
| 1689 | // this correctly, we will need to track which include directory a file has been | |
| 1690 | // included from. | |
| 1691 | find.wait_for = std.fs.path.dirname(other_file); | |
| 1692 | }, | |
| 1334 | 1693 | } |
| 1335 | if (self.include_dirs_idx < self.comp.include_dirs.items.len) { | |
| 1336 | defer self.include_dirs_idx += 1; | |
| 1337 | return .{ .path = self.comp.include_dirs.items[self.include_dirs_idx], .kind = .user }; | |
| 1694 | switch (include_type) { | |
| 1695 | .quotes => for (comp.iquote_include_dirs.items) |dir| { | |
| 1696 | if (try find.checkIncludeDir(dir, .user)) |res| return res; | |
| 1697 | }, | |
| 1698 | .angle_brackets => {}, | |
| 1338 | 1699 | } |
| 1339 | if (self.sys_include_dirs_idx < self.comp.system_include_dirs.items.len) { | |
| 1340 | defer self.sys_include_dirs_idx += 1; | |
| 1341 | return .{ .path = self.comp.system_include_dirs.items[self.sys_include_dirs_idx], .kind = .system }; | |
| 1700 | for (comp.include_dirs.items) |dir| { | |
| 1701 | if (try find.checkIncludeDir(dir, .user)) |res| return res; | |
| 1342 | 1702 | } |
| 1343 | if (self.comp.ms_cwd_source_id) |source_id| { | |
| 1344 | if (self.tried_ms_cwd) return null; | |
| 1345 | self.tried_ms_cwd = true; | |
| 1346 | const path = self.comp.getSource(source_id).path; | |
| 1347 | return .{ .path = std.fs.path.dirname(path) orelse ".", .kind = .user }; | |
| 1703 | for (comp.framework_dirs.items) |dir| { | |
| 1704 | if (try find.checkFrameworkDir(dir, .user)) |res| return res; | |
| 1348 | 1705 | } |
| 1349 | return null; | |
| 1350 | } | |
| 1351 | ||
| 1352 | /// Returned value's path field must be freed by allocator | |
| 1353 | fn nextWithFile(self: *IncludeDirIterator, filename: []const u8, allocator: Allocator) !?FoundSource { | |
| 1354 | while (self.next()) |found| { | |
| 1355 | const path = try std.fs.path.join(allocator, &.{ found.path, filename }); | |
| 1356 | if (self.comp.langopts.ms_extensions) { | |
| 1357 | std.mem.replaceScalar(u8, path, '\\', '/'); | |
| 1358 | } | |
| 1359 | return .{ .path = path, .kind = found.kind }; | |
| 1706 | for (comp.system_include_dirs.items) |dir| { | |
| 1707 | if (try find.checkIncludeDir(dir, .system)) |res| return res; | |
| 1708 | } | |
| 1709 | for (comp.system_framework_dirs.items) |dir| { | |
| 1710 | if (try find.checkFrameworkDir(dir, .system)) |res| return res; | |
| 1711 | } | |
| 1712 | for (comp.after_include_dirs.items) |dir| { | |
| 1713 | if (try find.checkIncludeDir(dir, .system)) |res| return res; | |
| 1714 | } | |
| 1715 | if (comp.ms_cwd_source_id) |source_id| { | |
| 1716 | if (try find.checkMsCwdIncludeDir(source_id)) |res| return res; | |
| 1360 | 1717 | } |
| 1361 | 1718 | return null; |
| 1362 | 1719 | } |
| 1363 | ||
| 1364 | /// Advance the iterator until it finds an include directory that matches | |
| 1365 | /// the directory which contains `source`. | |
| 1366 | fn skipUntilDirMatch(self: *IncludeDirIterator, source: Source.Id) void { | |
| 1367 | const path = self.comp.getSource(source).path; | |
| 1368 | const includer_path = std.fs.path.dirname(path) orelse "."; | |
| 1369 | while (self.next()) |found| { | |
| 1370 | if (mem.eql(u8, includer_path, found.path)) break; | |
| 1720 | fn checkIncludeDir(find: *FindInclude, include_dir: []const u8, kind: Source.Kind) Allocator.Error!?Result { | |
| 1721 | if (find.wait_for) |wait_for| { | |
| 1722 | if (std.mem.eql(u8, include_dir, wait_for)) find.wait_for = null; | |
| 1723 | return null; | |
| 1371 | 1724 | } |
| 1725 | return find.check("{s}{c}{s}", .{ | |
| 1726 | include_dir, | |
| 1727 | std.fs.path.sep, | |
| 1728 | find.include_path, | |
| 1729 | }, kind, false); | |
| 1372 | 1730 | } |
| 1373 | }; | |
| 1374 | ||
| 1375 | pub fn hasInclude( | |
| 1376 | comp: *const Compilation, | |
| 1377 | filename: []const u8, | |
| 1378 | includer_token_source: Source.Id, | |
| 1379 | /// angle bracket vs quotes | |
| 1380 | include_type: IncludeType, | |
| 1381 | /// __has_include vs __has_include_next | |
| 1382 | which: WhichInclude, | |
| 1383 | ) !bool { | |
| 1384 | if (mem.indexOfScalar(u8, filename, 0) != null) { | |
| 1385 | return false; | |
| 1731 | fn checkMsCwdIncludeDir(find: *FindInclude, source_id: Source.Id) Allocator.Error!?Result { | |
| 1732 | const path = find.comp.getSource(source_id).path; | |
| 1733 | const dir = std.fs.path.dirname(path) orelse "."; | |
| 1734 | if (find.wait_for) |wait_for| { | |
| 1735 | if (std.mem.eql(u8, dir, wait_for)) find.wait_for = null; | |
| 1736 | return null; | |
| 1737 | } | |
| 1738 | return find.check("{s}{c}{s}", .{ | |
| 1739 | dir, | |
| 1740 | std.fs.path.sep, | |
| 1741 | find.include_path, | |
| 1742 | }, .user, true); | |
| 1386 | 1743 | } |
| 1387 | ||
| 1388 | if (std.fs.path.isAbsolute(filename)) { | |
| 1389 | if (which == .next) return false; | |
| 1390 | return !std.meta.isError(comp.cwd.access(filename, .{})); | |
| 1744 | fn checkFrameworkDir(find: *FindInclude, framework_dir: []const u8, kind: Source.Kind) Allocator.Error!?Result { | |
| 1745 | if (find.wait_for) |wait_for| { | |
| 1746 | match: { | |
| 1747 | // If this is a match, then `wait_for` looks like '.../Foo.framework/Headers'. | |
| 1748 | const wait_framework = std.fs.path.dirname(wait_for) orelse break :match; | |
| 1749 | const wait_framework_dir = std.fs.path.dirname(wait_framework) orelse break :match; | |
| 1750 | if (!std.mem.eql(u8, framework_dir, wait_framework_dir)) break :match; | |
| 1751 | find.wait_for = null; | |
| 1752 | } | |
| 1753 | return null; | |
| 1754 | } | |
| 1755 | // For an include like 'Foo/Bar.h', search in '<framework_dir>/Foo.framework/Headers/Bar.h'. | |
| 1756 | const framework_name: []const u8, const header_sub_path: []const u8 = f: { | |
| 1757 | const i = std.mem.indexOfScalar(u8, find.include_path, '/') orelse return null; | |
| 1758 | break :f .{ find.include_path[0..i], find.include_path[i + 1 ..] }; | |
| 1759 | }; | |
| 1760 | return find.check("{s}{c}{s}.framework{c}Headers{c}{s}", .{ | |
| 1761 | framework_dir, | |
| 1762 | std.fs.path.sep, | |
| 1763 | framework_name, | |
| 1764 | std.fs.path.sep, | |
| 1765 | std.fs.path.sep, | |
| 1766 | header_sub_path, | |
| 1767 | }, kind, false); | |
| 1391 | 1768 | } |
| 1769 | fn check( | |
| 1770 | find: *FindInclude, | |
| 1771 | comptime format: []const u8, | |
| 1772 | args: anytype, | |
| 1773 | kind: Source.Kind, | |
| 1774 | used_ms_search_rule: bool, | |
| 1775 | ) Allocator.Error!?Result { | |
| 1776 | const comp = find.comp; | |
| 1392 | 1777 | |
| 1393 | const cwd_source_id = switch (include_type) { | |
| 1394 | .quotes => switch (which) { | |
| 1395 | .first => includer_token_source, | |
| 1396 | .next => null, | |
| 1397 | }, | |
| 1398 | .angle_brackets => null, | |
| 1399 | }; | |
| 1400 | var it = IncludeDirIterator{ .comp = comp, .cwd_source_id = cwd_source_id }; | |
| 1401 | if (which == .next) { | |
| 1402 | it.skipUntilDirMatch(includer_token_source); | |
| 1403 | } | |
| 1778 | var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); | |
| 1779 | const sfa = stack_fallback.get(); | |
| 1780 | const header_path = try std.fmt.allocPrint(sfa, format, args); | |
| 1781 | defer sfa.free(header_path); | |
| 1404 | 1782 | |
| 1405 | var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); | |
| 1406 | const sf_allocator = stack_fallback.get(); | |
| 1407 | ||
| 1408 | while (try it.nextWithFile(filename, sf_allocator)) |found| { | |
| 1409 | defer sf_allocator.free(found.path); | |
| 1410 | if (!std.meta.isError(comp.cwd.access(found.path, .{}))) return true; | |
| 1783 | if (find.comp.langopts.ms_extensions) { | |
| 1784 | std.mem.replaceScalar(u8, header_path, '\\', '/'); | |
| 1785 | } | |
| 1786 | const source = comp.addSourceFromPathExtra(header_path, kind) catch |err| switch (err) { | |
| 1787 | error.OutOfMemory => |e| return e, | |
| 1788 | else => return null, | |
| 1789 | }; | |
| 1790 | return .{ | |
| 1791 | .source = source.id, | |
| 1792 | .kind = kind, | |
| 1793 | .used_ms_search_rule = used_ms_search_rule, | |
| 1794 | }; | |
| 1411 | 1795 | } |
| 1412 | return false; | |
| 1413 | } | |
| 1796 | }; | |
| 1414 | 1797 | |
| 1415 | 1798 | pub const WhichInclude = enum { |
| 1416 | 1799 | first, |
| ... | ... | @@ -1422,12 +1805,39 @@ pub const IncludeType = enum { |
| 1422 | 1805 | angle_brackets, |
| 1423 | 1806 | }; |
| 1424 | 1807 | |
| 1425 | fn getFileContents(comp: *Compilation, path: []const u8, limit: ?u32) ![]const u8 { | |
| 1808 | fn getPathContents(comp: *Compilation, path: []const u8, limit: std.Io.Limit) ![]u8 { | |
| 1426 | 1809 | if (mem.indexOfScalar(u8, path, 0) != null) { |
| 1427 | 1810 | return error.FileNotFound; |
| 1428 | 1811 | } |
| 1429 | 1812 | |
| 1430 | return comp.cwd.readFileAlloc(path, comp.gpa, .limited(limit orelse std.math.maxInt(u32))); | |
| 1813 | const file = try comp.cwd.openFile(path, .{}); | |
| 1814 | defer file.close(); | |
| 1815 | return comp.getFileContents(file, limit); | |
| 1816 | } | |
| 1817 | ||
| 1818 | fn getFileContents(comp: *Compilation, file: std.fs.File, limit: std.Io.Limit) ![]u8 { | |
| 1819 | var file_buf: [4096]u8 = undefined; | |
| 1820 | var file_reader = file.reader(&file_buf); | |
| 1821 | ||
| 1822 | var allocating: std.Io.Writer.Allocating = .init(comp.gpa); | |
| 1823 | defer allocating.deinit(); | |
| 1824 | if (file_reader.getSize()) |size| { | |
| 1825 | const limited_size = limit.minInt64(size); | |
| 1826 | if (limited_size > std.math.maxInt(u32)) return error.FileTooBig; | |
| 1827 | try allocating.ensureUnusedCapacity(limited_size); | |
| 1828 | } else |_| {} | |
| 1829 | ||
| 1830 | var remaining = limit.min(.limited(std.math.maxInt(u32))); | |
| 1831 | while (remaining.nonzero()) { | |
| 1832 | const n = file_reader.interface.stream(&allocating.writer, remaining) catch |err| switch (err) { | |
| 1833 | error.EndOfStream => return allocating.toOwnedSlice(), | |
| 1834 | error.WriteFailed => return error.OutOfMemory, | |
| 1835 | error.ReadFailed => return file_reader.err.?, | |
| 1836 | }; | |
| 1837 | remaining = remaining.subtract(n).?; | |
| 1838 | } | |
| 1839 | if (limit == .unlimited) return error.FileTooBig; | |
| 1840 | return allocating.toOwnedSlice(); | |
| 1431 | 1841 | } |
| 1432 | 1842 | |
| 1433 | 1843 | pub fn findEmbed( |
| ... | ... | @@ -1436,30 +1846,53 @@ pub fn findEmbed( |
| 1436 | 1846 | includer_token_source: Source.Id, |
| 1437 | 1847 | /// angle bracket vs quotes |
| 1438 | 1848 | include_type: IncludeType, |
| 1439 | limit: ?u32, | |
| 1440 | ) !?[]const u8 { | |
| 1849 | limit: std.Io.Limit, | |
| 1850 | opt_dep_file: ?*DepFile, | |
| 1851 | ) !?[]u8 { | |
| 1441 | 1852 | if (std.fs.path.isAbsolute(filename)) { |
| 1442 | return if (comp.getFileContents(filename, limit)) |some| | |
| 1443 | some | |
| 1444 | else |err| switch (err) { | |
| 1853 | if (comp.getPathContents(filename, limit)) |some| { | |
| 1854 | errdefer comp.gpa.free(some); | |
| 1855 | if (opt_dep_file) |dep_file| try dep_file.addDependencyDupe(comp.gpa, comp.arena, filename); | |
| 1856 | return some; | |
| 1857 | } else |err| switch (err) { | |
| 1445 | 1858 | error.OutOfMemory => |e| return e, |
| 1446 | else => null, | |
| 1447 | }; | |
| 1859 | else => return null, | |
| 1860 | } | |
| 1448 | 1861 | } |
| 1449 | 1862 | |
| 1450 | const cwd_source_id = switch (include_type) { | |
| 1451 | .quotes => includer_token_source, | |
| 1452 | .angle_brackets => null, | |
| 1453 | }; | |
| 1454 | var it = IncludeDirIterator{ .comp = comp, .cwd_source_id = cwd_source_id }; | |
| 1455 | 1863 | var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); |
| 1456 | 1864 | const sf_allocator = stack_fallback.get(); |
| 1457 | 1865 | |
| 1458 | while (try it.nextWithFile(filename, sf_allocator)) |found| { | |
| 1459 | defer sf_allocator.free(found.path); | |
| 1460 | if (comp.getFileContents(found.path, limit)) |some| | |
| 1461 | return some | |
| 1462 | else |err| switch (err) { | |
| 1866 | switch (include_type) { | |
| 1867 | .quotes => { | |
| 1868 | const dir = std.fs.path.dirname(comp.getSource(includer_token_source).path) orelse "."; | |
| 1869 | const path = try std.fs.path.join(sf_allocator, &.{ dir, filename }); | |
| 1870 | defer sf_allocator.free(path); | |
| 1871 | if (comp.langopts.ms_extensions) { | |
| 1872 | std.mem.replaceScalar(u8, path, '\\', '/'); | |
| 1873 | } | |
| 1874 | if (comp.getPathContents(path, limit)) |some| { | |
| 1875 | errdefer comp.gpa.free(some); | |
| 1876 | if (opt_dep_file) |dep_file| try dep_file.addDependencyDupe(comp.gpa, comp.arena, filename); | |
| 1877 | return some; | |
| 1878 | } else |err| switch (err) { | |
| 1879 | error.OutOfMemory => return error.OutOfMemory, | |
| 1880 | else => {}, | |
| 1881 | } | |
| 1882 | }, | |
| 1883 | .angle_brackets => {}, | |
| 1884 | } | |
| 1885 | for (comp.embed_dirs.items) |embed_dir| { | |
| 1886 | const path = try std.fs.path.join(sf_allocator, &.{ embed_dir, filename }); | |
| 1887 | defer sf_allocator.free(path); | |
| 1888 | if (comp.langopts.ms_extensions) { | |
| 1889 | std.mem.replaceScalar(u8, path, '\\', '/'); | |
| 1890 | } | |
| 1891 | if (comp.getPathContents(path, limit)) |some| { | |
| 1892 | errdefer comp.gpa.free(some); | |
| 1893 | if (opt_dep_file) |dep_file| try dep_file.addDependencyDupe(comp.gpa, comp.arena, filename); | |
| 1894 | return some; | |
| 1895 | } else |err| switch (err) { | |
| 1463 | 1896 | error.OutOfMemory => return error.OutOfMemory, |
| 1464 | 1897 | else => {}, |
| 1465 | 1898 | } |
| ... | ... | @@ -1475,54 +1908,29 @@ pub fn findInclude( |
| 1475 | 1908 | include_type: IncludeType, |
| 1476 | 1909 | /// include vs include_next |
| 1477 | 1910 | which: WhichInclude, |
| 1478 | ) !?Source { | |
| 1479 | if (std.fs.path.isAbsolute(filename)) { | |
| 1480 | if (which == .next) return null; | |
| 1481 | // TODO: classify absolute file as belonging to system includes or not? | |
| 1482 | return if (comp.addSourceFromPath(filename)) |some| | |
| 1483 | some | |
| 1484 | else |err| switch (err) { | |
| 1485 | error.OutOfMemory => |e| return e, | |
| 1486 | else => null, | |
| 1487 | }; | |
| 1488 | } | |
| 1489 | const cwd_source_id = switch (include_type) { | |
| 1490 | .quotes => switch (which) { | |
| 1491 | .first => includer_token.source, | |
| 1492 | .next => null, | |
| 1911 | ) Compilation.Error!?Source { | |
| 1912 | const found = try FindInclude.run(comp, filename, include_type, switch (which) { | |
| 1913 | .next => .{ .only_search_after_dir = comp.getSource(includer_token.source).path }, | |
| 1914 | .first => switch (include_type) { | |
| 1915 | .quotes => .{ .allow_same_dir = comp.getSource(includer_token.source).path }, | |
| 1916 | .angle_brackets => .only_search, | |
| 1493 | 1917 | }, |
| 1494 | .angle_brackets => null, | |
| 1495 | }; | |
| 1496 | var it = IncludeDirIterator{ .comp = comp, .cwd_source_id = cwd_source_id }; | |
| 1497 | ||
| 1498 | if (which == .next) { | |
| 1499 | it.skipUntilDirMatch(includer_token.source); | |
| 1918 | }) orelse return null; | |
| 1919 | if (found.used_ms_search_rule) { | |
| 1920 | const diagnostic: Diagnostic = .ms_search_rule; | |
| 1921 | try comp.diagnostics.add(.{ | |
| 1922 | .text = diagnostic.fmt, | |
| 1923 | .kind = diagnostic.kind, | |
| 1924 | .opt = diagnostic.opt, | |
| 1925 | .extension = diagnostic.extension, | |
| 1926 | .location = (Source.Location{ | |
| 1927 | .id = includer_token.source, | |
| 1928 | .byte_offset = includer_token.start, | |
| 1929 | .line = includer_token.line, | |
| 1930 | }).expand(comp), | |
| 1931 | }); | |
| 1500 | 1932 | } |
| 1501 | ||
| 1502 | var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); | |
| 1503 | const sf_allocator = stack_fallback.get(); | |
| 1504 | ||
| 1505 | while (try it.nextWithFile(filename, sf_allocator)) |found| { | |
| 1506 | defer sf_allocator.free(found.path); | |
| 1507 | if (comp.addSourceFromPathExtra(found.path, found.kind)) |some| { | |
| 1508 | if (it.tried_ms_cwd) { | |
| 1509 | try comp.addDiagnostic(.{ | |
| 1510 | .tag = .ms_search_rule, | |
| 1511 | .extra = .{ .str = some.path }, | |
| 1512 | .loc = .{ | |
| 1513 | .id = includer_token.source, | |
| 1514 | .byte_offset = includer_token.start, | |
| 1515 | .line = includer_token.line, | |
| 1516 | }, | |
| 1517 | }, &.{}); | |
| 1518 | } | |
| 1519 | return some; | |
| 1520 | } else |err| switch (err) { | |
| 1521 | error.OutOfMemory => return error.OutOfMemory, | |
| 1522 | else => {}, | |
| 1523 | } | |
| 1524 | } | |
| 1525 | return null; | |
| 1933 | return comp.getSource(found.source); | |
| 1526 | 1934 | } |
| 1527 | 1935 | |
| 1528 | 1936 | pub fn addPragmaHandler(comp: *Compilation, name: []const u8, handler: *Pragma) Allocator.Error!void { |
| ... | ... | @@ -1574,12 +1982,6 @@ pub fn pragmaEvent(comp: *Compilation, event: PragmaEvent) void { |
| 1574 | 1982 | } |
| 1575 | 1983 | |
| 1576 | 1984 | pub fn hasBuiltin(comp: *const Compilation, name: []const u8) bool { |
| 1577 | if (std.mem.eql(u8, name, "__builtin_va_arg") or | |
| 1578 | std.mem.eql(u8, name, "__builtin_choose_expr") or | |
| 1579 | std.mem.eql(u8, name, "__builtin_bitoffsetof") or | |
| 1580 | std.mem.eql(u8, name, "__builtin_offsetof") or | |
| 1581 | std.mem.eql(u8, name, "__builtin_types_compatible_p")) return true; | |
| 1582 | ||
| 1583 | 1985 | const builtin = Builtin.fromName(name) orelse return false; |
| 1584 | 1986 | return comp.hasBuiltinFunction(builtin); |
| 1585 | 1987 | } |
| ... | ... | @@ -1605,6 +2007,16 @@ pub fn locSlice(comp: *const Compilation, loc: Source.Location) []const u8 { |
| 1605 | 2007 | return tmp_tokenizer.buf[tok.start..tok.end]; |
| 1606 | 2008 | } |
| 1607 | 2009 | |
| 2010 | pub fn getSourceMTimeUncached(comp: *const Compilation, source_id: Source.Id) ?u64 { | |
| 2011 | const source = comp.getSource(source_id); | |
| 2012 | if (comp.cwd.statFile(source.path)) |stat| { | |
| 2013 | const mtime = @divTrunc(stat.mtime, std.time.ns_per_s); | |
| 2014 | return std.math.cast(u64, mtime); | |
| 2015 | } else |_| { | |
| 2016 | return null; | |
| 2017 | } | |
| 2018 | } | |
| 2019 | ||
| 1608 | 2020 | pub const CharUnitSize = enum(u32) { |
| 1609 | 2021 | @"1" = 1, |
| 1610 | 2022 | @"2" = 2, |
| ... | ... | @@ -1619,66 +2031,100 @@ pub const CharUnitSize = enum(u32) { |
| 1619 | 2031 | } |
| 1620 | 2032 | }; |
| 1621 | 2033 | |
| 1622 | pub const addDiagnostic = Diagnostics.add; | |
| 2034 | pub const Diagnostic = struct { | |
| 2035 | fmt: []const u8, | |
| 2036 | kind: Diagnostics.Message.Kind, | |
| 2037 | opt: ?Diagnostics.Option = null, | |
| 2038 | extension: bool = false, | |
| 2039 | ||
| 2040 | pub const backslash_newline_escape: Diagnostic = .{ | |
| 2041 | .fmt = "backslash and newline separated by space", | |
| 2042 | .kind = .warning, | |
| 2043 | .opt = .@"backslash-newline-escape", | |
| 2044 | }; | |
| 2045 | ||
| 2046 | pub const ms_search_rule: Diagnostic = .{ | |
| 2047 | .fmt = "#include resolved using non-portable Microsoft search rules as: {s}", | |
| 2048 | .kind = .warning, | |
| 2049 | .opt = .@"microsoft-include", | |
| 2050 | .extension = true, | |
| 2051 | }; | |
| 2052 | ||
| 2053 | pub const ctrl_z_eof: Diagnostic = .{ | |
| 2054 | .fmt = "treating Ctrl-Z as end-of-file is a Microsoft extension", | |
| 2055 | .kind = .off, | |
| 2056 | .opt = .@"microsoft-end-of-file", | |
| 2057 | .extension = true, | |
| 2058 | }; | |
| 2059 | }; | |
| 1623 | 2060 | |
| 1624 | test "addSourceFromReader" { | |
| 2061 | test "addSourceFromBuffer" { | |
| 1625 | 2062 | const Test = struct { |
| 1626 | fn addSourceFromReader(str: []const u8, expected: []const u8, warning_count: u32, splices: []const u32) !void { | |
| 1627 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 2063 | fn addSourceFromBuffer(str: []const u8, expected: []const u8, warning_count: u32, splices: []const u32) !void { | |
| 2064 | var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 2065 | defer arena.deinit(); | |
| 2066 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 2067 | var comp = Compilation.init(std.testing.allocator, arena.allocator(), &diagnostics, std.fs.cwd()); | |
| 1628 | 2068 | defer comp.deinit(); |
| 1629 | 2069 | |
| 1630 | var buf_reader: std.Io.Reader = .fixed(str); | |
| 1631 | const source = try comp.addSourceFromReader(&buf_reader, "path", .user); | |
| 2070 | const source = try comp.addSourceFromBuffer("path", str); | |
| 1632 | 2071 | |
| 1633 | 2072 | try std.testing.expectEqualStrings(expected, source.buf); |
| 1634 | try std.testing.expectEqual(warning_count, @as(u32, @intCast(comp.diagnostics.list.items.len))); | |
| 2073 | try std.testing.expectEqual(warning_count, @as(u32, @intCast(diagnostics.warnings))); | |
| 1635 | 2074 | try std.testing.expectEqualSlices(u32, splices, source.splice_locs); |
| 1636 | 2075 | } |
| 1637 | 2076 | |
| 1638 | 2077 | fn withAllocationFailures(allocator: std.mem.Allocator) !void { |
| 1639 | var comp = Compilation.init(allocator, std.fs.cwd()); | |
| 2078 | var arena: std.heap.ArenaAllocator = .init(allocator); | |
| 2079 | defer arena.deinit(); | |
| 2080 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 2081 | var comp = Compilation.init(allocator, arena.allocator(), &diagnostics, std.fs.cwd()); | |
| 1640 | 2082 | defer comp.deinit(); |
| 1641 | 2083 | |
| 1642 | 2084 | _ = try comp.addSourceFromBuffer("path", "spliced\\\nbuffer\n"); |
| 1643 | 2085 | _ = try comp.addSourceFromBuffer("path", "non-spliced buffer\n"); |
| 1644 | 2086 | } |
| 1645 | 2087 | }; |
| 1646 | try Test.addSourceFromReader("ab\\\nc", "abc", 0, &.{2}); | |
| 1647 | try Test.addSourceFromReader("ab\\\rc", "abc", 0, &.{2}); | |
| 1648 | try Test.addSourceFromReader("ab\\\r\nc", "abc", 0, &.{2}); | |
| 1649 | try Test.addSourceFromReader("ab\\ \nc", "abc", 1, &.{2}); | |
| 1650 | try Test.addSourceFromReader("ab\\\t\nc", "abc", 1, &.{2}); | |
| 1651 | try Test.addSourceFromReader("ab\\ \t\nc", "abc", 1, &.{2}); | |
| 1652 | try Test.addSourceFromReader("ab\\\r \nc", "ab \nc", 0, &.{2}); | |
| 1653 | try Test.addSourceFromReader("ab\\\\\nc", "ab\\c", 0, &.{3}); | |
| 1654 | try Test.addSourceFromReader("ab\\ \r\nc", "abc", 1, &.{2}); | |
| 1655 | try Test.addSourceFromReader("ab\\ \\\nc", "ab\\ c", 0, &.{4}); | |
| 1656 | try Test.addSourceFromReader("ab\\\r\\\nc", "abc", 0, &.{ 2, 2 }); | |
| 1657 | try Test.addSourceFromReader("ab\\ \rc", "abc", 1, &.{2}); | |
| 1658 | try Test.addSourceFromReader("ab\\", "ab\\", 0, &.{}); | |
| 1659 | try Test.addSourceFromReader("ab\\\\", "ab\\\\", 0, &.{}); | |
| 1660 | try Test.addSourceFromReader("ab\\ ", "ab\\ ", 0, &.{}); | |
| 1661 | try Test.addSourceFromReader("ab\\\n", "ab", 0, &.{2}); | |
| 1662 | try Test.addSourceFromReader("ab\\\r\n", "ab", 0, &.{2}); | |
| 1663 | try Test.addSourceFromReader("ab\\\r", "ab", 0, &.{2}); | |
| 2088 | try Test.addSourceFromBuffer("ab\\\nc", "abc", 0, &.{2}); | |
| 2089 | try Test.addSourceFromBuffer("ab\\\rc", "abc", 0, &.{2}); | |
| 2090 | try Test.addSourceFromBuffer("ab\\\r\nc", "abc", 0, &.{2}); | |
| 2091 | try Test.addSourceFromBuffer("ab\\ \nc", "abc", 1, &.{2}); | |
| 2092 | try Test.addSourceFromBuffer("ab\\\t\nc", "abc", 1, &.{2}); | |
| 2093 | try Test.addSourceFromBuffer("ab\\ \t\nc", "abc", 1, &.{2}); | |
| 2094 | try Test.addSourceFromBuffer("ab\\\r \nc", "ab \nc", 0, &.{2}); | |
| 2095 | try Test.addSourceFromBuffer("ab\\\\\nc", "ab\\c", 0, &.{3}); | |
| 2096 | try Test.addSourceFromBuffer("ab\\ \r\nc", "abc", 1, &.{2}); | |
| 2097 | try Test.addSourceFromBuffer("ab\\ \\\nc", "ab\\ c", 0, &.{4}); | |
| 2098 | try Test.addSourceFromBuffer("ab\\\r\\\nc", "abc", 0, &.{ 2, 2 }); | |
| 2099 | try Test.addSourceFromBuffer("ab\\ \rc", "abc", 1, &.{2}); | |
| 2100 | try Test.addSourceFromBuffer("ab\\", "ab\\", 0, &.{}); | |
| 2101 | try Test.addSourceFromBuffer("ab\\\\", "ab\\\\", 0, &.{}); | |
| 2102 | try Test.addSourceFromBuffer("ab\\ ", "ab\\ ", 0, &.{}); | |
| 2103 | try Test.addSourceFromBuffer("ab\\\n", "ab", 0, &.{2}); | |
| 2104 | try Test.addSourceFromBuffer("ab\\\r\n", "ab", 0, &.{2}); | |
| 2105 | try Test.addSourceFromBuffer("ab\\\r", "ab", 0, &.{2}); | |
| 1664 | 2106 | |
| 1665 | 2107 | // carriage return normalization |
| 1666 | try Test.addSourceFromReader("ab\r", "ab\n", 0, &.{}); | |
| 1667 | try Test.addSourceFromReader("ab\r\r", "ab\n\n", 0, &.{}); | |
| 1668 | try Test.addSourceFromReader("ab\r\r\n", "ab\n\n", 0, &.{}); | |
| 1669 | try Test.addSourceFromReader("ab\r\r\n\r", "ab\n\n\n", 0, &.{}); | |
| 1670 | try Test.addSourceFromReader("\r\\", "\n\\", 0, &.{}); | |
| 1671 | try Test.addSourceFromReader("\\\r\\", "\\", 0, &.{0}); | |
| 2108 | try Test.addSourceFromBuffer("ab\r", "ab\n", 0, &.{}); | |
| 2109 | try Test.addSourceFromBuffer("ab\r\r", "ab\n\n", 0, &.{}); | |
| 2110 | try Test.addSourceFromBuffer("ab\r\r\n", "ab\n\n", 0, &.{}); | |
| 2111 | try Test.addSourceFromBuffer("ab\r\r\n\r", "ab\n\n\n", 0, &.{}); | |
| 2112 | try Test.addSourceFromBuffer("\r\\", "\n\\", 0, &.{}); | |
| 2113 | try Test.addSourceFromBuffer("\\\r\\", "\\", 0, &.{0}); | |
| 1672 | 2114 | |
| 1673 | 2115 | try std.testing.checkAllAllocationFailures(std.testing.allocator, Test.withAllocationFailures, .{}); |
| 1674 | 2116 | } |
| 1675 | 2117 | |
| 1676 | test "addSourceFromReader - exhaustive check for carriage return elimination" { | |
| 2118 | test "addSourceFromBuffer - exhaustive check for carriage return elimination" { | |
| 2119 | var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 2120 | defer arena.deinit(); | |
| 2121 | ||
| 1677 | 2122 | const alphabet = [_]u8{ '\r', '\n', ' ', '\\', 'a' }; |
| 1678 | 2123 | const alen = alphabet.len; |
| 1679 | 2124 | var buf: [alphabet.len]u8 = [1]u8{alphabet[0]} ** alen; |
| 1680 | 2125 | |
| 1681 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 2126 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 2127 | var comp = Compilation.init(std.testing.allocator, arena.allocator(), &diagnostics, std.fs.cwd()); | |
| 1682 | 2128 | defer comp.deinit(); |
| 1683 | 2129 | |
| 1684 | 2130 | var source_count: u32 = 0; |
| ... | ... | @@ -1703,28 +2149,31 @@ test "addSourceFromReader - exhaustive check for carriage return elimination" { |
| 1703 | 2149 | |
| 1704 | 2150 | test "ignore BOM at beginning of file" { |
| 1705 | 2151 | const BOM = "\xEF\xBB\xBF"; |
| 1706 | ||
| 1707 | 2152 | const Test = struct { |
| 1708 | fn run(buf: []const u8) !void { | |
| 1709 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 2153 | fn run(arena: Allocator, buf: []const u8) !void { | |
| 2154 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 2155 | var comp = Compilation.init(std.testing.allocator, arena, &diagnostics, std.fs.cwd()); | |
| 1710 | 2156 | defer comp.deinit(); |
| 1711 | 2157 | |
| 1712 | var buf_reader: std.Io.Reader = .fixed(buf); | |
| 1713 | const source = try comp.addSourceFromReader(&buf_reader, "file.c", .user); | |
| 2158 | const source = try comp.addSourceFromBuffer("file.c", buf); | |
| 1714 | 2159 | const expected_output = if (mem.startsWith(u8, buf, BOM)) buf[BOM.len..] else buf; |
| 1715 | 2160 | try std.testing.expectEqualStrings(expected_output, source.buf); |
| 1716 | 2161 | } |
| 1717 | 2162 | }; |
| 1718 | 2163 | |
| 1719 | try Test.run(BOM); | |
| 1720 | try Test.run(BOM ++ "x"); | |
| 1721 | try Test.run("x" ++ BOM); | |
| 1722 | try Test.run(BOM ++ " "); | |
| 1723 | try Test.run(BOM ++ "\n"); | |
| 1724 | try Test.run(BOM ++ "\\"); | |
| 1725 | ||
| 1726 | try Test.run(BOM[0..1] ++ "x"); | |
| 1727 | try Test.run(BOM[0..2] ++ "x"); | |
| 1728 | try Test.run(BOM[1..] ++ "x"); | |
| 1729 | try Test.run(BOM[2..] ++ "x"); | |
| 2164 | var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 2165 | defer arena_state.deinit(); | |
| 2166 | const arena = arena_state.allocator(); | |
| 2167 | ||
| 2168 | try Test.run(arena, BOM); | |
| 2169 | try Test.run(arena, BOM ++ "x"); | |
| 2170 | try Test.run(arena, "x" ++ BOM); | |
| 2171 | try Test.run(arena, BOM ++ " "); | |
| 2172 | try Test.run(arena, BOM ++ "\n"); | |
| 2173 | try Test.run(arena, BOM ++ "\\"); | |
| 2174 | ||
| 2175 | try Test.run(arena, BOM[0..1] ++ "x"); | |
| 2176 | try Test.run(arena, BOM[0..2] ++ "x"); | |
| 2177 | try Test.run(arena, BOM[1..] ++ "x"); | |
| 2178 | try Test.run(arena, BOM[2..] ++ "x"); | |
| 1730 | 2179 | } |
lib/compiler/aro/aro/DepFile.zig created+99| ... | ... | @@ -0,0 +1,99 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Allocator = std.mem.Allocator; | |
| 3 | ||
| 4 | pub const Format = enum { make, nmake }; | |
| 5 | ||
| 6 | const DepFile = @This(); | |
| 7 | ||
| 8 | target: []const u8, | |
| 9 | deps: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 10 | format: Format, | |
| 11 | ||
| 12 | pub fn deinit(d: *DepFile, gpa: Allocator) void { | |
| 13 | d.deps.deinit(gpa); | |
| 14 | d.* = undefined; | |
| 15 | } | |
| 16 | ||
| 17 | pub fn addDependency(d: *DepFile, gpa: Allocator, path: []const u8) !void { | |
| 18 | try d.deps.put(gpa, path, {}); | |
| 19 | } | |
| 20 | ||
| 21 | pub fn addDependencyDupe(d: *DepFile, gpa: Allocator, arena: Allocator, path: []const u8) !void { | |
| 22 | const gop = try d.deps.getOrPut(gpa, path); | |
| 23 | if (gop.found_existing) return; | |
| 24 | gop.key_ptr.* = try arena.dupe(u8, path); | |
| 25 | } | |
| 26 | ||
| 27 | pub fn write(d: *const DepFile, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 28 | const max_columns = 75; | |
| 29 | var columns: usize = 0; | |
| 30 | ||
| 31 | try writeTarget(d.target, w); | |
| 32 | columns += d.target.len; | |
| 33 | try w.writeByte(':'); | |
| 34 | columns += 1; | |
| 35 | ||
| 36 | for (d.deps.keys()) |path| { | |
| 37 | if (std.mem.eql(u8, path, "<stdin>")) continue; | |
| 38 | ||
| 39 | if (columns + path.len + " \\\n".len > max_columns) { | |
| 40 | try w.writeAll(" \\\n "); | |
| 41 | columns = 1; | |
| 42 | } | |
| 43 | try w.writeByte(' '); | |
| 44 | try d.writePath(path, w); | |
| 45 | columns += path.len + 1; | |
| 46 | } | |
| 47 | try w.writeByte('\n'); | |
| 48 | try w.flush(); | |
| 49 | } | |
| 50 | ||
| 51 | fn writeTarget(path: []const u8, w: *std.Io.Writer) !void { | |
| 52 | for (path, 0..) |c, i| { | |
| 53 | switch (c) { | |
| 54 | ' ', '\t' => { | |
| 55 | try w.writeByte('\\'); | |
| 56 | var j = i; | |
| 57 | while (j != 0) { | |
| 58 | j -= 1; | |
| 59 | if (path[j] != '\\') break; | |
| 60 | try w.writeByte('\\'); | |
| 61 | } | |
| 62 | }, | |
| 63 | '$' => try w.writeByte('$'), | |
| 64 | '#' => try w.writeByte('\\'), | |
| 65 | else => {}, | |
| 66 | } | |
| 67 | try w.writeByte(c); | |
| 68 | } | |
| 69 | } | |
| 70 | ||
| 71 | fn writePath(d: *const DepFile, path: []const u8, w: *std.Io.Writer) !void { | |
| 72 | switch (d.format) { | |
| 73 | .nmake => { | |
| 74 | if (std.mem.indexOfAny(u8, path, " #${}^!")) |_| | |
| 75 | try w.print("\"{s}\"", .{path}) | |
| 76 | else | |
| 77 | try w.writeAll(path); | |
| 78 | }, | |
| 79 | .make => { | |
| 80 | for (path, 0..) |c, i| { | |
| 81 | switch (c) { | |
| 82 | ' ' => { | |
| 83 | try w.writeByte('\\'); | |
| 84 | var j = i; | |
| 85 | while (j != 0) { | |
| 86 | j -= 1; | |
| 87 | if (path[j] != '\\') break; | |
| 88 | try w.writeByte('\\'); | |
| 89 | } | |
| 90 | }, | |
| 91 | '$' => try w.writeByte('$'), | |
| 92 | '#' => try w.writeByte('\\'), | |
| 93 | else => {}, | |
| 94 | } | |
| 95 | try w.writeByte(c); | |
| 96 | } | |
| 97 | }, | |
| 98 | } | |
| 99 | } |
lib/compiler/aro/aro/Diagnostics.zig+488-516| ... | ... | @@ -1,592 +1,564 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const assert = std.debug.assert; | |
| 3 | const Allocator = mem.Allocator; | |
| 4 | 2 | const mem = std.mem; |
| 5 | const Source = @import("Source.zig"); | |
| 3 | const Allocator = mem.Allocator; | |
| 4 | ||
| 6 | 5 | const Compilation = @import("Compilation.zig"); |
| 7 | const Attribute = @import("Attribute.zig"); | |
| 8 | const Builtins = @import("Builtins.zig"); | |
| 9 | const Builtin = Builtins.Builtin; | |
| 10 | const Header = @import("Builtins/Properties.zig").Header; | |
| 11 | const Tree = @import("Tree.zig"); | |
| 12 | const is_windows = @import("builtin").os.tag == .windows; | |
| 13 | 6 | const LangOpts = @import("LangOpts.zig"); |
| 7 | const Source = @import("Source.zig"); | |
| 14 | 8 | |
| 15 | 9 | pub const Message = struct { |
| 16 | tag: Tag, | |
| 17 | kind: Kind = undefined, | |
| 18 | loc: Source.Location = .{}, | |
| 19 | extra: Extra = .{ .none = {} }, | |
| 20 | ||
| 21 | pub const Extra = union { | |
| 22 | str: []const u8, | |
| 23 | tok_id: struct { | |
| 24 | expected: Tree.Token.Id, | |
| 25 | actual: Tree.Token.Id, | |
| 26 | }, | |
| 27 | tok_id_expected: Tree.Token.Id, | |
| 28 | arguments: struct { | |
| 29 | expected: u32, | |
| 30 | actual: u32, | |
| 31 | }, | |
| 32 | codepoints: struct { | |
| 33 | actual: u21, | |
| 34 | resembles: u21, | |
| 35 | }, | |
| 36 | attr_arg_count: struct { | |
| 37 | attribute: Attribute.Tag, | |
| 38 | expected: u32, | |
| 39 | }, | |
| 40 | attr_arg_type: struct { | |
| 41 | expected: Attribute.ArgumentType, | |
| 42 | actual: Attribute.ArgumentType, | |
| 43 | }, | |
| 44 | attr_enum: struct { | |
| 45 | tag: Attribute.Tag, | |
| 46 | }, | |
| 47 | ignored_record_attr: struct { | |
| 48 | tag: Attribute.Tag, | |
| 49 | specifier: enum { @"struct", @"union", @"enum" }, | |
| 50 | }, | |
| 51 | attribute_todo: struct { | |
| 52 | tag: Attribute.Tag, | |
| 53 | kind: enum { variables, fields, types, functions }, | |
| 54 | }, | |
| 55 | builtin_with_header: struct { | |
| 56 | builtin: Builtin.Tag, | |
| 57 | header: Header, | |
| 58 | }, | |
| 59 | invalid_escape: struct { | |
| 60 | offset: u32, | |
| 61 | char: u8, | |
| 62 | }, | |
| 63 | actual_codepoint: u21, | |
| 64 | ascii: u7, | |
| 65 | unsigned: u64, | |
| 66 | offset: u64, | |
| 67 | pow_2_as_string: u8, | |
| 68 | signed: i64, | |
| 69 | normalized: []const u8, | |
| 70 | none: void, | |
| 10 | kind: Kind, | |
| 11 | text: []const u8, | |
| 12 | ||
| 13 | opt: ?Option = null, | |
| 14 | extension: bool = false, | |
| 15 | location: ?Source.ExpandedLocation, | |
| 16 | ||
| 17 | effective_kind: Kind = .off, | |
| 18 | ||
| 19 | pub const Kind = enum { | |
| 20 | off, | |
| 21 | note, | |
| 22 | warning, | |
| 23 | @"error", | |
| 24 | @"fatal error", | |
| 71 | 25 | }; |
| 72 | }; | |
| 73 | 26 | |
| 74 | const Properties = struct { | |
| 75 | msg: []const u8, | |
| 76 | kind: Kind, | |
| 77 | extra: std.meta.FieldEnum(Message.Extra) = .none, | |
| 78 | opt: ?u8 = null, | |
| 79 | all: bool = false, | |
| 80 | w_extra: bool = false, | |
| 81 | pedantic: bool = false, | |
| 82 | suppress_version: ?LangOpts.Standard = null, | |
| 83 | suppress_unless_version: ?LangOpts.Standard = null, | |
| 84 | suppress_gnu: bool = false, | |
| 85 | suppress_gcc: bool = false, | |
| 86 | suppress_clang: bool = false, | |
| 87 | suppress_msvc: bool = false, | |
| 88 | ||
| 89 | pub fn makeOpt(comptime str: []const u8) u16 { | |
| 90 | return @offsetOf(Options, str); | |
| 91 | } | |
| 92 | pub fn getKind(prop: Properties, options: *Options) Kind { | |
| 93 | const opt = @as([*]Kind, @ptrCast(options))[prop.opt orelse return prop.kind]; | |
| 94 | if (opt == .default) return prop.kind; | |
| 95 | return opt; | |
| 27 | pub fn write(msg: Message, w: *std.Io.Writer, config: std.Io.tty.Config, details: bool) std.Io.tty.Config.SetColorError!void { | |
| 28 | try config.setColor(w, .bold); | |
| 29 | if (msg.location) |loc| { | |
| 30 | try w.print("{s}:{d}:{d}: ", .{ loc.path, loc.line_no, loc.col }); | |
| 31 | } | |
| 32 | switch (msg.effective_kind) { | |
| 33 | .@"fatal error", .@"error" => try config.setColor(w, .bright_red), | |
| 34 | .note => try config.setColor(w, .bright_cyan), | |
| 35 | .warning => try config.setColor(w, .bright_magenta), | |
| 36 | .off => unreachable, | |
| 37 | } | |
| 38 | try w.print("{s}: ", .{@tagName(msg.effective_kind)}); | |
| 39 | ||
| 40 | try config.setColor(w, .white); | |
| 41 | try w.writeAll(msg.text); | |
| 42 | if (msg.opt) |some| { | |
| 43 | if (msg.effective_kind == .@"error" and msg.kind != .@"error") { | |
| 44 | try w.print(" [-Werror,-W{s}]", .{@tagName(some)}); | |
| 45 | } else if (msg.effective_kind != .note) { | |
| 46 | try w.print(" [-W{s}]", .{@tagName(some)}); | |
| 47 | } | |
| 48 | } else if (msg.extension) { | |
| 49 | if (msg.effective_kind == .@"error") { | |
| 50 | try w.writeAll(" [-Werror,-Wpedantic]"); | |
| 51 | } else if (msg.effective_kind != msg.kind) { | |
| 52 | try w.writeAll(" [-Wpedantic]"); | |
| 53 | } | |
| 54 | } | |
| 55 | ||
| 56 | if (!details or msg.location == null) { | |
| 57 | try w.writeAll("\n"); | |
| 58 | try config.setColor(w, .reset); | |
| 59 | } else { | |
| 60 | const loc = msg.location.?; | |
| 61 | const trailer = if (loc.end_with_splice) "\\ " else ""; | |
| 62 | try config.setColor(w, .reset); | |
| 63 | try w.print("\n{s}{s}\n", .{ loc.line, trailer }); | |
| 64 | try w.splatByteAll(' ', loc.width); | |
| 65 | try config.setColor(w, .bold); | |
| 66 | try config.setColor(w, .bright_green); | |
| 67 | try w.writeAll("^\n"); | |
| 68 | try config.setColor(w, .reset); | |
| 69 | } | |
| 70 | try w.flush(); | |
| 96 | 71 | } |
| 97 | pub const max_bits = Compilation.bit_int_max_bits; | |
| 98 | 72 | }; |
| 99 | 73 | |
| 100 | pub const Tag = @import("Diagnostics/messages.zig").with(Properties).Tag; | |
| 101 | ||
| 102 | pub const Kind = enum { @"fatal error", @"error", note, warning, off, default }; | |
| 103 | ||
| 104 | pub const Options = struct { | |
| 105 | // do not directly use these, instead add `const NAME = true;` | |
| 106 | all: Kind = .default, | |
| 107 | extra: Kind = .default, | |
| 108 | pedantic: Kind = .default, | |
| 109 | ||
| 110 | @"unsupported-pragma": Kind = .default, | |
| 111 | @"c99-extensions": Kind = .default, | |
| 112 | @"implicit-int": Kind = .default, | |
| 113 | @"duplicate-decl-specifier": Kind = .default, | |
| 114 | @"missing-declaration": Kind = .default, | |
| 115 | @"extern-initializer": Kind = .default, | |
| 116 | @"implicit-function-declaration": Kind = .default, | |
| 117 | @"unused-value": Kind = .default, | |
| 118 | @"unreachable-code": Kind = .default, | |
| 119 | @"unknown-warning-option": Kind = .default, | |
| 120 | @"gnu-empty-struct": Kind = .default, | |
| 121 | @"gnu-alignof-expression": Kind = .default, | |
| 122 | @"macro-redefined": Kind = .default, | |
| 123 | @"generic-qual-type": Kind = .default, | |
| 124 | multichar: Kind = .default, | |
| 125 | @"pointer-integer-compare": Kind = .default, | |
| 126 | @"compare-distinct-pointer-types": Kind = .default, | |
| 127 | @"literal-conversion": Kind = .default, | |
| 128 | @"cast-qualifiers": Kind = .default, | |
| 129 | @"array-bounds": Kind = .default, | |
| 130 | @"int-conversion": Kind = .default, | |
| 131 | @"pointer-type-mismatch": Kind = .default, | |
| 132 | @"c23-extensions": Kind = .default, | |
| 133 | @"incompatible-pointer-types": Kind = .default, | |
| 134 | @"excess-initializers": Kind = .default, | |
| 135 | @"division-by-zero": Kind = .default, | |
| 136 | @"initializer-overrides": Kind = .default, | |
| 137 | @"incompatible-pointer-types-discards-qualifiers": Kind = .default, | |
| 138 | @"unknown-attributes": Kind = .default, | |
| 139 | @"ignored-attributes": Kind = .default, | |
| 140 | @"builtin-macro-redefined": Kind = .default, | |
| 141 | @"gnu-label-as-value": Kind = .default, | |
| 142 | @"malformed-warning-check": Kind = .default, | |
| 143 | @"#pragma-messages": Kind = .default, | |
| 144 | @"newline-eof": Kind = .default, | |
| 145 | @"empty-translation-unit": Kind = .default, | |
| 146 | @"implicitly-unsigned-literal": Kind = .default, | |
| 147 | @"c99-compat": Kind = .default, | |
| 148 | @"unicode-zero-width": Kind = .default, | |
| 149 | @"unicode-homoglyph": Kind = .default, | |
| 150 | unicode: Kind = .default, | |
| 151 | @"return-type": Kind = .default, | |
| 152 | @"dollar-in-identifier-extension": Kind = .default, | |
| 153 | @"unknown-pragmas": Kind = .default, | |
| 154 | @"predefined-identifier-outside-function": Kind = .default, | |
| 155 | @"many-braces-around-scalar-init": Kind = .default, | |
| 156 | uninitialized: Kind = .default, | |
| 157 | @"gnu-statement-expression": Kind = .default, | |
| 158 | @"gnu-imaginary-constant": Kind = .default, | |
| 159 | @"gnu-complex-integer": Kind = .default, | |
| 160 | @"ignored-qualifiers": Kind = .default, | |
| 161 | @"integer-overflow": Kind = .default, | |
| 162 | @"extra-semi": Kind = .default, | |
| 163 | @"gnu-binary-literal": Kind = .default, | |
| 164 | @"variadic-macros": Kind = .default, | |
| 165 | varargs: Kind = .default, | |
| 166 | @"#warnings": Kind = .default, | |
| 167 | @"deprecated-declarations": Kind = .default, | |
| 168 | @"backslash-newline-escape": Kind = .default, | |
| 169 | @"pointer-to-int-cast": Kind = .default, | |
| 170 | @"gnu-case-range": Kind = .default, | |
| 171 | @"c++-compat": Kind = .default, | |
| 172 | vla: Kind = .default, | |
| 173 | @"float-overflow-conversion": Kind = .default, | |
| 174 | @"float-zero-conversion": Kind = .default, | |
| 175 | @"float-conversion": Kind = .default, | |
| 176 | @"gnu-folding-constant": Kind = .default, | |
| 177 | undef: Kind = .default, | |
| 178 | @"ignored-pragmas": Kind = .default, | |
| 179 | @"gnu-include-next": Kind = .default, | |
| 180 | @"include-next-outside-header": Kind = .default, | |
| 181 | @"include-next-absolute-path": Kind = .default, | |
| 182 | @"enum-too-large": Kind = .default, | |
| 183 | @"fixed-enum-extension": Kind = .default, | |
| 184 | @"designated-init": Kind = .default, | |
| 185 | @"attribute-warning": Kind = .default, | |
| 186 | @"invalid-noreturn": Kind = .default, | |
| 187 | @"zero-length-array": Kind = .default, | |
| 188 | @"old-style-flexible-struct": Kind = .default, | |
| 189 | @"gnu-zero-variadic-macro-arguments": Kind = .default, | |
| 190 | @"main-return-type": Kind = .default, | |
| 191 | @"expansion-to-defined": Kind = .default, | |
| 192 | @"bit-int-extension": Kind = .default, | |
| 193 | @"keyword-macro": Kind = .default, | |
| 194 | @"pointer-arith": Kind = .default, | |
| 195 | @"sizeof-array-argument": Kind = .default, | |
| 196 | @"pre-c23-compat": Kind = .default, | |
| 197 | @"pointer-bool-conversion": Kind = .default, | |
| 198 | @"string-conversion": Kind = .default, | |
| 199 | @"gnu-auto-type": Kind = .default, | |
| 200 | @"gnu-union-cast": Kind = .default, | |
| 201 | @"pointer-sign": Kind = .default, | |
| 202 | @"fuse-ld-path": Kind = .default, | |
| 203 | @"language-extension-token": Kind = .default, | |
| 204 | @"complex-component-init": Kind = .default, | |
| 205 | @"microsoft-include": Kind = .default, | |
| 206 | @"microsoft-end-of-file": Kind = .default, | |
| 207 | @"invalid-source-encoding": Kind = .default, | |
| 208 | @"four-char-constants": Kind = .default, | |
| 209 | @"unknown-escape-sequence": Kind = .default, | |
| 210 | @"invalid-pp-token": Kind = .default, | |
| 211 | @"deprecated-non-prototype": Kind = .default, | |
| 212 | @"duplicate-embed-param": Kind = .default, | |
| 213 | @"unsupported-embed-param": Kind = .default, | |
| 214 | @"unused-result": Kind = .default, | |
| 215 | normalized: Kind = .default, | |
| 216 | @"shift-count-negative": Kind = .default, | |
| 217 | @"shift-count-overflow": Kind = .default, | |
| 218 | @"constant-conversion": Kind = .default, | |
| 219 | @"sign-conversion": Kind = .default, | |
| 220 | nonnull: Kind = .default, | |
| 74 | pub const Option = enum { | |
| 75 | @"unsupported-pragma", | |
| 76 | @"c99-extensions", | |
| 77 | @"implicit-int", | |
| 78 | @"duplicate-decl-specifier", | |
| 79 | @"missing-declaration", | |
| 80 | @"extern-initializer", | |
| 81 | @"implicit-function-declaration", | |
| 82 | @"unused-value", | |
| 83 | @"unreachable-code", | |
| 84 | @"unknown-warning-option", | |
| 85 | @"gnu-empty-struct", | |
| 86 | @"gnu-alignof-expression", | |
| 87 | @"macro-redefined", | |
| 88 | @"generic-qual-type", | |
| 89 | multichar, | |
| 90 | @"pointer-integer-compare", | |
| 91 | @"compare-distinct-pointer-types", | |
| 92 | @"literal-conversion", | |
| 93 | @"cast-qualifiers", | |
| 94 | @"array-bounds", | |
| 95 | @"int-conversion", | |
| 96 | @"pointer-type-mismatch", | |
| 97 | @"c23-extensions", | |
| 98 | @"incompatible-pointer-types", | |
| 99 | @"excess-initializers", | |
| 100 | @"division-by-zero", | |
| 101 | @"initializer-overrides", | |
| 102 | @"incompatible-pointer-types-discards-qualifiers", | |
| 103 | @"unknown-attributes", | |
| 104 | @"ignored-attributes", | |
| 105 | @"builtin-macro-redefined", | |
| 106 | @"gnu-label-as-value", | |
| 107 | @"malformed-warning-check", | |
| 108 | @"#pragma-messages", | |
| 109 | @"newline-eof", | |
| 110 | @"empty-translation-unit", | |
| 111 | @"implicitly-unsigned-literal", | |
| 112 | @"c99-compat", | |
| 113 | @"unicode-zero-width", | |
| 114 | @"unicode-homoglyph", | |
| 115 | unicode, | |
| 116 | @"return-type", | |
| 117 | @"dollar-in-identifier-extension", | |
| 118 | @"unknown-pragmas", | |
| 119 | @"predefined-identifier-outside-function", | |
| 120 | @"many-braces-around-scalar-init", | |
| 121 | uninitialized, | |
| 122 | @"gnu-statement-expression", | |
| 123 | @"gnu-imaginary-constant", | |
| 124 | @"gnu-complex-integer", | |
| 125 | @"ignored-qualifiers", | |
| 126 | @"integer-overflow", | |
| 127 | @"extra-semi", | |
| 128 | @"gnu-binary-literal", | |
| 129 | @"variadic-macros", | |
| 130 | varargs, | |
| 131 | @"#warnings", | |
| 132 | @"deprecated-declarations", | |
| 133 | @"backslash-newline-escape", | |
| 134 | @"pointer-to-int-cast", | |
| 135 | @"gnu-case-range", | |
| 136 | @"c++-compat", | |
| 137 | vla, | |
| 138 | @"float-overflow-conversion", | |
| 139 | @"float-zero-conversion", | |
| 140 | @"float-conversion", | |
| 141 | @"gnu-folding-constant", | |
| 142 | undef, | |
| 143 | @"ignored-pragmas", | |
| 144 | @"gnu-include-next", | |
| 145 | @"include-next-outside-header", | |
| 146 | @"include-next-absolute-path", | |
| 147 | @"enum-too-large", | |
| 148 | @"fixed-enum-extension", | |
| 149 | @"designated-init", | |
| 150 | @"attribute-warning", | |
| 151 | @"invalid-noreturn", | |
| 152 | @"zero-length-array", | |
| 153 | @"old-style-flexible-struct", | |
| 154 | @"gnu-zero-variadic-macro-arguments", | |
| 155 | @"main-return-type", | |
| 156 | @"expansion-to-defined", | |
| 157 | @"bit-int-extension", | |
| 158 | @"keyword-macro", | |
| 159 | @"pointer-arith", | |
| 160 | @"sizeof-array-argument", | |
| 161 | @"pre-c23-compat", | |
| 162 | @"pointer-bool-conversion", | |
| 163 | @"string-conversion", | |
| 164 | @"gnu-auto-type", | |
| 165 | @"gnu-pointer-arith", | |
| 166 | @"gnu-union-cast", | |
| 167 | @"pointer-sign", | |
| 168 | @"fuse-ld-path", | |
| 169 | @"language-extension-token", | |
| 170 | @"complex-component-init", | |
| 171 | @"microsoft-include", | |
| 172 | @"microsoft-end-of-file", | |
| 173 | @"invalid-source-encoding", | |
| 174 | @"four-char-constants", | |
| 175 | @"unknown-escape-sequence", | |
| 176 | @"invalid-pp-token", | |
| 177 | @"deprecated-non-prototype", | |
| 178 | @"duplicate-embed-param", | |
| 179 | @"unsupported-embed-param", | |
| 180 | @"unused-result", | |
| 181 | normalized, | |
| 182 | @"shift-count-negative", | |
| 183 | @"shift-count-overflow", | |
| 184 | @"constant-conversion", | |
| 185 | @"sign-conversion", | |
| 186 | @"address-of-packed-member", | |
| 187 | nonnull, | |
| 188 | @"atomic-access", | |
| 189 | @"gnu-designator", | |
| 190 | @"empty-body", | |
| 191 | @"nullability-extension", | |
| 192 | nullability, | |
| 193 | @"microsoft-flexible-array", | |
| 194 | @"microsoft-anon-tag", | |
| 195 | @"out-of-scope-function", | |
| 196 | @"date-time", | |
| 197 | @"variadic-macro-arguments-omitted", | |
| 198 | @"attribute-todo", | |
| 199 | ||
| 200 | /// GNU extensions | |
| 201 | pub const gnu = [_]Option{ | |
| 202 | .@"gnu-empty-struct", | |
| 203 | .@"gnu-alignof-expression", | |
| 204 | .@"gnu-label-as-value", | |
| 205 | .@"gnu-statement-expression", | |
| 206 | .@"gnu-imaginary-constant", | |
| 207 | .@"gnu-complex-integer", | |
| 208 | .@"gnu-binary-literal", | |
| 209 | .@"gnu-case-range", | |
| 210 | .@"gnu-folding-constant", | |
| 211 | .@"gnu-include-next", | |
| 212 | .@"gnu-zero-variadic-macro-arguments", | |
| 213 | .@"gnu-auto-type", | |
| 214 | .@"gnu-pointer-arith", | |
| 215 | .@"gnu-union-cast", | |
| 216 | .@"gnu-designator", | |
| 217 | .@"zero-length-array", | |
| 218 | }; | |
| 219 | ||
| 220 | /// Clang extensions | |
| 221 | pub const clang = [_]Option{ | |
| 222 | .@"fixed-enum-extension", | |
| 223 | .@"bit-int-extension", | |
| 224 | .@"nullability-extension", | |
| 225 | }; | |
| 226 | ||
| 227 | /// Microsoft extensions | |
| 228 | pub const microsoft = [_]Option{ | |
| 229 | .@"microsoft-end-of-file", | |
| 230 | .@"microsoft-include", | |
| 231 | .@"microsoft-flexible-array", | |
| 232 | .@"microsoft-anon-tag", | |
| 233 | }; | |
| 234 | ||
| 235 | pub const extra = [_]Option{ | |
| 236 | .@"initializer-overrides", | |
| 237 | .@"ignored-qualifiers", | |
| 238 | .@"initializer-overrides", | |
| 239 | .@"expansion-to-defined", | |
| 240 | .@"fuse-ld-path", | |
| 241 | }; | |
| 242 | ||
| 243 | pub const implicit = [_]Option{ | |
| 244 | .@"implicit-int", | |
| 245 | .@"implicit-function-declaration", | |
| 246 | }; | |
| 247 | ||
| 248 | pub const unused = [_]Option{ | |
| 249 | .@"unused-value", | |
| 250 | .@"unused-result", | |
| 251 | }; | |
| 252 | ||
| 253 | pub const most = implicit ++ unused ++ [_]Option{ | |
| 254 | .@"initializer-overrides", | |
| 255 | .@"ignored-qualifiers", | |
| 256 | .@"initializer-overrides", | |
| 257 | .multichar, | |
| 258 | .@"return-type", | |
| 259 | .@"sizeof-array-argument", | |
| 260 | .uninitialized, | |
| 261 | .@"unknown-pragmas", | |
| 262 | }; | |
| 263 | ||
| 264 | pub const all = most ++ [_]Option{ | |
| 265 | .nonnull, | |
| 266 | .@"unreachable-code", | |
| 267 | .@"malformed-warning-check", | |
| 268 | }; | |
| 269 | }; | |
| 270 | ||
| 271 | pub const State = struct { | |
| 272 | // Treat all errors as fatal, set by -Wfatal-errors | |
| 273 | fatal_errors: bool = false, | |
| 274 | // Treat all warnings as errors, set by -Werror | |
| 275 | error_warnings: bool = false, | |
| 276 | /// Enable all warnings, set by -Weverything | |
| 277 | enable_all_warnings: bool = false, | |
| 278 | /// Ignore all warnings, set by -w | |
| 279 | ignore_warnings: bool = false, | |
| 280 | /// How to treat extension diagnostics, set by -Wpedantic | |
| 281 | extensions: Message.Kind = .off, | |
| 282 | /// How to treat individual options, set by -W<name> | |
| 283 | options: std.EnumMap(Option, Message.Kind) = .{}, | |
| 284 | /// Should warnings be suppressed in system headers, set by -Wsystem-headers | |
| 285 | suppress_system_headers: bool = true, | |
| 221 | 286 | }; |
| 222 | 287 | |
| 223 | 288 | const Diagnostics = @This(); |
| 224 | 289 | |
| 225 | list: std.ArrayListUnmanaged(Message) = .empty, | |
| 226 | arena: std.heap.ArenaAllocator, | |
| 227 | fatal_errors: bool = false, | |
| 228 | options: Options = .{}, | |
| 290 | output: union(enum) { | |
| 291 | to_writer: struct { | |
| 292 | writer: *std.Io.Writer, | |
| 293 | color: std.Io.tty.Config, | |
| 294 | }, | |
| 295 | to_list: struct { | |
| 296 | messages: std.ArrayList(Message) = .empty, | |
| 297 | arena: std.heap.ArenaAllocator, | |
| 298 | }, | |
| 299 | ignore, | |
| 300 | }, | |
| 301 | /// Force usage of color in output. | |
| 302 | color: ?bool = null, | |
| 303 | /// Include line of code in output. | |
| 304 | details: bool = true, | |
| 305 | ||
| 306 | state: State = .{}, | |
| 307 | /// Amount of error or fatal error messages that have been sent to `output`. | |
| 229 | 308 | errors: u32 = 0, |
| 309 | /// Amount of warnings that have been sent to `output`. | |
| 310 | warnings: u32 = 0, | |
| 311 | // Total amount of diagnostics messages sent to `output`. | |
| 312 | total: u32 = 0, | |
| 230 | 313 | macro_backtrace_limit: u32 = 6, |
| 314 | /// If `effectiveKind` causes us to skip a diagnostic, this is temporarily set to | |
| 315 | /// `true` to signal that associated notes should also be skipped. | |
| 316 | hide_notes: bool = false, | |
| 317 | ||
| 318 | pub fn deinit(d: *Diagnostics) void { | |
| 319 | switch (d.output) { | |
| 320 | .ignore => {}, | |
| 321 | .to_writer => {}, | |
| 322 | .to_list => |*list| { | |
| 323 | list.messages.deinit(list.arena.child_allocator); | |
| 324 | list.arena.deinit(); | |
| 325 | }, | |
| 326 | } | |
| 327 | } | |
| 231 | 328 | |
| 329 | /// Used by the __has_warning builtin macro. | |
| 232 | 330 | pub fn warningExists(name: []const u8) bool { |
| 233 | inline for (@typeInfo(Options).@"struct".fields) |f| { | |
| 234 | if (mem.eql(u8, f.name, name)) return true; | |
| 331 | if (std.mem.eql(u8, name, "pedantic")) return true; | |
| 332 | inline for (comptime std.meta.declarations(Option)) |group| { | |
| 333 | if (std.mem.eql(u8, name, group.name)) return true; | |
| 235 | 334 | } |
| 236 | return false; | |
| 335 | return std.meta.stringToEnum(Option, name) != null; | |
| 237 | 336 | } |
| 238 | 337 | |
| 239 | pub fn set(d: *Diagnostics, name: []const u8, to: Kind) !void { | |
| 240 | inline for (@typeInfo(Options).@"struct".fields) |f| { | |
| 241 | if (mem.eql(u8, f.name, name)) { | |
| 242 | @field(d.options, f.name) = to; | |
| 338 | pub fn set(d: *Diagnostics, name: []const u8, to: Message.Kind) Compilation.Error!void { | |
| 339 | if (std.mem.eql(u8, name, "pedantic")) { | |
| 340 | d.state.extensions = to; | |
| 341 | return; | |
| 342 | } | |
| 343 | if (std.meta.stringToEnum(Option, name)) |option| { | |
| 344 | d.state.options.put(option, to); | |
| 345 | return; | |
| 346 | } | |
| 347 | ||
| 348 | inline for (comptime std.meta.declarations(Option)) |group| { | |
| 349 | if (std.mem.eql(u8, name, group.name)) { | |
| 350 | for (@field(Option, group.name)) |option| { | |
| 351 | d.state.options.put(option, to); | |
| 352 | } | |
| 243 | 353 | return; |
| 244 | 354 | } |
| 245 | 355 | } |
| 246 | try d.addExtra(.{}, .{ | |
| 247 | .tag = .unknown_warning, | |
| 248 | .extra = .{ .str = name }, | |
| 249 | }, &.{}, true); | |
| 250 | } | |
| 251 | 356 | |
| 252 | pub fn init(gpa: Allocator) Diagnostics { | |
| 253 | return .{ | |
| 254 | .arena = std.heap.ArenaAllocator.init(gpa), | |
| 255 | }; | |
| 357 | var buf: [256]u8 = undefined; | |
| 358 | const slice = std.fmt.bufPrint(&buf, "unknown warning '{s}'", .{name}) catch &buf; | |
| 359 | ||
| 360 | try d.add(.{ | |
| 361 | .text = slice, | |
| 362 | .kind = .warning, | |
| 363 | .opt = .@"unknown-warning-option", | |
| 364 | .location = null, | |
| 365 | }); | |
| 256 | 366 | } |
| 257 | 367 | |
| 258 | pub fn deinit(d: *Diagnostics) void { | |
| 259 | d.list.deinit(d.arena.child_allocator); | |
| 260 | d.arena.deinit(); | |
| 368 | /// This mutates the `Diagnostics`, so may only be called when `message` is being added. | |
| 369 | /// If `.off` is returned, `message` will not be included, so the caller should give up. | |
| 370 | pub fn effectiveKind(d: *Diagnostics, message: anytype) Message.Kind { | |
| 371 | if (d.hide_notes and message.kind == .note) { | |
| 372 | return .off; | |
| 373 | } | |
| 374 | ||
| 375 | // -w disregards explicit kind set with -W<name> | |
| 376 | if (d.state.ignore_warnings and message.kind == .warning) { | |
| 377 | d.hide_notes = true; | |
| 378 | return .off; | |
| 379 | } | |
| 380 | ||
| 381 | if (@hasField(@TypeOf(message), "location")) { | |
| 382 | if (message.location) |location| { | |
| 383 | if (location.kind != .user and d.state.suppress_system_headers and | |
| 384 | (message.kind == .warning or message.kind == .off)) | |
| 385 | { | |
| 386 | return .off; | |
| 387 | } | |
| 388 | } | |
| 389 | } | |
| 390 | ||
| 391 | var kind = message.kind; | |
| 392 | ||
| 393 | // Get explicit kind set by -W<name>= | |
| 394 | var set_explicit = false; | |
| 395 | if (message.opt) |option| { | |
| 396 | if (d.state.options.get(option)) |explicit| { | |
| 397 | kind = explicit; | |
| 398 | set_explicit = true; | |
| 399 | } | |
| 400 | } | |
| 401 | ||
| 402 | // Use extension diagnostic behavior if not set explicitly. | |
| 403 | if (message.extension and !set_explicit) { | |
| 404 | kind = @enumFromInt(@max(@intFromEnum(kind), @intFromEnum(d.state.extensions))); | |
| 405 | } | |
| 406 | ||
| 407 | // Make diagnostic a warning if -Weverything is set. | |
| 408 | if (kind == .off and d.state.enable_all_warnings) kind = .warning; | |
| 409 | ||
| 410 | // Upgrade warnigns to errors if -Werror is set | |
| 411 | if (kind == .warning and d.state.error_warnings) kind = .@"error"; | |
| 412 | ||
| 413 | // Upgrade errors to fatal errors if -Wfatal-errors is set | |
| 414 | if (kind == .@"error" and d.state.fatal_errors) kind = .@"fatal error"; | |
| 415 | ||
| 416 | if (kind == .off) d.hide_notes = true; | |
| 417 | return kind; | |
| 261 | 418 | } |
| 262 | 419 | |
| 263 | pub fn add(comp: *Compilation, msg: Message, expansion_locs: []const Source.Location) Compilation.Error!void { | |
| 264 | return comp.diagnostics.addExtra(comp.langopts, msg, expansion_locs, true); | |
| 420 | pub fn add(d: *Diagnostics, msg: Message) Compilation.Error!void { | |
| 421 | var copy = msg; | |
| 422 | copy.effective_kind = d.effectiveKind(msg); | |
| 423 | if (copy.effective_kind == .off) return; | |
| 424 | try d.addMessage(copy); | |
| 425 | if (copy.effective_kind == .@"fatal error") return error.FatalError; | |
| 265 | 426 | } |
| 266 | 427 | |
| 267 | pub fn addExtra( | |
| 428 | pub fn addWithLocation( | |
| 268 | 429 | d: *Diagnostics, |
| 269 | langopts: LangOpts, | |
| 430 | comp: *const Compilation, | |
| 270 | 431 | msg: Message, |
| 271 | 432 | expansion_locs: []const Source.Location, |
| 272 | 433 | note_msg_loc: bool, |
| 273 | 434 | ) Compilation.Error!void { |
| 274 | const kind = d.tagKind(msg.tag, langopts); | |
| 275 | if (kind == .off) return; | |
| 276 | 435 | var copy = msg; |
| 277 | copy.kind = kind; | |
| 436 | if (expansion_locs.len != 0) copy.location = expansion_locs[expansion_locs.len - 1].expand(comp); | |
| 437 | copy.effective_kind = d.effectiveKind(copy); | |
| 438 | if (copy.effective_kind == .off) return; | |
| 439 | try d.addMessage(copy); | |
| 278 | 440 | |
| 279 | if (expansion_locs.len != 0) copy.loc = expansion_locs[expansion_locs.len - 1]; | |
| 280 | try d.list.append(d.arena.child_allocator, copy); | |
| 281 | 441 | if (expansion_locs.len != 0) { |
| 282 | 442 | // Add macro backtrace notes in reverse order omitting from the middle if needed. |
| 283 | 443 | var i = expansion_locs.len - 1; |
| 284 | 444 | const half = d.macro_backtrace_limit / 2; |
| 285 | 445 | const limit = if (i < d.macro_backtrace_limit) 0 else i - half; |
| 286 | try d.list.ensureUnusedCapacity( | |
| 287 | d.arena.child_allocator, | |
| 288 | if (limit == 0) expansion_locs.len else d.macro_backtrace_limit + 1, | |
| 289 | ); | |
| 290 | 446 | while (i > limit) { |
| 291 | 447 | i -= 1; |
| 292 | d.list.appendAssumeCapacity(.{ | |
| 293 | .tag = .expanded_from_here, | |
| 448 | try d.addMessage(.{ | |
| 294 | 449 | .kind = .note, |
| 295 | .loc = expansion_locs[i], | |
| 450 | .effective_kind = .note, | |
| 451 | .text = "expanded from here", | |
| 452 | .location = expansion_locs[i].expand(comp), | |
| 296 | 453 | }); |
| 297 | 454 | } |
| 298 | 455 | if (limit != 0) { |
| 299 | d.list.appendAssumeCapacity(.{ | |
| 300 | .tag = .skipping_macro_backtrace, | |
| 456 | var buf: [256]u8 = undefined; | |
| 457 | try d.addMessage(.{ | |
| 301 | 458 | .kind = .note, |
| 302 | .extra = .{ .unsigned = expansion_locs.len - d.macro_backtrace_limit }, | |
| 459 | .effective_kind = .note, | |
| 460 | .text = std.fmt.bufPrint( | |
| 461 | &buf, | |
| 462 | "(skipping {d} expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)", | |
| 463 | .{expansion_locs.len - d.macro_backtrace_limit}, | |
| 464 | ) catch unreachable, | |
| 465 | .location = null, | |
| 303 | 466 | }); |
| 304 | 467 | i = half -| 1; |
| 305 | 468 | while (i > 0) { |
| 306 | 469 | i -= 1; |
| 307 | d.list.appendAssumeCapacity(.{ | |
| 308 | .tag = .expanded_from_here, | |
| 470 | try d.addMessage(.{ | |
| 309 | 471 | .kind = .note, |
| 310 | .loc = expansion_locs[i], | |
| 472 | .effective_kind = .note, | |
| 473 | .text = "expanded from here", | |
| 474 | .location = expansion_locs[i].expand(comp), | |
| 311 | 475 | }); |
| 312 | 476 | } |
| 313 | 477 | } |
| 314 | 478 | |
| 315 | if (note_msg_loc) d.list.appendAssumeCapacity(.{ | |
| 316 | .tag = .expanded_from_here, | |
| 317 | .kind = .note, | |
| 318 | .loc = msg.loc, | |
| 319 | }); | |
| 320 | } | |
| 321 | if (kind == .@"fatal error" or (kind == .@"error" and d.fatal_errors)) | |
| 322 | return error.FatalError; | |
| 323 | } | |
| 324 | ||
| 325 | pub fn render(comp: *Compilation, config: std.Io.tty.Config) void { | |
| 326 | if (comp.diagnostics.list.items.len == 0) return; | |
| 327 | var buffer: [1000]u8 = undefined; | |
| 328 | var m = defaultMsgWriter(config, &buffer); | |
| 329 | defer m.deinit(); | |
| 330 | renderMessages(comp, &m); | |
| 331 | } | |
| 332 | pub fn defaultMsgWriter(config: std.Io.tty.Config, buffer: []u8) MsgWriter { | |
| 333 | return MsgWriter.init(config, buffer); | |
| 334 | } | |
| 335 | ||
| 336 | pub fn renderMessages(comp: *Compilation, m: anytype) void { | |
| 337 | var errors: u32 = 0; | |
| 338 | var warnings: u32 = 0; | |
| 339 | for (comp.diagnostics.list.items) |msg| { | |
| 340 | switch (msg.kind) { | |
| 341 | .@"fatal error", .@"error" => errors += 1, | |
| 342 | .warning => warnings += 1, | |
| 343 | .note => {}, | |
| 344 | .off => continue, // happens if an error is added before it is disabled | |
| 345 | .default => unreachable, | |
| 346 | } | |
| 347 | renderMessage(comp, m, msg); | |
| 348 | } | |
| 349 | const w_s: []const u8 = if (warnings == 1) "" else "s"; | |
| 350 | const e_s: []const u8 = if (errors == 1) "" else "s"; | |
| 351 | if (errors != 0 and warnings != 0) { | |
| 352 | m.print("{d} warning{s} and {d} error{s} generated.\n", .{ warnings, w_s, errors, e_s }); | |
| 353 | } else if (warnings != 0) { | |
| 354 | m.print("{d} warning{s} generated.\n", .{ warnings, w_s }); | |
| 355 | } else if (errors != 0) { | |
| 356 | m.print("{d} error{s} generated.\n", .{ errors, e_s }); | |
| 357 | } | |
| 358 | ||
| 359 | comp.diagnostics.list.items.len = 0; | |
| 360 | comp.diagnostics.errors += errors; | |
| 361 | } | |
| 362 | ||
| 363 | pub fn renderMessage(comp: *Compilation, m: anytype, msg: Message) void { | |
| 364 | var line: ?[]const u8 = null; | |
| 365 | var end_with_splice = false; | |
| 366 | const width = if (msg.loc.id != .unused) blk: { | |
| 367 | var loc = msg.loc; | |
| 368 | switch (msg.tag) { | |
| 369 | .escape_sequence_overflow, | |
| 370 | .invalid_universal_character, | |
| 371 | => loc.byte_offset += @truncate(msg.extra.offset), | |
| 372 | .non_standard_escape_char, | |
| 373 | .unknown_escape_sequence, | |
| 374 | => loc.byte_offset += msg.extra.invalid_escape.offset, | |
| 375 | else => {}, | |
| 376 | } | |
| 377 | const source = comp.getSource(loc.id); | |
| 378 | var line_col = source.lineCol(loc); | |
| 379 | line = line_col.line; | |
| 380 | end_with_splice = line_col.end_with_splice; | |
| 381 | if (msg.tag == .backslash_newline_escape) { | |
| 382 | line = line_col.line[0 .. line_col.col - 1]; | |
| 383 | line_col.col += 1; | |
| 384 | line_col.width += 1; | |
| 385 | } | |
| 386 | m.location(source.path, line_col.line_no, line_col.col); | |
| 387 | break :blk line_col.width; | |
| 388 | } else 0; | |
| 389 | ||
| 390 | m.start(msg.kind); | |
| 391 | const prop = msg.tag.property(); | |
| 392 | switch (prop.extra) { | |
| 393 | .str => printRt(m, prop.msg, .{"{s}"}, .{msg.extra.str}), | |
| 394 | .tok_id => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ | |
| 395 | msg.extra.tok_id.expected.symbol(), | |
| 396 | msg.extra.tok_id.actual.symbol(), | |
| 397 | }), | |
| 398 | .tok_id_expected => printRt(m, prop.msg, .{"{s}"}, .{msg.extra.tok_id_expected.symbol()}), | |
| 399 | .arguments => printRt(m, prop.msg, .{ "{d}", "{d}" }, .{ | |
| 400 | msg.extra.arguments.expected, | |
| 401 | msg.extra.arguments.actual, | |
| 402 | }), | |
| 403 | .codepoints => printRt(m, prop.msg, .{ "{X:0>4}", "{u}" }, .{ | |
| 404 | msg.extra.codepoints.actual, | |
| 405 | msg.extra.codepoints.resembles, | |
| 406 | }), | |
| 407 | .attr_arg_count => printRt(m, prop.msg, .{ "{s}", "{d}" }, .{ | |
| 408 | @tagName(msg.extra.attr_arg_count.attribute), | |
| 409 | msg.extra.attr_arg_count.expected, | |
| 410 | }), | |
| 411 | .attr_arg_type => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ | |
| 412 | msg.extra.attr_arg_type.expected.toString(), | |
| 413 | msg.extra.attr_arg_type.actual.toString(), | |
| 414 | }), | |
| 415 | .actual_codepoint => printRt(m, prop.msg, .{"{X:0>4}"}, .{msg.extra.actual_codepoint}), | |
| 416 | .ascii => printRt(m, prop.msg, .{"{c}"}, .{msg.extra.ascii}), | |
| 417 | .unsigned => printRt(m, prop.msg, .{"{d}"}, .{msg.extra.unsigned}), | |
| 418 | .pow_2_as_string => printRt(m, prop.msg, .{"{s}"}, .{switch (msg.extra.pow_2_as_string) { | |
| 419 | 63 => "9223372036854775808", | |
| 420 | 64 => "18446744073709551616", | |
| 421 | 127 => "170141183460469231731687303715884105728", | |
| 422 | 128 => "340282366920938463463374607431768211456", | |
| 423 | else => unreachable, | |
| 424 | }}), | |
| 425 | .signed => printRt(m, prop.msg, .{"{d}"}, .{msg.extra.signed}), | |
| 426 | .attr_enum => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ | |
| 427 | @tagName(msg.extra.attr_enum.tag), | |
| 428 | Attribute.Formatting.choices(msg.extra.attr_enum.tag), | |
| 429 | }), | |
| 430 | .ignored_record_attr => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ | |
| 431 | @tagName(msg.extra.ignored_record_attr.tag), | |
| 432 | @tagName(msg.extra.ignored_record_attr.specifier), | |
| 433 | }), | |
| 434 | .attribute_todo => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ | |
| 435 | @tagName(msg.extra.attribute_todo.tag), | |
| 436 | @tagName(msg.extra.attribute_todo.kind), | |
| 437 | }), | |
| 438 | .builtin_with_header => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ | |
| 439 | @tagName(msg.extra.builtin_with_header.header), | |
| 440 | Builtin.nameFromTag(msg.extra.builtin_with_header.builtin).span(), | |
| 441 | }), | |
| 442 | .invalid_escape => { | |
| 443 | if (std.ascii.isPrint(msg.extra.invalid_escape.char)) { | |
| 444 | const str: [1]u8 = .{msg.extra.invalid_escape.char}; | |
| 445 | printRt(m, prop.msg, .{"{s}"}, .{&str}); | |
| 446 | } else { | |
| 447 | var buf: [3]u8 = undefined; | |
| 448 | const str = std.fmt.bufPrint(&buf, "x{x}", .{msg.extra.invalid_escape.char}) catch unreachable; | |
| 449 | printRt(m, prop.msg, .{"{s}"}, .{str}); | |
| 450 | } | |
| 451 | }, | |
| 452 | .normalized => { | |
| 453 | const f = struct { | |
| 454 | pub fn f(bytes: []const u8, writer: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 455 | var it: std.unicode.Utf8Iterator = .{ | |
| 456 | .bytes = bytes, | |
| 457 | .i = 0, | |
| 458 | }; | |
| 459 | while (it.nextCodepoint()) |codepoint| { | |
| 460 | if (codepoint < 0x7F) { | |
| 461 | try writer.writeByte(@intCast(codepoint)); | |
| 462 | } else if (codepoint < 0xFFFF) { | |
| 463 | try writer.writeAll("\\u"); | |
| 464 | try writer.printInt(codepoint, 16, .upper, .{ .fill = '0', .width = 4 }); | |
| 465 | } else { | |
| 466 | try writer.writeAll("\\U"); | |
| 467 | try writer.printInt(codepoint, 16, .upper, .{ .fill = '0', .width = 8 }); | |
| 468 | } | |
| 469 | } | |
| 470 | } | |
| 471 | }.f; | |
| 472 | printRt(m, prop.msg, .{"{f}"}, .{ | |
| 473 | std.fmt.Alt([]const u8, f){ .data = msg.extra.normalized }, | |
| 479 | if (note_msg_loc) { | |
| 480 | try d.addMessage(.{ | |
| 481 | .kind = .note, | |
| 482 | .effective_kind = .note, | |
| 483 | .text = "expanded from here", | |
| 484 | .location = msg.location.?, | |
| 474 | 485 | }); |
| 475 | }, | |
| 476 | .none, .offset => m.write(prop.msg), | |
| 477 | } | |
| 478 | ||
| 479 | if (prop.opt) |some| { | |
| 480 | if (msg.kind == .@"error" and prop.kind != .@"error") { | |
| 481 | m.print(" [-Werror,-W{s}]", .{optName(some)}); | |
| 482 | } else if (msg.kind != .note) { | |
| 483 | m.print(" [-W{s}]", .{optName(some)}); | |
| 484 | 486 | } |
| 485 | 487 | } |
| 486 | ||
| 487 | m.end(line, width, end_with_splice); | |
| 488 | if (copy.kind == .@"fatal error") return error.FatalError; | |
| 488 | 489 | } |
| 489 | 490 | |
| 490 | fn printRt(m: anytype, str: []const u8, comptime fmts: anytype, args: anytype) void { | |
| 491 | pub fn formatArgs(w: *std.Io.Writer, fmt: []const u8, args: anytype) std.Io.Writer.Error!void { | |
| 491 | 492 | var i: usize = 0; |
| 492 | inline for (fmts, args) |fmt, arg| { | |
| 493 | const new = std.mem.indexOfPos(u8, str, i, fmt).?; | |
| 494 | m.write(str[i..new]); | |
| 495 | i = new + fmt.len; | |
| 496 | m.print(fmt, .{arg}); | |
| 493 | inline for (std.meta.fields(@TypeOf(args))) |arg_info| { | |
| 494 | const arg = @field(args, arg_info.name); | |
| 495 | i += switch (@TypeOf(arg)) { | |
| 496 | []const u8 => try formatString(w, fmt[i..], arg), | |
| 497 | else => switch (@typeInfo(@TypeOf(arg))) { | |
| 498 | .int, .comptime_int => try Diagnostics.formatInt(w, fmt[i..], arg), | |
| 499 | .pointer => try Diagnostics.formatString(w, fmt[i..], arg), | |
| 500 | else => comptime unreachable, | |
| 501 | }, | |
| 502 | }; | |
| 497 | 503 | } |
| 498 | m.write(str[i..]); | |
| 504 | try w.writeAll(fmt[i..]); | |
| 499 | 505 | } |
| 500 | 506 | |
| 501 | fn optName(offset: u16) []const u8 { | |
| 502 | return std.meta.fieldNames(Options)[offset / @sizeOf(Kind)]; | |
| 507 | pub fn templateIndex(w: *std.Io.Writer, fmt: []const u8, template: []const u8) std.Io.Writer.Error!usize { | |
| 508 | const i = std.mem.indexOf(u8, fmt, template) orelse { | |
| 509 | if (@import("builtin").mode == .Debug) { | |
| 510 | std.debug.panic("template `{s}` not found in format string `{s}`", .{ template, fmt }); | |
| 511 | } | |
| 512 | try w.print("template `{s}` not found in format string `{s}` (this is a bug in arocc)", .{ template, fmt }); | |
| 513 | return 0; | |
| 514 | }; | |
| 515 | try w.writeAll(fmt[0..i]); | |
| 516 | return i + template.len; | |
| 503 | 517 | } |
| 504 | 518 | |
| 505 | fn tagKind(d: *Diagnostics, tag: Tag, langopts: LangOpts) Kind { | |
| 506 | const prop = tag.property(); | |
| 507 | var kind = prop.getKind(&d.options); | |
| 508 | ||
| 509 | if (prop.all) { | |
| 510 | if (d.options.all != .default) kind = d.options.all; | |
| 511 | } | |
| 512 | if (prop.w_extra) { | |
| 513 | if (d.options.extra != .default) kind = d.options.extra; | |
| 514 | } | |
| 515 | if (prop.pedantic) { | |
| 516 | if (d.options.pedantic != .default) kind = d.options.pedantic; | |
| 517 | } | |
| 518 | if (prop.suppress_version) |some| if (langopts.standard.atLeast(some)) return .off; | |
| 519 | if (prop.suppress_unless_version) |some| if (!langopts.standard.atLeast(some)) return .off; | |
| 520 | if (prop.suppress_gnu and langopts.standard.isExplicitGNU()) return .off; | |
| 521 | if (prop.suppress_gcc and langopts.emulate == .gcc) return .off; | |
| 522 | if (prop.suppress_clang and langopts.emulate == .clang) return .off; | |
| 523 | if (prop.suppress_msvc and langopts.emulate == .msvc) return .off; | |
| 524 | if (kind == .@"error" and d.fatal_errors) kind = .@"fatal error"; | |
| 525 | return kind; | |
| 519 | pub fn formatString(w: *std.Io.Writer, fmt: []const u8, str: []const u8) std.Io.Writer.Error!usize { | |
| 520 | const i = templateIndex(w, fmt, "{s}"); | |
| 521 | try w.writeAll(str); | |
| 522 | return i; | |
| 526 | 523 | } |
| 527 | 524 | |
| 528 | const MsgWriter = struct { | |
| 529 | writer: *std.Io.Writer, | |
| 530 | config: std.Io.tty.Config, | |
| 531 | ||
| 532 | fn init(config: std.Io.tty.Config, buffer: []u8) MsgWriter { | |
| 533 | return .{ | |
| 534 | .writer = std.debug.lockStderrWriter(buffer), | |
| 535 | .config = config, | |
| 536 | }; | |
| 537 | } | |
| 538 | ||
| 539 | pub fn deinit(m: *MsgWriter) void { | |
| 540 | std.debug.unlockStderrWriter(); | |
| 541 | m.* = undefined; | |
| 542 | } | |
| 543 | ||
| 544 | pub fn print(m: *MsgWriter, comptime fmt: []const u8, args: anytype) void { | |
| 545 | m.writer.print(fmt, args) catch {}; | |
| 546 | } | |
| 547 | ||
| 548 | fn write(m: *MsgWriter, msg: []const u8) void { | |
| 549 | m.writer.writeAll(msg) catch {}; | |
| 550 | } | |
| 551 | ||
| 552 | fn setColor(m: *MsgWriter, color: std.Io.tty.Color) void { | |
| 553 | m.config.setColor(m.writer, color) catch {}; | |
| 554 | } | |
| 555 | ||
| 556 | fn location(m: *MsgWriter, path: []const u8, line: u32, col: u32) void { | |
| 557 | m.setColor(.bold); | |
| 558 | m.print("{s}:{d}:{d}: ", .{ path, line, col }); | |
| 559 | } | |
| 525 | pub fn formatInt(w: *std.Io.Writer, fmt: []const u8, int: anytype) std.Io.Writer.Error!usize { | |
| 526 | const i = templateIndex(w, fmt, "{d}"); | |
| 527 | try w.printInt(int, 10, .lower, .{}); | |
| 528 | return i; | |
| 529 | } | |
| 560 | 530 | |
| 561 | fn start(m: *MsgWriter, kind: Kind) void { | |
| 562 | switch (kind) { | |
| 563 | .@"fatal error", .@"error" => m.setColor(.bright_red), | |
| 564 | .note => m.setColor(.bright_cyan), | |
| 565 | .warning => m.setColor(.bright_magenta), | |
| 566 | .off, .default => unreachable, | |
| 567 | } | |
| 568 | m.write(switch (kind) { | |
| 569 | .@"fatal error" => "fatal error: ", | |
| 570 | .@"error" => "error: ", | |
| 571 | .note => "note: ", | |
| 572 | .warning => "warning: ", | |
| 573 | .off, .default => unreachable, | |
| 574 | }); | |
| 575 | m.setColor(.white); | |
| 531 | fn addMessage(d: *Diagnostics, msg: Message) Compilation.Error!void { | |
| 532 | std.debug.assert(msg.effective_kind != .off); | |
| 533 | switch (msg.effective_kind) { | |
| 534 | .off => unreachable, | |
| 535 | .@"error", .@"fatal error" => d.errors += 1, | |
| 536 | .warning => d.warnings += 1, | |
| 537 | .note => {}, | |
| 576 | 538 | } |
| 577 | ||
| 578 | fn end(m: *MsgWriter, maybe_line: ?[]const u8, col: u32, end_with_splice: bool) void { | |
| 579 | const line = maybe_line orelse { | |
| 580 | m.write("\n"); | |
| 581 | m.setColor(.reset); | |
| 582 | return; | |
| 583 | }; | |
| 584 | const trailer = if (end_with_splice) "\\ " else ""; | |
| 585 | m.setColor(.reset); | |
| 586 | m.print("\n{s}{s}\n{s: >[3]}", .{ line, trailer, "", col }); | |
| 587 | m.setColor(.bold); | |
| 588 | m.setColor(.bright_green); | |
| 589 | m.write("^\n"); | |
| 590 | m.setColor(.reset); | |
| 539 | d.total += 1; | |
| 540 | d.hide_notes = false; | |
| 541 | ||
| 542 | switch (d.output) { | |
| 543 | .ignore => {}, | |
| 544 | .to_writer => |writer| { | |
| 545 | var config = writer.color; | |
| 546 | if (d.color == false) config = .no_color; | |
| 547 | if (d.color == true and config == .no_color) config = .escape_codes; | |
| 548 | msg.write(writer.writer, config, d.details) catch { | |
| 549 | return error.FatalError; | |
| 550 | }; | |
| 551 | }, | |
| 552 | .to_list => |*list| { | |
| 553 | const arena = list.arena.allocator(); | |
| 554 | try list.messages.append(list.arena.child_allocator, .{ | |
| 555 | .kind = msg.kind, | |
| 556 | .effective_kind = msg.effective_kind, | |
| 557 | .text = try arena.dupe(u8, msg.text), | |
| 558 | .opt = msg.opt, | |
| 559 | .extension = msg.extension, | |
| 560 | .location = msg.location, | |
| 561 | }); | |
| 562 | }, | |
| 591 | 563 | } |
| 592 | }; | |
| 564 | } |
lib/compiler/aro/aro/Diagnostics/messages.zig deleted-1041| ... | ... | @@ -1,1041 +0,0 @@ |
| 1 | //! Autogenerated by GenerateDef from src/aro/Diagnostics/messages.def, do not edit | |
| 2 | // zig fmt: off | |
| 3 | ||
| 4 | const std = @import("std"); | |
| 5 | ||
| 6 | pub fn with(comptime Properties: type) type { | |
| 7 | return struct { | |
| 8 | const W = Properties.makeOpt; | |
| 9 | const pointer_sign_message = " converts between pointers to integer types with different sign"; | |
| 10 | const expected_arguments = "expected {d} argument(s) got {d}"; | |
| 11 | pub const Tag = enum { | |
| 12 | todo, | |
| 13 | error_directive, | |
| 14 | warning_directive, | |
| 15 | elif_without_if, | |
| 16 | elif_after_else, | |
| 17 | elifdef_without_if, | |
| 18 | elifdef_after_else, | |
| 19 | elifndef_without_if, | |
| 20 | elifndef_after_else, | |
| 21 | else_without_if, | |
| 22 | else_after_else, | |
| 23 | endif_without_if, | |
| 24 | unknown_pragma, | |
| 25 | line_simple_digit, | |
| 26 | line_invalid_filename, | |
| 27 | unterminated_conditional_directive, | |
| 28 | invalid_preprocessing_directive, | |
| 29 | macro_name_missing, | |
| 30 | extra_tokens_directive_end, | |
| 31 | expected_value_in_expr, | |
| 32 | closing_paren, | |
| 33 | to_match_paren, | |
| 34 | to_match_brace, | |
| 35 | to_match_bracket, | |
| 36 | header_str_closing, | |
| 37 | header_str_match, | |
| 38 | string_literal_in_pp_expr, | |
| 39 | float_literal_in_pp_expr, | |
| 40 | defined_as_macro_name, | |
| 41 | macro_name_must_be_identifier, | |
| 42 | whitespace_after_macro_name, | |
| 43 | hash_hash_at_start, | |
| 44 | hash_hash_at_end, | |
| 45 | pasting_formed_invalid, | |
| 46 | missing_paren_param_list, | |
| 47 | unterminated_macro_param_list, | |
| 48 | invalid_token_param_list, | |
| 49 | expected_comma_param_list, | |
| 50 | hash_not_followed_param, | |
| 51 | expected_filename, | |
| 52 | empty_filename, | |
| 53 | expected_invalid, | |
| 54 | expected_eof, | |
| 55 | expected_token, | |
| 56 | expected_expr, | |
| 57 | expected_integer_constant_expr, | |
| 58 | missing_type_specifier, | |
| 59 | missing_type_specifier_c23, | |
| 60 | multiple_storage_class, | |
| 61 | static_assert_failure, | |
| 62 | static_assert_failure_message, | |
| 63 | expected_type, | |
| 64 | cannot_combine_spec, | |
| 65 | duplicate_decl_spec, | |
| 66 | restrict_non_pointer, | |
| 67 | expected_external_decl, | |
| 68 | expected_ident_or_l_paren, | |
| 69 | missing_declaration, | |
| 70 | func_not_in_root, | |
| 71 | illegal_initializer, | |
| 72 | extern_initializer, | |
| 73 | spec_from_typedef, | |
| 74 | param_before_var_args, | |
| 75 | void_only_param, | |
| 76 | void_param_qualified, | |
| 77 | void_must_be_first_param, | |
| 78 | invalid_storage_on_param, | |
| 79 | threadlocal_non_var, | |
| 80 | func_spec_non_func, | |
| 81 | illegal_storage_on_func, | |
| 82 | illegal_storage_on_global, | |
| 83 | expected_stmt, | |
| 84 | func_cannot_return_func, | |
| 85 | func_cannot_return_array, | |
| 86 | undeclared_identifier, | |
| 87 | not_callable, | |
| 88 | unsupported_str_cat, | |
| 89 | static_func_not_global, | |
| 90 | implicit_func_decl, | |
| 91 | unknown_builtin, | |
| 92 | implicit_builtin, | |
| 93 | implicit_builtin_header_note, | |
| 94 | expected_param_decl, | |
| 95 | invalid_old_style_params, | |
| 96 | expected_fn_body, | |
| 97 | invalid_void_param, | |
| 98 | unused_value, | |
| 99 | continue_not_in_loop, | |
| 100 | break_not_in_loop_or_switch, | |
| 101 | unreachable_code, | |
| 102 | duplicate_label, | |
| 103 | previous_label, | |
| 104 | undeclared_label, | |
| 105 | case_not_in_switch, | |
| 106 | duplicate_switch_case, | |
| 107 | multiple_default, | |
| 108 | previous_case, | |
| 109 | expected_arguments, | |
| 110 | callee_with_static_array, | |
| 111 | array_argument_too_small, | |
| 112 | non_null_argument, | |
| 113 | expected_arguments_old, | |
| 114 | expected_at_least_arguments, | |
| 115 | invalid_static_star, | |
| 116 | static_non_param, | |
| 117 | array_qualifiers, | |
| 118 | star_non_param, | |
| 119 | variable_len_array_file_scope, | |
| 120 | useless_static, | |
| 121 | negative_array_size, | |
| 122 | array_incomplete_elem, | |
| 123 | array_func_elem, | |
| 124 | static_non_outermost_array, | |
| 125 | qualifier_non_outermost_array, | |
| 126 | unterminated_macro_arg_list, | |
| 127 | unknown_warning, | |
| 128 | overflow, | |
| 129 | int_literal_too_big, | |
| 130 | indirection_ptr, | |
| 131 | addr_of_rvalue, | |
| 132 | addr_of_bitfield, | |
| 133 | not_assignable, | |
| 134 | ident_or_l_brace, | |
| 135 | empty_enum, | |
| 136 | redefinition, | |
| 137 | previous_definition, | |
| 138 | expected_identifier, | |
| 139 | expected_str_literal, | |
| 140 | expected_str_literal_in, | |
| 141 | parameter_missing, | |
| 142 | empty_record, | |
| 143 | empty_record_size, | |
| 144 | wrong_tag, | |
| 145 | expected_parens_around_typename, | |
| 146 | alignof_expr, | |
| 147 | invalid_alignof, | |
| 148 | invalid_sizeof, | |
| 149 | macro_redefined, | |
| 150 | generic_qual_type, | |
| 151 | generic_array_type, | |
| 152 | generic_func_type, | |
| 153 | generic_duplicate, | |
| 154 | generic_duplicate_here, | |
| 155 | generic_duplicate_default, | |
| 156 | generic_no_match, | |
| 157 | escape_sequence_overflow, | |
| 158 | invalid_universal_character, | |
| 159 | incomplete_universal_character, | |
| 160 | multichar_literal_warning, | |
| 161 | invalid_multichar_literal, | |
| 162 | wide_multichar_literal, | |
| 163 | char_lit_too_wide, | |
| 164 | char_too_large, | |
| 165 | must_use_struct, | |
| 166 | must_use_union, | |
| 167 | must_use_enum, | |
| 168 | redefinition_different_sym, | |
| 169 | redefinition_incompatible, | |
| 170 | redefinition_of_parameter, | |
| 171 | invalid_bin_types, | |
| 172 | comparison_ptr_int, | |
| 173 | comparison_distinct_ptr, | |
| 174 | incompatible_pointers, | |
| 175 | invalid_argument_un, | |
| 176 | incompatible_assign, | |
| 177 | implicit_ptr_to_int, | |
| 178 | invalid_cast_to_float, | |
| 179 | invalid_cast_to_pointer, | |
| 180 | invalid_cast_type, | |
| 181 | qual_cast, | |
| 182 | invalid_index, | |
| 183 | invalid_subscript, | |
| 184 | array_after, | |
| 185 | array_before, | |
| 186 | statement_int, | |
| 187 | statement_scalar, | |
| 188 | func_should_return, | |
| 189 | incompatible_return, | |
| 190 | incompatible_return_sign, | |
| 191 | implicit_int_to_ptr, | |
| 192 | func_does_not_return, | |
| 193 | void_func_returns_value, | |
| 194 | incompatible_arg, | |
| 195 | incompatible_ptr_arg, | |
| 196 | incompatible_ptr_arg_sign, | |
| 197 | parameter_here, | |
| 198 | atomic_array, | |
| 199 | atomic_func, | |
| 200 | atomic_incomplete, | |
| 201 | addr_of_register, | |
| 202 | variable_incomplete_ty, | |
| 203 | parameter_incomplete_ty, | |
| 204 | tentative_array, | |
| 205 | deref_incomplete_ty_ptr, | |
| 206 | alignas_on_func, | |
| 207 | alignas_on_param, | |
| 208 | minimum_alignment, | |
| 209 | maximum_alignment, | |
| 210 | negative_alignment, | |
| 211 | align_ignored, | |
| 212 | zero_align_ignored, | |
| 213 | non_pow2_align, | |
| 214 | pointer_mismatch, | |
| 215 | static_assert_not_constant, | |
| 216 | static_assert_missing_message, | |
| 217 | pre_c23_compat, | |
| 218 | unbound_vla, | |
| 219 | array_too_large, | |
| 220 | record_too_large, | |
| 221 | incompatible_ptr_init, | |
| 222 | incompatible_ptr_init_sign, | |
| 223 | incompatible_ptr_assign, | |
| 224 | incompatible_ptr_assign_sign, | |
| 225 | vla_init, | |
| 226 | func_init, | |
| 227 | incompatible_init, | |
| 228 | empty_scalar_init, | |
| 229 | excess_scalar_init, | |
| 230 | excess_str_init, | |
| 231 | excess_struct_init, | |
| 232 | excess_array_init, | |
| 233 | str_init_too_long, | |
| 234 | arr_init_too_long, | |
| 235 | invalid_typeof, | |
| 236 | division_by_zero, | |
| 237 | division_by_zero_macro, | |
| 238 | builtin_choose_cond, | |
| 239 | alignas_unavailable, | |
| 240 | case_val_unavailable, | |
| 241 | enum_val_unavailable, | |
| 242 | incompatible_array_init, | |
| 243 | array_init_str, | |
| 244 | initializer_overrides, | |
| 245 | previous_initializer, | |
| 246 | invalid_array_designator, | |
| 247 | negative_array_designator, | |
| 248 | oob_array_designator, | |
| 249 | invalid_field_designator, | |
| 250 | no_such_field_designator, | |
| 251 | empty_aggregate_init_braces, | |
| 252 | ptr_init_discards_quals, | |
| 253 | ptr_assign_discards_quals, | |
| 254 | ptr_ret_discards_quals, | |
| 255 | ptr_arg_discards_quals, | |
| 256 | unknown_attribute, | |
| 257 | ignored_attribute, | |
| 258 | invalid_fallthrough, | |
| 259 | cannot_apply_attribute_to_statement, | |
| 260 | builtin_macro_redefined, | |
| 261 | feature_check_requires_identifier, | |
| 262 | missing_tok_builtin, | |
| 263 | gnu_label_as_value, | |
| 264 | expected_record_ty, | |
| 265 | member_expr_not_ptr, | |
| 266 | member_expr_ptr, | |
| 267 | no_such_member, | |
| 268 | malformed_warning_check, | |
| 269 | invalid_computed_goto, | |
| 270 | pragma_warning_message, | |
| 271 | pragma_error_message, | |
| 272 | pragma_message, | |
| 273 | pragma_requires_string_literal, | |
| 274 | poisoned_identifier, | |
| 275 | pragma_poison_identifier, | |
| 276 | pragma_poison_macro, | |
| 277 | newline_eof, | |
| 278 | empty_translation_unit, | |
| 279 | omitting_parameter_name, | |
| 280 | non_int_bitfield, | |
| 281 | negative_bitwidth, | |
| 282 | zero_width_named_field, | |
| 283 | bitfield_too_big, | |
| 284 | invalid_utf8, | |
| 285 | implicitly_unsigned_literal, | |
| 286 | invalid_preproc_operator, | |
| 287 | invalid_preproc_expr_start, | |
| 288 | c99_compat, | |
| 289 | unexpected_character, | |
| 290 | invalid_identifier_start_char, | |
| 291 | unicode_zero_width, | |
| 292 | unicode_homoglyph, | |
| 293 | meaningless_asm_qual, | |
| 294 | duplicate_asm_qual, | |
| 295 | invalid_asm_str, | |
| 296 | dollar_in_identifier_extension, | |
| 297 | dollars_in_identifiers, | |
| 298 | expanded_from_here, | |
| 299 | skipping_macro_backtrace, | |
| 300 | pragma_operator_string_literal, | |
| 301 | unknown_gcc_pragma, | |
| 302 | unknown_gcc_pragma_directive, | |
| 303 | predefined_top_level, | |
| 304 | incompatible_va_arg, | |
| 305 | too_many_scalar_init_braces, | |
| 306 | uninitialized_in_own_init, | |
| 307 | gnu_statement_expression, | |
| 308 | stmt_expr_not_allowed_file_scope, | |
| 309 | gnu_imaginary_constant, | |
| 310 | plain_complex, | |
| 311 | complex_int, | |
| 312 | qual_on_ret_type, | |
| 313 | cli_invalid_standard, | |
| 314 | cli_invalid_target, | |
| 315 | cli_invalid_emulate, | |
| 316 | cli_unknown_arg, | |
| 317 | cli_error, | |
| 318 | cli_unused_link_object, | |
| 319 | cli_unknown_linker, | |
| 320 | extra_semi, | |
| 321 | func_field, | |
| 322 | vla_field, | |
| 323 | field_incomplete_ty, | |
| 324 | flexible_in_union, | |
| 325 | flexible_non_final, | |
| 326 | flexible_in_empty, | |
| 327 | duplicate_member, | |
| 328 | binary_integer_literal, | |
| 329 | gnu_va_macro, | |
| 330 | builtin_must_be_called, | |
| 331 | va_start_not_in_func, | |
| 332 | va_start_fixed_args, | |
| 333 | va_start_not_last_param, | |
| 334 | attribute_not_enough_args, | |
| 335 | attribute_too_many_args, | |
| 336 | attribute_arg_invalid, | |
| 337 | unknown_attr_enum, | |
| 338 | attribute_requires_identifier, | |
| 339 | declspec_not_enabled, | |
| 340 | declspec_attr_not_supported, | |
| 341 | deprecated_declarations, | |
| 342 | deprecated_note, | |
| 343 | unavailable, | |
| 344 | unavailable_note, | |
| 345 | warning_attribute, | |
| 346 | error_attribute, | |
| 347 | ignored_record_attr, | |
| 348 | backslash_newline_escape, | |
| 349 | array_size_non_int, | |
| 350 | cast_to_smaller_int, | |
| 351 | gnu_switch_range, | |
| 352 | empty_case_range, | |
| 353 | non_standard_escape_char, | |
| 354 | invalid_pp_stringify_escape, | |
| 355 | vla, | |
| 356 | int_value_changed, | |
| 357 | sign_conversion, | |
| 358 | float_overflow_conversion, | |
| 359 | float_out_of_range, | |
| 360 | float_zero_conversion, | |
| 361 | float_value_changed, | |
| 362 | float_to_int, | |
| 363 | const_decl_folded, | |
| 364 | const_decl_folded_vla, | |
| 365 | redefinition_of_typedef, | |
| 366 | undefined_macro, | |
| 367 | fn_macro_undefined, | |
| 368 | preprocessing_directive_only, | |
| 369 | missing_lparen_after_builtin, | |
| 370 | offsetof_ty, | |
| 371 | offsetof_incomplete, | |
| 372 | offsetof_array, | |
| 373 | pragma_pack_lparen, | |
| 374 | pragma_pack_rparen, | |
| 375 | pragma_pack_unknown_action, | |
| 376 | pragma_pack_show, | |
| 377 | pragma_pack_int, | |
| 378 | pragma_pack_int_ident, | |
| 379 | pragma_pack_undefined_pop, | |
| 380 | pragma_pack_empty_stack, | |
| 381 | cond_expr_type, | |
| 382 | too_many_includes, | |
| 383 | enumerator_too_small, | |
| 384 | enumerator_too_large, | |
| 385 | include_next, | |
| 386 | include_next_outside_header, | |
| 387 | enumerator_overflow, | |
| 388 | enum_not_representable, | |
| 389 | enum_too_large, | |
| 390 | enum_fixed, | |
| 391 | enum_prev_nonfixed, | |
| 392 | enum_prev_fixed, | |
| 393 | enum_different_explicit_ty, | |
| 394 | enum_not_representable_fixed, | |
| 395 | transparent_union_wrong_type, | |
| 396 | transparent_union_one_field, | |
| 397 | transparent_union_size, | |
| 398 | transparent_union_size_note, | |
| 399 | designated_init_invalid, | |
| 400 | designated_init_needed, | |
| 401 | ignore_common, | |
| 402 | ignore_nocommon, | |
| 403 | non_string_ignored, | |
| 404 | local_variable_attribute, | |
| 405 | ignore_cold, | |
| 406 | ignore_hot, | |
| 407 | ignore_noinline, | |
| 408 | ignore_always_inline, | |
| 409 | invalid_noreturn, | |
| 410 | nodiscard_unused, | |
| 411 | warn_unused_result, | |
| 412 | invalid_vec_elem_ty, | |
| 413 | vec_size_not_multiple, | |
| 414 | invalid_imag, | |
| 415 | invalid_real, | |
| 416 | zero_length_array, | |
| 417 | old_style_flexible_struct, | |
| 418 | comma_deletion_va_args, | |
| 419 | main_return_type, | |
| 420 | expansion_to_defined, | |
| 421 | invalid_int_suffix, | |
| 422 | invalid_float_suffix, | |
| 423 | invalid_octal_digit, | |
| 424 | invalid_binary_digit, | |
| 425 | exponent_has_no_digits, | |
| 426 | hex_floating_constant_requires_exponent, | |
| 427 | sizeof_returns_zero, | |
| 428 | declspec_not_allowed_after_declarator, | |
| 429 | declarator_name_tok, | |
| 430 | type_not_supported_on_target, | |
| 431 | bit_int, | |
| 432 | unsigned_bit_int_too_small, | |
| 433 | signed_bit_int_too_small, | |
| 434 | unsigned_bit_int_too_big, | |
| 435 | signed_bit_int_too_big, | |
| 436 | keyword_macro, | |
| 437 | ptr_arithmetic_incomplete, | |
| 438 | callconv_not_supported, | |
| 439 | pointer_arith_void, | |
| 440 | sizeof_array_arg, | |
| 441 | array_address_to_bool, | |
| 442 | string_literal_to_bool, | |
| 443 | constant_expression_conversion_not_allowed, | |
| 444 | invalid_object_cast, | |
| 445 | cli_invalid_fp_eval_method, | |
| 446 | suggest_pointer_for_invalid_fp16, | |
| 447 | bitint_suffix, | |
| 448 | auto_type_extension, | |
| 449 | auto_type_not_allowed, | |
| 450 | auto_type_requires_initializer, | |
| 451 | auto_type_requires_single_declarator, | |
| 452 | auto_type_requires_plain_declarator, | |
| 453 | invalid_cast_to_auto_type, | |
| 454 | auto_type_from_bitfield, | |
| 455 | array_of_auto_type, | |
| 456 | auto_type_with_init_list, | |
| 457 | missing_semicolon, | |
| 458 | tentative_definition_incomplete, | |
| 459 | forward_declaration_here, | |
| 460 | gnu_union_cast, | |
| 461 | invalid_union_cast, | |
| 462 | cast_to_incomplete_type, | |
| 463 | invalid_source_epoch, | |
| 464 | fuse_ld_path, | |
| 465 | invalid_rtlib, | |
| 466 | unsupported_rtlib_gcc, | |
| 467 | invalid_unwindlib, | |
| 468 | incompatible_unwindlib, | |
| 469 | gnu_asm_disabled, | |
| 470 | extension_token_used, | |
| 471 | complex_component_init, | |
| 472 | complex_prefix_postfix_op, | |
| 473 | not_floating_type, | |
| 474 | argument_types_differ, | |
| 475 | ms_search_rule, | |
| 476 | ctrl_z_eof, | |
| 477 | illegal_char_encoding_warning, | |
| 478 | illegal_char_encoding_error, | |
| 479 | ucn_basic_char_error, | |
| 480 | ucn_basic_char_warning, | |
| 481 | ucn_control_char_error, | |
| 482 | ucn_control_char_warning, | |
| 483 | c89_ucn_in_literal, | |
| 484 | four_char_char_literal, | |
| 485 | multi_char_char_literal, | |
| 486 | missing_hex_escape, | |
| 487 | unknown_escape_sequence, | |
| 488 | attribute_requires_string, | |
| 489 | unterminated_string_literal_warning, | |
| 490 | unterminated_string_literal_error, | |
| 491 | empty_char_literal_warning, | |
| 492 | empty_char_literal_error, | |
| 493 | unterminated_char_literal_warning, | |
| 494 | unterminated_char_literal_error, | |
| 495 | unterminated_comment, | |
| 496 | def_no_proto_deprecated, | |
| 497 | passing_args_to_kr, | |
| 498 | unknown_type_name, | |
| 499 | label_compound_end, | |
| 500 | u8_char_lit, | |
| 501 | malformed_embed_param, | |
| 502 | malformed_embed_limit, | |
| 503 | duplicate_embed_param, | |
| 504 | unsupported_embed_param, | |
| 505 | invalid_compound_literal_storage_class, | |
| 506 | va_opt_lparen, | |
| 507 | va_opt_rparen, | |
| 508 | attribute_int_out_of_range, | |
| 509 | identifier_not_normalized, | |
| 510 | c23_auto_plain_declarator, | |
| 511 | c23_auto_single_declarator, | |
| 512 | c32_auto_requires_initializer, | |
| 513 | c23_auto_scalar_init, | |
| 514 | negative_shift_count, | |
| 515 | too_big_shift_count, | |
| 516 | complex_conj, | |
| 517 | overflow_builtin_requires_int, | |
| 518 | overflow_result_requires_ptr, | |
| 519 | attribute_todo, | |
| 520 | invalid_type_underlying_enum, | |
| 521 | auto_type_self_initialized, | |
| 522 | ||
| 523 | pub fn property(tag: Tag) Properties { | |
| 524 | return named_data[@intFromEnum(tag)]; | |
| 525 | } | |
| 526 | ||
| 527 | const named_data = [_]Properties{ | |
| 528 | .{ .msg = "TODO: {s}", .extra = .str, .kind = .@"error" }, | |
| 529 | .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, | |
| 530 | .{ .msg = "{s}", .opt = W("#warnings"), .extra = .str, .kind = .warning }, | |
| 531 | .{ .msg = "#elif without #if", .kind = .@"error" }, | |
| 532 | .{ .msg = "#elif after #else", .kind = .@"error" }, | |
| 533 | .{ .msg = "#elifdef without #if", .kind = .@"error" }, | |
| 534 | .{ .msg = "#elifdef after #else", .kind = .@"error" }, | |
| 535 | .{ .msg = "#elifndef without #if", .kind = .@"error" }, | |
| 536 | .{ .msg = "#elifndef after #else", .kind = .@"error" }, | |
| 537 | .{ .msg = "#else without #if", .kind = .@"error" }, | |
| 538 | .{ .msg = "#else after #else", .kind = .@"error" }, | |
| 539 | .{ .msg = "#endif without #if", .kind = .@"error" }, | |
| 540 | .{ .msg = "unknown pragma ignored", .opt = W("unknown-pragmas"), .kind = .off, .all = true }, | |
| 541 | .{ .msg = "#line directive requires a simple digit sequence", .kind = .@"error" }, | |
| 542 | .{ .msg = "invalid filename for #line directive", .kind = .@"error" }, | |
| 543 | .{ .msg = "unterminated conditional directive", .kind = .@"error" }, | |
| 544 | .{ .msg = "invalid preprocessing directive", .kind = .@"error" }, | |
| 545 | .{ .msg = "macro name missing", .kind = .@"error" }, | |
| 546 | .{ .msg = "extra tokens at end of macro directive", .kind = .@"error" }, | |
| 547 | .{ .msg = "expected value in expression", .kind = .@"error" }, | |
| 548 | .{ .msg = "expected closing ')'", .kind = .@"error" }, | |
| 549 | .{ .msg = "to match this '('", .kind = .note }, | |
| 550 | .{ .msg = "to match this '{'", .kind = .note }, | |
| 551 | .{ .msg = "to match this '['", .kind = .note }, | |
| 552 | .{ .msg = "expected closing '>'", .kind = .@"error" }, | |
| 553 | .{ .msg = "to match this '<'", .kind = .note }, | |
| 554 | .{ .msg = "string literal in preprocessor expression", .kind = .@"error" }, | |
| 555 | .{ .msg = "floating point literal in preprocessor expression", .kind = .@"error" }, | |
| 556 | .{ .msg = "'defined' cannot be used as a macro name", .kind = .@"error" }, | |
| 557 | .{ .msg = "macro name must be an identifier", .kind = .@"error" }, | |
| 558 | .{ .msg = "ISO C99 requires whitespace after the macro name", .opt = W("c99-extensions"), .kind = .warning }, | |
| 559 | .{ .msg = "'##' cannot appear at the start of a macro expansion", .kind = .@"error" }, | |
| 560 | .{ .msg = "'##' cannot appear at the end of a macro expansion", .kind = .@"error" }, | |
| 561 | .{ .msg = "pasting formed '{s}', an invalid preprocessing token", .extra = .str, .kind = .@"error" }, | |
| 562 | .{ .msg = "missing ')' in macro parameter list", .kind = .@"error" }, | |
| 563 | .{ .msg = "unterminated macro param list", .kind = .@"error" }, | |
| 564 | .{ .msg = "invalid token in macro parameter list", .kind = .@"error" }, | |
| 565 | .{ .msg = "expected comma in macro parameter list", .kind = .@"error" }, | |
| 566 | .{ .msg = "'#' is not followed by a macro parameter", .kind = .@"error" }, | |
| 567 | .{ .msg = "expected \"FILENAME\" or <FILENAME>", .kind = .@"error" }, | |
| 568 | .{ .msg = "empty filename", .kind = .@"error" }, | |
| 569 | .{ .msg = "expected '{s}', found invalid bytes", .extra = .tok_id_expected, .kind = .@"error" }, | |
| 570 | .{ .msg = "expected '{s}' before end of file", .extra = .tok_id_expected, .kind = .@"error" }, | |
| 571 | .{ .msg = "expected '{s}', found '{s}'", .extra = .tok_id, .kind = .@"error" }, | |
| 572 | .{ .msg = "expected expression", .kind = .@"error" }, | |
| 573 | .{ .msg = "expression is not an integer constant expression", .kind = .@"error" }, | |
| 574 | .{ .msg = "type specifier missing, defaults to 'int'", .opt = W("implicit-int"), .kind = .warning, .all = true }, | |
| 575 | .{ .msg = "a type specifier is required for all declarations", .kind = .@"error" }, | |
| 576 | .{ .msg = "cannot combine with previous '{s}' declaration specifier", .extra = .str, .kind = .@"error" }, | |
| 577 | .{ .msg = "static assertion failed", .kind = .@"error" }, | |
| 578 | .{ .msg = "static assertion failed {s}", .extra = .str, .kind = .@"error" }, | |
| 579 | .{ .msg = "expected a type", .kind = .@"error" }, | |
| 580 | .{ .msg = "cannot combine with previous '{s}' specifier", .extra = .str, .kind = .@"error" }, | |
| 581 | .{ .msg = "duplicate '{s}' declaration specifier", .extra = .str, .opt = W("duplicate-decl-specifier"), .kind = .warning, .all = true }, | |
| 582 | .{ .msg = "restrict requires a pointer or reference ('{s}' is invalid)", .extra = .str, .kind = .@"error" }, | |
| 583 | .{ .msg = "expected external declaration", .kind = .@"error" }, | |
| 584 | .{ .msg = "expected identifier or '('", .kind = .@"error" }, | |
| 585 | .{ .msg = "declaration does not declare anything", .opt = W("missing-declaration"), .kind = .warning }, | |
| 586 | .{ .msg = "function definition is not allowed here", .kind = .@"error" }, | |
| 587 | .{ .msg = "illegal initializer (only variables can be initialized)", .kind = .@"error" }, | |
| 588 | .{ .msg = "extern variable has initializer", .opt = W("extern-initializer"), .kind = .warning }, | |
| 589 | .{ .msg = "'{s}' came from typedef", .extra = .str, .kind = .note }, | |
| 590 | .{ .msg = "ISO C requires a named parameter before '...'", .kind = .@"error", .suppress_version = .c23 }, | |
| 591 | .{ .msg = "'void' must be the only parameter if specified", .kind = .@"error" }, | |
| 592 | .{ .msg = "'void' parameter cannot be qualified", .kind = .@"error" }, | |
| 593 | .{ .msg = "'void' must be the first parameter if specified", .kind = .@"error" }, | |
| 594 | .{ .msg = "invalid storage class on function parameter", .kind = .@"error" }, | |
| 595 | .{ .msg = "_Thread_local only allowed on variables", .kind = .@"error" }, | |
| 596 | .{ .msg = "'{s}' can only appear on functions", .extra = .str, .kind = .@"error" }, | |
| 597 | .{ .msg = "illegal storage class on function", .kind = .@"error" }, | |
| 598 | .{ .msg = "illegal storage class on global variable", .kind = .@"error" }, | |
| 599 | .{ .msg = "expected statement", .kind = .@"error" }, | |
| 600 | .{ .msg = "function cannot return a function", .kind = .@"error" }, | |
| 601 | .{ .msg = "function cannot return an array", .kind = .@"error" }, | |
| 602 | .{ .msg = "use of undeclared identifier '{s}'", .extra = .str, .kind = .@"error" }, | |
| 603 | .{ .msg = "cannot call non function type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 604 | .{ .msg = "unsupported string literal concatenation", .kind = .@"error" }, | |
| 605 | .{ .msg = "static functions must be global", .kind = .@"error" }, | |
| 606 | .{ .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 }, | |
| 607 | .{ .msg = "use of unknown builtin '{s}'", .extra = .str, .opt = W("implicit-function-declaration"), .kind = .@"error", .all = true }, | |
| 608 | .{ .msg = "implicitly declaring library function '{s}'", .extra = .str, .opt = W("implicit-function-declaration"), .kind = .@"error", .all = true }, | |
| 609 | .{ .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 }, | |
| 610 | .{ .msg = "expected parameter declaration", .kind = .@"error" }, | |
| 611 | .{ .msg = "identifier parameter lists are only allowed in function definitions", .kind = .@"error" }, | |
| 612 | .{ .msg = "expected function body after function declaration", .kind = .@"error" }, | |
| 613 | .{ .msg = "parameter cannot have void type", .kind = .@"error" }, | |
| 614 | .{ .msg = "expression result unused", .opt = W("unused-value"), .kind = .warning, .all = true }, | |
| 615 | .{ .msg = "'continue' statement not in a loop", .kind = .@"error" }, | |
| 616 | .{ .msg = "'break' statement not in a loop or a switch", .kind = .@"error" }, | |
| 617 | .{ .msg = "unreachable code", .opt = W("unreachable-code"), .kind = .warning, .all = true }, | |
| 618 | .{ .msg = "duplicate label '{s}'", .extra = .str, .kind = .@"error" }, | |
| 619 | .{ .msg = "previous definition of label '{s}' was here", .extra = .str, .kind = .note }, | |
| 620 | .{ .msg = "use of undeclared label '{s}'", .extra = .str, .kind = .@"error" }, | |
| 621 | .{ .msg = "'{s}' statement not in a switch statement", .extra = .str, .kind = .@"error" }, | |
| 622 | .{ .msg = "duplicate case value '{s}'", .extra = .str, .kind = .@"error" }, | |
| 623 | .{ .msg = "multiple default cases in the same switch", .kind = .@"error" }, | |
| 624 | .{ .msg = "previous case defined here", .kind = .note }, | |
| 625 | .{ .msg = expected_arguments, .extra = .arguments, .kind = .@"error" }, | |
| 626 | .{ .msg = "callee declares array parameter as static here", .kind = .note }, | |
| 627 | .{ .msg = "array argument is too small; contains {d} elements, callee requires at least {d}", .extra = .arguments, .kind = .warning, .opt = W("array-bounds") }, | |
| 628 | .{ .msg = "null passed to a callee that requires a non-null argument", .kind = .warning, .opt = W("nonnull") }, | |
| 629 | .{ .msg = expected_arguments, .extra = .arguments, .kind = .warning }, | |
| 630 | .{ .msg = "expected at least {d} argument(s) got {d}", .extra = .arguments, .kind = .warning }, | |
| 631 | .{ .msg = "'static' may not be used with an unspecified variable length array size", .kind = .@"error" }, | |
| 632 | .{ .msg = "'static' used outside of function parameters", .kind = .@"error" }, | |
| 633 | .{ .msg = "type qualifier in non parameter array type", .kind = .@"error" }, | |
| 634 | .{ .msg = "star modifier used outside of function parameters", .kind = .@"error" }, | |
| 635 | .{ .msg = "variable length arrays not allowed at file scope", .kind = .@"error" }, | |
| 636 | .{ .msg = "'static' useless without a constant size", .kind = .warning, .w_extra = true }, | |
| 637 | .{ .msg = "array size must be 0 or greater", .kind = .@"error" }, | |
| 638 | .{ .msg = "array has incomplete element type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 639 | .{ .msg = "arrays cannot have functions as their element type", .kind = .@"error" }, | |
| 640 | .{ .msg = "'static' used in non-outermost array type", .kind = .@"error" }, | |
| 641 | .{ .msg = "type qualifier used in non-outermost array type", .kind = .@"error" }, | |
| 642 | .{ .msg = "unterminated function macro argument list", .kind = .@"error" }, | |
| 643 | .{ .msg = "unknown warning '{s}'", .extra = .str, .opt = W("unknown-warning-option"), .kind = .warning }, | |
| 644 | .{ .msg = "overflow in expression; result is '{s}'", .extra = .str, .opt = W("integer-overflow"), .kind = .warning }, | |
| 645 | .{ .msg = "integer literal is too large to be represented in any integer type", .kind = .@"error" }, | |
| 646 | .{ .msg = "indirection requires pointer operand", .kind = .@"error" }, | |
| 647 | .{ .msg = "cannot take the address of an rvalue", .kind = .@"error" }, | |
| 648 | .{ .msg = "address of bit-field requested", .kind = .@"error" }, | |
| 649 | .{ .msg = "expression is not assignable", .kind = .@"error" }, | |
| 650 | .{ .msg = "expected identifier or '{'", .kind = .@"error" }, | |
| 651 | .{ .msg = "empty enum is invalid", .kind = .@"error" }, | |
| 652 | .{ .msg = "redefinition of '{s}'", .extra = .str, .kind = .@"error" }, | |
| 653 | .{ .msg = "previous definition is here", .kind = .note }, | |
| 654 | .{ .msg = "expected identifier", .kind = .@"error" }, | |
| 655 | .{ .msg = "expected string literal for diagnostic message in static_assert", .kind = .@"error" }, | |
| 656 | .{ .msg = "expected string literal in '{s}'", .extra = .str, .kind = .@"error" }, | |
| 657 | .{ .msg = "parameter named '{s}' is missing", .extra = .str, .kind = .@"error" }, | |
| 658 | .{ .msg = "empty {s} is a GNU extension", .extra = .str, .opt = W("gnu-empty-struct"), .kind = .off, .pedantic = true }, | |
| 659 | .{ .msg = "empty {s} has size 0 in C, size 1 in C++", .extra = .str, .opt = W("c++-compat"), .kind = .off }, | |
| 660 | .{ .msg = "use of '{s}' with tag type that does not match previous definition", .extra = .str, .kind = .@"error" }, | |
| 661 | .{ .msg = "expected parentheses around type name", .kind = .@"error" }, | |
| 662 | .{ .msg = "'_Alignof' applied to an expression is a GNU extension", .opt = W("gnu-alignof-expression"), .kind = .warning, .suppress_gnu = true }, | |
| 663 | .{ .msg = "invalid application of 'alignof' to an incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 664 | .{ .msg = "invalid application of 'sizeof' to an incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 665 | .{ .msg = "'{s}' macro redefined", .extra = .str, .opt = W("macro-redefined"), .kind = .warning }, | |
| 666 | .{ .msg = "generic association with qualifiers cannot be matched with", .opt = W("generic-qual-type"), .kind = .warning }, | |
| 667 | .{ .msg = "generic association array type cannot be matched with", .opt = W("generic-qual-type"), .kind = .warning }, | |
| 668 | .{ .msg = "generic association function type cannot be matched with", .opt = W("generic-qual-type"), .kind = .warning }, | |
| 669 | .{ .msg = "type '{s}' in generic association compatible with previously specified type", .extra = .str, .kind = .@"error" }, | |
| 670 | .{ .msg = "compatible type '{s}' specified here", .extra = .str, .kind = .note }, | |
| 671 | .{ .msg = "duplicate default generic association", .kind = .@"error" }, | |
| 672 | .{ .msg = "controlling expression type '{s}' not compatible with any generic association type", .extra = .str, .kind = .@"error" }, | |
| 673 | .{ .msg = "escape sequence out of range", .kind = .@"error" }, | |
| 674 | .{ .msg = "invalid universal character", .kind = .@"error" }, | |
| 675 | .{ .msg = "incomplete universal character name", .kind = .@"error" }, | |
| 676 | .{ .msg = "multi-character character constant", .opt = W("multichar"), .kind = .warning, .all = true }, | |
| 677 | .{ .msg = "{s} character literals may not contain multiple characters", .kind = .@"error", .extra = .str }, | |
| 678 | .{ .msg = "extraneous characters in character constant ignored", .kind = .warning }, | |
| 679 | .{ .msg = "character constant too long for its type", .kind = .warning, .all = true }, | |
| 680 | .{ .msg = "character too large for enclosing character literal type", .kind = .@"error" }, | |
| 681 | .{ .msg = "must use 'struct' tag to refer to type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 682 | .{ .msg = "must use 'union' tag to refer to type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 683 | .{ .msg = "must use 'enum' tag to refer to type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 684 | .{ .msg = "redefinition of '{s}' as different kind of symbol", .extra = .str, .kind = .@"error" }, | |
| 685 | .{ .msg = "redefinition of '{s}' with a different type", .extra = .str, .kind = .@"error" }, | |
| 686 | .{ .msg = "redefinition of parameter '{s}'", .extra = .str, .kind = .@"error" }, | |
| 687 | .{ .msg = "invalid operands to binary expression ({s})", .extra = .str, .kind = .@"error" }, | |
| 688 | .{ .msg = "comparison between pointer and integer ({s})", .extra = .str, .opt = W("pointer-integer-compare"), .kind = .warning }, | |
| 689 | .{ .msg = "comparison of distinct pointer types ({s})", .extra = .str, .opt = W("compare-distinct-pointer-types"), .kind = .warning }, | |
| 690 | .{ .msg = "incompatible pointer types ({s})", .extra = .str, .kind = .@"error" }, | |
| 691 | .{ .msg = "invalid argument type '{s}' to unary expression", .extra = .str, .kind = .@"error" }, | |
| 692 | .{ .msg = "assignment to {s}", .extra = .str, .kind = .@"error" }, | |
| 693 | .{ .msg = "implicit pointer to integer conversion from {s}", .extra = .str, .opt = W("int-conversion"), .kind = .warning }, | |
| 694 | .{ .msg = "pointer cannot be cast to type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 695 | .{ .msg = "operand of type '{s}' cannot be cast to a pointer type", .extra = .str, .kind = .@"error" }, | |
| 696 | .{ .msg = "cannot cast to non arithmetic or pointer type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 697 | .{ .msg = "cast to type '{s}' will not preserve qualifiers", .extra = .str, .opt = W("cast-qualifiers"), .kind = .warning }, | |
| 698 | .{ .msg = "array subscript is not an integer", .kind = .@"error" }, | |
| 699 | .{ .msg = "subscripted value is not an array or pointer", .kind = .@"error" }, | |
| 700 | .{ .msg = "array index {s} is past the end of the array", .extra = .str, .opt = W("array-bounds"), .kind = .warning }, | |
| 701 | .{ .msg = "array index {s} is before the beginning of the array", .extra = .str, .opt = W("array-bounds"), .kind = .warning }, | |
| 702 | .{ .msg = "statement requires expression with integer type ('{s}' invalid)", .extra = .str, .kind = .@"error" }, | |
| 703 | .{ .msg = "statement requires expression with scalar type ('{s}' invalid)", .extra = .str, .kind = .@"error" }, | |
| 704 | .{ .msg = "non-void function '{s}' should return a value", .extra = .str, .opt = W("return-type"), .kind = .@"error", .all = true }, | |
| 705 | .{ .msg = "returning {s}", .extra = .str, .kind = .@"error" }, | |
| 706 | .{ .msg = "returning {s}" ++ pointer_sign_message, .extra = .str, .kind = .warning, .opt = W("pointer-sign") }, | |
| 707 | .{ .msg = "implicit integer to pointer conversion from {s}", .extra = .str, .opt = W("int-conversion"), .kind = .warning }, | |
| 708 | .{ .msg = "non-void function '{s}' does not return a value", .extra = .str, .opt = W("return-type"), .kind = .warning, .all = true }, | |
| 709 | .{ .msg = "void function '{s}' should not return a value", .extra = .str, .opt = W("return-type"), .kind = .@"error", .all = true }, | |
| 710 | .{ .msg = "passing {s}", .extra = .str, .kind = .@"error" }, | |
| 711 | .{ .msg = "passing {s}", .extra = .str, .kind = .warning, .opt = W("incompatible-pointer-types") }, | |
| 712 | .{ .msg = "passing {s}" ++ pointer_sign_message, .extra = .str, .kind = .warning, .opt = W("pointer-sign") }, | |
| 713 | .{ .msg = "passing argument to parameter here", .kind = .note }, | |
| 714 | .{ .msg = "atomic cannot be applied to array type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 715 | .{ .msg = "atomic cannot be applied to function type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 716 | .{ .msg = "atomic cannot be applied to incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 717 | .{ .msg = "address of register variable requested", .kind = .@"error" }, | |
| 718 | .{ .msg = "variable has incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 719 | .{ .msg = "parameter has incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 720 | .{ .msg = "tentative array definition assumed to have one element", .kind = .warning }, | |
| 721 | .{ .msg = "dereferencing pointer to incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 722 | .{ .msg = "'_Alignas' attribute only applies to variables and fields", .kind = .@"error" }, | |
| 723 | .{ .msg = "'_Alignas' attribute cannot be applied to a function parameter", .kind = .@"error" }, | |
| 724 | .{ .msg = "requested alignment is less than minimum alignment of {d}", .extra = .unsigned, .kind = .@"error" }, | |
| 725 | .{ .msg = "requested alignment of {s} is too large", .extra = .str, .kind = .@"error" }, | |
| 726 | .{ .msg = "requested negative alignment of {s} is invalid", .extra = .str, .kind = .@"error" }, | |
| 727 | .{ .msg = "'_Alignas' attribute is ignored here", .kind = .warning }, | |
| 728 | .{ .msg = "requested alignment of zero is ignored", .kind = .warning }, | |
| 729 | .{ .msg = "requested alignment is not a power of 2", .kind = .@"error" }, | |
| 730 | .{ .msg = "pointer type mismatch ({s})", .extra = .str, .opt = W("pointer-type-mismatch"), .kind = .warning }, | |
| 731 | .{ .msg = "static_assert expression is not an integral constant expression", .kind = .@"error" }, | |
| 732 | .{ .msg = "static_assert with no message is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, | |
| 733 | .{ .msg = "{s} is incompatible with C standards before C23", .extra = .str, .kind = .off, .suppress_unless_version = .c23, .opt = W("pre-c23-compat") }, | |
| 734 | .{ .msg = "variable length array must be bound in function definition", .kind = .@"error" }, | |
| 735 | .{ .msg = "array is too large", .kind = .@"error" }, | |
| 736 | .{ .msg = "type '{s}' is too large", .kind = .@"error", .extra = .str }, | |
| 737 | .{ .msg = "incompatible pointer types initializing {s}", .extra = .str, .opt = W("incompatible-pointer-types"), .kind = .warning }, | |
| 738 | .{ .msg = "incompatible pointer types initializing {s}" ++ pointer_sign_message, .extra = .str, .opt = W("pointer-sign"), .kind = .warning }, | |
| 739 | .{ .msg = "incompatible pointer types assigning to {s}", .extra = .str, .opt = W("incompatible-pointer-types"), .kind = .warning }, | |
| 740 | .{ .msg = "incompatible pointer types assigning to {s} " ++ pointer_sign_message, .extra = .str, .opt = W("pointer-sign"), .kind = .warning }, | |
| 741 | .{ .msg = "variable-sized object may not be initialized", .kind = .@"error" }, | |
| 742 | .{ .msg = "illegal initializer type", .kind = .@"error" }, | |
| 743 | .{ .msg = "initializing {s}", .extra = .str, .kind = .@"error" }, | |
| 744 | .{ .msg = "scalar initializer cannot be empty", .kind = .@"error" }, | |
| 745 | .{ .msg = "excess elements in scalar initializer", .opt = W("excess-initializers"), .kind = .warning }, | |
| 746 | .{ .msg = "excess elements in string initializer", .opt = W("excess-initializers"), .kind = .warning }, | |
| 747 | .{ .msg = "excess elements in struct initializer", .opt = W("excess-initializers"), .kind = .warning }, | |
| 748 | .{ .msg = "excess elements in array initializer", .opt = W("excess-initializers"), .kind = .warning }, | |
| 749 | .{ .msg = "initializer-string for char array is too long", .opt = W("excess-initializers"), .kind = .warning }, | |
| 750 | .{ .msg = "cannot initialize type ({s})", .extra = .str, .kind = .@"error" }, | |
| 751 | .{ .msg = "'{s} typeof' is invalid", .extra = .str, .kind = .@"error" }, | |
| 752 | .{ .msg = "{s} by zero is undefined", .extra = .str, .opt = W("division-by-zero"), .kind = .warning }, | |
| 753 | .{ .msg = "{s} by zero in preprocessor expression", .extra = .str, .kind = .@"error" }, | |
| 754 | .{ .msg = "'__builtin_choose_expr' requires a constant expression", .kind = .@"error" }, | |
| 755 | .{ .msg = "'_Alignas' attribute requires integer constant expression", .kind = .@"error" }, | |
| 756 | .{ .msg = "case value must be an integer constant expression", .kind = .@"error" }, | |
| 757 | .{ .msg = "enum value must be an integer constant expression", .kind = .@"error" }, | |
| 758 | .{ .msg = "cannot initialize array of type {s}", .extra = .str, .kind = .@"error" }, | |
| 759 | .{ .msg = "array initializer must be an initializer list or wide string literal", .kind = .@"error" }, | |
| 760 | .{ .msg = "initializer overrides previous initialization", .opt = W("initializer-overrides"), .kind = .warning, .w_extra = true }, | |
| 761 | .{ .msg = "previous initialization", .kind = .note }, | |
| 762 | .{ .msg = "array designator used for non-array type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 763 | .{ .msg = "array designator value {s} is negative", .extra = .str, .kind = .@"error" }, | |
| 764 | .{ .msg = "array designator index {s} exceeds array bounds", .extra = .str, .kind = .@"error" }, | |
| 765 | .{ .msg = "field designator used for non-record type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 766 | .{ .msg = "record type has no field named '{s}'", .extra = .str, .kind = .@"error" }, | |
| 767 | .{ .msg = "initializer for aggregate with no elements requires explicit braces", .kind = .@"error" }, | |
| 768 | .{ .msg = "initializing {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, | |
| 769 | .{ .msg = "assigning to {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, | |
| 770 | .{ .msg = "returning {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, | |
| 771 | .{ .msg = "passing {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, | |
| 772 | .{ .msg = "unknown attribute '{s}' ignored", .extra = .str, .opt = W("unknown-attributes"), .kind = .warning }, | |
| 773 | .{ .msg = "{s}", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, | |
| 774 | .{ .msg = "fallthrough annotation does not directly precede switch label", .kind = .@"error" }, | |
| 775 | .{ .msg = "'{s}' attribute cannot be applied to a statement", .extra = .str, .kind = .@"error" }, | |
| 776 | .{ .msg = "redefining builtin macro", .opt = W("builtin-macro-redefined"), .kind = .warning }, | |
| 777 | .{ .msg = "builtin feature check macro requires a parenthesized identifier", .kind = .@"error" }, | |
| 778 | .{ .msg = "missing '{s}', after builtin feature-check macro", .extra = .tok_id_expected, .kind = .@"error" }, | |
| 779 | .{ .msg = "use of GNU address-of-label extension", .opt = W("gnu-label-as-value"), .kind = .off, .pedantic = true }, | |
| 780 | .{ .msg = "member reference base type '{s}' is not a structure or union", .extra = .str, .kind = .@"error" }, | |
| 781 | .{ .msg = "member reference type '{s}' is not a pointer; did you mean to use '.'?", .extra = .str, .kind = .@"error" }, | |
| 782 | .{ .msg = "member reference type '{s}' is a pointer; did you mean to use '->'?", .extra = .str, .kind = .@"error" }, | |
| 783 | .{ .msg = "no member named {s}", .extra = .str, .kind = .@"error" }, | |
| 784 | .{ .msg = "{s} expected option name (e.g. \"-Wundef\")", .extra = .str, .opt = W("malformed-warning-check"), .kind = .warning, .all = true }, | |
| 785 | .{ .msg = "computed goto in function with no address-of-label expressions", .kind = .@"error" }, | |
| 786 | .{ .msg = "{s}", .extra = .str, .opt = W("#pragma-messages"), .kind = .warning }, | |
| 787 | .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, | |
| 788 | .{ .msg = "#pragma message: {s}", .extra = .str, .kind = .note }, | |
| 789 | .{ .msg = "pragma {s} requires string literal", .extra = .str, .kind = .@"error" }, | |
| 790 | .{ .msg = "attempt to use a poisoned identifier", .kind = .@"error" }, | |
| 791 | .{ .msg = "can only poison identifier tokens", .kind = .@"error" }, | |
| 792 | .{ .msg = "poisoning existing macro", .kind = .warning }, | |
| 793 | .{ .msg = "no newline at end of file", .opt = W("newline-eof"), .kind = .off, .pedantic = true }, | |
| 794 | .{ .msg = "ISO C requires a translation unit to contain at least one declaration", .opt = W("empty-translation-unit"), .kind = .off, .pedantic = true }, | |
| 795 | .{ .msg = "omitting the parameter name in a function definition is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, | |
| 796 | .{ .msg = "bit-field has non-integer type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 797 | .{ .msg = "bit-field has negative width ({s})", .extra = .str, .kind = .@"error" }, | |
| 798 | .{ .msg = "named bit-field has zero width", .kind = .@"error" }, | |
| 799 | .{ .msg = "width of bit-field exceeds width of its type", .kind = .@"error" }, | |
| 800 | .{ .msg = "source file is not valid UTF-8", .kind = .@"error" }, | |
| 801 | .{ .msg = "integer literal is too large to be represented in a signed integer type, interpreting as unsigned", .opt = W("implicitly-unsigned-literal"), .kind = .warning }, | |
| 802 | .{ .msg = "token is not a valid binary operator in a preprocessor subexpression", .kind = .@"error" }, | |
| 803 | .{ .msg = "invalid token at start of a preprocessor expression", .kind = .@"error" }, | |
| 804 | .{ .msg = "using this character in an identifier is incompatible with C99", .opt = W("c99-compat"), .kind = .off }, | |
| 805 | .{ .msg = "unexpected character <U+{X:0>4}>", .extra = .actual_codepoint, .kind = .@"error" }, | |
| 806 | .{ .msg = "character <U+{X:0>4}> not allowed at the start of an identifier", .extra = .actual_codepoint, .kind = .@"error" }, | |
| 807 | .{ .msg = "identifier contains Unicode character <U+{X:0>4}> that is invisible in some environments", .opt = W("unicode-homoglyph"), .extra = .actual_codepoint, .kind = .warning }, | |
| 808 | .{ .msg = "treating Unicode character <U+{X:0>4}> as identifier character rather than as '{u}' symbol", .extra = .codepoints, .opt = W("unicode-homoglyph"), .kind = .warning }, | |
| 809 | .{ .msg = "meaningless '{s}' on assembly outside function", .extra = .str, .kind = .@"error" }, | |
| 810 | .{ .msg = "duplicate asm qualifier '{s}'", .extra = .str, .kind = .@"error" }, | |
| 811 | .{ .msg = "cannot use {s} string literal in assembly", .extra = .str, .kind = .@"error" }, | |
| 812 | .{ .msg = "'$' in identifier", .opt = W("dollar-in-identifier-extension"), .kind = .off, .pedantic = true }, | |
| 813 | .{ .msg = "illegal character '$' in identifier", .kind = .@"error" }, | |
| 814 | .{ .msg = "expanded from here", .kind = .note }, | |
| 815 | .{ .msg = "(skipping {d} expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)", .extra = .unsigned, .kind = .note }, | |
| 816 | .{ .msg = "_Pragma requires exactly one string literal token", .kind = .@"error" }, | |
| 817 | .{ .msg = "pragma GCC expected 'error', 'warning', 'diagnostic', 'poison'", .opt = W("unknown-pragmas"), .kind = .off, .all = true }, | |
| 818 | .{ .msg = "pragma GCC diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'", .opt = W("unknown-pragmas"), .kind = .warning, .all = true }, | |
| 819 | .{ .msg = "predefined identifier is only valid inside function", .opt = W("predefined-identifier-outside-function"), .kind = .warning }, | |
| 820 | .{ .msg = "first argument to va_arg, is of type '{s}' and not 'va_list'", .extra = .str, .kind = .@"error" }, | |
| 821 | .{ .msg = "too many braces around scalar initializer", .opt = W("many-braces-around-scalar-init"), .kind = .warning }, | |
| 822 | .{ .msg = "variable '{s}' is uninitialized when used within its own initialization", .extra = .str, .opt = W("uninitialized"), .kind = .off, .all = true }, | |
| 823 | .{ .msg = "use of GNU statement expression extension", .opt = W("gnu-statement-expression"), .kind = .off, .suppress_gnu = true, .pedantic = true }, | |
| 824 | .{ .msg = "statement expression not allowed at file scope", .kind = .@"error" }, | |
| 825 | .{ .msg = "imaginary constants are a GNU extension", .opt = W("gnu-imaginary-constant"), .kind = .off, .suppress_gnu = true, .pedantic = true }, | |
| 826 | .{ .msg = "plain '_Complex' requires a type specifier; assuming '_Complex double'", .kind = .warning }, | |
| 827 | .{ .msg = "complex integer types are a GNU extension", .opt = W("gnu-complex-integer"), .suppress_gnu = true, .kind = .off }, | |
| 828 | .{ .msg = "'{s}' type qualifier on return type has no effect", .opt = W("ignored-qualifiers"), .extra = .str, .kind = .off, .all = true }, | |
| 829 | .{ .msg = "invalid standard '{s}'", .extra = .str, .kind = .@"error" }, | |
| 830 | .{ .msg = "invalid target '{s}'", .extra = .str, .kind = .@"error" }, | |
| 831 | .{ .msg = "invalid compiler '{s}'", .extra = .str, .kind = .@"error" }, | |
| 832 | .{ .msg = "unknown argument '{s}'", .extra = .str, .kind = .@"error" }, | |
| 833 | .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, | |
| 834 | .{ .msg = "{s}: linker input file unused because linking not done", .extra = .str, .kind = .warning }, | |
| 835 | .{ .msg = "unrecognized linker '{s}'", .extra = .str, .kind = .@"error" }, | |
| 836 | .{ .msg = "extra ';' outside of a function", .opt = W("extra-semi"), .kind = .off, .pedantic = true }, | |
| 837 | .{ .msg = "field declared as a function", .kind = .@"error" }, | |
| 838 | .{ .msg = "variable length array fields extension is not supported", .kind = .@"error" }, | |
| 839 | .{ .msg = "field has incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 840 | .{ .msg = "flexible array member in union is not allowed", .kind = .@"error", .suppress_msvc = true }, | |
| 841 | .{ .msg = "flexible array member is not at the end of struct", .kind = .@"error" }, | |
| 842 | .{ .msg = "flexible array member in otherwise empty struct", .kind = .@"error", .suppress_msvc = true }, | |
| 843 | .{ .msg = "duplicate member '{s}'", .extra = .str, .kind = .@"error" }, | |
| 844 | .{ .msg = "binary integer literals are a GNU extension", .kind = .off, .opt = W("gnu-binary-literal"), .pedantic = true }, | |
| 845 | .{ .msg = "named variadic macros are a GNU extension", .opt = W("variadic-macros"), .kind = .off, .pedantic = true }, | |
| 846 | .{ .msg = "builtin function must be directly called", .kind = .@"error" }, | |
| 847 | .{ .msg = "'va_start' cannot be used outside a function", .kind = .@"error" }, | |
| 848 | .{ .msg = "'va_start' used in a function with fixed args", .kind = .@"error" }, | |
| 849 | .{ .msg = "second argument to 'va_start' is not the last named parameter", .opt = W("varargs"), .kind = .warning }, | |
| 850 | .{ .msg = "'{s}' attribute takes at least {d} argument(s)", .kind = .@"error", .extra = .attr_arg_count }, | |
| 851 | .{ .msg = "'{s}' attribute takes at most {d} argument(s)", .kind = .@"error", .extra = .attr_arg_count }, | |
| 852 | .{ .msg = "Attribute argument is invalid, expected {s} but got {s}", .kind = .@"error", .extra = .attr_arg_type }, | |
| 853 | .{ .msg = "Unknown `{s}` argument. Possible values are: {s}", .kind = .@"error", .extra = .attr_enum }, | |
| 854 | .{ .msg = "'{s}' attribute requires an identifier", .kind = .@"error", .extra = .str }, | |
| 855 | .{ .msg = "'__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes", .kind = .@"error" }, | |
| 856 | .{ .msg = "__declspec attribute '{s}' is not supported", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, | |
| 857 | .{ .msg = "{s}", .extra = .str, .opt = W("deprecated-declarations"), .kind = .warning }, | |
| 858 | .{ .msg = "'{s}' has been explicitly marked deprecated here", .extra = .str, .opt = W("deprecated-declarations"), .kind = .note }, | |
| 859 | .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, | |
| 860 | .{ .msg = "'{s}' has been explicitly marked unavailable here", .extra = .str, .kind = .note }, | |
| 861 | .{ .msg = "{s}", .extra = .str, .kind = .warning, .opt = W("attribute-warning") }, | |
| 862 | .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, | |
| 863 | .{ .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") }, | |
| 864 | .{ .msg = "backslash and newline separated by space", .kind = .warning, .opt = W("backslash-newline-escape") }, | |
| 865 | .{ .msg = "size of array has non-integer type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 866 | .{ .msg = "cast to smaller integer type {s}", .extra = .str, .kind = .warning, .opt = W("pointer-to-int-cast") }, | |
| 867 | .{ .msg = "use of GNU case range extension", .opt = W("gnu-case-range"), .kind = .off, .pedantic = true }, | |
| 868 | .{ .msg = "empty case range specified", .kind = .warning }, | |
| 869 | .{ .msg = "use of non-standard escape character '\\{s}'", .kind = .off, .opt = W("pedantic"), .extra = .invalid_escape }, | |
| 870 | .{ .msg = "invalid string literal, ignoring final '\\'", .kind = .warning }, | |
| 871 | .{ .msg = "variable length array used", .kind = .off, .opt = W("vla") }, | |
| 872 | .{ .msg = "implicit conversion from {s}", .extra = .str, .kind = .warning, .opt = W("constant-conversion") }, | |
| 873 | .{ .msg = "implicit conversion changes signedness: {s}", .extra = .str, .kind = .off, .opt = W("sign-conversion") }, | |
| 874 | .{ .msg = "implicit conversion of non-finite value from {s} is undefined", .extra = .str, .kind = .off, .opt = W("float-overflow-conversion") }, | |
| 875 | .{ .msg = "implicit conversion of out of range value from {s} is undefined", .extra = .str, .kind = .warning, .opt = W("literal-conversion") }, | |
| 876 | .{ .msg = "implicit conversion from {s}", .extra = .str, .kind = .off, .opt = W("float-zero-conversion") }, | |
| 877 | .{ .msg = "implicit conversion from {s}", .extra = .str, .kind = .warning, .opt = W("float-conversion") }, | |
| 878 | .{ .msg = "implicit conversion turns floating-point number into integer: {s}", .extra = .str, .kind = .off, .opt = W("literal-conversion") }, | |
| 879 | .{ .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 }, | |
| 880 | .{ .msg = "variable length array folded to constant array as an extension", .kind = .off, .opt = W("gnu-folding-constant"), .pedantic = true }, | |
| 881 | .{ .msg = "typedef redefinition with different types ({s})", .extra = .str, .kind = .@"error" }, | |
| 882 | .{ .msg = "'{s}' is not defined, evaluates to 0", .extra = .str, .kind = .off, .opt = W("undef") }, | |
| 883 | .{ .msg = "function-like macro '{s}' is not defined", .extra = .str, .kind = .@"error" }, | |
| 884 | .{ .msg = "'{s}' must be used within a preprocessing directive", .extra = .tok_id_expected, .kind = .@"error" }, | |
| 885 | .{ .msg = "Missing '(' after built-in macro '{s}'", .extra = .str, .kind = .@"error" }, | |
| 886 | .{ .msg = "offsetof requires struct or union type, '{s}' invalid", .extra = .str, .kind = .@"error" }, | |
| 887 | .{ .msg = "offsetof of incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 888 | .{ .msg = "offsetof requires array type, '{s}' invalid", .extra = .str, .kind = .@"error" }, | |
| 889 | .{ .msg = "missing '(' after '#pragma pack' - ignoring", .kind = .warning, .opt = W("ignored-pragmas") }, | |
| 890 | .{ .msg = "missing ')' after '#pragma pack' - ignoring", .kind = .warning, .opt = W("ignored-pragmas") }, | |
| 891 | .{ .msg = "unknown action for '#pragma pack' - ignoring", .opt = W("ignored-pragmas"), .kind = .warning }, | |
| 892 | .{ .msg = "value of #pragma pack(show) == {d}", .extra = .unsigned, .kind = .warning }, | |
| 893 | .{ .msg = "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'", .opt = W("ignored-pragmas"), .kind = .warning }, | |
| 894 | .{ .msg = "expected integer or identifier in '#pragma pack' - ignored", .opt = W("ignored-pragmas"), .kind = .warning }, | |
| 895 | .{ .msg = "specifying both a name and alignment to 'pop' is undefined", .kind = .warning }, | |
| 896 | .{ .msg = "#pragma pack(pop, ...) failed: stack empty", .opt = W("ignored-pragmas"), .kind = .warning }, | |
| 897 | .{ .msg = "used type '{s}' where arithmetic or pointer type is required", .extra = .str, .kind = .@"error" }, | |
| 898 | .{ .msg = "#include nested too deeply", .kind = .@"error" }, | |
| 899 | .{ .msg = "ISO C restricts enumerator values to range of 'int' ({s} is too small)", .extra = .str, .kind = .off, .opt = W("pedantic") }, | |
| 900 | .{ .msg = "ISO C restricts enumerator values to range of 'int' ({s} is too large)", .extra = .str, .kind = .off, .opt = W("pedantic") }, | |
| 901 | .{ .msg = "#include_next is a language extension", .kind = .off, .pedantic = true, .opt = W("gnu-include-next") }, | |
| 902 | .{ .msg = "#include_next in primary source file; will search from start of include path", .kind = .warning, .opt = W("include-next-outside-header") }, | |
| 903 | .{ .msg = "overflow in enumeration value", .kind = .warning }, | |
| 904 | .{ .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 }, | |
| 905 | .{ .msg = "enumeration values exceed range of largest integer", .kind = .warning, .opt = W("enum-too-large") }, | |
| 906 | .{ .msg = "enumeration types with a fixed underlying type are a Clang extension", .kind = .off, .pedantic = true, .opt = W("fixed-enum-extension") }, | |
| 907 | .{ .msg = "enumeration previously declared with nonfixed underlying type", .kind = .@"error" }, | |
| 908 | .{ .msg = "enumeration previously declared with fixed underlying type", .kind = .@"error" }, | |
| 909 | .{ .msg = "enumeration redeclared with different underlying type {s})", .extra = .str, .kind = .@"error" }, | |
| 910 | .{ .msg = "enumerator value is not representable in the underlying type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 911 | .{ .msg = "'transparent_union' attribute only applies to unions", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 912 | .{ .msg = "transparent union definition must contain at least one field; transparent_union attribute ignored", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 913 | .{ .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 }, | |
| 914 | .{ .msg = "size of first field is {d}", .extra = .unsigned, .kind = .note }, | |
| 915 | .{ .msg = "'designated_init' attribute is only valid on 'struct' type'", .kind = .@"error" }, | |
| 916 | .{ .msg = "positional initialization of field in 'struct' declared with 'designated_init' attribute", .opt = W("designated-init"), .kind = .warning }, | |
| 917 | .{ .msg = "ignoring attribute 'common' because it conflicts with attribute 'nocommon'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 918 | .{ .msg = "ignoring attribute 'nocommon' because it conflicts with attribute 'common'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 919 | .{ .msg = "'nonstring' attribute ignored on objects of type '{s}'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 920 | .{ .msg = "'{s}' attribute only applies to local variables", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, | |
| 921 | .{ .msg = "ignoring attribute 'cold' because it conflicts with attribute 'hot'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 922 | .{ .msg = "ignoring attribute 'hot' because it conflicts with attribute 'cold'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 923 | .{ .msg = "ignoring attribute 'noinline' because it conflicts with attribute 'always_inline'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 924 | .{ .msg = "ignoring attribute 'always_inline' because it conflicts with attribute 'noinline'", .opt = W("ignored-attributes"), .kind = .warning }, | |
| 925 | .{ .msg = "function '{s}' declared 'noreturn' should not return", .extra = .str, .kind = .warning, .opt = W("invalid-noreturn") }, | |
| 926 | .{ .msg = "ignoring return value of '{s}', declared with 'nodiscard' attribute", .extra = .str, .kind = .warning, .opt = W("unused-result") }, | |
| 927 | .{ .msg = "ignoring return value of '{s}', declared with 'warn_unused_result' attribute", .extra = .str, .kind = .warning, .opt = W("unused-result") }, | |
| 928 | .{ .msg = "invalid vector element type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 929 | .{ .msg = "vector size not an integral multiple of component size", .kind = .@"error" }, | |
| 930 | .{ .msg = "invalid type '{s}' to __imag operator", .extra = .str, .kind = .@"error" }, | |
| 931 | .{ .msg = "invalid type '{s}' to __real operator", .extra = .str, .kind = .@"error" }, | |
| 932 | .{ .msg = "zero size arrays are an extension", .kind = .off, .pedantic = true, .opt = W("zero-length-array") }, | |
| 933 | .{ .msg = "array index {s} is past the end of the array", .extra = .str, .kind = .off, .pedantic = true, .opt = W("old-style-flexible-struct") }, | |
| 934 | .{ .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 }, | |
| 935 | .{ .msg = "return type of 'main' is not 'int'", .kind = .warning, .opt = W("main-return-type") }, | |
| 936 | .{ .msg = "macro expansion producing 'defined' has undefined behavior", .kind = .off, .pedantic = true, .opt = W("expansion-to-defined") }, | |
| 937 | .{ .msg = "invalid suffix '{s}' on integer constant", .extra = .str, .kind = .@"error" }, | |
| 938 | .{ .msg = "invalid suffix '{s}' on floating constant", .extra = .str, .kind = .@"error" }, | |
| 939 | .{ .msg = "invalid digit '{c}' in octal constant", .extra = .ascii, .kind = .@"error" }, | |
| 940 | .{ .msg = "invalid digit '{c}' in binary constant", .extra = .ascii, .kind = .@"error" }, | |
| 941 | .{ .msg = "exponent has no digits", .kind = .@"error" }, | |
| 942 | .{ .msg = "hexadecimal floating constant requires an exponent", .kind = .@"error" }, | |
| 943 | .{ .msg = "sizeof returns 0", .kind = .warning, .suppress_gcc = true, .suppress_clang = true }, | |
| 944 | .{ .msg = "'declspec' attribute not allowed after declarator", .kind = .@"error" }, | |
| 945 | .{ .msg = "this declarator", .kind = .note }, | |
| 946 | .{ .msg = "{s} is not supported on this target", .extra = .str, .kind = .@"error" }, | |
| 947 | .{ .msg = "'_BitInt' in C17 and earlier is a Clang extension'", .kind = .off, .pedantic = true, .opt = W("bit-int-extension"), .suppress_version = .c23 }, | |
| 948 | .{ .msg = "{s}unsigned _BitInt must have a bit size of at least 1", .extra = .str, .kind = .@"error" }, | |
| 949 | .{ .msg = "{s}signed _BitInt must have a bit size of at least 2", .extra = .str, .kind = .@"error" }, | |
| 950 | .{ .msg = "{s}unsigned _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Properties.max_bits}) ++ " not supported", .extra = .str, .kind = .@"error" }, | |
| 951 | .{ .msg = "{s}signed _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Properties.max_bits}) ++ " not supported", .extra = .str, .kind = .@"error" }, | |
| 952 | .{ .msg = "keyword is hidden by macro definition", .kind = .off, .pedantic = true, .opt = W("keyword-macro") }, | |
| 953 | .{ .msg = "arithmetic on a pointer to an incomplete type '{s}'", .extra = .str, .kind = .@"error" }, | |
| 954 | .{ .msg = "'{s}' calling convention is not supported for this target", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, | |
| 955 | .{ .msg = "invalid application of '{s}' to a void type", .extra = .str, .kind = .off, .pedantic = true, .opt = W("pointer-arith") }, | |
| 956 | .{ .msg = "sizeof on array function parameter will return size of {s}", .extra = .str, .kind = .warning, .opt = W("sizeof-array-argument") }, | |
| 957 | .{ .msg = "address of array '{s}' will always evaluate to 'true'", .extra = .str, .kind = .warning, .opt = W("pointer-bool-conversion") }, | |
| 958 | .{ .msg = "implicit conversion turns string literal into bool: {s}", .extra = .str, .kind = .off, .opt = W("string-conversion") }, | |
| 959 | .{ .msg = "this conversion is not allowed in a constant expression", .kind = .note }, | |
| 960 | .{ .msg = "cannot cast an object of type {s}", .extra = .str, .kind = .@"error" }, | |
| 961 | .{ .msg = "unsupported argument '{s}' to option '-ffp-eval-method='; expected 'source', 'double', or 'extended'", .extra = .str, .kind = .@"error" }, | |
| 962 | .{ .msg = "{s} cannot have __fp16 type; did you forget * ?", .extra = .str, .kind = .@"error" }, | |
| 963 | .{ .msg = "'_BitInt' suffix for literals is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, | |
| 964 | .{ .msg = "'__auto_type' is a GNU extension", .opt = W("gnu-auto-type"), .kind = .off, .pedantic = true }, | |
| 965 | .{ .msg = "'__auto_type' not allowed in {s}", .kind = .@"error", .extra = .str }, | |
| 966 | .{ .msg = "declaration of variable '{s}' with deduced type requires an initializer", .kind = .@"error", .extra = .str }, | |
| 967 | .{ .msg = "'__auto_type' may only be used with a single declarator", .kind = .@"error" }, | |
| 968 | .{ .msg = "'__auto_type' requires a plain identifier as declarator", .kind = .@"error" }, | |
| 969 | .{ .msg = "invalid cast to '__auto_type'", .kind = .@"error" }, | |
| 970 | .{ .msg = "cannot use bit-field as '__auto_type' initializer", .kind = .@"error" }, | |
| 971 | .{ .msg = "'{s}' declared as array of '__auto_type'", .kind = .@"error", .extra = .str }, | |
| 972 | .{ .msg = "cannot use '__auto_type' with initializer list", .kind = .@"error" }, | |
| 973 | .{ .msg = "expected ';' at end of declaration list", .kind = .warning }, | |
| 974 | .{ .msg = "tentative definition has type '{s}' that is never completed", .kind = .@"error", .extra = .str }, | |
| 975 | .{ .msg = "forward declaration of '{s}'", .kind = .note, .extra = .str }, | |
| 976 | .{ .msg = "cast to union type is a GNU extension", .opt = W("gnu-union-cast"), .kind = .off, .pedantic = true }, | |
| 977 | .{ .msg = "cast to union type from type '{s}' not present in union", .kind = .@"error", .extra = .str }, | |
| 978 | .{ .msg = "cast to incomplete type '{s}'", .kind = .@"error", .extra = .str }, | |
| 979 | .{ .msg = "environment variable SOURCE_DATE_EPOCH must expand to a non-negative integer less than or equal to 253402300799", .kind = .@"error" }, | |
| 980 | .{ .msg = "'-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead", .kind = .off, .opt = W("fuse-ld-path") }, | |
| 981 | .{ .msg = "invalid runtime library name '{s}'", .kind = .@"error", .extra = .str }, | |
| 982 | .{ .msg = "unsupported runtime library 'libgcc' for platform '{s}'", .kind = .@"error", .extra = .str }, | |
| 983 | .{ .msg = "invalid unwind library name '{s}'", .kind = .@"error", .extra = .str }, | |
| 984 | .{ .msg = "--rtlib=libgcc requires --unwindlib=libgcc", .kind = .@"error" }, | |
| 985 | .{ .msg = "GNU-style inline assembly is disabled", .kind = .@"error" }, | |
| 986 | .{ .msg = "extension used", .kind = .off, .pedantic = true, .opt = W("language-extension-token") }, | |
| 987 | .{ .msg = "complex initialization specifying real and imaginary components is an extension", .opt = W("complex-component-init"), .kind = .off, .pedantic = true }, | |
| 988 | .{ .msg = "ISO C does not support '++'/'--' on complex type '{s}'", .opt = W("pedantic"), .extra = .str, .kind = .off }, | |
| 989 | .{ .msg = "argument type '{s}' is not a real floating point type", .extra = .str, .kind = .@"error" }, | |
| 990 | .{ .msg = "arguments are of different types ({s})", .extra = .str, .kind = .@"error" }, | |
| 991 | .{ .msg = "#include resolved using non-portable Microsoft search rules as: {s}", .extra = .str, .opt = W("microsoft-include"), .kind = .warning }, | |
| 992 | .{ .msg = "treating Ctrl-Z as end-of-file is a Microsoft extension", .opt = W("microsoft-end-of-file"), .kind = .off, .pedantic = true }, | |
| 993 | .{ .msg = "illegal character encoding in character literal", .opt = W("invalid-source-encoding"), .kind = .warning }, | |
| 994 | .{ .msg = "illegal character encoding in character literal", .kind = .@"error" }, | |
| 995 | .{ .msg = "character '{c}' cannot be specified by a universal character name", .kind = .@"error", .extra = .ascii }, | |
| 996 | .{ .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") }, | |
| 997 | .{ .msg = "universal character name refers to a control character", .kind = .@"error" }, | |
| 998 | .{ .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") }, | |
| 999 | .{ .msg = "universal character names are only valid in C99 or later", .suppress_version = .c99, .kind = .warning, .opt = W("unicode") }, | |
| 1000 | .{ .msg = "multi-character character constant", .opt = W("four-char-constants"), .kind = .off }, | |
| 1001 | .{ .msg = "multi-character character constant", .kind = .off }, | |
| 1002 | .{ .msg = "\\{c} used with no following hex digits", .kind = .@"error", .extra = .ascii }, | |
| 1003 | .{ .msg = "unknown escape sequence '\\{s}'", .kind = .warning, .opt = W("unknown-escape-sequence"), .extra = .invalid_escape }, | |
| 1004 | .{ .msg = "attribute '{s}' requires an ordinary string", .kind = .@"error", .extra = .str }, | |
| 1005 | .{ .msg = "missing terminating '\"' character", .kind = .warning, .opt = W("invalid-pp-token") }, | |
| 1006 | .{ .msg = "missing terminating '\"' character", .kind = .@"error" }, | |
| 1007 | .{ .msg = "empty character constant", .kind = .warning, .opt = W("invalid-pp-token") }, | |
| 1008 | .{ .msg = "empty character constant", .kind = .@"error" }, | |
| 1009 | .{ .msg = "missing terminating ' character", .kind = .warning, .opt = W("invalid-pp-token") }, | |
| 1010 | .{ .msg = "missing terminating ' character", .kind = .@"error" }, | |
| 1011 | .{ .msg = "unterminated comment", .kind = .@"error" }, | |
| 1012 | .{ .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") }, | |
| 1013 | .{ .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") }, | |
| 1014 | .{ .msg = "unknown type name '{s}'", .kind = .@"error", .extra = .str }, | |
| 1015 | .{ .msg = "label at end of compound statement is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, | |
| 1016 | .{ .msg = "UTF-8 character literal is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, | |
| 1017 | .{ .msg = "unexpected token in embed parameter", .kind = .@"error" }, | |
| 1018 | .{ .msg = "the limit parameter expects one non-negative integer as a parameter", .kind = .@"error" }, | |
| 1019 | .{ .msg = "duplicate embed parameter '{s}'", .kind = .warning, .extra = .str, .opt = W("duplicate-embed-param") }, | |
| 1020 | .{ .msg = "unsupported embed parameter '{s}' embed parameter", .kind = .warning, .extra = .str, .opt = W("unsupported-embed-param") }, | |
| 1021 | .{ .msg = "compound literal cannot have {s} storage class", .kind = .@"error", .extra = .str }, | |
| 1022 | .{ .msg = "missing '(' following __VA_OPT__", .kind = .@"error" }, | |
| 1023 | .{ .msg = "unterminated __VA_OPT__ argument list", .kind = .@"error" }, | |
| 1024 | .{ .msg = "attribute value '{s}' out of range", .kind = .@"error", .extra = .str }, | |
| 1025 | .{ .msg = "'{s}' is not in NFC", .kind = .warning, .extra = .normalized, .opt = W("normalized") }, | |
| 1026 | .{ .msg = "'auto' requires a plain identifier declarator", .kind = .@"error" }, | |
| 1027 | .{ .msg = "'auto' can only be used with a single declarator", .kind = .@"error" }, | |
| 1028 | .{ .msg = "'auto' requires an initializer", .kind = .@"error" }, | |
| 1029 | .{ .msg = "'auto' requires a scalar initializer", .kind = .@"error" }, | |
| 1030 | .{ .msg = "shift count is negative", .opt = W("shift-count-negative"), .kind = .warning, .all = true }, | |
| 1031 | .{ .msg = "shift count >= width of type", .opt = W("shift-count-overflow"), .kind = .warning, .all = true }, | |
| 1032 | .{ .msg = "ISO C does not support '~' for complex conjugation of '{s}'", .opt = W("pedantic"), .extra = .str, .kind = .off }, | |
| 1033 | .{ .msg = "operand argument to overflow builtin must be an integer ('{s}' invalid)", .extra = .str, .kind = .@"error" }, | |
| 1034 | .{ .msg = "result argument to overflow builtin must be a pointer to a non-const integer ('{s}' invalid)", .extra = .str, .kind = .@"error" }, | |
| 1035 | .{ .msg = "TODO: implement '{s}' attribute for {s}", .extra = .attribute_todo, .kind = .@"error" }, | |
| 1036 | .{ .msg = "non-integral type '{s}' is an invalid underlying type", .extra = .str, .kind = .@"error" }, | |
| 1037 | .{ .msg = "variable '{s}' declared with deduced type '__auto_type' cannot appear in its own initializer", .extra = .str, .kind = .@"error" }, | |
| 1038 | }; | |
| 1039 | }; | |
| 1040 | }; | |
| 1041 | } |
lib/compiler/aro/aro/Driver.zig+866-215| ... | ... | @@ -2,17 +2,24 @@ const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | 3 | const Allocator = mem.Allocator; |
| 4 | 4 | const process = std.process; |
| 5 | ||
| 5 | 6 | const backend = @import("../backend.zig"); |
| 7 | const Assembly = backend.Assembly; | |
| 6 | 8 | const Ir = backend.Ir; |
| 7 | 9 | const Object = backend.Object; |
| 10 | ||
| 8 | 11 | const Compilation = @import("Compilation.zig"); |
| 9 | 12 | const Diagnostics = @import("Diagnostics.zig"); |
| 13 | const DepFile = @import("DepFile.zig"); | |
| 14 | const GCCVersion = @import("Driver/GCCVersion.zig"); | |
| 10 | 15 | const LangOpts = @import("LangOpts.zig"); |
| 11 | 16 | const Preprocessor = @import("Preprocessor.zig"); |
| 12 | 17 | const Source = @import("Source.zig"); |
| 13 | const Toolchain = @import("Toolchain.zig"); | |
| 14 | 18 | const target_util = @import("target.zig"); |
| 15 | const GCCVersion = @import("Driver/GCCVersion.zig"); | |
| 19 | const Toolchain = @import("Toolchain.zig"); | |
| 20 | const Tree = @import("Tree.zig"); | |
| 21 | ||
| 22 | const AsmCodeGenFn = fn (target: std.Target, tree: *const Tree) Compilation.Error!Assembly; | |
| 16 | 23 | |
| 17 | 24 | pub const Linker = enum { |
| 18 | 25 | ld, |
| ... | ... | @@ -22,13 +29,27 @@ pub const Linker = enum { |
| 22 | 29 | mold, |
| 23 | 30 | }; |
| 24 | 31 | |
| 32 | const pic_related_options = std.StaticStringMap(void).initComptime(.{ | |
| 33 | .{"-fpic"}, | |
| 34 | .{"-fno-pic"}, | |
| 35 | .{"-fPIC"}, | |
| 36 | .{"-fno-PIC"}, | |
| 37 | .{"-fpie"}, | |
| 38 | .{"-fno-pie"}, | |
| 39 | .{"-fPIE"}, | |
| 40 | .{"-fno-PIE"}, | |
| 41 | }); | |
| 42 | ||
| 25 | 43 | const Driver = @This(); |
| 26 | 44 | |
| 27 | 45 | comp: *Compilation, |
| 28 | inputs: std.ArrayListUnmanaged(Source) = .empty, | |
| 29 | link_objects: std.ArrayListUnmanaged([]const u8) = .empty, | |
| 46 | diagnostics: *Diagnostics, | |
| 47 | ||
| 48 | inputs: std.ArrayList(Source) = .empty, | |
| 49 | link_objects: std.ArrayList([]const u8) = .empty, | |
| 30 | 50 | output_name: ?[]const u8 = null, |
| 31 | 51 | sysroot: ?[]const u8 = null, |
| 52 | resource_dir: ?[]const u8 = null, | |
| 32 | 53 | system_defines: Compilation.SystemDefinesMode = .include_system_defines, |
| 33 | 54 | temp_file_count: u32 = 0, |
| 34 | 55 | /// If false, do not emit line directives in -E mode |
| ... | ... | @@ -43,10 +64,15 @@ verbose_ast: bool = false, |
| 43 | 64 | verbose_pp: bool = false, |
| 44 | 65 | verbose_ir: bool = false, |
| 45 | 66 | verbose_linker_args: bool = false, |
| 46 | color: ?bool = null, | |
| 47 | 67 | nobuiltininc: bool = false, |
| 48 | 68 | nostdinc: bool = false, |
| 49 | 69 | nostdlibinc: bool = false, |
| 70 | apple_kext: bool = false, | |
| 71 | mkernel: bool = false, | |
| 72 | mabicalls: ?bool = null, | |
| 73 | dynamic_nopic: ?bool = null, | |
| 74 | ropi: bool = false, | |
| 75 | rwpi: bool = false, | |
| 50 | 76 | debug_dump_letters: packed struct(u3) { |
| 51 | 77 | d: bool = false, |
| 52 | 78 | m: bool = false, |
| ... | ... | @@ -61,15 +87,26 @@ debug_dump_letters: packed struct(u3) { |
| 61 | 87 | return .result_only; |
| 62 | 88 | } |
| 63 | 89 | } = .{}, |
| 90 | dependencies: struct { | |
| 91 | m: bool = false, | |
| 92 | md: bool = false, | |
| 93 | format: DepFile.Format = .make, | |
| 94 | file: ?[]const u8 = null, | |
| 95 | } = .{}, | |
| 64 | 96 | |
| 65 | 97 | /// Full path to the aro executable |
| 66 | 98 | aro_name: []const u8 = "", |
| 67 | 99 | |
| 68 | /// Value of --triple= passed via CLI | |
| 100 | /// Value of -target passed via CLI | |
| 69 | 101 | raw_target_triple: ?[]const u8 = null, |
| 70 | 102 | |
| 103 | /// Value of -mcpu passed via CLI | |
| 104 | raw_cpu: ?[]const u8 = null, | |
| 105 | ||
| 106 | /// Non-optimizing assembly backend is currently selected by passing `-O0` | |
| 107 | use_assembly_backend: bool = false, | |
| 108 | ||
| 71 | 109 | // linker options |
| 72 | use_linker: ?[]const u8 = null, | |
| 73 | 110 | linker_path: ?[]const u8 = null, |
| 74 | 111 | nodefaultlibs: bool = false, |
| 75 | 112 | nolibc: bool = false, |
| ... | ... | @@ -101,20 +138,36 @@ pub const usage = |
| 101 | 138 | \\Usage {s}: [options] file.. |
| 102 | 139 | \\ |
| 103 | 140 | \\General options: |
| 104 | \\ -h, --help Print this message. | |
| 105 | \\ -v, --version Print aro version. | |
| 141 | \\ --help Print this message | |
| 142 | \\ --version Print aro version | |
| 106 | 143 | \\ |
| 107 | \\Compile options: | |
| 108 | \\ -c, --compile Only run preprocess, compile, and assemble steps | |
| 144 | \\Preprocessor options: | |
| 145 | \\ -C Do not discard comments | |
| 146 | \\ -CC Do not discard comments, including in macro expansions | |
| 109 | 147 | \\ -dM Output #define directives for all the macros defined during the execution of the preprocessor |
| 110 | 148 | \\ -dD Like -dM except that it outputs both the #define directives and the result of preprocessing |
| 111 | 149 | \\ -dN Like -dD, but emit only the macro names, not their expansions. |
| 112 | 150 | \\ -D <macro>=<value> Define <macro> to <value> (defaults to 1) |
| 113 | 151 | \\ -E Only run the preprocessor |
| 152 | \\ -fdollars-in-identifiers | |
| 153 | \\ Allow '$' in identifiers | |
| 154 | \\ -fno-dollars-in-identifiers | |
| 155 | \\ Disallow '$' in identifiers | |
| 156 | \\ -M Output dependency file instead of preprocessing result | |
| 157 | \\ -MD Like -M except -E is not implied | |
| 158 | \\ -MF <file> Write dependency file to <file> | |
| 159 | \\ -MV Use NMake/Jom format for dependency file | |
| 160 | \\ -P, --no-line-commands Disable linemarker output in -E mode | |
| 161 | \\ | |
| 162 | \\Compile options: | |
| 163 | \\ -c, --compile Only run preprocess, compile, and assemble steps | |
| 164 | \\ -fapple-kext Use Apple's kernel extensions ABI | |
| 114 | 165 | \\ -fchar8_t Enable char8_t (enabled by default in C23 and later) |
| 115 | 166 | \\ -fno-char8_t Disable char8_t (disabled by default for pre-C23) |
| 116 | 167 | \\ -fcolor-diagnostics Enable colors in diagnostics |
| 117 | 168 | \\ -fno-color-diagnostics Disable colors in diagnostics |
| 169 | \\ -fcommon Place uninitialized global variables in a common block | |
| 170 | \\ -fno-common Place uninitialized global variables in the BSS section of the object file | |
| 118 | 171 | \\ -fdeclspec Enable support for __declspec attributes |
| 119 | 172 | \\ -fgnuc-version=<value> Controls value of __GNUC__ and related macros. Set to 0 or empty to disable them. |
| 120 | 173 | \\ -fno-declspec Disable support for __declspec attributes |
| ... | ... | @@ -126,15 +179,20 @@ pub const usage = |
| 126 | 179 | \\ -fhosted Compilation in a hosted environment |
| 127 | 180 | \\ -fms-extensions Enable support for Microsoft extensions |
| 128 | 181 | \\ -fno-ms-extensions Disable support for Microsoft extensions |
| 129 | \\ -fdollars-in-identifiers | |
| 130 | \\ Allow '$' in identifiers | |
| 131 | \\ -fno-dollars-in-identifiers | |
| 132 | \\ Disallow '$' in identifiers | |
| 182 | \\ -g Generate debug information | |
| 133 | 183 | \\ -fmacro-backtrace-limit=<limit> |
| 134 | 184 | \\ Set limit on how many macro expansion traces are shown in errors (default 6) |
| 135 | 185 | \\ -fnative-half-type Use the native half type for __fp16 instead of promoting to float |
| 136 | 186 | \\ -fnative-half-arguments-and-returns |
| 137 | 187 | \\ Allow half-precision function arguments and return values |
| 188 | \\ -fpic Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine | |
| 189 | \\ -fPIC Similar to -fpic but avoid any limit on the size of the global offset table | |
| 190 | \\ -fpie Similar to -fpic, but the generated position-independent code can only be linked into executables | |
| 191 | \\ -fPIE Similar to -fPIC, but the generated position-independent code can only be linked into executables | |
| 192 | \\ -frwpi Generate read-write position independent code (ARM only) | |
| 193 | \\ -fno-rwpi Disable generate read-write position independent code (ARM only). | |
| 194 | \\ -fropi Generate read-only position independent code (ARM only) | |
| 195 | \\ -fno-ropi Disable generate read-only position independent code (ARM only). | |
| 138 | 196 | \\ -fshort-enums Use the narrowest possible integer type for enums |
| 139 | 197 | \\ -fno-short-enums Use "int" as the tag type for enums |
| 140 | 198 | \\ -fsigned-char "char" is signed |
| ... | ... | @@ -145,17 +203,28 @@ pub const usage = |
| 145 | 203 | \\ -fuse-line-directives Use `#line <num>` linemarkers in preprocessed output |
| 146 | 204 | \\ -fno-use-line-directives |
| 147 | 205 | \\ Use `# <num>` linemarkers in preprocessed output |
| 206 | \\ -iquote <dir> Add directory to QUOTE include search path | |
| 148 | 207 | \\ -I <dir> Add directory to include search path |
| 149 | \\ -isystem Add directory to SYSTEM include search path | |
| 208 | \\ -idirafter <dir> Add directory to AFTER include search path | |
| 209 | \\ -isystem <dir> Add directory to SYSTEM include search path | |
| 210 | \\ -F <dir> Add directory to macOS framework search path | |
| 211 | \\ -iframework <dir> Add directory to SYSTEM macOS framework search path | |
| 212 | \\ --embed-dir=<dir> Add directory to `#embed` search path | |
| 150 | 213 | \\ --emulate=[clang|gcc|msvc] |
| 151 | 214 | \\ Select which C compiler to emulate (default clang) |
| 215 | \\ -mabicalls Enable SVR4-style position-independent code (Mips only) | |
| 216 | \\ -mno-abicalls Disable SVR4-style position-independent code (Mips only) | |
| 217 | \\ -mcmodel=<code-model> Generate code for the given code model | |
| 218 | \\ -mcpu [cpu] Specify target CPU and feature set | |
| 219 | \\ -mkernel Enable kernel development mode | |
| 152 | 220 | \\ -nobuiltininc Do not search the compiler's builtin directory for include files |
| 221 | \\ -resource-dir <dir> Override the path to the compiler's builtin resource directory | |
| 153 | 222 | \\ -nostdinc, --no-standard-includes |
| 154 | 223 | \\ Do not search the standard system directories or compiler builtin directories for include files. |
| 155 | 224 | \\ -nostdlibinc Do not search the standard system directories for include files, but do search compiler builtin include directories |
| 156 | 225 | \\ -o <file> Write output to <file> |
| 157 | \\ -P, --no-line-commands Disable linemarker output in -E mode | |
| 158 | 226 | \\ -pedantic Warn on language extensions |
| 227 | \\ -pedantic-errors Error on language extensions | |
| 159 | 228 | \\ --rtlib=<arg> Compiler runtime library to use (libgcc or compiler-rt) |
| 160 | 229 | \\ -std=<standard> Specify language standard |
| 161 | 230 | \\ -S, --assemble Only run preprocess and compilation steps |
| ... | ... | @@ -163,6 +232,7 @@ pub const usage = |
| 163 | 232 | \\ --target=<value> Generate code for the given target |
| 164 | 233 | \\ -U <macro> Undefine <macro> |
| 165 | 234 | \\ -undef Do not predefine any system-specific macros. Standard predefined macros remain defined. |
| 235 | \\ -w Ignore all warnings | |
| 166 | 236 | \\ -Werror Treat all warnings as errors |
| 167 | 237 | \\ -Werror=<warning> Treat warning as error |
| 168 | 238 | \\ -W<warning> Enable the specified warning |
| ... | ... | @@ -199,33 +269,37 @@ pub const usage = |
| 199 | 269 | /// Process command line arguments, returns true if something was written to std_out. |
| 200 | 270 | pub fn parseArgs( |
| 201 | 271 | d: *Driver, |
| 202 | std_out: anytype, | |
| 203 | macro_buf: anytype, | |
| 272 | stdout: *std.Io.Writer, | |
| 273 | macro_buf: *std.ArrayList(u8), | |
| 204 | 274 | args: []const []const u8, |
| 205 | ) !bool { | |
| 275 | ) (Compilation.Error || std.Io.Writer.Error)!bool { | |
| 206 | 276 | var i: usize = 1; |
| 207 | 277 | var comment_arg: []const u8 = ""; |
| 208 | 278 | var hosted: ?bool = null; |
| 209 | var gnuc_version: []const u8 = "4.2.1"; // default value set by clang | |
| 279 | var gnuc_version: ?[]const u8 = null; | |
| 280 | var pic_arg: []const u8 = ""; | |
| 281 | var declspec_attrs: ?bool = null; | |
| 282 | var ms_extensions: ?bool = null; | |
| 283 | var strip = true; | |
| 284 | var debug: ?backend.CodeGenOptions.DebugFormat = null; | |
| 285 | var emulate: ?LangOpts.Compiler = null; | |
| 210 | 286 | while (i < args.len) : (i += 1) { |
| 211 | 287 | const arg = args[i]; |
| 212 | if (mem.startsWith(u8, arg, "-") and arg.len > 1) { | |
| 213 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { | |
| 214 | std_out.print(usage, .{args[0]}) catch |er| { | |
| 215 | return d.fatal("unable to print usage: {s}", .{errorDescription(er)}); | |
| 216 | }; | |
| 288 | if (arg.len > 1 and arg[0] == '-') { | |
| 289 | if (mem.eql(u8, arg, "--help")) { | |
| 290 | try stdout.print(usage, .{args[0]}); | |
| 291 | try stdout.flush(); | |
| 217 | 292 | return true; |
| 218 | } else if (mem.eql(u8, arg, "-v") or mem.eql(u8, arg, "--version")) { | |
| 219 | std_out.writeAll(@import("../backend.zig").version_str ++ "\n") catch |er| { | |
| 220 | return d.fatal("unable to print version: {s}", .{errorDescription(er)}); | |
| 221 | }; | |
| 293 | } else if (mem.eql(u8, arg, "--version")) { | |
| 294 | try stdout.writeAll(@import("../backend.zig").version_str ++ "\n"); | |
| 295 | try stdout.flush(); | |
| 222 | 296 | return true; |
| 223 | 297 | } else if (mem.startsWith(u8, arg, "-D")) { |
| 224 | 298 | var macro = arg["-D".len..]; |
| 225 | 299 | if (macro.len == 0) { |
| 226 | 300 | i += 1; |
| 227 | 301 | if (i >= args.len) { |
| 228 | try d.err("expected argument after -I"); | |
| 302 | try d.err("expected argument after -D", .{}); | |
| 229 | 303 | continue; |
| 230 | 304 | } |
| 231 | 305 | macro = args[i]; |
| ... | ... | @@ -235,18 +309,26 @@ pub fn parseArgs( |
| 235 | 309 | value = macro[some + 1 ..]; |
| 236 | 310 | macro = macro[0..some]; |
| 237 | 311 | } |
| 238 | try macro_buf.print("#define {s} {s}\n", .{ macro, value }); | |
| 312 | try macro_buf.print(d.comp.gpa, "#define {s} {s}\n", .{ macro, value }); | |
| 239 | 313 | } else if (mem.startsWith(u8, arg, "-U")) { |
| 240 | 314 | var macro = arg["-U".len..]; |
| 241 | 315 | if (macro.len == 0) { |
| 242 | 316 | i += 1; |
| 243 | 317 | if (i >= args.len) { |
| 244 | try d.err("expected argument after -I"); | |
| 318 | try d.err("expected argument after -U", .{}); | |
| 245 | 319 | continue; |
| 246 | 320 | } |
| 247 | 321 | macro = args[i]; |
| 248 | 322 | } |
| 249 | try macro_buf.print("#undef {s}\n", .{macro}); | |
| 323 | try macro_buf.print(d.comp.gpa, "#undef {s}\n", .{macro}); | |
| 324 | } else if (mem.eql(u8, arg, "-O")) { | |
| 325 | d.comp.code_gen_options.optimization_level = .@"1"; | |
| 326 | } else if (mem.startsWith(u8, arg, "-O")) { | |
| 327 | d.comp.code_gen_options.optimization_level = backend.CodeGenOptions.OptimizationLevel.fromString(arg["-O".len..]) orelse { | |
| 328 | try d.err("invalid optimization level '{s}'", .{arg}); | |
| 329 | continue; | |
| 330 | }; | |
| 331 | d.use_assembly_backend = d.comp.code_gen_options.optimization_level == .@"0"; | |
| 250 | 332 | } else if (mem.eql(u8, arg, "-undef")) { |
| 251 | 333 | d.system_defines = .no_system_defines; |
| 252 | 334 | } else if (mem.eql(u8, arg, "-c") or mem.eql(u8, arg, "--compile")) { |
| ... | ... | @@ -265,38 +347,124 @@ pub fn parseArgs( |
| 265 | 347 | d.use_line_directives = true; |
| 266 | 348 | } else if (mem.eql(u8, arg, "-fno-use-line-directives")) { |
| 267 | 349 | d.use_line_directives = false; |
| 350 | } else if (mem.eql(u8, arg, "-fapple-kext")) { | |
| 351 | d.apple_kext = true; | |
| 352 | } else if (option(arg, "-mcmodel=")) |cmodel| { | |
| 353 | d.comp.cmodel = std.meta.stringToEnum(std.builtin.CodeModel, cmodel) orelse | |
| 354 | return d.fatal("unsupported machine code model: '{s}'", .{arg}); | |
| 355 | } else if (mem.eql(u8, arg, "-mkernel")) { | |
| 356 | d.mkernel = true; | |
| 357 | } else if (mem.eql(u8, arg, "-mdynamic-no-pic")) { | |
| 358 | d.dynamic_nopic = true; | |
| 359 | } else if (mem.eql(u8, arg, "-mabicalls")) { | |
| 360 | d.mabicalls = true; | |
| 361 | } else if (mem.eql(u8, arg, "-mno-abicalls")) { | |
| 362 | d.mabicalls = false; | |
| 363 | } else if (mem.eql(u8, arg, "-mcpu")) { | |
| 364 | i += 1; | |
| 365 | if (i >= args.len) { | |
| 366 | try d.err("expected argument after -mcpu", .{}); | |
| 367 | continue; | |
| 368 | } | |
| 369 | d.raw_cpu = args[i]; | |
| 370 | } else if (option(arg, "-mcpu=")) |cpu| { | |
| 371 | d.raw_cpu = cpu; | |
| 372 | } else if (mem.eql(u8, arg, "-M") or mem.eql(u8, arg, "--dependencies")) { | |
| 373 | d.dependencies.m = true; | |
| 374 | // -M implies -w and -E | |
| 375 | d.diagnostics.state.ignore_warnings = true; | |
| 376 | d.only_preprocess = true; | |
| 377 | } else if (mem.eql(u8, arg, "-MD") or mem.eql(u8, arg, "--write-dependencies")) { | |
| 378 | d.dependencies.md = true; | |
| 379 | } else if (mem.startsWith(u8, arg, "-MF")) { | |
| 380 | var path = arg["-MF".len..]; | |
| 381 | if (path.len == 0) { | |
| 382 | i += 1; | |
| 383 | if (i >= args.len) { | |
| 384 | try d.err("expected argument after -MF", .{}); | |
| 385 | continue; | |
| 386 | } | |
| 387 | path = args[i]; | |
| 388 | } | |
| 389 | d.dependencies.file = path; | |
| 390 | } else if (mem.eql(u8, arg, "-MV")) { | |
| 391 | d.dependencies.format = .nmake; | |
| 268 | 392 | } else if (mem.eql(u8, arg, "-fchar8_t")) { |
| 269 | 393 | d.comp.langopts.has_char8_t_override = true; |
| 270 | 394 | } else if (mem.eql(u8, arg, "-fno-char8_t")) { |
| 271 | 395 | d.comp.langopts.has_char8_t_override = false; |
| 272 | 396 | } else if (mem.eql(u8, arg, "-fcolor-diagnostics")) { |
| 273 | d.color = true; | |
| 397 | d.diagnostics.color = true; | |
| 274 | 398 | } else if (mem.eql(u8, arg, "-fno-color-diagnostics")) { |
| 275 | d.color = false; | |
| 399 | d.diagnostics.color = false; | |
| 400 | } else if (mem.eql(u8, arg, "-fcaret-diagnostics")) { | |
| 401 | d.diagnostics.details = true; | |
| 402 | } else if (mem.eql(u8, arg, "-fno-caret-diagnostics")) { | |
| 403 | d.diagnostics.details = false; | |
| 404 | } else if (mem.eql(u8, arg, "-fcommon")) { | |
| 405 | d.comp.code_gen_options.common = true; | |
| 406 | } else if (mem.eql(u8, arg, "-fno-common")) { | |
| 407 | d.comp.code_gen_options.common = false; | |
| 276 | 408 | } else if (mem.eql(u8, arg, "-fdollars-in-identifiers")) { |
| 277 | 409 | d.comp.langopts.dollars_in_identifiers = true; |
| 278 | 410 | } else if (mem.eql(u8, arg, "-fno-dollars-in-identifiers")) { |
| 279 | 411 | d.comp.langopts.dollars_in_identifiers = false; |
| 412 | } else if (mem.eql(u8, arg, "-g")) { | |
| 413 | strip = false; | |
| 414 | } else if (mem.eql(u8, arg, "-g0")) { | |
| 415 | strip = true; | |
| 416 | } else if (mem.eql(u8, arg, "-gcodeview")) { | |
| 417 | debug = .code_view; | |
| 418 | } else if (mem.eql(u8, arg, "-gdwarf32")) { | |
| 419 | debug = .{ .dwarf = .@"32" }; | |
| 420 | } else if (mem.eql(u8, arg, "-gdwarf64")) { | |
| 421 | debug = .{ .dwarf = .@"64" }; | |
| 422 | } else if (mem.eql(u8, arg, "-gdwarf") or | |
| 423 | mem.eql(u8, arg, "-gdwarf-2") or | |
| 424 | mem.eql(u8, arg, "-gdwarf-3") or | |
| 425 | mem.eql(u8, arg, "-gdwarf-4") or | |
| 426 | mem.eql(u8, arg, "-gdwarf-5")) | |
| 427 | { | |
| 428 | d.comp.code_gen_options.dwarf_version = switch (arg[arg.len - 1]) { | |
| 429 | '2' => .@"2", | |
| 430 | '3' => .@"3", | |
| 431 | '4' => .@"4", | |
| 432 | '5' => .@"5", | |
| 433 | else => .@"0", | |
| 434 | }; | |
| 435 | if (debug == null or debug.? != .dwarf) { | |
| 436 | debug = .{ .dwarf = .@"32" }; | |
| 437 | } | |
| 280 | 438 | } else if (mem.eql(u8, arg, "-fdigraphs")) { |
| 281 | 439 | d.comp.langopts.digraphs = true; |
| 440 | } else if (mem.eql(u8, arg, "-fno-digraphs")) { | |
| 441 | d.comp.langopts.digraphs = false; | |
| 282 | 442 | } else if (mem.eql(u8, arg, "-fgnu-inline-asm")) { |
| 283 | 443 | d.comp.langopts.gnu_asm = true; |
| 284 | 444 | } else if (mem.eql(u8, arg, "-fno-gnu-inline-asm")) { |
| 285 | 445 | d.comp.langopts.gnu_asm = false; |
| 286 | } else if (mem.eql(u8, arg, "-fno-digraphs")) { | |
| 287 | d.comp.langopts.digraphs = false; | |
| 288 | 446 | } else if (option(arg, "-fmacro-backtrace-limit=")) |limit_str| { |
| 289 | 447 | var limit = std.fmt.parseInt(u32, limit_str, 10) catch { |
| 290 | try d.err("-fmacro-backtrace-limit takes a number argument"); | |
| 448 | try d.err("-fmacro-backtrace-limit takes a number argument", .{}); | |
| 291 | 449 | continue; |
| 292 | 450 | }; |
| 293 | 451 | |
| 294 | 452 | if (limit == 0) limit = std.math.maxInt(u32); |
| 295 | d.comp.diagnostics.macro_backtrace_limit = limit; | |
| 453 | d.diagnostics.macro_backtrace_limit = limit; | |
| 296 | 454 | } else if (mem.eql(u8, arg, "-fnative-half-type")) { |
| 297 | 455 | d.comp.langopts.use_native_half_type = true; |
| 298 | 456 | } else if (mem.eql(u8, arg, "-fnative-half-arguments-and-returns")) { |
| 299 | 457 | d.comp.langopts.allow_half_args_and_returns = true; |
| 458 | } else if (pic_related_options.has(arg)) { | |
| 459 | pic_arg = arg; | |
| 460 | } else if (mem.eql(u8, arg, "-fropi")) { | |
| 461 | d.ropi = true; | |
| 462 | } else if (mem.eql(u8, arg, "-fno-ropi")) { | |
| 463 | d.ropi = false; | |
| 464 | } else if (mem.eql(u8, arg, "-frwpi")) { | |
| 465 | d.rwpi = true; | |
| 466 | } else if (mem.eql(u8, arg, "-fno-rwpi")) { | |
| 467 | d.rwpi = false; | |
| 300 | 468 | } else if (mem.eql(u8, arg, "-fshort-enums")) { |
| 301 | 469 | d.comp.langopts.short_enums = true; |
| 302 | 470 | } else if (mem.eql(u8, arg, "-fno-short-enums")) { |
| ... | ... | @@ -310,59 +478,103 @@ pub fn parseArgs( |
| 310 | 478 | } else if (mem.eql(u8, arg, "-fno-unsigned-char")) { |
| 311 | 479 | d.comp.langopts.setCharSignedness(.signed); |
| 312 | 480 | } else if (mem.eql(u8, arg, "-fdeclspec")) { |
| 313 | d.comp.langopts.declspec_attrs = true; | |
| 481 | declspec_attrs = true; | |
| 314 | 482 | } else if (mem.eql(u8, arg, "-fno-declspec")) { |
| 315 | d.comp.langopts.declspec_attrs = false; | |
| 483 | declspec_attrs = false; | |
| 316 | 484 | } else if (mem.eql(u8, arg, "-ffreestanding")) { |
| 317 | 485 | hosted = false; |
| 318 | 486 | } else if (mem.eql(u8, arg, "-fhosted")) { |
| 319 | 487 | hosted = true; |
| 320 | 488 | } else if (mem.eql(u8, arg, "-fms-extensions")) { |
| 321 | d.comp.langopts.enableMSExtensions(); | |
| 489 | ms_extensions = true; | |
| 322 | 490 | } else if (mem.eql(u8, arg, "-fno-ms-extensions")) { |
| 323 | d.comp.langopts.disableMSExtensions(); | |
| 491 | ms_extensions = false; | |
| 492 | } else if (mem.eql(u8, arg, "-fsyntax-only")) { | |
| 493 | d.only_syntax = true; | |
| 494 | } else if (mem.eql(u8, arg, "-fno-syntax-only")) { | |
| 495 | d.only_syntax = false; | |
| 496 | } else if (mem.eql(u8, arg, "-fgnuc-version=")) { | |
| 497 | gnuc_version = "0"; | |
| 498 | } else if (option(arg, "-fgnuc-version=")) |version| { | |
| 499 | gnuc_version = version; | |
| 324 | 500 | } else if (mem.startsWith(u8, arg, "-I")) { |
| 325 | 501 | var path = arg["-I".len..]; |
| 326 | 502 | if (path.len == 0) { |
| 327 | 503 | i += 1; |
| 328 | 504 | if (i >= args.len) { |
| 329 | try d.err("expected argument after -I"); | |
| 505 | try d.err("expected argument after -I", .{}); | |
| 330 | 506 | continue; |
| 331 | 507 | } |
| 332 | 508 | path = args[i]; |
| 333 | 509 | } |
| 334 | 510 | try d.comp.include_dirs.append(d.comp.gpa, path); |
| 335 | } else if (mem.startsWith(u8, arg, "-fsyntax-only")) { | |
| 336 | d.only_syntax = true; | |
| 337 | } else if (mem.startsWith(u8, arg, "-fno-syntax-only")) { | |
| 338 | d.only_syntax = false; | |
| 339 | } else if (mem.eql(u8, arg, "-fgnuc-version=")) { | |
| 340 | gnuc_version = "0"; | |
| 341 | } else if (option(arg, "-fgnuc-version=")) |version| { | |
| 342 | gnuc_version = version; | |
| 511 | } else if (mem.startsWith(u8, arg, "-idirafter")) { | |
| 512 | var path = arg["-idirafter".len..]; | |
| 513 | if (path.len == 0) { | |
| 514 | i += 1; | |
| 515 | if (i >= args.len) { | |
| 516 | try d.err("expected argument after -idirafter", .{}); | |
| 517 | continue; | |
| 518 | } | |
| 519 | path = args[i]; | |
| 520 | } | |
| 521 | try d.comp.after_include_dirs.append(d.comp.gpa, path); | |
| 343 | 522 | } else if (mem.startsWith(u8, arg, "-isystem")) { |
| 344 | 523 | var path = arg["-isystem".len..]; |
| 345 | 524 | if (path.len == 0) { |
| 346 | 525 | i += 1; |
| 347 | 526 | if (i >= args.len) { |
| 348 | try d.err("expected argument after -isystem"); | |
| 527 | try d.err("expected argument after -isystem", .{}); | |
| 349 | 528 | continue; |
| 350 | 529 | } |
| 351 | 530 | path = args[i]; |
| 352 | 531 | } |
| 353 | const duped = try d.comp.gpa.dupe(u8, path); | |
| 354 | errdefer d.comp.gpa.free(duped); | |
| 355 | try d.comp.system_include_dirs.append(d.comp.gpa, duped); | |
| 532 | try d.comp.system_include_dirs.append(d.comp.gpa, path); | |
| 533 | } else if (mem.startsWith(u8, arg, "-iquote")) { | |
| 534 | var path = arg["-iquote".len..]; | |
| 535 | if (path.len == 0) { | |
| 536 | i += 1; | |
| 537 | if (i >= args.len) { | |
| 538 | try d.err("expected argument after -iquote", .{}); | |
| 539 | continue; | |
| 540 | } | |
| 541 | path = args[i]; | |
| 542 | } | |
| 543 | try d.comp.iquote_include_dirs.append(d.comp.gpa, path); | |
| 544 | } else if (mem.startsWith(u8, arg, "-F")) { | |
| 545 | var path = arg["-F".len..]; | |
| 546 | if (path.len == 0) { | |
| 547 | i += 1; | |
| 548 | if (i >= args.len) { | |
| 549 | try d.err("expected argument after -F", .{}); | |
| 550 | continue; | |
| 551 | } | |
| 552 | path = args[i]; | |
| 553 | } | |
| 554 | try d.comp.framework_dirs.append(d.comp.gpa, path); | |
| 555 | } else if (mem.startsWith(u8, arg, "-iframework")) { | |
| 556 | var path = arg["-iframework".len..]; | |
| 557 | if (path.len == 0) { | |
| 558 | i += 1; | |
| 559 | if (i >= args.len) { | |
| 560 | try d.err("expected argument after -iframework", .{}); | |
| 561 | continue; | |
| 562 | } | |
| 563 | path = args[i]; | |
| 564 | } | |
| 565 | try d.comp.system_framework_dirs.append(d.comp.gpa, path); | |
| 566 | } else if (option(arg, "--embed-dir=")) |path| { | |
| 567 | try d.comp.embed_dirs.append(d.comp.gpa, path); | |
| 356 | 568 | } else if (option(arg, "--emulate=")) |compiler_str| { |
| 357 | 569 | const compiler = std.meta.stringToEnum(LangOpts.Compiler, compiler_str) orelse { |
| 358 | try d.comp.addDiagnostic(.{ .tag = .cli_invalid_emulate, .extra = .{ .str = arg } }, &.{}); | |
| 570 | try d.err("invalid compiler '{s}'", .{arg}); | |
| 359 | 571 | continue; |
| 360 | 572 | }; |
| 361 | d.comp.langopts.setEmulatedCompiler(compiler); | |
| 573 | emulate = compiler; | |
| 362 | 574 | } else if (option(arg, "-ffp-eval-method=")) |fp_method_str| { |
| 363 | 575 | const fp_eval_method = std.meta.stringToEnum(LangOpts.FPEvalMethod, fp_method_str) orelse .indeterminate; |
| 364 | 576 | if (fp_eval_method == .indeterminate) { |
| 365 | try d.comp.addDiagnostic(.{ .tag = .cli_invalid_fp_eval_method, .extra = .{ .str = fp_method_str } }, &.{}); | |
| 577 | try d.err("unsupported argument '{s}' to option '-ffp-eval-method='; expected 'source', 'double', or 'extended'", .{fp_method_str}); | |
| 366 | 578 | continue; |
| 367 | 579 | } |
| 368 | 580 | d.comp.langopts.setFpEvalMethod(fp_eval_method); |
| ... | ... | @@ -371,7 +583,7 @@ pub fn parseArgs( |
| 371 | 583 | if (file.len == 0) { |
| 372 | 584 | i += 1; |
| 373 | 585 | if (i >= args.len) { |
| 374 | try d.err("expected argument after -o"); | |
| 586 | try d.err("expected argument after -o", .{}); | |
| 375 | 587 | continue; |
| 376 | 588 | } |
| 377 | 589 | file = args[i]; |
| ... | ... | @@ -380,39 +592,58 @@ pub fn parseArgs( |
| 380 | 592 | } else if (option(arg, "--sysroot=")) |sysroot| { |
| 381 | 593 | d.sysroot = sysroot; |
| 382 | 594 | } else if (mem.eql(u8, arg, "-pedantic")) { |
| 383 | d.comp.diagnostics.options.pedantic = .warning; | |
| 595 | d.diagnostics.state.extensions = .warning; | |
| 596 | } else if (mem.eql(u8, arg, "-pedantic-errors")) { | |
| 597 | d.diagnostics.state.extensions = .@"error"; | |
| 598 | } else if (mem.eql(u8, arg, "-w")) { | |
| 599 | d.diagnostics.state.ignore_warnings = true; | |
| 384 | 600 | } else if (option(arg, "--rtlib=")) |rtlib| { |
| 385 | 601 | if (mem.eql(u8, rtlib, "compiler-rt") or mem.eql(u8, rtlib, "libgcc") or mem.eql(u8, rtlib, "platform")) { |
| 386 | 602 | d.rtlib = rtlib; |
| 387 | 603 | } else { |
| 388 | try d.comp.addDiagnostic(.{ .tag = .invalid_rtlib, .extra = .{ .str = rtlib } }, &.{}); | |
| 604 | try d.err("invalid runtime library name '{s}'", .{rtlib}); | |
| 389 | 605 | } |
| 390 | } else if (option(arg, "-Werror=")) |err_name| { | |
| 391 | try d.comp.diagnostics.set(err_name, .@"error"); | |
| 392 | 606 | } else if (mem.eql(u8, arg, "-Wno-fatal-errors")) { |
| 393 | d.comp.diagnostics.fatal_errors = false; | |
| 394 | } else if (option(arg, "-Wno-")) |err_name| { | |
| 395 | try d.comp.diagnostics.set(err_name, .off); | |
| 607 | d.diagnostics.state.fatal_errors = false; | |
| 396 | 608 | } else if (mem.eql(u8, arg, "-Wfatal-errors")) { |
| 397 | d.comp.diagnostics.fatal_errors = true; | |
| 609 | d.diagnostics.state.fatal_errors = true; | |
| 610 | } else if (mem.eql(u8, arg, "-Wno-everything")) { | |
| 611 | d.diagnostics.state.enable_all_warnings = false; | |
| 612 | } else if (mem.eql(u8, arg, "-Weverything")) { | |
| 613 | d.diagnostics.state.enable_all_warnings = true; | |
| 614 | } else if (mem.eql(u8, arg, "-Wno-system-headers")) { | |
| 615 | d.diagnostics.state.suppress_system_headers = true; | |
| 616 | } else if (mem.eql(u8, arg, "-Wsystem-headers")) { | |
| 617 | d.diagnostics.state.suppress_system_headers = false; | |
| 618 | } else if (mem.eql(u8, arg, "-Werror")) { | |
| 619 | d.diagnostics.state.error_warnings = true; | |
| 620 | } else if (mem.eql(u8, arg, "-Wno-error")) { | |
| 621 | d.diagnostics.state.error_warnings = false; | |
| 622 | } else if (option(arg, "-Werror=")) |err_name| { | |
| 623 | try d.diagnostics.set(err_name, .@"error"); | |
| 624 | } else if (option(arg, "-Wno-error=")) |err_name| { | |
| 625 | // TODO this should not set to warning if the option has not been specified. | |
| 626 | try d.diagnostics.set(err_name, .warning); | |
| 627 | } else if (option(arg, "-Wno-")) |err_name| { | |
| 628 | try d.diagnostics.set(err_name, .off); | |
| 398 | 629 | } else if (option(arg, "-W")) |err_name| { |
| 399 | try d.comp.diagnostics.set(err_name, .warning); | |
| 630 | try d.diagnostics.set(err_name, .warning); | |
| 400 | 631 | } else if (option(arg, "-std=")) |standard| { |
| 401 | 632 | d.comp.langopts.setStandard(standard) catch |
| 402 | try d.comp.addDiagnostic(.{ .tag = .cli_invalid_standard, .extra = .{ .str = arg } }, &.{}); | |
| 633 | try d.err("invalid standard '{s}'", .{arg}); | |
| 403 | 634 | } else if (mem.eql(u8, arg, "-S") or mem.eql(u8, arg, "--assemble")) { |
| 404 | 635 | d.only_preprocess_and_compile = true; |
| 405 | } else if (option(arg, "--target=")) |triple| { | |
| 406 | const query = std.Target.Query.parse(.{ .arch_os_abi = triple }) catch { | |
| 407 | try d.comp.addDiagnostic(.{ .tag = .cli_invalid_target, .extra = .{ .str = arg } }, &.{}); | |
| 636 | } else if (mem.eql(u8, arg, "-target")) { | |
| 637 | i += 1; | |
| 638 | if (i >= args.len) { | |
| 639 | try d.err("expected argument after -target", .{}); | |
| 408 | 640 | continue; |
| 409 | }; | |
| 410 | const target = std.zig.system.resolveTargetQuery(query) catch |e| { | |
| 411 | return d.fatal("unable to resolve target: {s}", .{errorDescription(e)}); | |
| 412 | }; | |
| 413 | d.comp.target = target; | |
| 414 | d.comp.langopts.setEmulatedCompiler(target_util.systemCompiler(target)); | |
| 641 | } | |
| 642 | d.raw_target_triple = args[i]; | |
| 643 | emulate = null; | |
| 644 | } else if (option(arg, "--target=")) |triple| { | |
| 415 | 645 | d.raw_target_triple = triple; |
| 646 | emulate = null; | |
| 416 | 647 | } else if (mem.eql(u8, arg, "--verbose-ast")) { |
| 417 | 648 | d.verbose_ast = true; |
| 418 | 649 | } else if (mem.eql(u8, arg, "--verbose-pp")) { |
| ... | ... | @@ -428,10 +659,6 @@ pub fn parseArgs( |
| 428 | 659 | d.comp.langopts.preserve_comments = true; |
| 429 | 660 | d.comp.langopts.preserve_comments_in_macros = true; |
| 430 | 661 | comment_arg = arg; |
| 431 | } else if (option(arg, "-fuse-ld=")) |linker_name| { | |
| 432 | d.use_linker = linker_name; | |
| 433 | } else if (mem.eql(u8, arg, "-fuse-ld=")) { | |
| 434 | d.use_linker = null; | |
| 435 | 662 | } else if (option(arg, "--ld-path=")) |linker_path| { |
| 436 | 663 | d.linker_path = linker_path; |
| 437 | 664 | } else if (mem.eql(u8, arg, "-r")) { |
| ... | ... | @@ -460,6 +687,13 @@ pub fn parseArgs( |
| 460 | 687 | d.nolibc = true; |
| 461 | 688 | } else if (mem.eql(u8, arg, "-nobuiltininc")) { |
| 462 | 689 | d.nobuiltininc = true; |
| 690 | } else if (mem.eql(u8, arg, "-resource-dir")) { | |
| 691 | i += 1; | |
| 692 | if (i >= args.len) { | |
| 693 | try d.err("expected argument after -resource-dir", .{}); | |
| 694 | continue; | |
| 695 | } | |
| 696 | d.resource_dir = args[i]; | |
| 463 | 697 | } else if (mem.eql(u8, arg, "-nostdinc") or mem.eql(u8, arg, "--no-standard-includes")) { |
| 464 | 698 | d.nostdinc = true; |
| 465 | 699 | } else if (mem.eql(u8, arg, "-nostdlibinc")) { |
| ... | ... | @@ -476,10 +710,37 @@ pub fn parseArgs( |
| 476 | 710 | break; |
| 477 | 711 | } |
| 478 | 712 | } else { |
| 479 | try d.comp.addDiagnostic(.{ .tag = .invalid_unwindlib, .extra = .{ .str = unwindlib } }, &.{}); | |
| 713 | try d.err("invalid unwind library name '{s}'", .{unwindlib}); | |
| 714 | } | |
| 715 | } else if (mem.startsWith(u8, arg, "-x")) { | |
| 716 | var lang = arg["-x".len..]; | |
| 717 | if (lang.len == 0) { | |
| 718 | i += 1; | |
| 719 | if (i >= args.len) { | |
| 720 | try d.err("expected argument after -x", .{}); | |
| 721 | continue; | |
| 722 | } | |
| 723 | lang = args[i]; | |
| 480 | 724 | } |
| 725 | if (!mem.eql(u8, lang, "none") and !mem.eql(u8, lang, "c")) { | |
| 726 | try d.err("language not recognized: '{s}'", .{lang}); | |
| 727 | } | |
| 728 | } else if (mem.startsWith(u8, arg, "-flto")) { | |
| 729 | const rest = arg["-flto".len..]; | |
| 730 | if (rest.len == 0 or | |
| 731 | mem.eql(u8, rest, "=auto") or | |
| 732 | mem.eql(u8, rest, "=full") or | |
| 733 | mem.eql(u8, rest, "=jobserver") or | |
| 734 | mem.eql(u8, rest, "=thin")) | |
| 735 | { | |
| 736 | try d.warn("lto not supported", .{}); | |
| 737 | } else { | |
| 738 | return d.fatal("invalid lto mode: '{s}'", .{arg}); | |
| 739 | } | |
| 740 | } else if (mem.eql(u8, arg, "-fno-lto")) { | |
| 741 | // nothing to do | |
| 481 | 742 | } else { |
| 482 | try d.comp.addDiagnostic(.{ .tag = .cli_unknown_arg, .extra = .{ .str = arg } }, &.{}); | |
| 743 | try d.warn("unknown argument '{s}'", .{arg}); | |
| 483 | 744 | } |
| 484 | 745 | } else if (std.mem.endsWith(u8, arg, ".o") or std.mem.endsWith(u8, arg, ".obj")) { |
| 485 | 746 | try d.link_objects.append(d.comp.gpa, arg); |
| ... | ... | @@ -490,6 +751,39 @@ pub fn parseArgs( |
| 490 | 751 | try d.inputs.append(d.comp.gpa, source); |
| 491 | 752 | } |
| 492 | 753 | } |
| 754 | { | |
| 755 | var diags: std.Target.Query.ParseOptions.Diagnostics = .{}; | |
| 756 | const opts: std.Target.Query.ParseOptions = .{ | |
| 757 | .arch_os_abi = d.raw_target_triple orelse "native", | |
| 758 | .cpu_features = d.raw_cpu, | |
| 759 | .diagnostics = &diags, | |
| 760 | }; | |
| 761 | const query = std.Target.Query.parse(opts) catch |er| switch (er) { | |
| 762 | error.UnknownCpuModel => { | |
| 763 | return d.fatal("unknown CPU: '{s}'", .{diags.cpu_name.?}); | |
| 764 | }, | |
| 765 | error.UnknownCpuFeature => { | |
| 766 | return d.fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?}); | |
| 767 | }, | |
| 768 | error.UnknownArchitecture => { | |
| 769 | return d.fatal("unknown architecture: '{s}'", .{diags.unknown_architecture_name.?}); | |
| 770 | }, | |
| 771 | else => |e| return d.fatal("unable to parse target query '{s}': {s}", .{ | |
| 772 | opts.arch_os_abi, @errorName(e), | |
| 773 | }), | |
| 774 | }; | |
| 775 | d.comp.target = std.zig.system.resolveTargetQuery(query) catch |e| { | |
| 776 | return d.fatal("unable to resolve target: {s}", .{errorDescription(e)}); | |
| 777 | }; | |
| 778 | } | |
| 779 | if (emulate != null or d.raw_target_triple != null) { | |
| 780 | d.comp.langopts.setEmulatedCompiler(emulate orelse target_util.systemCompiler(d.comp.target)); | |
| 781 | switch (d.comp.langopts.emulate) { | |
| 782 | .clang => try d.diagnostics.set("clang", .off), | |
| 783 | .gcc => try d.diagnostics.set("gnu", .off), | |
| 784 | .msvc => try d.diagnostics.set("microsoft", .off), | |
| 785 | } | |
| 786 | } | |
| 493 | 787 | if (d.comp.langopts.preserve_comments and !d.only_preprocess) { |
| 494 | 788 | return d.fatal("invalid argument '{s}' only allowed with '-E'", .{comment_arg}); |
| 495 | 789 | } |
| ... | ... | @@ -502,11 +796,31 @@ pub fn parseArgs( |
| 502 | 796 | d.comp.target.os.tag = .freestanding; |
| 503 | 797 | } |
| 504 | 798 | } |
| 505 | const version = GCCVersion.parse(gnuc_version); | |
| 506 | if (version.major == -1) { | |
| 507 | return d.fatal("invalid value '{0s}' in '-fgnuc-version={0s}'", .{gnuc_version}); | |
| 799 | if (gnuc_version) |unwrapped| { | |
| 800 | const version = GCCVersion.parse(unwrapped); | |
| 801 | if (version.major == -1) { | |
| 802 | return d.fatal("invalid value '{s}' in '-fgnuc-version={s}'", .{ unwrapped, unwrapped }); | |
| 803 | } | |
| 804 | d.comp.langopts.gnuc_version = version.toUnsigned(); | |
| 508 | 805 | } |
| 509 | d.comp.langopts.gnuc_version = version.toUnsigned(); | |
| 806 | const pic_level, const is_pie = try d.getPICMode(pic_arg); | |
| 807 | d.comp.code_gen_options.pic_level = pic_level; | |
| 808 | d.comp.code_gen_options.is_pie = is_pie; | |
| 809 | d.comp.code_gen_options.debug = debug: { | |
| 810 | if (strip) break :debug .strip; | |
| 811 | if (debug) |explicit| break :debug explicit; | |
| 812 | break :debug switch (d.comp.target.ofmt) { | |
| 813 | .elf, .goff, .macho, .wasm, .xcoff => .{ .dwarf = .@"32" }, | |
| 814 | .coff => .code_view, | |
| 815 | .c => switch (d.comp.target.os.tag) { | |
| 816 | .windows, .uefi => .code_view, | |
| 817 | else => .{ .dwarf = .@"32" }, | |
| 818 | }, | |
| 819 | .spirv, .hex, .raw, .plan9 => .strip, | |
| 820 | }; | |
| 821 | }; | |
| 822 | if (declspec_attrs) |some| d.comp.langopts.declspec_attrs = some; | |
| 823 | if (ms_extensions) |some| d.comp.langopts.setMSExtensions(some); | |
| 510 | 824 | return false; |
| 511 | 825 | } |
| 512 | 826 | |
| ... | ... | @@ -519,40 +833,71 @@ fn option(arg: []const u8, name: []const u8) ?[]const u8 { |
| 519 | 833 | |
| 520 | 834 | fn addSource(d: *Driver, path: []const u8) !Source { |
| 521 | 835 | if (mem.eql(u8, "-", path)) { |
| 522 | var stdin_reader: std.fs.File.Reader = .initStreaming(.stdin(), &.{}); | |
| 523 | const input = try stdin_reader.interface.allocRemaining(d.comp.gpa, .limited(std.math.maxInt(u32))); | |
| 524 | defer d.comp.gpa.free(input); | |
| 525 | return d.comp.addSourceFromBuffer("<stdin>", input); | |
| 836 | return d.comp.addSourceFromFile(.stdin(), "<stdin>", .user); | |
| 526 | 837 | } |
| 527 | 838 | return d.comp.addSourceFromPath(path); |
| 528 | 839 | } |
| 529 | 840 | |
| 530 | pub fn err(d: *Driver, msg: []const u8) !void { | |
| 531 | try d.comp.addDiagnostic(.{ .tag = .cli_error, .extra = .{ .str = msg } }, &.{}); | |
| 841 | pub fn err(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void { | |
| 842 | var sf = std.heap.stackFallback(1024, d.comp.gpa); | |
| 843 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 844 | defer allocating.deinit(); | |
| 845 | ||
| 846 | Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; | |
| 847 | try d.diagnostics.add(.{ .kind = .@"error", .text = allocating.written(), .location = null }); | |
| 848 | } | |
| 849 | ||
| 850 | pub fn warn(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void { | |
| 851 | var sf = std.heap.stackFallback(1024, d.comp.gpa); | |
| 852 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 853 | defer allocating.deinit(); | |
| 854 | ||
| 855 | Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; | |
| 856 | try d.diagnostics.add(.{ .kind = .warning, .text = allocating.written(), .location = null }); | |
| 857 | } | |
| 858 | ||
| 859 | pub fn unsupportedOptionForTarget(d: *Driver, target: std.Target, opt: []const u8) Compilation.Error!void { | |
| 860 | try d.err( | |
| 861 | "unsupported option '{s}' for target '{s}-{s}-{s}'", | |
| 862 | .{ opt, @tagName(target.cpu.arch), @tagName(target.os.tag), @tagName(target.abi) }, | |
| 863 | ); | |
| 532 | 864 | } |
| 533 | 865 | |
| 534 | 866 | pub fn fatal(d: *Driver, comptime fmt: []const u8, args: anytype) error{ FatalError, OutOfMemory } { |
| 535 | try d.comp.diagnostics.list.append(d.comp.gpa, .{ | |
| 536 | .tag = .cli_error, | |
| 537 | .kind = .@"fatal error", | |
| 538 | .extra = .{ .str = try std.fmt.allocPrint(d.comp.diagnostics.arena.allocator(), fmt, args) }, | |
| 539 | }); | |
| 540 | return error.FatalError; | |
| 867 | var sf = std.heap.stackFallback(1024, d.comp.gpa); | |
| 868 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 869 | defer allocating.deinit(); | |
| 870 | ||
| 871 | Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; | |
| 872 | try d.diagnostics.add(.{ .kind = .@"fatal error", .text = allocating.written(), .location = null }); | |
| 873 | unreachable; | |
| 541 | 874 | } |
| 542 | 875 | |
| 543 | pub fn renderErrors(d: *Driver) void { | |
| 544 | Diagnostics.render(d.comp, d.detectConfig(std.fs.File.stderr())); | |
| 876 | pub fn printDiagnosticsStats(d: *Driver) void { | |
| 877 | if (!d.diagnostics.details) return; | |
| 878 | const warnings = d.diagnostics.warnings; | |
| 879 | const errors = d.diagnostics.errors; | |
| 880 | ||
| 881 | const w_s: []const u8 = if (warnings == 1) "" else "s"; | |
| 882 | const e_s: []const u8 = if (errors == 1) "" else "s"; | |
| 883 | if (errors != 0 and warnings != 0) { | |
| 884 | std.debug.print("{d} warning{s} and {d} error{s} generated.\n", .{ warnings, w_s, errors, e_s }); | |
| 885 | } else if (warnings != 0) { | |
| 886 | std.debug.print("{d} warning{s} generated.\n", .{ warnings, w_s }); | |
| 887 | } else if (errors != 0) { | |
| 888 | std.debug.print("{d} error{s} generated.\n", .{ errors, e_s }); | |
| 889 | } | |
| 545 | 890 | } |
| 546 | 891 | |
| 547 | 892 | pub fn detectConfig(d: *Driver, file: std.fs.File) std.Io.tty.Config { |
| 548 | if (d.color == true) return .escape_codes; | |
| 549 | if (d.color == false) return .no_color; | |
| 893 | if (d.diagnostics.color == false) return .no_color; | |
| 894 | const force_color = d.diagnostics.color == true; | |
| 550 | 895 | |
| 551 | 896 | if (file.supportsAnsiEscapeCodes()) return .escape_codes; |
| 552 | 897 | if (@import("builtin").os.tag == .windows and file.isTty()) { |
| 553 | 898 | var info: std.os.windows.CONSOLE_SCREEN_BUFFER_INFO = undefined; |
| 554 | if (std.os.windows.kernel32.GetConsoleScreenBufferInfo(file.handle, &info) != std.os.windows.TRUE) { | |
| 555 | return .no_color; | |
| 899 | if (std.os.windows.kernel32.GetConsoleScreenBufferInfo(file.handle, &info) == std.os.windows.FALSE) { | |
| 900 | return if (force_color) .escape_codes else .no_color; | |
| 556 | 901 | } |
| 557 | 902 | return .{ .windows_api = .{ |
| 558 | 903 | .handle = file.handle, |
| ... | ... | @@ -560,7 +905,7 @@ pub fn detectConfig(d: *Driver, file: std.fs.File) std.Io.tty.Config { |
| 560 | 905 | } }; |
| 561 | 906 | } |
| 562 | 907 | |
| 563 | return .no_color; | |
| 908 | return if (force_color) .escape_codes else .no_color; | |
| 564 | 909 | } |
| 565 | 910 | |
| 566 | 911 | pub fn errorDescription(e: anyerror) []const u8 { |
| ... | ... | @@ -585,16 +930,28 @@ pub fn errorDescription(e: anyerror) []const u8 { |
| 585 | 930 | }; |
| 586 | 931 | } |
| 587 | 932 | |
| 588 | var stdout_buffer: [4096]u8 = undefined; | |
| 589 | ||
| 590 | 933 | /// The entry point of the Aro compiler. |
| 591 | 934 | /// **MAY call `exit` if `fast_exit` is set.** |
| 592 | pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_exit: bool) !void { | |
| 593 | var macro_buf = std.array_list.Managed(u8).init(d.comp.gpa); | |
| 594 | defer macro_buf.deinit(); | |
| 935 | pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_exit: bool, asm_gen_fn: ?AsmCodeGenFn) Compilation.Error!void { | |
| 936 | const user_macros = macros: { | |
| 937 | var macro_buf: std.ArrayList(u8) = .empty; | |
| 938 | defer macro_buf.deinit(d.comp.gpa); | |
| 939 | ||
| 940 | var stdout_buf: [256]u8 = undefined; | |
| 941 | var stdout = std.fs.File.stdout().writer(&stdout_buf); | |
| 942 | if (parseArgs(d, &stdout.interface, &macro_buf, args) catch |er| switch (er) { | |
| 943 | error.WriteFailed => return d.fatal("failed to write to stdout: {s}", .{errorDescription(er)}), | |
| 944 | error.OutOfMemory => return error.OutOfMemory, | |
| 945 | error.FatalError => return error.FatalError, | |
| 946 | }) return; | |
| 947 | if (macro_buf.items.len > std.math.maxInt(u32)) { | |
| 948 | return d.fatal("user provided macro source exceeded max size", .{}); | |
| 949 | } | |
| 950 | const contents = try macro_buf.toOwnedSlice(d.comp.gpa); | |
| 951 | errdefer d.comp.gpa.free(contents); | |
| 595 | 952 | |
| 596 | const std_out = std.fs.File.stdout().deprecatedWriter(); | |
| 597 | if (try parseArgs(d, std_out, macro_buf.writer(), args)) return; | |
| 953 | break :macros try d.comp.addSourceFromOwnedBuffer("<command line>", contents, .user); | |
| 954 | }; | |
| 598 | 955 | |
| 599 | 956 | const linking = !(d.only_preprocess or d.only_syntax or d.only_compile or d.only_preprocess_and_compile); |
| 600 | 957 | |
| ... | ... | @@ -605,38 +962,31 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_ |
| 605 | 962 | } |
| 606 | 963 | |
| 607 | 964 | if (!linking) for (d.link_objects.items) |obj| { |
| 608 | try d.comp.addDiagnostic(.{ .tag = .cli_unused_link_object, .extra = .{ .str = obj } }, &.{}); | |
| 965 | try d.err("{s}: linker input file unused because linking not done", .{obj}); | |
| 609 | 966 | }; |
| 610 | 967 | |
| 611 | try tc.discover(); | |
| 968 | tc.discover() catch |er| switch (er) { | |
| 969 | error.OutOfMemory => return error.OutOfMemory, | |
| 970 | error.TooManyMultilibs => return d.fatal("found more than one multilib with the same priority", .{}), | |
| 971 | }; | |
| 612 | 972 | tc.defineSystemIncludes() catch |er| switch (er) { |
| 613 | 973 | error.OutOfMemory => return error.OutOfMemory, |
| 614 | 974 | error.AroIncludeNotFound => return d.fatal("unable to find Aro builtin headers", .{}), |
| 615 | 975 | }; |
| 616 | 976 | |
| 617 | const builtin = try d.comp.generateBuiltinMacros(d.system_defines); | |
| 618 | const user_macros = try d.comp.addSourceFromBuffer("<command line>", macro_buf.items); | |
| 619 | ||
| 977 | const builtin_macros = d.comp.generateBuiltinMacros(d.system_defines) catch |er| switch (er) { | |
| 978 | error.FileTooBig => return d.fatal("builtin macro source exceeded max size", .{}), | |
| 979 | else => |e| return e, | |
| 980 | }; | |
| 620 | 981 | if (fast_exit and d.inputs.items.len == 1) { |
| 621 | d.processSource(tc, d.inputs.items[0], builtin, user_macros, fast_exit) catch |e| switch (e) { | |
| 622 | error.FatalError => { | |
| 623 | d.renderErrors(); | |
| 624 | d.exitWithCleanup(1); | |
| 625 | }, | |
| 626 | else => |er| return er, | |
| 627 | }; | |
| 982 | try d.processSource(tc, d.inputs.items[0], builtin_macros, user_macros, fast_exit, asm_gen_fn); | |
| 628 | 983 | unreachable; |
| 629 | 984 | } |
| 630 | 985 | |
| 631 | 986 | for (d.inputs.items) |source| { |
| 632 | d.processSource(tc, source, builtin, user_macros, fast_exit) catch |e| switch (e) { | |
| 633 | error.FatalError => { | |
| 634 | d.renderErrors(); | |
| 635 | }, | |
| 636 | else => |er| return er, | |
| 637 | }; | |
| 987 | try d.processSource(tc, source, builtin_macros, user_macros, fast_exit, asm_gen_fn); | |
| 638 | 988 | } |
| 639 | if (d.comp.diagnostics.errors != 0) { | |
| 989 | if (d.diagnostics.errors != 0) { | |
| 640 | 990 | if (fast_exit) d.exitWithCleanup(1); |
| 641 | 991 | return; |
| 642 | 992 | } |
| ... | ... | @@ -646,6 +996,111 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_ |
| 646 | 996 | if (fast_exit) std.process.exit(0); |
| 647 | 997 | } |
| 648 | 998 | |
| 999 | /// Initializes a DepFile if requested by driver options. | |
| 1000 | pub fn initDepFile( | |
| 1001 | d: *Driver, | |
| 1002 | source: Source, | |
| 1003 | buf: *[std.fs.max_name_bytes]u8, | |
| 1004 | omit_source: bool, | |
| 1005 | ) Compilation.Error!?DepFile { | |
| 1006 | if (!d.dependencies.m and !d.dependencies.md) return null; | |
| 1007 | var dep_file: DepFile = .{ | |
| 1008 | .target = undefined, | |
| 1009 | .format = d.dependencies.format, | |
| 1010 | }; | |
| 1011 | ||
| 1012 | if (d.dependencies.md and d.output_name != null) { | |
| 1013 | dep_file.target = d.output_name.?; | |
| 1014 | } else { | |
| 1015 | const args = .{ | |
| 1016 | std.fs.path.stem(source.path), | |
| 1017 | d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), | |
| 1018 | }; | |
| 1019 | dep_file.target = std.fmt.bufPrint(buf, "{s}{s}", args) catch | |
| 1020 | return d.fatal("dependency file name too long for filesystem '{s}{s}'", args); | |
| 1021 | } | |
| 1022 | ||
| 1023 | if (!omit_source) try dep_file.addDependency(d.comp.gpa, source.path); | |
| 1024 | errdefer comptime unreachable; | |
| 1025 | ||
| 1026 | return dep_file; | |
| 1027 | } | |
| 1028 | ||
| 1029 | /// Returns name requested for the dependency file or null for stdout. | |
| 1030 | pub fn getDepFileName(d: *Driver, source: Source, buf: *[std.fs.max_name_bytes]u8) Compilation.Error!?[]const u8 { | |
| 1031 | if (d.dependencies.file) |file| { | |
| 1032 | if (std.mem.eql(u8, file, "-")) return null; | |
| 1033 | return file; | |
| 1034 | } | |
| 1035 | if (!d.dependencies.md) { | |
| 1036 | if (d.output_name) |name| return name; | |
| 1037 | return null; | |
| 1038 | } | |
| 1039 | ||
| 1040 | const base_name = std.fs.path.stem(d.output_name orelse source.path); | |
| 1041 | return std.fmt.bufPrint(buf, "{s}.d", .{base_name}) catch | |
| 1042 | return d.fatal("dependency file name too long for filesystem: {s}.d", .{base_name}); | |
| 1043 | } | |
| 1044 | ||
| 1045 | fn getRandomFilename(d: *Driver, buf: *[std.fs.max_name_bytes]u8, extension: []const u8) ![]const u8 { | |
| 1046 | const random_bytes_count = 12; | |
| 1047 | const sub_path_len = comptime std.fs.base64_encoder.calcSize(random_bytes_count); | |
| 1048 | ||
| 1049 | var random_bytes: [random_bytes_count]u8 = undefined; | |
| 1050 | std.crypto.random.bytes(&random_bytes); | |
| 1051 | var random_name: [sub_path_len]u8 = undefined; | |
| 1052 | _ = std.fs.base64_encoder.encode(&random_name, &random_bytes); | |
| 1053 | ||
| 1054 | const fmt_template = "/tmp/{s}{s}"; | |
| 1055 | const fmt_args = .{ | |
| 1056 | @as([]const u8, &random_name), | |
| 1057 | extension, | |
| 1058 | }; | |
| 1059 | return std.fmt.bufPrint(buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); | |
| 1060 | } | |
| 1061 | ||
| 1062 | /// If it's used, buf will either hold a filename or `/tmp/<12 random bytes with base-64 encoding>.<extension>` | |
| 1063 | /// both of which should fit into max_name_bytes for all systems | |
| 1064 | fn getOutFileName(d: *Driver, source: Source, buf: *[std.fs.max_name_bytes]u8) ![]const u8 { | |
| 1065 | if (d.only_compile or d.only_preprocess_and_compile) { | |
| 1066 | const fmt_template = "{s}{s}"; | |
| 1067 | const fmt_args = .{ | |
| 1068 | std.fs.path.stem(source.path), | |
| 1069 | if (d.only_preprocess_and_compile) ".s" else d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), | |
| 1070 | }; | |
| 1071 | return d.output_name orelse | |
| 1072 | std.fmt.bufPrint(buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); | |
| 1073 | } | |
| 1074 | ||
| 1075 | return d.getRandomFilename(buf, d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch)); | |
| 1076 | } | |
| 1077 | ||
| 1078 | fn invokeAssembler(d: *Driver, tc: *Toolchain, input_path: []const u8, output_path: []const u8) !void { | |
| 1079 | var assembler_path_buf: [std.fs.max_path_bytes]u8 = undefined; | |
| 1080 | const assembler_path = try tc.getAssemblerPath(&assembler_path_buf); | |
| 1081 | const argv = [_][]const u8{ assembler_path, input_path, "-o", output_path }; | |
| 1082 | ||
| 1083 | var child = std.process.Child.init(&argv, d.comp.gpa); | |
| 1084 | // TODO handle better | |
| 1085 | child.stdin_behavior = .Inherit; | |
| 1086 | child.stdout_behavior = .Inherit; | |
| 1087 | child.stderr_behavior = .Inherit; | |
| 1088 | ||
| 1089 | const term = child.spawnAndWait() catch |er| { | |
| 1090 | return d.fatal("unable to spawn linker: {s}", .{errorDescription(er)}); | |
| 1091 | }; | |
| 1092 | switch (term) { | |
| 1093 | .Exited => |code| if (code != 0) { | |
| 1094 | const e = d.fatal("assembler exited with an error code", .{}); | |
| 1095 | return e; | |
| 1096 | }, | |
| 1097 | else => { | |
| 1098 | const e = d.fatal("assembler crashed", .{}); | |
| 1099 | return e; | |
| 1100 | }, | |
| 1101 | } | |
| 1102 | } | |
| 1103 | ||
| 649 | 1104 | fn processSource( |
| 650 | 1105 | d: *Driver, |
| 651 | 1106 | tc: *Toolchain, |
| ... | ... | @@ -653,11 +1108,20 @@ fn processSource( |
| 653 | 1108 | builtin: Source, |
| 654 | 1109 | user_macros: Source, |
| 655 | 1110 | comptime fast_exit: bool, |
| 1111 | asm_gen_fn: ?AsmCodeGenFn, | |
| 656 | 1112 | ) !void { |
| 657 | 1113 | d.comp.generated_buf.items.len = 0; |
| 1114 | const prev_total = d.diagnostics.errors; | |
| 1115 | ||
| 658 | 1116 | var pp = try Preprocessor.initDefault(d.comp); |
| 659 | 1117 | defer pp.deinit(); |
| 660 | 1118 | |
| 1119 | var name_buf: [std.fs.max_name_bytes]u8 = undefined; | |
| 1120 | var opt_dep_file = try d.initDepFile(source, &name_buf, false); | |
| 1121 | defer if (opt_dep_file) |*dep_file| dep_file.deinit(d.comp.gpa); | |
| 1122 | ||
| 1123 | if (opt_dep_file) |*dep_file| pp.dep_file = dep_file; | |
| 1124 | ||
| 661 | 1125 | if (d.comp.langopts.ms_extensions) { |
| 662 | 1126 | d.comp.ms_cwd_source_id = source.id; |
| 663 | 1127 | } |
| ... | ... | @@ -676,28 +1140,46 @@ fn processSource( |
| 676 | 1140 | |
| 677 | 1141 | try pp.preprocessSources(&.{ source, builtin, user_macros }); |
| 678 | 1142 | |
| 1143 | var writer_buf: [4096]u8 = undefined; | |
| 1144 | if (opt_dep_file) |dep_file| { | |
| 1145 | const dep_file_name = try d.getDepFileName(source, writer_buf[0..std.fs.max_name_bytes]); | |
| 1146 | ||
| 1147 | const file = if (dep_file_name) |path| | |
| 1148 | d.comp.cwd.createFile(path, .{}) catch |er| | |
| 1149 | return d.fatal("unable to create dependency file '{s}': {s}", .{ path, errorDescription(er) }) | |
| 1150 | else | |
| 1151 | std.fs.File.stdout(); | |
| 1152 | defer if (dep_file_name != null) file.close(); | |
| 1153 | ||
| 1154 | var file_writer = file.writer(&writer_buf); | |
| 1155 | dep_file.write(&file_writer.interface) catch | |
| 1156 | return d.fatal("unable to write dependency file: {s}", .{errorDescription(file_writer.err.?)}); | |
| 1157 | } | |
| 1158 | ||
| 679 | 1159 | if (d.only_preprocess) { |
| 680 | d.renderErrors(); | |
| 1160 | d.printDiagnosticsStats(); | |
| 1161 | ||
| 1162 | if (d.diagnostics.errors != prev_total) { | |
| 1163 | if (fast_exit) std.process.exit(1); // Not linking, no need for cleanup. | |
| 1164 | return; | |
| 1165 | } | |
| 681 | 1166 | |
| 682 | if (d.comp.diagnostics.errors != 0) { | |
| 1167 | if (d.dependencies.m and !d.dependencies.md) { | |
| 683 | 1168 | if (fast_exit) std.process.exit(1); // Not linking, no need for cleanup. |
| 684 | 1169 | return; |
| 685 | 1170 | } |
| 686 | 1171 | |
| 687 | 1172 | const file = if (d.output_name) |some| |
| 688 | std.fs.cwd().createFile(some, .{}) catch |er| | |
| 1173 | d.comp.cwd.createFile(some, .{}) catch |er| | |
| 689 | 1174 | return d.fatal("unable to create output file '{s}': {s}", .{ some, errorDescription(er) }) |
| 690 | 1175 | else |
| 691 | 1176 | std.fs.File.stdout(); |
| 692 | 1177 | defer if (d.output_name != null) file.close(); |
| 693 | var file_buffer: [1024]u8 = undefined; | |
| 694 | var file_writer = file.writer(&file_buffer); | |
| 695 | 1178 | |
| 696 | pp.prettyPrintTokens(&file_writer.interface, dump_mode) catch |er| | |
| 697 | return d.fatal("unable to write result: {s}", .{errorDescription(er)}); | |
| 1179 | var file_writer = file.writer(&writer_buf); | |
| 1180 | pp.prettyPrintTokens(&file_writer.interface, dump_mode) catch | |
| 1181 | return d.fatal("unable to write result: {s}", .{errorDescription(file_writer.err.?)}); | |
| 698 | 1182 | |
| 699 | file_writer.interface.flush() catch |er| | |
| 700 | return d.fatal("unable to write result: {s}", .{errorDescription(er)}); | |
| 701 | 1183 | if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. |
| 702 | 1184 | return; |
| 703 | 1185 | } |
| ... | ... | @@ -706,15 +1188,13 @@ fn processSource( |
| 706 | 1188 | defer tree.deinit(); |
| 707 | 1189 | |
| 708 | 1190 | if (d.verbose_ast) { |
| 709 | var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer); | |
| 710 | tree.dump(d.detectConfig(.stdout()), &stdout_writer.interface) catch {}; | |
| 711 | stdout_writer.interface.flush() catch {}; | |
| 1191 | var stdout = std.fs.File.stdout().writer(&writer_buf); | |
| 1192 | tree.dump(d.detectConfig(stdout.file), &stdout.interface) catch {}; | |
| 712 | 1193 | } |
| 713 | 1194 | |
| 714 | const prev_errors = d.comp.diagnostics.errors; | |
| 715 | d.renderErrors(); | |
| 1195 | d.printDiagnosticsStats(); | |
| 716 | 1196 | |
| 717 | if (d.comp.diagnostics.errors != prev_errors) { | |
| 1197 | if (d.diagnostics.errors != prev_total) { | |
| 718 | 1198 | if (fast_exit) d.exitWithCleanup(1); |
| 719 | 1199 | return; // do not compile if there were errors |
| 720 | 1200 | } |
| ... | ... | @@ -731,69 +1211,78 @@ fn processSource( |
| 731 | 1211 | ); |
| 732 | 1212 | } |
| 733 | 1213 | |
| 734 | var ir = try tree.genIr(); | |
| 735 | defer ir.deinit(d.comp.gpa); | |
| 1214 | const out_file_name = try d.getOutFileName(source, &name_buf); | |
| 736 | 1215 | |
| 737 | if (d.verbose_ir) { | |
| 738 | var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer); | |
| 739 | ir.dump(d.comp.gpa, d.detectConfig(.stdout()), &stdout_writer.interface) catch {}; | |
| 740 | stdout_writer.interface.flush() catch {}; | |
| 741 | } | |
| 1216 | if (d.use_assembly_backend) { | |
| 1217 | const asm_fn = asm_gen_fn orelse return d.fatal( | |
| 1218 | "Assembly codegen not supported", | |
| 1219 | .{}, | |
| 1220 | ); | |
| 742 | 1221 | |
| 743 | var render_errors: Ir.Renderer.ErrorList = .{}; | |
| 744 | defer { | |
| 745 | for (render_errors.values()) |msg| d.comp.gpa.free(msg); | |
| 746 | render_errors.deinit(d.comp.gpa); | |
| 747 | } | |
| 1222 | const assembly = try asm_fn(d.comp.target, &tree); | |
| 1223 | defer assembly.deinit(d.comp.gpa); | |
| 748 | 1224 | |
| 749 | var obj = ir.render(d.comp.gpa, d.comp.target, &render_errors) catch |e| switch (e) { | |
| 750 | error.OutOfMemory => return error.OutOfMemory, | |
| 751 | error.LowerFail => { | |
| 752 | return d.fatal( | |
| 753 | "unable to render Ir to machine code: {s}", | |
| 754 | .{render_errors.values()[0]}, | |
| 755 | ); | |
| 756 | }, | |
| 757 | }; | |
| 758 | defer obj.deinit(); | |
| 1225 | if (d.only_preprocess_and_compile) { | |
| 1226 | const out_file = d.comp.cwd.createFile(out_file_name, .{}) catch |er| | |
| 1227 | return d.fatal("unable to create output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); | |
| 1228 | defer out_file.close(); | |
| 759 | 1229 | |
| 760 | // If it's used, name_buf will either hold a filename or `/tmp/<12 random bytes with base-64 encoding>.<extension>` | |
| 761 | // both of which should fit into max_name_bytes for all systems | |
| 762 | var name_buf: [std.fs.max_name_bytes]u8 = undefined; | |
| 1230 | assembly.writeToFile(out_file) catch |er| | |
| 1231 | return d.fatal("unable to write to output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); | |
| 1232 | if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. | |
| 1233 | return; | |
| 1234 | } | |
| 763 | 1235 | |
| 764 | const out_file_name = if (d.only_compile) blk: { | |
| 765 | const fmt_template = "{s}{s}"; | |
| 766 | const fmt_args = .{ | |
| 767 | std.fs.path.stem(source.path), | |
| 768 | d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), | |
| 769 | }; | |
| 770 | break :blk d.output_name orelse | |
| 771 | std.fmt.bufPrint(&name_buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); | |
| 772 | } else blk: { | |
| 773 | const random_bytes_count = 12; | |
| 774 | const sub_path_len = comptime std.fs.base64_encoder.calcSize(random_bytes_count); | |
| 775 | ||
| 776 | var random_bytes: [random_bytes_count]u8 = undefined; | |
| 777 | std.crypto.random.bytes(&random_bytes); | |
| 778 | var random_name: [sub_path_len]u8 = undefined; | |
| 779 | _ = std.fs.base64_encoder.encode(&random_name, &random_bytes); | |
| 780 | ||
| 781 | const fmt_template = "/tmp/{s}{s}"; | |
| 782 | const fmt_args = .{ | |
| 783 | random_name, | |
| 784 | d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), | |
| 1236 | // write to assembly_out_file_name | |
| 1237 | // then assemble to out_file_name | |
| 1238 | var assembly_name_buf: [std.fs.max_name_bytes]u8 = undefined; | |
| 1239 | const assembly_out_file_name = try d.getRandomFilename(&assembly_name_buf, ".s"); | |
| 1240 | const out_file = d.comp.cwd.createFile(assembly_out_file_name, .{}) catch |er| | |
| 1241 | return d.fatal("unable to create output file '{s}': {s}", .{ assembly_out_file_name, errorDescription(er) }); | |
| 1242 | defer out_file.close(); | |
| 1243 | assembly.writeToFile(out_file) catch |er| | |
| 1244 | return d.fatal("unable to write to output file '{s}': {s}", .{ assembly_out_file_name, errorDescription(er) }); | |
| 1245 | try d.invokeAssembler(tc, assembly_out_file_name, out_file_name); | |
| 1246 | if (d.only_compile) { | |
| 1247 | if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. | |
| 1248 | return; | |
| 1249 | } | |
| 1250 | } else { | |
| 1251 | var ir = try tree.genIr(); | |
| 1252 | defer ir.deinit(d.comp.gpa); | |
| 1253 | ||
| 1254 | if (d.verbose_ir) { | |
| 1255 | var stdout = std.fs.File.stdout().writer(&writer_buf); | |
| 1256 | ir.dump(d.comp.gpa, d.detectConfig(stdout.file), &stdout.interface) catch {}; | |
| 1257 | } | |
| 1258 | ||
| 1259 | var render_errors: Ir.Renderer.ErrorList = .{}; | |
| 1260 | defer { | |
| 1261 | for (render_errors.values()) |msg| d.comp.gpa.free(msg); | |
| 1262 | render_errors.deinit(d.comp.gpa); | |
| 1263 | } | |
| 1264 | ||
| 1265 | var obj = ir.render(d.comp.gpa, d.comp.target, &render_errors) catch |e| switch (e) { | |
| 1266 | error.OutOfMemory => return error.OutOfMemory, | |
| 1267 | error.LowerFail => { | |
| 1268 | return d.fatal( | |
| 1269 | "unable to render Ir to machine code: {s}", | |
| 1270 | .{render_errors.values()[0]}, | |
| 1271 | ); | |
| 1272 | }, | |
| 785 | 1273 | }; |
| 786 | break :blk std.fmt.bufPrint(&name_buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); | |
| 787 | }; | |
| 1274 | defer obj.deinit(); | |
| 788 | 1275 | |
| 789 | const out_file = std.fs.cwd().createFile(out_file_name, .{}) catch |er| | |
| 790 | return d.fatal("unable to create output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); | |
| 791 | defer out_file.close(); | |
| 1276 | const out_file = d.comp.cwd.createFile(out_file_name, .{}) catch |er| | |
| 1277 | return d.fatal("unable to create output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); | |
| 1278 | defer out_file.close(); | |
| 792 | 1279 | |
| 793 | obj.finish(out_file) catch |er| | |
| 794 | return d.fatal("could not output to object file '{s}': {s}", .{ out_file_name, errorDescription(er) }); | |
| 1280 | var file_writer = out_file.writer(&writer_buf); | |
| 1281 | obj.finish(&file_writer.interface) catch | |
| 1282 | return d.fatal("could not output to object file '{s}': {s}", .{ out_file_name, errorDescription(file_writer.err.?) }); | |
| 1283 | } | |
| 795 | 1284 | |
| 796 | if (d.only_compile) { | |
| 1285 | if (d.only_compile or d.only_preprocess_and_compile) { | |
| 797 | 1286 | if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. |
| 798 | 1287 | return; |
| 799 | 1288 | } |
| ... | ... | @@ -805,30 +1294,33 @@ fn processSource( |
| 805 | 1294 | } |
| 806 | 1295 | } |
| 807 | 1296 | |
| 808 | fn dumpLinkerArgs(items: []const []const u8) !void { | |
| 809 | const stdout = std.fs.File.stdout().deprecatedWriter(); | |
| 1297 | fn dumpLinkerArgs(w: *std.Io.Writer, items: []const []const u8) !void { | |
| 810 | 1298 | for (items, 0..) |item, i| { |
| 811 | if (i > 0) try stdout.writeByte(' '); | |
| 812 | try stdout.print("\"{f}\"", .{std.zig.fmtString(item)}); | |
| 1299 | if (i > 0) try w.writeByte(' '); | |
| 1300 | try w.print("\"{f}\"", .{std.zig.fmtString(item)}); | |
| 813 | 1301 | } |
| 814 | try stdout.writeByte('\n'); | |
| 1302 | try w.writeByte('\n'); | |
| 1303 | try w.flush(); | |
| 815 | 1304 | } |
| 816 | 1305 | |
| 817 | 1306 | /// The entry point of the Aro compiler. |
| 818 | 1307 | /// **MAY call `exit` if `fast_exit` is set.** |
| 819 | pub fn invokeLinker(d: *Driver, tc: *Toolchain, comptime fast_exit: bool) !void { | |
| 820 | var argv = std.array_list.Managed([]const u8).init(d.comp.gpa); | |
| 821 | defer argv.deinit(); | |
| 1308 | pub fn invokeLinker(d: *Driver, tc: *Toolchain, comptime fast_exit: bool) Compilation.Error!void { | |
| 1309 | const gpa = d.comp.gpa; | |
| 1310 | var argv: std.ArrayList([]const u8) = .empty; | |
| 1311 | defer argv.deinit(gpa); | |
| 822 | 1312 | |
| 823 | 1313 | var linker_path_buf: [std.fs.max_path_bytes]u8 = undefined; |
| 824 | 1314 | const linker_path = try tc.getLinkerPath(&linker_path_buf); |
| 825 | try argv.append(linker_path); | |
| 1315 | try argv.append(gpa, linker_path); | |
| 826 | 1316 | |
| 827 | 1317 | try tc.buildLinkerArgs(&argv); |
| 828 | 1318 | |
| 829 | 1319 | if (d.verbose_linker_args) { |
| 830 | dumpLinkerArgs(argv.items) catch |er| { | |
| 831 | return d.fatal("unable to dump linker args: {s}", .{errorDescription(er)}); | |
| 1320 | var stdout_buf: [4096]u8 = undefined; | |
| 1321 | var stdout = std.fs.File.stdout().writer(&stdout_buf); | |
| 1322 | dumpLinkerArgs(&stdout.interface, argv.items) catch { | |
| 1323 | return d.fatal("unable to dump linker args: {s}", .{errorDescription(stdout.err.?)}); | |
| 832 | 1324 | }; |
| 833 | 1325 | } |
| 834 | 1326 | var child = std.process.Child.init(argv.items, d.comp.gpa); |
| ... | ... | @@ -861,3 +1353,162 @@ fn exitWithCleanup(d: *Driver, code: u8) noreturn { |
| 861 | 1353 | } |
| 862 | 1354 | std.process.exit(code); |
| 863 | 1355 | } |
| 1356 | ||
| 1357 | /// Parses the various -fpic/-fPIC/-fpie/-fPIE arguments. | |
| 1358 | /// Then, smooshes them together with platform defaults, to decide whether | |
| 1359 | /// this compile should be using PIC mode or not. | |
| 1360 | pub fn getPICMode(d: *Driver, lastpic: []const u8) Compilation.Error!struct { backend.CodeGenOptions.PicLevel, bool } { | |
| 1361 | const eqlIgnoreCase = std.ascii.eqlIgnoreCase; | |
| 1362 | ||
| 1363 | const target = d.comp.target; | |
| 1364 | ||
| 1365 | const is_pie_default = switch (target_util.isPIEDefault(target)) { | |
| 1366 | .yes => true, | |
| 1367 | .no => false, | |
| 1368 | .depends_on_linker => false, | |
| 1369 | }; | |
| 1370 | const is_pic_default = switch (target_util.isPICdefault(target)) { | |
| 1371 | .yes => true, | |
| 1372 | .no => false, | |
| 1373 | .depends_on_linker => false, | |
| 1374 | }; | |
| 1375 | ||
| 1376 | var pie: bool = is_pie_default; | |
| 1377 | var pic: bool = pie or is_pic_default; | |
| 1378 | // The Darwin/MachO default to use PIC does not apply when using -static. | |
| 1379 | if (target.ofmt == .macho and d.static) { | |
| 1380 | pic, pie = .{ false, false }; | |
| 1381 | } | |
| 1382 | var is_piclevel_two = pic; | |
| 1383 | ||
| 1384 | const kernel_or_kext: bool = d.mkernel or d.apple_kext; | |
| 1385 | ||
| 1386 | // Android-specific defaults for PIC/PIE | |
| 1387 | if (target.abi.isAndroid()) { | |
| 1388 | switch (target.cpu.arch) { | |
| 1389 | .arm, | |
| 1390 | .armeb, | |
| 1391 | .thumb, | |
| 1392 | .thumbeb, | |
| 1393 | .aarch64, | |
| 1394 | .mips, | |
| 1395 | .mipsel, | |
| 1396 | .mips64, | |
| 1397 | .mips64el, | |
| 1398 | => pic = true, // "-fpic" | |
| 1399 | ||
| 1400 | .x86, .x86_64 => { | |
| 1401 | pic = true; // "-fPIC" | |
| 1402 | is_piclevel_two = true; | |
| 1403 | }, | |
| 1404 | else => {}, | |
| 1405 | } | |
| 1406 | } | |
| 1407 | ||
| 1408 | // OHOS-specific defaults for PIC/PIE | |
| 1409 | if (target.abi == .ohos and target.cpu.arch == .aarch64) | |
| 1410 | pic = true; | |
| 1411 | ||
| 1412 | // OpenBSD-specific defaults for PIE | |
| 1413 | if (target.os.tag == .openbsd) { | |
| 1414 | switch (target.cpu.arch) { | |
| 1415 | .arm, .aarch64, .mips64, .mips64el, .x86, .x86_64 => is_piclevel_two = false, // "-fpie" | |
| 1416 | .powerpc, .sparc64 => is_piclevel_two = true, // "-fPIE" | |
| 1417 | else => {}, | |
| 1418 | } | |
| 1419 | } | |
| 1420 | ||
| 1421 | // The last argument relating to either PIC or PIE wins, and no | |
| 1422 | // other argument is used. If the last argument is any flavor of the | |
| 1423 | // '-fno-...' arguments, both PIC and PIE are disabled. Any PIE | |
| 1424 | // option implicitly enables PIC at the same level. | |
| 1425 | if (target.os.tag == .windows and | |
| 1426 | !target_util.isCygwinMinGW(target) and | |
| 1427 | (eqlIgnoreCase(lastpic, "-fpic") or eqlIgnoreCase(lastpic, "-fpie"))) // -fpic/-fPIC, -fpie/-fPIE | |
| 1428 | { | |
| 1429 | try d.unsupportedOptionForTarget(target, lastpic); | |
| 1430 | if (target.cpu.arch == .x86_64) | |
| 1431 | return .{ .two, false }; | |
| 1432 | return .{ .none, false }; | |
| 1433 | } | |
| 1434 | ||
| 1435 | // Check whether the tool chain trumps the PIC-ness decision. If the PIC-ness | |
| 1436 | // is forced, then neither PIC nor PIE flags will have no effect. | |
| 1437 | const forced = switch (target_util.isPICDefaultForced(target)) { | |
| 1438 | .yes => true, | |
| 1439 | .no => false, | |
| 1440 | .depends_on_linker => false, | |
| 1441 | }; | |
| 1442 | if (!forced) { | |
| 1443 | // -fpic/-fPIC, -fpie/-fPIE | |
| 1444 | if (eqlIgnoreCase(lastpic, "-fpic") or eqlIgnoreCase(lastpic, "-fpie")) { | |
| 1445 | pie = eqlIgnoreCase(lastpic, "-fpie"); | |
| 1446 | pic = pie or eqlIgnoreCase(lastpic, "-fpic"); | |
| 1447 | is_piclevel_two = mem.eql(u8, lastpic, "-fPIE") or mem.eql(u8, lastpic, "-fPIC"); | |
| 1448 | } else { | |
| 1449 | pic, pie = .{ false, false }; | |
| 1450 | if (target_util.isPS(target)) { | |
| 1451 | if (d.comp.cmodel != .kernel) { | |
| 1452 | pic = true; | |
| 1453 | try d.warn( | |
| 1454 | "option '{s}' was ignored by the {s} toolchain, using '-fPIC'", | |
| 1455 | .{ lastpic, if (target.os.tag == .ps4) "PS4" else "PS5" }, | |
| 1456 | ); | |
| 1457 | } | |
| 1458 | } | |
| 1459 | } | |
| 1460 | } | |
| 1461 | ||
| 1462 | if (pic and (target.os.tag.isDarwin() or target_util.isPS(target))) { | |
| 1463 | is_piclevel_two = is_piclevel_two or is_pic_default; | |
| 1464 | } | |
| 1465 | ||
| 1466 | // This kernel flags are a trump-card: they will disable PIC/PIE | |
| 1467 | // generation, independent of the argument order. | |
| 1468 | if (kernel_or_kext and | |
| 1469 | (!(target.os.tag != .ios) or (target.os.isAtLeast(.ios, .{ .major = 6, .minor = 0, .patch = 0 }) orelse false)) and | |
| 1470 | !(target.os.tag != .watchos) and | |
| 1471 | !(target.os.tag != .driverkit)) | |
| 1472 | { | |
| 1473 | pie, pic = .{ false, false }; | |
| 1474 | } | |
| 1475 | ||
| 1476 | if (d.dynamic_nopic == true) { | |
| 1477 | if (!target.os.tag.isDarwin()) { | |
| 1478 | try d.unsupportedOptionForTarget(target, "-mdynamic-no-pic"); | |
| 1479 | } | |
| 1480 | pic = is_pic_default or forced; | |
| 1481 | return .{ if (pic) .two else .none, false }; | |
| 1482 | } | |
| 1483 | ||
| 1484 | const embedded_pi_supported = target.cpu.arch.isArm(); | |
| 1485 | if (!embedded_pi_supported) { | |
| 1486 | if (d.ropi) try d.unsupportedOptionForTarget(target, "-fropi"); | |
| 1487 | if (d.rwpi) try d.unsupportedOptionForTarget(target, "-frwpi"); | |
| 1488 | } | |
| 1489 | ||
| 1490 | // ROPI and RWPI are not compatible with PIC or PIE. | |
| 1491 | if ((d.ropi or d.rwpi) and (pic or pie)) { | |
| 1492 | try d.err("embedded and GOT-based position independence are incompatible", .{}); | |
| 1493 | } | |
| 1494 | ||
| 1495 | if (target.cpu.arch.isMIPS()) { | |
| 1496 | // When targeting the N64 ABI, PIC is the default, except in the case | |
| 1497 | // when the -mno-abicalls option is used. In that case we exit | |
| 1498 | // at next check regardless of PIC being set below. | |
| 1499 | // TODO: implement incomplete!! | |
| 1500 | if (target.cpu.arch.isMIPS64()) | |
| 1501 | pic = true; | |
| 1502 | ||
| 1503 | // When targettng MIPS with -mno-abicalls, it's always static. | |
| 1504 | if (d.mabicalls == false) | |
| 1505 | return .{ .none, false }; | |
| 1506 | ||
| 1507 | // Unlike other architectures, MIPS, even with -fPIC/-mxgot/multigot, | |
| 1508 | // does not use PIC level 2 for historical reasons. | |
| 1509 | is_piclevel_two = false; | |
| 1510 | } | |
| 1511 | ||
| 1512 | if (pic) return .{ if (is_piclevel_two) .two else .one, pie }; | |
| 1513 | return .{ .none, false }; | |
| 1514 | } |
lib/compiler/aro/aro/Driver/Filesystem.zig+6-6| ... | ... | @@ -96,7 +96,7 @@ fn findProgramByNamePosix(name: []const u8, path: ?[]const u8, buf: []u8) ?[]con |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | pub const Filesystem = union(enum) { |
| 99 | real: void, | |
| 99 | real: std.fs.Dir, | |
| 100 | 100 | fake: []const Entry, |
| 101 | 101 | |
| 102 | 102 | const Entry = struct { |
| ... | ... | @@ -172,8 +172,8 @@ pub const Filesystem = union(enum) { |
| 172 | 172 | |
| 173 | 173 | pub fn exists(fs: Filesystem, path: []const u8) bool { |
| 174 | 174 | switch (fs) { |
| 175 | .real => { | |
| 176 | std.fs.cwd().access(path, .{}) catch return false; | |
| 175 | .real => |cwd| { | |
| 176 | cwd.access(path, .{}) catch return false; | |
| 177 | 177 | return true; |
| 178 | 178 | }, |
| 179 | 179 | .fake => |paths| return existsFake(paths, path), |
| ... | ... | @@ -210,8 +210,8 @@ pub const Filesystem = union(enum) { |
| 210 | 210 | /// Otherwise returns a slice of `buf`. If the file is larger than `buf` partial contents are returned |
| 211 | 211 | pub fn readFile(fs: Filesystem, path: []const u8, buf: []u8) ?[]const u8 { |
| 212 | 212 | return switch (fs) { |
| 213 | .real => { | |
| 214 | const file = std.fs.cwd().openFile(path, .{}) catch return null; | |
| 213 | .real => |cwd| { | |
| 214 | const file = cwd.openFile(path, .{}) catch return null; | |
| 215 | 215 | defer file.close(); |
| 216 | 216 | |
| 217 | 217 | const bytes_read = file.readAll(buf) catch return null; |
| ... | ... | @@ -223,7 +223,7 @@ pub const Filesystem = union(enum) { |
| 223 | 223 | |
| 224 | 224 | pub fn openDir(fs: Filesystem, dir_name: []const u8) std.fs.Dir.OpenError!Dir { |
| 225 | 225 | return switch (fs) { |
| 226 | .real => .{ .dir = try std.fs.cwd().openDir(dir_name, .{ .access_sub_paths = false, .iterate = true }) }, | |
| 226 | .real => |cwd| .{ .dir = try cwd.openDir(dir_name, .{ .access_sub_paths = false, .iterate = true }) }, | |
| 227 | 227 | .fake => |entries| .{ .fake = .{ .entries = entries, .path = dir_name } }, |
| 228 | 228 | }; |
| 229 | 229 | } |
lib/compiler/aro/aro/Driver/GCCDetector.zig deleted-634| ... | ... | @@ -1,634 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Toolchain = @import("../Toolchain.zig"); | |
| 3 | const target_util = @import("../target.zig"); | |
| 4 | const system_defaults = @import("system_defaults"); | |
| 5 | const GCCVersion = @import("GCCVersion.zig"); | |
| 6 | const Multilib = @import("Multilib.zig"); | |
| 7 | ||
| 8 | const GCCDetector = @This(); | |
| 9 | ||
| 10 | is_valid: bool = false, | |
| 11 | install_path: []const u8 = "", | |
| 12 | parent_lib_path: []const u8 = "", | |
| 13 | version: GCCVersion = .{}, | |
| 14 | gcc_triple: []const u8 = "", | |
| 15 | selected: Multilib = .{}, | |
| 16 | biarch_sibling: ?Multilib = null, | |
| 17 | ||
| 18 | pub fn deinit(self: *GCCDetector) void { | |
| 19 | if (!self.is_valid) return; | |
| 20 | } | |
| 21 | ||
| 22 | pub fn appendToolPath(self: *const GCCDetector, tc: *Toolchain) !void { | |
| 23 | if (!self.is_valid) return; | |
| 24 | return tc.addPathFromComponents(&.{ | |
| 25 | self.parent_lib_path, | |
| 26 | "..", | |
| 27 | self.gcc_triple, | |
| 28 | "bin", | |
| 29 | }, .program); | |
| 30 | } | |
| 31 | ||
| 32 | fn addDefaultGCCPrefixes(prefixes: *std.ArrayListUnmanaged([]const u8), tc: *const Toolchain) !void { | |
| 33 | const sysroot = tc.getSysroot(); | |
| 34 | const target = tc.getTarget(); | |
| 35 | if (sysroot.len == 0 and target.os.tag == .linux and tc.filesystem.exists("/opt/rh")) { | |
| 36 | prefixes.appendAssumeCapacity("/opt/rh/gcc-toolset-12/root/usr"); | |
| 37 | prefixes.appendAssumeCapacity("/opt/rh/gcc-toolset-11/root/usr"); | |
| 38 | prefixes.appendAssumeCapacity("/opt/rh/gcc-toolset-10/root/usr"); | |
| 39 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-12/root/usr"); | |
| 40 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-11/root/usr"); | |
| 41 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-10/root/usr"); | |
| 42 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-9/root/usr"); | |
| 43 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-8/root/usr"); | |
| 44 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-7/root/usr"); | |
| 45 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-6/root/usr"); | |
| 46 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-4/root/usr"); | |
| 47 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-3/root/usr"); | |
| 48 | prefixes.appendAssumeCapacity("/opt/rh/devtoolset-2/root/usr"); | |
| 49 | } | |
| 50 | if (sysroot.len == 0) { | |
| 51 | prefixes.appendAssumeCapacity("/usr"); | |
| 52 | } else { | |
| 53 | var usr_path = try tc.arena.alloc(u8, 4 + sysroot.len); | |
| 54 | @memcpy(usr_path[0..4], "/usr"); | |
| 55 | @memcpy(usr_path[4..], sysroot); | |
| 56 | prefixes.appendAssumeCapacity(usr_path); | |
| 57 | } | |
| 58 | } | |
| 59 | ||
| 60 | fn collectLibDirsAndTriples( | |
| 61 | tc: *Toolchain, | |
| 62 | lib_dirs: *std.ArrayListUnmanaged([]const u8), | |
| 63 | triple_aliases: *std.ArrayListUnmanaged([]const u8), | |
| 64 | biarch_libdirs: *std.ArrayListUnmanaged([]const u8), | |
| 65 | biarch_triple_aliases: *std.ArrayListUnmanaged([]const u8), | |
| 66 | ) !void { | |
| 67 | const AArch64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 68 | const AArch64Triples: [4][]const u8 = .{ "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", "aarch64-suse-linux" }; | |
| 69 | const AArch64beLibDirs: [1][]const u8 = .{"/lib"}; | |
| 70 | const AArch64beTriples: [2][]const u8 = .{ "aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu" }; | |
| 71 | ||
| 72 | const ARMLibDirs: [1][]const u8 = .{"/lib"}; | |
| 73 | const ARMTriples: [1][]const u8 = .{"arm-linux-gnueabi"}; | |
| 74 | const ARMHFTriples: [4][]const u8 = .{ "arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi", "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi" }; | |
| 75 | ||
| 76 | const ARMebLibDirs: [1][]const u8 = .{"/lib"}; | |
| 77 | const ARMebTriples: [1][]const u8 = .{"armeb-linux-gnueabi"}; | |
| 78 | const ARMebHFTriples: [2][]const u8 = .{ "armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi" }; | |
| 79 | ||
| 80 | const AVRLibDirs: [1][]const u8 = .{"/lib"}; | |
| 81 | const AVRTriples: [1][]const u8 = .{"avr"}; | |
| 82 | ||
| 83 | const CSKYLibDirs: [1][]const u8 = .{"/lib"}; | |
| 84 | const CSKYTriples: [3][]const u8 = .{ "csky-linux-gnuabiv2", "csky-linux-uclibcabiv2", "csky-elf-noneabiv2" }; | |
| 85 | ||
| 86 | const X86_64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 87 | const X86_64Triples: [11][]const u8 = .{ | |
| 88 | "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", | |
| 89 | "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", | |
| 90 | "x86_64-redhat-linux", "x86_64-suse-linux", | |
| 91 | "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", | |
| 92 | "x86_64-slackware-linux", "x86_64-unknown-linux", | |
| 93 | "x86_64-amazon-linux", | |
| 94 | }; | |
| 95 | const X32Triples: [2][]const u8 = .{ "x86_64-linux-gnux32", "x86_64-pc-linux-gnux32" }; | |
| 96 | const X32LibDirs: [2][]const u8 = .{ "/libx32", "/lib" }; | |
| 97 | const X86LibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; | |
| 98 | const X86Triples: [9][]const u8 = .{ | |
| 99 | "i586-linux-gnu", "i686-linux-gnu", "i686-pc-linux-gnu", | |
| 100 | "i386-redhat-linux6E", "i686-redhat-linux", "i386-redhat-linux", | |
| 101 | "i586-suse-linux", "i686-montavista-linux", "i686-gnu", | |
| 102 | }; | |
| 103 | ||
| 104 | const LoongArch64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 105 | const LoongArch64Triples: [2][]const u8 = .{ "loongarch64-linux-gnu", "loongarch64-unknown-linux-gnu" }; | |
| 106 | ||
| 107 | const M68kLibDirs: [1][]const u8 = .{"/lib"}; | |
| 108 | const M68kTriples: [3][]const u8 = .{ "m68k-linux-gnu", "m68k-unknown-linux-gnu", "m68k-suse-linux" }; | |
| 109 | ||
| 110 | const MIPSLibDirs: [2][]const u8 = .{ "/libo32", "/lib" }; | |
| 111 | const MIPSTriples: [5][]const u8 = .{ | |
| 112 | "mips-linux-gnu", "mips-mti-linux", | |
| 113 | "mips-mti-linux-gnu", "mips-img-linux-gnu", | |
| 114 | "mipsisa32r6-linux-gnu", | |
| 115 | }; | |
| 116 | const MIPSELLibDirs: [2][]const u8 = .{ "/libo32", "/lib" }; | |
| 117 | const MIPSELTriples: [3][]const u8 = .{ "mipsel-linux-gnu", "mips-img-linux-gnu", "mipsisa32r6el-linux-gnu" }; | |
| 118 | ||
| 119 | const MIPS64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 120 | const MIPS64Triples: [6][]const u8 = .{ | |
| 121 | "mips64-linux-gnu", "mips-mti-linux-gnu", | |
| 122 | "mips-img-linux-gnu", "mips64-linux-gnuabi64", | |
| 123 | "mipsisa64r6-linux-gnu", "mipsisa64r6-linux-gnuabi64", | |
| 124 | }; | |
| 125 | const MIPS64ELLibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 126 | const MIPS64ELTriples: [6][]const u8 = .{ | |
| 127 | "mips64el-linux-gnu", "mips-mti-linux-gnu", | |
| 128 | "mips-img-linux-gnu", "mips64el-linux-gnuabi64", | |
| 129 | "mipsisa64r6el-linux-gnu", "mipsisa64r6el-linux-gnuabi64", | |
| 130 | }; | |
| 131 | ||
| 132 | const MIPSN32LibDirs: [1][]const u8 = .{"/lib32"}; | |
| 133 | const MIPSN32Triples: [2][]const u8 = .{ "mips64-linux-gnuabin32", "mipsisa64r6-linux-gnuabin32" }; | |
| 134 | const MIPSN32ELLibDirs: [1][]const u8 = .{"/lib32"}; | |
| 135 | const MIPSN32ELTriples: [2][]const u8 = .{ "mips64el-linux-gnuabin32", "mipsisa64r6el-linux-gnuabin32" }; | |
| 136 | ||
| 137 | const MSP430LibDirs: [1][]const u8 = .{"/lib"}; | |
| 138 | const MSP430Triples: [1][]const u8 = .{"msp430-elf"}; | |
| 139 | ||
| 140 | const PPCLibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; | |
| 141 | const PPCTriples: [5][]const u8 = .{ | |
| 142 | "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe", | |
| 143 | // On 32-bit PowerPC systems running SUSE Linux, gcc is configured as a | |
| 144 | // 64-bit compiler which defaults to "-m32", hence "powerpc64-suse-linux". | |
| 145 | "powerpc64-suse-linux", "powerpc-montavista-linuxspe", | |
| 146 | }; | |
| 147 | const PPCLELibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; | |
| 148 | const PPCLETriples: [3][]const u8 = .{ "powerpcle-linux-gnu", "powerpcle-unknown-linux-gnu", "powerpcle-linux-musl" }; | |
| 149 | ||
| 150 | const PPC64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 151 | const PPC64Triples: [4][]const u8 = .{ | |
| 152 | "powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu", | |
| 153 | "powerpc64-suse-linux", "ppc64-redhat-linux", | |
| 154 | }; | |
| 155 | const PPC64LELibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 156 | const PPC64LETriples: [5][]const u8 = .{ | |
| 157 | "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu", | |
| 158 | "powerpc64le-none-linux-gnu", "powerpc64le-suse-linux", | |
| 159 | "ppc64le-redhat-linux", | |
| 160 | }; | |
| 161 | ||
| 162 | const RISCV32LibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; | |
| 163 | const RISCV32Triples: [3][]const u8 = .{ "riscv32-unknown-linux-gnu", "riscv32-linux-gnu", "riscv32-unknown-elf" }; | |
| 164 | const RISCV64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 165 | const RISCV64Triples: [3][]const u8 = .{ | |
| 166 | "riscv64-unknown-linux-gnu", | |
| 167 | "riscv64-linux-gnu", | |
| 168 | "riscv64-unknown-elf", | |
| 169 | }; | |
| 170 | ||
| 171 | const SPARCv8LibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; | |
| 172 | const SPARCv8Triples: [2][]const u8 = .{ "sparc-linux-gnu", "sparcv8-linux-gnu" }; | |
| 173 | const SPARCv9LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 174 | const SPARCv9Triples: [2][]const u8 = .{ "sparc64-linux-gnu", "sparcv9-linux-gnu" }; | |
| 175 | ||
| 176 | const SystemZLibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; | |
| 177 | const SystemZTriples: [5][]const u8 = .{ | |
| 178 | "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu", | |
| 179 | "s390x-suse-linux", "s390x-redhat-linux", | |
| 180 | }; | |
| 181 | const target = tc.getTarget(); | |
| 182 | if (target.os.tag == .solaris) { | |
| 183 | // TODO | |
| 184 | return; | |
| 185 | } | |
| 186 | if (target.abi.isAndroid()) { | |
| 187 | const AArch64AndroidTriples: [1][]const u8 = .{"aarch64-linux-android"}; | |
| 188 | const ARMAndroidTriples: [1][]const u8 = .{"arm-linux-androideabi"}; | |
| 189 | const MIPSELAndroidTriples: [1][]const u8 = .{"mipsel-linux-android"}; | |
| 190 | const MIPS64ELAndroidTriples: [1][]const u8 = .{"mips64el-linux-android"}; | |
| 191 | const X86AndroidTriples: [1][]const u8 = .{"i686-linux-android"}; | |
| 192 | const X86_64AndroidTriples: [1][]const u8 = .{"x86_64-linux-android"}; | |
| 193 | ||
| 194 | switch (target.cpu.arch) { | |
| 195 | .aarch64 => { | |
| 196 | lib_dirs.appendSliceAssumeCapacity(&AArch64LibDirs); | |
| 197 | triple_aliases.appendSliceAssumeCapacity(&AArch64AndroidTriples); | |
| 198 | }, | |
| 199 | .arm, | |
| 200 | .thumb, | |
| 201 | => { | |
| 202 | lib_dirs.appendSliceAssumeCapacity(&ARMLibDirs); | |
| 203 | triple_aliases.appendSliceAssumeCapacity(&ARMAndroidTriples); | |
| 204 | }, | |
| 205 | .mipsel => { | |
| 206 | lib_dirs.appendSliceAssumeCapacity(&MIPSELLibDirs); | |
| 207 | triple_aliases.appendSliceAssumeCapacity(&MIPSELAndroidTriples); | |
| 208 | biarch_libdirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); | |
| 209 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPS64ELAndroidTriples); | |
| 210 | }, | |
| 211 | .mips64el => { | |
| 212 | lib_dirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); | |
| 213 | triple_aliases.appendSliceAssumeCapacity(&MIPS64ELAndroidTriples); | |
| 214 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSELLibDirs); | |
| 215 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSELAndroidTriples); | |
| 216 | }, | |
| 217 | .x86_64 => { | |
| 218 | lib_dirs.appendSliceAssumeCapacity(&X86_64LibDirs); | |
| 219 | triple_aliases.appendSliceAssumeCapacity(&X86_64AndroidTriples); | |
| 220 | biarch_libdirs.appendSliceAssumeCapacity(&X86LibDirs); | |
| 221 | biarch_triple_aliases.appendSliceAssumeCapacity(&X86AndroidTriples); | |
| 222 | }, | |
| 223 | .x86 => { | |
| 224 | lib_dirs.appendSliceAssumeCapacity(&X86LibDirs); | |
| 225 | triple_aliases.appendSliceAssumeCapacity(&X86AndroidTriples); | |
| 226 | biarch_libdirs.appendSliceAssumeCapacity(&X86_64LibDirs); | |
| 227 | biarch_triple_aliases.appendSliceAssumeCapacity(&X86_64AndroidTriples); | |
| 228 | }, | |
| 229 | else => {}, | |
| 230 | } | |
| 231 | return; | |
| 232 | } | |
| 233 | switch (target.cpu.arch) { | |
| 234 | .aarch64 => { | |
| 235 | lib_dirs.appendSliceAssumeCapacity(&AArch64LibDirs); | |
| 236 | triple_aliases.appendSliceAssumeCapacity(&AArch64Triples); | |
| 237 | biarch_libdirs.appendSliceAssumeCapacity(&AArch64LibDirs); | |
| 238 | biarch_triple_aliases.appendSliceAssumeCapacity(&AArch64Triples); | |
| 239 | }, | |
| 240 | .aarch64_be => { | |
| 241 | lib_dirs.appendSliceAssumeCapacity(&AArch64beLibDirs); | |
| 242 | triple_aliases.appendSliceAssumeCapacity(&AArch64beTriples); | |
| 243 | biarch_libdirs.appendSliceAssumeCapacity(&AArch64beLibDirs); | |
| 244 | biarch_triple_aliases.appendSliceAssumeCapacity(&AArch64beTriples); | |
| 245 | }, | |
| 246 | .arm, .thumb => { | |
| 247 | lib_dirs.appendSliceAssumeCapacity(&ARMLibDirs); | |
| 248 | if (target.abi == .gnueabihf) { | |
| 249 | triple_aliases.appendSliceAssumeCapacity(&ARMHFTriples); | |
| 250 | } else { | |
| 251 | triple_aliases.appendSliceAssumeCapacity(&ARMTriples); | |
| 252 | } | |
| 253 | }, | |
| 254 | .armeb, .thumbeb => { | |
| 255 | lib_dirs.appendSliceAssumeCapacity(&ARMebLibDirs); | |
| 256 | if (target.abi == .gnueabihf) { | |
| 257 | triple_aliases.appendSliceAssumeCapacity(&ARMebHFTriples); | |
| 258 | } else { | |
| 259 | triple_aliases.appendSliceAssumeCapacity(&ARMebTriples); | |
| 260 | } | |
| 261 | }, | |
| 262 | .avr => { | |
| 263 | lib_dirs.appendSliceAssumeCapacity(&AVRLibDirs); | |
| 264 | triple_aliases.appendSliceAssumeCapacity(&AVRTriples); | |
| 265 | }, | |
| 266 | .csky => { | |
| 267 | lib_dirs.appendSliceAssumeCapacity(&CSKYLibDirs); | |
| 268 | triple_aliases.appendSliceAssumeCapacity(&CSKYTriples); | |
| 269 | }, | |
| 270 | .x86_64 => { | |
| 271 | if (target.abi == .gnux32 or target.abi == .muslx32) { | |
| 272 | lib_dirs.appendSliceAssumeCapacity(&X32LibDirs); | |
| 273 | triple_aliases.appendSliceAssumeCapacity(&X32Triples); | |
| 274 | biarch_libdirs.appendSliceAssumeCapacity(&X86_64LibDirs); | |
| 275 | biarch_triple_aliases.appendSliceAssumeCapacity(&X86_64Triples); | |
| 276 | } else { | |
| 277 | lib_dirs.appendSliceAssumeCapacity(&X86_64LibDirs); | |
| 278 | triple_aliases.appendSliceAssumeCapacity(&X86_64Triples); | |
| 279 | biarch_libdirs.appendSliceAssumeCapacity(&X32LibDirs); | |
| 280 | biarch_triple_aliases.appendSliceAssumeCapacity(&X32Triples); | |
| 281 | } | |
| 282 | biarch_libdirs.appendSliceAssumeCapacity(&X86LibDirs); | |
| 283 | biarch_triple_aliases.appendSliceAssumeCapacity(&X86Triples); | |
| 284 | }, | |
| 285 | .x86 => { | |
| 286 | lib_dirs.appendSliceAssumeCapacity(&X86LibDirs); | |
| 287 | triple_aliases.appendSliceAssumeCapacity(&X86Triples); | |
| 288 | biarch_libdirs.appendSliceAssumeCapacity(&X86_64LibDirs); | |
| 289 | biarch_triple_aliases.appendSliceAssumeCapacity(&X86_64Triples); | |
| 290 | biarch_libdirs.appendSliceAssumeCapacity(&X32LibDirs); | |
| 291 | biarch_triple_aliases.appendSliceAssumeCapacity(&X32Triples); | |
| 292 | }, | |
| 293 | .loongarch64 => { | |
| 294 | lib_dirs.appendSliceAssumeCapacity(&LoongArch64LibDirs); | |
| 295 | triple_aliases.appendSliceAssumeCapacity(&LoongArch64Triples); | |
| 296 | }, | |
| 297 | .m68k => { | |
| 298 | lib_dirs.appendSliceAssumeCapacity(&M68kLibDirs); | |
| 299 | triple_aliases.appendSliceAssumeCapacity(&M68kTriples); | |
| 300 | }, | |
| 301 | .mips => { | |
| 302 | lib_dirs.appendSliceAssumeCapacity(&MIPSLibDirs); | |
| 303 | triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); | |
| 304 | biarch_libdirs.appendSliceAssumeCapacity(&MIPS64LibDirs); | |
| 305 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPS64Triples); | |
| 306 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32LibDirs); | |
| 307 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32Triples); | |
| 308 | }, | |
| 309 | .mipsel => { | |
| 310 | lib_dirs.appendSliceAssumeCapacity(&MIPSELLibDirs); | |
| 311 | triple_aliases.appendSliceAssumeCapacity(&MIPSELTriples); | |
| 312 | triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); | |
| 313 | biarch_libdirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); | |
| 314 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPS64ELTriples); | |
| 315 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32ELLibDirs); | |
| 316 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32ELTriples); | |
| 317 | }, | |
| 318 | .mips64 => { | |
| 319 | lib_dirs.appendSliceAssumeCapacity(&MIPS64LibDirs); | |
| 320 | triple_aliases.appendSliceAssumeCapacity(&MIPS64Triples); | |
| 321 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSLibDirs); | |
| 322 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); | |
| 323 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32LibDirs); | |
| 324 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32Triples); | |
| 325 | }, | |
| 326 | .mips64el => { | |
| 327 | lib_dirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); | |
| 328 | triple_aliases.appendSliceAssumeCapacity(&MIPS64ELTriples); | |
| 329 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSELLibDirs); | |
| 330 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSELTriples); | |
| 331 | biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32ELLibDirs); | |
| 332 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32ELTriples); | |
| 333 | biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); | |
| 334 | }, | |
| 335 | .msp430 => { | |
| 336 | lib_dirs.appendSliceAssumeCapacity(&MSP430LibDirs); | |
| 337 | triple_aliases.appendSliceAssumeCapacity(&MSP430Triples); | |
| 338 | }, | |
| 339 | .powerpc => { | |
| 340 | lib_dirs.appendSliceAssumeCapacity(&PPCLibDirs); | |
| 341 | triple_aliases.appendSliceAssumeCapacity(&PPCTriples); | |
| 342 | biarch_libdirs.appendSliceAssumeCapacity(&PPC64LibDirs); | |
| 343 | biarch_triple_aliases.appendSliceAssumeCapacity(&PPC64Triples); | |
| 344 | }, | |
| 345 | .powerpcle => { | |
| 346 | lib_dirs.appendSliceAssumeCapacity(&PPCLELibDirs); | |
| 347 | triple_aliases.appendSliceAssumeCapacity(&PPCLETriples); | |
| 348 | biarch_libdirs.appendSliceAssumeCapacity(&PPC64LELibDirs); | |
| 349 | biarch_triple_aliases.appendSliceAssumeCapacity(&PPC64LETriples); | |
| 350 | }, | |
| 351 | .powerpc64 => { | |
| 352 | lib_dirs.appendSliceAssumeCapacity(&PPC64LibDirs); | |
| 353 | triple_aliases.appendSliceAssumeCapacity(&PPC64Triples); | |
| 354 | biarch_libdirs.appendSliceAssumeCapacity(&PPCLibDirs); | |
| 355 | biarch_triple_aliases.appendSliceAssumeCapacity(&PPCTriples); | |
| 356 | }, | |
| 357 | .powerpc64le => { | |
| 358 | lib_dirs.appendSliceAssumeCapacity(&PPC64LELibDirs); | |
| 359 | triple_aliases.appendSliceAssumeCapacity(&PPC64LETriples); | |
| 360 | biarch_libdirs.appendSliceAssumeCapacity(&PPCLELibDirs); | |
| 361 | biarch_triple_aliases.appendSliceAssumeCapacity(&PPCLETriples); | |
| 362 | }, | |
| 363 | .riscv32 => { | |
| 364 | lib_dirs.appendSliceAssumeCapacity(&RISCV32LibDirs); | |
| 365 | triple_aliases.appendSliceAssumeCapacity(&RISCV32Triples); | |
| 366 | biarch_libdirs.appendSliceAssumeCapacity(&RISCV64LibDirs); | |
| 367 | biarch_triple_aliases.appendSliceAssumeCapacity(&RISCV64Triples); | |
| 368 | }, | |
| 369 | .riscv64 => { | |
| 370 | lib_dirs.appendSliceAssumeCapacity(&RISCV64LibDirs); | |
| 371 | triple_aliases.appendSliceAssumeCapacity(&RISCV64Triples); | |
| 372 | biarch_libdirs.appendSliceAssumeCapacity(&RISCV32LibDirs); | |
| 373 | biarch_triple_aliases.appendSliceAssumeCapacity(&RISCV32Triples); | |
| 374 | }, | |
| 375 | .sparc => { | |
| 376 | lib_dirs.appendSliceAssumeCapacity(&SPARCv8LibDirs); | |
| 377 | triple_aliases.appendSliceAssumeCapacity(&SPARCv8Triples); | |
| 378 | biarch_libdirs.appendSliceAssumeCapacity(&SPARCv9LibDirs); | |
| 379 | biarch_triple_aliases.appendSliceAssumeCapacity(&SPARCv9Triples); | |
| 380 | }, | |
| 381 | .sparc64 => { | |
| 382 | lib_dirs.appendSliceAssumeCapacity(&SPARCv9LibDirs); | |
| 383 | triple_aliases.appendSliceAssumeCapacity(&SPARCv9Triples); | |
| 384 | biarch_libdirs.appendSliceAssumeCapacity(&SPARCv8LibDirs); | |
| 385 | biarch_triple_aliases.appendSliceAssumeCapacity(&SPARCv8Triples); | |
| 386 | }, | |
| 387 | .s390x => { | |
| 388 | lib_dirs.appendSliceAssumeCapacity(&SystemZLibDirs); | |
| 389 | triple_aliases.appendSliceAssumeCapacity(&SystemZTriples); | |
| 390 | }, | |
| 391 | else => {}, | |
| 392 | } | |
| 393 | } | |
| 394 | ||
| 395 | pub fn discover(self: *GCCDetector, tc: *Toolchain) !void { | |
| 396 | var path_buf: [std.fs.max_path_bytes]u8 = undefined; | |
| 397 | var fib = std.heap.FixedBufferAllocator.init(&path_buf); | |
| 398 | ||
| 399 | const target = tc.getTarget(); | |
| 400 | const biarch_variant_target = if (target.ptrBitWidth() == 32) | |
| 401 | target_util.get64BitArchVariant(target) | |
| 402 | else | |
| 403 | target_util.get32BitArchVariant(target); | |
| 404 | ||
| 405 | var candidate_lib_dirs_buffer: [16][]const u8 = undefined; | |
| 406 | var candidate_lib_dirs = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_lib_dirs_buffer); | |
| 407 | ||
| 408 | var candidate_triple_aliases_buffer: [16][]const u8 = undefined; | |
| 409 | var candidate_triple_aliases = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_triple_aliases_buffer); | |
| 410 | ||
| 411 | var candidate_biarch_lib_dirs_buffer: [16][]const u8 = undefined; | |
| 412 | var candidate_biarch_lib_dirs = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_biarch_lib_dirs_buffer); | |
| 413 | ||
| 414 | var candidate_biarch_triple_aliases_buffer: [16][]const u8 = undefined; | |
| 415 | var candidate_biarch_triple_aliases = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_biarch_triple_aliases_buffer); | |
| 416 | ||
| 417 | try collectLibDirsAndTriples( | |
| 418 | tc, | |
| 419 | &candidate_lib_dirs, | |
| 420 | &candidate_triple_aliases, | |
| 421 | &candidate_biarch_lib_dirs, | |
| 422 | &candidate_biarch_triple_aliases, | |
| 423 | ); | |
| 424 | ||
| 425 | var target_buf: [64]u8 = undefined; | |
| 426 | const triple_str = target_util.toLLVMTriple(target, &target_buf); | |
| 427 | candidate_triple_aliases.appendAssumeCapacity(triple_str); | |
| 428 | ||
| 429 | // Also include the multiarch variant if it's different. | |
| 430 | var biarch_buf: [64]u8 = undefined; | |
| 431 | if (biarch_variant_target) |biarch_target| { | |
| 432 | const biarch_triple_str = target_util.toLLVMTriple(biarch_target, &biarch_buf); | |
| 433 | if (!std.mem.eql(u8, biarch_triple_str, triple_str)) { | |
| 434 | candidate_triple_aliases.appendAssumeCapacity(biarch_triple_str); | |
| 435 | } | |
| 436 | } | |
| 437 | ||
| 438 | var prefixes_buf: [16][]const u8 = undefined; | |
| 439 | var prefixes = std.ArrayListUnmanaged([]const u8).initBuffer(&prefixes_buf); | |
| 440 | const gcc_toolchain_dir = gccToolchainDir(tc); | |
| 441 | if (gcc_toolchain_dir.len != 0) { | |
| 442 | const adjusted = if (gcc_toolchain_dir[gcc_toolchain_dir.len - 1] == '/') | |
| 443 | gcc_toolchain_dir[0 .. gcc_toolchain_dir.len - 1] | |
| 444 | else | |
| 445 | gcc_toolchain_dir; | |
| 446 | prefixes.appendAssumeCapacity(adjusted); | |
| 447 | } else { | |
| 448 | const sysroot = tc.getSysroot(); | |
| 449 | if (sysroot.len > 0) { | |
| 450 | prefixes.appendAssumeCapacity(sysroot); | |
| 451 | try addDefaultGCCPrefixes(&prefixes, tc); | |
| 452 | } | |
| 453 | ||
| 454 | if (sysroot.len == 0) { | |
| 455 | try addDefaultGCCPrefixes(&prefixes, tc); | |
| 456 | } | |
| 457 | // TODO: Special-case handling for Gentoo | |
| 458 | } | |
| 459 | ||
| 460 | const v0 = GCCVersion.parse("0.0.0"); | |
| 461 | for (prefixes.items) |prefix| { | |
| 462 | if (!tc.filesystem.exists(prefix)) continue; | |
| 463 | ||
| 464 | for (candidate_lib_dirs.items) |suffix| { | |
| 465 | defer fib.reset(); | |
| 466 | const lib_dir = std.fs.path.join(fib.allocator(), &.{ prefix, suffix }) catch continue; | |
| 467 | if (!tc.filesystem.exists(lib_dir)) continue; | |
| 468 | ||
| 469 | const gcc_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc" }); | |
| 470 | const gcc_cross_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc-cross" }); | |
| 471 | ||
| 472 | try self.scanLibDirForGCCTriple(tc, target, lib_dir, triple_str, false, gcc_dir_exists, gcc_cross_dir_exists); | |
| 473 | for (candidate_triple_aliases.items) |candidate| { | |
| 474 | try self.scanLibDirForGCCTriple(tc, target, lib_dir, candidate, false, gcc_dir_exists, gcc_cross_dir_exists); | |
| 475 | } | |
| 476 | } | |
| 477 | for (candidate_biarch_lib_dirs.items) |suffix| { | |
| 478 | const lib_dir = std.fs.path.join(fib.allocator(), &.{ prefix, suffix }) catch continue; | |
| 479 | if (!tc.filesystem.exists(lib_dir)) continue; | |
| 480 | ||
| 481 | const gcc_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc" }); | |
| 482 | const gcc_cross_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc-cross" }); | |
| 483 | for (candidate_biarch_triple_aliases.items) |candidate| { | |
| 484 | try self.scanLibDirForGCCTriple(tc, target, lib_dir, candidate, true, gcc_dir_exists, gcc_cross_dir_exists); | |
| 485 | } | |
| 486 | } | |
| 487 | if (self.version.order(v0) == .gt) break; | |
| 488 | } | |
| 489 | } | |
| 490 | ||
| 491 | fn findBiarchMultilibs( | |
| 492 | tc: *const Toolchain, | |
| 493 | result: *Multilib.Detected, | |
| 494 | target: std.Target, | |
| 495 | path: [2][]const u8, | |
| 496 | needs_biarch_suffix: bool, | |
| 497 | ) !bool { | |
| 498 | const suff64 = if (target.os.tag == .solaris) switch (target.cpu.arch) { | |
| 499 | .x86, .x86_64 => "/amd64", | |
| 500 | .sparc => "/sparcv9", | |
| 501 | else => "/64", | |
| 502 | } else "/64"; | |
| 503 | ||
| 504 | const alt_64 = Multilib.init(suff64, suff64, &.{ "-m32", "+m64", "-mx32" }); | |
| 505 | const alt_32 = Multilib.init("/32", "/32", &.{ "+m32", "-m64", "-mx32" }); | |
| 506 | const alt_x32 = Multilib.init("/x32", "/x32", &.{ "-m32", "-m64", "+mx32" }); | |
| 507 | ||
| 508 | const multilib_filter = Multilib.Filter{ | |
| 509 | .base = path, | |
| 510 | .file = "crtbegin.o", | |
| 511 | }; | |
| 512 | ||
| 513 | const Want = enum { | |
| 514 | want32, | |
| 515 | want64, | |
| 516 | wantx32, | |
| 517 | }; | |
| 518 | const is_x32 = target.abi == .gnux32 or target.abi == .muslx32; | |
| 519 | const target_ptr_width = target.ptrBitWidth(); | |
| 520 | const want: Want = if (target_ptr_width == 32 and multilib_filter.exists(alt_32, tc.filesystem)) | |
| 521 | .want64 | |
| 522 | else if (target_ptr_width == 64 and is_x32 and multilib_filter.exists(alt_x32, tc.filesystem)) | |
| 523 | .want64 | |
| 524 | else if (target_ptr_width == 64 and !is_x32 and multilib_filter.exists(alt_64, tc.filesystem)) | |
| 525 | .want32 | |
| 526 | else if (target_ptr_width == 32) | |
| 527 | if (needs_biarch_suffix) .want64 else .want32 | |
| 528 | else if (is_x32) | |
| 529 | if (needs_biarch_suffix) .want64 else .wantx32 | |
| 530 | else if (needs_biarch_suffix) .want32 else .want64; | |
| 531 | ||
| 532 | const default = switch (want) { | |
| 533 | .want32 => Multilib.init("", "", &.{ "+m32", "-m64", "-mx32" }), | |
| 534 | .want64 => Multilib.init("", "", &.{ "-m32", "+m64", "-mx32" }), | |
| 535 | .wantx32 => Multilib.init("", "", &.{ "-m32", "-m64", "+mx32" }), | |
| 536 | }; | |
| 537 | result.multilibs.appendSliceAssumeCapacity(&.{ | |
| 538 | default, | |
| 539 | alt_64, | |
| 540 | alt_32, | |
| 541 | alt_x32, | |
| 542 | }); | |
| 543 | result.filter(multilib_filter, tc.filesystem); | |
| 544 | var flags: Multilib.Flags = .{}; | |
| 545 | flags.appendAssumeCapacity(if (target_ptr_width == 64 and !is_x32) "+m64" else "-m64"); | |
| 546 | flags.appendAssumeCapacity(if (target_ptr_width == 32) "+m32" else "-m32"); | |
| 547 | flags.appendAssumeCapacity(if (target_ptr_width == 64 and is_x32) "+mx32" else "-mx32"); | |
| 548 | ||
| 549 | return result.select(flags); | |
| 550 | } | |
| 551 | ||
| 552 | fn scanGCCForMultilibs( | |
| 553 | self: *GCCDetector, | |
| 554 | tc: *const Toolchain, | |
| 555 | target: std.Target, | |
| 556 | path: [2][]const u8, | |
| 557 | needs_biarch_suffix: bool, | |
| 558 | ) !bool { | |
| 559 | var detected: Multilib.Detected = .{}; | |
| 560 | if (target.cpu.arch == .csky) { | |
| 561 | // TODO | |
| 562 | } else if (target.cpu.arch.isMIPS()) { | |
| 563 | // TODO | |
| 564 | } else if (target.cpu.arch.isRISCV()) { | |
| 565 | // TODO | |
| 566 | } else if (target.cpu.arch == .msp430) { | |
| 567 | // TODO | |
| 568 | } else if (target.cpu.arch == .avr) { | |
| 569 | // No multilibs | |
| 570 | } else if (!try findBiarchMultilibs(tc, &detected, target, path, needs_biarch_suffix)) { | |
| 571 | return false; | |
| 572 | } | |
| 573 | self.selected = detected.selected; | |
| 574 | self.biarch_sibling = detected.biarch_sibling; | |
| 575 | return true; | |
| 576 | } | |
| 577 | ||
| 578 | fn scanLibDirForGCCTriple( | |
| 579 | self: *GCCDetector, | |
| 580 | tc: *const Toolchain, | |
| 581 | target: std.Target, | |
| 582 | lib_dir: []const u8, | |
| 583 | candidate_triple: []const u8, | |
| 584 | needs_biarch_suffix: bool, | |
| 585 | gcc_dir_exists: bool, | |
| 586 | gcc_cross_dir_exists: bool, | |
| 587 | ) !void { | |
| 588 | var path_buf: [std.fs.max_path_bytes]u8 = undefined; | |
| 589 | var fib = std.heap.FixedBufferAllocator.init(&path_buf); | |
| 590 | for (0..2) |i| { | |
| 591 | if (i == 0 and !gcc_dir_exists) continue; | |
| 592 | if (i == 1 and !gcc_cross_dir_exists) continue; | |
| 593 | defer fib.reset(); | |
| 594 | ||
| 595 | const base: []const u8 = if (i == 0) "gcc" else "gcc-cross"; | |
| 596 | var lib_suffix_buf: [64]u8 = undefined; | |
| 597 | var suffix_buf_fib = std.heap.FixedBufferAllocator.init(&lib_suffix_buf); | |
| 598 | const lib_suffix = std.fs.path.join(suffix_buf_fib.allocator(), &.{ base, candidate_triple }) catch continue; | |
| 599 | ||
| 600 | const dir_name = std.fs.path.join(fib.allocator(), &.{ lib_dir, lib_suffix }) catch continue; | |
| 601 | var parent_dir = tc.filesystem.openDir(dir_name) catch continue; | |
| 602 | defer parent_dir.close(); | |
| 603 | ||
| 604 | var it = parent_dir.iterate(); | |
| 605 | while (it.next() catch continue) |entry| { | |
| 606 | if (entry.kind != .directory) continue; | |
| 607 | ||
| 608 | const version_text = entry.name; | |
| 609 | const candidate_version = GCCVersion.parse(version_text); | |
| 610 | if (candidate_version.major != -1) { | |
| 611 | // TODO: cache path so we're not repeatedly scanning | |
| 612 | } | |
| 613 | if (candidate_version.isLessThan(4, 1, 1, "")) continue; | |
| 614 | switch (candidate_version.order(self.version)) { | |
| 615 | .lt, .eq => continue, | |
| 616 | .gt => {}, | |
| 617 | } | |
| 618 | ||
| 619 | if (!try self.scanGCCForMultilibs(tc, target, .{ dir_name, version_text }, needs_biarch_suffix)) continue; | |
| 620 | ||
| 621 | self.version = candidate_version; | |
| 622 | self.gcc_triple = try tc.arena.dupe(u8, candidate_triple); | |
| 623 | self.install_path = try std.fs.path.join(tc.arena, &.{ lib_dir, lib_suffix, version_text }); | |
| 624 | self.parent_lib_path = try std.fs.path.join(tc.arena, &.{ self.install_path, "..", "..", ".." }); | |
| 625 | self.is_valid = true; | |
| 626 | } | |
| 627 | } | |
| 628 | } | |
| 629 | ||
| 630 | fn gccToolchainDir(tc: *const Toolchain) []const u8 { | |
| 631 | const sysroot = tc.getSysroot(); | |
| 632 | if (sysroot.len != 0) return ""; | |
| 633 | return system_defaults.gcc_install_prefix; | |
| 634 | } |
lib/compiler/aro/aro/Driver/GCCVersion.zig+1-1| ... | ... | @@ -57,7 +57,7 @@ pub fn parse(text: []const u8) GCCVersion { |
| 57 | 57 | var good = bad; |
| 58 | 58 | |
| 59 | 59 | var it = mem.splitScalar(u8, text, '.'); |
| 60 | const first = it.next().?; | |
| 60 | const first = it.first(); | |
| 61 | 61 | const second = it.next() orelse ""; |
| 62 | 62 | const rest = it.next() orelse ""; |
| 63 | 63 |
lib/compiler/aro/aro/Driver/Multilib.zig+32-23| ... | ... | @@ -1,47 +1,50 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const Filesystem = @import("Filesystem.zig").Filesystem; |
| 3 | 3 | |
| 4 | pub const Flags = std.BoundedArray([]const u8, 6); | |
| 5 | ||
| 6 | 4 | /// Large enough for GCCDetector for Linux; may need to be increased to support other toolchains. |
| 7 | 5 | const max_multilibs = 4; |
| 8 | 6 | |
| 9 | const MultilibArray = std.BoundedArray(Multilib, max_multilibs); | |
| 10 | ||
| 11 | 7 | pub const Detected = struct { |
| 12 | multilibs: MultilibArray = .{}, | |
| 8 | multilib_buf: [max_multilibs]Multilib = undefined, | |
| 9 | multilib_count: u8 = 0, | |
| 13 | 10 | selected: Multilib = .{}, |
| 14 | 11 | biarch_sibling: ?Multilib = null, |
| 15 | 12 | |
| 16 | pub fn filter(self: *Detected, multilib_filter: Filter, fs: Filesystem) void { | |
| 17 | var found_count: usize = 0; | |
| 18 | for (self.multilibs.constSlice()) |multilib| { | |
| 13 | pub fn filter(d: *Detected, multilib_filter: Filter, fs: Filesystem) void { | |
| 14 | var found_count: u8 = 0; | |
| 15 | for (d.multilibs()) |multilib| { | |
| 19 | 16 | if (multilib_filter.exists(multilib, fs)) { |
| 20 | self.multilibs.set(found_count, multilib); | |
| 17 | d.multilib_buf[found_count] = multilib; | |
| 21 | 18 | found_count += 1; |
| 22 | 19 | } |
| 23 | 20 | } |
| 24 | self.multilibs.resize(found_count) catch unreachable; | |
| 21 | d.multilib_count = found_count; | |
| 25 | 22 | } |
| 26 | 23 | |
| 27 | pub fn select(self: *Detected, flags: Flags) !bool { | |
| 28 | var filtered: MultilibArray = .{}; | |
| 29 | for (self.multilibs.constSlice()) |multilib| { | |
| 30 | for (multilib.flags.constSlice()) |multilib_flag| { | |
| 31 | const matched = for (flags.constSlice()) |arg_flag| { | |
| 24 | pub fn select(d: *Detected, check_flags: []const []const u8) !bool { | |
| 25 | var selected: ?Multilib = null; | |
| 26 | ||
| 27 | for (d.multilibs()) |multilib| { | |
| 28 | for (multilib.flags()) |multilib_flag| { | |
| 29 | const matched = for (check_flags) |arg_flag| { | |
| 32 | 30 | if (std.mem.eql(u8, arg_flag[1..], multilib_flag[1..])) break arg_flag; |
| 33 | 31 | } else multilib_flag; |
| 34 | 32 | if (matched[0] != multilib_flag[0]) break; |
| 33 | } else if (selected != null) { | |
| 34 | return error.TooManyMultilibs; | |
| 35 | 35 | } else { |
| 36 | filtered.appendAssumeCapacity(multilib); | |
| 36 | selected = multilib; | |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | if (filtered.len == 0) return false; | |
| 40 | if (filtered.len == 1) { | |
| 41 | self.selected = filtered.get(0); | |
| 39 | if (selected) |multilib| { | |
| 40 | d.selected = multilib; | |
| 42 | 41 | return true; |
| 43 | 42 | } |
| 44 | return error.TooManyMultilibs; | |
| 43 | return false; | |
| 44 | } | |
| 45 | ||
| 46 | pub fn multilibs(d: *const Detected) []const Multilib { | |
| 47 | return d.multilib_buf[0..d.multilib_count]; | |
| 45 | 48 | } |
| 46 | 49 | }; |
| 47 | 50 | |
| ... | ... | @@ -58,14 +61,20 @@ const Multilib = @This(); |
| 58 | 61 | gcc_suffix: []const u8 = "", |
| 59 | 62 | os_suffix: []const u8 = "", |
| 60 | 63 | include_suffix: []const u8 = "", |
| 61 | flags: Flags = .{}, | |
| 64 | flag_buf: [6][]const u8 = undefined, | |
| 65 | flag_count: u8 = 0, | |
| 62 | 66 | priority: u32 = 0, |
| 63 | 67 | |
| 64 | pub fn init(gcc_suffix: []const u8, os_suffix: []const u8, flags: []const []const u8) Multilib { | |
| 68 | pub fn init(gcc_suffix: []const u8, os_suffix: []const u8, init_flags: []const []const u8) Multilib { | |
| 65 | 69 | var self: Multilib = .{ |
| 66 | 70 | .gcc_suffix = gcc_suffix, |
| 67 | 71 | .os_suffix = os_suffix, |
| 72 | .flag_count = @intCast(init_flags.len), | |
| 68 | 73 | }; |
| 69 | self.flags.appendSliceAssumeCapacity(flags); | |
| 74 | @memcpy(self.flag_buf[0..init_flags.len], init_flags); | |
| 70 | 75 | return self; |
| 71 | 76 | } |
| 77 | ||
| 78 | pub fn flags(m: *const Multilib) []const []const u8 { | |
| 79 | return m.flag_buf[0..m.flag_count]; | |
| 80 | } |
lib/compiler/aro/aro/Hideset.zig+4-3| ... | ... | @@ -10,8 +10,9 @@ |
| 10 | 10 | const std = @import("std"); |
| 11 | 11 | const mem = std.mem; |
| 12 | 12 | const Allocator = mem.Allocator; |
| 13 | const Source = @import("Source.zig"); | |
| 13 | ||
| 14 | 14 | const Compilation = @import("Compilation.zig"); |
| 15 | const Source = @import("Source.zig"); | |
| 15 | 16 | const Tokenizer = @import("Tokenizer.zig"); |
| 16 | 17 | |
| 17 | 18 | pub const Hideset = @This(); |
| ... | ... | @@ -51,10 +52,10 @@ pub const Index = enum(u32) { |
| 51 | 52 | _, |
| 52 | 53 | }; |
| 53 | 54 | |
| 54 | map: std.AutoHashMapUnmanaged(Identifier, Index) = .empty, | |
| 55 | map: std.AutoHashMapUnmanaged(Identifier, Index) = .{}, | |
| 55 | 56 | /// Used for computing union/intersection of two lists; stored here so that allocations can be retained |
| 56 | 57 | /// until hideset is deinit'ed |
| 57 | tmp_map: std.AutoHashMapUnmanaged(Identifier, void) = .empty, | |
| 58 | tmp_map: std.AutoHashMapUnmanaged(Identifier, void) = .{}, | |
| 58 | 59 | linked_list: Item.List = .{}, |
| 59 | 60 | comp: *const Compilation, |
| 60 | 61 |
lib/compiler/aro/aro/InitList.zig+18-71| ... | ... | @@ -3,17 +3,16 @@ |
| 3 | 3 | const std = @import("std"); |
| 4 | 4 | const Allocator = std.mem.Allocator; |
| 5 | 5 | const testing = std.testing; |
| 6 | ||
| 7 | const Diagnostics = @import("Diagnostics.zig"); | |
| 8 | const Parser = @import("Parser.zig"); | |
| 6 | 9 | const Tree = @import("Tree.zig"); |
| 7 | 10 | const Token = Tree.Token; |
| 8 | 11 | const TokenIndex = Tree.TokenIndex; |
| 9 | const NodeIndex = Tree.NodeIndex; | |
| 10 | const Type = @import("Type.zig"); | |
| 11 | const Diagnostics = @import("Diagnostics.zig"); | |
| 12 | const NodeList = std.array_list.Managed(NodeIndex); | |
| 13 | const Parser = @import("Parser.zig"); | |
| 12 | const Node = Tree.Node; | |
| 14 | 13 | |
| 15 | 14 | const Item = struct { |
| 16 | list: InitList = .{}, | |
| 15 | list: InitList, | |
| 17 | 16 | index: u64, |
| 18 | 17 | |
| 19 | 18 | fn order(_: void, a: Item, b: Item) std.math.Order { |
| ... | ... | @@ -23,8 +22,8 @@ const Item = struct { |
| 23 | 22 | |
| 24 | 23 | const InitList = @This(); |
| 25 | 24 | |
| 26 | list: std.ArrayListUnmanaged(Item) = .empty, | |
| 27 | node: NodeIndex = .none, | |
| 25 | list: std.ArrayList(Item) = .empty, | |
| 26 | node: Node.OptIndex = .null, | |
| 28 | 27 | tok: TokenIndex = 0, |
| 29 | 28 | |
| 30 | 29 | /// Deinitialize freeing all memory. |
| ... | ... | @@ -34,50 +33,6 @@ pub fn deinit(il: *InitList, gpa: Allocator) void { |
| 34 | 33 | il.* = undefined; |
| 35 | 34 | } |
| 36 | 35 | |
| 37 | /// Insert initializer at index, returning previous entry if one exists. | |
| 38 | pub fn put(il: *InitList, gpa: Allocator, index: usize, node: NodeIndex, tok: TokenIndex) !?TokenIndex { | |
| 39 | const items = il.list.items; | |
| 40 | var left: usize = 0; | |
| 41 | var right: usize = items.len; | |
| 42 | ||
| 43 | // Append new value to empty list | |
| 44 | if (left == right) { | |
| 45 | const item = try il.list.addOne(gpa); | |
| 46 | item.* = .{ | |
| 47 | .list = .{ .node = node, .tok = tok }, | |
| 48 | .index = index, | |
| 49 | }; | |
| 50 | return null; | |
| 51 | } | |
| 52 | ||
| 53 | while (left < right) { | |
| 54 | // Avoid overflowing in the midpoint calculation | |
| 55 | const mid = left + (right - left) / 2; | |
| 56 | // Compare the key with the midpoint element | |
| 57 | switch (std.math.order(index, items[mid].index)) { | |
| 58 | .eq => { | |
| 59 | // Replace previous entry. | |
| 60 | const prev = items[mid].list.tok; | |
| 61 | items[mid].list.deinit(gpa); | |
| 62 | items[mid] = .{ | |
| 63 | .list = .{ .node = node, .tok = tok }, | |
| 64 | .index = index, | |
| 65 | }; | |
| 66 | return prev; | |
| 67 | }, | |
| 68 | .gt => left = mid + 1, | |
| 69 | .lt => right = mid, | |
| 70 | } | |
| 71 | } | |
| 72 | ||
| 73 | // Insert a new value into a sorted position. | |
| 74 | try il.list.insert(gpa, left, .{ | |
| 75 | .list = .{ .node = node, .tok = tok }, | |
| 76 | .index = index, | |
| 77 | }); | |
| 78 | return null; | |
| 79 | } | |
| 80 | ||
| 81 | 36 | /// Find item at index, create new if one does not exist. |
| 82 | 37 | pub fn find(il: *InitList, gpa: Allocator, index: u64) !*InitList { |
| 83 | 38 | const items = il.list.items; |
| ... | ... | @@ -85,13 +40,21 @@ pub fn find(il: *InitList, gpa: Allocator, index: u64) !*InitList { |
| 85 | 40 | var right: usize = items.len; |
| 86 | 41 | |
| 87 | 42 | // Append new value to empty list |
| 88 | if (left == right) { | |
| 43 | if (il.list.items.len == 0) { | |
| 89 | 44 | const item = try il.list.addOne(gpa); |
| 90 | 45 | item.* = .{ |
| 91 | .list = .{ .node = .none, .tok = 0 }, | |
| 46 | .list = .{}, | |
| 92 | 47 | .index = index, |
| 93 | 48 | }; |
| 94 | 49 | return &item.list; |
| 50 | } else if (il.list.items[il.list.items.len - 1].index < index) { | |
| 51 | // Append a new value to the end of the list. | |
| 52 | const new = try il.list.addOne(gpa); | |
| 53 | new.* = .{ | |
| 54 | .list = .{}, | |
| 55 | .index = index, | |
| 56 | }; | |
| 57 | return &new.list; | |
| 95 | 58 | } |
| 96 | 59 | |
| 97 | 60 | while (left < right) { |
| ... | ... | @@ -107,7 +70,7 @@ pub fn find(il: *InitList, gpa: Allocator, index: u64) !*InitList { |
| 107 | 70 | |
| 108 | 71 | // Insert a new value into a sorted position. |
| 109 | 72 | try il.list.insert(gpa, left, .{ |
| 110 | .list = .{ .node = .none, .tok = 0 }, | |
| 73 | .list = .{}, | |
| 111 | 74 | .index = index, |
| 112 | 75 | }); |
| 113 | 76 | return &il.list.items[left].list; |
| ... | ... | @@ -118,22 +81,6 @@ test "basic usage" { |
| 118 | 81 | var il: InitList = .{}; |
| 119 | 82 | defer il.deinit(gpa); |
| 120 | 83 | |
| 121 | { | |
| 122 | var i: usize = 0; | |
| 123 | while (i < 5) : (i += 1) { | |
| 124 | const prev = try il.put(gpa, i, .none, 0); | |
| 125 | try testing.expect(prev == null); | |
| 126 | } | |
| 127 | } | |
| 128 | ||
| 129 | { | |
| 130 | const failing = testing.failing_allocator; | |
| 131 | var i: usize = 0; | |
| 132 | while (i < 5) : (i += 1) { | |
| 133 | _ = try il.find(failing, i); | |
| 134 | } | |
| 135 | } | |
| 136 | ||
| 137 | 84 | { |
| 138 | 85 | var item = try il.find(gpa, 0); |
| 139 | 86 | var i: usize = 1; |
lib/compiler/aro/aro/LangOpts.zig+15-11| ... | ... | @@ -1,11 +1,20 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const DiagnosticTag = @import("Diagnostics.zig").Tag; | |
| 2 | ||
| 3 | 3 | const char_info = @import("char_info.zig"); |
| 4 | const DiagnosticTag = @import("Diagnostics.zig").Tag; | |
| 4 | 5 | |
| 5 | 6 | pub const Compiler = enum { |
| 6 | 7 | clang, |
| 7 | 8 | gcc, |
| 8 | 9 | msvc, |
| 10 | ||
| 11 | pub fn defaultGccVersion(self: Compiler) u32 { | |
| 12 | return switch (self) { | |
| 13 | .clang => 4 * 10_000 + 2 * 100 + 1, | |
| 14 | .gcc => 7 * 10_000 + 1 * 100 + 0, | |
| 15 | .msvc => 0, | |
| 16 | }; | |
| 17 | } | |
| 9 | 18 | }; |
| 10 | 19 | |
| 11 | 20 | /// The floating-point evaluation method for intermediate results within a single expression |
| ... | ... | @@ -138,20 +147,15 @@ preserve_comments_in_macros: bool = false, |
| 138 | 147 | /// Used ONLY for generating __GNUC__ and related macros. Does not control the presence/absence of any features |
| 139 | 148 | /// Encoded as major * 10,000 + minor * 100 + patch |
| 140 | 149 | /// e.g. 4.2.1 == 40201 |
| 141 | gnuc_version: u32 = 0, | |
| 150 | gnuc_version: ?u32 = null, | |
| 142 | 151 | |
| 143 | 152 | pub fn setStandard(self: *LangOpts, name: []const u8) error{InvalidStandard}!void { |
| 144 | 153 | self.standard = Standard.NameMap.get(name) orelse return error.InvalidStandard; |
| 145 | 154 | } |
| 146 | 155 | |
| 147 | pub fn enableMSExtensions(self: *LangOpts) void { | |
| 148 | self.declspec_attrs = true; | |
| 149 | self.ms_extensions = true; | |
| 150 | } | |
| 151 | ||
| 152 | pub fn disableMSExtensions(self: *LangOpts) void { | |
| 153 | self.declspec_attrs = false; | |
| 154 | self.ms_extensions = true; | |
| 156 | pub fn setMSExtensions(self: *LangOpts, enabled: bool) void { | |
| 157 | self.declspec_attrs = enabled; | |
| 158 | self.ms_extensions = enabled; | |
| 155 | 159 | } |
| 156 | 160 | |
| 157 | 161 | pub fn hasChar8_T(self: *const LangOpts) bool { |
| ... | ... | @@ -164,7 +168,7 @@ pub fn hasDigraphs(self: *const LangOpts) bool { |
| 164 | 168 | |
| 165 | 169 | pub fn setEmulatedCompiler(self: *LangOpts, compiler: Compiler) void { |
| 166 | 170 | self.emulate = compiler; |
| 167 | if (compiler == .msvc) self.enableMSExtensions(); | |
| 171 | self.setMSExtensions(compiler == .msvc); | |
| 168 | 172 | } |
| 169 | 173 | |
| 170 | 174 | pub fn setFpEvalMethod(self: *LangOpts, fp_eval_method: FPEvalMethod) void { |
lib/compiler/aro/aro/Parser.zig+5664-4395| ... | ... | @@ -3,39 +3,41 @@ const mem = std.mem; |
| 3 | 3 | const Allocator = mem.Allocator; |
| 4 | 4 | const assert = std.debug.assert; |
| 5 | 5 | const big = std.math.big; |
| 6 | ||
| 7 | const Attribute = @import("Attribute.zig"); | |
| 8 | const Builtins = @import("Builtins.zig"); | |
| 9 | const Builtin = Builtins.Builtin; | |
| 10 | const evalBuiltin = @import("Builtins/eval.zig").eval; | |
| 11 | const char_info = @import("char_info.zig"); | |
| 6 | 12 | const Compilation = @import("Compilation.zig"); |
| 13 | const Diagnostics = @import("Diagnostics.zig"); | |
| 14 | const InitList = @import("InitList.zig"); | |
| 15 | const Preprocessor = @import("Preprocessor.zig"); | |
| 16 | const record_layout = @import("record_layout.zig"); | |
| 7 | 17 | const Source = @import("Source.zig"); |
| 18 | const StringId = @import("StringInterner.zig").StringId; | |
| 19 | const SymbolStack = @import("SymbolStack.zig"); | |
| 20 | const Symbol = SymbolStack.Symbol; | |
| 21 | const target_util = @import("target.zig"); | |
| 22 | const text_literal = @import("text_literal.zig"); | |
| 8 | 23 | const Tokenizer = @import("Tokenizer.zig"); |
| 9 | const Preprocessor = @import("Preprocessor.zig"); | |
| 10 | 24 | const Tree = @import("Tree.zig"); |
| 11 | 25 | const Token = Tree.Token; |
| 12 | 26 | const NumberPrefix = Token.NumberPrefix; |
| 13 | 27 | const NumberSuffix = Token.NumberSuffix; |
| 14 | 28 | const TokenIndex = Tree.TokenIndex; |
| 15 | const NodeIndex = Tree.NodeIndex; | |
| 16 | const Type = @import("Type.zig"); | |
| 17 | const Diagnostics = @import("Diagnostics.zig"); | |
| 18 | const NodeList = std.array_list.Managed(NodeIndex); | |
| 19 | const InitList = @import("InitList.zig"); | |
| 20 | const Attribute = @import("Attribute.zig"); | |
| 21 | const char_info = @import("char_info.zig"); | |
| 22 | const text_literal = @import("text_literal.zig"); | |
| 29 | const Node = Tree.Node; | |
| 30 | const TypeStore = @import("TypeStore.zig"); | |
| 31 | const Type = TypeStore.Type; | |
| 32 | const QualType = TypeStore.QualType; | |
| 23 | 33 | const Value = @import("Value.zig"); |
| 24 | const SymbolStack = @import("SymbolStack.zig"); | |
| 25 | const Symbol = SymbolStack.Symbol; | |
| 26 | const record_layout = @import("record_layout.zig"); | |
| 27 | const StrInt = @import("StringInterner.zig"); | |
| 28 | const StringId = StrInt.StringId; | |
| 29 | const Builtins = @import("Builtins.zig"); | |
| 30 | const Builtin = Builtins.Builtin; | |
| 31 | const evalBuiltin = @import("Builtins/eval.zig").eval; | |
| 32 | const target_util = @import("target.zig"); | |
| 33 | 34 | |
| 35 | const NodeList = std.ArrayList(Node.Index); | |
| 34 | 36 | const Switch = struct { |
| 35 | 37 | default: ?TokenIndex = null, |
| 36 | ranges: std.array_list.Managed(Range), | |
| 37 | ty: Type, | |
| 38 | comp: *Compilation, | |
| 38 | ranges: std.ArrayList(Range) = .empty, | |
| 39 | qt: QualType, | |
| 40 | comp: *const Compilation, | |
| 39 | 41 | |
| 40 | 42 | const Range = struct { |
| 41 | 43 | first: Value, |
| ... | ... | @@ -43,13 +45,13 @@ const Switch = struct { |
| 43 | 45 | tok: TokenIndex, |
| 44 | 46 | }; |
| 45 | 47 | |
| 46 | fn add(self: *Switch, first: Value, last: Value, tok: TokenIndex) !?Range { | |
| 47 | for (self.ranges.items) |range| { | |
| 48 | if (last.compare(.gte, range.first, self.comp) and first.compare(.lte, range.last, self.comp)) { | |
| 48 | fn add(s: *Switch, first: Value, last: Value, tok: TokenIndex) !?Range { | |
| 49 | for (s.ranges.items) |range| { | |
| 50 | if (last.compare(.gte, range.first, s.comp) and first.compare(.lte, range.last, s.comp)) { | |
| 49 | 51 | return range; // They overlap. |
| 50 | 52 | } |
| 51 | 53 | } |
| 52 | try self.ranges.append(.{ | |
| 54 | try s.ranges.append(s.comp.gpa, .{ | |
| 53 | 55 | .first = first, |
| 54 | 56 | .last = last, |
| 55 | 57 | .tok = tok, |
| ... | ... | @@ -63,6 +65,15 @@ const Label = union(enum) { |
| 63 | 65 | label: TokenIndex, |
| 64 | 66 | }; |
| 65 | 67 | |
| 68 | const InitContext = enum { | |
| 69 | /// inits do not need to be compile-time constants | |
| 70 | runtime, | |
| 71 | /// constexpr variable, could be any scope but inits must be compile-time constants | |
| 72 | constexpr, | |
| 73 | /// static and global variables, inits must be compile-time constants | |
| 74 | static, | |
| 75 | }; | |
| 76 | ||
| 66 | 77 | pub const Error = Compilation.Error || error{ParsingFailed}; |
| 67 | 78 | |
| 68 | 79 | /// An attribute that has been parsed but not yet validated in its context |
| ... | ... | @@ -89,28 +100,30 @@ const Parser = @This(); |
| 89 | 100 | // values from preprocessor |
| 90 | 101 | pp: *Preprocessor, |
| 91 | 102 | comp: *Compilation, |
| 92 | gpa: mem.Allocator, | |
| 103 | diagnostics: *Diagnostics, | |
| 93 | 104 | tok_ids: []const Token.Id, |
| 94 | 105 | tok_i: TokenIndex = 0, |
| 95 | 106 | |
| 96 | // values of the incomplete Tree | |
| 97 | arena: Allocator, | |
| 98 | nodes: Tree.Node.List = .{}, | |
| 99 | data: NodeList, | |
| 100 | value_map: Tree.ValueMap, | |
| 107 | /// The AST being constructed. | |
| 108 | tree: Tree, | |
| 101 | 109 | |
| 102 | 110 | // buffers used during compilation |
| 103 | 111 | syms: SymbolStack = .{}, |
| 104 | strings: std.array_list.Managed(u8), | |
| 105 | labels: std.array_list.Managed(Label), | |
| 106 | list_buf: NodeList, | |
| 107 | decl_buf: NodeList, | |
| 108 | param_buf: std.array_list.Managed(Type.Func.Param), | |
| 109 | enum_buf: std.array_list.Managed(Type.Enum.Field), | |
| 110 | record_buf: std.array_list.Managed(Type.Record.Field), | |
| 111 | attr_buf: std.MultiArrayList(TentativeAttribute) = .{}, | |
| 112 | attr_application_buf: std.ArrayListUnmanaged(Attribute) = .empty, | |
| 113 | field_attr_buf: std.array_list.Managed([]const Attribute), | |
| 112 | strings: std.array_list.Aligned(u8, .@"4") = .empty, | |
| 113 | labels: std.ArrayList(Label) = .empty, | |
| 114 | list_buf: NodeList = .empty, | |
| 115 | decl_buf: NodeList = .empty, | |
| 116 | /// Function type parameters, also used for generic selection association | |
| 117 | /// duplicate checking. | |
| 118 | param_buf: std.ArrayList(Type.Func.Param) = .empty, | |
| 119 | /// Enum type fields. | |
| 120 | enum_buf: std.ArrayList(Type.Enum.Field) = .empty, | |
| 121 | /// Record type fields. | |
| 122 | record_buf: std.ArrayList(Type.Record.Field) = .empty, | |
| 123 | /// Attributes that have been parsed but not yet validated or applied. | |
| 124 | attr_buf: std.MultiArrayList(TentativeAttribute) = .empty, | |
| 125 | /// Used to store validated attributes before they are applied to types. | |
| 126 | attr_application_buf: std.ArrayList(Attribute) = .empty, | |
| 114 | 127 | /// type name -> variable name location for tentative definitions (top-level defs with thus-far-incomplete types) |
| 115 | 128 | /// e.g. `struct Foo bar;` where `struct Foo` is not defined yet. |
| 116 | 129 | /// The key is the StringId of `Foo` and the value is the TokenIndex of `bar` |
| ... | ... | @@ -135,46 +148,51 @@ computed_goto_tok: ?TokenIndex = null, |
| 135 | 148 | /// so that it is not used in its own initializer. |
| 136 | 149 | auto_type_decl_name: StringId = .empty, |
| 137 | 150 | |
| 151 | init_context: InitContext = .runtime, | |
| 152 | ||
| 138 | 153 | /// Various variables that are different for each function. |
| 139 | 154 | func: struct { |
| 140 | /// null if not in function, will always be plain func, var_args_func or old_style_func | |
| 141 | ty: ?Type = null, | |
| 155 | /// null if not in function, will always be plain func | |
| 156 | qt: ?QualType = null, | |
| 142 | 157 | name: TokenIndex = 0, |
| 143 | 158 | ident: ?Result = null, |
| 144 | 159 | pretty_ident: ?Result = null, |
| 145 | 160 | } = .{}, |
| 161 | ||
| 146 | 162 | /// Various variables that are different for each record. |
| 147 | 163 | record: struct { |
| 148 | 164 | // invalid means we're not parsing a record |
| 149 | 165 | kind: Token.Id = .invalid, |
| 150 | 166 | flexible_field: ?TokenIndex = null, |
| 151 | 167 | start: usize = 0, |
| 152 | field_attr_start: usize = 0, | |
| 153 | 168 | |
| 154 | 169 | fn addField(r: @This(), p: *Parser, name: StringId, tok: TokenIndex) Error!void { |
| 155 | 170 | var i = p.record_members.items.len; |
| 156 | 171 | while (i > r.start) { |
| 157 | 172 | i -= 1; |
| 158 | 173 | if (p.record_members.items[i].name == name) { |
| 159 | try p.errStr(.duplicate_member, tok, p.tokSlice(tok)); | |
| 160 | try p.errTok(.previous_definition, p.record_members.items[i].tok); | |
| 174 | try p.err(tok, .duplicate_member, .{p.tokSlice(tok)}); | |
| 175 | try p.err(p.record_members.items[i].tok, .previous_definition, .{}); | |
| 161 | 176 | break; |
| 162 | 177 | } |
| 163 | 178 | } |
| 164 | try p.record_members.append(p.gpa, .{ .name = name, .tok = tok }); | |
| 179 | try p.record_members.append(p.comp.gpa, .{ .name = name, .tok = tok }); | |
| 165 | 180 | } |
| 166 | 181 | |
| 167 | fn addFieldsFromAnonymous(r: @This(), p: *Parser, ty: Type) Error!void { | |
| 168 | for (ty.getRecord().?.fields) |f| { | |
| 169 | if (f.isAnonymousRecord()) { | |
| 170 | try r.addFieldsFromAnonymous(p, f.ty.canonicalize(.standard)); | |
| 171 | } else if (f.name_tok != 0) { | |
| 182 | fn addFieldsFromAnonymous(r: @This(), p: *Parser, record_ty: Type.Record) Error!void { | |
| 183 | for (record_ty.fields) |f| { | |
| 184 | if (f.name_tok == 0) { | |
| 185 | if (f.qt.getRecord(p.comp)) |field_record_ty| { | |
| 186 | try r.addFieldsFromAnonymous(p, field_record_ty); | |
| 187 | } | |
| 188 | } else { | |
| 172 | 189 | try r.addField(p, f.name, f.name_tok); |
| 173 | 190 | } |
| 174 | 191 | } |
| 175 | 192 | } |
| 176 | 193 | } = .{}, |
| 177 | record_members: std.ArrayListUnmanaged(struct { tok: TokenIndex, name: StringId }) = .empty, | |
| 194 | record_members: std.ArrayList(struct { tok: TokenIndex, name: StringId }) = .empty, | |
| 195 | ||
| 178 | 196 | @"switch": ?*Switch = null, |
| 179 | 197 | in_loop: bool = false, |
| 180 | 198 | pragma_pack: ?u8 = null, |
| ... | ... | @@ -189,32 +207,49 @@ string_ids: struct { |
| 189 | 207 | |
| 190 | 208 | /// Checks codepoint for various pedantic warnings |
| 191 | 209 | /// Returns true if diagnostic issued |
| 192 | fn checkIdentifierCodepointWarnings(comp: *Compilation, codepoint: u21, loc: Source.Location) Compilation.Error!bool { | |
| 210 | fn checkIdentifierCodepointWarnings(p: *Parser, codepoint: u21, loc: Source.Location) Compilation.Error!bool { | |
| 193 | 211 | assert(codepoint >= 0x80); |
| 194 | 212 | |
| 195 | const err_start = comp.diagnostics.list.items.len; | |
| 213 | const prev_total = p.diagnostics.total; | |
| 214 | var sf = std.heap.stackFallback(1024, p.comp.gpa); | |
| 215 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 216 | defer allocating.deinit(); | |
| 196 | 217 | |
| 197 | 218 | if (!char_info.isC99IdChar(codepoint)) { |
| 198 | try comp.addDiagnostic(.{ | |
| 199 | .tag = .c99_compat, | |
| 200 | .loc = loc, | |
| 201 | }, &.{}); | |
| 219 | const diagnostic: Diagnostic = .c99_compat; | |
| 220 | try p.diagnostics.add(.{ | |
| 221 | .kind = diagnostic.kind, | |
| 222 | .text = diagnostic.fmt, | |
| 223 | .extension = diagnostic.extension, | |
| 224 | .opt = diagnostic.opt, | |
| 225 | .location = loc.expand(p.comp), | |
| 226 | }); | |
| 202 | 227 | } |
| 203 | 228 | if (char_info.isInvisible(codepoint)) { |
| 204 | try comp.addDiagnostic(.{ | |
| 205 | .tag = .unicode_zero_width, | |
| 206 | .loc = loc, | |
| 207 | .extra = .{ .actual_codepoint = codepoint }, | |
| 208 | }, &.{}); | |
| 229 | const diagnostic: Diagnostic = .unicode_zero_width; | |
| 230 | p.formatArgs(&allocating.writer, diagnostic.fmt, .{Codepoint.init(codepoint)}) catch return error.OutOfMemory; | |
| 231 | ||
| 232 | try p.diagnostics.add(.{ | |
| 233 | .kind = diagnostic.kind, | |
| 234 | .text = allocating.written(), | |
| 235 | .extension = diagnostic.extension, | |
| 236 | .opt = diagnostic.opt, | |
| 237 | .location = loc.expand(p.comp), | |
| 238 | }); | |
| 209 | 239 | } |
| 210 | 240 | if (char_info.homoglyph(codepoint)) |resembles| { |
| 211 | try comp.addDiagnostic(.{ | |
| 212 | .tag = .unicode_homoglyph, | |
| 213 | .loc = loc, | |
| 214 | .extra = .{ .codepoints = .{ .actual = codepoint, .resembles = resembles } }, | |
| 215 | }, &.{}); | |
| 241 | const diagnostic: Diagnostic = .unicode_homoglyph; | |
| 242 | p.formatArgs(&allocating.writer, diagnostic.fmt, .{ Codepoint.init(codepoint), resembles }) catch return error.OutOfMemory; | |
| 243 | ||
| 244 | try p.diagnostics.add(.{ | |
| 245 | .kind = diagnostic.kind, | |
| 246 | .text = allocating.written(), | |
| 247 | .extension = diagnostic.extension, | |
| 248 | .opt = diagnostic.opt, | |
| 249 | .location = loc.expand(p.comp), | |
| 250 | }); | |
| 216 | 251 | } |
| 217 | return comp.diagnostics.list.items.len != err_start; | |
| 252 | return p.diagnostics.total != prev_total; | |
| 218 | 253 | } |
| 219 | 254 | |
| 220 | 255 | /// Issues diagnostics for the current extended identifier token |
| ... | ... | @@ -226,7 +261,7 @@ fn validateExtendedIdentifier(p: *Parser) !bool { |
| 226 | 261 | |
| 227 | 262 | const slice = p.tokSlice(p.tok_i); |
| 228 | 263 | const view = std.unicode.Utf8View.init(slice) catch { |
| 229 | try p.errTok(.invalid_utf8, p.tok_i); | |
| 264 | try p.err(p.tok_i, .invalid_utf8, .{}); | |
| 230 | 265 | return error.FatalError; |
| 231 | 266 | }; |
| 232 | 267 | var it = view.iterator(); |
| ... | ... | @@ -247,10 +282,16 @@ fn validateExtendedIdentifier(p: *Parser) !bool { |
| 247 | 282 | } |
| 248 | 283 | if (codepoint == '$') { |
| 249 | 284 | warned = true; |
| 250 | if (p.comp.langopts.dollars_in_identifiers) try p.comp.addDiagnostic(.{ | |
| 251 | .tag = .dollar_in_identifier_extension, | |
| 252 | .loc = loc, | |
| 253 | }, &.{}); | |
| 285 | if (p.comp.langopts.dollars_in_identifiers) { | |
| 286 | const diagnostic: Diagnostic = .dollar_in_identifier_extension; | |
| 287 | try p.diagnostics.add(.{ | |
| 288 | .kind = diagnostic.kind, | |
| 289 | .text = diagnostic.fmt, | |
| 290 | .extension = diagnostic.extension, | |
| 291 | .opt = diagnostic.opt, | |
| 292 | .location = loc.expand(p.comp), | |
| 293 | }); | |
| 294 | } | |
| 254 | 295 | } |
| 255 | 296 | |
| 256 | 297 | if (codepoint <= 0x7F) continue; |
| ... | ... | @@ -264,7 +305,7 @@ fn validateExtendedIdentifier(p: *Parser) !bool { |
| 264 | 305 | } |
| 265 | 306 | |
| 266 | 307 | if (!warned) { |
| 267 | warned = try checkIdentifierCodepointWarnings(p.comp, codepoint, loc); | |
| 308 | warned = try p.checkIdentifierCodepointWarnings(codepoint, loc); | |
| 268 | 309 | } |
| 269 | 310 | |
| 270 | 311 | // Check NFC normalization. |
| ... | ... | @@ -274,22 +315,22 @@ fn validateExtendedIdentifier(p: *Parser) !bool { |
| 274 | 315 | canonical_class != .not_reordered) |
| 275 | 316 | { |
| 276 | 317 | normalized = false; |
| 277 | try p.errStr(.identifier_not_normalized, p.tok_i, slice); | |
| 318 | try p.err(p.tok_i, .identifier_not_normalized, .{slice}); | |
| 278 | 319 | continue; |
| 279 | 320 | } |
| 280 | 321 | if (char_info.isNormalized(codepoint) != .yes) { |
| 281 | 322 | normalized = false; |
| 282 | try p.errExtra(.identifier_not_normalized, p.tok_i, .{ .normalized = slice }); | |
| 323 | try p.err(p.tok_i, .identifier_not_normalized, .{Normalized.init(slice)}); | |
| 283 | 324 | } |
| 284 | 325 | last_canonical_class = canonical_class; |
| 285 | 326 | } |
| 286 | 327 | |
| 287 | 328 | if (!valid_identifier) { |
| 288 | 329 | if (len == 1) { |
| 289 | try p.errExtra(.unexpected_character, p.tok_i, .{ .actual_codepoint = invalid_char }); | |
| 330 | try p.err(p.tok_i, .unexpected_character, .{Codepoint.init(invalid_char)}); | |
| 290 | 331 | return false; |
| 291 | 332 | } else { |
| 292 | try p.errExtra(.invalid_identifier_start_char, p.tok_i, .{ .actual_codepoint = invalid_char }); | |
| 333 | try p.err(p.tok_i, .invalid_identifier_start_char, .{Codepoint.init(invalid_char)}); | |
| 293 | 334 | } |
| 294 | 335 | } |
| 295 | 336 | |
| ... | ... | @@ -312,7 +353,7 @@ fn eatIdentifier(p: *Parser) !?TokenIndex { |
| 312 | 353 | // Handle illegal '$' characters in identifiers |
| 313 | 354 | if (!p.comp.langopts.dollars_in_identifiers) { |
| 314 | 355 | if (p.tok_ids[p.tok_i] == .invalid and p.tokSlice(p.tok_i)[0] == '$') { |
| 315 | try p.err(.dollars_in_identifiers); | |
| 356 | try p.err(p.tok_i, .dollars_in_identifiers, .{}); | |
| 316 | 357 | p.tok_i += 1; |
| 317 | 358 | return error.ParsingFailed; |
| 318 | 359 | } |
| ... | ... | @@ -362,40 +403,33 @@ pub fn tokSlice(p: *Parser, tok: TokenIndex) []const u8 { |
| 362 | 403 | fn expectClosing(p: *Parser, opening: TokenIndex, id: Token.Id) Error!void { |
| 363 | 404 | _ = p.expectToken(id) catch |e| { |
| 364 | 405 | if (e == error.ParsingFailed) { |
| 365 | try p.errTok(switch (id) { | |
| 406 | try p.err(opening, switch (id) { | |
| 366 | 407 | .r_paren => .to_match_paren, |
| 367 | 408 | .r_brace => .to_match_brace, |
| 368 | 409 | .r_bracket => .to_match_brace, |
| 369 | 410 | else => unreachable, |
| 370 | }, opening); | |
| 411 | }, .{}); | |
| 371 | 412 | } |
| 372 | 413 | return e; |
| 373 | 414 | }; |
| 374 | 415 | } |
| 375 | 416 | |
| 376 | fn errOverflow(p: *Parser, op_tok: TokenIndex, res: Result) !void { | |
| 377 | try p.errStr(.overflow, op_tok, try res.str(p)); | |
| 378 | } | |
| 417 | pub const Diagnostic = @import("Parser/Diagnostic.zig"); | |
| 379 | 418 | |
| 380 | fn errExpectedToken(p: *Parser, expected: Token.Id, actual: Token.Id) Error { | |
| 381 | switch (actual) { | |
| 382 | .invalid => try p.errExtra(.expected_invalid, p.tok_i, .{ .tok_id_expected = expected }), | |
| 383 | .eof => try p.errExtra(.expected_eof, p.tok_i, .{ .tok_id_expected = expected }), | |
| 384 | else => try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ | |
| 385 | .expected = expected, | |
| 386 | .actual = actual, | |
| 387 | } }), | |
| 419 | pub fn err(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { | |
| 420 | if (p.extension_suppressed) { | |
| 421 | if (diagnostic.extension and diagnostic.kind == .off) return; | |
| 388 | 422 | } |
| 389 | return error.ParsingFailed; | |
| 390 | } | |
| 423 | if (diagnostic.suppress_version) |some| if (p.comp.langopts.standard.atLeast(some)) return; | |
| 424 | if (diagnostic.suppress_unless_version) |some| if (!p.comp.langopts.standard.atLeast(some)) return; | |
| 425 | if (p.diagnostics.effectiveKind(diagnostic) == .off) return; | |
| 391 | 426 | |
| 392 | pub fn errStr(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, str: []const u8) Compilation.Error!void { | |
| 393 | @branchHint(.cold); | |
| 394 | return p.errExtra(tag, tok_i, .{ .str = str }); | |
| 395 | } | |
| 427 | var sf = std.heap.stackFallback(1024, p.comp.gpa); | |
| 428 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 429 | defer allocating.deinit(); | |
| 430 | ||
| 431 | p.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; | |
| 396 | 432 | |
| 397 | pub fn errExtra(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, extra: Diagnostics.Message.Extra) Compilation.Error!void { | |
| 398 | @branchHint(.cold); | |
| 399 | 433 | const tok = p.pp.tokens.get(tok_i); |
| 400 | 434 | var loc = tok.loc; |
| 401 | 435 | if (tok_i != 0 and tok.id == .eof) { |
| ... | ... | @@ -404,196 +438,218 @@ pub fn errExtra(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, extra: Diag |
| 404 | 438 | loc = prev.loc; |
| 405 | 439 | loc.byte_offset += @intCast(p.tokSlice(tok_i - 1).len); |
| 406 | 440 | } |
| 407 | try p.comp.addDiagnostic(.{ | |
| 408 | .tag = tag, | |
| 409 | .loc = loc, | |
| 410 | .extra = extra, | |
| 411 | }, p.pp.expansionSlice(tok_i)); | |
| 441 | try p.diagnostics.addWithLocation(p.comp, .{ | |
| 442 | .kind = diagnostic.kind, | |
| 443 | .text = allocating.written(), | |
| 444 | .opt = diagnostic.opt, | |
| 445 | .extension = diagnostic.extension, | |
| 446 | .location = loc.expand(p.comp), | |
| 447 | }, p.pp.expansionSlice(tok_i), true); | |
| 448 | } | |
| 449 | ||
| 450 | fn formatArgs(p: *Parser, w: *std.Io.Writer, fmt: []const u8, args: anytype) !void { | |
| 451 | var i: usize = 0; | |
| 452 | inline for (std.meta.fields(@TypeOf(args))) |arg_info| { | |
| 453 | const arg = @field(args, arg_info.name); | |
| 454 | i += switch (@TypeOf(arg)) { | |
| 455 | []const u8 => try Diagnostics.formatString(w, fmt[i..], arg), | |
| 456 | Tree.Token.Id => try formatTokenId(w, fmt[i..], arg), | |
| 457 | QualType => try p.formatQualType(w, fmt[i..], arg), | |
| 458 | text_literal.Ascii => try arg.format(w, fmt[i..]), | |
| 459 | Result => try p.formatResult(w, fmt[i..], arg), | |
| 460 | *Result => try p.formatResult(w, fmt[i..], arg.*), | |
| 461 | Enumerator, *Enumerator => try p.formatResult(w, fmt[i..], .{ | |
| 462 | .node = undefined, | |
| 463 | .val = arg.val, | |
| 464 | .qt = arg.qt, | |
| 465 | }), | |
| 466 | Codepoint => try arg.format(w, fmt[i..]), | |
| 467 | Normalized => try arg.format(w, fmt[i..]), | |
| 468 | Escaped => try arg.format(w, fmt[i..]), | |
| 469 | else => switch (@typeInfo(@TypeOf(arg))) { | |
| 470 | .int, .comptime_int => try Diagnostics.formatInt(w, fmt[i..], arg), | |
| 471 | .pointer => try Diagnostics.formatString(w, fmt[i..], arg), | |
| 472 | else => comptime unreachable, | |
| 473 | }, | |
| 474 | }; | |
| 475 | } | |
| 476 | try w.writeAll(fmt[i..]); | |
| 412 | 477 | } |
| 413 | 478 | |
| 414 | pub fn errTok(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex) Compilation.Error!void { | |
| 415 | @branchHint(.cold); | |
| 416 | return p.errExtra(tag, tok_i, .{ .none = {} }); | |
| 479 | fn formatTokenId(w: *std.Io.Writer, fmt: []const u8, tok_id: Tree.Token.Id) !usize { | |
| 480 | const i = Diagnostics.templateIndex(w, fmt, "{tok_id}"); | |
| 481 | try w.writeAll(tok_id.symbol()); | |
| 482 | return i; | |
| 417 | 483 | } |
| 418 | 484 | |
| 419 | pub fn err(p: *Parser, tag: Diagnostics.Tag) Compilation.Error!void { | |
| 420 | @branchHint(.cold); | |
| 421 | return p.errExtra(tag, p.tok_i, .{ .none = {} }); | |
| 422 | } | |
| 485 | fn formatQualType(p: *Parser, w: *std.Io.Writer, fmt: []const u8, qt: QualType) !usize { | |
| 486 | const i = Diagnostics.templateIndex(w, fmt, "{qt}"); | |
| 487 | try w.writeByte('\''); | |
| 488 | try qt.print(p.comp, w); | |
| 489 | try w.writeByte('\''); | |
| 423 | 490 | |
| 424 | pub fn todo(p: *Parser, msg: []const u8) Error { | |
| 425 | try p.errStr(.todo, p.tok_i, msg); | |
| 426 | return error.ParsingFailed; | |
| 491 | if (qt.isC23Auto()) return i; | |
| 492 | if (qt.get(p.comp, .vector)) |vector_ty| { | |
| 493 | try w.print(" (vector of {d} '", .{vector_ty.len}); | |
| 494 | try vector_ty.elem.printDesugared(p.comp, w); | |
| 495 | try w.writeAll("' values)"); | |
| 496 | } else if (qt.shouldDesugar(p.comp)) { | |
| 497 | try w.writeAll(" (aka '"); | |
| 498 | try qt.printDesugared(p.comp, w); | |
| 499 | try w.writeAll("')"); | |
| 500 | } | |
| 501 | return i; | |
| 427 | 502 | } |
| 428 | 503 | |
| 429 | pub fn removeNull(p: *Parser, str: Value) !Value { | |
| 430 | const strings_top = p.strings.items.len; | |
| 431 | defer p.strings.items.len = strings_top; | |
| 432 | { | |
| 433 | const bytes = p.comp.interner.get(str.ref()).bytes; | |
| 434 | try p.strings.appendSlice(bytes[0 .. bytes.len - 1]); | |
| 504 | fn formatResult(p: *Parser, w: *std.Io.Writer, fmt: []const u8, res: Result) !usize { | |
| 505 | const i = Diagnostics.templateIndex(w, fmt, "{value}"); | |
| 506 | switch (res.val.opt_ref) { | |
| 507 | .none => try w.writeAll("(none)"), | |
| 508 | .null => try w.writeAll("nullptr_t"), | |
| 509 | else => if (try res.val.print(res.qt, p.comp, w)) |nested| switch (nested) { | |
| 510 | .pointer => |ptr| { | |
| 511 | const ptr_node: Node.Index = @enumFromInt(ptr.node); | |
| 512 | const decl_name = p.tree.tokSlice(ptr_node.tok(&p.tree)); | |
| 513 | try ptr.offset.printPointer(decl_name, p.comp, w); | |
| 514 | }, | |
| 515 | }, | |
| 435 | 516 | } |
| 436 | return Value.intern(p.comp, .{ .bytes = p.strings.items[strings_top..] }); | |
| 517 | return i; | |
| 437 | 518 | } |
| 438 | 519 | |
| 439 | pub fn typeStr(p: *Parser, ty: Type) ![]const u8 { | |
| 440 | if (@import("builtin").mode != .Debug) { | |
| 441 | if (ty.is(.invalid)) { | |
| 442 | return "Tried to render invalid type - this is an aro bug."; | |
| 443 | } | |
| 520 | const Normalized = struct { | |
| 521 | str: []const u8, | |
| 522 | ||
| 523 | fn init(str: []const u8) Normalized { | |
| 524 | return .{ .str = str }; | |
| 444 | 525 | } |
| 445 | if (Type.Builder.fromType(ty).str(p.comp.langopts)) |str| return str; | |
| 446 | const strings_top = p.strings.items.len; | |
| 447 | defer p.strings.items.len = strings_top; | |
| 448 | 526 | |
| 449 | const mapper = p.comp.string_interner.getSlowTypeMapper(); | |
| 450 | { | |
| 451 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 452 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 453 | defer { | |
| 454 | unmanaged = allocating.toArrayList(); | |
| 455 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 456 | } | |
| 457 | ty.print(mapper, p.comp.langopts, &allocating.writer) catch |e| switch (e) { | |
| 458 | error.WriteFailed => return error.OutOfMemory, | |
| 527 | pub fn format(ctx: Normalized, w: *std.Io.Writer, fmt: []const u8) !usize { | |
| 528 | const i = Diagnostics.templateIndex(w, fmt, "{normalized}"); | |
| 529 | var it: std.unicode.Utf8Iterator = .{ | |
| 530 | .bytes = ctx.str, | |
| 531 | .i = 0, | |
| 459 | 532 | }; |
| 533 | while (it.nextCodepoint()) |codepoint| { | |
| 534 | if (codepoint < 0x7F) { | |
| 535 | try w.writeByte(@intCast(codepoint)); | |
| 536 | } else if (codepoint < 0xFFFF) { | |
| 537 | try w.writeAll("\\u"); | |
| 538 | try w.printInt(codepoint, 16, .upper, .{ | |
| 539 | .fill = '0', | |
| 540 | .width = 4, | |
| 541 | }); | |
| 542 | } else { | |
| 543 | try w.writeAll("\\U"); | |
| 544 | try w.printInt(codepoint, 16, .upper, .{ | |
| 545 | .fill = '0', | |
| 546 | .width = 8, | |
| 547 | }); | |
| 548 | } | |
| 549 | } | |
| 550 | return i; | |
| 460 | 551 | } |
| 461 | return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 462 | } | |
| 552 | }; | |
| 463 | 553 | |
| 464 | pub fn typePairStr(p: *Parser, a: Type, b: Type) ![]const u8 { | |
| 465 | return p.typePairStrExtra(a, " and ", b); | |
| 466 | } | |
| 554 | const Codepoint = struct { | |
| 555 | codepoint: u21, | |
| 467 | 556 | |
| 468 | pub fn typePairStrExtra(p: *Parser, a: Type, msg: []const u8, b: Type) Error![]const u8 { | |
| 469 | if (@import("builtin").mode != .Debug) { | |
| 470 | if (a.is(.invalid) or b.is(.invalid)) { | |
| 471 | return "Tried to render invalid type - this is an aro bug."; | |
| 472 | } | |
| 557 | fn init(codepoint: u21) Codepoint { | |
| 558 | return .{ .codepoint = codepoint }; | |
| 473 | 559 | } |
| 474 | const strings_top = p.strings.items.len; | |
| 475 | defer p.strings.items.len = strings_top; | |
| 476 | 560 | |
| 477 | try p.strings.append('\''); | |
| 478 | const mapper = p.comp.string_interner.getSlowTypeMapper(); | |
| 479 | { | |
| 480 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 481 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 482 | defer { | |
| 483 | unmanaged = allocating.toArrayList(); | |
| 484 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 485 | } | |
| 486 | a.print(mapper, p.comp.langopts, &allocating.writer) catch |e| switch (e) { | |
| 487 | error.WriteFailed => return error.OutOfMemory, | |
| 488 | }; | |
| 561 | pub fn format(ctx: Codepoint, w: *std.Io.Writer, fmt: []const u8) !usize { | |
| 562 | const i = Diagnostics.templateIndex(w, fmt, "{codepoint}"); | |
| 563 | try w.print("{X:0>4}", .{ctx.codepoint}); | |
| 564 | return i; | |
| 489 | 565 | } |
| 490 | try p.strings.append('\''); | |
| 491 | try p.strings.appendSlice(msg); | |
| 492 | try p.strings.append('\''); | |
| 493 | { | |
| 494 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 495 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 496 | defer { | |
| 497 | unmanaged = allocating.toArrayList(); | |
| 498 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 499 | } | |
| 500 | b.print(mapper, p.comp.langopts, &allocating.writer) catch |e| switch (e) { | |
| 501 | error.WriteFailed => return error.OutOfMemory, | |
| 502 | }; | |
| 566 | }; | |
| 567 | ||
| 568 | const Escaped = struct { | |
| 569 | str: []const u8, | |
| 570 | ||
| 571 | fn init(str: []const u8) Escaped { | |
| 572 | return .{ .str = str }; | |
| 573 | } | |
| 574 | ||
| 575 | pub fn format(ctx: Escaped, w: *std.Io.Writer, fmt: []const u8) !usize { | |
| 576 | const i = Diagnostics.templateIndex(w, fmt, "{s}"); | |
| 577 | try std.zig.stringEscape(ctx.str, w); | |
| 578 | return i; | |
| 503 | 579 | } |
| 504 | try p.strings.append('\''); | |
| 505 | return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 580 | }; | |
| 581 | ||
| 582 | pub fn todo(p: *Parser, msg: []const u8) Error { | |
| 583 | try p.err(p.tok_i, .todo, .{msg}); | |
| 584 | return error.ParsingFailed; | |
| 506 | 585 | } |
| 507 | 586 | |
| 508 | pub fn valueChangedStr(p: *Parser, res: *Result, old_value: Value, int_ty: Type) Error![]const u8 { | |
| 587 | pub fn removeNull(p: *Parser, str: Value) !Value { | |
| 509 | 588 | const strings_top = p.strings.items.len; |
| 510 | 589 | defer p.strings.items.len = strings_top; |
| 511 | ||
| 512 | const type_pair_str = try p.typePairStrExtra(res.ty, " to ", int_ty); | |
| 513 | 590 | { |
| 514 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 515 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 516 | defer { | |
| 517 | unmanaged = allocating.toArrayList(); | |
| 518 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 519 | } | |
| 520 | allocating.writer.writeAll(type_pair_str) catch return error.OutOfMemory; | |
| 521 | ||
| 522 | allocating.writer.writeAll(" changes ") catch return error.OutOfMemory; | |
| 523 | if (res.val.isZero(p.comp)) allocating.writer.writeAll("non-zero ") catch return error.OutOfMemory; | |
| 524 | allocating.writer.writeAll("value from ") catch return error.OutOfMemory; | |
| 525 | old_value.print(res.ty, p.comp, &allocating.writer) catch |e| switch (e) { | |
| 526 | error.WriteFailed => return error.OutOfMemory, | |
| 527 | }; | |
| 528 | allocating.writer.writeAll(" to ") catch return error.OutOfMemory; | |
| 529 | res.val.print(int_ty, p.comp, &allocating.writer) catch |e| switch (e) { | |
| 530 | error.WriteFailed => return error.OutOfMemory, | |
| 531 | }; | |
| 591 | const bytes = p.comp.interner.get(str.ref()).bytes; | |
| 592 | try p.strings.appendSlice(p.comp.gpa, bytes[0 .. bytes.len - 1]); | |
| 532 | 593 | } |
| 533 | ||
| 534 | return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 594 | return Value.intern(p.comp, .{ .bytes = p.strings.items[strings_top..] }); | |
| 535 | 595 | } |
| 536 | 596 | |
| 537 | fn checkDeprecatedUnavailable(p: *Parser, ty: Type, usage_tok: TokenIndex, decl_tok: TokenIndex) !void { | |
| 538 | if (ty.getAttribute(.@"error")) |@"error"| { | |
| 539 | const strings_top = p.strings.items.len; | |
| 540 | defer p.strings.items.len = strings_top; | |
| 597 | pub fn errValueChanged(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, res: Result, old_val: Value, int_qt: QualType) !void { | |
| 598 | const zero_str = if (res.val.isZero(p.comp)) "non-zero " else ""; | |
| 599 | const old_res: Result = .{ | |
| 600 | .node = undefined, | |
| 601 | .val = old_val, | |
| 602 | .qt = res.qt, | |
| 603 | }; | |
| 604 | const new_res: Result = .{ | |
| 605 | .node = undefined, | |
| 606 | .val = res.val, | |
| 607 | .qt = int_qt, | |
| 608 | }; | |
| 609 | try p.err(tok_i, diagnostic, .{ res.qt, int_qt, zero_str, old_res, new_res }); | |
| 610 | } | |
| 541 | 611 | |
| 612 | fn checkDeprecatedUnavailable(p: *Parser, ty: QualType, usage_tok: TokenIndex, decl_tok: TokenIndex) !void { | |
| 613 | if (ty.getAttribute(p.comp, .@"error")) |@"error"| { | |
| 542 | 614 | const msg_str = p.comp.interner.get(@"error".msg.ref()).bytes; |
| 543 | try p.strings.print("call to '{s}' declared with attribute error: {f}", .{ | |
| 544 | p.tokSlice(@"error".__name_tok), std.zig.fmtString(msg_str), | |
| 545 | }); | |
| 546 | const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 547 | try p.errStr(.error_attribute, usage_tok, str); | |
| 615 | try p.err(usage_tok, .error_attribute, .{ p.tokSlice(@"error".__name_tok), Escaped.init(msg_str) }); | |
| 548 | 616 | } |
| 549 | if (ty.getAttribute(.warning)) |warning| { | |
| 550 | const strings_top = p.strings.items.len; | |
| 551 | defer p.strings.items.len = strings_top; | |
| 552 | ||
| 617 | if (ty.getAttribute(p.comp, .warning)) |warning| { | |
| 553 | 618 | const msg_str = p.comp.interner.get(warning.msg.ref()).bytes; |
| 554 | try p.strings.print("call to '{s}' declared with attribute warning: {f}", .{ | |
| 555 | p.tokSlice(warning.__name_tok), std.zig.fmtString(msg_str), | |
| 556 | }); | |
| 557 | const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 558 | try p.errStr(.warning_attribute, usage_tok, str); | |
| 619 | try p.err(usage_tok, .warning_attribute, .{ p.tokSlice(warning.__name_tok), Escaped.init(msg_str) }); | |
| 559 | 620 | } |
| 560 | if (ty.getAttribute(.unavailable)) |unavailable| { | |
| 561 | try p.errDeprecated(.unavailable, usage_tok, unavailable.msg); | |
| 562 | try p.errStr(.unavailable_note, unavailable.__name_tok, p.tokSlice(decl_tok)); | |
| 621 | if (ty.getAttribute(p.comp, .unavailable)) |unavailable| { | |
| 622 | try p.errDeprecated(usage_tok, .unavailable, unavailable.msg); | |
| 623 | try p.err(unavailable.__name_tok, .unavailable_note, .{p.tokSlice(decl_tok)}); | |
| 563 | 624 | return error.ParsingFailed; |
| 564 | } else if (ty.getAttribute(.deprecated)) |deprecated| { | |
| 565 | try p.errDeprecated(.deprecated_declarations, usage_tok, deprecated.msg); | |
| 566 | try p.errStr(.deprecated_note, deprecated.__name_tok, p.tokSlice(decl_tok)); | |
| 625 | } | |
| 626 | if (ty.getAttribute(p.comp, .deprecated)) |deprecated| { | |
| 627 | try p.errDeprecated(usage_tok, .deprecated_declarations, deprecated.msg); | |
| 628 | try p.err(deprecated.__name_tok, .deprecated_note, .{p.tokSlice(decl_tok)}); | |
| 567 | 629 | } |
| 568 | 630 | } |
| 569 | 631 | |
| 570 | fn errDeprecated(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, msg: ?Value) Compilation.Error!void { | |
| 571 | const strings_top = p.strings.items.len; | |
| 572 | defer p.strings.items.len = strings_top; | |
| 632 | fn errDeprecated(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, msg: ?Value) Compilation.Error!void { | |
| 633 | const colon_str: []const u8 = if (msg != null) ": " else ""; | |
| 634 | const msg_str: []const u8 = if (msg) |m| p.comp.interner.get(m.ref()).bytes else ""; | |
| 635 | return p.err(tok_i, diagnostic, .{ p.tokSlice(tok_i), colon_str, Escaped.init(msg_str) }); | |
| 636 | } | |
| 573 | 637 | |
| 574 | try p.strings.print("'{s}' is ", .{p.tokSlice(tok_i)}); | |
| 575 | const reason: []const u8 = switch (tag) { | |
| 576 | .unavailable => "unavailable", | |
| 577 | .deprecated_declarations => "deprecated", | |
| 578 | else => unreachable, | |
| 579 | }; | |
| 580 | try p.strings.appendSlice(reason); | |
| 581 | if (msg) |m| { | |
| 582 | const str = p.comp.interner.get(m.ref()).bytes; | |
| 583 | try p.strings.print(": {f}", .{std.zig.fmtString(str)}); | |
| 584 | } | |
| 585 | const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 586 | return p.errStr(tag, tok_i, str); | |
| 638 | fn addNode(p: *Parser, node: Tree.Node) Allocator.Error!Node.Index { | |
| 639 | if (p.in_macro) return undefined; | |
| 640 | return p.tree.addNode(node); | |
| 587 | 641 | } |
| 588 | 642 | |
| 589 | fn addNode(p: *Parser, node: Tree.Node) Allocator.Error!NodeIndex { | |
| 590 | if (p.in_macro) return .none; | |
| 591 | const res = p.nodes.len; | |
| 592 | try p.nodes.append(p.gpa, node); | |
| 593 | return @enumFromInt(res); | |
| 643 | fn errExpectedToken(p: *Parser, expected: Token.Id, actual: Token.Id) Error { | |
| 644 | switch (actual) { | |
| 645 | .invalid => try p.err(p.tok_i, .expected_invalid, .{expected}), | |
| 646 | .eof => try p.err(p.tok_i, .expected_eof, .{expected}), | |
| 647 | else => try p.err(p.tok_i, .expected_token, .{ expected, actual }), | |
| 648 | } | |
| 649 | return error.ParsingFailed; | |
| 594 | 650 | } |
| 595 | 651 | |
| 596 | fn addList(p: *Parser, nodes: []const NodeIndex) Allocator.Error!Tree.Node.Range { | |
| 652 | fn addList(p: *Parser, nodes: []const Node.Index) Allocator.Error!Tree.Node.Range { | |
| 597 | 653 | if (p.in_macro) return Tree.Node.Range{ .start = 0, .end = 0 }; |
| 598 | 654 | const start: u32 = @intCast(p.data.items.len); |
| 599 | 655 | try p.data.appendSlice(nodes); |
| ... | ... | @@ -601,6 +657,51 @@ fn addList(p: *Parser, nodes: []const NodeIndex) Allocator.Error!Tree.Node.Range |
| 601 | 657 | return Tree.Node.Range{ .start = start, .end = end }; |
| 602 | 658 | } |
| 603 | 659 | |
| 660 | /// Recursively sets the defintion field of `tentative_decl` to `definition`. | |
| 661 | pub fn setTentativeDeclDefinition(p: *Parser, tentative_decl: Node.Index, definition: Node.Index) void { | |
| 662 | const node_data = &p.tree.nodes.items(.data)[@intFromEnum(tentative_decl)]; | |
| 663 | switch (p.tree.nodes.items(.tag)[@intFromEnum(tentative_decl)]) { | |
| 664 | .fn_proto => {}, | |
| 665 | .variable => {}, | |
| 666 | else => return, | |
| 667 | } | |
| 668 | ||
| 669 | const prev: Node.OptIndex = @enumFromInt(node_data[2]); | |
| 670 | ||
| 671 | node_data[2] = @intFromEnum(definition); | |
| 672 | if (prev.unpack()) |some| { | |
| 673 | p.setTentativeDeclDefinition(some, definition); | |
| 674 | } | |
| 675 | } | |
| 676 | ||
| 677 | /// Clears the defintion field of declarations that were not defined so that | |
| 678 | /// the field always contains a _def if present. | |
| 679 | fn clearNonTentativeDefinitions(p: *Parser) void { | |
| 680 | const tags = p.tree.nodes.items(.tag); | |
| 681 | const data = p.tree.nodes.items(.data); | |
| 682 | for (p.tree.root_decls.items) |root_decl| { | |
| 683 | switch (tags[@intFromEnum(root_decl)]) { | |
| 684 | .fn_proto => { | |
| 685 | const node_data = &data[@intFromEnum(root_decl)]; | |
| 686 | if (node_data[2] != @intFromEnum(Node.OptIndex.null)) { | |
| 687 | if (tags[node_data[2]] != .fn_def) { | |
| 688 | node_data[2] = @intFromEnum(Node.OptIndex.null); | |
| 689 | } | |
| 690 | } | |
| 691 | }, | |
| 692 | .variable => { | |
| 693 | const node_data = &data[@intFromEnum(root_decl)]; | |
| 694 | if (node_data[2] != @intFromEnum(Node.OptIndex.null)) { | |
| 695 | if (tags[node_data[2]] != .variable_def) { | |
| 696 | node_data[2] = @intFromEnum(Node.OptIndex.null); | |
| 697 | } | |
| 698 | } | |
| 699 | }, | |
| 700 | else => {}, | |
| 701 | } | |
| 702 | } | |
| 703 | } | |
| 704 | ||
| 604 | 705 | fn findLabel(p: *Parser, name: []const u8) ?TokenIndex { |
| 605 | 706 | for (p.labels.items) |item| { |
| 606 | 707 | switch (item) { |
| ... | ... | @@ -611,64 +712,36 @@ fn findLabel(p: *Parser, name: []const u8) ?TokenIndex { |
| 611 | 712 | return null; |
| 612 | 713 | } |
| 613 | 714 | |
| 614 | fn nodeIs(p: *Parser, node: NodeIndex, tag: Tree.Tag) bool { | |
| 715 | fn nodeIs(p: *Parser, node: Node.Index, comptime tag: std.meta.Tag(Tree.Node)) bool { | |
| 615 | 716 | return p.getNode(node, tag) != null; |
| 616 | 717 | } |
| 617 | 718 | |
| 618 | pub fn getDecayedStringLiteral(p: *Parser, node: NodeIndex) ?Value { | |
| 619 | const cast_node = p.getNode(node, .implicit_cast) orelse return null; | |
| 620 | const data = p.nodes.items(.data)[@intFromEnum(cast_node)]; | |
| 621 | if (data.cast.kind != .array_to_pointer) return null; | |
| 622 | const literal_node = p.getNode(data.cast.operand, .string_literal_expr) orelse return null; | |
| 623 | return p.value_map.get(literal_node); | |
| 624 | } | |
| 625 | ||
| 626 | fn getNode(p: *Parser, node: NodeIndex, tag: Tree.Tag) ?NodeIndex { | |
| 719 | pub fn getDecayedStringLiteral(p: *Parser, node: Node.Index) ?Value { | |
| 627 | 720 | var cur = node; |
| 628 | const tags = p.nodes.items(.tag); | |
| 629 | const data = p.nodes.items(.data); | |
| 630 | 721 | while (true) { |
| 631 | const cur_tag = tags[@intFromEnum(cur)]; | |
| 632 | if (cur_tag == .paren_expr) { | |
| 633 | cur = data[@intFromEnum(cur)].un; | |
| 634 | } else if (cur_tag == tag) { | |
| 635 | return cur; | |
| 636 | } else { | |
| 637 | return null; | |
| 722 | switch (cur.get(&p.tree)) { | |
| 723 | .paren_expr => |un| cur = un.operand, | |
| 724 | .string_literal_expr => return p.tree.value_map.get(cur), | |
| 725 | .cast => |cast| switch (cast.kind) { | |
| 726 | .no_op, .bitcast, .array_to_pointer => cur = cast.operand, | |
| 727 | else => return null, | |
| 728 | }, | |
| 729 | else => return null, | |
| 638 | 730 | } |
| 639 | 731 | } |
| 640 | 732 | } |
| 641 | 733 | |
| 642 | fn nodeIsCompoundLiteral(p: *Parser, node: NodeIndex) bool { | |
| 734 | fn getNode(p: *Parser, node: Node.Index, comptime tag: std.meta.Tag(Tree.Node)) ?@FieldType(Node, @tagName(tag)) { | |
| 643 | 735 | var cur = node; |
| 644 | const tags = p.nodes.items(.tag); | |
| 645 | const data = p.nodes.items(.data); | |
| 646 | 736 | while (true) { |
| 647 | switch (tags[@intFromEnum(cur)]) { | |
| 648 | .paren_expr => cur = data[@intFromEnum(cur)].un, | |
| 649 | .compound_literal_expr, | |
| 650 | .static_compound_literal_expr, | |
| 651 | .thread_local_compound_literal_expr, | |
| 652 | .static_thread_local_compound_literal_expr, | |
| 653 | => return true, | |
| 654 | else => return false, | |
| 737 | switch (cur.get(&p.tree)) { | |
| 738 | .paren_expr => |un| cur = un.operand, | |
| 739 | tag => |data| return data, | |
| 740 | else => return null, | |
| 655 | 741 | } |
| 656 | 742 | } |
| 657 | 743 | } |
| 658 | 744 | |
| 659 | fn tmpTree(p: *Parser) Tree { | |
| 660 | return .{ | |
| 661 | .nodes = p.nodes.slice(), | |
| 662 | .data = p.data.items, | |
| 663 | .value_map = p.value_map, | |
| 664 | .comp = p.comp, | |
| 665 | .arena = undefined, | |
| 666 | .generated = undefined, | |
| 667 | .tokens = undefined, | |
| 668 | .root_decls = undefined, | |
| 669 | }; | |
| 670 | } | |
| 671 | ||
| 672 | 745 | fn pragma(p: *Parser) Compilation.Error!bool { |
| 673 | 746 | var found_pragma = false; |
| 674 | 747 | while (p.eatToken(.keyword_pragma)) |_| { |
| ... | ... | @@ -691,118 +764,95 @@ fn pragma(p: *Parser) Compilation.Error!bool { |
| 691 | 764 | fn diagnoseIncompleteDefinitions(p: *Parser) !void { |
| 692 | 765 | @branchHint(.cold); |
| 693 | 766 | |
| 694 | const node_slices = p.nodes.slice(); | |
| 695 | const tags = node_slices.items(.tag); | |
| 696 | const tys = node_slices.items(.ty); | |
| 697 | const data = node_slices.items(.data); | |
| 698 | ||
| 699 | for (p.decl_buf.items) |decl_node| { | |
| 700 | const idx = @intFromEnum(decl_node); | |
| 701 | switch (tags[idx]) { | |
| 702 | .struct_forward_decl, .union_forward_decl, .enum_forward_decl => {}, | |
| 767 | for (p.decl_buf.items) |decl_index| { | |
| 768 | const node = decl_index.get(&p.tree); | |
| 769 | const forward = switch (node) { | |
| 770 | .struct_forward_decl, .union_forward_decl, .enum_forward_decl => |forward| forward, | |
| 703 | 771 | else => continue, |
| 704 | } | |
| 772 | }; | |
| 705 | 773 | |
| 706 | const ty = tys[idx]; | |
| 707 | const decl_type_name = if (ty.getRecord()) |rec| | |
| 708 | rec.name | |
| 709 | else if (ty.get(.@"enum")) |en| | |
| 710 | en.data.@"enum".name | |
| 711 | else | |
| 712 | unreachable; | |
| 774 | const decl_type_name = switch (forward.container_qt.base(p.comp).type) { | |
| 775 | .@"struct", .@"union" => |record_ty| record_ty.name, | |
| 776 | .@"enum" => |enum_ty| enum_ty.name, | |
| 777 | else => unreachable, | |
| 778 | }; | |
| 713 | 779 | |
| 714 | 780 | const tentative_def_tok = p.tentative_defs.get(decl_type_name) orelse continue; |
| 715 | const type_str = try p.typeStr(ty); | |
| 716 | try p.errStr(.tentative_definition_incomplete, tentative_def_tok, type_str); | |
| 717 | try p.errStr(.forward_declaration_here, data[idx].decl_ref, type_str); | |
| 781 | try p.err(tentative_def_tok, .tentative_definition_incomplete, .{forward.container_qt}); | |
| 782 | try p.err(forward.name_or_kind_tok, .forward_declaration_here, .{forward.container_qt}); | |
| 718 | 783 | } |
| 719 | 784 | } |
| 720 | 785 | |
| 721 | 786 | /// root : (decl | assembly ';' | staticAssert)* |
| 722 | pub fn parse(pp: *Preprocessor) Error!Tree { | |
| 787 | pub fn parse(pp: *Preprocessor) Compilation.Error!Tree { | |
| 788 | const gpa = pp.comp.gpa; | |
| 723 | 789 | assert(pp.linemarkers == .none); |
| 724 | 790 | pp.comp.pragmaEvent(.before_parse); |
| 725 | 791 | |
| 726 | var arena = std.heap.ArenaAllocator.init(pp.comp.gpa); | |
| 727 | errdefer arena.deinit(); | |
| 728 | var p = Parser{ | |
| 792 | const expected_implicit_typedef_max = 7; | |
| 793 | try pp.tokens.ensureUnusedCapacity(gpa, expected_implicit_typedef_max); | |
| 794 | ||
| 795 | var p: Parser = .{ | |
| 729 | 796 | .pp = pp, |
| 730 | 797 | .comp = pp.comp, |
| 731 | .gpa = pp.comp.gpa, | |
| 732 | .arena = arena.allocator(), | |
| 798 | .diagnostics = pp.diagnostics, | |
| 799 | .tree = .{ | |
| 800 | .comp = pp.comp, | |
| 801 | .tokens = undefined, // Set after implicit typedefs | |
| 802 | }, | |
| 733 | 803 | .tok_ids = pp.tokens.items(.id), |
| 734 | .strings = std.array_list.Managed(u8).init(pp.comp.gpa), | |
| 735 | .value_map = Tree.ValueMap.init(pp.comp.gpa), | |
| 736 | .data = NodeList.init(pp.comp.gpa), | |
| 737 | .labels = std.array_list.Managed(Label).init(pp.comp.gpa), | |
| 738 | .list_buf = NodeList.init(pp.comp.gpa), | |
| 739 | .decl_buf = NodeList.init(pp.comp.gpa), | |
| 740 | .param_buf = std.array_list.Managed(Type.Func.Param).init(pp.comp.gpa), | |
| 741 | .enum_buf = std.array_list.Managed(Type.Enum.Field).init(pp.comp.gpa), | |
| 742 | .record_buf = std.array_list.Managed(Type.Record.Field).init(pp.comp.gpa), | |
| 743 | .field_attr_buf = std.array_list.Managed([]const Attribute).init(pp.comp.gpa), | |
| 744 | 804 | .string_ids = .{ |
| 745 | .declspec_id = try StrInt.intern(pp.comp, "__declspec"), | |
| 746 | .main_id = try StrInt.intern(pp.comp, "main"), | |
| 747 | .file = try StrInt.intern(pp.comp, "FILE"), | |
| 748 | .jmp_buf = try StrInt.intern(pp.comp, "jmp_buf"), | |
| 749 | .sigjmp_buf = try StrInt.intern(pp.comp, "sigjmp_buf"), | |
| 750 | .ucontext_t = try StrInt.intern(pp.comp, "ucontext_t"), | |
| 805 | .declspec_id = try pp.comp.internString("__declspec"), | |
| 806 | .main_id = try pp.comp.internString("main"), | |
| 807 | .file = try pp.comp.internString("FILE"), | |
| 808 | .jmp_buf = try pp.comp.internString("jmp_buf"), | |
| 809 | .sigjmp_buf = try pp.comp.internString("sigjmp_buf"), | |
| 810 | .ucontext_t = try pp.comp.internString("ucontext_t"), | |
| 751 | 811 | }, |
| 752 | 812 | }; |
| 753 | errdefer { | |
| 754 | p.nodes.deinit(pp.comp.gpa); | |
| 755 | p.value_map.deinit(); | |
| 756 | } | |
| 813 | errdefer p.tree.deinit(); | |
| 757 | 814 | defer { |
| 758 | p.data.deinit(); | |
| 759 | p.labels.deinit(); | |
| 760 | p.strings.deinit(); | |
| 761 | p.syms.deinit(pp.comp.gpa); | |
| 762 | p.list_buf.deinit(); | |
| 763 | p.decl_buf.deinit(); | |
| 764 | p.param_buf.deinit(); | |
| 765 | p.enum_buf.deinit(); | |
| 766 | p.record_buf.deinit(); | |
| 767 | p.record_members.deinit(pp.comp.gpa); | |
| 768 | p.attr_buf.deinit(pp.comp.gpa); | |
| 769 | p.attr_application_buf.deinit(pp.comp.gpa); | |
| 770 | p.tentative_defs.deinit(pp.comp.gpa); | |
| 771 | assert(p.field_attr_buf.items.len == 0); | |
| 772 | p.field_attr_buf.deinit(); | |
| 815 | p.labels.deinit(gpa); | |
| 816 | p.strings.deinit(gpa); | |
| 817 | p.syms.deinit(gpa); | |
| 818 | p.list_buf.deinit(gpa); | |
| 819 | p.decl_buf.deinit(gpa); | |
| 820 | p.param_buf.deinit(gpa); | |
| 821 | p.enum_buf.deinit(gpa); | |
| 822 | p.record_buf.deinit(gpa); | |
| 823 | p.record_members.deinit(gpa); | |
| 824 | p.attr_buf.deinit(gpa); | |
| 825 | p.attr_application_buf.deinit(gpa); | |
| 826 | p.tentative_defs.deinit(gpa); | |
| 773 | 827 | } |
| 774 | 828 | |
| 775 | 829 | try p.syms.pushScope(&p); |
| 776 | 830 | defer p.syms.popScope(); |
| 777 | 831 | |
| 778 | // NodeIndex 0 must be invalid | |
| 779 | _ = try p.addNode(.{ .tag = .invalid, .ty = undefined, .data = undefined, .loc = undefined }); | |
| 780 | ||
| 781 | 832 | { |
| 782 | 833 | if (p.comp.langopts.hasChar8_T()) { |
| 783 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "char8_t"), .{ .specifier = .uchar }, 0, .none); | |
| 834 | try p.addImplicitTypedef("char8_t", .uchar); | |
| 784 | 835 | } |
| 785 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__int128_t"), .{ .specifier = .int128 }, 0, .none); | |
| 786 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__uint128_t"), .{ .specifier = .uint128 }, 0, .none); | |
| 787 | ||
| 788 | const elem_ty = try p.arena.create(Type); | |
| 789 | elem_ty.* = .{ .specifier = .char }; | |
| 790 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__builtin_ms_va_list"), .{ | |
| 791 | .specifier = .pointer, | |
| 792 | .data = .{ .sub_type = elem_ty }, | |
| 793 | }, 0, .none); | |
| 836 | try p.addImplicitTypedef("__int128_t", .int128); | |
| 837 | try p.addImplicitTypedef("__uint128_t", .uint128); | |
| 794 | 838 | |
| 795 | const ty = &pp.comp.types.va_list; | |
| 796 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__builtin_va_list"), ty.*, 0, .none); | |
| 839 | try p.addImplicitTypedef("__builtin_ms_va_list", .char_pointer); | |
| 797 | 840 | |
| 798 | if (ty.isArray()) ty.decayArray(); | |
| 841 | const va_list_qt = pp.comp.type_store.va_list; | |
| 842 | try p.addImplicitTypedef("__builtin_va_list", va_list_qt); | |
| 843 | pp.comp.type_store.va_list = try va_list_qt.decay(pp.comp); | |
| 799 | 844 | |
| 800 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__NSConstantString"), pp.comp.types.ns_constant_string.ty, 0, .none); | |
| 845 | try p.addImplicitTypedef("__NSConstantString", pp.comp.type_store.ns_constant_string); | |
| 801 | 846 | |
| 802 | 847 | if (p.comp.float80Type()) |float80_ty| { |
| 803 | try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__float80"), float80_ty, 0, .none); | |
| 848 | try p.addImplicitTypedef("__float80", float80_ty); | |
| 804 | 849 | } |
| 850 | ||
| 851 | // Set here so that the newly generated tokens are included. | |
| 852 | p.tree.tokens = p.pp.tokens.slice(); | |
| 805 | 853 | } |
| 854 | const implicit_typedef_count = p.decl_buf.items.len; | |
| 855 | assert(implicit_typedef_count <= expected_implicit_typedef_max); | |
| 806 | 856 | |
| 807 | 857 | while (p.eatToken(.eof) == null) { |
| 808 | 858 | if (try p.pragma()) continue; |
| ... | ... | @@ -824,7 +874,7 @@ pub fn parse(pp: *Preprocessor) Error!Tree { |
| 824 | 874 | .keyword_asm1, |
| 825 | 875 | .keyword_asm2, |
| 826 | 876 | => {}, |
| 827 | else => try p.err(.expected_external_decl), | |
| 877 | else => try p.err(p.tok_i, .expected_external_decl, .{}), | |
| 828 | 878 | } |
| 829 | 879 | continue; |
| 830 | 880 | } |
| ... | ... | @@ -835,39 +885,68 @@ pub fn parse(pp: *Preprocessor) Error!Tree { |
| 835 | 885 | }, |
| 836 | 886 | else => |e| return e, |
| 837 | 887 | }) |node| { |
| 838 | try p.decl_buf.append(node); | |
| 888 | try p.decl_buf.append(gpa, node); | |
| 839 | 889 | continue; |
| 840 | 890 | } |
| 841 | 891 | if (p.eatToken(.semicolon)) |tok| { |
| 842 | try p.errTok(.extra_semi, tok); | |
| 892 | try p.err(tok, .extra_semi, .{}); | |
| 893 | const empty = try p.tree.addNode(.{ .empty_decl = .{ | |
| 894 | .semicolon = tok, | |
| 895 | } }); | |
| 896 | try p.decl_buf.append(gpa, empty); | |
| 843 | 897 | continue; |
| 844 | 898 | } |
| 845 | try p.err(.expected_external_decl); | |
| 846 | p.tok_i += 1; | |
| 899 | try p.err(p.tok_i, .expected_external_decl, .{}); | |
| 900 | p.nextExternDecl(); | |
| 847 | 901 | } |
| 848 | 902 | if (p.tentative_defs.count() > 0) { |
| 849 | 903 | try p.diagnoseIncompleteDefinitions(); |
| 850 | 904 | } |
| 851 | 905 | |
| 852 | const root_decls = try p.decl_buf.toOwnedSlice(); | |
| 853 | errdefer pp.comp.gpa.free(root_decls); | |
| 854 | if (root_decls.len == 0) { | |
| 855 | try p.errTok(.empty_translation_unit, p.tok_i - 1); | |
| 906 | p.tree.root_decls = p.decl_buf; | |
| 907 | p.decl_buf = .empty; | |
| 908 | ||
| 909 | if (p.tree.root_decls.items.len == implicit_typedef_count) { | |
| 910 | try p.err(p.tok_i - 1, .empty_translation_unit, .{}); | |
| 856 | 911 | } |
| 857 | 912 | pp.comp.pragmaEvent(.after_parse); |
| 858 | 913 | |
| 859 | const data = try p.data.toOwnedSlice(); | |
| 860 | errdefer pp.comp.gpa.free(data); | |
| 861 | return Tree{ | |
| 862 | .comp = pp.comp, | |
| 863 | .tokens = pp.tokens.slice(), | |
| 864 | .arena = arena, | |
| 865 | .generated = pp.comp.generated_buf.items, | |
| 866 | .nodes = p.nodes.toOwnedSlice(), | |
| 867 | .data = data, | |
| 868 | .root_decls = root_decls, | |
| 869 | .value_map = p.value_map, | |
| 870 | }; | |
| 914 | p.clearNonTentativeDefinitions(); | |
| 915 | ||
| 916 | return p.tree; | |
| 917 | } | |
| 918 | ||
| 919 | fn addImplicitTypedef(p: *Parser, name: []const u8, qt: QualType) !void { | |
| 920 | const gpa = p.comp.gpa; | |
| 921 | const start = p.comp.generated_buf.items.len; | |
| 922 | try p.comp.generated_buf.ensureUnusedCapacity(gpa, name.len + 1); | |
| 923 | p.comp.generated_buf.appendSliceAssumeCapacity(name); | |
| 924 | p.comp.generated_buf.appendAssumeCapacity('\n'); | |
| 925 | ||
| 926 | const name_tok: u32 = @intCast(p.pp.tokens.len); | |
| 927 | p.pp.tokens.appendAssumeCapacity(.{ .id = .identifier, .loc = .{ | |
| 928 | .id = .generated, | |
| 929 | .byte_offset = @intCast(start), | |
| 930 | .line = p.pp.generated_line, | |
| 931 | } }); | |
| 932 | p.pp.generated_line += 1; | |
| 933 | ||
| 934 | const node = try p.addNode(.{ | |
| 935 | .typedef = .{ | |
| 936 | .name_tok = name_tok, | |
| 937 | .qt = qt, | |
| 938 | .implicit = true, | |
| 939 | }, | |
| 940 | }); | |
| 941 | ||
| 942 | const interned_name = try p.comp.internString(name); | |
| 943 | const typedef_qt = (try p.comp.type_store.put(gpa, .{ .typedef = .{ | |
| 944 | .base = qt, | |
| 945 | .name = interned_name, | |
| 946 | .decl_node = node, | |
| 947 | } })).withQualifiers(qt); | |
| 948 | try p.syms.defineTypedef(p, interned_name, typedef_qt, name_tok, node); | |
| 949 | try p.decl_buf.append(gpa, node); | |
| 871 | 950 | } |
| 872 | 951 | |
| 873 | 952 | fn skipToPragmaSentinel(p: *Parser) void { |
| ... | ... | @@ -895,9 +974,7 @@ fn nextExternDecl(p: *Parser) void { |
| 895 | 974 | while (true) : (p.tok_i += 1) { |
| 896 | 975 | switch (p.tok_ids[p.tok_i]) { |
| 897 | 976 | .l_paren, .l_brace, .l_bracket => parens += 1, |
| 898 | .r_paren, .r_brace, .r_bracket => if (parens != 0) { | |
| 899 | parens -= 1; | |
| 900 | }, | |
| 977 | .r_paren, .r_brace, .r_bracket => parens -|= 1, | |
| 901 | 978 | .keyword_typedef, |
| 902 | 979 | .keyword_extern, |
| 903 | 980 | .keyword_static, |
| ... | ... | @@ -969,15 +1046,15 @@ fn skipTo(p: *Parser, id: Token.Id) void { |
| 969 | 1046 | } |
| 970 | 1047 | |
| 971 | 1048 | /// Called after a typedef is defined |
| 972 | fn typedefDefined(p: *Parser, name: StringId, ty: Type) void { | |
| 1049 | fn typedefDefined(p: *Parser, name: StringId, ty: QualType) void { | |
| 973 | 1050 | if (name == p.string_ids.file) { |
| 974 | p.comp.types.file = ty; | |
| 1051 | p.comp.type_store.file = ty; | |
| 975 | 1052 | } else if (name == p.string_ids.jmp_buf) { |
| 976 | p.comp.types.jmp_buf = ty; | |
| 1053 | p.comp.type_store.jmp_buf = ty; | |
| 977 | 1054 | } else if (name == p.string_ids.sigjmp_buf) { |
| 978 | p.comp.types.sigjmp_buf = ty; | |
| 1055 | p.comp.type_store.sigjmp_buf = ty; | |
| 979 | 1056 | } else if (name == p.string_ids.ucontext_t) { |
| 980 | p.comp.types.ucontext_t = ty; | |
| 1057 | p.comp.type_store.ucontext_t = ty; | |
| 981 | 1058 | } |
| 982 | 1059 | } |
| 983 | 1060 | |
| ... | ... | @@ -987,6 +1064,7 @@ fn typedefDefined(p: *Parser, name: StringId, ty: Type) void { |
| 987 | 1064 | /// : declSpec (initDeclarator ( ',' initDeclarator)*)? ';' |
| 988 | 1065 | /// | declSpec declarator decl* compoundStmt |
| 989 | 1066 | fn decl(p: *Parser) Error!bool { |
| 1067 | const gpa = p.comp.gpa; | |
| 990 | 1068 | _ = try p.pragma(); |
| 991 | 1069 | const first_tok = p.tok_i; |
| 992 | 1070 | const attr_buf_top = p.attr_buf.len; |
| ... | ... | @@ -994,97 +1072,120 @@ fn decl(p: *Parser) Error!bool { |
| 994 | 1072 | |
| 995 | 1073 | try p.attributeSpecifier(); |
| 996 | 1074 | |
| 997 | var decl_spec = if (try p.declSpec()) |some| some else blk: { | |
| 998 | if (p.func.ty != null) { | |
| 1075 | var decl_spec = (try p.declSpec()) orelse blk: { | |
| 1076 | if (p.func.qt != null) { | |
| 999 | 1077 | p.tok_i = first_tok; |
| 1000 | 1078 | return false; |
| 1001 | 1079 | } |
| 1002 | 1080 | switch (p.tok_ids[first_tok]) { |
| 1003 | .asterisk, .l_paren, .identifier, .extended_identifier => {}, | |
| 1081 | .asterisk, .l_paren => {}, | |
| 1082 | .identifier, .extended_identifier => switch (p.tok_ids[first_tok + 1]) { | |
| 1083 | .identifier, .extended_identifier => { | |
| 1084 | // The most likely reason for `identifier identifier` is | |
| 1085 | // an unknown type name. | |
| 1086 | try p.err(p.tok_i, .unknown_type_name, .{p.tokSlice(p.tok_i)}); | |
| 1087 | p.tok_i += 1; | |
| 1088 | break :blk DeclSpec{ .qt = .invalid }; | |
| 1089 | }, | |
| 1090 | else => {}, | |
| 1091 | }, | |
| 1004 | 1092 | else => if (p.tok_i != first_tok) { |
| 1005 | try p.err(.expected_ident_or_l_paren); | |
| 1093 | try p.err(p.tok_i, .expected_ident_or_l_paren, .{}); | |
| 1006 | 1094 | return error.ParsingFailed; |
| 1007 | 1095 | } else return false, |
| 1008 | 1096 | } |
| 1009 | var spec: Type.Builder = .{}; | |
| 1010 | break :blk DeclSpec{ .ty = try spec.finish(p) }; | |
| 1097 | var builder: TypeStore.Builder = .{ .parser = p }; | |
| 1098 | break :blk DeclSpec{ .qt = try builder.finish() }; | |
| 1011 | 1099 | }; |
| 1012 | 1100 | if (decl_spec.noreturn) |tok| { |
| 1013 | 1101 | const attr = Attribute{ .tag = .noreturn, .args = .{ .noreturn = .{} }, .syntax = .keyword }; |
| 1014 | try p.attr_buf.append(p.gpa, .{ .attr = attr, .tok = tok }); | |
| 1102 | try p.attr_buf.append(gpa, .{ .attr = attr, .tok = tok }); | |
| 1015 | 1103 | } |
| 1016 | var init_d = (try p.initDeclarator(&decl_spec, attr_buf_top)) orelse { | |
| 1104 | ||
| 1105 | var decl_node = try p.tree.addNode(.{ .empty_decl = .{ | |
| 1106 | .semicolon = first_tok, | |
| 1107 | } }); | |
| 1108 | var init_d = (try p.initDeclarator(&decl_spec, attr_buf_top, decl_node)) orelse { | |
| 1017 | 1109 | _ = try p.expectToken(.semicolon); |
| 1018 | if (decl_spec.ty.is(.@"enum") or | |
| 1019 | (decl_spec.ty.isRecord() and !decl_spec.ty.isAnonymousRecord(p.comp) and | |
| 1020 | !decl_spec.ty.isTypeof())) // we follow GCC and clang's behavior here | |
| 1021 | { | |
| 1022 | const specifier = decl_spec.ty.canonicalize(.standard).specifier; | |
| 1023 | const attrs = p.attr_buf.items(.attr)[attr_buf_top..]; | |
| 1024 | const toks = p.attr_buf.items(.tok)[attr_buf_top..]; | |
| 1025 | for (attrs, toks) |attr, tok| { | |
| 1026 | try p.errExtra(.ignored_record_attr, tok, .{ | |
| 1027 | .ignored_record_attr = .{ .tag = attr.tag, .specifier = switch (specifier) { | |
| 1028 | .@"enum" => .@"enum", | |
| 1029 | .@"struct" => .@"struct", | |
| 1030 | .@"union" => .@"union", | |
| 1031 | else => unreachable, | |
| 1032 | } }, | |
| 1033 | }); | |
| 1110 | ||
| 1111 | missing_decl: { | |
| 1112 | if (decl_spec.qt.type(p.comp) == .typeof) { | |
| 1113 | // we follow GCC and clang's behavior here | |
| 1114 | try p.err(first_tok, .missing_declaration, .{}); | |
| 1115 | return true; | |
| 1116 | } | |
| 1117 | switch (decl_spec.qt.base(p.comp).type) { | |
| 1118 | .@"enum" => break :missing_decl, | |
| 1119 | .@"struct", .@"union" => |record_ty| if (!record_ty.isAnonymous(p.comp)) break :missing_decl, | |
| 1120 | else => {}, | |
| 1034 | 1121 | } |
| 1122 | ||
| 1123 | try p.err(first_tok, .missing_declaration, .{}); | |
| 1035 | 1124 | return true; |
| 1036 | 1125 | } |
| 1037 | 1126 | |
| 1038 | try p.errTok(.missing_declaration, first_tok); | |
| 1127 | const attrs = p.attr_buf.items(.attr)[attr_buf_top..]; | |
| 1128 | const toks = p.attr_buf.items(.tok)[attr_buf_top..]; | |
| 1129 | for (attrs, toks) |attr, tok| { | |
| 1130 | try p.err(tok, .ignored_record_attr, .{ | |
| 1131 | @tagName(attr.tag), @tagName(decl_spec.qt.base(p.comp).type), | |
| 1132 | }); | |
| 1133 | } | |
| 1039 | 1134 | return true; |
| 1040 | 1135 | }; |
| 1041 | 1136 | |
| 1042 | 1137 | // Check for function definition. |
| 1043 | if (init_d.d.func_declarator != null and init_d.initializer.node == .none and init_d.d.ty.isFunc()) fn_def: { | |
| 1044 | if (decl_spec.auto_type) |tok_i| { | |
| 1045 | try p.errStr(.auto_type_not_allowed, tok_i, "function return type"); | |
| 1046 | return error.ParsingFailed; | |
| 1047 | } | |
| 1048 | ||
| 1138 | if (init_d.d.declarator_type == .func and init_d.initializer == null) fn_def: { | |
| 1049 | 1139 | switch (p.tok_ids[p.tok_i]) { |
| 1050 | 1140 | .comma, .semicolon => break :fn_def, |
| 1051 | 1141 | .l_brace => {}, |
| 1052 | 1142 | else => if (init_d.d.old_style_func == null) { |
| 1053 | try p.err(.expected_fn_body); | |
| 1143 | try p.err(p.tok_i - 1, .expected_fn_body, .{}); | |
| 1054 | 1144 | return true; |
| 1055 | 1145 | }, |
| 1056 | 1146 | } |
| 1057 | if (p.func.ty != null) try p.err(.func_not_in_root); | |
| 1058 | ||
| 1059 | const node = try p.addNode(undefined); // reserve space | |
| 1060 | const interned_declarator_name = try StrInt.intern(p.comp, p.tokSlice(init_d.d.name)); | |
| 1061 | try p.syms.defineSymbol(p, interned_declarator_name, init_d.d.ty, init_d.d.name, node, .{}, false); | |
| 1147 | if (p.func.qt != null) try p.err(p.tok_i, .func_not_in_root, .{}); | |
| 1062 | 1148 | |
| 1149 | const interned_declarator_name = try p.comp.internString(p.tokSlice(init_d.d.name)); | |
| 1150 | try p.syms.defineSymbol(p, interned_declarator_name, init_d.d.qt, init_d.d.name, decl_node, .{}, false); | |
| 1063 | 1151 | const func = p.func; |
| 1064 | 1152 | p.func = .{ |
| 1065 | .ty = init_d.d.ty, | |
| 1153 | .qt = init_d.d.qt, | |
| 1066 | 1154 | .name = init_d.d.name, |
| 1067 | 1155 | }; |
| 1068 | if (interned_declarator_name == p.string_ids.main_id and !init_d.d.ty.returnType().is(.int)) { | |
| 1069 | try p.errTok(.main_return_type, init_d.d.name); | |
| 1070 | } | |
| 1071 | 1156 | defer p.func = func; |
| 1072 | 1157 | |
| 1158 | // Check return type of 'main' function. | |
| 1159 | if (interned_declarator_name == p.string_ids.main_id) { | |
| 1160 | const func_ty = init_d.d.qt.get(p.comp, .func).?; | |
| 1161 | const int_ty = func_ty.return_type.get(p.comp, .int); | |
| 1162 | if (int_ty == null or int_ty.? != .int) { | |
| 1163 | try p.err(init_d.d.name, .main_return_type, .{}); | |
| 1164 | } | |
| 1165 | } | |
| 1166 | ||
| 1073 | 1167 | try p.syms.pushScope(p); |
| 1074 | 1168 | defer p.syms.popScope(); |
| 1075 | 1169 | |
| 1076 | 1170 | // Collect old style parameter declarations. |
| 1077 | 1171 | if (init_d.d.old_style_func != null) { |
| 1078 | var base_ty = init_d.d.ty.base(); | |
| 1079 | base_ty.specifier = .func; | |
| 1080 | ||
| 1081 | 1172 | const param_buf_top = p.param_buf.items.len; |
| 1082 | 1173 | defer p.param_buf.items.len = param_buf_top; |
| 1083 | 1174 | |
| 1175 | // We cannot refer to the function type here because the pointer to | |
| 1176 | // type_store.extra might get invalidated while parsing the param decls. | |
| 1177 | const func_qt = init_d.d.qt.base(p.comp).qt; | |
| 1178 | const params_len = func_qt.get(p.comp, .func).?.params.len; | |
| 1179 | ||
| 1180 | const new_params = try p.param_buf.addManyAsSlice(gpa, params_len); | |
| 1181 | for (new_params) |*new_param| { | |
| 1182 | new_param.name = .empty; | |
| 1183 | } | |
| 1184 | ||
| 1084 | 1185 | param_loop: while (true) { |
| 1085 | 1186 | const param_decl_spec = (try p.declSpec()) orelse break; |
| 1086 | 1187 | if (p.eatToken(.semicolon)) |semi| { |
| 1087 | try p.errTok(.missing_declaration, semi); | |
| 1188 | try p.err(semi, .missing_declaration, .{}); | |
| 1088 | 1189 | continue :param_loop; |
| 1089 | 1190 | } |
| 1090 | 1191 | |
| ... | ... | @@ -1092,97 +1193,140 @@ fn decl(p: *Parser) Error!bool { |
| 1092 | 1193 | const attr_buf_top_declarator = p.attr_buf.len; |
| 1093 | 1194 | defer p.attr_buf.len = attr_buf_top_declarator; |
| 1094 | 1195 | |
| 1095 | var d = (try p.declarator(param_decl_spec.ty, .param)) orelse { | |
| 1096 | try p.errTok(.missing_declaration, first_tok); | |
| 1196 | var param_d = (try p.declarator(param_decl_spec.qt, .param)) orelse { | |
| 1197 | try p.err(first_tok, .missing_declaration, .{}); | |
| 1097 | 1198 | _ = try p.expectToken(.semicolon); |
| 1098 | 1199 | continue :param_loop; |
| 1099 | 1200 | }; |
| 1100 | 1201 | try p.attributeSpecifier(); |
| 1101 | 1202 | |
| 1102 | if (d.ty.hasIncompleteSize() and !d.ty.is(.void)) try p.errStr(.parameter_incomplete_ty, d.name, try p.typeStr(d.ty)); | |
| 1103 | if (d.ty.isFunc()) { | |
| 1104 | // Params declared as functions are converted to function pointers. | |
| 1105 | const elem_ty = try p.arena.create(Type); | |
| 1106 | elem_ty.* = d.ty; | |
| 1107 | d.ty = Type{ | |
| 1108 | .specifier = .pointer, | |
| 1109 | .data = .{ .sub_type = elem_ty }, | |
| 1110 | }; | |
| 1111 | } else if (d.ty.isArray()) { | |
| 1112 | // params declared as arrays are converted to pointers | |
| 1113 | d.ty.decayArray(); | |
| 1114 | } else if (d.ty.is(.void)) { | |
| 1115 | try p.errTok(.invalid_void_param, d.name); | |
| 1203 | if (param_d.qt.hasIncompleteSize(p.comp)) { | |
| 1204 | if (param_d.qt.is(p.comp, .void)) { | |
| 1205 | try p.err(param_d.name, .invalid_void_param, .{}); | |
| 1206 | } else { | |
| 1207 | try p.err(param_d.name, .parameter_incomplete_ty, .{param_d.qt}); | |
| 1208 | } | |
| 1209 | } else { | |
| 1210 | // Decay params declared as functions or arrays to pointer. | |
| 1211 | param_d.qt = try param_d.qt.decay(p.comp); | |
| 1116 | 1212 | } |
| 1117 | 1213 | |
| 1214 | const attributed_qt = try Attribute.applyParameterAttributes(p, param_d.qt, attr_buf_top_declarator, .alignas_on_param); | |
| 1215 | ||
| 1216 | try param_decl_spec.validateParam(p); | |
| 1217 | const param_node = try p.addNode(.{ | |
| 1218 | .param = .{ | |
| 1219 | .name_tok = param_d.name, | |
| 1220 | .qt = attributed_qt, | |
| 1221 | .storage_class = switch (param_decl_spec.storage_class) { | |
| 1222 | .none => .auto, | |
| 1223 | .register => .register, | |
| 1224 | else => .auto, // Error reported in `validateParam` | |
| 1225 | }, | |
| 1226 | }, | |
| 1227 | }); | |
| 1228 | ||
| 1229 | const name_str = p.tokSlice(param_d.name); | |
| 1230 | const interned_name = try p.comp.internString(name_str); | |
| 1231 | try p.syms.defineParam(p, interned_name, attributed_qt, param_d.name, param_node); | |
| 1232 | ||
| 1118 | 1233 | // find and correct parameter types |
| 1119 | // TODO check for missing declarations and redefinitions | |
| 1120 | const name_str = p.tokSlice(d.name); | |
| 1121 | const interned_name = try StrInt.intern(p.comp, name_str); | |
| 1122 | for (init_d.d.ty.params()) |*param| { | |
| 1234 | for (func_qt.get(p.comp, .func).?.params, new_params) |param, *new_param| { | |
| 1123 | 1235 | if (param.name == interned_name) { |
| 1124 | param.ty = d.ty; | |
| 1236 | new_param.* = .{ | |
| 1237 | .qt = attributed_qt, | |
| 1238 | .name = param.name, | |
| 1239 | .node = .pack(param_node), | |
| 1240 | .name_tok = param.name_tok, | |
| 1241 | }; | |
| 1125 | 1242 | break; |
| 1126 | 1243 | } |
| 1127 | 1244 | } else { |
| 1128 | try p.errStr(.parameter_missing, d.name, name_str); | |
| 1245 | try p.err(param_d.name, .parameter_missing, .{name_str}); | |
| 1129 | 1246 | } |
| 1130 | d.ty = try Attribute.applyParameterAttributes(p, d.ty, attr_buf_top_declarator, .alignas_on_param); | |
| 1131 | ||
| 1132 | // bypass redefinition check to avoid duplicate errors | |
| 1133 | try p.syms.define(p.gpa, .{ | |
| 1134 | .kind = .def, | |
| 1135 | .name = interned_name, | |
| 1136 | .tok = d.name, | |
| 1137 | .ty = d.ty, | |
| 1138 | .val = .{}, | |
| 1139 | }); | |
| 1247 | ||
| 1140 | 1248 | if (p.eatToken(.comma) == null) break; |
| 1141 | 1249 | } |
| 1142 | 1250 | _ = try p.expectToken(.semicolon); |
| 1143 | 1251 | } |
| 1144 | } else { | |
| 1145 | for (init_d.d.ty.params()) |param| { | |
| 1146 | if (param.ty.hasUnboundVLA()) try p.errTok(.unbound_vla, param.name_tok); | |
| 1147 | 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)); | |
| 1148 | 1252 | |
| 1253 | const func_ty = func_qt.get(p.comp, .func).?; | |
| 1254 | for (func_ty.params, new_params) |param, *new_param| { | |
| 1255 | if (new_param.name == .empty) { | |
| 1256 | try p.err(param.name_tok, .param_not_declared, .{param.name.lookup(p.comp)}); | |
| 1257 | new_param.* = .{ | |
| 1258 | .name = param.name, | |
| 1259 | .name_tok = param.name_tok, | |
| 1260 | .node = param.node, | |
| 1261 | .qt = .int, | |
| 1262 | }; | |
| 1263 | } | |
| 1264 | } | |
| 1265 | // Update the functio type to contain the declared parameters. | |
| 1266 | p.func.qt = try p.comp.type_store.put(gpa, .{ .func = .{ | |
| 1267 | .kind = .normal, | |
| 1268 | .params = new_params, | |
| 1269 | .return_type = func_ty.return_type, | |
| 1270 | } }); | |
| 1271 | } else if (init_d.d.qt.get(p.comp, .func)) |func_ty| { | |
| 1272 | for (func_ty.params) |param| { | |
| 1149 | 1273 | if (param.name == .empty) { |
| 1150 | try p.errTok(.omitting_parameter_name, param.name_tok); | |
| 1274 | try p.err(param.name_tok, .omitting_parameter_name, .{}); | |
| 1151 | 1275 | continue; |
| 1152 | 1276 | } |
| 1153 | 1277 | |
| 1154 | 1278 | // bypass redefinition check to avoid duplicate errors |
| 1155 | try p.syms.define(p.gpa, .{ | |
| 1279 | try p.syms.define(gpa, .{ | |
| 1156 | 1280 | .kind = .def, |
| 1157 | 1281 | .name = param.name, |
| 1158 | 1282 | .tok = param.name_tok, |
| 1159 | .ty = param.ty, | |
| 1283 | .qt = param.qt, | |
| 1160 | 1284 | .val = .{}, |
| 1285 | .node = param.node, | |
| 1161 | 1286 | }); |
| 1287 | if (param.qt.isInvalid()) continue; | |
| 1288 | ||
| 1289 | if (param.qt.get(p.comp, .pointer)) |pointer_ty| { | |
| 1290 | if (pointer_ty.decayed) |decayed_qt| { | |
| 1291 | if (decayed_qt.get(p.comp, .array)) |array_ty| { | |
| 1292 | if (array_ty.len == .unspecified_variable) { | |
| 1293 | try p.err(param.name_tok, .unbound_vla, .{}); | |
| 1294 | } | |
| 1295 | } | |
| 1296 | } | |
| 1297 | } | |
| 1298 | if (param.qt.hasIncompleteSize(p.comp) and !param.qt.is(p.comp, .void)) { | |
| 1299 | try p.err(param.name_tok, .parameter_incomplete_ty, .{param.qt}); | |
| 1300 | } | |
| 1162 | 1301 | } |
| 1163 | 1302 | } |
| 1164 | 1303 | |
| 1165 | 1304 | const body = (try p.compoundStmt(true, null)) orelse { |
| 1166 | 1305 | assert(init_d.d.old_style_func != null); |
| 1167 | try p.err(.expected_fn_body); | |
| 1306 | try p.err(p.tok_i, .expected_fn_body, .{}); | |
| 1168 | 1307 | return true; |
| 1169 | 1308 | }; |
| 1170 | p.nodes.set(@intFromEnum(node), .{ | |
| 1171 | .ty = init_d.d.ty, | |
| 1172 | .tag = try decl_spec.validateFnDef(p), | |
| 1173 | .data = .{ .decl = .{ .name = init_d.d.name, .node = body } }, | |
| 1174 | .loc = @enumFromInt(init_d.d.name), | |
| 1175 | }); | |
| 1176 | try p.decl_buf.append(node); | |
| 1309 | ||
| 1310 | try decl_spec.validateFnDef(p); | |
| 1311 | try p.tree.setNode(.{ .function = .{ | |
| 1312 | .name_tok = init_d.d.name, | |
| 1313 | .@"inline" = decl_spec.@"inline" != null, | |
| 1314 | .static = decl_spec.storage_class == .static, | |
| 1315 | .qt = p.func.qt.?, | |
| 1316 | .body = body, | |
| 1317 | .definition = null, | |
| 1318 | } }, @intFromEnum(decl_node)); | |
| 1319 | ||
| 1320 | try p.decl_buf.append(gpa, decl_node); | |
| 1177 | 1321 | |
| 1178 | 1322 | // check gotos |
| 1179 | if (func.ty == null) { | |
| 1323 | if (func.qt == null) { | |
| 1180 | 1324 | for (p.labels.items) |item| { |
| 1181 | 1325 | if (item == .unresolved_goto) |
| 1182 | try p.errStr(.undeclared_label, item.unresolved_goto, p.tokSlice(item.unresolved_goto)); | |
| 1326 | try p.err(item.unresolved_goto, .undeclared_label, .{p.tokSlice(item.unresolved_goto)}); | |
| 1183 | 1327 | } |
| 1184 | 1328 | if (p.computed_goto_tok) |goto_tok| { |
| 1185 | if (!p.contains_address_of_label) try p.errTok(.invalid_computed_goto, goto_tok); | |
| 1329 | if (!p.contains_address_of_label) try p.err(goto_tok, .invalid_computed_goto, .{}); | |
| 1186 | 1330 | } |
| 1187 | 1331 | p.labels.items.len = 0; |
| 1188 | 1332 | p.label_count = 0; |
| ... | ... | @@ -1195,59 +1339,110 @@ fn decl(p: *Parser) Error!bool { |
| 1195 | 1339 | // Declare all variable/typedef declarators. |
| 1196 | 1340 | var warned_auto = false; |
| 1197 | 1341 | while (true) { |
| 1198 | if (init_d.d.old_style_func) |tok_i| try p.errTok(.invalid_old_style_params, tok_i); | |
| 1199 | const tag = try decl_spec.validate(p, &init_d.d.ty, init_d.initializer.node != .none); | |
| 1342 | if (init_d.d.old_style_func) |tok_i| try p.err(tok_i, .invalid_old_style_params, .{}); | |
| 1200 | 1343 | |
| 1201 | const tok = switch (decl_spec.storage_class) { | |
| 1202 | .auto, .@"extern", .register, .static, .typedef => |tok| tok, | |
| 1203 | .none => init_d.d.name, | |
| 1204 | }; | |
| 1205 | const node = try p.addNode(.{ | |
| 1206 | .ty = init_d.d.ty, | |
| 1207 | .tag = tag, | |
| 1208 | .data = .{ | |
| 1209 | .decl = .{ .name = init_d.d.name, .node = init_d.initializer.node }, | |
| 1210 | }, | |
| 1211 | .loc = @enumFromInt(tok), | |
| 1212 | }); | |
| 1213 | try p.decl_buf.append(node); | |
| 1344 | if (decl_spec.storage_class == .typedef) { | |
| 1345 | try decl_spec.validateDecl(p); | |
| 1346 | try p.tree.setNode(.{ .typedef = .{ | |
| 1347 | .name_tok = init_d.d.name, | |
| 1348 | .qt = init_d.d.qt, | |
| 1349 | .implicit = false, | |
| 1350 | } }, @intFromEnum(decl_node)); | |
| 1351 | } else if (init_d.d.declarator_type == .func or init_d.d.qt.is(p.comp, .func)) { | |
| 1352 | try decl_spec.validateFnDecl(p); | |
| 1353 | try p.tree.setNode(.{ .function = .{ | |
| 1354 | .name_tok = init_d.d.name, | |
| 1355 | .qt = init_d.d.qt, | |
| 1356 | .static = decl_spec.storage_class == .static, | |
| 1357 | .@"inline" = decl_spec.@"inline" != null, | |
| 1358 | .body = null, | |
| 1359 | .definition = null, | |
| 1360 | } }, @intFromEnum(decl_node)); | |
| 1361 | } else { | |
| 1362 | try decl_spec.validateDecl(p); | |
| 1363 | var node_qt = init_d.d.qt; | |
| 1364 | if (p.func.qt == null and decl_spec.storage_class != .@"extern") { | |
| 1365 | if (node_qt.get(p.comp, .array)) |array_ty| { | |
| 1366 | if (array_ty.len == .incomplete) { | |
| 1367 | // Create tentative array node with fixed type. | |
| 1368 | node_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 1369 | .elem = array_ty.elem, | |
| 1370 | .len = .{ .fixed = 1 }, | |
| 1371 | } }); | |
| 1372 | } | |
| 1373 | } | |
| 1374 | } | |
| 1375 | ||
| 1376 | try p.tree.setNode(.{ | |
| 1377 | .variable = .{ | |
| 1378 | .name_tok = init_d.d.name, | |
| 1379 | .qt = node_qt, | |
| 1380 | .thread_local = decl_spec.thread_local != null, | |
| 1381 | .implicit = false, | |
| 1382 | .storage_class = switch (decl_spec.storage_class) { | |
| 1383 | .auto => .auto, | |
| 1384 | .register => .register, | |
| 1385 | .static => .static, | |
| 1386 | .@"extern" => if (init_d.initializer == null) .@"extern" else .auto, | |
| 1387 | else => .auto, // Error reported in `validate` | |
| 1388 | }, | |
| 1389 | .initializer = if (init_d.initializer) |some| some.node else null, | |
| 1390 | .definition = null, | |
| 1391 | }, | |
| 1392 | }, @intFromEnum(decl_node)); | |
| 1393 | } | |
| 1394 | try p.decl_buf.append(gpa, decl_node); | |
| 1214 | 1395 | |
| 1215 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(init_d.d.name)); | |
| 1396 | const interned_name = try p.comp.internString(p.tokSlice(init_d.d.name)); | |
| 1216 | 1397 | if (decl_spec.storage_class == .typedef) { |
| 1217 | try p.syms.defineTypedef(p, interned_name, init_d.d.ty, init_d.d.name, node); | |
| 1218 | p.typedefDefined(interned_name, init_d.d.ty); | |
| 1219 | } else if (init_d.initializer.node != .none or | |
| 1220 | (p.func.ty != null and decl_spec.storage_class != .@"extern")) | |
| 1221 | { | |
| 1398 | const typedef_qt = if (init_d.d.qt.isInvalid()) | |
| 1399 | init_d.d.qt | |
| 1400 | else | |
| 1401 | (try p.comp.type_store.put(gpa, .{ .typedef = .{ | |
| 1402 | .base = init_d.d.qt, | |
| 1403 | .name = interned_name, | |
| 1404 | .decl_node = decl_node, | |
| 1405 | } })).withQualifiers(init_d.d.qt); | |
| 1406 | try p.syms.defineTypedef(p, interned_name, typedef_qt, init_d.d.name, decl_node); | |
| 1407 | p.typedefDefined(interned_name, typedef_qt); | |
| 1408 | } else if (init_d.initializer) |init| { | |
| 1222 | 1409 | // TODO validate global variable/constexpr initializer comptime known |
| 1223 | 1410 | try p.syms.defineSymbol( |
| 1224 | 1411 | p, |
| 1225 | 1412 | interned_name, |
| 1226 | init_d.d.ty, | |
| 1413 | init_d.d.qt, | |
| 1227 | 1414 | init_d.d.name, |
| 1228 | node, | |
| 1229 | if (init_d.d.ty.isConst() or decl_spec.constexpr != null) init_d.initializer.val else .{}, | |
| 1415 | decl_node, | |
| 1416 | if (init_d.d.qt.@"const" or decl_spec.constexpr != null) init.val else .{}, | |
| 1230 | 1417 | decl_spec.constexpr != null, |
| 1231 | 1418 | ); |
| 1419 | } else if (init_d.d.qt.is(p.comp, .func)) { | |
| 1420 | try p.syms.declareSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node); | |
| 1421 | } else if (p.func.qt != null and decl_spec.storage_class != .@"extern") { | |
| 1422 | try p.syms.defineSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node, .{}, false); | |
| 1232 | 1423 | } else { |
| 1233 | try p.syms.declareSymbol(p, interned_name, init_d.d.ty, init_d.d.name, node); | |
| 1424 | try p.syms.declareSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node); | |
| 1234 | 1425 | } |
| 1235 | 1426 | |
| 1236 | 1427 | if (p.eatToken(.comma) == null) break; |
| 1237 | 1428 | |
| 1238 | 1429 | if (!warned_auto) { |
| 1430 | // TODO these are warnings in clang | |
| 1239 | 1431 | if (decl_spec.auto_type) |tok_i| { |
| 1240 | try p.errTok(.auto_type_requires_single_declarator, tok_i); | |
| 1432 | try p.err(tok_i, .auto_type_requires_single_declarator, .{}); | |
| 1241 | 1433 | warned_auto = true; |
| 1242 | 1434 | } |
| 1243 | if (p.comp.langopts.standard.atLeast(.c23) and decl_spec.storage_class == .auto) { | |
| 1244 | try p.errTok(.c23_auto_single_declarator, decl_spec.storage_class.auto); | |
| 1435 | if (decl_spec.c23_auto) |tok_i| { | |
| 1436 | try p.err(tok_i, .c23_auto_single_declarator, .{}); | |
| 1245 | 1437 | warned_auto = true; |
| 1246 | 1438 | } |
| 1247 | 1439 | } |
| 1248 | 1440 | |
| 1249 | init_d = (try p.initDeclarator(&decl_spec, attr_buf_top)) orelse { | |
| 1250 | try p.err(.expected_ident_or_l_paren); | |
| 1441 | decl_node = try p.tree.addNode(.{ .empty_decl = .{ | |
| 1442 | .semicolon = p.tok_i - 1, | |
| 1443 | } }); | |
| 1444 | init_d = (try p.initDeclarator(&decl_spec, attr_buf_top, decl_node)) orelse { | |
| 1445 | try p.err(p.tok_i, .expected_ident_or_l_paren, .{}); | |
| 1251 | 1446 | continue; |
| 1252 | 1447 | }; |
| 1253 | 1448 | } |
| ... | ... | @@ -1256,52 +1451,39 @@ fn decl(p: *Parser) Error!bool { |
| 1256 | 1451 | return true; |
| 1257 | 1452 | } |
| 1258 | 1453 | |
| 1259 | fn staticAssertMessage(p: *Parser, cond_node: NodeIndex, message: Result) Error!?[]const u8 { | |
| 1260 | const cond_tag = p.nodes.items(.tag)[@intFromEnum(cond_node)]; | |
| 1261 | if (cond_tag != .builtin_types_compatible_p and message.node == .none) return null; | |
| 1262 | ||
| 1263 | var allocating: std.Io.Writer.Allocating = .init(p.gpa); | |
| 1264 | defer allocating.deinit(); | |
| 1265 | ||
| 1266 | const buf = &allocating.writer; | |
| 1454 | fn staticAssertMessage(p: *Parser, cond_node: Node.Index, maybe_message: ?Result, allocating: *std.Io.Writer.Allocating) !?[]const u8 { | |
| 1455 | const w = &allocating.writer; | |
| 1267 | 1456 | |
| 1268 | if (cond_tag == .builtin_types_compatible_p) { | |
| 1269 | const mapper = p.comp.string_interner.getSlowTypeMapper(); | |
| 1270 | const data = p.nodes.items(.data)[@intFromEnum(cond_node)].bin; | |
| 1457 | const cond = cond_node.get(&p.tree); | |
| 1458 | if (cond == .builtin_types_compatible_p) { | |
| 1459 | try w.writeAll("'__builtin_types_compatible_p("); | |
| 1271 | 1460 | |
| 1272 | buf.writeAll("'__builtin_types_compatible_p(") catch return error.OutOfMemory; | |
| 1461 | const lhs_ty = cond.builtin_types_compatible_p.lhs; | |
| 1462 | try lhs_ty.print(p.comp, w); | |
| 1463 | try w.writeAll(", "); | |
| 1273 | 1464 | |
| 1274 | const lhs_ty = p.nodes.items(.ty)[@intFromEnum(data.lhs)]; | |
| 1275 | lhs_ty.print(mapper, p.comp.langopts, buf) catch |e| switch (e) { | |
| 1276 | error.WriteFailed => return error.OutOfMemory, | |
| 1277 | }; | |
| 1278 | buf.writeAll(", ") catch return error.OutOfMemory; | |
| 1465 | const rhs_ty = cond.builtin_types_compatible_p.rhs; | |
| 1466 | try rhs_ty.print(p.comp, w); | |
| 1279 | 1467 | |
| 1280 | const rhs_ty = p.nodes.items(.ty)[@intFromEnum(data.rhs)]; | |
| 1281 | rhs_ty.print(mapper, p.comp.langopts, buf) catch |e| switch (e) { | |
| 1282 | error.WriteFailed => return error.OutOfMemory, | |
| 1283 | }; | |
| 1468 | try w.writeAll(")'"); | |
| 1469 | } else if (maybe_message == null) return null; | |
| 1284 | 1470 | |
| 1285 | buf.writeAll(")'") catch return error.OutOfMemory; | |
| 1286 | } | |
| 1287 | if (message.node != .none) { | |
| 1288 | assert(p.nodes.items(.tag)[@intFromEnum(message.node)] == .string_literal_expr); | |
| 1289 | if (buf.buffered().len > 0) { | |
| 1290 | buf.writeByte(' ') catch return error.OutOfMemory; | |
| 1471 | if (maybe_message) |message| { | |
| 1472 | assert(message.node.get(&p.tree) == .string_literal_expr); | |
| 1473 | if (allocating.written().len > 0) { | |
| 1474 | try w.writeByte(' '); | |
| 1291 | 1475 | } |
| 1292 | 1476 | const bytes = p.comp.interner.get(message.val.ref()).bytes; |
| 1293 | try allocating.ensureUnusedCapacity(bytes.len); | |
| 1294 | Value.printString(bytes, message.ty, p.comp, buf) catch |e| switch (e) { | |
| 1295 | error.WriteFailed => return error.OutOfMemory, | |
| 1296 | }; | |
| 1477 | try Value.printString(bytes, message.qt, p.comp, w); | |
| 1297 | 1478 | } |
| 1298 | return try p.comp.diagnostics.arena.allocator().dupe(u8, allocating.written()); | |
| 1479 | return allocating.written(); | |
| 1299 | 1480 | } |
| 1300 | 1481 | |
| 1301 | 1482 | /// staticAssert |
| 1302 | 1483 | /// : keyword_static_assert '(' integerConstExpr (',' STRING_LITERAL)? ')' ';' |
| 1303 | 1484 | /// | keyword_c23_static_assert '(' integerConstExpr (',' STRING_LITERAL)? ')' ';' |
| 1304 | 1485 | fn staticAssert(p: *Parser) Error!bool { |
| 1486 | const gpa = p.comp.gpa; | |
| 1305 | 1487 | const static_assert = p.eatToken(.keyword_static_assert) orelse p.eatToken(.keyword_c23_static_assert) orelse return false; |
| 1306 | 1488 | const l_paren = try p.expectToken(.l_paren); |
| 1307 | 1489 | const res_token = p.tok_i; |
| ... | ... | @@ -1317,52 +1499,50 @@ fn staticAssert(p: *Parser) Error!bool { |
| 1317 | 1499 | .unterminated_string_literal, |
| 1318 | 1500 | => try p.stringLiteral(), |
| 1319 | 1501 | else => { |
| 1320 | try p.err(.expected_str_literal); | |
| 1502 | try p.err(p.tok_i, .expected_str_literal, .{}); | |
| 1321 | 1503 | return error.ParsingFailed; |
| 1322 | 1504 | }, |
| 1323 | 1505 | } |
| 1324 | 1506 | else |
| 1325 | Result{}; | |
| 1507 | null; | |
| 1326 | 1508 | try p.expectClosing(l_paren, .r_paren); |
| 1327 | 1509 | _ = try p.expectToken(.semicolon); |
| 1328 | if (str.node == .none) { | |
| 1329 | try p.errTok(.static_assert_missing_message, static_assert); | |
| 1330 | try p.errStr(.pre_c23_compat, static_assert, "'_Static_assert' with no message"); | |
| 1510 | if (str == null) { | |
| 1511 | try p.err(static_assert, .static_assert_missing_message, .{}); | |
| 1512 | try p.err(static_assert, .pre_c23_compat, .{"'_Static_assert' with no message"}); | |
| 1331 | 1513 | } |
| 1332 | 1514 | |
| 1333 | // Array will never be zero; a value of zero for a pointer is a null pointer constant | |
| 1334 | if ((res.ty.isArray() or res.ty.isPtr()) and !res.val.isZero(p.comp)) { | |
| 1335 | const err_start = p.comp.diagnostics.list.items.len; | |
| 1336 | try p.errTok(.const_decl_folded, res_token); | |
| 1337 | if (res.ty.isPtr() and err_start != p.comp.diagnostics.list.items.len) { | |
| 1338 | // Don't show the note if the .const_decl_folded diagnostic was not added | |
| 1339 | try p.errTok(.constant_expression_conversion_not_allowed, res_token); | |
| 1340 | } | |
| 1515 | const is_int_expr = res.qt.isInvalid() or res.qt.isInt(p.comp); | |
| 1516 | try res.castToBool(p, .bool, res_token); | |
| 1517 | if (!is_int_expr) { | |
| 1518 | res.val = .{}; | |
| 1341 | 1519 | } |
| 1342 | try res.boolCast(p, .{ .specifier = .bool }, res_token); | |
| 1343 | 1520 | if (res.val.opt_ref == .none) { |
| 1344 | if (res.ty.specifier != .invalid) { | |
| 1345 | try p.errTok(.static_assert_not_constant, res_token); | |
| 1521 | if (!res.qt.isInvalid()) { | |
| 1522 | try p.err(res_token, .static_assert_not_constant, .{}); | |
| 1346 | 1523 | } |
| 1347 | 1524 | } else { |
| 1348 | 1525 | if (!res.val.toBool(p.comp)) { |
| 1349 | if (try p.staticAssertMessage(res_node, str)) |message| { | |
| 1350 | try p.errStr(.static_assert_failure_message, static_assert, message); | |
| 1526 | var sf = std.heap.stackFallback(1024, gpa); | |
| 1527 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 1528 | defer allocating.deinit(); | |
| 1529 | ||
| 1530 | if (p.staticAssertMessage(res_node, str, &allocating) catch return error.OutOfMemory) |message| { | |
| 1531 | try p.err(static_assert, .static_assert_failure_message, .{message}); | |
| 1351 | 1532 | } else { |
| 1352 | try p.errTok(.static_assert_failure, static_assert); | |
| 1533 | try p.err(static_assert, .static_assert_failure, .{}); | |
| 1353 | 1534 | } |
| 1354 | 1535 | } |
| 1355 | 1536 | } |
| 1356 | 1537 | |
| 1357 | 1538 | const node = try p.addNode(.{ |
| 1358 | .tag = .static_assert, | |
| 1359 | .data = .{ .bin = .{ | |
| 1360 | .lhs = res.node, | |
| 1361 | .rhs = str.node, | |
| 1362 | } }, | |
| 1363 | .loc = @enumFromInt(static_assert), | |
| 1539 | .static_assert = .{ | |
| 1540 | .assert_tok = static_assert, | |
| 1541 | .cond = res.node, | |
| 1542 | .message = if (str) |some| some.node else null, | |
| 1543 | }, | |
| 1364 | 1544 | }); |
| 1365 | try p.decl_buf.append(node); | |
| 1545 | try p.decl_buf.append(gpa, node); | |
| 1366 | 1546 | return true; |
| 1367 | 1547 | } |
| 1368 | 1548 | |
| ... | ... | @@ -1380,95 +1560,63 @@ pub const DeclSpec = struct { |
| 1380 | 1560 | @"inline": ?TokenIndex = null, |
| 1381 | 1561 | noreturn: ?TokenIndex = null, |
| 1382 | 1562 | auto_type: ?TokenIndex = null, |
| 1383 | ty: Type, | |
| 1563 | c23_auto: ?TokenIndex = null, | |
| 1564 | qt: QualType, | |
| 1384 | 1565 | |
| 1385 | fn validateParam(d: DeclSpec, p: *Parser, ty: *Type) Error!void { | |
| 1566 | fn validateParam(d: DeclSpec, p: *Parser) Error!void { | |
| 1386 | 1567 | switch (d.storage_class) { |
| 1387 | .none => {}, | |
| 1388 | .register => ty.qual.register = true, | |
| 1389 | .auto, .@"extern", .static, .typedef => |tok_i| try p.errTok(.invalid_storage_on_param, tok_i), | |
| 1390 | } | |
| 1391 | if (d.thread_local) |tok_i| try p.errTok(.threadlocal_non_var, tok_i); | |
| 1392 | if (d.@"inline") |tok_i| try p.errStr(.func_spec_non_func, tok_i, "inline"); | |
| 1393 | if (d.noreturn) |tok_i| try p.errStr(.func_spec_non_func, tok_i, "_Noreturn"); | |
| 1394 | if (d.constexpr) |tok_i| try p.errTok(.invalid_storage_on_param, tok_i); | |
| 1395 | if (d.auto_type) |tok_i| { | |
| 1396 | try p.errStr(.auto_type_not_allowed, tok_i, "function prototype"); | |
| 1397 | ty.* = Type.invalid; | |
| 1568 | .none, .register => {}, | |
| 1569 | .auto, .@"extern", .static, .typedef => |tok_i| try p.err(tok_i, .invalid_storage_on_param, .{}), | |
| 1398 | 1570 | } |
| 1571 | if (d.thread_local) |tok_i| try p.err(tok_i, .threadlocal_non_var, .{}); | |
| 1572 | if (d.@"inline") |tok_i| try p.err(tok_i, .func_spec_non_func, .{"inline"}); | |
| 1573 | if (d.noreturn) |tok_i| try p.err(tok_i, .func_spec_non_func, .{"_Noreturn"}); | |
| 1574 | if (d.constexpr) |tok_i| try p.err(tok_i, .invalid_storage_on_param, .{}); | |
| 1399 | 1575 | } |
| 1400 | 1576 | |
| 1401 | fn validateFnDef(d: DeclSpec, p: *Parser) Error!Tree.Tag { | |
| 1577 | fn validateFnDef(d: DeclSpec, p: *Parser) Error!void { | |
| 1402 | 1578 | switch (d.storage_class) { |
| 1403 | 1579 | .none, .@"extern", .static => {}, |
| 1404 | .auto, .register, .typedef => |tok_i| try p.errTok(.illegal_storage_on_func, tok_i), | |
| 1580 | .auto, .register, .typedef => |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}), | |
| 1405 | 1581 | } |
| 1406 | if (d.thread_local) |tok_i| try p.errTok(.threadlocal_non_var, tok_i); | |
| 1407 | if (d.constexpr) |tok_i| try p.errTok(.illegal_storage_on_func, tok_i); | |
| 1582 | if (d.thread_local) |tok_i| try p.err(tok_i, .threadlocal_non_var, .{}); | |
| 1583 | if (d.constexpr) |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}); | |
| 1584 | } | |
| 1408 | 1585 | |
| 1409 | const is_static = d.storage_class == .static; | |
| 1410 | const is_inline = d.@"inline" != null; | |
| 1411 | if (is_static) { | |
| 1412 | if (is_inline) return .inline_static_fn_def; | |
| 1413 | return .static_fn_def; | |
| 1414 | } else { | |
| 1415 | if (is_inline) return .inline_fn_def; | |
| 1416 | return .fn_def; | |
| 1586 | fn validateFnDecl(d: DeclSpec, p: *Parser) Error!void { | |
| 1587 | switch (d.storage_class) { | |
| 1588 | .none, .@"extern" => {}, | |
| 1589 | .static => |tok_i| if (p.func.qt != null) try p.err(tok_i, .static_func_not_global, .{}), | |
| 1590 | .typedef => unreachable, | |
| 1591 | .auto, .register => |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}), | |
| 1417 | 1592 | } |
| 1593 | if (d.thread_local) |tok_i| try p.err(tok_i, .threadlocal_non_var, .{}); | |
| 1594 | if (d.constexpr) |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}); | |
| 1418 | 1595 | } |
| 1419 | 1596 | |
| 1420 | fn validate(d: DeclSpec, p: *Parser, ty: *Type, has_init: bool) Error!Tree.Tag { | |
| 1421 | const is_static = d.storage_class == .static; | |
| 1422 | if (ty.isFunc() and d.storage_class != .typedef) { | |
| 1423 | switch (d.storage_class) { | |
| 1424 | .none, .@"extern" => {}, | |
| 1425 | .static => |tok_i| if (p.func.ty != null) try p.errTok(.static_func_not_global, tok_i), | |
| 1426 | .typedef => unreachable, | |
| 1427 | .auto, .register => |tok_i| try p.errTok(.illegal_storage_on_func, tok_i), | |
| 1428 | } | |
| 1429 | if (d.thread_local) |tok_i| try p.errTok(.threadlocal_non_var, tok_i); | |
| 1430 | if (d.constexpr) |tok_i| try p.errTok(.illegal_storage_on_func, tok_i); | |
| 1431 | ||
| 1432 | const is_inline = d.@"inline" != null; | |
| 1433 | if (is_static) { | |
| 1434 | if (is_inline) return .inline_static_fn_proto; | |
| 1435 | return .static_fn_proto; | |
| 1436 | } else { | |
| 1437 | if (is_inline) return .inline_fn_proto; | |
| 1438 | return .fn_proto; | |
| 1439 | } | |
| 1440 | } else { | |
| 1441 | if (d.@"inline") |tok_i| try p.errStr(.func_spec_non_func, tok_i, "inline"); | |
| 1442 | // TODO move to attribute validation | |
| 1443 | if (d.noreturn) |tok_i| try p.errStr(.func_spec_non_func, tok_i, "_Noreturn"); | |
| 1444 | switch (d.storage_class) { | |
| 1445 | .auto => if (p.func.ty == null and !p.comp.langopts.standard.atLeast(.c23)) { | |
| 1446 | try p.err(.illegal_storage_on_global); | |
| 1447 | }, | |
| 1448 | .register => if (p.func.ty == null) try p.err(.illegal_storage_on_global), | |
| 1449 | .typedef => return .typedef, | |
| 1450 | else => {}, | |
| 1451 | } | |
| 1452 | ty.qual.register = d.storage_class == .register; | |
| 1453 | ||
| 1454 | const is_extern = d.storage_class == .@"extern" and !has_init; | |
| 1455 | if (d.thread_local != null) { | |
| 1456 | if (is_static) return .threadlocal_static_var; | |
| 1457 | if (is_extern) return .threadlocal_extern_var; | |
| 1458 | return .threadlocal_var; | |
| 1459 | } else { | |
| 1460 | if (is_static) return .static_var; | |
| 1461 | if (is_extern) return .extern_var; | |
| 1462 | return .@"var"; | |
| 1463 | } | |
| 1597 | fn validateDecl(d: DeclSpec, p: *Parser) Error!void { | |
| 1598 | if (d.@"inline") |tok_i| try p.err(tok_i, .func_spec_non_func, .{"inline"}); | |
| 1599 | // TODO move to attribute validation | |
| 1600 | if (d.noreturn) |tok_i| try p.err(tok_i, .func_spec_non_func, .{"_Noreturn"}); | |
| 1601 | switch (d.storage_class) { | |
| 1602 | .auto => std.debug.assert(!p.comp.langopts.standard.atLeast(.c23)), | |
| 1603 | .register => if (p.func.qt == null) try p.err(p.tok_i, .illegal_storage_on_global, .{}), | |
| 1604 | else => {}, | |
| 1464 | 1605 | } |
| 1465 | 1606 | } |
| 1607 | ||
| 1608 | fn initContext(d: DeclSpec, p: *Parser) InitContext { | |
| 1609 | if (d.constexpr != null) return .constexpr; | |
| 1610 | if (p.func.qt == null or d.storage_class == .static) return .static; | |
| 1611 | return .runtime; | |
| 1612 | } | |
| 1466 | 1613 | }; |
| 1467 | 1614 | |
| 1468 | 1615 | /// typeof |
| 1469 | 1616 | /// : keyword_typeof '(' typeName ')' |
| 1470 | 1617 | /// | keyword_typeof '(' expr ')' |
| 1471 | fn typeof(p: *Parser) Error!?Type { | |
| 1618 | fn typeof(p: *Parser) Error!?QualType { | |
| 1619 | const gpa = p.comp.gpa; | |
| 1472 | 1620 | var unqual = false; |
| 1473 | 1621 | switch (p.tok_ids[p.tok_i]) { |
| 1474 | 1622 | .keyword_typeof, .keyword_typeof1, .keyword_typeof2 => p.tok_i += 1, |
| ... | ... | @@ -1479,92 +1627,85 @@ fn typeof(p: *Parser) Error!?Type { |
| 1479 | 1627 | else => return null, |
| 1480 | 1628 | } |
| 1481 | 1629 | const l_paren = try p.expectToken(.l_paren); |
| 1482 | if (try p.typeName()) |ty| { | |
| 1630 | if (try p.typeName()) |qt| { | |
| 1483 | 1631 | try p.expectClosing(l_paren, .r_paren); |
| 1484 | if (ty.is(.invalid)) return null; | |
| 1632 | if (qt.isInvalid()) return null; | |
| 1485 | 1633 | |
| 1486 | const typeof_ty = try p.arena.create(Type); | |
| 1487 | typeof_ty.* = .{ | |
| 1488 | .data = ty.data, | |
| 1489 | .qual = if (unqual) .{} else ty.qual.inheritFromTypeof(), | |
| 1490 | .specifier = ty.specifier, | |
| 1491 | }; | |
| 1492 | ||
| 1493 | return Type{ | |
| 1494 | .data = .{ .sub_type = typeof_ty }, | |
| 1495 | .specifier = .typeof_type, | |
| 1496 | }; | |
| 1634 | return (try p.comp.type_store.put(gpa, .{ .typeof = .{ | |
| 1635 | .base = qt, | |
| 1636 | .expr = null, | |
| 1637 | } })).withQualifiers(qt); | |
| 1497 | 1638 | } |
| 1498 | 1639 | const typeof_expr = try p.parseNoEval(expr); |
| 1499 | try typeof_expr.expect(p); | |
| 1500 | 1640 | try p.expectClosing(l_paren, .r_paren); |
| 1501 | // Special case nullptr_t since it's defined as typeof(nullptr) | |
| 1502 | if (typeof_expr.ty.is(.nullptr_t)) { | |
| 1503 | return Type{ | |
| 1504 | .specifier = .nullptr_t, | |
| 1505 | .qual = if (unqual) .{} else typeof_expr.ty.qual.inheritFromTypeof(), | |
| 1506 | }; | |
| 1507 | } else if (typeof_expr.ty.is(.invalid)) { | |
| 1508 | return null; | |
| 1509 | } | |
| 1510 | ||
| 1511 | const inner = try p.arena.create(Type.Expr); | |
| 1512 | inner.* = .{ | |
| 1513 | .node = typeof_expr.node, | |
| 1514 | .ty = .{ | |
| 1515 | .data = typeof_expr.ty.data, | |
| 1516 | .qual = if (unqual) .{} else typeof_expr.ty.qual.inheritFromTypeof(), | |
| 1517 | .specifier = typeof_expr.ty.specifier, | |
| 1518 | .decayed = typeof_expr.ty.decayed, | |
| 1519 | }, | |
| 1520 | }; | |
| 1641 | if (typeof_expr.qt.isInvalid()) return null; | |
| 1521 | 1642 | |
| 1522 | return Type{ | |
| 1523 | .data = .{ .expr = inner }, | |
| 1524 | .specifier = .typeof_expr, | |
| 1525 | .decayed = typeof_expr.ty.decayed, | |
| 1526 | }; | |
| 1643 | const typeof_qt = try p.comp.type_store.put(gpa, .{ .typeof = .{ | |
| 1644 | .base = typeof_expr.qt, | |
| 1645 | .expr = typeof_expr.node, | |
| 1646 | } }); | |
| 1647 | if (unqual) return typeof_qt; | |
| 1648 | return typeof_qt.withQualifiers(typeof_expr.qt); | |
| 1527 | 1649 | } |
| 1528 | 1650 | |
| 1529 | /// declSpec: (storageClassSpec | typeSpec | typeQual | funcSpec | alignSpec)+ | |
| 1651 | /// declSpec: (storageClassSpec | typeSpec | funcSpec | autoTypeSpec)+ | |
| 1530 | 1652 | /// funcSpec : keyword_inline | keyword_noreturn |
| 1653 | /// autoTypeSpec : keyword_auto_type | |
| 1531 | 1654 | fn declSpec(p: *Parser) Error!?DeclSpec { |
| 1532 | var d: DeclSpec = .{ .ty = .{ .specifier = undefined } }; | |
| 1533 | var spec: Type.Builder = .{}; | |
| 1655 | var d: DeclSpec = .{ .qt = .invalid }; | |
| 1656 | var builder: TypeStore.Builder = .{ .parser = p }; | |
| 1534 | 1657 | |
| 1535 | var combined_auto = !p.comp.langopts.standard.atLeast(.c23); | |
| 1536 | 1658 | const start = p.tok_i; |
| 1537 | 1659 | while (true) { |
| 1538 | if (!combined_auto and d.storage_class == .auto) { | |
| 1539 | try spec.combine(p, .c23_auto, d.storage_class.auto); | |
| 1540 | combined_auto = true; | |
| 1541 | } | |
| 1542 | if (try p.storageClassSpec(&d)) continue; | |
| 1543 | if (try p.typeSpec(&spec)) continue; | |
| 1544 | 1660 | const id = p.tok_ids[p.tok_i]; |
| 1545 | 1661 | switch (id) { |
| 1546 | 1662 | .keyword_inline, .keyword_inline1, .keyword_inline2 => { |
| 1547 | 1663 | if (d.@"inline" != null) { |
| 1548 | try p.errStr(.duplicate_decl_spec, p.tok_i, "inline"); | |
| 1664 | try p.err(p.tok_i, .duplicate_decl_spec, .{"inline"}); | |
| 1549 | 1665 | } |
| 1550 | 1666 | d.@"inline" = p.tok_i; |
| 1667 | p.tok_i += 1; | |
| 1668 | continue; | |
| 1551 | 1669 | }, |
| 1552 | 1670 | .keyword_noreturn => { |
| 1553 | 1671 | if (d.noreturn != null) { |
| 1554 | try p.errStr(.duplicate_decl_spec, p.tok_i, "_Noreturn"); | |
| 1672 | try p.err(p.tok_i, .duplicate_decl_spec, .{"_Noreturn"}); | |
| 1555 | 1673 | } |
| 1556 | 1674 | d.noreturn = p.tok_i; |
| 1675 | p.tok_i += 1; | |
| 1676 | continue; | |
| 1557 | 1677 | }, |
| 1558 | else => break, | |
| 1678 | .keyword_auto_type => { | |
| 1679 | try p.err(p.tok_i, .auto_type_extension, .{}); | |
| 1680 | try builder.combine(.auto_type, p.tok_i); | |
| 1681 | if (builder.type == .auto_type) d.auto_type = p.tok_i; | |
| 1682 | p.tok_i += 1; | |
| 1683 | continue; | |
| 1684 | }, | |
| 1685 | .keyword_auto => if (p.comp.langopts.standard.atLeast(.c23)) { | |
| 1686 | try builder.combine(.c23_auto, p.tok_i); | |
| 1687 | if (builder.type == .c23_auto) d.c23_auto = p.tok_i; | |
| 1688 | p.tok_i += 1; | |
| 1689 | continue; | |
| 1690 | }, | |
| 1691 | .keyword_forceinline, .keyword_forceinline2 => { | |
| 1692 | try p.attr_buf.append(p.comp.gpa, .{ | |
| 1693 | .attr = .{ .tag = .always_inline, .args = .{ .always_inline = .{} }, .syntax = .keyword }, | |
| 1694 | .tok = p.tok_i, | |
| 1695 | }); | |
| 1696 | p.tok_i += 1; | |
| 1697 | continue; | |
| 1698 | }, | |
| 1699 | else => {}, | |
| 1559 | 1700 | } |
| 1560 | p.tok_i += 1; | |
| 1561 | } | |
| 1562 | 1701 | |
| 1563 | if (p.tok_i == start) return null; | |
| 1702 | if (try p.storageClassSpec(&d)) continue; | |
| 1703 | if (try p.typeSpec(&builder)) continue; | |
| 1704 | if (p.tok_i == start) return null; | |
| 1564 | 1705 | |
| 1565 | d.ty = try spec.finish(p); | |
| 1566 | d.auto_type = spec.auto_type_tok; | |
| 1567 | return d; | |
| 1706 | d.qt = try builder.finish(); | |
| 1707 | return d; | |
| 1708 | } | |
| 1568 | 1709 | } |
| 1569 | 1710 | |
| 1570 | 1711 | /// storageClassSpec: |
| ... | ... | @@ -1586,22 +1727,22 @@ fn storageClassSpec(p: *Parser, d: *DeclSpec) Error!bool { |
| 1586 | 1727 | .keyword_register, |
| 1587 | 1728 | => { |
| 1588 | 1729 | if (d.storage_class != .none) { |
| 1589 | try p.errStr(.multiple_storage_class, p.tok_i, @tagName(d.storage_class)); | |
| 1730 | try p.err(p.tok_i, .multiple_storage_class, .{@tagName(d.storage_class)}); | |
| 1590 | 1731 | return error.ParsingFailed; |
| 1591 | 1732 | } |
| 1592 | 1733 | if (d.thread_local != null) { |
| 1593 | 1734 | switch (id) { |
| 1594 | 1735 | .keyword_extern, .keyword_static => {}, |
| 1595 | else => try p.errStr(.cannot_combine_spec, p.tok_i, id.lexeme().?), | |
| 1736 | else => try p.err(p.tok_i, .cannot_combine_spec, .{id.lexeme().?}), | |
| 1596 | 1737 | } |
| 1597 | if (d.constexpr) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); | |
| 1738 | if (d.constexpr) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); | |
| 1598 | 1739 | } |
| 1599 | 1740 | if (d.constexpr != null) { |
| 1600 | 1741 | switch (id) { |
| 1601 | 1742 | .keyword_auto, .keyword_register, .keyword_static => {}, |
| 1602 | else => try p.errStr(.cannot_combine_spec, p.tok_i, id.lexeme().?), | |
| 1743 | else => try p.err(p.tok_i, .cannot_combine_spec, .{id.lexeme().?}), | |
| 1603 | 1744 | } |
| 1604 | if (d.thread_local) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); | |
| 1745 | if (d.thread_local) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); | |
| 1605 | 1746 | } |
| 1606 | 1747 | switch (id) { |
| 1607 | 1748 | .keyword_typedef => d.storage_class = .{ .typedef = p.tok_i }, |
| ... | ... | @@ -1616,23 +1757,23 @@ fn storageClassSpec(p: *Parser, d: *DeclSpec) Error!bool { |
| 1616 | 1757 | .keyword_c23_thread_local, |
| 1617 | 1758 | => { |
| 1618 | 1759 | if (d.thread_local != null) { |
| 1619 | try p.errStr(.duplicate_decl_spec, p.tok_i, id.lexeme().?); | |
| 1760 | try p.err(p.tok_i, .duplicate_decl_spec, .{id.lexeme().?}); | |
| 1620 | 1761 | } |
| 1621 | if (d.constexpr) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); | |
| 1762 | if (d.constexpr) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); | |
| 1622 | 1763 | switch (d.storage_class) { |
| 1623 | 1764 | .@"extern", .none, .static => {}, |
| 1624 | else => try p.errStr(.cannot_combine_spec, p.tok_i, @tagName(d.storage_class)), | |
| 1765 | else => try p.err(p.tok_i, .cannot_combine_spec, .{@tagName(d.storage_class)}), | |
| 1625 | 1766 | } |
| 1626 | 1767 | d.thread_local = p.tok_i; |
| 1627 | 1768 | }, |
| 1628 | 1769 | .keyword_constexpr => { |
| 1629 | 1770 | if (d.constexpr != null) { |
| 1630 | try p.errStr(.duplicate_decl_spec, p.tok_i, id.lexeme().?); | |
| 1771 | try p.err(p.tok_i, .duplicate_decl_spec, .{id.lexeme().?}); | |
| 1631 | 1772 | } |
| 1632 | if (d.thread_local) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); | |
| 1773 | if (d.thread_local) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); | |
| 1633 | 1774 | switch (d.storage_class) { |
| 1634 | 1775 | .auto, .register, .none, .static => {}, |
| 1635 | else => try p.errStr(.cannot_combine_spec, p.tok_i, @tagName(d.storage_class)), | |
| 1776 | else => try p.err(p.tok_i, .cannot_combine_spec, .{@tagName(d.storage_class)}), | |
| 1636 | 1777 | } |
| 1637 | 1778 | d.constexpr = p.tok_i; |
| 1638 | 1779 | }, |
| ... | ... | @@ -1643,7 +1784,7 @@ fn storageClassSpec(p: *Parser, d: *DeclSpec) Error!bool { |
| 1643 | 1784 | return p.tok_i != start; |
| 1644 | 1785 | } |
| 1645 | 1786 | |
| 1646 | const InitDeclarator = struct { d: Declarator, initializer: Result = .{} }; | |
| 1787 | const InitDeclarator = struct { d: Declarator, initializer: ?Result = null }; | |
| 1647 | 1788 | |
| 1648 | 1789 | /// attribute |
| 1649 | 1790 | /// : attrIdentifier |
| ... | ... | @@ -1652,15 +1793,16 @@ const InitDeclarator = struct { d: Declarator, initializer: Result = .{} }; |
| 1652 | 1793 | /// | attrIdentifier '(' (expr (',' expr)*)? ')' |
| 1653 | 1794 | fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?TentativeAttribute { |
| 1654 | 1795 | const name_tok = p.tok_i; |
| 1655 | switch (p.tok_ids[p.tok_i]) { | |
| 1656 | .keyword_const, .keyword_const1, .keyword_const2 => p.tok_i += 1, | |
| 1657 | else => _ = try p.expectIdentifier(), | |
| 1796 | if (!p.tok_ids[p.tok_i].isMacroIdentifier()) { | |
| 1797 | return p.errExpectedToken(.identifier, p.tok_ids[p.tok_i]); | |
| 1658 | 1798 | } |
| 1799 | _ = (try p.eatIdentifier()) orelse { | |
| 1800 | p.tok_i += 1; | |
| 1801 | }; | |
| 1659 | 1802 | const name = p.tokSlice(name_tok); |
| 1660 | 1803 | |
| 1661 | 1804 | const attr = Attribute.fromString(kind, namespace, name) orelse { |
| 1662 | const tag: Diagnostics.Tag = if (kind == .declspec) .declspec_attr_not_supported else .unknown_attribute; | |
| 1663 | try p.errStr(tag, name_tok, name); | |
| 1805 | try p.err(name_tok, if (kind == .declspec) .declspec_attr_not_supported else .unknown_attribute, .{name}); | |
| 1664 | 1806 | if (p.eatToken(.l_paren)) |_| p.skipTo(.r_paren); |
| 1665 | 1807 | return null; |
| 1666 | 1808 | }; |
| ... | ... | @@ -1677,21 +1819,18 @@ fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?Te |
| 1677 | 1819 | |
| 1678 | 1820 | if (Attribute.wantsIdentEnum(attr)) { |
| 1679 | 1821 | if (try p.eatIdentifier()) |ident| { |
| 1680 | if (Attribute.diagnoseIdent(attr, &arguments, p.tokSlice(ident))) |msg| { | |
| 1681 | try p.errExtra(msg.tag, ident, msg.extra); | |
| 1822 | if (try Attribute.diagnoseIdent(attr, &arguments, ident, p)) { | |
| 1682 | 1823 | p.skipTo(.r_paren); |
| 1683 | 1824 | return error.ParsingFailed; |
| 1684 | 1825 | } |
| 1685 | 1826 | } else { |
| 1686 | try p.errExtra(.attribute_requires_identifier, name_tok, .{ .str = name }); | |
| 1827 | try p.err(name_tok, .attribute_requires_identifier, .{name}); | |
| 1687 | 1828 | return error.ParsingFailed; |
| 1688 | 1829 | } |
| 1689 | 1830 | } else { |
| 1690 | 1831 | const arg_start = p.tok_i; |
| 1691 | var first_expr = try p.assignExpr(); | |
| 1692 | try first_expr.expect(p); | |
| 1693 | if (try p.diagnose(attr, &arguments, arg_idx, first_expr)) |msg| { | |
| 1694 | try p.errExtra(msg.tag, arg_start, msg.extra); | |
| 1832 | const first_expr = try p.expect(assignExpr); | |
| 1833 | if (try p.diagnose(attr, &arguments, arg_idx, first_expr, arg_start)) { | |
| 1695 | 1834 | p.skipTo(.r_paren); |
| 1696 | 1835 | return error.ParsingFailed; |
| 1697 | 1836 | } |
| ... | ... | @@ -1701,10 +1840,8 @@ fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?Te |
| 1701 | 1840 | _ = try p.expectToken(.comma); |
| 1702 | 1841 | |
| 1703 | 1842 | const arg_start = p.tok_i; |
| 1704 | var arg_expr = try p.assignExpr(); | |
| 1705 | try arg_expr.expect(p); | |
| 1706 | if (try p.diagnose(attr, &arguments, arg_idx, arg_expr)) |msg| { | |
| 1707 | try p.errExtra(msg.tag, arg_start, msg.extra); | |
| 1843 | const arg_expr = try p.expect(assignExpr); | |
| 1844 | if (try p.diagnose(attr, &arguments, arg_idx, arg_expr, arg_start)) { | |
| 1708 | 1845 | p.skipTo(.r_paren); |
| 1709 | 1846 | return error.ParsingFailed; |
| 1710 | 1847 | } |
| ... | ... | @@ -1713,28 +1850,30 @@ fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?Te |
| 1713 | 1850 | else => {}, |
| 1714 | 1851 | } |
| 1715 | 1852 | if (arg_idx < required_count) { |
| 1716 | try p.errExtra(.attribute_not_enough_args, name_tok, .{ .attr_arg_count = .{ .attribute = attr, .expected = required_count } }); | |
| 1853 | try p.err(name_tok, .attribute_not_enough_args, .{ | |
| 1854 | @tagName(attr), required_count, | |
| 1855 | }); | |
| 1717 | 1856 | return error.ParsingFailed; |
| 1718 | 1857 | } |
| 1719 | 1858 | return TentativeAttribute{ .attr = .{ .tag = attr, .args = arguments, .syntax = kind.toSyntax() }, .tok = name_tok }; |
| 1720 | 1859 | } |
| 1721 | 1860 | |
| 1722 | fn diagnose(p: *Parser, attr: Attribute.Tag, arguments: *Attribute.Arguments, arg_idx: u32, res: Result) !?Diagnostics.Message { | |
| 1861 | fn diagnose(p: *Parser, attr: Attribute.Tag, arguments: *Attribute.Arguments, arg_idx: u32, res: Result, arg_start: TokenIndex) !bool { | |
| 1723 | 1862 | if (Attribute.wantsAlignment(attr, arg_idx)) { |
| 1724 | return Attribute.diagnoseAlignment(attr, arguments, arg_idx, res, p); | |
| 1863 | return Attribute.diagnoseAlignment(attr, arguments, arg_idx, res, arg_start, p); | |
| 1725 | 1864 | } |
| 1726 | const node = p.nodes.get(@intFromEnum(res.node)); | |
| 1727 | return Attribute.diagnose(attr, arguments, arg_idx, res, node, p); | |
| 1865 | return Attribute.diagnose(attr, arguments, arg_idx, res, arg_start, res.node.get(&p.tree), p); | |
| 1728 | 1866 | } |
| 1729 | 1867 | |
| 1730 | 1868 | /// attributeList : (attribute (',' attribute)*)? |
| 1731 | 1869 | fn gnuAttributeList(p: *Parser) Error!void { |
| 1732 | 1870 | if (p.tok_ids[p.tok_i] == .r_paren) return; |
| 1871 | const gpa = p.comp.gpa; | |
| 1733 | 1872 | |
| 1734 | if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(p.gpa, attr); | |
| 1873 | if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(gpa, attr); | |
| 1735 | 1874 | while (p.tok_ids[p.tok_i] != .r_paren) { |
| 1736 | 1875 | _ = try p.expectToken(.comma); |
| 1737 | if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(p.gpa, attr); | |
| 1876 | if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(gpa, attr); | |
| 1738 | 1877 | } |
| 1739 | 1878 | } |
| 1740 | 1879 | |
| ... | ... | @@ -1747,14 +1886,14 @@ fn c23AttributeList(p: *Parser) Error!void { |
| 1747 | 1886 | } else { |
| 1748 | 1887 | p.tok_i -= 1; |
| 1749 | 1888 | } |
| 1750 | if (try p.attribute(.c23, namespace)) |attr| try p.attr_buf.append(p.gpa, attr); | |
| 1889 | if (try p.attribute(.c23, namespace)) |attr| try p.attr_buf.append(p.comp.gpa, attr); | |
| 1751 | 1890 | _ = p.eatToken(.comma); |
| 1752 | 1891 | } |
| 1753 | 1892 | } |
| 1754 | 1893 | |
| 1755 | 1894 | fn msvcAttributeList(p: *Parser) Error!void { |
| 1756 | 1895 | while (p.tok_ids[p.tok_i] != .r_paren) { |
| 1757 | if (try p.attribute(.declspec, null)) |attr| try p.attr_buf.append(p.gpa, attr); | |
| 1896 | if (try p.attribute(.declspec, null)) |attr| try p.attr_buf.append(p.comp.gpa, attr); | |
| 1758 | 1897 | _ = p.eatToken(.comma); |
| 1759 | 1898 | } |
| 1760 | 1899 | } |
| ... | ... | @@ -1812,8 +1951,8 @@ fn attributeSpecifierExtra(p: *Parser, declarator_name: ?TokenIndex) Error!void |
| 1812 | 1951 | const attr_buf_top = p.attr_buf.len; |
| 1813 | 1952 | if (try p.msvcAttribute()) { |
| 1814 | 1953 | if (declarator_name) |name_tok| { |
| 1815 | try p.errTok(.declspec_not_allowed_after_declarator, maybe_declspec_tok); | |
| 1816 | try p.errTok(.declarator_name_tok, name_tok); | |
| 1954 | try p.err(maybe_declspec_tok, .declspec_not_allowed_after_declarator, .{}); | |
| 1955 | try p.err(name_tok, .declarator_name_tok, .{}); | |
| 1817 | 1956 | p.attr_buf.len = attr_buf_top; |
| 1818 | 1957 | } |
| 1819 | 1958 | continue; |
| ... | ... | @@ -1823,130 +1962,181 @@ fn attributeSpecifierExtra(p: *Parser, declarator_name: ?TokenIndex) Error!void |
| 1823 | 1962 | } |
| 1824 | 1963 | |
| 1825 | 1964 | /// initDeclarator : declarator assembly? attributeSpecifier? ('=' initializer)? |
| 1826 | fn initDeclarator(p: *Parser, decl_spec: *DeclSpec, attr_buf_top: usize) Error!?InitDeclarator { | |
| 1965 | fn initDeclarator(p: *Parser, decl_spec: *DeclSpec, attr_buf_top: usize, decl_node: Node.Index) Error!?InitDeclarator { | |
| 1827 | 1966 | const this_attr_buf_top = p.attr_buf.len; |
| 1828 | 1967 | defer p.attr_buf.len = this_attr_buf_top; |
| 1968 | const gpa = p.comp.gpa; | |
| 1829 | 1969 | |
| 1830 | 1970 | var init_d = InitDeclarator{ |
| 1831 | .d = (try p.declarator(decl_spec.ty, .normal)) orelse return null, | |
| 1971 | .d = (try p.declarator(decl_spec.qt, .normal)) orelse return null, | |
| 1832 | 1972 | }; |
| 1833 | 1973 | |
| 1834 | if (decl_spec.ty.is(.c23_auto) and !init_d.d.ty.is(.c23_auto)) { | |
| 1835 | try p.errTok(.c23_auto_plain_declarator, decl_spec.storage_class.auto); | |
| 1836 | return error.ParsingFailed; | |
| 1837 | } | |
| 1838 | ||
| 1839 | 1974 | try p.attributeSpecifierExtra(init_d.d.name); |
| 1840 | 1975 | _ = try p.assembly(.decl_label); |
| 1841 | 1976 | try p.attributeSpecifierExtra(init_d.d.name); |
| 1842 | 1977 | |
| 1978 | switch (init_d.d.declarator_type) { | |
| 1979 | .func => { | |
| 1980 | if (decl_spec.auto_type) |tok_i| { | |
| 1981 | try p.err(tok_i, .auto_type_not_allowed, .{"function return type"}); | |
| 1982 | init_d.d.qt = .invalid; | |
| 1983 | } else if (decl_spec.c23_auto) |tok_i| { | |
| 1984 | try p.err(tok_i, .c23_auto_not_allowed, .{"function return type"}); | |
| 1985 | init_d.d.qt = .invalid; | |
| 1986 | } | |
| 1987 | }, | |
| 1988 | .array => { | |
| 1989 | if (decl_spec.auto_type) |tok_i| { | |
| 1990 | try p.err(tok_i, .auto_type_array, .{p.tokSlice(init_d.d.name)}); | |
| 1991 | init_d.d.qt = .invalid; | |
| 1992 | } else if (decl_spec.c23_auto) |tok_i| { | |
| 1993 | try p.err(tok_i, .c23_auto_array, .{p.tokSlice(init_d.d.name)}); | |
| 1994 | init_d.d.qt = .invalid; | |
| 1995 | } | |
| 1996 | }, | |
| 1997 | .pointer => { | |
| 1998 | if (decl_spec.auto_type != null or decl_spec.c23_auto != null) { | |
| 1999 | // TODO this is not a hard error in clang | |
| 2000 | try p.err(p.tok_i, .auto_type_requires_plain_declarator, .{}); | |
| 2001 | init_d.d.qt = .invalid; | |
| 2002 | } | |
| 2003 | }, | |
| 2004 | .other => if (decl_spec.storage_class == .typedef) { | |
| 2005 | if (decl_spec.auto_type) |tok_i| { | |
| 2006 | try p.err(tok_i, .auto_type_not_allowed, .{"typedef"}); | |
| 2007 | init_d.d.qt = .invalid; | |
| 2008 | } else if (decl_spec.c23_auto) |tok_i| { | |
| 2009 | try p.err(tok_i, .c23_auto_not_allowed, .{"typedef"}); | |
| 2010 | init_d.d.qt = .invalid; | |
| 2011 | } | |
| 2012 | }, | |
| 2013 | } | |
| 2014 | ||
| 1843 | 2015 | var apply_var_attributes = false; |
| 1844 | 2016 | if (decl_spec.storage_class == .typedef) { |
| 1845 | if (decl_spec.auto_type) |tok_i| { | |
| 1846 | try p.errStr(.auto_type_not_allowed, tok_i, "typedef"); | |
| 1847 | return error.ParsingFailed; | |
| 1848 | } | |
| 1849 | init_d.d.ty = try Attribute.applyTypeAttributes(p, init_d.d.ty, attr_buf_top, null); | |
| 1850 | } else if (init_d.d.ty.isFunc()) { | |
| 1851 | init_d.d.ty = try Attribute.applyFunctionAttributes(p, init_d.d.ty, attr_buf_top); | |
| 2017 | init_d.d.qt = try Attribute.applyTypeAttributes(p, init_d.d.qt, attr_buf_top, null); | |
| 2018 | } else if (init_d.d.declarator_type == .func or init_d.d.qt.is(p.comp, .func)) { | |
| 2019 | init_d.d.qt = try Attribute.applyFunctionAttributes(p, init_d.d.qt, attr_buf_top); | |
| 1852 | 2020 | } else { |
| 1853 | 2021 | apply_var_attributes = true; |
| 1854 | 2022 | } |
| 1855 | const c23_auto = init_d.d.ty.is(.c23_auto); | |
| 1856 | const auto_type = init_d.d.ty.is(.auto_type); | |
| 1857 | 2023 | |
| 1858 | if (p.eatToken(.equal)) |eq| init: { | |
| 2024 | if (p.eatToken(.equal)) |eq| { | |
| 1859 | 2025 | if (decl_spec.storage_class == .typedef or |
| 1860 | (init_d.d.func_declarator != null and init_d.d.ty.isFunc())) | |
| 2026 | (init_d.d.declarator_type == .func and init_d.d.qt.is(p.comp, .func))) | |
| 1861 | 2027 | { |
| 1862 | try p.errTok(.illegal_initializer, eq); | |
| 1863 | } else if (init_d.d.ty.is(.variable_len_array)) { | |
| 1864 | try p.errTok(.vla_init, eq); | |
| 2028 | try p.err(eq, .illegal_initializer, .{}); | |
| 2029 | } else if (init_d.d.qt.get(p.comp, .array)) |array_ty| { | |
| 2030 | if (array_ty.len == .variable) try p.err(eq, .vla_init, .{}); | |
| 1865 | 2031 | } else if (decl_spec.storage_class == .@"extern") { |
| 1866 | try p.err(.extern_initializer); | |
| 2032 | try p.err(p.tok_i, .extern_initializer, .{}); | |
| 1867 | 2033 | decl_spec.storage_class = .none; |
| 1868 | 2034 | } |
| 1869 | 2035 | |
| 1870 | if (init_d.d.ty.hasIncompleteSize() and !init_d.d.ty.is(.incomplete_array)) { | |
| 1871 | try p.errStr(.variable_incomplete_ty, init_d.d.name, try p.typeStr(init_d.d.ty)); | |
| 1872 | return error.ParsingFailed; | |
| 1873 | } | |
| 1874 | if (p.tok_ids[p.tok_i] == .l_brace and init_d.d.ty.is(.c23_auto)) { | |
| 1875 | try p.errTok(.c23_auto_scalar_init, decl_spec.storage_class.auto); | |
| 1876 | return error.ParsingFailed; | |
| 2036 | incomplete: { | |
| 2037 | if (init_d.d.qt.isInvalid()) break :incomplete; | |
| 2038 | if (init_d.d.qt.isC23Auto()) break :incomplete; | |
| 2039 | if (init_d.d.qt.isAutoType()) break :incomplete; | |
| 2040 | if (!init_d.d.qt.hasIncompleteSize(p.comp)) break :incomplete; | |
| 2041 | if (init_d.d.qt.get(p.comp, .array)) |array_ty| { | |
| 2042 | if (array_ty.len == .incomplete) break :incomplete; | |
| 2043 | } | |
| 2044 | try p.err(init_d.d.name, .variable_incomplete_ty, .{init_d.d.qt}); | |
| 2045 | init_d.d.qt = .invalid; | |
| 1877 | 2046 | } |
| 1878 | 2047 | |
| 1879 | 2048 | try p.syms.pushScope(p); |
| 1880 | 2049 | defer p.syms.popScope(); |
| 1881 | 2050 | |
| 1882 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(init_d.d.name)); | |
| 1883 | try p.syms.declareSymbol(p, interned_name, init_d.d.ty, init_d.d.name, .none); | |
| 1884 | if (c23_auto or auto_type) { | |
| 2051 | const interned_name = try p.comp.internString(p.tokSlice(init_d.d.name)); | |
| 2052 | try p.syms.declareSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node); | |
| 2053 | ||
| 2054 | // TODO this should be a stack of auto type names because of statement expressions. | |
| 2055 | if (init_d.d.qt.isAutoType() or init_d.d.qt.isC23Auto()) { | |
| 1885 | 2056 | p.auto_type_decl_name = interned_name; |
| 1886 | 2057 | } |
| 1887 | 2058 | defer p.auto_type_decl_name = .empty; |
| 1888 | 2059 | |
| 1889 | var init_list_expr = try p.initializer(init_d.d.ty); | |
| 2060 | const init_context = p.init_context; | |
| 2061 | defer p.init_context = init_context; | |
| 2062 | p.init_context = decl_spec.initContext(p); | |
| 2063 | var init_list_expr = try p.initializer(init_d.d.qt); | |
| 1890 | 2064 | init_d.initializer = init_list_expr; |
| 1891 | if (!init_list_expr.ty.isArray()) break :init; | |
| 1892 | if (init_d.d.ty.is(.incomplete_array)) { | |
| 1893 | init_d.d.ty.setIncompleteArrayLen(init_list_expr.ty.arrayLen() orelse break :init); | |
| 2065 | ||
| 2066 | // Set incomplete array length if possible. | |
| 2067 | if (init_d.d.qt.get(p.comp, .array)) |base_array_ty| { | |
| 2068 | if (base_array_ty.len == .incomplete) if (init_list_expr.qt.get(p.comp, .array)) |init_array_ty| { | |
| 2069 | switch (init_array_ty.len) { | |
| 2070 | .fixed, .static => |len| { | |
| 2071 | init_d.d.qt = (try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 2072 | .elem = base_array_ty.elem, | |
| 2073 | .len = .{ .fixed = len }, | |
| 2074 | } })).withQualifiers(init_d.d.qt); | |
| 2075 | }, | |
| 2076 | else => {}, | |
| 2077 | } | |
| 2078 | }; | |
| 1894 | 2079 | } |
| 1895 | 2080 | } |
| 1896 | 2081 | |
| 1897 | 2082 | const name = init_d.d.name; |
| 1898 | if (auto_type or c23_auto) { | |
| 1899 | if (init_d.initializer.node == .none) { | |
| 1900 | init_d.d.ty = Type.invalid; | |
| 1901 | if (c23_auto) { | |
| 1902 | try p.errStr(.c32_auto_requires_initializer, decl_spec.storage_class.auto, p.tokSlice(name)); | |
| 2083 | if (init_d.d.qt.isAutoType() or init_d.d.qt.isC23Auto()) { | |
| 2084 | if (init_d.initializer) |some| { | |
| 2085 | init_d.d.qt = some.qt.withQualifiers(init_d.d.qt); | |
| 2086 | } else { | |
| 2087 | if (init_d.d.qt.isC23Auto()) { | |
| 2088 | try p.err(name, .c23_auto_requires_initializer, .{}); | |
| 1903 | 2089 | } else { |
| 1904 | try p.errStr(.auto_type_requires_initializer, name, p.tokSlice(name)); | |
| 2090 | try p.err(name, .auto_type_requires_initializer, .{p.tokSlice(name)}); | |
| 1905 | 2091 | } |
| 2092 | init_d.d.qt = .invalid; | |
| 1906 | 2093 | return init_d; |
| 1907 | } else { | |
| 1908 | init_d.d.ty.specifier = init_d.initializer.ty.specifier; | |
| 1909 | init_d.d.ty.data = init_d.initializer.ty.data; | |
| 1910 | init_d.d.ty.decayed = init_d.initializer.ty.decayed; | |
| 1911 | 2094 | } |
| 1912 | 2095 | } |
| 1913 | 2096 | if (apply_var_attributes) { |
| 1914 | init_d.d.ty = try Attribute.applyVariableAttributes(p, init_d.d.ty, attr_buf_top, null); | |
| 2097 | init_d.d.qt = try Attribute.applyVariableAttributes(p, init_d.d.qt, attr_buf_top, null); | |
| 1915 | 2098 | } |
| 1916 | if (decl_spec.storage_class != .typedef and init_d.d.ty.hasIncompleteSize()) incomplete: { | |
| 1917 | const specifier = init_d.d.ty.canonicalize(.standard).specifier; | |
| 1918 | if (decl_spec.storage_class == .@"extern") switch (specifier) { | |
| 2099 | ||
| 2100 | incomplete: { | |
| 2101 | if (decl_spec.storage_class == .typedef) break :incomplete; | |
| 2102 | if (init_d.d.qt.isInvalid()) break :incomplete; | |
| 2103 | if (!init_d.d.qt.hasIncompleteSize(p.comp)) break :incomplete; | |
| 2104 | ||
| 2105 | const init_type = init_d.d.qt.base(p.comp).type; | |
| 2106 | if (decl_spec.storage_class == .@"extern") switch (init_type) { | |
| 1919 | 2107 | .@"struct", .@"union", .@"enum" => break :incomplete, |
| 1920 | .incomplete_array => { | |
| 1921 | init_d.d.ty.decayArray(); | |
| 1922 | break :incomplete; | |
| 1923 | }, | |
| 2108 | .array => |array_ty| if (array_ty.len == .incomplete) break :incomplete, | |
| 1924 | 2109 | else => {}, |
| 1925 | 2110 | }; |
| 1926 | 2111 | // if there was an initializer expression it must have contained an error |
| 1927 | if (init_d.initializer.node != .none) break :incomplete; | |
| 1928 | ||
| 1929 | if (p.func.ty == null) { | |
| 1930 | if (specifier == .incomplete_array) { | |
| 1931 | // TODO properly check this after finishing parsing | |
| 1932 | try p.errStr(.tentative_array, name, try p.typeStr(init_d.d.ty)); | |
| 1933 | break :incomplete; | |
| 1934 | } else if (init_d.d.ty.getRecord()) |record| { | |
| 1935 | _ = try p.tentative_defs.getOrPutValue(p.gpa, record.name, init_d.d.name); | |
| 1936 | break :incomplete; | |
| 1937 | } else if (init_d.d.ty.get(.@"enum")) |en| { | |
| 1938 | _ = try p.tentative_defs.getOrPutValue(p.gpa, en.data.@"enum".name, init_d.d.name); | |
| 1939 | break :incomplete; | |
| 2112 | if (init_d.initializer != null) break :incomplete; | |
| 2113 | ||
| 2114 | if (p.func.qt == null) { | |
| 2115 | switch (init_type) { | |
| 2116 | .array => |array_ty| if (array_ty.len == .incomplete) { | |
| 2117 | // TODO properly check this after finishing parsing | |
| 2118 | try p.err(name, .tentative_array, .{}); | |
| 2119 | break :incomplete; | |
| 2120 | }, | |
| 2121 | .@"struct", .@"union" => |record_ty| { | |
| 2122 | _ = try p.tentative_defs.getOrPutValue(gpa, record_ty.name, init_d.d.name); | |
| 2123 | break :incomplete; | |
| 2124 | }, | |
| 2125 | .@"enum" => |enum_ty| { | |
| 2126 | _ = try p.tentative_defs.getOrPutValue(gpa, enum_ty.name, init_d.d.name); | |
| 2127 | break :incomplete; | |
| 2128 | }, | |
| 2129 | else => {}, | |
| 1940 | 2130 | } |
| 1941 | 2131 | } |
| 1942 | try p.errStr(.variable_incomplete_ty, name, try p.typeStr(init_d.d.ty)); | |
| 2132 | try p.err(name, .variable_incomplete_ty, .{init_d.d.qt}); | |
| 2133 | init_d.d.qt = .invalid; | |
| 1943 | 2134 | } |
| 1944 | 2135 | return init_d; |
| 1945 | 2136 | } |
| 1946 | 2137 | |
| 1947 | 2138 | /// typeSpec |
| 1948 | 2139 | /// : keyword_void |
| 1949 | /// | keyword_auto_type | |
| 1950 | 2140 | /// | keyword_char |
| 1951 | 2141 | /// | keyword_short |
| 1952 | 2142 | /// | keyword_int |
| ... | ... | @@ -1960,53 +2150,48 @@ fn initDeclarator(p: *Parser, decl_spec: *DeclSpec, attr_buf_top: usize) Error!? |
| 1960 | 2150 | /// | keyword_bool |
| 1961 | 2151 | /// | keyword_c23_bool |
| 1962 | 2152 | /// | keyword_complex |
| 1963 | /// | atomicTypeSpec | |
| 2153 | /// | keyword_atomic '(' typeName ')' | |
| 1964 | 2154 | /// | recordSpec |
| 1965 | 2155 | /// | enumSpec |
| 1966 | 2156 | /// | typedef // IDENTIFIER |
| 1967 | 2157 | /// | typeof |
| 1968 | 2158 | /// | keyword_bit_int '(' integerConstExpr ')' |
| 1969 | /// atomicTypeSpec : keyword_atomic '(' typeName ')' | |
| 1970 | /// alignSpec | |
| 1971 | /// : keyword_alignas '(' typeName ')' | |
| 1972 | /// | keyword_alignas '(' integerConstExpr ')' | |
| 1973 | /// | keyword_c23_alignas '(' typeName ')' | |
| 1974 | /// | keyword_c23_alignas '(' integerConstExpr ')' | |
| 1975 | fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { | |
| 2159 | /// | typeQual | |
| 2160 | /// | keyword_alignas '(' typeName ')' | |
| 2161 | /// | keyword_alignas '(' integerConstExpr ')' | |
| 2162 | /// | keyword_c23_alignas '(' typeName ')' | |
| 2163 | /// | keyword_c23_alignas '(' integerConstExpr ')' | |
| 2164 | fn typeSpec(p: *Parser, builder: *TypeStore.Builder) Error!bool { | |
| 1976 | 2165 | const start = p.tok_i; |
| 1977 | 2166 | while (true) { |
| 1978 | 2167 | try p.attributeSpecifier(); |
| 1979 | 2168 | |
| 1980 | if (try p.typeof()) |inner_ty| { | |
| 1981 | try ty.combineFromTypeof(p, inner_ty, start); | |
| 2169 | if (try p.typeof()) |typeof_qt| { | |
| 2170 | try builder.combineFromTypeof(typeof_qt, start); | |
| 1982 | 2171 | continue; |
| 1983 | 2172 | } |
| 1984 | if (try p.typeQual(&ty.qual)) continue; | |
| 2173 | if (try p.typeQual(builder, true)) continue; | |
| 1985 | 2174 | switch (p.tok_ids[p.tok_i]) { |
| 1986 | .keyword_void => try ty.combine(p, .void, p.tok_i), | |
| 1987 | .keyword_auto_type => { | |
| 1988 | try p.errTok(.auto_type_extension, p.tok_i); | |
| 1989 | try ty.combine(p, .auto_type, p.tok_i); | |
| 1990 | }, | |
| 1991 | .keyword_bool, .keyword_c23_bool => try ty.combine(p, .bool, p.tok_i), | |
| 1992 | .keyword_int8, .keyword_int8_2, .keyword_char => try ty.combine(p, .char, p.tok_i), | |
| 1993 | .keyword_int16, .keyword_int16_2, .keyword_short => try ty.combine(p, .short, p.tok_i), | |
| 1994 | .keyword_int32, .keyword_int32_2, .keyword_int => try ty.combine(p, .int, p.tok_i), | |
| 1995 | .keyword_long => try ty.combine(p, .long, p.tok_i), | |
| 1996 | .keyword_int64, .keyword_int64_2 => try ty.combine(p, .long_long, p.tok_i), | |
| 1997 | .keyword_int128 => try ty.combine(p, .int128, p.tok_i), | |
| 1998 | .keyword_signed, .keyword_signed1, .keyword_signed2 => try ty.combine(p, .signed, p.tok_i), | |
| 1999 | .keyword_unsigned => try ty.combine(p, .unsigned, p.tok_i), | |
| 2000 | .keyword_fp16 => try ty.combine(p, .fp16, p.tok_i), | |
| 2001 | .keyword_float16 => try ty.combine(p, .float16, p.tok_i), | |
| 2002 | .keyword_float => try ty.combine(p, .float, p.tok_i), | |
| 2003 | .keyword_double => try ty.combine(p, .double, p.tok_i), | |
| 2004 | .keyword_complex => try ty.combine(p, .complex, p.tok_i), | |
| 2175 | .keyword_void => try builder.combine(.void, p.tok_i), | |
| 2176 | .keyword_bool, .keyword_c23_bool => try builder.combine(.bool, p.tok_i), | |
| 2177 | .keyword_int8, .keyword_int8_2, .keyword_char => try builder.combine(.char, p.tok_i), | |
| 2178 | .keyword_int16, .keyword_int16_2, .keyword_short => try builder.combine(.short, p.tok_i), | |
| 2179 | .keyword_int32, .keyword_int32_2, .keyword_int => try builder.combine(.int, p.tok_i), | |
| 2180 | .keyword_long => try builder.combine(.long, p.tok_i), | |
| 2181 | .keyword_int64, .keyword_int64_2 => try builder.combine(.long_long, p.tok_i), | |
| 2182 | .keyword_int128 => try builder.combine(.int128, p.tok_i), | |
| 2183 | .keyword_signed, .keyword_signed1, .keyword_signed2 => try builder.combine(.signed, p.tok_i), | |
| 2184 | .keyword_unsigned => try builder.combine(.unsigned, p.tok_i), | |
| 2185 | .keyword_fp16 => try builder.combine(.fp16, p.tok_i), | |
| 2186 | .keyword_float16 => try builder.combine(.float16, p.tok_i), | |
| 2187 | .keyword_float => try builder.combine(.float, p.tok_i), | |
| 2188 | .keyword_double => try builder.combine(.double, p.tok_i), | |
| 2189 | .keyword_complex => try builder.combine(.complex, p.tok_i), | |
| 2005 | 2190 | .keyword_float128_1, .keyword_float128_2 => { |
| 2006 | 2191 | if (!p.comp.hasFloat128()) { |
| 2007 | try p.errStr(.type_not_supported_on_target, p.tok_i, p.tok_ids[p.tok_i].lexeme().?); | |
| 2192 | try p.err(p.tok_i, .type_not_supported_on_target, .{p.tok_ids[p.tok_i].lexeme().?}); | |
| 2008 | 2193 | } |
| 2009 | try ty.combine(p, .float128, p.tok_i); | |
| 2194 | try builder.combine(.float128, p.tok_i); | |
| 2010 | 2195 | }, |
| 2011 | 2196 | .keyword_atomic => { |
| 2012 | 2197 | const atomic_tok = p.tok_i; |
| ... | ... | @@ -2016,19 +2201,19 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { |
| 2016 | 2201 | p.tok_i = atomic_tok; |
| 2017 | 2202 | break; |
| 2018 | 2203 | }; |
| 2019 | const inner_ty = (try p.typeName()) orelse { | |
| 2020 | try p.err(.expected_type); | |
| 2204 | const base_qt = (try p.typeName()) orelse { | |
| 2205 | try p.err(p.tok_i, .expected_type, .{}); | |
| 2021 | 2206 | return error.ParsingFailed; |
| 2022 | 2207 | }; |
| 2023 | 2208 | try p.expectClosing(l_paren, .r_paren); |
| 2024 | 2209 | |
| 2025 | const new_spec = Type.Builder.fromType(inner_ty); | |
| 2026 | try ty.combine(p, new_spec, atomic_tok); | |
| 2210 | if (base_qt.isQualified() and !base_qt.isInvalid()) { | |
| 2211 | try p.err(atomic_tok, .atomic_qualified, .{base_qt}); | |
| 2212 | builder.type = .{ .other = .invalid }; | |
| 2213 | continue; | |
| 2214 | } | |
| 2027 | 2215 | |
| 2028 | if (ty.qual.atomic != null) | |
| 2029 | try p.errStr(.duplicate_decl_spec, atomic_tok, "atomic") | |
| 2030 | else | |
| 2031 | ty.qual.atomic = atomic_tok; | |
| 2216 | try builder.combineAtomic(base_qt, atomic_tok); | |
| 2032 | 2217 | continue; |
| 2033 | 2218 | }, |
| 2034 | 2219 | .keyword_alignas, |
| ... | ... | @@ -2036,14 +2221,15 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { |
| 2036 | 2221 | => { |
| 2037 | 2222 | const align_tok = p.tok_i; |
| 2038 | 2223 | p.tok_i += 1; |
| 2224 | const gpa = p.comp.gpa; | |
| 2039 | 2225 | const l_paren = try p.expectToken(.l_paren); |
| 2040 | 2226 | const typename_start = p.tok_i; |
| 2041 | if (try p.typeName()) |inner_ty| { | |
| 2042 | if (!inner_ty.alignable()) { | |
| 2043 | try p.errStr(.invalid_alignof, typename_start, try p.typeStr(inner_ty)); | |
| 2227 | if (try p.typeName()) |inner_qt| { | |
| 2228 | if (!inner_qt.alignable(p.comp)) { | |
| 2229 | try p.err(typename_start, .invalid_alignof, .{inner_qt}); | |
| 2044 | 2230 | } |
| 2045 | const alignment = Attribute.Alignment{ .requested = inner_ty.alignof(p.comp) }; | |
| 2046 | try p.attr_buf.append(p.gpa, .{ | |
| 2231 | const alignment = Attribute.Alignment{ .requested = inner_qt.alignof(p.comp) }; | |
| 2232 | try p.attr_buf.append(gpa, .{ | |
| 2047 | 2233 | .attr = .{ .tag = .aligned, .args = .{ |
| 2048 | 2234 | .aligned = .{ .alignment = alignment, .__name_tok = align_tok }, |
| 2049 | 2235 | }, .syntax = .keyword }, |
| ... | ... | @@ -2054,13 +2240,12 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { |
| 2054 | 2240 | const res = try p.integerConstExpr(.no_const_decl_folding); |
| 2055 | 2241 | if (!res.val.isZero(p.comp)) { |
| 2056 | 2242 | var args = Attribute.initArguments(.aligned, align_tok); |
| 2057 | if (try p.diagnose(.aligned, &args, 0, res)) |msg| { | |
| 2058 | try p.errExtra(msg.tag, arg_start, msg.extra); | |
| 2243 | if (try p.diagnose(.aligned, &args, 0, res, arg_start)) { | |
| 2059 | 2244 | p.skipTo(.r_paren); |
| 2060 | 2245 | return error.ParsingFailed; |
| 2061 | 2246 | } |
| 2062 | args.aligned.alignment.?.node = res.node; | |
| 2063 | try p.attr_buf.append(p.gpa, .{ | |
| 2247 | args.aligned.alignment.?.node = .pack(res.node); | |
| 2248 | try p.attr_buf.append(gpa, .{ | |
| 2064 | 2249 | .attr = .{ .tag = .aligned, .args = args, .syntax = .keyword }, |
| 2065 | 2250 | .tok = align_tok, |
| 2066 | 2251 | }); |
| ... | ... | @@ -2069,47 +2254,24 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { |
| 2069 | 2254 | try p.expectClosing(l_paren, .r_paren); |
| 2070 | 2255 | continue; |
| 2071 | 2256 | }, |
| 2072 | .keyword_stdcall, | |
| 2073 | .keyword_stdcall2, | |
| 2074 | .keyword_thiscall, | |
| 2075 | .keyword_thiscall2, | |
| 2076 | .keyword_vectorcall, | |
| 2077 | .keyword_vectorcall2, | |
| 2078 | => try p.attr_buf.append(p.gpa, .{ | |
| 2079 | .attr = .{ .tag = .calling_convention, .args = .{ | |
| 2080 | .calling_convention = .{ .cc = switch (p.tok_ids[p.tok_i]) { | |
| 2081 | .keyword_stdcall, | |
| 2082 | .keyword_stdcall2, | |
| 2083 | => .stdcall, | |
| 2084 | .keyword_thiscall, | |
| 2085 | .keyword_thiscall2, | |
| 2086 | => .thiscall, | |
| 2087 | .keyword_vectorcall, | |
| 2088 | .keyword_vectorcall2, | |
| 2089 | => .vectorcall, | |
| 2090 | else => unreachable, | |
| 2091 | } }, | |
| 2092 | }, .syntax = .keyword }, | |
| 2093 | .tok = p.tok_i, | |
| 2094 | }), | |
| 2095 | 2257 | .keyword_struct, .keyword_union => { |
| 2096 | 2258 | const tag_tok = p.tok_i; |
| 2097 | 2259 | const record_ty = try p.recordSpec(); |
| 2098 | try ty.combine(p, Type.Builder.fromType(record_ty), tag_tok); | |
| 2260 | try builder.combine(.{ .other = record_ty }, tag_tok); | |
| 2099 | 2261 | continue; |
| 2100 | 2262 | }, |
| 2101 | 2263 | .keyword_enum => { |
| 2102 | 2264 | const tag_tok = p.tok_i; |
| 2103 | 2265 | const enum_ty = try p.enumSpec(); |
| 2104 | try ty.combine(p, Type.Builder.fromType(enum_ty), tag_tok); | |
| 2266 | try builder.combine(.{ .other = enum_ty }, tag_tok); | |
| 2105 | 2267 | continue; |
| 2106 | 2268 | }, |
| 2107 | 2269 | .identifier, .extended_identifier => { |
| 2108 | var interned_name = try StrInt.intern(p.comp, p.tokSlice(p.tok_i)); | |
| 2270 | var interned_name = try p.comp.internString(p.tokSlice(p.tok_i)); | |
| 2109 | 2271 | var declspec_found = false; |
| 2110 | 2272 | |
| 2111 | 2273 | if (interned_name == p.string_ids.declspec_id) { |
| 2112 | try p.errTok(.declspec_not_enabled, p.tok_i); | |
| 2274 | try p.err(p.tok_i, .declspec_not_enabled, .{}); | |
| 2113 | 2275 | p.tok_i += 1; |
| 2114 | 2276 | if (p.eatToken(.l_paren)) |_| { |
| 2115 | 2277 | p.skipTo(.r_paren); |
| ... | ... | @@ -2117,15 +2279,14 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { |
| 2117 | 2279 | } |
| 2118 | 2280 | declspec_found = true; |
| 2119 | 2281 | } |
| 2120 | if (ty.typedef != null) break; | |
| 2121 | 2282 | if (declspec_found) { |
| 2122 | interned_name = try StrInt.intern(p.comp, p.tokSlice(p.tok_i)); | |
| 2283 | interned_name = try p.comp.internString(p.tokSlice(p.tok_i)); | |
| 2123 | 2284 | } |
| 2124 | const typedef = (try p.syms.findTypedef(p, interned_name, p.tok_i, ty.specifier != .none)) orelse break; | |
| 2125 | if (!ty.combineTypedef(p, typedef.ty, typedef.tok)) break; | |
| 2285 | const typedef = (try p.syms.findTypedef(p, interned_name, p.tok_i, builder.type != .none)) orelse break; | |
| 2286 | if (!builder.combineTypedef(typedef.qt)) break; | |
| 2126 | 2287 | }, |
| 2127 | 2288 | .keyword_bit_int => { |
| 2128 | try p.err(.bit_int); | |
| 2289 | try p.err(p.tok_i, .bit_int, .{}); | |
| 2129 | 2290 | const bit_int_tok = p.tok_i; |
| 2130 | 2291 | p.tok_i += 1; |
| 2131 | 2292 | const l_paren = try p.expectToken(.l_paren); |
| ... | ... | @@ -2134,15 +2295,15 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { |
| 2134 | 2295 | |
| 2135 | 2296 | var bits: u64 = undefined; |
| 2136 | 2297 | if (res.val.opt_ref == .none) { |
| 2137 | try p.errTok(.expected_integer_constant_expr, bit_int_tok); | |
| 2298 | try p.err(bit_int_tok, .expected_integer_constant_expr, .{}); | |
| 2138 | 2299 | return error.ParsingFailed; |
| 2139 | } else if (res.val.compare(.lte, Value.zero, p.comp)) { | |
| 2300 | } else if (res.val.compare(.lte, .zero, p.comp)) { | |
| 2140 | 2301 | bits = 0; |
| 2141 | 2302 | } else { |
| 2142 | 2303 | bits = res.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); |
| 2143 | 2304 | } |
| 2144 | 2305 | |
| 2145 | try ty.combine(p, .{ .bit_int = bits }, bit_int_tok); | |
| 2306 | try builder.combine(.{ .bit_int = bits }, bit_int_tok); | |
| 2146 | 2307 | continue; |
| 2147 | 2308 | }, |
| 2148 | 2309 | else => break, |
| ... | ... | @@ -2163,18 +2324,21 @@ fn getAnonymousName(p: *Parser, kind_tok: TokenIndex) !StringId { |
| 2163 | 2324 | else => "record field", |
| 2164 | 2325 | }; |
| 2165 | 2326 | |
| 2327 | var arena = p.comp.type_store.anon_name_arena.promote(p.comp.gpa); | |
| 2328 | defer p.comp.type_store.anon_name_arena = arena.state; | |
| 2166 | 2329 | const str = try std.fmt.allocPrint( |
| 2167 | p.arena, | |
| 2330 | arena.allocator(), | |
| 2168 | 2331 | "(anonymous {s} at {s}:{d}:{d})", |
| 2169 | 2332 | .{ kind_str, source.path, line_col.line_no, line_col.col }, |
| 2170 | 2333 | ); |
| 2171 | return StrInt.intern(p.comp, str); | |
| 2334 | return p.comp.internString(str); | |
| 2172 | 2335 | } |
| 2173 | 2336 | |
| 2174 | 2337 | /// recordSpec |
| 2175 | /// : (keyword_struct | keyword_union) IDENTIFIER? { recordDecl* } | |
| 2338 | /// : (keyword_struct | keyword_union) IDENTIFIER? { recordDecls } | |
| 2176 | 2339 | /// | (keyword_struct | keyword_union) IDENTIFIER |
| 2177 | fn recordSpec(p: *Parser) Error!Type { | |
| 2340 | fn recordSpec(p: *Parser) Error!QualType { | |
| 2341 | const gpa = p.comp.gpa; | |
| 2178 | 2342 | const starting_pragma_pack = p.pragma_pack; |
| 2179 | 2343 | const kind_tok = p.tok_i; |
| 2180 | 2344 | const is_struct = p.tok_ids[kind_tok] == .keyword_struct; |
| ... | ... | @@ -2183,37 +2347,51 @@ fn recordSpec(p: *Parser) Error!Type { |
| 2183 | 2347 | defer p.attr_buf.len = attr_buf_top; |
| 2184 | 2348 | try p.attributeSpecifier(); |
| 2185 | 2349 | |
| 2350 | const reserved_index = try p.tree.nodes.addOne(gpa); | |
| 2351 | ||
| 2186 | 2352 | const maybe_ident = try p.eatIdentifier(); |
| 2187 | 2353 | const l_brace = p.eatToken(.l_brace) orelse { |
| 2188 | 2354 | const ident = maybe_ident orelse { |
| 2189 | try p.err(.ident_or_l_brace); | |
| 2355 | try p.err(p.tok_i, .ident_or_l_brace, .{}); | |
| 2190 | 2356 | return error.ParsingFailed; |
| 2191 | 2357 | }; |
| 2192 | 2358 | // check if this is a reference to a previous type |
| 2193 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(ident)); | |
| 2359 | const interned_name = try p.comp.internString(p.tokSlice(ident)); | |
| 2194 | 2360 | if (try p.syms.findTag(p, interned_name, p.tok_ids[kind_tok], ident, p.tok_ids[p.tok_i])) |prev| { |
| 2195 | return prev.ty; | |
| 2361 | return prev.qt; | |
| 2196 | 2362 | } else { |
| 2197 | // this is a forward declaration, create a new record Type. | |
| 2198 | const record_ty = try Type.Record.create(p.arena, interned_name); | |
| 2199 | const ty = try Attribute.applyTypeAttributes(p, .{ | |
| 2200 | .specifier = if (is_struct) .@"struct" else .@"union", | |
| 2201 | .data = .{ .record = record_ty }, | |
| 2202 | }, attr_buf_top, null); | |
| 2203 | try p.syms.define(p.gpa, .{ | |
| 2363 | // this is a forward declaration, create a new record type. | |
| 2364 | const record_ty: Type.Record = .{ | |
| 2365 | .name = interned_name, | |
| 2366 | .layout = null, | |
| 2367 | .decl_node = @enumFromInt(reserved_index), | |
| 2368 | .fields = &.{}, | |
| 2369 | }; | |
| 2370 | const record_qt = try p.comp.type_store.put(gpa, if (is_struct) | |
| 2371 | .{ .@"struct" = record_ty } | |
| 2372 | else | |
| 2373 | .{ .@"union" = record_ty }); | |
| 2374 | ||
| 2375 | const attributed_qt = try Attribute.applyTypeAttributes(p, record_qt, attr_buf_top, null); | |
| 2376 | try p.syms.define(gpa, .{ | |
| 2204 | 2377 | .kind = if (is_struct) .@"struct" else .@"union", |
| 2205 | 2378 | .name = interned_name, |
| 2206 | 2379 | .tok = ident, |
| 2207 | .ty = ty, | |
| 2380 | .qt = attributed_qt, | |
| 2208 | 2381 | .val = .{}, |
| 2209 | 2382 | }); |
| 2210 | try p.decl_buf.append(try p.addNode(.{ | |
| 2211 | .tag = if (is_struct) .struct_forward_decl else .union_forward_decl, | |
| 2212 | .ty = ty, | |
| 2213 | .data = .{ .decl_ref = ident }, | |
| 2214 | .loc = @enumFromInt(ident), | |
| 2215 | })); | |
| 2216 | return ty; | |
| 2383 | ||
| 2384 | const fw: Node.ContainerForwardDecl = .{ | |
| 2385 | .name_or_kind_tok = ident, | |
| 2386 | .container_qt = attributed_qt, | |
| 2387 | .definition = null, | |
| 2388 | }; | |
| 2389 | try p.tree.setNode(if (is_struct) | |
| 2390 | .{ .struct_forward_decl = fw } | |
| 2391 | else | |
| 2392 | .{ .union_forward_decl = fw }, reserved_index); | |
| 2393 | try p.decl_buf.append(gpa, @enumFromInt(reserved_index)); | |
| 2394 | return attributed_qt; | |
| 2217 | 2395 | } |
| 2218 | 2396 | }; |
| 2219 | 2397 | |
| ... | ... | @@ -2221,44 +2399,52 @@ fn recordSpec(p: *Parser) Error!Type { |
| 2221 | 2399 | errdefer if (!done) p.skipTo(.r_brace); |
| 2222 | 2400 | |
| 2223 | 2401 | // Get forward declared type or create a new one |
| 2224 | var defined = false; | |
| 2225 | const record_ty: *Type.Record = if (maybe_ident) |ident| record_ty: { | |
| 2226 | const ident_str = p.tokSlice(ident); | |
| 2227 | const interned_name = try StrInt.intern(p.comp, ident_str); | |
| 2228 | if (try p.syms.defineTag(p, interned_name, p.tok_ids[kind_tok], ident)) |prev| { | |
| 2229 | if (!prev.ty.hasIncompleteSize()) { | |
| 2230 | // if the record isn't incomplete, this is a redefinition | |
| 2231 | try p.errStr(.redefinition, ident, ident_str); | |
| 2232 | try p.errTok(.previous_definition, prev.tok); | |
| 2233 | } else { | |
| 2234 | defined = true; | |
| 2235 | break :record_ty prev.ty.get(if (is_struct) .@"struct" else .@"union").?.data.record; | |
| 2402 | var record_ty: Type.Record, const qt: QualType = blk: { | |
| 2403 | const interned_name = if (maybe_ident) |ident| interned: { | |
| 2404 | const ident_str = p.tokSlice(ident); | |
| 2405 | const interned_name = try p.comp.internString(ident_str); | |
| 2406 | if (try p.syms.defineTag(p, interned_name, p.tok_ids[kind_tok], ident)) |prev| { | |
| 2407 | const record_ty = prev.qt.getRecord(p.comp).?; | |
| 2408 | if (record_ty.layout != null) { | |
| 2409 | // if the record isn't incomplete, this is a redefinition | |
| 2410 | try p.err(ident, .redefinition, .{ident_str}); | |
| 2411 | try p.err(prev.tok, .previous_definition, .{}); | |
| 2412 | } else { | |
| 2413 | break :blk .{ record_ty, prev.qt }; | |
| 2414 | } | |
| 2236 | 2415 | } |
| 2416 | break :interned interned_name; | |
| 2417 | } else try p.getAnonymousName(kind_tok); | |
| 2418 | ||
| 2419 | // Initially create ty as a regular non-attributed type, since attributes for a record | |
| 2420 | // can be specified after the closing rbrace, which we haven't encountered yet. | |
| 2421 | const record_ty: Type.Record = .{ | |
| 2422 | .name = interned_name, | |
| 2423 | .decl_node = @enumFromInt(reserved_index), | |
| 2424 | .layout = null, | |
| 2425 | .fields = &.{}, | |
| 2426 | }; | |
| 2427 | const record_qt = try p.comp.type_store.put(gpa, if (is_struct) | |
| 2428 | .{ .@"struct" = record_ty } | |
| 2429 | else | |
| 2430 | .{ .@"union" = record_ty }); | |
| 2431 | ||
| 2432 | // declare a symbol for the type | |
| 2433 | // We need to replace the symbol's type if it has attributes | |
| 2434 | if (maybe_ident != null) { | |
| 2435 | try p.syms.define(gpa, .{ | |
| 2436 | .kind = if (is_struct) .@"struct" else .@"union", | |
| 2437 | .name = record_ty.name, | |
| 2438 | .tok = maybe_ident.?, | |
| 2439 | .qt = record_qt, | |
| 2440 | .val = .{}, | |
| 2441 | }); | |
| 2237 | 2442 | } |
| 2238 | break :record_ty try Type.Record.create(p.arena, interned_name); | |
| 2239 | } else try Type.Record.create(p.arena, try p.getAnonymousName(kind_tok)); | |
| 2240 | 2443 | |
| 2241 | // Initially create ty as a regular non-attributed type, since attributes for a record | |
| 2242 | // can be specified after the closing rbrace, which we haven't encountered yet. | |
| 2243 | var ty = Type{ | |
| 2244 | .specifier = if (is_struct) .@"struct" else .@"union", | |
| 2245 | .data = .{ .record = record_ty }, | |
| 2444 | break :blk .{ record_ty, record_qt }; | |
| 2246 | 2445 | }; |
| 2247 | 2446 | |
| 2248 | // declare a symbol for the type | |
| 2249 | // We need to replace the symbol's type if it has attributes | |
| 2250 | if (maybe_ident != null and !defined) { | |
| 2251 | try p.syms.define(p.gpa, .{ | |
| 2252 | .kind = if (is_struct) .@"struct" else .@"union", | |
| 2253 | .name = record_ty.name, | |
| 2254 | .tok = maybe_ident.?, | |
| 2255 | .ty = ty, | |
| 2256 | .val = .{}, | |
| 2257 | }); | |
| 2258 | } | |
| 2259 | ||
| 2260 | // reserve space for this record | |
| 2261 | try p.decl_buf.append(.none); | |
| 2447 | try p.decl_buf.append(gpa, @enumFromInt(reserved_index)); | |
| 2262 | 2448 | const decl_buf_top = p.decl_buf.items.len; |
| 2263 | 2449 | const record_buf_top = p.record_buf.items.len; |
| 2264 | 2450 | errdefer p.decl_buf.items.len = decl_buf_top - 1; |
| ... | ... | @@ -2269,100 +2455,121 @@ fn recordSpec(p: *Parser) Error!Type { |
| 2269 | 2455 | |
| 2270 | 2456 | const old_record = p.record; |
| 2271 | 2457 | const old_members = p.record_members.items.len; |
| 2272 | const old_field_attr_start = p.field_attr_buf.items.len; | |
| 2273 | 2458 | p.record = .{ |
| 2274 | 2459 | .kind = p.tok_ids[kind_tok], |
| 2275 | 2460 | .start = p.record_members.items.len, |
| 2276 | .field_attr_start = p.field_attr_buf.items.len, | |
| 2277 | 2461 | }; |
| 2278 | 2462 | defer p.record = old_record; |
| 2279 | 2463 | defer p.record_members.items.len = old_members; |
| 2280 | defer p.field_attr_buf.items.len = old_field_attr_start; | |
| 2281 | 2464 | |
| 2282 | 2465 | try p.recordDecls(); |
| 2283 | 2466 | |
| 2284 | if (p.record.flexible_field) |some| { | |
| 2285 | if (p.record_buf.items[record_buf_top..].len == 1 and is_struct) { | |
| 2286 | try p.errTok(.flexible_in_empty, some); | |
| 2287 | } | |
| 2288 | } | |
| 2467 | const fields = p.record_buf.items[record_buf_top..]; | |
| 2289 | 2468 | |
| 2290 | for (p.record_buf.items[record_buf_top..]) |field| { | |
| 2291 | if (field.ty.hasIncompleteSize() and !field.ty.is(.incomplete_array)) break; | |
| 2292 | } else { | |
| 2293 | record_ty.fields = try p.arena.dupe(Type.Record.Field, p.record_buf.items[record_buf_top..]); | |
| 2294 | } | |
| 2295 | const attr_count = p.field_attr_buf.items.len - old_field_attr_start; | |
| 2296 | const record_decls = p.decl_buf.items[decl_buf_top..]; | |
| 2297 | if (attr_count > 0) { | |
| 2298 | if (attr_count != record_decls.len) { | |
| 2299 | // A mismatch here means that non-field decls were parsed. This can happen if there were | |
| 2300 | // parse errors during attribute parsing. Bail here because if there are any field attributes, | |
| 2301 | // there must be exactly one per field. | |
| 2302 | return error.ParsingFailed; | |
| 2469 | if (p.record.flexible_field) |some| { | |
| 2470 | if (fields.len == 1 and is_struct) { | |
| 2471 | if (p.comp.langopts.emulate == .msvc) { | |
| 2472 | try p.err(some, .flexible_in_empty_msvc, .{}); | |
| 2473 | } else { | |
| 2474 | try p.err(some, .flexible_in_empty, .{}); | |
| 2475 | } | |
| 2303 | 2476 | } |
| 2304 | const field_attr_slice = p.field_attr_buf.items[old_field_attr_start..]; | |
| 2305 | const duped = try p.arena.dupe([]const Attribute, field_attr_slice); | |
| 2306 | record_ty.field_attributes = duped.ptr; | |
| 2307 | 2477 | } |
| 2308 | 2478 | |
| 2309 | 2479 | if (p.record_buf.items.len == record_buf_top) { |
| 2310 | try p.errStr(.empty_record, kind_tok, p.tokSlice(kind_tok)); | |
| 2311 | try p.errStr(.empty_record_size, kind_tok, p.tokSlice(kind_tok)); | |
| 2480 | try p.err(kind_tok, .empty_record, .{p.tokSlice(kind_tok)}); | |
| 2481 | try p.err(kind_tok, .empty_record_size, .{p.tokSlice(kind_tok)}); | |
| 2312 | 2482 | } |
| 2313 | 2483 | try p.expectClosing(l_brace, .r_brace); |
| 2314 | 2484 | done = true; |
| 2315 | 2485 | try p.attributeSpecifier(); |
| 2316 | 2486 | |
| 2317 | ty = try Attribute.applyTypeAttributes(p, .{ | |
| 2318 | .specifier = if (is_struct) .@"struct" else .@"union", | |
| 2319 | .data = .{ .record = record_ty }, | |
| 2320 | }, attr_buf_top, null); | |
| 2321 | if (ty.specifier == .attributed and maybe_ident != null) { | |
| 2487 | const any_incomplete = blk: { | |
| 2488 | for (fields) |field| { | |
| 2489 | if (field.qt.hasIncompleteSize(p.comp) and !field.qt.is(p.comp, .array)) break :blk true; | |
| 2490 | } | |
| 2491 | // Set fields and a dummy layout before addign attributes. | |
| 2492 | record_ty.fields = fields; | |
| 2493 | record_ty.layout = .{ | |
| 2494 | .size_bits = 8, | |
| 2495 | .field_alignment_bits = 8, | |
| 2496 | .pointer_alignment_bits = 8, | |
| 2497 | .required_alignment_bits = 8, | |
| 2498 | }; | |
| 2499 | record_ty.decl_node = @enumFromInt(reserved_index); | |
| 2500 | ||
| 2501 | const base_type = qt.base(p.comp); | |
| 2502 | if (is_struct) { | |
| 2503 | std.debug.assert(base_type.type.@"struct".name == record_ty.name); | |
| 2504 | try p.comp.type_store.set(gpa, .{ .@"struct" = record_ty }, @intFromEnum(base_type.qt._index)); | |
| 2505 | } else { | |
| 2506 | std.debug.assert(base_type.type.@"union".name == record_ty.name); | |
| 2507 | try p.comp.type_store.set(gpa, .{ .@"union" = record_ty }, @intFromEnum(base_type.qt._index)); | |
| 2508 | } | |
| 2509 | break :blk false; | |
| 2510 | }; | |
| 2511 | ||
| 2512 | const attributed_qt = try Attribute.applyTypeAttributes(p, qt, attr_buf_top, null); | |
| 2513 | ||
| 2514 | // Make sure the symbol for this record points to the attributed type. | |
| 2515 | if (attributed_qt != qt and maybe_ident != null) { | |
| 2322 | 2516 | const ident_str = p.tokSlice(maybe_ident.?); |
| 2323 | const interned_name = try StrInt.intern(p.comp, ident_str); | |
| 2517 | const interned_name = try p.comp.internString(ident_str); | |
| 2324 | 2518 | const ptr = p.syms.getPtr(interned_name, .tags); |
| 2325 | ptr.ty = ty; | |
| 2519 | ptr.qt = attributed_qt; | |
| 2326 | 2520 | } |
| 2327 | 2521 | |
| 2328 | if (!ty.hasIncompleteSize()) { | |
| 2522 | if (!any_incomplete) { | |
| 2329 | 2523 | const pragma_pack_value = switch (p.comp.langopts.emulate) { |
| 2330 | 2524 | .clang => starting_pragma_pack, |
| 2331 | 2525 | .gcc => p.pragma_pack, |
| 2332 | 2526 | // TODO: msvc considers `#pragma pack` on a per-field basis |
| 2333 | 2527 | .msvc => p.pragma_pack, |
| 2334 | 2528 | }; |
| 2335 | record_layout.compute(record_ty, ty, p.comp, pragma_pack_value) catch |er| switch (er) { | |
| 2336 | error.Overflow => try p.errStr(.record_too_large, maybe_ident orelse kind_tok, try p.typeStr(ty)), | |
| 2337 | }; | |
| 2529 | if (record_layout.compute(fields, attributed_qt, p.comp, pragma_pack_value)) |layout| { | |
| 2530 | record_ty.fields = fields; | |
| 2531 | record_ty.layout = layout; | |
| 2532 | } else |er| switch (er) { | |
| 2533 | error.Overflow => try p.err(maybe_ident orelse kind_tok, .record_too_large, .{qt}), | |
| 2534 | } | |
| 2535 | ||
| 2536 | // Override previous incomplete layout and fields. | |
| 2537 | const base_qt = qt.base(p.comp).qt; | |
| 2538 | const ts = &p.comp.type_store; | |
| 2539 | var extra_index = ts.types.items(.data)[@intFromEnum(base_qt._index)][1]; | |
| 2540 | ||
| 2541 | const layout_size = 5; | |
| 2542 | comptime std.debug.assert(@sizeOf(Type.Record.Layout) == @sizeOf(u32) * layout_size); | |
| 2543 | const field_size = 10; | |
| 2544 | comptime std.debug.assert(@sizeOf(Type.Record.Field) == @sizeOf(u32) * field_size); | |
| 2545 | ||
| 2546 | extra_index += 1; // For decl_node | |
| 2547 | const casted_layout: *const [layout_size]u32 = @ptrCast(&record_ty.layout); | |
| 2548 | ts.extra.items[extra_index..][0..layout_size].* = casted_layout.*; | |
| 2549 | extra_index += layout_size; | |
| 2550 | extra_index += 1; // For field length | |
| 2551 | ||
| 2552 | for (record_ty.fields) |*field| { | |
| 2553 | const casted: *const [field_size]u32 = @ptrCast(field); | |
| 2554 | ts.extra.items[extra_index..][0..field_size].* = casted.*; | |
| 2555 | extra_index += field_size; | |
| 2556 | } | |
| 2338 | 2557 | } |
| 2339 | 2558 | |
| 2340 | 2559 | // finish by creating a node |
| 2341 | var node: Tree.Node = .{ | |
| 2342 | .tag = if (is_struct) .struct_decl_two else .union_decl_two, | |
| 2343 | .ty = ty, | |
| 2344 | .data = .{ .two = .{ .none, .none } }, | |
| 2345 | .loc = @enumFromInt(maybe_ident orelse kind_tok), | |
| 2560 | const cd: Node.ContainerDecl = .{ | |
| 2561 | .name_or_kind_tok = maybe_ident orelse kind_tok, | |
| 2562 | .container_qt = attributed_qt, | |
| 2563 | .fields = p.decl_buf.items[decl_buf_top..], | |
| 2346 | 2564 | }; |
| 2347 | switch (record_decls.len) { | |
| 2348 | 0 => {}, | |
| 2349 | 1 => node.data = .{ .two = .{ record_decls[0], .none } }, | |
| 2350 | 2 => node.data = .{ .two = .{ record_decls[0], record_decls[1] } }, | |
| 2351 | else => { | |
| 2352 | node.tag = if (is_struct) .struct_decl else .union_decl; | |
| 2353 | node.data = .{ .range = try p.addList(record_decls) }; | |
| 2354 | }, | |
| 2355 | } | |
| 2356 | p.decl_buf.items[decl_buf_top - 1] = try p.addNode(node); | |
| 2357 | if (p.func.ty == null) { | |
| 2565 | try p.tree.setNode(if (is_struct) .{ .struct_decl = cd } else .{ .union_decl = cd }, reserved_index); | |
| 2566 | if (p.func.qt == null) { | |
| 2358 | 2567 | _ = p.tentative_defs.remove(record_ty.name); |
| 2359 | 2568 | } |
| 2360 | return ty; | |
| 2569 | return attributed_qt; | |
| 2361 | 2570 | } |
| 2362 | 2571 | |
| 2363 | /// recordDecl | |
| 2364 | /// : specQual (recordDeclarator (',' recordDeclarator)*)? ; | |
| 2365 | /// | staticAssert | |
| 2572 | /// recordDecls : (keyword_extension? recordDecl | staticAssert)* | |
| 2366 | 2573 | fn recordDecls(p: *Parser) Error!void { |
| 2367 | 2574 | while (true) { |
| 2368 | 2575 | if (try p.pragma()) continue; |
| ... | ... | @@ -2372,23 +2579,60 @@ fn recordDecls(p: *Parser) Error!void { |
| 2372 | 2579 | defer p.extension_suppressed = saved_extension; |
| 2373 | 2580 | p.extension_suppressed = true; |
| 2374 | 2581 | |
| 2375 | if (try p.parseOrNextDecl(recordDeclarator)) continue; | |
| 2376 | try p.err(.expected_type); | |
| 2582 | if (try p.parseOrNextDecl(recordDecl)) continue; | |
| 2583 | try p.err(p.tok_i, .expected_type, .{}); | |
| 2377 | 2584 | p.nextExternDecl(); |
| 2378 | 2585 | continue; |
| 2379 | 2586 | } |
| 2380 | if (try p.parseOrNextDecl(recordDeclarator)) continue; | |
| 2587 | if (try p.parseOrNextDecl(recordDecl)) continue; | |
| 2381 | 2588 | break; |
| 2382 | 2589 | } |
| 2383 | 2590 | } |
| 2384 | 2591 | |
| 2385 | /// recordDeclarator : keyword_extension? declarator (':' integerConstExpr)? | |
| 2386 | fn recordDeclarator(p: *Parser) Error!bool { | |
| 2592 | /// recordDecl : typeSpec+ (recordDeclarator (',' recordDeclarator)*)? | |
| 2593 | /// recordDeclarator : declarator (':' integerConstExpr)? | |
| 2594 | fn recordDecl(p: *Parser) Error!bool { | |
| 2595 | const gpa = p.comp.gpa; | |
| 2387 | 2596 | const attr_buf_top = p.attr_buf.len; |
| 2388 | 2597 | defer p.attr_buf.len = attr_buf_top; |
| 2389 | const base_ty = (try p.specQual()) orelse return false; | |
| 2598 | ||
| 2599 | const base_qt: QualType = blk: { | |
| 2600 | const start = p.tok_i; | |
| 2601 | var builder: TypeStore.Builder = .{ .parser = p }; | |
| 2602 | while (true) { | |
| 2603 | if (try p.typeSpec(&builder)) continue; | |
| 2604 | const id = p.tok_ids[p.tok_i]; | |
| 2605 | switch (id) { | |
| 2606 | .keyword_auto => { | |
| 2607 | if (!p.comp.langopts.standard.atLeast(.c23)) break; | |
| 2608 | ||
| 2609 | try p.err(p.tok_i, .c23_auto_not_allowed, .{if (p.record.kind == .keyword_struct) "struct member" else "union member"}); | |
| 2610 | try builder.combine(.c23_auto, p.tok_i); | |
| 2611 | }, | |
| 2612 | .keyword_auto_type => { | |
| 2613 | try p.err(p.tok_i, .auto_type_extension, .{}); | |
| 2614 | try p.err(p.tok_i, .auto_type_not_allowed, .{if (p.record.kind == .keyword_struct) "struct member" else "union member"}); | |
| 2615 | try builder.combine(.auto_type, p.tok_i); | |
| 2616 | }, | |
| 2617 | .identifier, .extended_identifier => { | |
| 2618 | if (builder.type != .none) break; | |
| 2619 | try p.err(p.tok_i, .unknown_type_name, .{p.tokSlice(p.tok_i)}); | |
| 2620 | builder.type = .{ .other = .invalid }; | |
| 2621 | }, | |
| 2622 | else => break, | |
| 2623 | } | |
| 2624 | p.tok_i += 1; | |
| 2625 | break; | |
| 2626 | } | |
| 2627 | if (p.tok_i == start) return false; | |
| 2628 | break :blk switch (builder.type) { | |
| 2629 | .auto_type, .c23_auto => .invalid, | |
| 2630 | else => try builder.finish(), | |
| 2631 | }; | |
| 2632 | }; | |
| 2390 | 2633 | |
| 2391 | 2634 | try p.attributeSpecifier(); // .record |
| 2635 | var error_on_unnamed = false; | |
| 2392 | 2636 | while (true) { |
| 2393 | 2637 | const this_decl_top = p.attr_buf.len; |
| 2394 | 2638 | defer p.attr_buf.len = this_decl_top; |
| ... | ... | @@ -2397,43 +2641,40 @@ fn recordDeclarator(p: *Parser) Error!bool { |
| 2397 | 2641 | |
| 2398 | 2642 | // 0 means unnamed |
| 2399 | 2643 | var name_tok: TokenIndex = 0; |
| 2400 | var ty = base_ty; | |
| 2401 | if (ty.is(.auto_type)) { | |
| 2402 | try p.errStr(.auto_type_not_allowed, p.tok_i, if (p.record.kind == .keyword_struct) "struct member" else "union member"); | |
| 2403 | ty = Type.invalid; | |
| 2404 | } | |
| 2405 | var bits_node: NodeIndex = .none; | |
| 2644 | var qt = base_qt; | |
| 2645 | var bits_node: ?Node.Index = null; | |
| 2406 | 2646 | var bits: ?u32 = null; |
| 2407 | 2647 | const first_tok = p.tok_i; |
| 2408 | if (try p.declarator(ty, .record)) |d| { | |
| 2648 | if (try p.declarator(qt, .record)) |d| { | |
| 2409 | 2649 | name_tok = d.name; |
| 2410 | ty = d.ty; | |
| 2650 | qt = d.qt; | |
| 2651 | error_on_unnamed = true; | |
| 2411 | 2652 | } |
| 2412 | 2653 | |
| 2413 | 2654 | if (p.eatToken(.colon)) |_| bits: { |
| 2414 | 2655 | const bits_tok = p.tok_i; |
| 2415 | 2656 | const res = try p.integerConstExpr(.gnu_folding_extension); |
| 2416 | if (!ty.isInt()) { | |
| 2417 | try p.errStr(.non_int_bitfield, first_tok, try p.typeStr(ty)); | |
| 2657 | if (!qt.isInvalid() and !qt.isRealInt(p.comp)) { | |
| 2658 | try p.err(first_tok, .non_int_bitfield, .{qt}); | |
| 2418 | 2659 | break :bits; |
| 2419 | 2660 | } |
| 2420 | 2661 | |
| 2421 | 2662 | if (res.val.opt_ref == .none) { |
| 2422 | try p.errTok(.expected_integer_constant_expr, bits_tok); | |
| 2663 | try p.err(bits_tok, .expected_integer_constant_expr, .{}); | |
| 2423 | 2664 | break :bits; |
| 2424 | } else if (res.val.compare(.lt, Value.zero, p.comp)) { | |
| 2425 | try p.errStr(.negative_bitwidth, first_tok, try res.str(p)); | |
| 2665 | } else if (res.val.compare(.lt, .zero, p.comp)) { | |
| 2666 | try p.err(first_tok, .negative_bitwidth, .{res}); | |
| 2426 | 2667 | break :bits; |
| 2427 | 2668 | } |
| 2428 | 2669 | |
| 2429 | 2670 | // incomplete size error is reported later |
| 2430 | const bit_size = ty.bitSizeof(p.comp) orelse break :bits; | |
| 2671 | const bit_size = qt.bitSizeofOrNull(p.comp) orelse break :bits; | |
| 2431 | 2672 | const bits_unchecked = res.val.toInt(u32, p.comp) orelse std.math.maxInt(u32); |
| 2432 | 2673 | if (bits_unchecked > bit_size) { |
| 2433 | try p.errTok(.bitfield_too_big, name_tok); | |
| 2674 | try p.err(name_tok, .bitfield_too_big, .{}); | |
| 2434 | 2675 | break :bits; |
| 2435 | 2676 | } else if (bits_unchecked == 0 and name_tok != 0) { |
| 2436 | try p.errTok(.zero_width_named_field, name_tok); | |
| 2677 | try p.err(name_tok, .zero_width_named_field, .{}); | |
| 2437 | 2678 | break :bits; |
| 2438 | 2679 | } |
| 2439 | 2680 | |
| ... | ... | @@ -2442,85 +2683,126 @@ fn recordDeclarator(p: *Parser) Error!bool { |
| 2442 | 2683 | } |
| 2443 | 2684 | |
| 2444 | 2685 | try p.attributeSpecifier(); // .record |
| 2445 | const to_append = try Attribute.applyFieldAttributes(p, &ty, attr_buf_top); | |
| 2446 | 2686 | |
| 2447 | const any_fields_have_attrs = p.field_attr_buf.items.len > p.record.field_attr_start; | |
| 2687 | const to_append = try Attribute.applyFieldAttributes(p, &qt, attr_buf_top); | |
| 2448 | 2688 | |
| 2449 | if (any_fields_have_attrs) { | |
| 2450 | try p.field_attr_buf.append(to_append); | |
| 2451 | } else { | |
| 2452 | if (to_append.len > 0) { | |
| 2453 | const preceding = p.record_members.items.len - p.record.start; | |
| 2454 | if (preceding > 0) { | |
| 2455 | try p.field_attr_buf.appendNTimes(&.{}, preceding); | |
| 2456 | } | |
| 2457 | try p.field_attr_buf.append(to_append); | |
| 2458 | } | |
| 2459 | } | |
| 2689 | const attr_index: u32 = @intCast(p.comp.type_store.attributes.items.len); | |
| 2690 | const attr_len: u32 = @intCast(to_append.len); | |
| 2691 | try p.comp.type_store.attributes.appendSlice(gpa, to_append); | |
| 2460 | 2692 | |
| 2461 | if (name_tok == 0 and bits_node == .none) unnamed: { | |
| 2462 | if (ty.is(.@"enum") or ty.hasIncompleteSize()) break :unnamed; | |
| 2463 | if (ty.isAnonymousRecord(p.comp)) { | |
| 2464 | // An anonymous record appears as indirect fields on the parent | |
| 2465 | try p.record_buf.append(.{ | |
| 2466 | .name = try p.getAnonymousName(first_tok), | |
| 2467 | .ty = ty, | |
| 2468 | }); | |
| 2469 | const node = try p.addNode(.{ | |
| 2470 | .tag = .indirect_record_field_decl, | |
| 2471 | .ty = ty, | |
| 2472 | .data = undefined, | |
| 2473 | .loc = @enumFromInt(first_tok), | |
| 2474 | }); | |
| 2475 | try p.decl_buf.append(node); | |
| 2476 | try p.record.addFieldsFromAnonymous(p, ty); | |
| 2477 | break; // must be followed by a semicolon | |
| 2693 | if (name_tok == 0 and bits == null) unnamed: { | |
| 2694 | var is_typedef = false; | |
| 2695 | if (!qt.isInvalid()) loop: switch (qt.type(p.comp)) { | |
| 2696 | .attributed => |attributed_ty| continue :loop attributed_ty.base.type(p.comp), | |
| 2697 | .typedef => |typedef_ty| { | |
| 2698 | is_typedef = true; | |
| 2699 | continue :loop typedef_ty.base.type(p.comp); | |
| 2700 | }, | |
| 2701 | // typeof intentionally ignored here | |
| 2702 | .@"enum" => break :unnamed, | |
| 2703 | .@"struct", .@"union" => |record_ty| if ((record_ty.isAnonymous(p.comp) and !is_typedef) or | |
| 2704 | (p.comp.langopts.ms_extensions and is_typedef)) | |
| 2705 | { | |
| 2706 | if (!(record_ty.isAnonymous(p.comp) and !is_typedef)) { | |
| 2707 | try p.err(first_tok, .anonymous_struct, .{}); | |
| 2708 | } | |
| 2709 | // An anonymous record appears as indirect fields on the parent | |
| 2710 | try p.record_buf.append(gpa, .{ | |
| 2711 | .name = try p.getAnonymousName(first_tok), | |
| 2712 | .qt = qt, | |
| 2713 | ._attr_index = attr_index, | |
| 2714 | ._attr_len = attr_len, | |
| 2715 | }); | |
| 2716 | ||
| 2717 | const node = try p.addNode(.{ | |
| 2718 | .record_field = .{ | |
| 2719 | .name_or_first_tok = name_tok, | |
| 2720 | .qt = qt, | |
| 2721 | .bit_width = null, | |
| 2722 | }, | |
| 2723 | }); | |
| 2724 | try p.decl_buf.append(gpa, node); | |
| 2725 | try p.record.addFieldsFromAnonymous(p, record_ty); | |
| 2726 | break; // must be followed by a semicolon | |
| 2727 | }, | |
| 2728 | else => {}, | |
| 2729 | }; | |
| 2730 | if (error_on_unnamed) { | |
| 2731 | try p.err(first_tok, .expected_member_name, .{}); | |
| 2732 | } else { | |
| 2733 | try p.err(p.tok_i, .missing_declaration, .{}); | |
| 2478 | 2734 | } |
| 2479 | try p.err(.missing_declaration); | |
| 2735 | if (p.eatToken(.comma) == null) break; | |
| 2736 | continue; | |
| 2480 | 2737 | } else { |
| 2481 | const interned_name = if (name_tok != 0) try StrInt.intern(p.comp, p.tokSlice(name_tok)) else try p.getAnonymousName(first_tok); | |
| 2482 | try p.record_buf.append(.{ | |
| 2738 | const interned_name = if (name_tok != 0) try p.comp.internString(p.tokSlice(name_tok)) else try p.getAnonymousName(first_tok); | |
| 2739 | try p.record_buf.append(gpa, .{ | |
| 2483 | 2740 | .name = interned_name, |
| 2484 | .ty = ty, | |
| 2741 | .qt = qt, | |
| 2485 | 2742 | .name_tok = name_tok, |
| 2486 | .bit_width = bits, | |
| 2743 | .bit_width = if (bits) |some| @enumFromInt(some) else .null, | |
| 2744 | ._attr_index = attr_index, | |
| 2745 | ._attr_len = attr_len, | |
| 2487 | 2746 | }); |
| 2488 | 2747 | if (name_tok != 0) try p.record.addField(p, interned_name, name_tok); |
| 2489 | 2748 | const node = try p.addNode(.{ |
| 2490 | .tag = .record_field_decl, | |
| 2491 | .ty = ty, | |
| 2492 | .data = .{ .decl = .{ .name = name_tok, .node = bits_node } }, | |
| 2493 | .loc = @enumFromInt(if (name_tok != 0) name_tok else first_tok), | |
| 2749 | .record_field = .{ | |
| 2750 | .name_or_first_tok = name_tok, | |
| 2751 | .qt = qt, | |
| 2752 | .bit_width = bits_node, | |
| 2753 | }, | |
| 2494 | 2754 | }); |
| 2495 | try p.decl_buf.append(node); | |
| 2755 | try p.decl_buf.append(gpa, node); | |
| 2496 | 2756 | } |
| 2497 | 2757 | |
| 2498 | if (ty.isFunc()) { | |
| 2499 | try p.errTok(.func_field, first_tok); | |
| 2500 | } else if (ty.is(.variable_len_array)) { | |
| 2501 | try p.errTok(.vla_field, first_tok); | |
| 2502 | } else if (ty.is(.incomplete_array)) { | |
| 2503 | if (p.record.kind == .keyword_union) { | |
| 2504 | try p.errTok(.flexible_in_union, first_tok); | |
| 2505 | } | |
| 2506 | if (p.record.flexible_field) |some| { | |
| 2507 | if (p.record.kind == .keyword_struct) { | |
| 2508 | try p.errTok(.flexible_non_final, some); | |
| 2509 | } | |
| 2758 | if (!qt.isInvalid()) { | |
| 2759 | const field_type = qt.base(p.comp); | |
| 2760 | switch (field_type.type) { | |
| 2761 | .func => { | |
| 2762 | try p.err(first_tok, .func_field, .{}); | |
| 2763 | qt = .invalid; | |
| 2764 | }, | |
| 2765 | .array => |array_ty| switch (array_ty.len) { | |
| 2766 | .static, .unspecified_variable => unreachable, | |
| 2767 | .variable => { | |
| 2768 | try p.err(first_tok, .vla_field, .{}); | |
| 2769 | qt = .invalid; | |
| 2770 | }, | |
| 2771 | .fixed => {}, | |
| 2772 | .incomplete => { | |
| 2773 | if (p.record.kind == .keyword_union) { | |
| 2774 | if (p.comp.langopts.emulate == .msvc) { | |
| 2775 | try p.err(first_tok, .flexible_in_union_msvc, .{}); | |
| 2776 | } else { | |
| 2777 | try p.err(first_tok, .flexible_in_union, .{}); | |
| 2778 | qt = .invalid; | |
| 2779 | } | |
| 2780 | } | |
| 2781 | if (p.record.flexible_field) |some| { | |
| 2782 | if (p.record.kind == .keyword_struct) { | |
| 2783 | try p.err(some, .flexible_non_final, .{}); | |
| 2784 | } | |
| 2785 | } | |
| 2786 | p.record.flexible_field = first_tok; | |
| 2787 | }, | |
| 2788 | }, | |
| 2789 | else => if (field_type.qt.hasIncompleteSize(p.comp)) { | |
| 2790 | try p.err(first_tok, .field_incomplete_ty, .{qt}); | |
| 2791 | } else if (p.record.flexible_field) |some| { | |
| 2792 | std.debug.assert(some != first_tok); | |
| 2793 | if (p.record.kind == .keyword_struct) try p.err(some, .flexible_non_final, .{}); | |
| 2794 | }, | |
| 2510 | 2795 | } |
| 2511 | p.record.flexible_field = first_tok; | |
| 2512 | } else if (ty.specifier != .invalid and ty.hasIncompleteSize()) { | |
| 2513 | try p.errStr(.field_incomplete_ty, first_tok, try p.typeStr(ty)); | |
| 2514 | } else if (p.record.flexible_field) |some| { | |
| 2515 | if (some != first_tok and p.record.kind == .keyword_struct) try p.errTok(.flexible_non_final, some); | |
| 2516 | 2796 | } |
| 2797 | ||
| 2517 | 2798 | if (p.eatToken(.comma) == null) break; |
| 2799 | error_on_unnamed = true; | |
| 2518 | 2800 | } |
| 2519 | 2801 | |
| 2520 | 2802 | if (p.eatToken(.semicolon) == null) { |
| 2521 | 2803 | const tok_id = p.tok_ids[p.tok_i]; |
| 2522 | 2804 | if (tok_id == .r_brace) { |
| 2523 | try p.err(.missing_semicolon); | |
| 2805 | try p.err(p.tok_i, .missing_semicolon, .{}); | |
| 2524 | 2806 | } else { |
| 2525 | 2807 | return p.errExpectedToken(.semicolon, tok_id); |
| 2526 | 2808 | } |
| ... | ... | @@ -2529,11 +2811,11 @@ fn recordDeclarator(p: *Parser) Error!bool { |
| 2529 | 2811 | return true; |
| 2530 | 2812 | } |
| 2531 | 2813 | |
| 2532 | /// specQual : (typeSpec | typeQual | alignSpec)+ | |
| 2533 | fn specQual(p: *Parser) Error!?Type { | |
| 2534 | var spec: Type.Builder = .{}; | |
| 2535 | if (try p.typeSpec(&spec)) { | |
| 2536 | return try spec.finish(p); | |
| 2814 | /// specQual : typeSpec+ | |
| 2815 | fn specQual(p: *Parser) Error!?QualType { | |
| 2816 | var builder: TypeStore.Builder = .{ .parser = p }; | |
| 2817 | if (try p.typeSpec(&builder)) { | |
| 2818 | return try builder.finish(); | |
| 2537 | 2819 | } |
| 2538 | 2820 | return null; |
| 2539 | 2821 | } |
| ... | ... | @@ -2541,7 +2823,8 @@ fn specQual(p: *Parser) Error!?Type { |
| 2541 | 2823 | /// enumSpec |
| 2542 | 2824 | /// : keyword_enum IDENTIFIER? (: typeName)? { enumerator (',' enumerator)? ',') } |
| 2543 | 2825 | /// | keyword_enum IDENTIFIER (: typeName)? |
| 2544 | fn enumSpec(p: *Parser) Error!Type { | |
| 2826 | fn enumSpec(p: *Parser) Error!QualType { | |
| 2827 | const gpa = p.comp.gpa; | |
| 2545 | 2828 | const enum_tok = p.tok_i; |
| 2546 | 2829 | p.tok_i += 1; |
| 2547 | 2830 | const attr_buf_top = p.attr_buf.len; |
| ... | ... | @@ -2549,7 +2832,7 @@ fn enumSpec(p: *Parser) Error!Type { |
| 2549 | 2832 | try p.attributeSpecifier(); |
| 2550 | 2833 | |
| 2551 | 2834 | const maybe_ident = try p.eatIdentifier(); |
| 2552 | const fixed_ty = if (p.eatToken(.colon)) |colon| fixed: { | |
| 2835 | const fixed_qt = if (p.eatToken(.colon)) |colon| fixed: { | |
| 2553 | 2836 | const ty_start = p.tok_i; |
| 2554 | 2837 | const fixed = (try p.specQual()) orelse { |
| 2555 | 2838 | if (p.record.kind != .invalid) { |
| ... | ... | @@ -2557,53 +2840,60 @@ fn enumSpec(p: *Parser) Error!Type { |
| 2557 | 2840 | p.tok_i -= 1; |
| 2558 | 2841 | break :fixed null; |
| 2559 | 2842 | } |
| 2560 | try p.err(.expected_type); | |
| 2561 | try p.errTok(.enum_fixed, colon); | |
| 2843 | try p.err(p.tok_i, .expected_type, .{}); | |
| 2844 | try p.err(colon, .enum_fixed, .{}); | |
| 2562 | 2845 | break :fixed null; |
| 2563 | 2846 | }; |
| 2564 | 2847 | |
| 2565 | if (!fixed.isInt() or fixed.is(.@"enum")) { | |
| 2566 | try p.errStr(.invalid_type_underlying_enum, ty_start, try p.typeStr(fixed)); | |
| 2567 | break :fixed Type.int; | |
| 2848 | const fixed_sk = fixed.scalarKind(p.comp); | |
| 2849 | if (fixed_sk == .@"enum" or !fixed_sk.isInt() or !fixed_sk.isReal()) { | |
| 2850 | try p.err(ty_start, .invalid_type_underlying_enum, .{fixed}); | |
| 2851 | break :fixed null; | |
| 2568 | 2852 | } |
| 2569 | 2853 | |
| 2570 | try p.errTok(.enum_fixed, colon); | |
| 2854 | try p.err(colon, .enum_fixed, .{}); | |
| 2571 | 2855 | break :fixed fixed; |
| 2572 | 2856 | } else null; |
| 2573 | 2857 | |
| 2858 | const reserved_index = try p.tree.nodes.addOne(gpa); | |
| 2859 | ||
| 2574 | 2860 | const l_brace = p.eatToken(.l_brace) orelse { |
| 2575 | 2861 | const ident = maybe_ident orelse { |
| 2576 | try p.err(.ident_or_l_brace); | |
| 2862 | try p.err(p.tok_i, .ident_or_l_brace, .{}); | |
| 2577 | 2863 | return error.ParsingFailed; |
| 2578 | 2864 | }; |
| 2579 | 2865 | // check if this is a reference to a previous type |
| 2580 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(ident)); | |
| 2581 | if (try p.syms.findTag(p, interned_name, .keyword_enum, ident, p.tok_ids[p.tok_i])) |prev| { | |
| 2866 | const interned_name = try p.comp.internString(p.tokSlice(ident)); | |
| 2867 | if (try p.syms.findTag(p, interned_name, p.tok_ids[enum_tok], ident, p.tok_ids[p.tok_i])) |prev| { | |
| 2582 | 2868 | // only check fixed underlying type in forward declarations and not in references. |
| 2583 | 2869 | if (p.tok_ids[p.tok_i] == .semicolon) |
| 2584 | try p.checkEnumFixedTy(fixed_ty, ident, prev); | |
| 2585 | return prev.ty; | |
| 2870 | try p.checkEnumFixedTy(fixed_qt, ident, prev); | |
| 2871 | return prev.qt; | |
| 2586 | 2872 | } else { |
| 2587 | // this is a forward declaration, create a new enum Type. | |
| 2588 | const enum_ty = try Type.Enum.create(p.arena, interned_name, fixed_ty); | |
| 2589 | const ty = try Attribute.applyTypeAttributes(p, .{ | |
| 2590 | .specifier = .@"enum", | |
| 2591 | .data = .{ .@"enum" = enum_ty }, | |
| 2592 | }, attr_buf_top, null); | |
| 2593 | try p.syms.define(p.gpa, .{ | |
| 2873 | const enum_qt = try p.comp.type_store.put(gpa, .{ .@"enum" = .{ | |
| 2874 | .name = interned_name, | |
| 2875 | .tag = fixed_qt, | |
| 2876 | .fixed = fixed_qt != null, | |
| 2877 | .incomplete = true, | |
| 2878 | .decl_node = @enumFromInt(reserved_index), | |
| 2879 | .fields = &.{}, | |
| 2880 | } }); | |
| 2881 | ||
| 2882 | const attributed_qt = try Attribute.applyTypeAttributes(p, enum_qt, attr_buf_top, null); | |
| 2883 | try p.syms.define(gpa, .{ | |
| 2594 | 2884 | .kind = .@"enum", |
| 2595 | 2885 | .name = interned_name, |
| 2596 | 2886 | .tok = ident, |
| 2597 | .ty = ty, | |
| 2887 | .qt = attributed_qt, | |
| 2598 | 2888 | .val = .{}, |
| 2599 | 2889 | }); |
| 2600 | try p.decl_buf.append(try p.addNode(.{ | |
| 2601 | .tag = .enum_forward_decl, | |
| 2602 | .ty = ty, | |
| 2603 | .data = .{ .decl_ref = ident }, | |
| 2604 | .loc = @enumFromInt(ident), | |
| 2605 | })); | |
| 2606 | return ty; | |
| 2890 | ||
| 2891 | try p.decl_buf.append(gpa, try p.addNode(.{ .enum_forward_decl = .{ | |
| 2892 | .name_or_kind_tok = ident, | |
| 2893 | .container_qt = attributed_qt, | |
| 2894 | .definition = null, | |
| 2895 | } })); | |
| 2896 | return attributed_qt; | |
| 2607 | 2897 | } |
| 2608 | 2898 | }; |
| 2609 | 2899 | |
| ... | ... | @@ -2612,26 +2902,41 @@ fn enumSpec(p: *Parser) Error!Type { |
| 2612 | 2902 | |
| 2613 | 2903 | // Get forward declared type or create a new one |
| 2614 | 2904 | var defined = false; |
| 2615 | const enum_ty: *Type.Enum = if (maybe_ident) |ident| enum_ty: { | |
| 2616 | const ident_str = p.tokSlice(ident); | |
| 2617 | const interned_name = try StrInt.intern(p.comp, ident_str); | |
| 2618 | if (try p.syms.defineTag(p, interned_name, .keyword_enum, ident)) |prev| { | |
| 2619 | const enum_ty = prev.ty.get(.@"enum").?.data.@"enum"; | |
| 2620 | if (!enum_ty.isIncomplete() and !enum_ty.fixed) { | |
| 2621 | // if the enum isn't incomplete, this is a redefinition | |
| 2622 | try p.errStr(.redefinition, ident, ident_str); | |
| 2623 | try p.errTok(.previous_definition, prev.tok); | |
| 2624 | } else { | |
| 2625 | try p.checkEnumFixedTy(fixed_ty, ident, prev); | |
| 2626 | defined = true; | |
| 2627 | break :enum_ty enum_ty; | |
| 2905 | var enum_ty: Type.Enum, const qt: QualType = blk: { | |
| 2906 | const interned_name = if (maybe_ident) |ident| interned: { | |
| 2907 | const ident_str = p.tokSlice(ident); | |
| 2908 | const interned_name = try p.comp.internString(ident_str); | |
| 2909 | if (try p.syms.defineTag(p, interned_name, p.tok_ids[enum_tok], ident)) |prev| { | |
| 2910 | const enum_ty = prev.qt.get(p.comp, .@"enum").?; | |
| 2911 | if (!enum_ty.incomplete) { | |
| 2912 | // if the record isn't incomplete, this is a redefinition | |
| 2913 | try p.err(ident, .redefinition, .{ident_str}); | |
| 2914 | try p.err(prev.tok, .previous_definition, .{}); | |
| 2915 | } else { | |
| 2916 | try p.checkEnumFixedTy(fixed_qt, ident, prev); | |
| 2917 | defined = true; | |
| 2918 | break :blk .{ enum_ty, prev.qt }; | |
| 2919 | } | |
| 2628 | 2920 | } |
| 2629 | } | |
| 2630 | break :enum_ty try Type.Enum.create(p.arena, interned_name, fixed_ty); | |
| 2631 | } else try Type.Enum.create(p.arena, try p.getAnonymousName(enum_tok), fixed_ty); | |
| 2921 | break :interned interned_name; | |
| 2922 | } else try p.getAnonymousName(enum_tok); | |
| 2923 | ||
| 2924 | // Initially create ty as a regular non-attributed type, since attributes for a record | |
| 2925 | // can be specified after the closing rbrace, which we haven't encountered yet. | |
| 2926 | const enum_ty: Type.Enum = .{ | |
| 2927 | .name = interned_name, | |
| 2928 | .decl_node = @enumFromInt(reserved_index), | |
| 2929 | .tag = fixed_qt, | |
| 2930 | .incomplete = true, | |
| 2931 | .fixed = fixed_qt != null, | |
| 2932 | .fields = &.{}, | |
| 2933 | }; | |
| 2934 | const enum_qt = try p.comp.type_store.put(gpa, .{ .@"enum" = enum_ty }); | |
| 2935 | break :blk .{ enum_ty, enum_qt }; | |
| 2936 | }; | |
| 2632 | 2937 | |
| 2633 | 2938 | // reserve space for this enum |
| 2634 | try p.decl_buf.append(.none); | |
| 2939 | try p.decl_buf.append(gpa, @enumFromInt(reserved_index)); | |
| 2635 | 2940 | const decl_buf_top = p.decl_buf.items.len; |
| 2636 | 2941 | const list_buf_top = p.list_buf.items.len; |
| 2637 | 2942 | const enum_buf_top = p.enum_buf.items.len; |
| ... | ... | @@ -2642,187 +2947,190 @@ fn enumSpec(p: *Parser) Error!Type { |
| 2642 | 2947 | p.enum_buf.items.len = enum_buf_top; |
| 2643 | 2948 | } |
| 2644 | 2949 | |
| 2645 | var e = Enumerator.init(fixed_ty); | |
| 2950 | var e = Enumerator.init(fixed_qt); | |
| 2646 | 2951 | while (try p.enumerator(&e)) |field_and_node| { |
| 2647 | try p.enum_buf.append(field_and_node.field); | |
| 2648 | try p.list_buf.append(field_and_node.node); | |
| 2952 | try p.enum_buf.append(gpa, field_and_node.field); | |
| 2953 | try p.list_buf.append(gpa, field_and_node.node); | |
| 2649 | 2954 | if (p.eatToken(.comma) == null) break; |
| 2650 | 2955 | } |
| 2651 | 2956 | |
| 2652 | if (p.enum_buf.items.len == enum_buf_top) try p.err(.empty_enum); | |
| 2957 | if (p.enum_buf.items.len == enum_buf_top) try p.err(p.tok_i, .empty_enum, .{}); | |
| 2653 | 2958 | try p.expectClosing(l_brace, .r_brace); |
| 2654 | 2959 | done = true; |
| 2655 | 2960 | try p.attributeSpecifier(); |
| 2656 | 2961 | |
| 2657 | const ty = try Attribute.applyTypeAttributes(p, .{ | |
| 2658 | .specifier = .@"enum", | |
| 2659 | .data = .{ .@"enum" = enum_ty }, | |
| 2660 | }, attr_buf_top, null); | |
| 2962 | const attributed_qt = try Attribute.applyTypeAttributes(p, qt, attr_buf_top, null); | |
| 2661 | 2963 | if (!enum_ty.fixed) { |
| 2662 | const tag_specifier = try e.getTypeSpecifier(p, ty.enumIsPacked(p.comp), maybe_ident orelse enum_tok); | |
| 2663 | enum_ty.tag_ty = .{ .specifier = tag_specifier }; | |
| 2964 | enum_ty.tag = try e.getTypeSpecifier(p, attributed_qt.enumIsPacked(p.comp), maybe_ident orelse enum_tok); | |
| 2664 | 2965 | } |
| 2665 | 2966 | |
| 2666 | 2967 | const enum_fields = p.enum_buf.items[enum_buf_top..]; |
| 2667 | 2968 | const field_nodes = p.list_buf.items[list_buf_top..]; |
| 2668 | 2969 | |
| 2669 | if (fixed_ty == null) { | |
| 2670 | for (enum_fields, 0..) |*field, i| { | |
| 2671 | if (field.ty.eql(Type.int, p.comp, false)) continue; | |
| 2970 | if (fixed_qt == null) { | |
| 2971 | // Coerce all fields to final type. | |
| 2972 | for (enum_fields, field_nodes) |*field, field_node| { | |
| 2973 | if (field.qt.eql(.int, p.comp)) continue; | |
| 2672 | 2974 | |
| 2673 | 2975 | const sym = p.syms.get(field.name, .vars) orelse continue; |
| 2674 | 2976 | if (sym.kind != .enumeration) continue; // already an error |
| 2675 | 2977 | |
| 2676 | var res = Result{ .node = field.node, .ty = field.ty, .val = sym.val }; | |
| 2677 | const dest_ty = if (p.comp.fixedEnumTagSpecifier()) |some| | |
| 2678 | Type{ .specifier = some } | |
| 2679 | else if (try res.intFitsInType(p, Type.int)) | |
| 2680 | Type.int | |
| 2681 | else if (!res.ty.eql(enum_ty.tag_ty, p.comp, false)) | |
| 2682 | enum_ty.tag_ty | |
| 2978 | var res: Result = .{ .node = undefined, .qt = field.qt, .val = sym.val }; | |
| 2979 | const dest_ty: QualType = if (p.comp.fixedEnumTagType()) |some| | |
| 2980 | some | |
| 2981 | else if (try res.intFitsInType(p, .int)) | |
| 2982 | .int | |
| 2983 | else if (!res.qt.eql(enum_ty.tag.?, p.comp)) | |
| 2984 | enum_ty.tag.? | |
| 2683 | 2985 | else |
| 2684 | 2986 | continue; |
| 2685 | 2987 | |
| 2686 | 2988 | const symbol = p.syms.getPtr(field.name, .vars); |
| 2687 | 2989 | _ = try symbol.val.intCast(dest_ty, p.comp); |
| 2688 | symbol.ty = dest_ty; | |
| 2689 | p.nodes.items(.ty)[@intFromEnum(field_nodes[i])] = dest_ty; | |
| 2690 | field.ty = dest_ty; | |
| 2691 | res.ty = dest_ty; | |
| 2990 | try p.tree.value_map.put(gpa, field_node, symbol.val); | |
| 2991 | ||
| 2992 | symbol.qt = dest_ty; | |
| 2993 | field.qt = dest_ty; | |
| 2994 | res.qt = dest_ty; | |
| 2692 | 2995 | |
| 2693 | if (res.node != .none) { | |
| 2694 | try res.implicitCast(p, .int_cast); | |
| 2695 | field.node = res.node; | |
| 2696 | p.nodes.items(.data)[@intFromEnum(field_nodes[i])].decl.node = res.node; | |
| 2996 | // Create a new enum_field node with the correct type. | |
| 2997 | var new_field_node = field_node.get(&p.tree); | |
| 2998 | new_field_node.enum_field.qt = dest_ty; | |
| 2999 | ||
| 3000 | if (new_field_node.enum_field.init) |some| { | |
| 3001 | res.node = some; | |
| 3002 | try res.implicitCast(p, .int_cast, some.tok(&p.tree)); | |
| 3003 | new_field_node.enum_field.init = res.node; | |
| 2697 | 3004 | } |
| 3005 | ||
| 3006 | try p.tree.setNode(new_field_node, @intFromEnum(field_node)); | |
| 2698 | 3007 | } |
| 2699 | 3008 | } |
| 2700 | 3009 | |
| 2701 | enum_ty.fields = try p.arena.dupe(Type.Enum.Field, enum_fields); | |
| 3010 | { // Override previous incomplete type | |
| 3011 | enum_ty.fields = enum_fields; | |
| 3012 | enum_ty.incomplete = false; | |
| 3013 | enum_ty.decl_node = @enumFromInt(reserved_index); | |
| 3014 | const base_type = attributed_qt.base(p.comp); | |
| 3015 | std.debug.assert(base_type.type.@"enum".name == enum_ty.name); | |
| 3016 | try p.comp.type_store.set(gpa, .{ .@"enum" = enum_ty }, @intFromEnum(base_type.qt._index)); | |
| 3017 | } | |
| 2702 | 3018 | |
| 2703 | 3019 | // declare a symbol for the type |
| 2704 | 3020 | if (maybe_ident != null and !defined) { |
| 2705 | try p.syms.define(p.gpa, .{ | |
| 3021 | try p.syms.define(gpa, .{ | |
| 2706 | 3022 | .kind = .@"enum", |
| 2707 | 3023 | .name = enum_ty.name, |
| 2708 | .ty = ty, | |
| 3024 | .qt = attributed_qt, | |
| 2709 | 3025 | .tok = maybe_ident.?, |
| 2710 | 3026 | .val = .{}, |
| 2711 | 3027 | }); |
| 2712 | 3028 | } |
| 2713 | 3029 | |
| 2714 | 3030 | // finish by creating a node |
| 2715 | var node: Tree.Node = .{ | |
| 2716 | .tag = .enum_decl_two, | |
| 2717 | .ty = ty, | |
| 2718 | .data = .{ | |
| 2719 | .two = .{ .none, .none }, | |
| 2720 | }, | |
| 2721 | .loc = @enumFromInt(maybe_ident orelse enum_tok), | |
| 2722 | }; | |
| 2723 | switch (field_nodes.len) { | |
| 2724 | 0 => {}, | |
| 2725 | 1 => node.data = .{ .two = .{ field_nodes[0], .none } }, | |
| 2726 | 2 => node.data = .{ .two = .{ field_nodes[0], field_nodes[1] } }, | |
| 2727 | else => { | |
| 2728 | node.tag = .enum_decl; | |
| 2729 | node.data = .{ .range = try p.addList(field_nodes) }; | |
| 2730 | }, | |
| 2731 | } | |
| 2732 | p.decl_buf.items[decl_buf_top - 1] = try p.addNode(node); | |
| 2733 | if (p.func.ty == null) { | |
| 3031 | try p.tree.setNode(.{ .enum_decl = .{ | |
| 3032 | .name_or_kind_tok = maybe_ident orelse enum_tok, | |
| 3033 | .container_qt = attributed_qt, | |
| 3034 | .fields = field_nodes, | |
| 3035 | } }, reserved_index); | |
| 3036 | ||
| 3037 | if (p.func.qt == null) { | |
| 2734 | 3038 | _ = p.tentative_defs.remove(enum_ty.name); |
| 2735 | 3039 | } |
| 2736 | return ty; | |
| 3040 | return attributed_qt; | |
| 2737 | 3041 | } |
| 2738 | 3042 | |
| 2739 | fn checkEnumFixedTy(p: *Parser, fixed_ty: ?Type, ident_tok: TokenIndex, prev: Symbol) !void { | |
| 2740 | const enum_ty = prev.ty.get(.@"enum").?.data.@"enum"; | |
| 2741 | if (fixed_ty) |some| { | |
| 3043 | fn checkEnumFixedTy(p: *Parser, fixed_qt: ?QualType, ident_tok: TokenIndex, prev: Symbol) !void { | |
| 3044 | const enum_ty = prev.qt.get(p.comp, .@"enum").?; | |
| 3045 | if (fixed_qt) |some| { | |
| 2742 | 3046 | if (!enum_ty.fixed) { |
| 2743 | try p.errTok(.enum_prev_nonfixed, ident_tok); | |
| 2744 | try p.errTok(.previous_definition, prev.tok); | |
| 3047 | try p.err(ident_tok, .enum_prev_nonfixed, .{}); | |
| 3048 | try p.err(prev.tok, .previous_definition, .{}); | |
| 2745 | 3049 | return error.ParsingFailed; |
| 2746 | 3050 | } |
| 2747 | 3051 | |
| 2748 | if (!enum_ty.tag_ty.eql(some, p.comp, false)) { | |
| 2749 | const str = try p.typePairStrExtra(some, " (was ", enum_ty.tag_ty); | |
| 2750 | try p.errStr(.enum_different_explicit_ty, ident_tok, str); | |
| 2751 | try p.errTok(.previous_definition, prev.tok); | |
| 3052 | if (!enum_ty.tag.?.eql(some, p.comp)) { | |
| 3053 | try p.err(ident_tok, .enum_different_explicit_ty, .{ some, enum_ty.tag.? }); | |
| 3054 | try p.err(prev.tok, .previous_definition, .{}); | |
| 2752 | 3055 | return error.ParsingFailed; |
| 2753 | 3056 | } |
| 2754 | 3057 | } else if (enum_ty.fixed) { |
| 2755 | try p.errTok(.enum_prev_fixed, ident_tok); | |
| 2756 | try p.errTok(.previous_definition, prev.tok); | |
| 3058 | try p.err(ident_tok, .enum_prev_fixed, .{}); | |
| 3059 | try p.err(prev.tok, .previous_definition, .{}); | |
| 2757 | 3060 | return error.ParsingFailed; |
| 2758 | 3061 | } |
| 2759 | 3062 | } |
| 2760 | 3063 | |
| 2761 | 3064 | const Enumerator = struct { |
| 2762 | res: Result, | |
| 3065 | val: Value = .{}, | |
| 3066 | qt: QualType, | |
| 2763 | 3067 | num_positive_bits: usize = 0, |
| 2764 | 3068 | num_negative_bits: usize = 0, |
| 2765 | 3069 | fixed: bool, |
| 2766 | 3070 | |
| 2767 | fn init(fixed_ty: ?Type) Enumerator { | |
| 3071 | fn init(fixed_ty: ?QualType) Enumerator { | |
| 2768 | 3072 | return .{ |
| 2769 | .res = .{ .ty = fixed_ty orelse .{ .specifier = .int } }, | |
| 3073 | .qt = fixed_ty orelse .int, | |
| 2770 | 3074 | .fixed = fixed_ty != null, |
| 2771 | 3075 | }; |
| 2772 | 3076 | } |
| 2773 | 3077 | |
| 2774 | 3078 | /// Increment enumerator value adjusting type if needed. |
| 2775 | 3079 | fn incr(e: *Enumerator, p: *Parser, tok: TokenIndex) !void { |
| 2776 | e.res.node = .none; | |
| 2777 | const old_val = e.res.val; | |
| 3080 | const old_val = e.val; | |
| 2778 | 3081 | if (old_val.opt_ref == .none) { |
| 2779 | 3082 | // First enumerator, set to 0 fits in all types. |
| 2780 | e.res.val = Value.zero; | |
| 3083 | e.val = .zero; | |
| 2781 | 3084 | return; |
| 2782 | 3085 | } |
| 2783 | if (try e.res.val.add(e.res.val, Value.one, e.res.ty, p.comp)) { | |
| 3086 | if (try e.val.add(e.val, .one, e.qt, p.comp)) { | |
| 2784 | 3087 | if (e.fixed) { |
| 2785 | try p.errStr(.enum_not_representable_fixed, tok, try p.typeStr(e.res.ty)); | |
| 3088 | try p.err(tok, .enum_not_representable_fixed, .{e.qt}); | |
| 2786 | 3089 | return; |
| 2787 | 3090 | } |
| 2788 | const new_ty = if (p.comp.nextLargestIntSameSign(e.res.ty)) |larger| blk: { | |
| 2789 | try p.errTok(.enumerator_overflow, tok); | |
| 2790 | break :blk larger; | |
| 2791 | } else blk: { | |
| 2792 | const signed = !e.res.ty.isUnsignedInt(p.comp); | |
| 2793 | const bit_size: u8 = @intCast(e.res.ty.bitSizeof(p.comp).? - @intFromBool(signed)); | |
| 2794 | try p.errExtra(.enum_not_representable, tok, .{ .pow_2_as_string = bit_size }); | |
| 2795 | break :blk Type{ .specifier = .ulong_long }; | |
| 2796 | }; | |
| 2797 | e.res.ty = new_ty; | |
| 2798 | _ = try e.res.val.add(old_val, Value.one, e.res.ty, p.comp); | |
| 3091 | if (p.comp.nextLargestIntSameSign(e.qt)) |larger| { | |
| 3092 | try p.err(tok, .enumerator_overflow, .{}); | |
| 3093 | e.qt = larger; | |
| 3094 | } else { | |
| 3095 | const signed = e.qt.signedness(p.comp) == .signed; | |
| 3096 | const bit_size = e.qt.bitSizeof(p.comp) - @intFromBool(signed); | |
| 3097 | try p.err(tok, .enum_not_representable, .{switch (bit_size) { | |
| 3098 | 63 => "9223372036854775808", | |
| 3099 | 64 => "18446744073709551616", | |
| 3100 | 127 => "170141183460469231731687303715884105728", | |
| 3101 | 128 => "340282366920938463463374607431768211456", | |
| 3102 | else => unreachable, | |
| 3103 | }}); | |
| 3104 | e.qt = .ulong_long; | |
| 3105 | } | |
| 3106 | _ = try e.val.add(old_val, .one, e.qt, p.comp); | |
| 2799 | 3107 | } |
| 2800 | 3108 | } |
| 2801 | 3109 | |
| 2802 | 3110 | /// Set enumerator value to specified value. |
| 2803 | fn set(e: *Enumerator, p: *Parser, res: Result, tok: TokenIndex) !void { | |
| 2804 | if (res.ty.specifier == .invalid) return; | |
| 2805 | if (e.fixed and !res.ty.eql(e.res.ty, p.comp, false)) { | |
| 2806 | if (!try res.intFitsInType(p, e.res.ty)) { | |
| 2807 | try p.errStr(.enum_not_representable_fixed, tok, try p.typeStr(e.res.ty)); | |
| 3111 | fn set(e: *Enumerator, p: *Parser, res: *Result, tok: TokenIndex) !void { | |
| 3112 | if (res.qt.isInvalid()) return; | |
| 3113 | if (e.fixed and !res.qt.eql(e.qt, p.comp)) { | |
| 3114 | if (!try res.intFitsInType(p, e.qt)) { | |
| 3115 | try p.err(tok, .enum_not_representable_fixed, .{e.qt}); | |
| 2808 | 3116 | return error.ParsingFailed; |
| 2809 | 3117 | } |
| 2810 | var copy = res; | |
| 2811 | copy.ty = e.res.ty; | |
| 2812 | try copy.implicitCast(p, .int_cast); | |
| 2813 | e.res = copy; | |
| 3118 | res.qt = e.qt; | |
| 3119 | try res.implicitCast(p, .int_cast, tok); | |
| 3120 | e.val = res.val; | |
| 2814 | 3121 | } else { |
| 2815 | e.res = res; | |
| 2816 | try e.res.intCast(p, e.res.ty.integerPromotion(p.comp), tok); | |
| 3122 | try res.castToInt(p, res.qt.promoteInt(p.comp), tok); | |
| 3123 | e.qt = res.qt; | |
| 3124 | e.val = res.val; | |
| 2817 | 3125 | } |
| 2818 | 3126 | } |
| 2819 | 3127 | |
| 2820 | fn getTypeSpecifier(e: *const Enumerator, p: *Parser, is_packed: bool, tok: TokenIndex) !Type.Specifier { | |
| 2821 | if (p.comp.fixedEnumTagSpecifier()) |tag_specifier| return tag_specifier; | |
| 3128 | fn getTypeSpecifier(e: *const Enumerator, p: *Parser, is_packed: bool, tok: TokenIndex) !QualType { | |
| 3129 | if (p.comp.fixedEnumTagType()) |tag_specifier| return tag_specifier; | |
| 2822 | 3130 | |
| 2823 | const char_width = (Type{ .specifier = .schar }).sizeof(p.comp).? * 8; | |
| 2824 | const short_width = (Type{ .specifier = .short }).sizeof(p.comp).? * 8; | |
| 2825 | const int_width = (Type{ .specifier = .int }).sizeof(p.comp).? * 8; | |
| 3131 | const char_width = Type.Int.schar.bits(p.comp); | |
| 3132 | const short_width = Type.Int.short.bits(p.comp); | |
| 3133 | const int_width = Type.Int.int.bits(p.comp); | |
| 2826 | 3134 | if (e.num_negative_bits > 0) { |
| 2827 | 3135 | if (is_packed and e.num_negative_bits <= char_width and e.num_positive_bits < char_width) { |
| 2828 | 3136 | return .schar; |
| ... | ... | @@ -2831,13 +3139,13 @@ const Enumerator = struct { |
| 2831 | 3139 | } else if (e.num_negative_bits <= int_width and e.num_positive_bits < int_width) { |
| 2832 | 3140 | return .int; |
| 2833 | 3141 | } |
| 2834 | const long_width = (Type{ .specifier = .long }).sizeof(p.comp).? * 8; | |
| 3142 | const long_width = Type.Int.long.bits(p.comp); | |
| 2835 | 3143 | if (e.num_negative_bits <= long_width and e.num_positive_bits < long_width) { |
| 2836 | 3144 | return .long; |
| 2837 | 3145 | } |
| 2838 | const long_long_width = (Type{ .specifier = .long_long }).sizeof(p.comp).? * 8; | |
| 3146 | const long_long_width = Type.Int.long_long.bits(p.comp); | |
| 2839 | 3147 | if (e.num_negative_bits > long_long_width or e.num_positive_bits >= long_long_width) { |
| 2840 | try p.errTok(.enum_too_large, tok); | |
| 3148 | try p.err(tok, .enum_too_large, .{}); | |
| 2841 | 3149 | } |
| 2842 | 3150 | return .long_long; |
| 2843 | 3151 | } |
| ... | ... | @@ -2847,21 +3155,21 @@ const Enumerator = struct { |
| 2847 | 3155 | return .ushort; |
| 2848 | 3156 | } else if (e.num_positive_bits <= int_width) { |
| 2849 | 3157 | return .uint; |
| 2850 | } else if (e.num_positive_bits <= (Type{ .specifier = .long }).sizeof(p.comp).? * 8) { | |
| 3158 | } else if (e.num_positive_bits <= Type.Int.long.bits(p.comp)) { | |
| 2851 | 3159 | return .ulong; |
| 2852 | 3160 | } |
| 2853 | 3161 | return .ulong_long; |
| 2854 | 3162 | } |
| 2855 | 3163 | }; |
| 2856 | 3164 | |
| 2857 | const EnumFieldAndNode = struct { field: Type.Enum.Field, node: NodeIndex }; | |
| 3165 | const EnumFieldAndNode = struct { field: Type.Enum.Field, node: Node.Index }; | |
| 2858 | 3166 | |
| 2859 | 3167 | /// enumerator : IDENTIFIER ('=' integerConstExpr) |
| 2860 | 3168 | fn enumerator(p: *Parser, e: *Enumerator) Error!?EnumFieldAndNode { |
| 2861 | 3169 | _ = try p.pragma(); |
| 2862 | 3170 | const name_tok = (try p.eatIdentifier()) orelse { |
| 2863 | 3171 | if (p.tok_ids[p.tok_i] == .r_brace) return null; |
| 2864 | try p.err(.expected_identifier); | |
| 3172 | try p.err(p.tok_i, .expected_identifier, .{}); | |
| 2865 | 3173 | p.skipTo(.r_brace); |
| 2866 | 3174 | return error.ParsingFailed; |
| 2867 | 3175 | }; |
| ... | ... | @@ -2869,83 +3177,85 @@ fn enumerator(p: *Parser, e: *Enumerator) Error!?EnumFieldAndNode { |
| 2869 | 3177 | defer p.attr_buf.len = attr_buf_top; |
| 2870 | 3178 | try p.attributeSpecifier(); |
| 2871 | 3179 | |
| 2872 | const err_start = p.comp.diagnostics.list.items.len; | |
| 2873 | if (p.eatToken(.equal)) |_| { | |
| 2874 | const specified = try p.integerConstExpr(.gnu_folding_extension); | |
| 3180 | const prev_total = p.diagnostics.total; | |
| 3181 | const field_init = if (p.eatToken(.equal)) |_| blk: { | |
| 3182 | var specified = try p.integerConstExpr(.gnu_folding_extension); | |
| 2875 | 3183 | if (specified.val.opt_ref == .none) { |
| 2876 | try p.errTok(.enum_val_unavailable, name_tok + 2); | |
| 3184 | try p.err(name_tok + 2, .enum_val_unavailable, .{}); | |
| 2877 | 3185 | try e.incr(p, name_tok); |
| 3186 | break :blk null; | |
| 2878 | 3187 | } else { |
| 2879 | try e.set(p, specified, name_tok); | |
| 3188 | try e.set(p, &specified, name_tok); | |
| 3189 | break :blk specified.node; | |
| 2880 | 3190 | } |
| 2881 | } else { | |
| 3191 | } else blk: { | |
| 2882 | 3192 | try e.incr(p, name_tok); |
| 2883 | } | |
| 2884 | ||
| 2885 | var res = e.res; | |
| 2886 | res.ty = try Attribute.applyEnumeratorAttributes(p, res.ty, attr_buf_top); | |
| 3193 | break :blk null; | |
| 3194 | }; | |
| 2887 | 3195 | |
| 2888 | if (res.ty.isUnsignedInt(p.comp) or res.val.compare(.gte, Value.zero, p.comp)) { | |
| 2889 | e.num_positive_bits = @max(e.num_positive_bits, res.val.minUnsignedBits(p.comp)); | |
| 3196 | if (e.qt.signedness(p.comp) == .unsigned or e.val.compare(.gte, .zero, p.comp)) { | |
| 3197 | e.num_positive_bits = @max(e.num_positive_bits, e.val.minUnsignedBits(p.comp)); | |
| 2890 | 3198 | } else { |
| 2891 | e.num_negative_bits = @max(e.num_negative_bits, res.val.minSignedBits(p.comp)); | |
| 3199 | e.num_negative_bits = @max(e.num_negative_bits, e.val.minSignedBits(p.comp)); | |
| 2892 | 3200 | } |
| 2893 | 3201 | |
| 2894 | if (err_start == p.comp.diagnostics.list.items.len) { | |
| 3202 | if (prev_total == p.diagnostics.total) { | |
| 2895 | 3203 | // only do these warnings if we didn't already warn about overflow or non-representable values |
| 2896 | if (e.res.val.compare(.lt, Value.zero, p.comp)) { | |
| 2897 | const min_val = try Value.minInt(Type.int, p.comp); | |
| 2898 | if (e.res.val.compare(.lt, min_val, p.comp)) { | |
| 2899 | try p.errStr(.enumerator_too_small, name_tok, try e.res.str(p)); | |
| 3204 | if (e.val.compare(.lt, .zero, p.comp)) { | |
| 3205 | const min_val = try Value.minInt(.int, p.comp); | |
| 3206 | if (e.val.compare(.lt, min_val, p.comp)) { | |
| 3207 | try p.err(name_tok, .enumerator_too_small, .{e}); | |
| 2900 | 3208 | } |
| 2901 | 3209 | } else { |
| 2902 | const max_val = try Value.maxInt(Type.int, p.comp); | |
| 2903 | if (e.res.val.compare(.gt, max_val, p.comp)) { | |
| 2904 | try p.errStr(.enumerator_too_large, name_tok, try e.res.str(p)); | |
| 3210 | const max_val = try Value.maxInt(.int, p.comp); | |
| 3211 | if (e.val.compare(.gt, max_val, p.comp)) { | |
| 3212 | try p.err(name_tok, .enumerator_too_large, .{e}); | |
| 2905 | 3213 | } |
| 2906 | 3214 | } |
| 2907 | 3215 | } |
| 2908 | 3216 | |
| 2909 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(name_tok)); | |
| 2910 | try p.syms.defineEnumeration(p, interned_name, res.ty, name_tok, e.res.val); | |
| 3217 | const attributed_qt = try Attribute.applyEnumeratorAttributes(p, e.qt, attr_buf_top); | |
| 2911 | 3218 | const node = try p.addNode(.{ |
| 2912 | .tag = .enum_field_decl, | |
| 2913 | .ty = res.ty, | |
| 2914 | .data = .{ .decl = .{ | |
| 2915 | .name = name_tok, | |
| 2916 | .node = res.node, | |
| 2917 | } }, | |
| 2918 | .loc = @enumFromInt(name_tok), | |
| 3219 | .enum_field = .{ | |
| 3220 | .name_tok = name_tok, | |
| 3221 | .qt = attributed_qt, | |
| 3222 | .init = field_init, | |
| 3223 | }, | |
| 2919 | 3224 | }); |
| 2920 | try p.value_map.put(node, e.res.val); | |
| 2921 | return EnumFieldAndNode{ .field = .{ | |
| 3225 | try p.tree.value_map.put(p.comp.gpa, node, e.val); | |
| 3226 | ||
| 3227 | const interned_name = try p.comp.internString(p.tokSlice(name_tok)); | |
| 3228 | try p.syms.defineEnumeration(p, interned_name, attributed_qt, name_tok, e.val, node); | |
| 3229 | ||
| 3230 | return .{ .field = .{ | |
| 2922 | 3231 | .name = interned_name, |
| 2923 | .ty = res.ty, | |
| 3232 | .qt = attributed_qt, | |
| 2924 | 3233 | .name_tok = name_tok, |
| 2925 | .node = res.node, | |
| 2926 | 3234 | }, .node = node }; |
| 2927 | 3235 | } |
| 2928 | 3236 | |
| 2929 | 3237 | /// typeQual : keyword_const | keyword_restrict | keyword_volatile | keyword_atomic |
| 2930 | fn typeQual(p: *Parser, b: *Type.Qualifiers.Builder) Error!bool { | |
| 3238 | fn typeQual(p: *Parser, b: *TypeStore.Builder, allow_attr: bool) Error!bool { | |
| 2931 | 3239 | var any = false; |
| 2932 | 3240 | while (true) { |
| 3241 | if (allow_attr and try p.msTypeAttribute()) continue; | |
| 3242 | if (allow_attr) try p.attributeSpecifier(); | |
| 2933 | 3243 | switch (p.tok_ids[p.tok_i]) { |
| 2934 | 3244 | .keyword_restrict, .keyword_restrict1, .keyword_restrict2 => { |
| 2935 | 3245 | if (b.restrict != null) |
| 2936 | try p.errStr(.duplicate_decl_spec, p.tok_i, "restrict") | |
| 3246 | try p.err(p.tok_i, .duplicate_decl_spec, .{"restrict"}) | |
| 2937 | 3247 | else |
| 2938 | 3248 | b.restrict = p.tok_i; |
| 2939 | 3249 | }, |
| 2940 | 3250 | .keyword_const, .keyword_const1, .keyword_const2 => { |
| 2941 | 3251 | if (b.@"const" != null) |
| 2942 | try p.errStr(.duplicate_decl_spec, p.tok_i, "const") | |
| 3252 | try p.err(p.tok_i, .duplicate_decl_spec, .{"const"}) | |
| 2943 | 3253 | else |
| 2944 | 3254 | b.@"const" = p.tok_i; |
| 2945 | 3255 | }, |
| 2946 | 3256 | .keyword_volatile, .keyword_volatile1, .keyword_volatile2 => { |
| 2947 | 3257 | if (b.@"volatile" != null) |
| 2948 | try p.errStr(.duplicate_decl_spec, p.tok_i, "volatile") | |
| 3258 | try p.err(p.tok_i, .duplicate_decl_spec, .{"volatile"}) | |
| 2949 | 3259 | else |
| 2950 | 3260 | b.@"volatile" = p.tok_i; |
| 2951 | 3261 | }, |
| ... | ... | @@ -2953,10 +3263,51 @@ fn typeQual(p: *Parser, b: *Type.Qualifiers.Builder) Error!bool { |
| 2953 | 3263 | // _Atomic(typeName) instead of just _Atomic |
| 2954 | 3264 | if (p.tok_ids[p.tok_i + 1] == .l_paren) break; |
| 2955 | 3265 | if (b.atomic != null) |
| 2956 | try p.errStr(.duplicate_decl_spec, p.tok_i, "atomic") | |
| 3266 | try p.err(p.tok_i, .duplicate_decl_spec, .{"atomic"}) | |
| 2957 | 3267 | else |
| 2958 | 3268 | b.atomic = p.tok_i; |
| 2959 | 3269 | }, |
| 3270 | .keyword_unaligned, .keyword_unaligned2 => { | |
| 3271 | if (b.unaligned != null) | |
| 3272 | try p.err(p.tok_i, .duplicate_decl_spec, .{"__unaligned"}) | |
| 3273 | else | |
| 3274 | b.unaligned = p.tok_i; | |
| 3275 | }, | |
| 3276 | .keyword_nonnull, .keyword_nullable, .keyword_nullable_result, .keyword_null_unspecified => |tok_id| { | |
| 3277 | const sym_str = p.tok_ids[p.tok_i].symbol(); | |
| 3278 | try p.err(p.tok_i, .nullability_extension, .{sym_str}); | |
| 3279 | const new: @FieldType(TypeStore.Builder, "nullability") = switch (tok_id) { | |
| 3280 | .keyword_nonnull => .{ .nonnull = p.tok_i }, | |
| 3281 | .keyword_nullable => .{ .nullable = p.tok_i }, | |
| 3282 | .keyword_nullable_result => .{ .nullable_result = p.tok_i }, | |
| 3283 | .keyword_null_unspecified => .{ .null_unspecified = p.tok_i }, | |
| 3284 | else => unreachable, | |
| 3285 | }; | |
| 3286 | if (std.meta.activeTag(b.nullability) == new) { | |
| 3287 | try p.err(p.tok_i, .duplicate_nullability, .{sym_str}); | |
| 3288 | } else switch (b.nullability) { | |
| 3289 | .none => { | |
| 3290 | b.nullability = new; | |
| 3291 | try p.attr_buf.append(p.comp.gpa, .{ | |
| 3292 | .attr = .{ .tag = .nullability, .args = .{ | |
| 3293 | .nullability = .{ .kind = switch (tok_id) { | |
| 3294 | .keyword_nonnull => .nonnull, | |
| 3295 | .keyword_nullable => .nullable, | |
| 3296 | .keyword_nullable_result => .nullable_result, | |
| 3297 | .keyword_null_unspecified => .unspecified, | |
| 3298 | else => unreachable, | |
| 3299 | } }, | |
| 3300 | }, .syntax = .keyword }, | |
| 3301 | .tok = p.tok_i, | |
| 3302 | }); | |
| 3303 | }, | |
| 3304 | .nonnull, | |
| 3305 | .nullable, | |
| 3306 | .nullable_result, | |
| 3307 | .null_unspecified, | |
| 3308 | => |prev| try p.err(p.tok_i, .conflicting_nullability, .{ p.tok_ids[p.tok_i], p.tok_ids[prev] }), | |
| 3309 | } | |
| 3310 | }, | |
| 2960 | 3311 | else => break, |
| 2961 | 3312 | } |
| 2962 | 3313 | p.tok_i += 1; |
| ... | ... | @@ -2965,61 +3316,271 @@ fn typeQual(p: *Parser, b: *Type.Qualifiers.Builder) Error!bool { |
| 2965 | 3316 | return any; |
| 2966 | 3317 | } |
| 2967 | 3318 | |
| 2968 | const Declarator = struct { | |
| 2969 | name: TokenIndex, | |
| 2970 | ty: Type, | |
| 2971 | func_declarator: ?TokenIndex = null, | |
| 2972 | old_style_func: ?TokenIndex = null, | |
| 2973 | }; | |
| 2974 | const DeclaratorKind = enum { normal, abstract, param, record }; | |
| 2975 | ||
| 2976 | /// declarator : pointer? (IDENTIFIER | '(' declarator ')') directDeclarator* | |
| 3319 | fn msTypeAttribute(p: *Parser) !bool { | |
| 3320 | var any = false; | |
| 3321 | while (true) { | |
| 3322 | switch (p.tok_ids[p.tok_i]) { | |
| 3323 | .keyword_stdcall, | |
| 3324 | .keyword_stdcall2, | |
| 3325 | .keyword_thiscall, | |
| 3326 | .keyword_thiscall2, | |
| 3327 | .keyword_vectorcall, | |
| 3328 | .keyword_vectorcall2, | |
| 3329 | .keyword_fastcall, | |
| 3330 | .keyword_fastcall2, | |
| 3331 | .keyword_regcall, | |
| 3332 | .keyword_cdecl, | |
| 3333 | .keyword_cdecl2, | |
| 3334 | => { | |
| 3335 | try p.attr_buf.append(p.comp.gpa, .{ | |
| 3336 | .attr = .{ .tag = .calling_convention, .args = .{ | |
| 3337 | .calling_convention = .{ .cc = switch (p.tok_ids[p.tok_i]) { | |
| 3338 | .keyword_stdcall, | |
| 3339 | .keyword_stdcall2, | |
| 3340 | => .stdcall, | |
| 3341 | .keyword_thiscall, | |
| 3342 | .keyword_thiscall2, | |
| 3343 | => .thiscall, | |
| 3344 | .keyword_vectorcall, | |
| 3345 | .keyword_vectorcall2, | |
| 3346 | => .vectorcall, | |
| 3347 | .keyword_fastcall, | |
| 3348 | .keyword_fastcall2, | |
| 3349 | => .fastcall, | |
| 3350 | .keyword_regcall, | |
| 3351 | => .regcall, | |
| 3352 | .keyword_cdecl, | |
| 3353 | .keyword_cdecl2, | |
| 3354 | => .c, | |
| 3355 | else => unreachable, | |
| 3356 | } }, | |
| 3357 | }, .syntax = .keyword }, | |
| 3358 | .tok = p.tok_i, | |
| 3359 | }); | |
| 3360 | any = true; | |
| 3361 | p.tok_i += 1; | |
| 3362 | }, | |
| 3363 | else => break, | |
| 3364 | } | |
| 3365 | } | |
| 3366 | return any; | |
| 3367 | } | |
| 3368 | ||
| 3369 | const Declarator = struct { | |
| 3370 | name: TokenIndex, | |
| 3371 | qt: QualType, | |
| 3372 | old_style_func: ?TokenIndex = null, | |
| 3373 | ||
| 3374 | /// What kind of a type did this declarator declare? | |
| 3375 | /// Used redundantly with `qt` in case it was set to `.invalid` by `validate`. | |
| 3376 | declarator_type: enum { other, func, array, pointer } = .other, | |
| 3377 | ||
| 3378 | const Kind = enum { normal, abstract, param, record }; | |
| 3379 | ||
| 3380 | fn validate(d: *Declarator, p: *Parser, source_tok: TokenIndex) Parser.Error!void { | |
| 3381 | switch (try validateExtra(p, d.qt, source_tok)) { | |
| 3382 | .normal => return, | |
| 3383 | .nested_invalid => if (d.declarator_type == .func) return, | |
| 3384 | .nested_auto => { | |
| 3385 | if (d.declarator_type == .func) return; | |
| 3386 | if (d.qt.isAutoType() or d.qt.isC23Auto()) return; | |
| 3387 | }, | |
| 3388 | .declarator_combine => return, | |
| 3389 | } | |
| 3390 | d.qt = .invalid; | |
| 3391 | } | |
| 3392 | ||
| 3393 | const ValidationResult = enum { | |
| 3394 | nested_invalid, | |
| 3395 | nested_auto, | |
| 3396 | declarator_combine, | |
| 3397 | normal, | |
| 3398 | }; | |
| 3399 | ||
| 3400 | fn validateExtra(p: *Parser, cur: QualType, source_tok: TokenIndex) Parser.Error!ValidationResult { | |
| 3401 | if (cur.isInvalid()) return .nested_invalid; | |
| 3402 | if (cur.isAutoType()) return .nested_auto; | |
| 3403 | if (cur.isC23Auto()) return .nested_auto; | |
| 3404 | if (cur._index == .declarator_combine) return .declarator_combine; | |
| 3405 | ||
| 3406 | switch (cur.type(p.comp)) { | |
| 3407 | .pointer => |pointer_ty| { | |
| 3408 | return validateExtra(p, pointer_ty.child, source_tok); | |
| 3409 | }, | |
| 3410 | .atomic => |atomic_ty| { | |
| 3411 | return validateExtra(p, atomic_ty, source_tok); | |
| 3412 | }, | |
| 3413 | .array => |array_ty| { | |
| 3414 | const elem_qt = array_ty.elem; | |
| 3415 | const child_res = try validateExtra(p, elem_qt, source_tok); | |
| 3416 | if (child_res != .normal) return child_res; | |
| 3417 | ||
| 3418 | if (elem_qt.hasIncompleteSize(p.comp)) { | |
| 3419 | try p.err(source_tok, .array_incomplete_elem, .{elem_qt}); | |
| 3420 | return .nested_invalid; | |
| 3421 | } | |
| 3422 | switch (array_ty.len) { | |
| 3423 | .fixed, .static => |len| { | |
| 3424 | const elem_size = elem_qt.sizeofOrNull(p.comp) orelse 1; | |
| 3425 | const max_elems = p.comp.maxArrayBytes() / @max(1, elem_size); | |
| 3426 | if (len > max_elems) { | |
| 3427 | try p.err(source_tok, .array_too_large, .{}); | |
| 3428 | return .nested_invalid; | |
| 3429 | } | |
| 3430 | }, | |
| 3431 | else => {}, | |
| 3432 | } | |
| 3433 | ||
| 3434 | if (elem_qt.is(p.comp, .func)) { | |
| 3435 | try p.err(source_tok, .array_func_elem, .{}); | |
| 3436 | return .nested_invalid; | |
| 3437 | } | |
| 3438 | if (elem_qt.get(p.comp, .array)) |elem_array_ty| { | |
| 3439 | if (elem_array_ty.len == .static) { | |
| 3440 | try p.err(source_tok, .static_non_outermost_array, .{}); | |
| 3441 | } | |
| 3442 | if (elem_qt.isQualified()) { | |
| 3443 | try p.err(source_tok, .qualifier_non_outermost_array, .{}); | |
| 3444 | } | |
| 3445 | } | |
| 3446 | return .normal; | |
| 3447 | }, | |
| 3448 | .func => |func_ty| { | |
| 3449 | const ret_qt = func_ty.return_type; | |
| 3450 | const child_res = try validateExtra(p, ret_qt, source_tok); | |
| 3451 | if (child_res != .normal) return child_res; | |
| 3452 | ||
| 3453 | if (ret_qt.is(p.comp, .array)) try p.err(source_tok, .func_cannot_return_array, .{}); | |
| 3454 | if (ret_qt.is(p.comp, .func)) try p.err(source_tok, .func_cannot_return_func, .{}); | |
| 3455 | if (ret_qt.@"const") { | |
| 3456 | try p.err(source_tok, .qual_on_ret_type, .{"const"}); | |
| 3457 | } | |
| 3458 | if (ret_qt.@"volatile") { | |
| 3459 | try p.err(source_tok, .qual_on_ret_type, .{"volatile"}); | |
| 3460 | } | |
| 3461 | if (ret_qt.get(p.comp, .float)) |float| { | |
| 3462 | if (float == .fp16 and !p.comp.hasHalfPrecisionFloatABI()) { | |
| 3463 | try p.err(source_tok, .suggest_pointer_for_invalid_fp16, .{"function return value"}); | |
| 3464 | } | |
| 3465 | } | |
| 3466 | return .normal; | |
| 3467 | }, | |
| 3468 | else => return .normal, | |
| 3469 | } | |
| 3470 | } | |
| 3471 | }; | |
| 3472 | ||
| 3473 | /// declarator : pointer? (IDENTIFIER | '(' declarator ')') directDeclarator* | |
| 2977 | 3474 | /// abstractDeclarator |
| 2978 | 3475 | /// : pointer? ('(' abstractDeclarator ')')? directAbstractDeclarator* |
| 3476 | /// pointer : '*' typeQual* pointer? | |
| 2979 | 3477 | fn declarator( |
| 2980 | 3478 | p: *Parser, |
| 2981 | base_type: Type, | |
| 2982 | kind: DeclaratorKind, | |
| 3479 | base_qt: QualType, | |
| 3480 | kind: Declarator.Kind, | |
| 2983 | 3481 | ) Error!?Declarator { |
| 2984 | const start = p.tok_i; | |
| 2985 | var d = Declarator{ .name = 0, .ty = try p.pointer(base_type) }; | |
| 2986 | if (base_type.is(.auto_type) and !d.ty.is(.auto_type)) { | |
| 2987 | try p.errTok(.auto_type_requires_plain_declarator, start); | |
| 2988 | return error.ParsingFailed; | |
| 3482 | var d = Declarator{ .name = 0, .qt = base_qt }; | |
| 3483 | ||
| 3484 | // Parse potential pointer declarators first. | |
| 3485 | while (p.eatToken(.asterisk)) |_| { | |
| 3486 | d.declarator_type = .pointer; | |
| 3487 | var builder: TypeStore.Builder = .{ .parser = p }; | |
| 3488 | _ = try p.typeQual(&builder, true); | |
| 3489 | ||
| 3490 | const pointer_qt = try p.comp.type_store.put(p.comp.gpa, .{ .pointer = .{ | |
| 3491 | .child = d.qt, | |
| 3492 | .decayed = null, | |
| 3493 | } }); | |
| 3494 | d.qt = try builder.finishQuals(pointer_qt); | |
| 2989 | 3495 | } |
| 2990 | 3496 | |
| 2991 | 3497 | const maybe_ident = p.tok_i; |
| 2992 | 3498 | if (kind != .abstract and (try p.eatIdentifier()) != null) { |
| 2993 | 3499 | d.name = maybe_ident; |
| 2994 | 3500 | const combine_tok = p.tok_i; |
| 2995 | d.ty = try p.directDeclarator(d.ty, &d, kind); | |
| 2996 | try d.ty.validateCombinedType(p, combine_tok); | |
| 3501 | d.qt = try p.directDeclarator(&d, kind); | |
| 3502 | try d.validate(p, combine_tok); | |
| 2997 | 3503 | return d; |
| 2998 | 3504 | } else if (p.eatToken(.l_paren)) |l_paren| blk: { |
| 2999 | var res = (try p.declarator(.{ .specifier = .void }, kind)) orelse { | |
| 3505 | // C23 and declspec attributes are not allowed here | |
| 3506 | while (try p.gnuAttribute()) {} | |
| 3507 | ||
| 3508 | // Parse Microsoft keyword type attributes. | |
| 3509 | _ = try p.msTypeAttribute(); | |
| 3510 | ||
| 3511 | const special_marker: QualType = .{ ._index = .declarator_combine }; | |
| 3512 | var res = (try p.declarator(special_marker, kind)) orelse { | |
| 3000 | 3513 | p.tok_i = l_paren; |
| 3001 | 3514 | break :blk; |
| 3002 | 3515 | }; |
| 3003 | 3516 | try p.expectClosing(l_paren, .r_paren); |
| 3004 | 3517 | const suffix_start = p.tok_i; |
| 3005 | const outer = try p.directDeclarator(d.ty, &d, kind); | |
| 3006 | try res.ty.combine(outer); | |
| 3007 | try res.ty.validateCombinedType(p, suffix_start); | |
| 3008 | res.old_style_func = d.old_style_func; | |
| 3009 | if (d.func_declarator) |some| res.func_declarator = some; | |
| 3518 | const outer = try p.directDeclarator(&d, kind); | |
| 3519 | ||
| 3520 | // Correct the base type now that it is known. | |
| 3521 | // If res.qt is the special marker there was no inner type. | |
| 3522 | if (res.qt._index == .declarator_combine) { | |
| 3523 | res.qt = outer; | |
| 3524 | res.declarator_type = d.declarator_type; | |
| 3525 | } else if (outer.isInvalid() or res.qt.isInvalid()) { | |
| 3526 | res.qt = outer; | |
| 3527 | } else { | |
| 3528 | var cur = res.qt; | |
| 3529 | while (true) { | |
| 3530 | switch (cur.type(p.comp)) { | |
| 3531 | .pointer => |pointer_ty| if (pointer_ty.child._index != .declarator_combine) { | |
| 3532 | cur = pointer_ty.child; | |
| 3533 | continue; | |
| 3534 | }, | |
| 3535 | .atomic => |atomic_ty| if (atomic_ty._index != .declarator_combine) { | |
| 3536 | cur = atomic_ty; | |
| 3537 | continue; | |
| 3538 | }, | |
| 3539 | .array => |array_ty| if (array_ty.elem._index != .declarator_combine) { | |
| 3540 | cur = array_ty.elem; | |
| 3541 | continue; | |
| 3542 | }, | |
| 3543 | .func => |func_ty| if (func_ty.return_type._index != .declarator_combine) { | |
| 3544 | cur = func_ty.return_type; | |
| 3545 | continue; | |
| 3546 | }, | |
| 3547 | else => unreachable, | |
| 3548 | } | |
| 3549 | // Child type is always stored in repr.data[0] | |
| 3550 | p.comp.type_store.types.items(.data)[@intFromEnum(cur._index)][0] = @bitCast(outer); | |
| 3551 | break; | |
| 3552 | } | |
| 3553 | } | |
| 3554 | ||
| 3555 | try res.validate(p, suffix_start); | |
| 3010 | 3556 | return res; |
| 3011 | 3557 | } |
| 3012 | 3558 | |
| 3013 | 3559 | const expected_ident = p.tok_i; |
| 3014 | 3560 | |
| 3015 | d.ty = try p.directDeclarator(d.ty, &d, kind); | |
| 3016 | ||
| 3017 | if (kind == .normal and !d.ty.isEnumOrRecord()) { | |
| 3018 | try p.errTok(.expected_ident_or_l_paren, expected_ident); | |
| 3019 | return error.ParsingFailed; | |
| 3561 | d.qt = try p.directDeclarator(&d, kind); | |
| 3562 | if (kind == .normal) { | |
| 3563 | var cur = d.qt; | |
| 3564 | while (true) { | |
| 3565 | // QualType.base inlined here because of potential | |
| 3566 | // .declarator_combine. | |
| 3567 | if (cur._index == .declarator_combine) break; | |
| 3568 | switch (cur.type(p.comp)) { | |
| 3569 | .typeof => |typeof_ty| cur = typeof_ty.base, | |
| 3570 | .typedef => |typedef_ty| cur = typedef_ty.base, | |
| 3571 | .attributed => |attributed_ty| cur = attributed_ty.base, | |
| 3572 | else => |ty| switch (ty) { | |
| 3573 | .@"enum", .@"struct", .@"union" => break, | |
| 3574 | else => { | |
| 3575 | try p.err(expected_ident, .expected_ident_or_l_paren, .{}); | |
| 3576 | return error.ParsingFailed; | |
| 3577 | }, | |
| 3578 | }, | |
| 3579 | } | |
| 3580 | } | |
| 3020 | 3581 | } |
| 3021 | try d.ty.validateCombinedType(p, expected_ident); | |
| 3022 | if (start == p.tok_i) return null; | |
| 3582 | try d.validate(p, expected_ident); | |
| 3583 | if (d.qt == base_qt) return null; | |
| 3023 | 3584 | return d; |
| 3024 | 3585 | } |
| 3025 | 3586 | |
| ... | ... | @@ -3036,212 +3597,192 @@ fn declarator( |
| 3036 | 3597 | /// | '[' typeQual+ keyword_static assignExpr ']' |
| 3037 | 3598 | /// | '[' '*' ']' |
| 3038 | 3599 | /// | '(' paramDecls? ')' |
| 3039 | fn directDeclarator(p: *Parser, base_type: Type, d: *Declarator, kind: DeclaratorKind) Error!Type { | |
| 3600 | fn directDeclarator( | |
| 3601 | p: *Parser, | |
| 3602 | base_declarator: *Declarator, | |
| 3603 | kind: Declarator.Kind, | |
| 3604 | ) Error!QualType { | |
| 3605 | const gpa = p.comp.gpa; | |
| 3040 | 3606 | if (p.eatToken(.l_bracket)) |l_bracket| { |
| 3607 | // Check for C23 attribute | |
| 3041 | 3608 | if (p.tok_ids[p.tok_i] == .l_bracket) { |
| 3042 | 3609 | switch (kind) { |
| 3043 | 3610 | .normal, .record => if (p.comp.langopts.standard.atLeast(.c23)) { |
| 3044 | 3611 | p.tok_i -= 1; |
| 3045 | return base_type; | |
| 3612 | return base_declarator.qt; | |
| 3046 | 3613 | }, |
| 3047 | 3614 | .param, .abstract => {}, |
| 3048 | 3615 | } |
| 3049 | try p.err(.expected_expr); | |
| 3616 | try p.err(p.tok_i, .expected_expr, .{}); | |
| 3050 | 3617 | return error.ParsingFailed; |
| 3051 | 3618 | } |
| 3052 | var res_ty = Type{ | |
| 3053 | // so that we can get any restrict type that might be present | |
| 3054 | .specifier = .pointer, | |
| 3055 | }; | |
| 3056 | var quals = Type.Qualifiers.Builder{}; | |
| 3057 | 3619 | |
| 3058 | var got_quals = try p.typeQual(&quals); | |
| 3620 | var builder: TypeStore.Builder = .{ .parser = p }; | |
| 3621 | ||
| 3622 | var got_quals = try p.typeQual(&builder, false); | |
| 3059 | 3623 | var static = p.eatToken(.keyword_static); |
| 3060 | if (static != null and !got_quals) got_quals = try p.typeQual(&quals); | |
| 3624 | if (static != null and !got_quals) got_quals = try p.typeQual(&builder, false); | |
| 3061 | 3625 | var star = p.eatToken(.asterisk); |
| 3062 | 3626 | const size_tok = p.tok_i; |
| 3063 | 3627 | |
| 3064 | 3628 | const const_decl_folding = p.const_decl_folding; |
| 3065 | 3629 | p.const_decl_folding = .gnu_vla_folding_extension; |
| 3066 | const size = if (star) |_| Result{} else try p.assignExpr(); | |
| 3630 | const opt_size = if (star) |_| null else try p.assignExpr(); | |
| 3067 | 3631 | p.const_decl_folding = const_decl_folding; |
| 3068 | 3632 | |
| 3069 | 3633 | try p.expectClosing(l_bracket, .r_bracket); |
| 3070 | 3634 | |
| 3071 | 3635 | if (star != null and static != null) { |
| 3072 | try p.errTok(.invalid_static_star, static.?); | |
| 3636 | try p.err(static.?, .invalid_static_star, .{}); | |
| 3073 | 3637 | static = null; |
| 3074 | 3638 | } |
| 3075 | 3639 | if (kind != .param) { |
| 3076 | 3640 | if (static != null) |
| 3077 | try p.errTok(.static_non_param, l_bracket) | |
| 3641 | try p.err(l_bracket, .static_non_param, .{}) | |
| 3078 | 3642 | else if (got_quals) |
| 3079 | try p.errTok(.array_qualifiers, l_bracket); | |
| 3080 | if (star) |some| try p.errTok(.star_non_param, some); | |
| 3643 | try p.err(l_bracket, .array_qualifiers, .{}); | |
| 3644 | if (star) |some| try p.err(some, .star_non_param, .{}); | |
| 3081 | 3645 | static = null; |
| 3082 | quals = .{}; | |
| 3646 | builder = .{ .parser = p }; | |
| 3083 | 3647 | star = null; |
| 3084 | } else { | |
| 3085 | try quals.finish(p, &res_ty); | |
| 3086 | 3648 | } |
| 3087 | if (static) |_| try size.expect(p); | |
| 3649 | if (static) |_| _ = try p.expectResult(opt_size); | |
| 3088 | 3650 | |
| 3089 | if (base_type.is(.auto_type)) { | |
| 3090 | try p.errStr(.array_of_auto_type, d.name, p.tokSlice(d.name)); | |
| 3091 | return error.ParsingFailed; | |
| 3092 | } | |
| 3651 | const outer = try p.directDeclarator(base_declarator, kind); | |
| 3093 | 3652 | |
| 3094 | const outer = try p.directDeclarator(base_type, d, kind); | |
| 3653 | // Set after call to `directDeclarator` since we will return an | |
| 3654 | // array type from here. | |
| 3655 | base_declarator.declarator_type = .array; | |
| 3095 | 3656 | |
| 3096 | if (!size.ty.isInt()) { | |
| 3097 | try p.errStr(.array_size_non_int, size_tok, try p.typeStr(size.ty)); | |
| 3657 | if (opt_size != null and !opt_size.?.qt.isInvalid() and !opt_size.?.qt.isRealInt(p.comp)) { | |
| 3658 | try p.err(size_tok, .array_size_non_int, .{opt_size.?.qt}); | |
| 3098 | 3659 | return error.ParsingFailed; |
| 3099 | 3660 | } |
| 3100 | if (base_type.is(.c23_auto) or outer.is(.invalid)) { | |
| 3101 | // issue error later | |
| 3102 | return Type.invalid; | |
| 3103 | } else if (size.val.opt_ref == .none) { | |
| 3104 | if (size.node != .none) { | |
| 3105 | try p.errTok(.vla, size_tok); | |
| 3106 | if (p.func.ty == null and kind != .param and p.record.kind == .invalid) { | |
| 3107 | try p.errTok(.variable_len_array_file_scope, d.name); | |
| 3661 | ||
| 3662 | if (opt_size) |size| { | |
| 3663 | if (size.val.opt_ref == .none) { | |
| 3664 | try p.err(size_tok, .vla, .{}); | |
| 3665 | if (p.func.qt == null and kind != .param and p.record.kind == .invalid) { | |
| 3666 | try p.err(base_declarator.name, .variable_len_array_file_scope, .{}); | |
| 3108 | 3667 | } |
| 3109 | const expr_ty = try p.arena.create(Type.Expr); | |
| 3110 | expr_ty.ty = .{ .specifier = .void }; | |
| 3111 | expr_ty.node = size.node; | |
| 3112 | res_ty.data = .{ .expr = expr_ty }; | |
| 3113 | res_ty.specifier = .variable_len_array; | |
| 3114 | ||
| 3115 | if (static) |some| try p.errTok(.useless_static, some); | |
| 3116 | } else if (star) |_| { | |
| 3117 | const elem_ty = try p.arena.create(Type); | |
| 3118 | elem_ty.* = .{ .specifier = .void }; | |
| 3119 | res_ty.data = .{ .sub_type = elem_ty }; | |
| 3120 | res_ty.specifier = .unspecified_variable_len_array; | |
| 3668 | ||
| 3669 | const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 3670 | .elem = outer, | |
| 3671 | .len = .{ .variable = size.node }, | |
| 3672 | } }); | |
| 3673 | ||
| 3674 | if (static) |some| try p.err(some, .useless_static, .{}); | |
| 3675 | return builder.finishQuals(array_qt); | |
| 3121 | 3676 | } else { |
| 3122 | const arr_ty = try p.arena.create(Type.Array); | |
| 3123 | arr_ty.elem = .{ .specifier = .void }; | |
| 3124 | arr_ty.len = 0; | |
| 3125 | res_ty.data = .{ .array = arr_ty }; | |
| 3126 | res_ty.specifier = .incomplete_array; | |
| 3127 | } | |
| 3677 | if (size.val.isZero(p.comp)) { | |
| 3678 | try p.err(l_bracket, .zero_length_array, .{}); | |
| 3679 | } else if (size.val.compare(.lt, .zero, p.comp)) { | |
| 3680 | try p.err(l_bracket, .negative_array_size, .{}); | |
| 3681 | return error.ParsingFailed; | |
| 3682 | } | |
| 3683 | ||
| 3684 | const len = size.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); | |
| 3685 | const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 3686 | .elem = outer, | |
| 3687 | .len = if (static != null) | |
| 3688 | .{ .static = len } | |
| 3689 | else | |
| 3690 | .{ .fixed = len }, | |
| 3691 | } }); | |
| 3692 | return builder.finishQuals(array_qt); | |
| 3693 | } | |
| 3694 | } else if (star) |_| { | |
| 3695 | const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 3696 | .elem = outer, | |
| 3697 | .len = .unspecified_variable, | |
| 3698 | } }); | |
| 3699 | return builder.finishQuals(array_qt); | |
| 3128 | 3700 | } else { |
| 3129 | // `outer` is validated later so it may be invalid here | |
| 3130 | const outer_size = outer.sizeof(p.comp); | |
| 3131 | const max_elems = p.comp.maxArrayBytes() / @max(1, outer_size orelse 1); | |
| 3132 | ||
| 3133 | var size_val = size.val; | |
| 3134 | if (size_val.isZero(p.comp)) { | |
| 3135 | try p.errTok(.zero_length_array, l_bracket); | |
| 3136 | } else if (size_val.compare(.lt, Value.zero, p.comp)) { | |
| 3137 | try p.errTok(.negative_array_size, l_bracket); | |
| 3138 | return error.ParsingFailed; | |
| 3139 | } | |
| 3140 | const arr_ty = try p.arena.create(Type.Array); | |
| 3141 | arr_ty.elem = .{ .specifier = .void }; | |
| 3142 | arr_ty.len = size_val.toInt(u64, p.comp) orelse std.math.maxInt(u64); | |
| 3143 | if (arr_ty.len > max_elems) { | |
| 3144 | try p.errTok(.array_too_large, l_bracket); | |
| 3145 | arr_ty.len = max_elems; | |
| 3146 | } | |
| 3147 | res_ty.data = .{ .array = arr_ty }; | |
| 3148 | res_ty.specifier = if (static != null) .static_array else .array; | |
| 3701 | const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 3702 | .elem = outer, | |
| 3703 | .len = .incomplete, | |
| 3704 | } }); | |
| 3705 | return builder.finishQuals(array_qt); | |
| 3149 | 3706 | } |
| 3150 | ||
| 3151 | try res_ty.combine(outer); | |
| 3152 | return res_ty; | |
| 3153 | 3707 | } else if (p.eatToken(.l_paren)) |l_paren| { |
| 3154 | d.func_declarator = l_paren; | |
| 3155 | ||
| 3156 | const func_ty = try p.arena.create(Type.Func); | |
| 3157 | func_ty.params = &.{}; | |
| 3158 | func_ty.return_type.specifier = .void; | |
| 3159 | var specifier: Type.Specifier = .func; | |
| 3708 | var func_ty: Type.Func = .{ | |
| 3709 | .kind = undefined, | |
| 3710 | .return_type = undefined, | |
| 3711 | .params = &.{}, | |
| 3712 | }; | |
| 3160 | 3713 | |
| 3161 | 3714 | if (p.eatToken(.ellipsis)) |_| { |
| 3162 | try p.err(.param_before_var_args); | |
| 3715 | try p.err(p.tok_i, .param_before_var_args, .{}); | |
| 3163 | 3716 | try p.expectClosing(l_paren, .r_paren); |
| 3164 | var res_ty = Type{ .specifier = .func, .data = .{ .func = func_ty } }; | |
| 3717 | func_ty.kind = .variadic; | |
| 3718 | ||
| 3719 | func_ty.return_type = try p.directDeclarator(base_declarator, kind); | |
| 3165 | 3720 | |
| 3166 | const outer = try p.directDeclarator(base_type, d, kind); | |
| 3167 | try res_ty.combine(outer); | |
| 3168 | return res_ty; | |
| 3721 | // Set after call to `directDeclarator` since we will return | |
| 3722 | // a function type from here. | |
| 3723 | base_declarator.declarator_type = .func; | |
| 3724 | return p.comp.type_store.put(gpa, .{ .func = func_ty }); | |
| 3169 | 3725 | } |
| 3170 | 3726 | |
| 3171 | if (try p.paramDecls(d)) |params| { | |
| 3727 | // Set here so the call to directDeclarator for the return type | |
| 3728 | // doesn't clobber this function type's parameters. | |
| 3729 | const param_buf_top = p.param_buf.items.len; | |
| 3730 | defer p.param_buf.items.len = param_buf_top; | |
| 3731 | ||
| 3732 | if (try p.paramDecls()) |params| { | |
| 3733 | func_ty.kind = .normal; | |
| 3172 | 3734 | func_ty.params = params; |
| 3173 | if (p.eatToken(.ellipsis)) |_| specifier = .var_args_func; | |
| 3735 | if (p.eatToken(.ellipsis)) |_| func_ty.kind = .variadic; | |
| 3174 | 3736 | } else if (p.tok_ids[p.tok_i] == .r_paren) { |
| 3175 | specifier = if (p.comp.langopts.standard.atLeast(.c23)) | |
| 3176 | .func | |
| 3737 | func_ty.kind = if (p.comp.langopts.standard.atLeast(.c23)) | |
| 3738 | .normal | |
| 3177 | 3739 | else |
| 3178 | .old_style_func; | |
| 3740 | .old_style; | |
| 3179 | 3741 | } else if (p.tok_ids[p.tok_i] == .identifier or p.tok_ids[p.tok_i] == .extended_identifier) { |
| 3180 | d.old_style_func = p.tok_i; | |
| 3181 | const param_buf_top = p.param_buf.items.len; | |
| 3742 | base_declarator.old_style_func = p.tok_i; | |
| 3182 | 3743 | try p.syms.pushScope(p); |
| 3183 | defer { | |
| 3184 | p.param_buf.items.len = param_buf_top; | |
| 3185 | p.syms.popScope(); | |
| 3186 | } | |
| 3744 | defer p.syms.popScope(); | |
| 3187 | 3745 | |
| 3188 | specifier = .old_style_func; | |
| 3746 | func_ty.kind = .old_style; | |
| 3189 | 3747 | while (true) { |
| 3190 | 3748 | const name_tok = try p.expectIdentifier(); |
| 3191 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(name_tok)); | |
| 3192 | try p.syms.defineParam(p, interned_name, undefined, name_tok); | |
| 3193 | try p.param_buf.append(.{ | |
| 3749 | const interned_name = try p.comp.internString(p.tokSlice(name_tok)); | |
| 3750 | try p.syms.defineParam(p, interned_name, undefined, name_tok, null); | |
| 3751 | try p.param_buf.append(gpa, .{ | |
| 3194 | 3752 | .name = interned_name, |
| 3195 | 3753 | .name_tok = name_tok, |
| 3196 | .ty = .{ .specifier = .int }, | |
| 3754 | .qt = .int, | |
| 3755 | .node = .null, | |
| 3197 | 3756 | }); |
| 3198 | 3757 | if (p.eatToken(.comma) == null) break; |
| 3199 | 3758 | } |
| 3200 | func_ty.params = try p.arena.dupe(Type.Func.Param, p.param_buf.items[param_buf_top..]); | |
| 3759 | func_ty.params = p.param_buf.items[param_buf_top..]; | |
| 3201 | 3760 | } else { |
| 3202 | try p.err(.expected_param_decl); | |
| 3761 | try p.err(p.tok_i, .expected_param_decl, .{}); | |
| 3203 | 3762 | } |
| 3204 | 3763 | |
| 3205 | 3764 | try p.expectClosing(l_paren, .r_paren); |
| 3206 | var res_ty = Type{ | |
| 3207 | .specifier = specifier, | |
| 3208 | .data = .{ .func = func_ty }, | |
| 3209 | }; | |
| 3765 | func_ty.return_type = try p.directDeclarator(base_declarator, kind); | |
| 3210 | 3766 | |
| 3211 | const outer = try p.directDeclarator(base_type, d, kind); | |
| 3212 | try res_ty.combine(outer); | |
| 3213 | return res_ty; | |
| 3214 | } else return base_type; | |
| 3215 | } | |
| 3767 | // Set after call to `directDeclarator` since we will return | |
| 3768 | // a function type from here. | |
| 3769 | base_declarator.declarator_type = .func; | |
| 3216 | 3770 | |
| 3217 | /// pointer : '*' typeQual* pointer? | |
| 3218 | fn pointer(p: *Parser, base_ty: Type) Error!Type { | |
| 3219 | var ty = base_ty; | |
| 3220 | while (p.eatToken(.asterisk)) |_| { | |
| 3221 | if (!ty.is(.invalid)) { | |
| 3222 | const elem_ty = try p.arena.create(Type); | |
| 3223 | elem_ty.* = ty; | |
| 3224 | ty = Type{ | |
| 3225 | .specifier = .pointer, | |
| 3226 | .data = .{ .sub_type = elem_ty }, | |
| 3227 | }; | |
| 3228 | } | |
| 3229 | var quals = Type.Qualifiers.Builder{}; | |
| 3230 | _ = try p.typeQual(&quals); | |
| 3231 | try quals.finish(p, &ty); | |
| 3232 | } | |
| 3233 | return ty; | |
| 3771 | return p.comp.type_store.put(gpa, .{ .func = func_ty }); | |
| 3772 | } else return base_declarator.qt; | |
| 3234 | 3773 | } |
| 3235 | 3774 | |
| 3236 | 3775 | /// paramDecls : paramDecl (',' paramDecl)* (',' '...') |
| 3237 | 3776 | /// paramDecl : declSpec (declarator | abstractDeclarator) |
| 3238 | fn paramDecls(p: *Parser, d: *Declarator) Error!?[]Type.Func.Param { | |
| 3777 | fn paramDecls(p: *Parser) Error!?[]Type.Func.Param { | |
| 3239 | 3778 | // TODO warn about visibility of types declared here |
| 3240 | const param_buf_top = p.param_buf.items.len; | |
| 3241 | defer p.param_buf.items.len = param_buf_top; | |
| 3242 | 3779 | try p.syms.pushScope(p); |
| 3243 | 3780 | defer p.syms.popScope(); |
| 3244 | 3781 | |
| 3782 | // Clearing the param buf is handled in directDeclarator. | |
| 3783 | const param_buf_top = p.param_buf.items.len; | |
| 3784 | const gpa = p.comp.gpa; | |
| 3785 | ||
| 3245 | 3786 | while (true) { |
| 3246 | 3787 | const attr_buf_top = p.attr_buf.len; |
| 3247 | 3788 | defer p.attr_buf.len = attr_buf_top; |
| ... | ... | @@ -3252,13 +3793,13 @@ fn paramDecls(p: *Parser, d: *Declarator) Error!?[]Type.Func.Param { |
| 3252 | 3793 | { |
| 3253 | 3794 | // handle deprecated K&R style parameters |
| 3254 | 3795 | const identifier = try p.expectIdentifier(); |
| 3255 | try p.errStr(.unknown_type_name, identifier, p.tokSlice(identifier)); | |
| 3256 | if (d.old_style_func == null) d.old_style_func = identifier; | |
| 3796 | try p.err(identifier, .unknown_type_name, .{p.tokSlice(identifier)}); | |
| 3257 | 3797 | |
| 3258 | try p.param_buf.append(.{ | |
| 3259 | .name = try StrInt.intern(p.comp, p.tokSlice(identifier)), | |
| 3798 | try p.param_buf.append(gpa, .{ | |
| 3799 | .name = try p.comp.internString(p.tokSlice(identifier)), | |
| 3260 | 3800 | .name_tok = identifier, |
| 3261 | .ty = .{ .specifier = .int }, | |
| 3801 | .qt = .int, | |
| 3802 | .node = .null, | |
| 3262 | 3803 | }); |
| 3263 | 3804 | |
| 3264 | 3805 | if (p.eatToken(.comma) == null) break; |
| ... | ... | @@ -3267,801 +3808,925 @@ fn paramDecls(p: *Parser, d: *Declarator) Error!?[]Type.Func.Param { |
| 3267 | 3808 | } else if (p.param_buf.items.len == param_buf_top) { |
| 3268 | 3809 | return null; |
| 3269 | 3810 | } else blk: { |
| 3270 | var spec: Type.Builder = .{}; | |
| 3271 | break :blk DeclSpec{ .ty = try spec.finish(p) }; | |
| 3811 | try p.err(p.tok_i, .missing_type_specifier, .{}); | |
| 3812 | break :blk DeclSpec{ .qt = .int }; | |
| 3272 | 3813 | }; |
| 3273 | 3814 | |
| 3274 | 3815 | var name_tok: TokenIndex = 0; |
| 3816 | var interned_name: StringId = .empty; | |
| 3275 | 3817 | const first_tok = p.tok_i; |
| 3276 | var param_ty = param_decl_spec.ty; | |
| 3277 | if (try p.declarator(param_decl_spec.ty, .param)) |some| { | |
| 3278 | if (some.old_style_func) |tok_i| try p.errTok(.invalid_old_style_params, tok_i); | |
| 3279 | try p.attributeSpecifier(); | |
| 3818 | var param_qt = param_decl_spec.qt; | |
| 3819 | if (param_decl_spec.auto_type) |tok_i| { | |
| 3820 | try p.err(tok_i, .auto_type_not_allowed, .{"function prototype"}); | |
| 3821 | param_qt = .invalid; | |
| 3822 | } | |
| 3823 | if (param_decl_spec.c23_auto) |tok_i| { | |
| 3824 | try p.err(tok_i, .c23_auto_not_allowed, .{"function prototype"}); | |
| 3825 | param_qt = .invalid; | |
| 3826 | } | |
| 3280 | 3827 | |
| 3828 | if (try p.declarator(param_qt, .param)) |some| { | |
| 3829 | if (some.old_style_func) |tok_i| try p.err(tok_i, .invalid_old_style_params, .{}); | |
| 3830 | try p.attributeSpecifier(); | |
| 3281 | 3831 | name_tok = some.name; |
| 3282 | param_ty = some.ty; | |
| 3283 | if (some.name != 0) { | |
| 3284 | const interned_name = try StrInt.intern(p.comp, p.tokSlice(name_tok)); | |
| 3285 | try p.syms.defineParam(p, interned_name, param_ty, name_tok); | |
| 3286 | } | |
| 3832 | param_qt = some.qt; | |
| 3287 | 3833 | } |
| 3288 | param_ty = try Attribute.applyParameterAttributes(p, param_ty, attr_buf_top, .alignas_on_param); | |
| 3289 | 3834 | |
| 3290 | if (param_ty.isFunc()) { | |
| 3291 | // params declared as functions are converted to function pointers | |
| 3292 | const elem_ty = try p.arena.create(Type); | |
| 3293 | elem_ty.* = param_ty; | |
| 3294 | param_ty = Type{ | |
| 3295 | .specifier = .pointer, | |
| 3296 | .data = .{ .sub_type = elem_ty }, | |
| 3297 | }; | |
| 3298 | } else if (param_ty.isArray()) { | |
| 3299 | // params declared as arrays are converted to pointers | |
| 3300 | param_ty.decayArray(); | |
| 3301 | } else if (param_ty.is(.void)) { | |
| 3835 | if (param_qt.is(p.comp, .void)) { | |
| 3302 | 3836 | // validate void parameters |
| 3303 | 3837 | if (p.param_buf.items.len == param_buf_top) { |
| 3304 | 3838 | if (p.tok_ids[p.tok_i] != .r_paren) { |
| 3305 | try p.err(.void_only_param); | |
| 3306 | if (param_ty.anyQual()) try p.err(.void_param_qualified); | |
| 3839 | try p.err(p.tok_i, .void_only_param, .{}); | |
| 3840 | if (param_qt.isQualified()) try p.err(p.tok_i, .void_param_qualified, .{}); | |
| 3307 | 3841 | return error.ParsingFailed; |
| 3308 | 3842 | } |
| 3309 | return &[0]Type.Func.Param{}; | |
| 3843 | return &.{}; | |
| 3310 | 3844 | } |
| 3311 | try p.err(.void_must_be_first_param); | |
| 3845 | try p.err(p.tok_i, .void_must_be_first_param, .{}); | |
| 3312 | 3846 | return error.ParsingFailed; |
| 3847 | } else { | |
| 3848 | // Decay params declared as functions or arrays to pointer. | |
| 3849 | param_qt = try param_qt.decay(p.comp); | |
| 3313 | 3850 | } |
| 3851 | try param_decl_spec.validateParam(p); | |
| 3852 | param_qt = try Attribute.applyParameterAttributes(p, param_qt, attr_buf_top, .alignas_on_param); | |
| 3314 | 3853 | |
| 3315 | try param_decl_spec.validateParam(p, &param_ty); | |
| 3316 | try p.param_buf.append(.{ | |
| 3317 | .name = if (name_tok == 0) .empty else try StrInt.intern(p.comp, p.tokSlice(name_tok)), | |
| 3854 | if (param_qt.get(p.comp, .float)) |float| { | |
| 3855 | if (float == .fp16 and !p.comp.hasHalfPrecisionFloatABI()) { | |
| 3856 | try p.err(first_tok, .suggest_pointer_for_invalid_fp16, .{"parameters"}); | |
| 3857 | } | |
| 3858 | } | |
| 3859 | ||
| 3860 | var param_node: Node.OptIndex = .null; | |
| 3861 | if (name_tok != 0) { | |
| 3862 | const node = try p.addNode(.{ | |
| 3863 | .param = .{ | |
| 3864 | .name_tok = name_tok, | |
| 3865 | .qt = param_qt, | |
| 3866 | .storage_class = switch (param_decl_spec.storage_class) { | |
| 3867 | .none => .auto, | |
| 3868 | .register => .register, | |
| 3869 | else => .auto, // Error reported in `validateParam` | |
| 3870 | }, | |
| 3871 | }, | |
| 3872 | }); | |
| 3873 | param_node = .pack(node); | |
| 3874 | interned_name = try p.comp.internString(p.tokSlice(name_tok)); | |
| 3875 | try p.syms.defineParam(p, interned_name, param_qt, name_tok, node); | |
| 3876 | } | |
| 3877 | ||
| 3878 | try p.param_buf.append(gpa, .{ | |
| 3879 | .name = interned_name, | |
| 3318 | 3880 | .name_tok = if (name_tok == 0) first_tok else name_tok, |
| 3319 | .ty = param_ty, | |
| 3881 | .qt = param_qt, | |
| 3882 | .node = param_node, | |
| 3320 | 3883 | }); |
| 3321 | 3884 | |
| 3322 | 3885 | if (p.eatToken(.comma) == null) break; |
| 3323 | 3886 | if (p.tok_ids[p.tok_i] == .ellipsis) break; |
| 3324 | 3887 | } |
| 3325 | return try p.arena.dupe(Type.Func.Param, p.param_buf.items[param_buf_top..]); | |
| 3888 | return p.param_buf.items[param_buf_top..]; | |
| 3326 | 3889 | } |
| 3327 | 3890 | |
| 3328 | 3891 | /// typeName : specQual abstractDeclarator |
| 3329 | fn typeName(p: *Parser) Error!?Type { | |
| 3892 | fn typeName(p: *Parser) Error!?QualType { | |
| 3330 | 3893 | const attr_buf_top = p.attr_buf.len; |
| 3331 | 3894 | defer p.attr_buf.len = attr_buf_top; |
| 3332 | 3895 | const ty = (try p.specQual()) orelse return null; |
| 3333 | 3896 | if (try p.declarator(ty, .abstract)) |some| { |
| 3334 | if (some.old_style_func) |tok_i| try p.errTok(.invalid_old_style_params, tok_i); | |
| 3335 | return try Attribute.applyTypeAttributes(p, some.ty, attr_buf_top, .align_ignored); | |
| 3897 | if (some.old_style_func) |tok_i| try p.err(tok_i, .invalid_old_style_params, .{}); | |
| 3898 | return try Attribute.applyTypeAttributes(p, some.qt, attr_buf_top, .align_ignored); | |
| 3336 | 3899 | } |
| 3337 | 3900 | return try Attribute.applyTypeAttributes(p, ty, attr_buf_top, .align_ignored); |
| 3338 | 3901 | } |
| 3339 | 3902 | |
| 3340 | fn complexInitializer(p: *Parser, init_ty: Type) Error!Result { | |
| 3341 | assert(p.tok_ids[p.tok_i] == .l_brace); | |
| 3342 | assert(init_ty.isComplex()); | |
| 3343 | ||
| 3344 | const real_ty = init_ty.makeReal(); | |
| 3345 | if (real_ty.isInt()) { | |
| 3346 | return p.todo("Complex integer initializers"); | |
| 3347 | } | |
| 3348 | const l_brace = p.tok_i; | |
| 3349 | p.tok_i += 1; | |
| 3350 | try p.errTok(.complex_component_init, l_brace); | |
| 3351 | ||
| 3352 | const first_tok = p.tok_i; | |
| 3353 | var first = try p.assignExpr(); | |
| 3354 | try first.expect(p); | |
| 3355 | try p.coerceInit(&first, first_tok, real_ty); | |
| 3356 | ||
| 3357 | var second: Result = .{ | |
| 3358 | .ty = real_ty, | |
| 3359 | .val = Value.zero, | |
| 3360 | }; | |
| 3361 | if (p.eatToken(.comma)) |_| { | |
| 3362 | const second_tok = p.tok_i; | |
| 3363 | const maybe_second = try p.assignExpr(); | |
| 3364 | if (!maybe_second.empty(p)) { | |
| 3365 | second = maybe_second; | |
| 3366 | try p.coerceInit(&second, second_tok, real_ty); | |
| 3367 | } | |
| 3368 | } | |
| 3369 | ||
| 3370 | // Eat excess initializers | |
| 3371 | var extra_tok: ?TokenIndex = null; | |
| 3372 | while (p.eatToken(.comma)) |_| { | |
| 3373 | if (p.tok_ids[p.tok_i] == .r_brace) break; | |
| 3374 | extra_tok = p.tok_i; | |
| 3375 | const extra = try p.assignExpr(); | |
| 3376 | if (extra.empty(p)) { | |
| 3377 | try p.errTok(.expected_expr, p.tok_i); | |
| 3378 | p.skipTo(.r_brace); | |
| 3379 | return error.ParsingFailed; | |
| 3380 | } | |
| 3381 | } | |
| 3382 | try p.expectClosing(l_brace, .r_brace); | |
| 3383 | if (extra_tok) |tok| { | |
| 3384 | try p.errTok(.excess_scalar_init, tok); | |
| 3385 | } | |
| 3386 | ||
| 3387 | const arr_init_node: Tree.Node = .{ | |
| 3388 | .tag = .array_init_expr_two, | |
| 3389 | .ty = init_ty, | |
| 3390 | .data = .{ .two = .{ first.node, second.node } }, | |
| 3391 | .loc = @enumFromInt(l_brace), | |
| 3392 | }; | |
| 3393 | var res: Result = .{ | |
| 3394 | .node = try p.addNode(arr_init_node), | |
| 3395 | .ty = init_ty, | |
| 3396 | }; | |
| 3397 | if (first.val.opt_ref != .none and second.val.opt_ref != .none) { | |
| 3398 | res.val = try Value.intern(p.comp, switch (real_ty.bitSizeof(p.comp).?) { | |
| 3399 | 32 => .{ .complex = .{ .cf32 = .{ first.val.toFloat(f32, p.comp), second.val.toFloat(f32, p.comp) } } }, | |
| 3400 | 64 => .{ .complex = .{ .cf64 = .{ first.val.toFloat(f64, p.comp), second.val.toFloat(f64, p.comp) } } }, | |
| 3401 | 80 => .{ .complex = .{ .cf80 = .{ first.val.toFloat(f80, p.comp), second.val.toFloat(f80, p.comp) } } }, | |
| 3402 | 128 => .{ .complex = .{ .cf128 = .{ first.val.toFloat(f128, p.comp), second.val.toFloat(f128, p.comp) } } }, | |
| 3403 | else => unreachable, | |
| 3404 | }); | |
| 3405 | } | |
| 3406 | return res; | |
| 3407 | } | |
| 3408 | ||
| 3409 | 3903 | /// initializer |
| 3410 | 3904 | /// : assignExpr |
| 3411 | 3905 | /// | '{' initializerItems '}' |
| 3412 | fn initializer(p: *Parser, init_ty: Type) Error!Result { | |
| 3413 | // fast path for non-braced initializers | |
| 3414 | if (p.tok_ids[p.tok_i] != .l_brace) { | |
| 3906 | fn initializer(p: *Parser, init_qt: QualType) Error!Result { | |
| 3907 | const l_brace = p.eatToken(.l_brace) orelse { | |
| 3908 | // fast path for non-braced initializers | |
| 3415 | 3909 | const tok = p.tok_i; |
| 3416 | var res = try p.assignExpr(); | |
| 3417 | try res.expect(p); | |
| 3418 | if (try p.coerceArrayInit(&res, tok, init_ty)) return res; | |
| 3419 | try p.coerceInit(&res, tok, init_ty); | |
| 3910 | var res = try p.expect(assignExpr); | |
| 3911 | if (try p.coerceArrayInit(res, tok, init_qt)) return res; | |
| 3912 | try p.coerceInit(&res, tok, init_qt); | |
| 3420 | 3913 | return res; |
| 3421 | } | |
| 3422 | if (init_ty.is(.auto_type)) { | |
| 3423 | try p.err(.auto_type_with_init_list); | |
| 3424 | return error.ParsingFailed; | |
| 3425 | } | |
| 3914 | }; | |
| 3426 | 3915 | |
| 3427 | if (init_ty.isComplex()) { | |
| 3428 | return p.complexInitializer(init_ty); | |
| 3916 | // We want to parse the initializer even if the target is | |
| 3917 | // invalidly inferred. | |
| 3918 | var final_init_qt = init_qt; | |
| 3919 | if (init_qt.isAutoType()) { | |
| 3920 | try p.err(l_brace, .auto_type_with_init_list, .{}); | |
| 3921 | final_init_qt = .invalid; | |
| 3922 | } else if (init_qt.isC23Auto()) { | |
| 3923 | try p.err(l_brace, .c23_auto_with_init_list, .{}); | |
| 3924 | final_init_qt = .invalid; | |
| 3429 | 3925 | } |
| 3926 | ||
| 3430 | 3927 | var il: InitList = .{}; |
| 3431 | defer il.deinit(p.gpa); | |
| 3928 | defer il.deinit(p.comp.gpa); | |
| 3432 | 3929 | |
| 3433 | _ = try p.initializerItem(&il, init_ty); | |
| 3930 | try p.initializerItem(&il, final_init_qt, l_brace); | |
| 3434 | 3931 | |
| 3435 | const res = try p.convertInitList(il, init_ty); | |
| 3436 | var res_ty = p.nodes.items(.ty)[@intFromEnum(res)]; | |
| 3437 | res_ty.qual = init_ty.qual; | |
| 3438 | return Result{ .ty = res_ty, .node = res }; | |
| 3932 | const list_node = try p.convertInitList(il, final_init_qt); | |
| 3933 | return .{ | |
| 3934 | .qt = list_node.qt(&p.tree).withQualifiers(final_init_qt), | |
| 3935 | .node = list_node, | |
| 3936 | .val = p.tree.value_map.get(list_node) orelse .{}, | |
| 3937 | }; | |
| 3439 | 3938 | } |
| 3440 | 3939 | |
| 3441 | /// initializerItems : designation? initializer (',' designation? initializer)* ','? | |
| 3442 | /// designation : designator+ '=' | |
| 3443 | /// designator | |
| 3444 | /// : '[' integerConstExpr ']' | |
| 3445 | /// | '.' identifier | |
| 3446 | fn initializerItem(p: *Parser, il: *InitList, init_ty: Type) Error!bool { | |
| 3447 | const l_brace = p.eatToken(.l_brace) orelse { | |
| 3448 | const tok = p.tok_i; | |
| 3449 | var res = try p.assignExpr(); | |
| 3450 | if (res.empty(p)) return false; | |
| 3940 | const IndexList = std.ArrayList(u64); | |
| 3451 | 3941 | |
| 3452 | const arr = try p.coerceArrayInit(&res, tok, init_ty); | |
| 3453 | if (!arr) try p.coerceInit(&res, tok, init_ty); | |
| 3454 | if (il.tok != 0) { | |
| 3455 | try p.errTok(.initializer_overrides, tok); | |
| 3456 | try p.errTok(.previous_initializer, il.tok); | |
| 3457 | } | |
| 3458 | il.node = res.node; | |
| 3459 | il.tok = tok; | |
| 3460 | return true; | |
| 3461 | }; | |
| 3942 | /// initializerItems : designation? initializer (',' designation? initializer)* ','? | |
| 3943 | fn initializerItem(p: *Parser, il: *InitList, init_qt: QualType, l_brace: TokenIndex) Error!void { | |
| 3944 | const gpa = p.comp.gpa; | |
| 3945 | const is_scalar = !init_qt.isInvalid() and init_qt.scalarKind(p.comp) != .none; | |
| 3462 | 3946 | |
| 3463 | const is_scalar = init_ty.isScalar(); | |
| 3464 | const is_complex = init_ty.isComplex(); | |
| 3465 | const scalar_inits_needed: usize = if (is_complex) 2 else 1; | |
| 3466 | 3947 | if (p.eatToken(.r_brace)) |_| { |
| 3467 | if (is_scalar) try p.errTok(.empty_scalar_init, l_brace); | |
| 3468 | if (il.tok != 0) { | |
| 3469 | try p.errTok(.initializer_overrides, l_brace); | |
| 3470 | try p.errTok(.previous_initializer, il.tok); | |
| 3948 | try p.err(l_brace, .empty_initializer, .{}); | |
| 3949 | if (il.tok != 0 and !init_qt.isInvalid()) { | |
| 3950 | try p.err(l_brace, .initializer_overrides, .{}); | |
| 3951 | try p.err(il.tok, .previous_initializer, .{}); | |
| 3471 | 3952 | } |
| 3472 | il.node = .none; | |
| 3953 | il.node = .null; | |
| 3473 | 3954 | il.tok = l_brace; |
| 3474 | return true; | |
| 3955 | return; | |
| 3475 | 3956 | } |
| 3476 | 3957 | |
| 3477 | var count: u64 = 0; | |
| 3478 | var warned_excess = false; | |
| 3479 | var is_str_init = false; | |
| 3480 | var index_hint: ?u64 = null; | |
| 3481 | while (true) : (count += 1) { | |
| 3482 | errdefer p.skipTo(.r_brace); | |
| 3483 | ||
| 3484 | var first_tok = p.tok_i; | |
| 3485 | var cur_ty = init_ty; | |
| 3486 | var cur_il = il; | |
| 3487 | var designation = false; | |
| 3488 | var cur_index_hint: ?u64 = null; | |
| 3489 | while (true) { | |
| 3490 | if (p.eatToken(.l_bracket)) |l_bracket| { | |
| 3491 | if (!cur_ty.isArray()) { | |
| 3492 | try p.errStr(.invalid_array_designator, l_bracket, try p.typeStr(cur_ty)); | |
| 3493 | return error.ParsingFailed; | |
| 3494 | } | |
| 3495 | const expr_tok = p.tok_i; | |
| 3496 | const index_res = try p.integerConstExpr(.gnu_folding_extension); | |
| 3497 | try p.expectClosing(l_bracket, .r_bracket); | |
| 3958 | var index_list: IndexList = .empty; | |
| 3959 | defer index_list.deinit(gpa); | |
| 3498 | 3960 | |
| 3499 | if (index_res.val.opt_ref == .none) { | |
| 3500 | try p.errTok(.expected_integer_constant_expr, expr_tok); | |
| 3501 | return error.ParsingFailed; | |
| 3502 | } else if (index_res.val.compare(.lt, Value.zero, p.comp)) { | |
| 3503 | try p.errStr(.negative_array_designator, l_bracket + 1, try index_res.str(p)); | |
| 3504 | return error.ParsingFailed; | |
| 3505 | } | |
| 3961 | var seen_any = false; | |
| 3962 | var warned_excess = init_qt.isInvalid(); | |
| 3963 | while (true) : (seen_any = true) { | |
| 3964 | errdefer p.skipTo(.r_brace); | |
| 3506 | 3965 | |
| 3507 | const max_len = cur_ty.arrayLen() orelse std.math.maxInt(usize); | |
| 3508 | const index_int = index_res.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); | |
| 3509 | if (index_int >= max_len) { | |
| 3510 | try p.errStr(.oob_array_designator, l_bracket + 1, try index_res.str(p)); | |
| 3511 | return error.ParsingFailed; | |
| 3512 | } | |
| 3513 | cur_index_hint = cur_index_hint orelse index_int; | |
| 3514 | ||
| 3515 | cur_il = try cur_il.find(p.gpa, index_int); | |
| 3516 | cur_ty = cur_ty.elemType(); | |
| 3517 | designation = true; | |
| 3518 | } else if (p.eatToken(.period)) |period| { | |
| 3519 | const field_tok = try p.expectIdentifier(); | |
| 3520 | const field_str = p.tokSlice(field_tok); | |
| 3521 | const field_name = try StrInt.intern(p.comp, field_str); | |
| 3522 | cur_ty = cur_ty.canonicalize(.standard); | |
| 3523 | if (!cur_ty.isRecord()) { | |
| 3524 | try p.errStr(.invalid_field_designator, period, try p.typeStr(cur_ty)); | |
| 3525 | return error.ParsingFailed; | |
| 3526 | } else if (!cur_ty.hasField(field_name)) { | |
| 3527 | try p.errStr(.no_such_field_designator, period, field_str); | |
| 3528 | return error.ParsingFailed; | |
| 3529 | } | |
| 3966 | const designated = try p.designation(il, init_qt, &index_list); | |
| 3967 | if (!designated and init_qt.hasAttribute(p.comp, .designated_init)) { | |
| 3968 | try p.err(p.tok_i, .designated_init_needed, .{}); | |
| 3969 | } | |
| 3530 | 3970 | |
| 3531 | // TODO check if union already has field set | |
| 3532 | outer: while (true) { | |
| 3533 | for (cur_ty.data.record.fields, 0..) |f, i| { | |
| 3534 | if (f.isAnonymousRecord()) { | |
| 3535 | // Recurse into anonymous field if it has a field by the name. | |
| 3536 | if (!f.ty.hasField(field_name)) continue; | |
| 3537 | cur_ty = f.ty.canonicalize(.standard); | |
| 3538 | cur_il = try il.find(p.gpa, i); | |
| 3539 | cur_index_hint = cur_index_hint orelse i; | |
| 3540 | continue :outer; | |
| 3541 | } | |
| 3542 | if (field_name == f.name) { | |
| 3543 | cur_il = try cur_il.find(p.gpa, i); | |
| 3544 | cur_ty = f.ty; | |
| 3545 | cur_index_hint = cur_index_hint orelse i; | |
| 3546 | break :outer; | |
| 3547 | } | |
| 3548 | } | |
| 3549 | unreachable; // we already checked that the starting type has this field | |
| 3971 | const first_tok = p.tok_i; | |
| 3972 | if (p.eatToken(.l_brace)) |inner_l_brace| { | |
| 3973 | if (try p.findBracedInitializer(il, init_qt, first_tok, &index_list)) |item| { | |
| 3974 | if (item.il.tok != 0 and !init_qt.isInvalid()) { | |
| 3975 | try p.err(first_tok, .initializer_overrides, .{}); | |
| 3976 | try p.err(item.il.tok, .previous_initializer, .{}); | |
| 3977 | item.il.deinit(gpa); | |
| 3978 | item.il.* = .{}; | |
| 3550 | 3979 | } |
| 3551 | designation = true; | |
| 3552 | } else break; | |
| 3553 | } | |
| 3554 | if (designation) index_hint = null; | |
| 3555 | defer index_hint = cur_index_hint orelse null; | |
| 3556 | ||
| 3557 | if (designation) _ = try p.expectToken(.equal); | |
| 3558 | ||
| 3559 | if (!designation and cur_ty.hasAttribute(.designated_init)) { | |
| 3560 | try p.err(.designated_init_needed); | |
| 3561 | } | |
| 3562 | ||
| 3563 | var saw = false; | |
| 3564 | if (is_str_init and p.isStringInit(init_ty)) { | |
| 3565 | // discard further strings | |
| 3566 | var tmp_il = InitList{}; | |
| 3567 | defer tmp_il.deinit(p.gpa); | |
| 3568 | saw = try p.initializerItem(&tmp_il, .{ .specifier = .void }); | |
| 3569 | } else if (count == 0 and p.isStringInit(init_ty)) { | |
| 3570 | is_str_init = true; | |
| 3571 | saw = try p.initializerItem(il, init_ty); | |
| 3572 | } else if (is_scalar and count >= scalar_inits_needed) { | |
| 3573 | // discard further scalars | |
| 3574 | var tmp_il = InitList{}; | |
| 3575 | defer tmp_il.deinit(p.gpa); | |
| 3576 | saw = try p.initializerItem(&tmp_il, .{ .specifier = .void }); | |
| 3577 | } else if (p.tok_ids[p.tok_i] == .l_brace) { | |
| 3578 | if (designation) { | |
| 3579 | // designation overrides previous value, let existing mechanism handle it | |
| 3580 | saw = try p.initializerItem(cur_il, cur_ty); | |
| 3581 | } else if (try p.findAggregateInitializer(&cur_il, &cur_ty, &index_hint)) { | |
| 3582 | saw = try p.initializerItem(cur_il, cur_ty); | |
| 3980 | try p.initializerItem(item.il, item.qt, inner_l_brace); | |
| 3583 | 3981 | } else { |
| 3584 | 3982 | // discard further values |
| 3585 | var tmp_il = InitList{}; | |
| 3586 | defer tmp_il.deinit(p.gpa); | |
| 3587 | saw = try p.initializerItem(&tmp_il, .{ .specifier = .void }); | |
| 3588 | if (!warned_excess) try p.errTok(if (init_ty.isArray()) .excess_array_init else .excess_struct_init, first_tok); | |
| 3983 | var tmp_il: InitList = .{}; | |
| 3984 | defer tmp_il.deinit(gpa); | |
| 3985 | try p.initializerItem(&tmp_il, .invalid, inner_l_brace); | |
| 3986 | if (!warned_excess) try p.err(first_tok, switch (init_qt.base(p.comp).type) { | |
| 3987 | .array => if (il.node != .null and p.isStringInit(init_qt, il.node.unpack().?)) | |
| 3988 | .excess_str_init | |
| 3989 | else | |
| 3990 | .excess_array_init, | |
| 3991 | .@"struct" => .excess_struct_init, | |
| 3992 | .@"union" => .excess_union_init, | |
| 3993 | .vector => .excess_vector_init, | |
| 3994 | else => .excess_scalar_init, | |
| 3995 | }, .{}); | |
| 3996 | ||
| 3589 | 3997 | warned_excess = true; |
| 3590 | 3998 | } |
| 3591 | } else single_item: { | |
| 3592 | first_tok = p.tok_i; | |
| 3593 | var res = try p.assignExpr(); | |
| 3594 | saw = !res.empty(p); | |
| 3595 | if (!saw) break :single_item; | |
| 3999 | } else if (try p.assignExpr()) |res| { | |
| 4000 | if (is_scalar and il.node != .null) { | |
| 4001 | if (!warned_excess) try p.err(first_tok, .excess_scalar_init, .{}); | |
| 4002 | warned_excess = true; | |
| 4003 | } else { | |
| 4004 | _ = try p.findScalarInitializer(il, init_qt, res, first_tok, &warned_excess, &index_list, 0); | |
| 4005 | } | |
| 4006 | } else if (designated or (seen_any and p.tok_ids[p.tok_i] != .r_brace)) { | |
| 4007 | try p.err(p.tok_i, .expected_expr, .{}); | |
| 4008 | } else break; | |
| 3596 | 4009 | |
| 3597 | excess: { | |
| 3598 | if (index_hint) |*hint| { | |
| 3599 | if (try p.findScalarInitializerAt(&cur_il, &cur_ty, &res, first_tok, hint)) break :excess; | |
| 3600 | } else if (try p.findScalarInitializer(&cur_il, &cur_ty, &res, first_tok)) break :excess; | |
| 4010 | if (p.eatToken(.comma) == null) break; | |
| 4011 | } | |
| 4012 | try p.expectClosing(l_brace, .r_brace); | |
| 3601 | 4013 | |
| 3602 | if (designation) break :excess; | |
| 3603 | if (!warned_excess) try p.errTok(if (init_ty.isArray()) .excess_array_init else .excess_struct_init, first_tok); | |
| 3604 | warned_excess = true; | |
| 4014 | if (il.tok == 0) il.tok = l_brace; | |
| 4015 | } | |
| 3605 | 4016 | |
| 3606 | break :single_item; | |
| 3607 | } | |
| 4017 | fn setInitializer(p: *Parser, il: *InitList, init_qt: QualType, tok: TokenIndex, res: Result) !void { | |
| 4018 | var copy = res; | |
| 3608 | 4019 | |
| 3609 | const arr = try p.coerceArrayInit(&res, first_tok, cur_ty); | |
| 3610 | if (!arr) try p.coerceInit(&res, first_tok, cur_ty); | |
| 3611 | if (cur_il.tok != 0) { | |
| 3612 | try p.errTok(.initializer_overrides, first_tok); | |
| 3613 | try p.errTok(.previous_initializer, cur_il.tok); | |
| 4020 | const arr = try p.coerceArrayInit(copy, tok, init_qt); | |
| 4021 | if (!arr) try p.coerceInit(&copy, tok, init_qt); | |
| 4022 | if (il.tok != 0 and !init_qt.isInvalid()) { | |
| 4023 | try p.err(tok, .initializer_overrides, .{}); | |
| 4024 | try p.err(il.tok, .previous_initializer, .{}); | |
| 4025 | } | |
| 4026 | il.node = .pack(copy.node); | |
| 4027 | il.tok = tok; | |
| 4028 | } | |
| 4029 | ||
| 4030 | /// designation : designator+ '='? | |
| 4031 | /// designator | |
| 4032 | /// : '[' integerConstExpr ']' | |
| 4033 | /// | '.' identifier | |
| 4034 | fn designation(p: *Parser, il: *InitList, init_qt: QualType, index_list: *IndexList) !bool { | |
| 4035 | switch (p.tok_ids[p.tok_i]) { | |
| 4036 | .l_bracket, .period => index_list.items.len = 0, | |
| 4037 | else => return false, | |
| 4038 | } | |
| 4039 | const gpa = p.comp.gpa; | |
| 4040 | ||
| 4041 | var cur_qt = init_qt; | |
| 4042 | var cur_il = il; | |
| 4043 | while (true) { | |
| 4044 | if (p.eatToken(.l_bracket)) |l_bracket| { | |
| 4045 | const array_ty = cur_qt.get(p.comp, .array) orelse { | |
| 4046 | try p.err(l_bracket, .invalid_array_designator, .{cur_qt}); | |
| 4047 | return error.ParsingFailed; | |
| 4048 | }; | |
| 4049 | const expr_tok = p.tok_i; | |
| 4050 | const index_res = try p.integerConstExpr(.gnu_folding_extension); | |
| 4051 | try p.expectClosing(l_bracket, .r_bracket); | |
| 4052 | if (cur_qt.isInvalid()) continue; | |
| 4053 | ||
| 4054 | if (index_res.val.opt_ref == .none) { | |
| 4055 | try p.err(expr_tok, .expected_integer_constant_expr, .{}); | |
| 4056 | return error.ParsingFailed; | |
| 4057 | } else if (index_res.val.compare(.lt, .zero, p.comp)) { | |
| 4058 | try p.err(l_bracket + 1, .negative_array_designator, .{index_res}); | |
| 4059 | return error.ParsingFailed; | |
| 3614 | 4060 | } |
| 3615 | cur_il.node = res.node; | |
| 3616 | cur_il.tok = first_tok; | |
| 3617 | } | |
| 3618 | 4061 | |
| 3619 | if (!saw) { | |
| 3620 | if (designation) { | |
| 3621 | try p.err(.expected_expr); | |
| 4062 | const max_len = switch (array_ty.len) { | |
| 4063 | .fixed, .static => |len| len, | |
| 4064 | else => std.math.maxInt(u64), | |
| 4065 | }; | |
| 4066 | const index_int = index_res.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); | |
| 4067 | if (index_int >= max_len) { | |
| 4068 | try p.err(l_bracket + 1, .oob_array_designator, .{index_res}); | |
| 3622 | 4069 | return error.ParsingFailed; |
| 3623 | 4070 | } |
| 3624 | break; | |
| 3625 | } else if (count == 1) { | |
| 3626 | if (is_str_init) try p.errTok(.excess_str_init, first_tok); | |
| 3627 | if (is_scalar and !is_complex) try p.errTok(.excess_scalar_init, first_tok); | |
| 3628 | } else if (count == 2) { | |
| 3629 | if (is_scalar and is_complex) try p.errTok(.excess_scalar_init, first_tok); | |
| 3630 | } | |
| 3631 | 4071 | |
| 3632 | if (p.eatToken(.comma) == null) break; | |
| 3633 | } | |
| 3634 | try p.expectClosing(l_brace, .r_brace); | |
| 4072 | try index_list.append(gpa, index_int); | |
| 4073 | cur_il = try cur_il.find(gpa, index_int); | |
| 4074 | cur_qt = array_ty.elem; | |
| 4075 | } else if (p.eatToken(.period)) |period| { | |
| 4076 | const field_tok = try p.expectIdentifier(); | |
| 4077 | if (cur_qt.isInvalid()) continue; | |
| 3635 | 4078 | |
| 3636 | if (is_complex and count == 1) { // count of 1 means we saw exactly 2 items in the initializer list | |
| 3637 | try p.errTok(.complex_component_init, l_brace); | |
| 4079 | const field_str = p.tokSlice(field_tok); | |
| 4080 | const target_name = try p.comp.internString(field_str); | |
| 4081 | var record_ty = cur_qt.getRecord(p.comp) orelse { | |
| 4082 | try p.err(period, .invalid_field_designator, .{cur_qt}); | |
| 4083 | return error.ParsingFailed; | |
| 4084 | }; | |
| 4085 | ||
| 4086 | var field_index: u32 = 0; | |
| 4087 | while (field_index < record_ty.fields.len) { | |
| 4088 | const field = record_ty.fields[field_index]; | |
| 4089 | if (field.name_tok == 0) if (field.qt.getRecord(p.comp)) |field_record_ty| { | |
| 4090 | // Recurse into anonymous field if it has a field by the name. | |
| 4091 | if (!field_record_ty.hasField(p.comp, target_name)) continue; | |
| 4092 | try index_list.append(gpa, field_index); | |
| 4093 | cur_il = try il.find(gpa, field_index); | |
| 4094 | record_ty = field_record_ty; | |
| 4095 | field_index = 0; | |
| 4096 | continue; | |
| 4097 | }; | |
| 4098 | if (field.name == target_name) { | |
| 4099 | cur_qt = field.qt; | |
| 4100 | try index_list.append(gpa, field_index); | |
| 4101 | cur_il = try cur_il.find(gpa, field_index); | |
| 4102 | break; | |
| 4103 | } | |
| 4104 | field_index += 1; | |
| 4105 | } else { | |
| 4106 | try p.err(period, .no_such_field_designator, .{field_str}); | |
| 4107 | return error.ParsingFailed; | |
| 4108 | } | |
| 4109 | } else break; | |
| 3638 | 4110 | } |
| 3639 | if (is_scalar or is_str_init) return true; | |
| 3640 | if (il.tok != 0) { | |
| 3641 | try p.errTok(.initializer_overrides, l_brace); | |
| 3642 | try p.errTok(.previous_initializer, il.tok); | |
| 4111 | ||
| 4112 | if (p.eatToken(.equal) == null) { | |
| 4113 | try p.err(p.tok_i, .gnu_missing_eq_designator, .{}); | |
| 3643 | 4114 | } |
| 3644 | il.node = .none; | |
| 3645 | il.tok = l_brace; | |
| 3646 | 4115 | return true; |
| 3647 | 4116 | } |
| 3648 | 4117 | |
| 3649 | /// Returns true if the value is unused. | |
| 3650 | fn findScalarInitializerAt(p: *Parser, il: **InitList, ty: *Type, res: *Result, first_tok: TokenIndex, start_index: *u64) Error!bool { | |
| 3651 | if (ty.isArray()) { | |
| 3652 | if (il.*.node != .none) return false; | |
| 3653 | start_index.* += 1; | |
| 4118 | /// Returns true if the item was filled. | |
| 4119 | fn findScalarInitializer( | |
| 4120 | p: *Parser, | |
| 4121 | il: *InitList, | |
| 4122 | qt: QualType, | |
| 4123 | res: Result, | |
| 4124 | first_tok: TokenIndex, | |
| 4125 | warned_excess: *bool, | |
| 4126 | index_list: *IndexList, | |
| 4127 | index_list_top: u32, | |
| 4128 | ) Error!bool { | |
| 4129 | if (qt.isInvalid()) return false; | |
| 4130 | const gpa = p.comp.gpa; | |
| 4131 | if (index_list.items.len <= index_list_top) try index_list.append(gpa, 0); | |
| 4132 | const index = index_list.items[index_list_top]; | |
| 4133 | ||
| 4134 | switch (qt.base(p.comp).type) { | |
| 4135 | .complex => |complex_ty| { | |
| 4136 | if (il.node != .null or index >= 2) { | |
| 4137 | if (!warned_excess.*) try p.err(first_tok, .excess_scalar_init, .{}); | |
| 4138 | warned_excess.* = true; | |
| 4139 | return true; | |
| 4140 | } | |
| 4141 | if (res.qt.eql(qt, p.comp) and il.list.items.len == 0) { | |
| 4142 | try p.setInitializer(il, qt, first_tok, res); | |
| 4143 | return true; | |
| 4144 | } | |
| 3654 | 4145 | |
| 3655 | const arr_ty = ty.*; | |
| 3656 | const elem_count = arr_ty.arrayLen() orelse std.math.maxInt(u64); | |
| 3657 | if (elem_count == 0) { | |
| 3658 | try p.errTok(.empty_aggregate_init_braces, first_tok); | |
| 3659 | return error.ParsingFailed; | |
| 3660 | } | |
| 3661 | const elem_ty = arr_ty.elemType(); | |
| 3662 | const arr_il = il.*; | |
| 3663 | if (start_index.* < elem_count) { | |
| 3664 | ty.* = elem_ty; | |
| 3665 | il.* = try arr_il.find(p.gpa, start_index.*); | |
| 3666 | _ = try p.findScalarInitializer(il, ty, res, first_tok); | |
| 3667 | return true; | |
| 3668 | } | |
| 3669 | return false; | |
| 3670 | } else if (ty.get(.@"struct")) |struct_ty| { | |
| 3671 | if (il.*.node != .none) return false; | |
| 3672 | start_index.* += 1; | |
| 4146 | const elem_il = try il.find(gpa, index); | |
| 4147 | if (try p.setInitializerIfEqual(elem_il, complex_ty, first_tok, res) or | |
| 4148 | try p.findScalarInitializer( | |
| 4149 | elem_il, | |
| 4150 | complex_ty, | |
| 4151 | res, | |
| 4152 | first_tok, | |
| 4153 | warned_excess, | |
| 4154 | index_list, | |
| 4155 | index_list_top + 1, | |
| 4156 | )) | |
| 4157 | { | |
| 4158 | const new_index = index + 1; | |
| 4159 | index_list.items[index_list_top] = new_index; | |
| 4160 | index_list.items.len = index_list_top + 1; | |
| 4161 | return new_index >= 2; | |
| 4162 | } | |
| 4163 | ||
| 4164 | return false; | |
| 4165 | }, | |
| 4166 | .vector => |vector_ty| { | |
| 4167 | if (il.node != .null or index >= vector_ty.len) { | |
| 4168 | if (!warned_excess.*) try p.err(first_tok, .excess_vector_init, .{}); | |
| 4169 | warned_excess.* = true; | |
| 4170 | return true; | |
| 4171 | } | |
| 4172 | if (il.list.items.len == 0 and (res.qt.eql(qt, p.comp) or | |
| 4173 | (res.qt.is(p.comp, .vector) and res.qt.sizeCompare(qt, p.comp) == .eq))) | |
| 4174 | { | |
| 4175 | try p.setInitializer(il, qt, first_tok, res); | |
| 4176 | return true; | |
| 4177 | } | |
| 4178 | ||
| 4179 | const elem_il = try il.find(gpa, index); | |
| 4180 | if (try p.setInitializerIfEqual(elem_il, vector_ty.elem, first_tok, res) or | |
| 4181 | try p.findScalarInitializer( | |
| 4182 | elem_il, | |
| 4183 | vector_ty.elem, | |
| 4184 | res, | |
| 4185 | first_tok, | |
| 4186 | warned_excess, | |
| 4187 | index_list, | |
| 4188 | index_list_top + 1, | |
| 4189 | )) | |
| 4190 | { | |
| 4191 | const new_index = index + 1; | |
| 4192 | index_list.items[index_list_top] = new_index; | |
| 4193 | index_list.items.len = index_list_top + 1; | |
| 4194 | return new_index >= vector_ty.len; | |
| 4195 | } | |
| 4196 | ||
| 4197 | return false; | |
| 4198 | }, | |
| 4199 | .array => |array_ty| { | |
| 4200 | const max_len = switch (array_ty.len) { | |
| 4201 | .fixed, .static => |len| len, | |
| 4202 | else => std.math.maxInt(u64), | |
| 4203 | }; | |
| 4204 | if (max_len == 0) { | |
| 4205 | try p.err(first_tok, .empty_aggregate_init_braces, .{}); | |
| 4206 | return true; | |
| 4207 | } | |
| 4208 | ||
| 4209 | if (il.node != .null or index >= max_len) { | |
| 4210 | if (!warned_excess.*) { | |
| 4211 | if (il.node.unpack()) |some| if (p.isStringInit(qt, some)) { | |
| 4212 | try p.err(first_tok, .excess_str_init, .{}); | |
| 4213 | warned_excess.* = true; | |
| 4214 | return true; | |
| 4215 | }; | |
| 4216 | try p.err(first_tok, .excess_array_init, .{}); | |
| 4217 | } | |
| 4218 | warned_excess.* = true; | |
| 4219 | return true; | |
| 4220 | } | |
| 4221 | if (il.list.items.len == 0 and p.isStringInit(qt, res.node) and | |
| 4222 | try p.coerceArrayInit(res, first_tok, qt)) | |
| 4223 | { | |
| 4224 | try p.setInitializer(il, qt, first_tok, res); | |
| 4225 | return true; | |
| 4226 | } | |
| 4227 | ||
| 4228 | const elem_il = try il.find(gpa, index); | |
| 4229 | if (try p.setInitializerIfEqual(elem_il, array_ty.elem, first_tok, res) or | |
| 4230 | try p.findScalarInitializer( | |
| 4231 | elem_il, | |
| 4232 | array_ty.elem, | |
| 4233 | res, | |
| 4234 | first_tok, | |
| 4235 | warned_excess, | |
| 4236 | index_list, | |
| 4237 | index_list_top + 1, | |
| 4238 | )) | |
| 4239 | { | |
| 4240 | const new_index = index + 1; | |
| 4241 | index_list.items[index_list_top] = new_index; | |
| 4242 | index_list.items.len = index_list_top + 1; | |
| 4243 | return new_index >= max_len; | |
| 4244 | } | |
| 4245 | ||
| 4246 | return false; | |
| 4247 | }, | |
| 4248 | .@"struct" => |struct_ty| { | |
| 4249 | if (struct_ty.fields.len == 0) { | |
| 4250 | try p.err(first_tok, .empty_aggregate_init_braces, .{}); | |
| 4251 | return true; | |
| 4252 | } | |
| 4253 | ||
| 4254 | if (il.node != .null or index >= struct_ty.fields.len) { | |
| 4255 | if (!warned_excess.*) try p.err(first_tok, .excess_struct_init, .{}); | |
| 4256 | warned_excess.* = true; | |
| 4257 | return true; | |
| 4258 | } | |
| 4259 | ||
| 4260 | const field = struct_ty.fields[@intCast(index)]; | |
| 4261 | const field_il = try il.find(gpa, index); | |
| 4262 | if (try p.setInitializerIfEqual(field_il, field.qt, first_tok, res) or | |
| 4263 | try p.findScalarInitializer( | |
| 4264 | field_il, | |
| 4265 | field.qt, | |
| 4266 | res, | |
| 4267 | first_tok, | |
| 4268 | warned_excess, | |
| 4269 | index_list, | |
| 4270 | index_list_top + 1, | |
| 4271 | )) | |
| 4272 | { | |
| 4273 | const new_index = index + 1; | |
| 4274 | index_list.items[index_list_top] = new_index; | |
| 4275 | index_list.items.len = index_list_top + 1; | |
| 4276 | return new_index >= struct_ty.fields.len; | |
| 4277 | } | |
| 4278 | ||
| 4279 | return false; | |
| 4280 | }, | |
| 4281 | .@"union" => |union_ty| { | |
| 4282 | if (union_ty.fields.len == 0) { | |
| 4283 | try p.err(first_tok, .empty_aggregate_init_braces, .{}); | |
| 4284 | return true; | |
| 4285 | } | |
| 4286 | ||
| 4287 | if (il.node != .null or il.list.items.len > 1 or | |
| 4288 | (il.list.items.len == 1 and il.list.items[0].index != index)) | |
| 4289 | { | |
| 4290 | if (!warned_excess.*) try p.err(first_tok, .excess_union_init, .{}); | |
| 4291 | warned_excess.* = true; | |
| 4292 | return true; | |
| 4293 | } | |
| 4294 | ||
| 4295 | const field = union_ty.fields[@intCast(index)]; | |
| 4296 | const field_il = try il.find(gpa, index); | |
| 4297 | if (try p.setInitializerIfEqual(field_il, field.qt, first_tok, res) or | |
| 4298 | try p.findScalarInitializer( | |
| 4299 | field_il, | |
| 4300 | field.qt, | |
| 4301 | res, | |
| 4302 | first_tok, | |
| 4303 | warned_excess, | |
| 4304 | index_list, | |
| 4305 | index_list_top + 1, | |
| 4306 | )) | |
| 4307 | { | |
| 4308 | const new_index = index + 1; | |
| 4309 | index_list.items[index_list_top] = new_index; | |
| 4310 | index_list.items.len = index_list_top + 1; | |
| 4311 | } | |
| 3673 | 4312 | |
| 3674 | const fields = struct_ty.data.record.fields; | |
| 3675 | if (fields.len == 0) { | |
| 3676 | try p.errTok(.empty_aggregate_init_braces, first_tok); | |
| 3677 | return error.ParsingFailed; | |
| 3678 | } | |
| 3679 | const struct_il = il.*; | |
| 3680 | if (start_index.* < fields.len) { | |
| 3681 | const field = fields[@intCast(start_index.*)]; | |
| 3682 | ty.* = field.ty; | |
| 3683 | il.* = try struct_il.find(p.gpa, start_index.*); | |
| 3684 | _ = try p.findScalarInitializer(il, ty, res, first_tok); | |
| 3685 | 4313 | return true; |
| 3686 | } | |
| 3687 | return false; | |
| 3688 | } else if (ty.get(.@"union")) |_| { | |
| 3689 | return false; | |
| 4314 | }, | |
| 4315 | else => { | |
| 4316 | try p.setInitializer(il, qt, first_tok, res); | |
| 4317 | return true; | |
| 4318 | }, | |
| 3690 | 4319 | } |
| 3691 | return il.*.node == .none; | |
| 3692 | 4320 | } |
| 3693 | 4321 | |
| 3694 | /// Returns true if the value is unused. | |
| 3695 | fn findScalarInitializer(p: *Parser, il: **InitList, ty: *Type, res: *Result, first_tok: TokenIndex) Error!bool { | |
| 3696 | const actual_ty = res.ty; | |
| 3697 | if (ty.isArray() or ty.isComplex()) { | |
| 3698 | if (il.*.node != .none) return false; | |
| 3699 | if (try p.coerceArrayInitExtra(res, first_tok, ty.*, false)) return true; | |
| 3700 | const start_index = il.*.list.items.len; | |
| 3701 | var index = if (start_index != 0) il.*.list.items[start_index - 1].index else start_index; | |
| 4322 | fn setInitializerIfEqual(p: *Parser, il: *InitList, init_qt: QualType, tok: TokenIndex, res: Result) !bool { | |
| 4323 | if (!res.qt.eql(init_qt, p.comp)) return false; | |
| 4324 | try p.setInitializer(il, init_qt, tok, res); | |
| 4325 | return true; | |
| 4326 | } | |
| 3702 | 4327 | |
| 3703 | const arr_ty = ty.*; | |
| 3704 | const elem_count: u64 = arr_ty.expectedInitListSize() orelse std.math.maxInt(u64); | |
| 3705 | if (elem_count == 0) { | |
| 3706 | try p.errTok(.empty_aggregate_init_braces, first_tok); | |
| 3707 | return error.ParsingFailed; | |
| 3708 | } | |
| 3709 | const elem_ty = arr_ty.elemType(); | |
| 3710 | const arr_il = il.*; | |
| 3711 | while (index < elem_count) : (index += 1) { | |
| 3712 | ty.* = elem_ty; | |
| 3713 | il.* = try arr_il.find(p.gpa, index); | |
| 3714 | if (il.*.node == .none and actual_ty.eql(elem_ty, p.comp, false)) return true; | |
| 3715 | if (try p.findScalarInitializer(il, ty, res, first_tok)) return true; | |
| 3716 | } | |
| 3717 | return false; | |
| 3718 | } else if (ty.get(.@"struct")) |struct_ty| { | |
| 3719 | if (il.*.node != .none) return false; | |
| 3720 | if (actual_ty.eql(ty.*, p.comp, false)) return true; | |
| 3721 | const start_index = il.*.list.items.len; | |
| 3722 | var index = if (start_index != 0) il.*.list.items[start_index - 1].index + 1 else start_index; | |
| 3723 | ||
| 3724 | const fields = struct_ty.data.record.fields; | |
| 3725 | if (fields.len == 0) { | |
| 3726 | try p.errTok(.empty_aggregate_init_braces, first_tok); | |
| 3727 | return error.ParsingFailed; | |
| 3728 | } | |
| 3729 | const struct_il = il.*; | |
| 3730 | while (index < fields.len) : (index += 1) { | |
| 3731 | const field = fields[@intCast(index)]; | |
| 3732 | ty.* = field.ty; | |
| 3733 | il.* = try struct_il.find(p.gpa, index); | |
| 3734 | if (il.*.node == .none and actual_ty.eql(field.ty, p.comp, false)) return true; | |
| 3735 | if (il.*.node == .none and try p.coerceArrayInitExtra(res, first_tok, ty.*, false)) return true; | |
| 3736 | if (try p.findScalarInitializer(il, ty, res, first_tok)) return true; | |
| 3737 | } | |
| 3738 | return false; | |
| 3739 | } else if (ty.get(.@"union")) |union_ty| { | |
| 3740 | if (il.*.node != .none) return false; | |
| 3741 | if (actual_ty.eql(ty.*, p.comp, false)) return true; | |
| 3742 | if (union_ty.data.record.fields.len == 0) { | |
| 3743 | try p.errTok(.empty_aggregate_init_braces, first_tok); | |
| 3744 | return error.ParsingFailed; | |
| 3745 | } | |
| 3746 | ty.* = union_ty.data.record.fields[0].ty; | |
| 3747 | il.* = try il.*.find(p.gpa, 0); | |
| 3748 | // if (il.*.node == .none and actual_ty.eql(ty, p.comp, false)) return true; | |
| 3749 | if (try p.coerceArrayInitExtra(res, first_tok, ty.*, false)) return true; | |
| 3750 | if (try p.findScalarInitializer(il, ty, res, first_tok)) return true; | |
| 3751 | return false; | |
| 4328 | const InitItem = struct { il: *InitList, qt: QualType }; | |
| 4329 | ||
| 4330 | fn findBracedInitializer( | |
| 4331 | p: *Parser, | |
| 4332 | il: *InitList, | |
| 4333 | qt: QualType, | |
| 4334 | first_tok: TokenIndex, | |
| 4335 | index_list: *IndexList, | |
| 4336 | ) Error!?InitItem { | |
| 4337 | if (qt.isInvalid()) { | |
| 4338 | if (il.node != .null) return .{ .il = il, .qt = qt }; | |
| 4339 | return null; | |
| 3752 | 4340 | } |
| 3753 | return il.*.node == .none; | |
| 3754 | } | |
| 4341 | const gpa = p.comp.gpa; | |
| 4342 | if (index_list.items.len == 0) try index_list.append(gpa, 0); | |
| 4343 | const index = index_list.items[0]; | |
| 3755 | 4344 | |
| 3756 | fn findAggregateInitializer(p: *Parser, il: **InitList, ty: *Type, start_index: *?u64) Error!bool { | |
| 3757 | if (ty.isArray()) { | |
| 3758 | if (il.*.node != .none) return false; | |
| 3759 | const list_index = il.*.list.items.len; | |
| 3760 | const index = if (start_index.*) |*some| blk: { | |
| 3761 | some.* += 1; | |
| 3762 | break :blk some.*; | |
| 3763 | } else if (list_index != 0) | |
| 3764 | il.*.list.items[list_index - 1].index + 1 | |
| 3765 | else | |
| 3766 | list_index; | |
| 3767 | ||
| 3768 | const arr_ty = ty.*; | |
| 3769 | const elem_count = arr_ty.arrayLen() orelse std.math.maxInt(u64); | |
| 3770 | const elem_ty = arr_ty.elemType(); | |
| 3771 | if (index < elem_count) { | |
| 3772 | ty.* = elem_ty; | |
| 3773 | il.* = try il.*.find(p.gpa, index); | |
| 3774 | return true; | |
| 3775 | } | |
| 3776 | return false; | |
| 3777 | } else if (ty.get(.@"struct")) |struct_ty| { | |
| 3778 | if (il.*.node != .none) return false; | |
| 3779 | const list_index = il.*.list.items.len; | |
| 3780 | const index = if (start_index.*) |*some| blk: { | |
| 3781 | some.* += 1; | |
| 3782 | break :blk some.*; | |
| 3783 | } else if (list_index != 0) | |
| 3784 | il.*.list.items[list_index - 1].index + 1 | |
| 3785 | else | |
| 3786 | list_index; | |
| 4345 | switch (qt.base(p.comp).type) { | |
| 4346 | .complex => |complex_ty| { | |
| 4347 | if (il.node != .null) return null; | |
| 3787 | 4348 | |
| 3788 | const field_count = struct_ty.data.record.fields.len; | |
| 3789 | if (index < field_count) { | |
| 3790 | ty.* = struct_ty.data.record.fields[@intCast(index)].ty; | |
| 3791 | il.* = try il.*.find(p.gpa, index); | |
| 3792 | return true; | |
| 3793 | } | |
| 3794 | return false; | |
| 3795 | } else if (ty.get(.@"union")) |union_ty| { | |
| 3796 | if (il.*.node != .none) return false; | |
| 3797 | if (start_index.*) |_| return false; // overrides | |
| 3798 | if (union_ty.data.record.fields.len == 0) return false; | |
| 4349 | if (index < 2) { | |
| 4350 | index_list.items[0] = index + 1; | |
| 4351 | index_list.items.len = 1; | |
| 4352 | return .{ .il = try il.find(gpa, index), .qt = complex_ty }; | |
| 4353 | } | |
| 4354 | }, | |
| 4355 | .vector => |vector_ty| { | |
| 4356 | if (il.node != .null) return null; | |
| 3799 | 4357 | |
| 3800 | ty.* = union_ty.data.record.fields[0].ty; | |
| 3801 | il.* = try il.*.find(p.gpa, 0); | |
| 3802 | return true; | |
| 3803 | } else { | |
| 3804 | try p.err(.too_many_scalar_init_braces); | |
| 3805 | return il.*.node == .none; | |
| 3806 | } | |
| 3807 | } | |
| 4358 | if (index < vector_ty.len) { | |
| 4359 | index_list.items[0] = index + 1; | |
| 4360 | index_list.items.len = 1; | |
| 4361 | return .{ .il = try il.find(gpa, index), .qt = vector_ty.elem }; | |
| 4362 | } | |
| 4363 | }, | |
| 4364 | .array => |array_ty| { | |
| 4365 | if (il.node != .null) return null; | |
| 3808 | 4366 | |
| 3809 | fn coerceArrayInit(p: *Parser, item: *Result, tok: TokenIndex, target: Type) !bool { | |
| 3810 | return p.coerceArrayInitExtra(item, tok, target, true); | |
| 4367 | const max_len = switch (array_ty.len) { | |
| 4368 | .fixed, .static => |len| len, | |
| 4369 | else => std.math.maxInt(u64), | |
| 4370 | }; | |
| 4371 | if (index < max_len) { | |
| 4372 | index_list.items[0] = index + 1; | |
| 4373 | index_list.items.len = 1; | |
| 4374 | return .{ .il = try il.find(gpa, index), .qt = array_ty.elem }; | |
| 4375 | } | |
| 4376 | }, | |
| 4377 | .@"struct" => |struct_ty| { | |
| 4378 | if (il.node != .null) return null; | |
| 4379 | ||
| 4380 | if (index < struct_ty.fields.len) { | |
| 4381 | index_list.items[0] = index + 1; | |
| 4382 | index_list.items.len = 1; | |
| 4383 | const field_qt = struct_ty.fields[@intCast(index)].qt; | |
| 4384 | return .{ .il = try il.find(gpa, index), .qt = field_qt }; | |
| 4385 | } | |
| 4386 | }, | |
| 4387 | .@"union" => |union_ty| { | |
| 4388 | if (il.node != .null) return null; | |
| 4389 | if (union_ty.fields.len == 0) return null; | |
| 4390 | ||
| 4391 | if (index < union_ty.fields.len) { | |
| 4392 | index_list.items[0] = index + 1; | |
| 4393 | index_list.items.len = 1; | |
| 4394 | const field_qt = union_ty.fields[@intCast(index)].qt; | |
| 4395 | return .{ .il = try il.find(gpa, index), .qt = field_qt }; | |
| 4396 | } | |
| 4397 | }, | |
| 4398 | else => { | |
| 4399 | try p.err(first_tok, .too_many_scalar_init_braces, .{}); | |
| 4400 | if (il.node == .null) return .{ .il = il, .qt = qt }; | |
| 4401 | }, | |
| 4402 | } | |
| 4403 | return null; | |
| 3811 | 4404 | } |
| 3812 | 4405 | |
| 3813 | fn coerceArrayInitExtra(p: *Parser, item: *Result, tok: TokenIndex, target: Type, report_err: bool) !bool { | |
| 3814 | if (!target.isArray()) return false; | |
| 4406 | fn coerceArrayInit(p: *Parser, item: Result, tok: TokenIndex, target: QualType) !bool { | |
| 4407 | if (target.isInvalid()) return false; | |
| 4408 | const target_array_ty = target.get(p.comp, .array) orelse return false; | |
| 3815 | 4409 | |
| 3816 | 4410 | const is_str_lit = p.nodeIs(item.node, .string_literal_expr); |
| 3817 | if (!is_str_lit and !p.nodeIsCompoundLiteral(item.node) or !item.ty.isArray()) { | |
| 3818 | if (!report_err) return false; | |
| 3819 | try p.errTok(.array_init_str, tok); | |
| 4411 | const maybe_item_array_ty = item.qt.get(p.comp, .array); | |
| 4412 | if (!is_str_lit and (!p.nodeIs(item.node, .compound_literal_expr) or maybe_item_array_ty == null)) { | |
| 4413 | try p.err(tok, .array_init_str, .{}); | |
| 3820 | 4414 | return true; // do not do further coercion |
| 3821 | 4415 | } |
| 3822 | 4416 | |
| 3823 | const target_spec = target.elemType().canonicalize(.standard).specifier; | |
| 3824 | const item_spec = item.ty.elemType().canonicalize(.standard).specifier; | |
| 4417 | const target_elem = target_array_ty.elem; | |
| 4418 | const item_elem = maybe_item_array_ty.?.elem; | |
| 4419 | ||
| 4420 | const target_int = target_elem.get(p.comp, .int) orelse .int; // not int; string compat checks below will fail by design | |
| 4421 | const item_int = item_elem.get(p.comp, .int) orelse .int; // not int; string compat checks below will fail by design | |
| 3825 | 4422 | |
| 3826 | const compatible = target.elemType().eql(item.ty.elemType(), p.comp, false) or | |
| 3827 | (is_str_lit and item_spec == .char and (target_spec == .uchar or target_spec == .schar)) or | |
| 3828 | (is_str_lit and item_spec == .uchar and (target_spec == .uchar or target_spec == .schar or target_spec == .char)); | |
| 4423 | const compatible = target_elem.eql(item_elem, p.comp) or | |
| 4424 | (is_str_lit and item_int == .char and (target_int == .uchar or target_int == .schar)) or | |
| 4425 | (is_str_lit and item_int == .uchar and (target_int == .uchar or target_int == .schar or target_int == .char)); | |
| 3829 | 4426 | if (!compatible) { |
| 3830 | if (!report_err) return false; | |
| 3831 | const e_msg = " with array of type "; | |
| 3832 | try p.errStr(.incompatible_array_init, tok, try p.typePairStrExtra(target, e_msg, item.ty)); | |
| 4427 | try p.err(tok, .incompatible_array_init, .{ target, item.qt }); | |
| 3833 | 4428 | return true; // do not do further coercion |
| 3834 | 4429 | } |
| 3835 | 4430 | |
| 3836 | if (target.get(.array)) |arr_ty| { | |
| 3837 | assert(item.ty.specifier == .array); | |
| 3838 | const len = item.ty.arrayLen().?; | |
| 3839 | const array_len = arr_ty.arrayLen().?; | |
| 4431 | if (target_array_ty.len == .fixed) { | |
| 4432 | const target_len = target_array_ty.len.fixed; | |
| 4433 | const item_len = switch (maybe_item_array_ty.?.len) { | |
| 4434 | .fixed, .static => |len| len, | |
| 4435 | else => unreachable, | |
| 4436 | }; | |
| 4437 | ||
| 3840 | 4438 | if (is_str_lit) { |
| 3841 | 4439 | // the null byte of a string can be dropped |
| 3842 | if (len - 1 > array_len and report_err) { | |
| 3843 | try p.errTok(.str_init_too_long, tok); | |
| 3844 | } | |
| 3845 | } else if (len > array_len and report_err) { | |
| 3846 | try p.errStr( | |
| 3847 | .arr_init_too_long, | |
| 3848 | tok, | |
| 3849 | try p.typePairStrExtra(target, " with array of type ", item.ty), | |
| 3850 | ); | |
| 4440 | if (item_len - 1 > target_len) { | |
| 4441 | try p.err(tok, .str_init_too_long, .{}); | |
| 4442 | } | |
| 4443 | } else if (item_len > target_len) { | |
| 4444 | try p.err(tok, .arr_init_too_long, .{ target, item.qt }); | |
| 3851 | 4445 | } |
| 3852 | 4446 | } |
| 3853 | 4447 | return true; |
| 3854 | 4448 | } |
| 3855 | 4449 | |
| 3856 | fn coerceInit(p: *Parser, item: *Result, tok: TokenIndex, target: Type) !void { | |
| 3857 | if (target.is(.void)) return; // Do not do type coercion on excess items | |
| 4450 | fn coerceInit(p: *Parser, item: *Result, tok: TokenIndex, target: QualType) !void { | |
| 4451 | if (target.isInvalid()) return; | |
| 3858 | 4452 | |
| 3859 | 4453 | const node = item.node; |
| 3860 | try item.lvalConversion(p); | |
| 3861 | if (target.is(.auto_type)) { | |
| 3862 | if (p.getNode(node, .member_access_expr) orelse p.getNode(node, .member_access_ptr_expr)) |member_node| { | |
| 3863 | if (p.tmpTree().isBitfield(member_node)) try p.errTok(.auto_type_from_bitfield, tok); | |
| 4454 | if (target.isAutoType() or target.isC23Auto()) { | |
| 4455 | if (p.getNode(node, .member_access_expr) orelse p.getNode(node, .member_access_ptr_expr)) |access| { | |
| 4456 | if (access.isBitFieldWidth(&p.tree) != null) try p.err(tok, .auto_type_from_bitfield, .{}); | |
| 3864 | 4457 | } |
| 3865 | return; | |
| 3866 | } else if (target.is(.c23_auto)) { | |
| 4458 | try item.lvalConversion(p, tok); | |
| 3867 | 4459 | return; |
| 3868 | 4460 | } |
| 3869 | 4461 | |
| 3870 | 4462 | try item.coerce(p, target, tok, .init); |
| 4463 | if (item.val.opt_ref == .none) runtime: { | |
| 4464 | const diagnostic: Diagnostic = switch (p.init_context) { | |
| 4465 | .runtime => break :runtime, | |
| 4466 | .constexpr => .constexpr_requires_const, | |
| 4467 | .static => break :runtime, // TODO: set this to .non_constant_initializer once we are capable of saving all valid values | |
| 4468 | }; | |
| 4469 | p.init_context = .runtime; // Suppress further "non-constant initializer" errors | |
| 4470 | try p.err(tok, diagnostic, .{}); | |
| 4471 | } | |
| 4472 | if (target.@"const" or p.init_context == .constexpr) { | |
| 4473 | return item.putValue(p); | |
| 4474 | } | |
| 4475 | return item.saveValue(p); | |
| 3871 | 4476 | } |
| 3872 | 4477 | |
| 3873 | fn isStringInit(p: *Parser, ty: Type) bool { | |
| 3874 | if (!ty.isArray() or !ty.elemType().isInt()) return false; | |
| 3875 | var i = p.tok_i; | |
| 3876 | while (true) : (i += 1) { | |
| 3877 | switch (p.tok_ids[i]) { | |
| 3878 | .l_paren => {}, | |
| 3879 | .string_literal, | |
| 3880 | .string_literal_utf_16, | |
| 3881 | .string_literal_utf_8, | |
| 3882 | .string_literal_utf_32, | |
| 3883 | .string_literal_wide, | |
| 3884 | => return true, | |
| 3885 | else => return false, | |
| 3886 | } | |
| 3887 | } | |
| 4478 | fn isStringInit(p: *Parser, init_qt: QualType, node: Node.Index) bool { | |
| 4479 | const init_array_ty = init_qt.get(p.comp, .array) orelse return false; | |
| 4480 | if (!init_array_ty.elem.is(p.comp, .int)) return false; | |
| 4481 | return p.nodeIs(node, .string_literal_expr); | |
| 3888 | 4482 | } |
| 3889 | 4483 | |
| 3890 | 4484 | /// Convert InitList into an AST |
| 3891 | fn convertInitList(p: *Parser, il: InitList, init_ty: Type) Error!NodeIndex { | |
| 3892 | const is_complex = init_ty.isComplex(); | |
| 3893 | if (init_ty.isScalar() and !is_complex) { | |
| 3894 | if (il.node == .none) { | |
| 3895 | return p.addNode(.{ .tag = .default_init_expr, .ty = init_ty, .data = undefined }); | |
| 3896 | } | |
| 3897 | return il.node; | |
| 3898 | } else if (init_ty.is(.variable_len_array)) { | |
| 3899 | return error.ParsingFailed; // vla invalid, reported earlier | |
| 3900 | } else if (init_ty.isArray() or is_complex) { | |
| 3901 | if (il.node != .none) { | |
| 3902 | return il.node; | |
| 3903 | } | |
| 3904 | const list_buf_top = p.list_buf.items.len; | |
| 3905 | defer p.list_buf.items.len = list_buf_top; | |
| 3906 | ||
| 3907 | const elem_ty = init_ty.elemType(); | |
| 3908 | ||
| 3909 | const max_items: u64 = init_ty.expectedInitListSize() orelse std.math.maxInt(usize); | |
| 3910 | var start: u64 = 0; | |
| 3911 | for (il.list.items) |*init| { | |
| 3912 | if (init.index > start) { | |
| 4485 | fn convertInitList(p: *Parser, il: InitList, init_qt: QualType) Error!Node.Index { | |
| 4486 | if (init_qt.isInvalid()) { | |
| 4487 | return try p.addNode(.{ .default_init_expr = .{ | |
| 4488 | .last_tok = p.tok_i, | |
| 4489 | .qt = init_qt, | |
| 4490 | } }); | |
| 4491 | } | |
| 4492 | ||
| 4493 | if (il.node.unpack()) |some| return some; | |
| 4494 | ||
| 4495 | const gpa = p.comp.gpa; | |
| 4496 | switch (init_qt.base(p.comp).type) { | |
| 4497 | .complex => |complex_ty| { | |
| 4498 | if (il.list.items.len == 0) { | |
| 4499 | return p.addNode(.{ .default_init_expr = .{ | |
| 4500 | .last_tok = p.tok_i - 1, | |
| 4501 | .qt = init_qt, | |
| 4502 | } }); | |
| 4503 | } | |
| 4504 | const first = try p.convertInitList(il.list.items[0].list, complex_ty); | |
| 4505 | const second = if (il.list.items.len > 1) | |
| 4506 | try p.convertInitList(il.list.items[1].list, complex_ty) | |
| 4507 | else | |
| 4508 | null; | |
| 4509 | ||
| 4510 | if (il.list.items.len == 2) { | |
| 4511 | try p.err(il.tok, .complex_component_init, .{}); | |
| 4512 | } | |
| 4513 | ||
| 4514 | const node = try p.addNode(.{ .array_init_expr = .{ | |
| 4515 | .container_qt = init_qt, | |
| 4516 | .items = if (second) |some| | |
| 4517 | &.{ first, some } | |
| 4518 | else | |
| 4519 | &.{first}, | |
| 4520 | .l_brace_tok = il.tok, | |
| 4521 | } }); | |
| 4522 | if (!complex_ty.isFloat(p.comp)) return node; | |
| 4523 | ||
| 4524 | const first_node = il.list.items[0].list.node.unpack() orelse return node; | |
| 4525 | const second_node = if (il.list.items.len > 1) il.list.items[1].list.node else .null; | |
| 4526 | ||
| 4527 | const first_val = p.tree.value_map.get(first_node) orelse return node; | |
| 4528 | const second_val = if (second_node.unpack()) |some| p.tree.value_map.get(some) orelse return node else Value.zero; | |
| 4529 | const complex_val = try Value.intern(p.comp, switch (complex_ty.bitSizeof(p.comp)) { | |
| 4530 | 32 => .{ .complex = .{ .cf32 = .{ first_val.toFloat(f32, p.comp), second_val.toFloat(f32, p.comp) } } }, | |
| 4531 | 64 => .{ .complex = .{ .cf64 = .{ first_val.toFloat(f64, p.comp), second_val.toFloat(f64, p.comp) } } }, | |
| 4532 | 80 => .{ .complex = .{ .cf80 = .{ first_val.toFloat(f80, p.comp), second_val.toFloat(f80, p.comp) } } }, | |
| 4533 | 128 => .{ .complex = .{ .cf128 = .{ first_val.toFloat(f128, p.comp), second_val.toFloat(f128, p.comp) } } }, | |
| 4534 | else => unreachable, | |
| 4535 | }); | |
| 4536 | try p.tree.value_map.put(gpa, node, complex_val); | |
| 4537 | return node; | |
| 4538 | }, | |
| 4539 | .vector => |vector_ty| { | |
| 4540 | const list_buf_top = p.list_buf.items.len; | |
| 4541 | defer p.list_buf.items.len = list_buf_top; | |
| 4542 | ||
| 4543 | const elem_ty = init_qt.childType(p.comp); | |
| 4544 | ||
| 4545 | const max_len = vector_ty.len; | |
| 4546 | var start: u64 = 0; | |
| 4547 | for (il.list.items) |*init| { | |
| 4548 | if (init.index > start) { | |
| 4549 | const elem = try p.addNode(.{ | |
| 4550 | .array_filler_expr = .{ | |
| 4551 | .last_tok = p.tok_i - 1, | |
| 4552 | .count = init.index - start, | |
| 4553 | .qt = elem_ty, | |
| 4554 | }, | |
| 4555 | }); | |
| 4556 | try p.list_buf.append(gpa, elem); | |
| 4557 | } | |
| 4558 | start = init.index + 1; | |
| 4559 | ||
| 4560 | const elem = try p.convertInitList(init.list, elem_ty); | |
| 4561 | try p.list_buf.append(gpa, elem); | |
| 4562 | } | |
| 4563 | ||
| 4564 | if (start < max_len) { | |
| 3913 | 4565 | const elem = try p.addNode(.{ |
| 3914 | .tag = .array_filler_expr, | |
| 3915 | .ty = elem_ty, | |
| 3916 | .data = .{ .int = init.index - start }, | |
| 4566 | .array_filler_expr = .{ | |
| 4567 | .last_tok = p.tok_i - 1, | |
| 4568 | .count = max_len - start, | |
| 4569 | .qt = elem_ty, | |
| 4570 | }, | |
| 3917 | 4571 | }); |
| 3918 | try p.list_buf.append(elem); | |
| 4572 | try p.list_buf.append(gpa, elem); | |
| 3919 | 4573 | } |
| 3920 | start = init.index + 1; | |
| 3921 | 4574 | |
| 3922 | const elem = try p.convertInitList(init.list, elem_ty); | |
| 3923 | try p.list_buf.append(elem); | |
| 3924 | } | |
| 3925 | ||
| 3926 | var arr_init_node: Tree.Node = .{ | |
| 3927 | .tag = .array_init_expr_two, | |
| 3928 | .ty = init_ty, | |
| 3929 | .data = .{ .two = .{ .none, .none } }, | |
| 3930 | }; | |
| 3931 | ||
| 3932 | const max_elems = p.comp.maxArrayBytes() / (@max(1, elem_ty.sizeof(p.comp) orelse 1)); | |
| 3933 | if (start > max_elems) { | |
| 3934 | try p.errTok(.array_too_large, il.tok); | |
| 3935 | start = max_elems; | |
| 3936 | } | |
| 3937 | ||
| 3938 | if (init_ty.specifier == .incomplete_array) { | |
| 3939 | arr_init_node.ty.specifier = .array; | |
| 3940 | arr_init_node.ty.data.array.len = start; | |
| 3941 | } else if (init_ty.is(.incomplete_array)) { | |
| 3942 | const arr_ty = try p.arena.create(Type.Array); | |
| 3943 | arr_ty.* = .{ .elem = init_ty.elemType(), .len = start }; | |
| 3944 | arr_init_node.ty = .{ | |
| 3945 | .specifier = .array, | |
| 3946 | .data = .{ .array = arr_ty }, | |
| 4575 | return p.addNode(.{ .array_init_expr = .{ | |
| 4576 | .l_brace_tok = il.tok, | |
| 4577 | .container_qt = init_qt, | |
| 4578 | .items = p.list_buf.items[list_buf_top..], | |
| 4579 | } }); | |
| 4580 | }, | |
| 4581 | .array => |array_ty| { | |
| 4582 | const list_buf_top = p.list_buf.items.len; | |
| 4583 | defer p.list_buf.items.len = list_buf_top; | |
| 4584 | ||
| 4585 | const elem_ty = init_qt.childType(p.comp); | |
| 4586 | ||
| 4587 | const max_len = switch (array_ty.len) { | |
| 4588 | .fixed, .static => |len| len, | |
| 4589 | // vla invalid, reported earlier | |
| 4590 | .variable => return try p.addNode(.{ .default_init_expr = .{ | |
| 4591 | .last_tok = p.tok_i, | |
| 4592 | .qt = init_qt, | |
| 4593 | } }), | |
| 4594 | else => std.math.maxInt(u64), | |
| 3947 | 4595 | }; |
| 3948 | } else if (start < max_items) { | |
| 3949 | const elem = try p.addNode(.{ | |
| 3950 | .tag = .array_filler_expr, | |
| 3951 | .ty = elem_ty, | |
| 3952 | .data = .{ .int = max_items - start }, | |
| 3953 | }); | |
| 3954 | try p.list_buf.append(elem); | |
| 3955 | } | |
| 4596 | var start: u64 = 0; | |
| 4597 | for (il.list.items) |*init| { | |
| 4598 | if (init.index > start) { | |
| 4599 | const elem = try p.addNode(.{ | |
| 4600 | .array_filler_expr = .{ | |
| 4601 | .last_tok = p.tok_i - 1, | |
| 4602 | .count = init.index - start, | |
| 4603 | .qt = elem_ty, | |
| 4604 | }, | |
| 4605 | }); | |
| 4606 | try p.list_buf.append(gpa, elem); | |
| 4607 | } | |
| 4608 | start = init.index + 1; | |
| 3956 | 4609 | |
| 3957 | const items = p.list_buf.items[list_buf_top..]; | |
| 3958 | switch (items.len) { | |
| 3959 | 0 => {}, | |
| 3960 | 1 => arr_init_node.data.two[0] = items[0], | |
| 3961 | 2 => arr_init_node.data.two = .{ items[0], items[1] }, | |
| 3962 | else => { | |
| 3963 | arr_init_node.tag = .array_init_expr; | |
| 3964 | arr_init_node.data = .{ .range = try p.addList(items) }; | |
| 3965 | }, | |
| 3966 | } | |
| 3967 | return try p.addNode(arr_init_node); | |
| 3968 | } else if (init_ty.get(.@"struct")) |struct_ty| { | |
| 3969 | assert(!struct_ty.hasIncompleteSize()); | |
| 3970 | if (il.node != .none) { | |
| 3971 | return il.node; | |
| 3972 | } | |
| 4610 | const elem = try p.convertInitList(init.list, elem_ty); | |
| 4611 | try p.list_buf.append(gpa, elem); | |
| 4612 | } | |
| 3973 | 4613 | |
| 3974 | const list_buf_top = p.list_buf.items.len; | |
| 3975 | defer p.list_buf.items.len = list_buf_top; | |
| 4614 | const max_elems = p.comp.maxArrayBytes() / (@max(1, elem_ty.sizeofOrNull(p.comp) orelse 1)); | |
| 4615 | if (start > max_elems) { | |
| 4616 | try p.err(il.tok, .array_too_large, .{}); | |
| 4617 | start = max_elems; | |
| 4618 | } | |
| 3976 | 4619 | |
| 3977 | var init_index: usize = 0; | |
| 3978 | for (struct_ty.data.record.fields, 0..) |f, i| { | |
| 3979 | if (init_index < il.list.items.len and il.list.items[init_index].index == i) { | |
| 3980 | const item = try p.convertInitList(il.list.items[init_index].list, f.ty); | |
| 3981 | try p.list_buf.append(item); | |
| 3982 | init_index += 1; | |
| 3983 | } else { | |
| 3984 | const item = try p.addNode(.{ .tag = .default_init_expr, .ty = f.ty, .data = undefined }); | |
| 3985 | try p.list_buf.append(item); | |
| 4620 | var arr_init_qt = init_qt; | |
| 4621 | if (array_ty.len == .incomplete) { | |
| 4622 | arr_init_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 4623 | .elem = array_ty.elem, | |
| 4624 | .len = .{ .fixed = start }, | |
| 4625 | } }); | |
| 4626 | } else if (start < max_len) { | |
| 4627 | const elem = try p.addNode(.{ | |
| 4628 | .array_filler_expr = .{ | |
| 4629 | .last_tok = p.tok_i - 1, | |
| 4630 | .count = max_len - start, | |
| 4631 | .qt = elem_ty, | |
| 4632 | }, | |
| 4633 | }); | |
| 4634 | try p.list_buf.append(gpa, elem); | |
| 3986 | 4635 | } |
| 3987 | } | |
| 3988 | 4636 | |
| 3989 | var struct_init_node: Tree.Node = .{ | |
| 3990 | .tag = .struct_init_expr_two, | |
| 3991 | .ty = init_ty, | |
| 3992 | .data = .{ .two = .{ .none, .none } }, | |
| 3993 | }; | |
| 3994 | const items = p.list_buf.items[list_buf_top..]; | |
| 3995 | switch (items.len) { | |
| 3996 | 0 => {}, | |
| 3997 | 1 => struct_init_node.data.two[0] = items[0], | |
| 3998 | 2 => struct_init_node.data.two = .{ items[0], items[1] }, | |
| 3999 | else => { | |
| 4000 | struct_init_node.tag = .struct_init_expr; | |
| 4001 | struct_init_node.data = .{ .range = try p.addList(items) }; | |
| 4002 | }, | |
| 4003 | } | |
| 4004 | return try p.addNode(struct_init_node); | |
| 4005 | } else if (init_ty.get(.@"union")) |union_ty| { | |
| 4006 | if (il.node != .none) { | |
| 4007 | return il.node; | |
| 4008 | } | |
| 4637 | return p.addNode(.{ .array_init_expr = .{ | |
| 4638 | .l_brace_tok = il.tok, | |
| 4639 | .container_qt = arr_init_qt, | |
| 4640 | .items = p.list_buf.items[list_buf_top..], | |
| 4641 | } }); | |
| 4642 | }, | |
| 4643 | .@"struct" => |struct_ty| { | |
| 4644 | assert(struct_ty.layout != null); | |
| 4645 | const list_buf_top = p.list_buf.items.len; | |
| 4646 | defer p.list_buf.items.len = list_buf_top; | |
| 4647 | ||
| 4648 | var init_index: usize = 0; | |
| 4649 | for (struct_ty.fields, 0..) |field, i| { | |
| 4650 | if (init_index < il.list.items.len and il.list.items[init_index].index == i) { | |
| 4651 | const item = try p.convertInitList(il.list.items[init_index].list, field.qt); | |
| 4652 | try p.list_buf.append(gpa, item); | |
| 4653 | init_index += 1; | |
| 4654 | } else { | |
| 4655 | const item = try p.addNode(.{ | |
| 4656 | .default_init_expr = .{ | |
| 4657 | .last_tok = il.tok, | |
| 4658 | .qt = field.qt, | |
| 4659 | }, | |
| 4660 | }); | |
| 4661 | try p.list_buf.append(gpa, item); | |
| 4662 | } | |
| 4663 | } | |
| 4009 | 4664 | |
| 4010 | var union_init_node: Tree.Node = .{ | |
| 4011 | .tag = .union_init_expr, | |
| 4012 | .ty = init_ty, | |
| 4013 | .data = .{ .union_init = .{ .field_index = 0, .node = .none } }, | |
| 4014 | }; | |
| 4015 | if (union_ty.data.record.fields.len == 0) { | |
| 4016 | // do nothing for empty unions | |
| 4017 | } else if (il.list.items.len == 0) { | |
| 4018 | union_init_node.data.union_init.node = try p.addNode(.{ | |
| 4019 | .tag = .default_init_expr, | |
| 4020 | .ty = init_ty, | |
| 4021 | .data = undefined, | |
| 4022 | }); | |
| 4023 | } else { | |
| 4024 | const init = il.list.items[0]; | |
| 4025 | const index: u32 = @truncate(init.index); | |
| 4026 | const field_ty = union_ty.data.record.fields[index].ty; | |
| 4027 | union_init_node.data.union_init = .{ | |
| 4028 | .field_index = index, | |
| 4029 | .node = try p.convertInitList(init.list, field_ty), | |
| 4665 | return p.addNode(.{ .struct_init_expr = .{ | |
| 4666 | .l_brace_tok = il.tok, | |
| 4667 | .container_qt = init_qt, | |
| 4668 | .items = p.list_buf.items[list_buf_top..], | |
| 4669 | } }); | |
| 4670 | }, | |
| 4671 | .@"union" => |union_ty| { | |
| 4672 | const init_node, const index = if (union_ty.fields.len == 0) | |
| 4673 | // do nothing for empty unions | |
| 4674 | .{ null, 0 } | |
| 4675 | else if (il.list.items.len == 0) | |
| 4676 | .{ try p.addNode(.{ .default_init_expr = .{ | |
| 4677 | .last_tok = p.tok_i - 1, | |
| 4678 | .qt = init_qt, | |
| 4679 | } }), 0 } | |
| 4680 | else blk: { | |
| 4681 | const init = il.list.items[0]; | |
| 4682 | const index: u32 = @truncate(init.index); | |
| 4683 | const field_qt = union_ty.fields[index].qt; | |
| 4684 | ||
| 4685 | break :blk .{ try p.convertInitList(init.list, field_qt), index }; | |
| 4030 | 4686 | }; |
| 4031 | } | |
| 4032 | return try p.addNode(union_init_node); | |
| 4033 | } else { | |
| 4034 | return error.ParsingFailed; // initializer target is invalid, reported earlier | |
| 4687 | return p.addNode(.{ .union_init_expr = .{ | |
| 4688 | .field_index = index, | |
| 4689 | .initializer = init_node, | |
| 4690 | .l_brace_tok = il.tok, | |
| 4691 | .union_qt = init_qt, | |
| 4692 | } }); | |
| 4693 | }, | |
| 4694 | // initializer target is invalid, reported earlier | |
| 4695 | else => return try p.addNode(.{ .default_init_expr = .{ | |
| 4696 | .last_tok = p.tok_i, | |
| 4697 | .qt = init_qt, | |
| 4698 | } }), | |
| 4035 | 4699 | } |
| 4036 | 4700 | } |
| 4037 | 4701 | |
| 4038 | fn msvcAsmStmt(p: *Parser) Error!?NodeIndex { | |
| 4702 | fn msvcAsmStmt(p: *Parser) Error!?Node.Index { | |
| 4039 | 4703 | return p.todo("MSVC assembly statements"); |
| 4040 | 4704 | } |
| 4041 | 4705 | |
| 4042 | 4706 | /// asmOperand : ('[' IDENTIFIER ']')? asmStr '(' expr ')' |
| 4043 | fn asmOperand(p: *Parser, names: *std.array_list.Managed(?TokenIndex), constraints: *NodeList, exprs: *NodeList) Error!void { | |
| 4707 | fn asmOperand(p: *Parser, names: *std.ArrayList(?TokenIndex), constraints: *NodeList, exprs: *NodeList) Error!void { | |
| 4708 | const gpa = p.comp.gpa; | |
| 4044 | 4709 | if (p.eatToken(.l_bracket)) |l_bracket| { |
| 4045 | 4710 | const ident = (try p.eatIdentifier()) orelse { |
| 4046 | try p.err(.expected_identifier); | |
| 4711 | try p.err(p.tok_i, .expected_identifier, .{}); | |
| 4047 | 4712 | return error.ParsingFailed; |
| 4048 | 4713 | }; |
| 4049 | try names.append(ident); | |
| 4714 | try names.append(gpa, ident); | |
| 4050 | 4715 | try p.expectClosing(l_bracket, .r_bracket); |
| 4051 | 4716 | } else { |
| 4052 | try names.append(null); | |
| 4717 | try names.append(gpa, null); | |
| 4053 | 4718 | } |
| 4054 | 4719 | const constraint = try p.asmStr(); |
| 4055 | try constraints.append(constraint.node); | |
| 4720 | try constraints.append(gpa, constraint.node); | |
| 4056 | 4721 | |
| 4057 | 4722 | const l_paren = p.eatToken(.l_paren) orelse { |
| 4058 | try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ .actual = p.tok_ids[p.tok_i], .expected = .l_paren } }); | |
| 4723 | try p.err(p.tok_i, .expected_token, .{ p.tok_ids[p.tok_i], Token.Id.l_paren }); | |
| 4059 | 4724 | return error.ParsingFailed; |
| 4060 | 4725 | }; |
| 4061 | const res = try p.expr(); | |
| 4726 | const maybe_res = try p.expr(); | |
| 4062 | 4727 | try p.expectClosing(l_paren, .r_paren); |
| 4063 | try res.expect(p); | |
| 4064 | try exprs.append(res.node); | |
| 4728 | const res = try p.expectResult(maybe_res); | |
| 4729 | try exprs.append(gpa, res.node); | |
| 4065 | 4730 | } |
| 4066 | 4731 | |
| 4067 | 4732 | /// gnuAsmStmt |
| ... | ... | @@ -4070,34 +4735,39 @@ fn asmOperand(p: *Parser, names: *std.array_list.Managed(?TokenIndex), constrain |
| 4070 | 4735 | /// | asmStr ':' asmOperand* ':' asmOperand* |
| 4071 | 4736 | /// | asmStr ':' asmOperand* ':' asmOperand* : asmStr? (',' asmStr)* |
| 4072 | 4737 | /// | asmStr ':' asmOperand* ':' asmOperand* : asmStr? (',' asmStr)* : IDENTIFIER (',' IDENTIFIER)* |
| 4073 | fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex, l_paren: TokenIndex) Error!NodeIndex { | |
| 4738 | fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex, l_paren: TokenIndex) Error!Node.Index { | |
| 4739 | const gpa = p.comp.gpa; | |
| 4074 | 4740 | const asm_str = try p.asmStr(); |
| 4075 | 4741 | try p.checkAsmStr(asm_str.val, l_paren); |
| 4076 | 4742 | |
| 4077 | 4743 | if (p.tok_ids[p.tok_i] == .r_paren) { |
| 4078 | return p.addNode(.{ | |
| 4079 | .tag = .gnu_asm_simple, | |
| 4080 | .ty = .{ .specifier = .void }, | |
| 4081 | .data = .{ .un = asm_str.node }, | |
| 4082 | .loc = @enumFromInt(asm_tok), | |
| 4744 | return try p.addNode(.{ | |
| 4745 | .gnu_asm_simple = .{ | |
| 4746 | .asm_str = asm_str.node, | |
| 4747 | .asm_tok = asm_tok, | |
| 4748 | }, | |
| 4083 | 4749 | }); |
| 4084 | 4750 | } |
| 4085 | 4751 | |
| 4086 | 4752 | const expected_items = 8; // arbitrarily chosen, most assembly will have fewer than 8 inputs/outputs/constraints/names |
| 4087 | const bytes_needed = expected_items * @sizeOf(?TokenIndex) + expected_items * 3 * @sizeOf(NodeIndex); | |
| 4753 | const bytes_needed = expected_items * @sizeOf(?TokenIndex) + expected_items * 3 * @sizeOf(Node.Index); | |
| 4088 | 4754 | |
| 4089 | var stack_fallback = std.heap.stackFallback(bytes_needed, p.gpa); | |
| 4755 | var stack_fallback = std.heap.stackFallback(bytes_needed, gpa); | |
| 4090 | 4756 | const allocator = stack_fallback.get(); |
| 4091 | 4757 | |
| 4092 | 4758 | // TODO: Consider using a TokenIndex of 0 instead of null if we need to store the names in the tree |
| 4093 | var names = std.array_list.Managed(?TokenIndex).initCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded | |
| 4094 | defer names.deinit(); | |
| 4095 | var constraints = NodeList.initCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded | |
| 4096 | defer constraints.deinit(); | |
| 4097 | var exprs = NodeList.initCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded | |
| 4098 | defer exprs.deinit(); | |
| 4099 | var clobbers = NodeList.initCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded | |
| 4100 | defer clobbers.deinit(); | |
| 4759 | var names: std.ArrayList(?TokenIndex) = .empty; | |
| 4760 | defer names.deinit(allocator); | |
| 4761 | names.ensureUnusedCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded | |
| 4762 | var constraints: NodeList = .empty; | |
| 4763 | defer constraints.deinit(allocator); | |
| 4764 | constraints.ensureUnusedCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded | |
| 4765 | var exprs: NodeList = .empty; | |
| 4766 | defer exprs.deinit(allocator); | |
| 4767 | exprs.ensureUnusedCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded | |
| 4768 | var clobbers: NodeList = .empty; | |
| 4769 | defer clobbers.deinit(allocator); | |
| 4770 | clobbers.ensureUnusedCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded | |
| 4101 | 4771 | |
| 4102 | 4772 | // Outputs |
| 4103 | 4773 | var ate_extra_colon = false; |
| ... | ... | @@ -4147,14 +4817,14 @@ fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex |
| 4147 | 4817 | if (!ate_extra_colon and p.tok_ids[p.tok_i].isStringLiteral()) { |
| 4148 | 4818 | while (true) { |
| 4149 | 4819 | const clobber = try p.asmStr(); |
| 4150 | try clobbers.append(clobber.node); | |
| 4820 | try clobbers.append(allocator, clobber.node); | |
| 4151 | 4821 | if (p.eatToken(.comma) == null) break; |
| 4152 | 4822 | } |
| 4153 | 4823 | } |
| 4154 | 4824 | } |
| 4155 | 4825 | |
| 4156 | 4826 | if (!quals.goto and (p.tok_ids[p.tok_i] != .r_paren or ate_extra_colon)) { |
| 4157 | try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ .actual = p.tok_ids[p.tok_i], .expected = .r_paren } }); | |
| 4827 | try p.err(p.tok_i, .expected_token, .{ Tree.Token.Id.r_paren, p.tok_ids[p.tok_i] }); | |
| 4158 | 4828 | return error.ParsingFailed; |
| 4159 | 4829 | } |
| 4160 | 4830 | |
| ... | ... | @@ -4166,38 +4836,37 @@ fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex |
| 4166 | 4836 | } |
| 4167 | 4837 | while (true) { |
| 4168 | 4838 | const ident = (try p.eatIdentifier()) orelse { |
| 4169 | try p.err(.expected_identifier); | |
| 4839 | try p.err(p.tok_i, .expected_identifier, .{}); | |
| 4170 | 4840 | return error.ParsingFailed; |
| 4171 | 4841 | }; |
| 4172 | 4842 | const ident_str = p.tokSlice(ident); |
| 4173 | 4843 | const label = p.findLabel(ident_str) orelse blk: { |
| 4174 | try p.labels.append(.{ .unresolved_goto = ident }); | |
| 4844 | try p.labels.append(gpa, .{ .unresolved_goto = ident }); | |
| 4175 | 4845 | break :blk ident; |
| 4176 | 4846 | }; |
| 4177 | try names.append(ident); | |
| 4178 | ||
| 4179 | const elem_ty = try p.arena.create(Type); | |
| 4180 | elem_ty.* = .{ .specifier = .void }; | |
| 4181 | const result_ty = Type{ .specifier = .pointer, .data = .{ .sub_type = elem_ty } }; | |
| 4847 | try names.append(allocator, ident); | |
| 4182 | 4848 | |
| 4183 | 4849 | const label_addr_node = try p.addNode(.{ |
| 4184 | .tag = .addr_of_label, | |
| 4185 | .data = .{ .decl_ref = label }, | |
| 4186 | .ty = result_ty, | |
| 4187 | .loc = @enumFromInt(ident), | |
| 4850 | .addr_of_label = .{ | |
| 4851 | .label_tok = label, | |
| 4852 | .qt = .void_pointer, | |
| 4853 | }, | |
| 4188 | 4854 | }); |
| 4189 | try exprs.append(label_addr_node); | |
| 4855 | try exprs.append(allocator, label_addr_node); | |
| 4190 | 4856 | |
| 4191 | 4857 | num_labels += 1; |
| 4192 | 4858 | if (p.eatToken(.comma) == null) break; |
| 4193 | 4859 | } |
| 4194 | 4860 | } else if (quals.goto) { |
| 4195 | try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ .actual = p.tok_ids[p.tok_i], .expected = .colon } }); | |
| 4861 | try p.err(p.tok_i, .expected_token, .{ Token.Id.colon, p.tok_ids[p.tok_i] }); | |
| 4196 | 4862 | return error.ParsingFailed; |
| 4197 | 4863 | } |
| 4198 | 4864 | |
| 4199 | 4865 | // TODO: validate and insert into AST |
| 4200 | return .none; | |
| 4866 | return p.addNode(.{ .null_stmt = .{ | |
| 4867 | .semicolon_or_r_brace_tok = asm_tok, | |
| 4868 | .qt = .void, | |
| 4869 | } }); | |
| 4201 | 4870 | } |
| 4202 | 4871 | |
| 4203 | 4872 | fn checkAsmStr(p: *Parser, asm_str: Value, tok: TokenIndex) !void { |
| ... | ... | @@ -4205,7 +4874,7 @@ fn checkAsmStr(p: *Parser, asm_str: Value, tok: TokenIndex) !void { |
| 4205 | 4874 | const str = p.comp.interner.get(asm_str.ref()).bytes; |
| 4206 | 4875 | if (str.len > 1) { |
| 4207 | 4876 | // Empty string (just a NUL byte) is ok because it does not emit any assembly |
| 4208 | try p.errTok(.gnu_asm_disabled, tok); | |
| 4877 | try p.err(tok, .gnu_asm_disabled, .{}); | |
| 4209 | 4878 | } |
| 4210 | 4879 | } |
| 4211 | 4880 | } |
| ... | ... | @@ -4214,11 +4883,11 @@ fn checkAsmStr(p: *Parser, asm_str: Value, tok: TokenIndex) !void { |
| 4214 | 4883 | /// : keyword_asm asmQual* '(' asmStr ')' |
| 4215 | 4884 | /// | keyword_asm asmQual* '(' gnuAsmStmt ')' |
| 4216 | 4885 | /// | keyword_asm msvcAsmStmt |
| 4217 | fn assembly(p: *Parser, kind: enum { global, decl_label, stmt }) Error!?NodeIndex { | |
| 4886 | fn assembly(p: *Parser, kind: enum { global, decl_label, stmt }) Error!?Node.Index { | |
| 4218 | 4887 | const asm_tok = p.tok_i; |
| 4219 | 4888 | switch (p.tok_ids[p.tok_i]) { |
| 4220 | 4889 | .keyword_asm => { |
| 4221 | try p.err(.extension_token_used); | |
| 4890 | try p.err(p.tok_i, .extension_token_used, .{}); | |
| 4222 | 4891 | p.tok_i += 1; |
| 4223 | 4892 | }, |
| 4224 | 4893 | .keyword_asm1, .keyword_asm2 => p.tok_i += 1, |
| ... | ... | @@ -4232,41 +4901,41 @@ fn assembly(p: *Parser, kind: enum { global, decl_label, stmt }) Error!?NodeInde |
| 4232 | 4901 | var quals: Tree.GNUAssemblyQualifiers = .{}; |
| 4233 | 4902 | while (true) : (p.tok_i += 1) switch (p.tok_ids[p.tok_i]) { |
| 4234 | 4903 | .keyword_volatile, .keyword_volatile1, .keyword_volatile2 => { |
| 4235 | if (kind != .stmt) try p.errStr(.meaningless_asm_qual, p.tok_i, "volatile"); | |
| 4236 | if (quals.@"volatile") try p.errStr(.duplicate_asm_qual, p.tok_i, "volatile"); | |
| 4904 | if (kind != .stmt) try p.err(p.tok_i, .meaningless_asm_qual, .{"volatile"}); | |
| 4905 | if (quals.@"volatile") try p.err(p.tok_i, .duplicate_asm_qual, .{"volatile"}); | |
| 4237 | 4906 | quals.@"volatile" = true; |
| 4238 | 4907 | }, |
| 4239 | 4908 | .keyword_inline, .keyword_inline1, .keyword_inline2 => { |
| 4240 | if (kind != .stmt) try p.errStr(.meaningless_asm_qual, p.tok_i, "inline"); | |
| 4241 | if (quals.@"inline") try p.errStr(.duplicate_asm_qual, p.tok_i, "inline"); | |
| 4909 | if (kind != .stmt) try p.err(p.tok_i, .meaningless_asm_qual, .{"inline"}); | |
| 4910 | if (quals.@"inline") try p.err(p.tok_i, .duplicate_asm_qual, .{"inline"}); | |
| 4242 | 4911 | quals.@"inline" = true; |
| 4243 | 4912 | }, |
| 4244 | 4913 | .keyword_goto => { |
| 4245 | if (kind != .stmt) try p.errStr(.meaningless_asm_qual, p.tok_i, "goto"); | |
| 4246 | if (quals.goto) try p.errStr(.duplicate_asm_qual, p.tok_i, "goto"); | |
| 4914 | if (kind != .stmt) try p.err(p.tok_i, .meaningless_asm_qual, .{"goto"}); | |
| 4915 | if (quals.goto) try p.err(p.tok_i, .duplicate_asm_qual, .{"goto"}); | |
| 4247 | 4916 | quals.goto = true; |
| 4248 | 4917 | }, |
| 4249 | 4918 | else => break, |
| 4250 | 4919 | }; |
| 4251 | 4920 | |
| 4252 | 4921 | const l_paren = try p.expectToken(.l_paren); |
| 4253 | var result_node: NodeIndex = .none; | |
| 4922 | var result_node: ?Node.Index = null; | |
| 4254 | 4923 | switch (kind) { |
| 4255 | 4924 | .decl_label => { |
| 4256 | 4925 | const asm_str = try p.asmStr(); |
| 4257 | 4926 | const str = try p.removeNull(asm_str.val); |
| 4258 | 4927 | |
| 4259 | 4928 | const attr = Attribute{ .tag = .asm_label, .args = .{ .asm_label = .{ .name = str } }, .syntax = .keyword }; |
| 4260 | try p.attr_buf.append(p.gpa, .{ .attr = attr, .tok = asm_tok }); | |
| 4929 | try p.attr_buf.append(p.comp.gpa, .{ .attr = attr, .tok = asm_tok }); | |
| 4261 | 4930 | }, |
| 4262 | 4931 | .global => { |
| 4263 | 4932 | const asm_str = try p.asmStr(); |
| 4264 | 4933 | try p.checkAsmStr(asm_str.val, l_paren); |
| 4265 | 4934 | result_node = try p.addNode(.{ |
| 4266 | .tag = .file_scope_asm, | |
| 4267 | .ty = .{ .specifier = .void }, | |
| 4268 | .data = .{ .decl = .{ .name = asm_tok, .node = asm_str.node } }, | |
| 4269 | .loc = @enumFromInt(asm_tok), | |
| 4935 | .global_asm = .{ | |
| 4936 | .asm_tok = asm_tok, | |
| 4937 | .asm_str = asm_str.node, | |
| 4938 | }, | |
| 4270 | 4939 | }); |
| 4271 | 4940 | }, |
| 4272 | 4941 | .stmt => result_node = try p.gnuAsmStmt(quals, asm_tok, l_paren), |
| ... | ... | @@ -4283,22 +4952,22 @@ fn asmStr(p: *Parser) Error!Result { |
| 4283 | 4952 | while (true) : (i += 1) switch (p.tok_ids[i]) { |
| 4284 | 4953 | .string_literal, .unterminated_string_literal => {}, |
| 4285 | 4954 | .string_literal_utf_16, .string_literal_utf_8, .string_literal_utf_32 => { |
| 4286 | try p.errStr(.invalid_asm_str, p.tok_i, "unicode"); | |
| 4955 | try p.err(p.tok_i, .invalid_asm_str, .{"unicode"}); | |
| 4287 | 4956 | return error.ParsingFailed; |
| 4288 | 4957 | }, |
| 4289 | 4958 | .string_literal_wide => { |
| 4290 | try p.errStr(.invalid_asm_str, p.tok_i, "wide"); | |
| 4959 | try p.err(p.tok_i, .invalid_asm_str, .{"wide"}); | |
| 4291 | 4960 | return error.ParsingFailed; |
| 4292 | 4961 | }, |
| 4293 | 4962 | else => { |
| 4294 | 4963 | if (i == p.tok_i) { |
| 4295 | try p.errStr(.expected_str_literal_in, p.tok_i, "asm"); | |
| 4964 | try p.err(p.tok_i, .expected_str_literal_in, .{"asm"}); | |
| 4296 | 4965 | return error.ParsingFailed; |
| 4297 | 4966 | } |
| 4298 | 4967 | break; |
| 4299 | 4968 | }, |
| 4300 | 4969 | }; |
| 4301 | return try p.stringLiteral(); | |
| 4970 | return p.stringLiteral(); | |
| 4302 | 4971 | } |
| 4303 | 4972 | |
| 4304 | 4973 | // ====== statements ====== |
| ... | ... | @@ -4317,80 +4986,89 @@ fn asmStr(p: *Parser) Error!Result { |
| 4317 | 4986 | /// | keyword_return expr? ';' |
| 4318 | 4987 | /// | assembly ';' |
| 4319 | 4988 | /// | expr? ';' |
| 4320 | fn stmt(p: *Parser) Error!NodeIndex { | |
| 4989 | fn stmt(p: *Parser) Error!Node.Index { | |
| 4321 | 4990 | if (try p.labeledStmt()) |some| return some; |
| 4322 | 4991 | if (try p.compoundStmt(false, null)) |some| return some; |
| 4992 | const gpa = p.comp.gpa; | |
| 4323 | 4993 | if (p.eatToken(.keyword_if)) |kw_if| { |
| 4324 | 4994 | const l_paren = try p.expectToken(.l_paren); |
| 4995 | ||
| 4325 | 4996 | const cond_tok = p.tok_i; |
| 4326 | var cond = try p.expr(); | |
| 4327 | try cond.expect(p); | |
| 4328 | try cond.lvalConversion(p); | |
| 4997 | var cond = try p.expect(expr); | |
| 4998 | try cond.lvalConversion(p, cond_tok); | |
| 4329 | 4999 | try cond.usualUnaryConversion(p, cond_tok); |
| 4330 | if (!cond.ty.isScalar()) | |
| 4331 | try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); | |
| 5000 | if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) | |
| 5001 | try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); | |
| 4332 | 5002 | try cond.saveValue(p); |
| 5003 | ||
| 4333 | 5004 | try p.expectClosing(l_paren, .r_paren); |
| 4334 | 5005 | |
| 4335 | const then = try p.stmt(); | |
| 4336 | const @"else" = if (p.eatToken(.keyword_else)) |_| try p.stmt() else .none; | |
| 5006 | const then_body = try p.stmt(); | |
| 5007 | const else_body = if (p.eatToken(.keyword_else)) |_| try p.stmt() else null; | |
| 4337 | 5008 | |
| 4338 | if (then != .none and @"else" != .none) | |
| 4339 | return try p.addNode(.{ | |
| 4340 | .tag = .if_then_else_stmt, | |
| 4341 | .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then, @"else" })).start } }, | |
| 4342 | .loc = @enumFromInt(kw_if), | |
| 4343 | }) | |
| 4344 | else | |
| 4345 | return try p.addNode(.{ | |
| 4346 | .tag = .if_then_stmt, | |
| 4347 | .data = .{ .bin = .{ .lhs = cond.node, .rhs = then } }, | |
| 4348 | .loc = @enumFromInt(kw_if), | |
| 4349 | }); | |
| 5009 | if (p.nodeIs(then_body, .null_stmt) and else_body == null) { | |
| 5010 | const semicolon_tok = then_body.get(&p.tree).null_stmt.semicolon_or_r_brace_tok; | |
| 5011 | const locs = p.pp.tokens.items(.loc); | |
| 5012 | const if_loc = locs[kw_if]; | |
| 5013 | const semicolon_loc = locs[semicolon_tok]; | |
| 5014 | if (if_loc.line == semicolon_loc.line) { | |
| 5015 | try p.err(semicolon_tok, .empty_if_body, .{}); | |
| 5016 | try p.err(semicolon_tok, .empty_if_body_note, .{}); | |
| 5017 | } | |
| 5018 | } | |
| 5019 | ||
| 5020 | return p.addNode(.{ .if_stmt = .{ | |
| 5021 | .if_tok = kw_if, | |
| 5022 | .cond = cond.node, | |
| 5023 | .then_body = then_body, | |
| 5024 | .else_body = else_body, | |
| 5025 | } }); | |
| 4350 | 5026 | } |
| 4351 | 5027 | if (p.eatToken(.keyword_switch)) |kw_switch| { |
| 4352 | 5028 | const l_paren = try p.expectToken(.l_paren); |
| 4353 | 5029 | const cond_tok = p.tok_i; |
| 4354 | var cond = try p.expr(); | |
| 4355 | try cond.expect(p); | |
| 4356 | try cond.lvalConversion(p); | |
| 5030 | var cond = try p.expect(expr); | |
| 5031 | try cond.lvalConversion(p, cond_tok); | |
| 4357 | 5032 | try cond.usualUnaryConversion(p, cond_tok); |
| 4358 | 5033 | |
| 4359 | if (!cond.ty.isInt()) | |
| 4360 | try p.errStr(.statement_int, l_paren + 1, try p.typeStr(cond.ty)); | |
| 5034 | // Switch condition can't be complex. | |
| 5035 | if (!cond.qt.isInvalid() and !cond.qt.isRealInt(p.comp)) { | |
| 5036 | try p.err(l_paren + 1, .statement_int, .{cond.qt}); | |
| 5037 | } | |
| 5038 | ||
| 4361 | 5039 | try cond.saveValue(p); |
| 4362 | 5040 | try p.expectClosing(l_paren, .r_paren); |
| 4363 | 5041 | |
| 4364 | 5042 | const old_switch = p.@"switch"; |
| 4365 | var @"switch" = Switch{ | |
| 4366 | .ranges = std.array_list.Managed(Switch.Range).init(p.gpa), | |
| 4367 | .ty = cond.ty, | |
| 5043 | var @"switch": Switch = .{ | |
| 5044 | .qt = cond.qt, | |
| 4368 | 5045 | .comp = p.comp, |
| 4369 | 5046 | }; |
| 4370 | 5047 | p.@"switch" = &@"switch"; |
| 4371 | 5048 | defer { |
| 4372 | @"switch".ranges.deinit(); | |
| 5049 | @"switch".ranges.deinit(gpa); | |
| 4373 | 5050 | p.@"switch" = old_switch; |
| 4374 | 5051 | } |
| 4375 | 5052 | |
| 4376 | 5053 | const body = try p.stmt(); |
| 4377 | 5054 | |
| 4378 | return try p.addNode(.{ | |
| 4379 | .tag = .switch_stmt, | |
| 4380 | .data = .{ .bin = .{ .lhs = cond.node, .rhs = body } }, | |
| 4381 | .loc = @enumFromInt(kw_switch), | |
| 4382 | }); | |
| 5055 | return p.addNode(.{ .switch_stmt = .{ | |
| 5056 | .switch_tok = kw_switch, | |
| 5057 | .cond = cond.node, | |
| 5058 | .body = body, | |
| 5059 | } }); | |
| 4383 | 5060 | } |
| 4384 | 5061 | if (p.eatToken(.keyword_while)) |kw_while| { |
| 4385 | 5062 | const l_paren = try p.expectToken(.l_paren); |
| 5063 | ||
| 4386 | 5064 | const cond_tok = p.tok_i; |
| 4387 | var cond = try p.expr(); | |
| 4388 | try cond.expect(p); | |
| 4389 | try cond.lvalConversion(p); | |
| 5065 | var cond = try p.expect(expr); | |
| 5066 | try cond.lvalConversion(p, cond_tok); | |
| 4390 | 5067 | try cond.usualUnaryConversion(p, cond_tok); |
| 4391 | if (!cond.ty.isScalar()) | |
| 4392 | try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); | |
| 5068 | if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) | |
| 5069 | try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); | |
| 4393 | 5070 | try cond.saveValue(p); |
| 5071 | ||
| 4394 | 5072 | try p.expectClosing(l_paren, .r_paren); |
| 4395 | 5073 | |
| 4396 | 5074 | const body = body: { |
| ... | ... | @@ -4400,11 +5078,11 @@ fn stmt(p: *Parser) Error!NodeIndex { |
| 4400 | 5078 | break :body try p.stmt(); |
| 4401 | 5079 | }; |
| 4402 | 5080 | |
| 4403 | return try p.addNode(.{ | |
| 4404 | .tag = .while_stmt, | |
| 4405 | .data = .{ .bin = .{ .lhs = cond.node, .rhs = body } }, | |
| 4406 | .loc = @enumFromInt(kw_while), | |
| 4407 | }); | |
| 5081 | return p.addNode(.{ .while_stmt = .{ | |
| 5082 | .while_tok = kw_while, | |
| 5083 | .cond = cond.node, | |
| 5084 | .body = body, | |
| 5085 | } }); | |
| 4408 | 5086 | } |
| 4409 | 5087 | if (p.eatToken(.keyword_do)) |kw_do| { |
| 4410 | 5088 | const body = body: { |
| ... | ... | @@ -4416,23 +5094,24 @@ fn stmt(p: *Parser) Error!NodeIndex { |
| 4416 | 5094 | |
| 4417 | 5095 | _ = try p.expectToken(.keyword_while); |
| 4418 | 5096 | const l_paren = try p.expectToken(.l_paren); |
| 5097 | ||
| 4419 | 5098 | const cond_tok = p.tok_i; |
| 4420 | var cond = try p.expr(); | |
| 4421 | try cond.expect(p); | |
| 4422 | try cond.lvalConversion(p); | |
| 5099 | var cond = try p.expect(expr); | |
| 5100 | try cond.lvalConversion(p, cond_tok); | |
| 4423 | 5101 | try cond.usualUnaryConversion(p, cond_tok); |
| 4424 | 5102 | |
| 4425 | if (!cond.ty.isScalar()) | |
| 4426 | try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); | |
| 5103 | if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) | |
| 5104 | try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); | |
| 4427 | 5105 | try cond.saveValue(p); |
| 4428 | 5106 | try p.expectClosing(l_paren, .r_paren); |
| 4429 | 5107 | |
| 4430 | 5108 | _ = try p.expectToken(.semicolon); |
| 4431 | return try p.addNode(.{ | |
| 4432 | .tag = .do_while_stmt, | |
| 4433 | .data = .{ .bin = .{ .lhs = cond.node, .rhs = body } }, | |
| 4434 | .loc = @enumFromInt(kw_do), | |
| 4435 | }); | |
| 5109 | ||
| 5110 | return p.addNode(.{ .do_while_stmt = .{ | |
| 5111 | .do_tok = kw_do, | |
| 5112 | .cond = cond.node, | |
| 5113 | .body = body, | |
| 5114 | } }); | |
| 4436 | 5115 | } |
| 4437 | 5116 | if (p.eatToken(.keyword_for)) |kw_for| { |
| 4438 | 5117 | try p.syms.pushScope(p); |
| ... | ... | @@ -4445,30 +5124,41 @@ fn stmt(p: *Parser) Error!NodeIndex { |
| 4445 | 5124 | |
| 4446 | 5125 | // for (init |
| 4447 | 5126 | const init_start = p.tok_i; |
| 4448 | var err_start = p.comp.diagnostics.list.items.len; | |
| 4449 | var init = if (!got_decl) try p.expr() else Result{}; | |
| 4450 | try init.saveValue(p); | |
| 4451 | try init.maybeWarnUnused(p, init_start, err_start); | |
| 5127 | var prev_total = p.diagnostics.total; | |
| 5128 | const init = init: { | |
| 5129 | if (got_decl) break :init null; | |
| 5130 | var init = (try p.expr()) orelse break :init null; | |
| 5131 | ||
| 5132 | try init.saveValue(p); | |
| 5133 | try init.maybeWarnUnused(p, init_start, prev_total); | |
| 5134 | break :init init.node; | |
| 5135 | }; | |
| 4452 | 5136 | if (!got_decl) _ = try p.expectToken(.semicolon); |
| 4453 | 5137 | |
| 4454 | 5138 | // for (init; cond |
| 4455 | const cond_tok = p.tok_i; | |
| 4456 | var cond = try p.expr(); | |
| 4457 | if (cond.node != .none) { | |
| 4458 | try cond.lvalConversion(p); | |
| 5139 | const cond = cond: { | |
| 5140 | const cond_tok = p.tok_i; | |
| 5141 | var cond = (try p.expr()) orelse break :cond null; | |
| 5142 | ||
| 5143 | try cond.lvalConversion(p, cond_tok); | |
| 4459 | 5144 | try cond.usualUnaryConversion(p, cond_tok); |
| 4460 | if (!cond.ty.isScalar()) | |
| 4461 | try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); | |
| 4462 | } | |
| 4463 | try cond.saveValue(p); | |
| 5145 | if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) | |
| 5146 | try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); | |
| 5147 | try cond.saveValue(p); | |
| 5148 | break :cond cond.node; | |
| 5149 | }; | |
| 4464 | 5150 | _ = try p.expectToken(.semicolon); |
| 4465 | 5151 | |
| 4466 | 5152 | // for (init; cond; incr |
| 4467 | 5153 | const incr_start = p.tok_i; |
| 4468 | err_start = p.comp.diagnostics.list.items.len; | |
| 4469 | var incr = try p.expr(); | |
| 4470 | try incr.maybeWarnUnused(p, incr_start, err_start); | |
| 4471 | try incr.saveValue(p); | |
| 5154 | prev_total = p.diagnostics.total; | |
| 5155 | const incr = incr: { | |
| 5156 | var incr = (try p.expr()) orelse break :incr null; | |
| 5157 | ||
| 5158 | try incr.maybeWarnUnused(p, incr_start, prev_total); | |
| 5159 | try incr.saveValue(p); | |
| 5160 | break :incr incr.node; | |
| 5161 | }; | |
| 4472 | 5162 | try p.expectClosing(l_paren, .r_paren); |
| 4473 | 5163 | |
| 4474 | 5164 | const body = body: { |
| ... | ... | @@ -4478,93 +5168,71 @@ fn stmt(p: *Parser) Error!NodeIndex { |
| 4478 | 5168 | break :body try p.stmt(); |
| 4479 | 5169 | }; |
| 4480 | 5170 | |
| 4481 | if (got_decl) { | |
| 4482 | const start = (try p.addList(p.decl_buf.items[decl_buf_top..])).start; | |
| 4483 | const end = (try p.addList(&.{ cond.node, incr.node, body })).end; | |
| 4484 | ||
| 4485 | return try p.addNode(.{ | |
| 4486 | .tag = .for_decl_stmt, | |
| 4487 | .data = .{ .range = .{ .start = start, .end = end } }, | |
| 4488 | .loc = @enumFromInt(kw_for), | |
| 4489 | }); | |
| 4490 | } else if (init.node == .none and cond.node == .none and incr.node == .none) { | |
| 4491 | return try p.addNode(.{ | |
| 4492 | .tag = .forever_stmt, | |
| 4493 | .data = .{ .un = body }, | |
| 4494 | .loc = @enumFromInt(kw_for), | |
| 4495 | }); | |
| 4496 | } else return try p.addNode(.{ | |
| 4497 | .tag = .for_stmt, | |
| 4498 | .data = .{ .if3 = .{ | |
| 4499 | .cond = body, | |
| 4500 | .body = (try p.addList(&.{ init.node, cond.node, incr.node })).start, | |
| 4501 | } }, | |
| 4502 | .loc = @enumFromInt(kw_for), | |
| 4503 | }); | |
| 5171 | return p.addNode(.{ .for_stmt = .{ | |
| 5172 | .for_tok = kw_for, | |
| 5173 | .init = if (decl_buf_top == p.decl_buf.items.len) | |
| 5174 | .{ .expr = init } | |
| 5175 | else | |
| 5176 | .{ .decls = p.decl_buf.items[decl_buf_top..] }, | |
| 5177 | .cond = cond, | |
| 5178 | .incr = incr, | |
| 5179 | .body = body, | |
| 5180 | } }); | |
| 4504 | 5181 | } |
| 4505 | 5182 | if (p.eatToken(.keyword_goto)) |goto_tok| { |
| 4506 | 5183 | if (p.eatToken(.asterisk)) |_| { |
| 4507 | 5184 | const expr_tok = p.tok_i; |
| 4508 | var e = try p.expr(); | |
| 4509 | try e.expect(p); | |
| 4510 | try e.lvalConversion(p); | |
| 5185 | var goto_expr = try p.expect(expr); | |
| 5186 | try goto_expr.lvalConversion(p, expr_tok); | |
| 4511 | 5187 | p.computed_goto_tok = p.computed_goto_tok orelse goto_tok; |
| 4512 | if (!e.ty.isPtr()) { | |
| 4513 | const elem_ty = try p.arena.create(Type); | |
| 4514 | elem_ty.* = .{ .specifier = .void, .qual = .{ .@"const" = true } }; | |
| 4515 | const result_ty = Type{ | |
| 4516 | .specifier = .pointer, | |
| 4517 | .data = .{ .sub_type = elem_ty }, | |
| 4518 | }; | |
| 4519 | if (!e.ty.isInt()) { | |
| 4520 | try p.errStr(.incompatible_arg, expr_tok, try p.typePairStrExtra(e.ty, " to parameter of incompatible type ", result_ty)); | |
| 5188 | ||
| 5189 | if (!goto_expr.qt.isInvalid() and !goto_expr.qt.isPointer(p.comp)) { | |
| 5190 | const result_qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ | |
| 5191 | .child = .{ .@"const" = true, ._index = .void }, | |
| 5192 | .decayed = null, | |
| 5193 | } }); | |
| 5194 | if (!goto_expr.qt.isRealInt(p.comp)) { | |
| 5195 | try p.err(expr_tok, .incompatible_arg, .{ goto_expr.qt, result_qt }); | |
| 4521 | 5196 | return error.ParsingFailed; |
| 4522 | 5197 | } |
| 4523 | if (e.val.isZero(p.comp)) { | |
| 4524 | try e.nullCast(p, result_ty); | |
| 5198 | if (goto_expr.val.isZero(p.comp)) { | |
| 5199 | try goto_expr.nullToPointer(p, result_qt, expr_tok); | |
| 4525 | 5200 | } else { |
| 4526 | try p.errStr(.implicit_int_to_ptr, expr_tok, try p.typePairStrExtra(e.ty, " to ", result_ty)); | |
| 4527 | try e.ptrCast(p, result_ty); | |
| 5201 | try p.err(expr_tok, .implicit_int_to_ptr, .{ goto_expr.qt, result_qt }); | |
| 5202 | try goto_expr.castToPointer(p, result_qt, expr_tok); | |
| 4528 | 5203 | } |
| 4529 | 5204 | } |
| 4530 | 5205 | |
| 4531 | try e.un(p, .computed_goto_stmt, goto_tok); | |
| 4532 | _ = try p.expectToken(.semicolon); | |
| 4533 | return e.node; | |
| 5206 | return p.addNode(.{ .computed_goto_stmt = .{ .goto_tok = goto_tok, .expr = goto_expr.node } }); | |
| 4534 | 5207 | } |
| 4535 | 5208 | const name_tok = try p.expectIdentifier(); |
| 4536 | 5209 | const str = p.tokSlice(name_tok); |
| 4537 | 5210 | if (p.findLabel(str) == null) { |
| 4538 | try p.labels.append(.{ .unresolved_goto = name_tok }); | |
| 5211 | try p.labels.append(gpa, .{ .unresolved_goto = name_tok }); | |
| 4539 | 5212 | } |
| 4540 | 5213 | _ = try p.expectToken(.semicolon); |
| 4541 | return try p.addNode(.{ | |
| 4542 | .tag = .goto_stmt, | |
| 4543 | .data = .{ .decl_ref = name_tok }, | |
| 4544 | .loc = @enumFromInt(goto_tok), | |
| 4545 | }); | |
| 5214 | return p.addNode(.{ .goto_stmt = .{ .label_tok = name_tok } }); | |
| 4546 | 5215 | } |
| 4547 | 5216 | if (p.eatToken(.keyword_continue)) |cont| { |
| 4548 | if (!p.in_loop) try p.errTok(.continue_not_in_loop, cont); | |
| 5217 | if (!p.in_loop) try p.err(cont, .continue_not_in_loop, .{}); | |
| 4549 | 5218 | _ = try p.expectToken(.semicolon); |
| 4550 | return try p.addNode(.{ .tag = .continue_stmt, .data = undefined, .loc = @enumFromInt(cont) }); | |
| 5219 | return p.addNode(.{ .continue_stmt = .{ .continue_tok = cont } }); | |
| 4551 | 5220 | } |
| 4552 | 5221 | if (p.eatToken(.keyword_break)) |br| { |
| 4553 | if (!p.in_loop and p.@"switch" == null) try p.errTok(.break_not_in_loop_or_switch, br); | |
| 5222 | if (!p.in_loop and p.@"switch" == null) try p.err(br, .break_not_in_loop_or_switch, .{}); | |
| 4554 | 5223 | _ = try p.expectToken(.semicolon); |
| 4555 | return try p.addNode(.{ .tag = .break_stmt, .data = undefined, .loc = @enumFromInt(br) }); | |
| 5224 | return p.addNode(.{ .break_stmt = .{ .break_tok = br } }); | |
| 4556 | 5225 | } |
| 4557 | 5226 | if (try p.returnStmt()) |some| return some; |
| 4558 | 5227 | if (try p.assembly(.stmt)) |some| return some; |
| 4559 | 5228 | |
| 4560 | 5229 | const expr_start = p.tok_i; |
| 4561 | const err_start = p.comp.diagnostics.list.items.len; | |
| 5230 | const prev_total = p.diagnostics.total; | |
| 4562 | 5231 | |
| 4563 | const e = try p.expr(); | |
| 4564 | if (e.node != .none) { | |
| 5232 | if (try p.expr()) |some| { | |
| 4565 | 5233 | _ = try p.expectToken(.semicolon); |
| 4566 | try e.maybeWarnUnused(p, expr_start, err_start); | |
| 4567 | return e.node; | |
| 5234 | try some.maybeWarnUnused(p, expr_start, prev_total); | |
| 5235 | return some.node; | |
| 4568 | 5236 | } |
| 4569 | 5237 | |
| 4570 | 5238 | const attr_buf_top = p.attr_buf.len; |
| ... | ... | @@ -4572,12 +5240,13 @@ fn stmt(p: *Parser) Error!NodeIndex { |
| 4572 | 5240 | try p.attributeSpecifier(); |
| 4573 | 5241 | |
| 4574 | 5242 | if (p.eatToken(.semicolon)) |semicolon| { |
| 4575 | var null_node: Tree.Node = .{ .tag = .null_stmt, .data = undefined, .loc = @enumFromInt(semicolon) }; | |
| 4576 | null_node.ty = try Attribute.applyStatementAttributes(p, null_node.ty, expr_start, attr_buf_top); | |
| 4577 | return p.addNode(null_node); | |
| 5243 | return p.addNode(.{ .null_stmt = .{ | |
| 5244 | .semicolon_or_r_brace_tok = semicolon, | |
| 5245 | .qt = try Attribute.applyStatementAttributes(p, expr_start, attr_buf_top), | |
| 5246 | } }); | |
| 4578 | 5247 | } |
| 4579 | 5248 | |
| 4580 | try p.err(.expected_stmt); | |
| 5249 | try p.err(p.tok_i, .expected_stmt, .{}); | |
| 4581 | 5250 | return error.ParsingFailed; |
| 4582 | 5251 | } |
| 4583 | 5252 | |
| ... | ... | @@ -4585,16 +5254,16 @@ fn stmt(p: *Parser) Error!NodeIndex { |
| 4585 | 5254 | /// : IDENTIFIER ':' stmt |
| 4586 | 5255 | /// | keyword_case integerConstExpr ':' stmt |
| 4587 | 5256 | /// | keyword_default ':' stmt |
| 4588 | fn labeledStmt(p: *Parser) Error!?NodeIndex { | |
| 5257 | fn labeledStmt(p: *Parser) Error!?Node.Index { | |
| 4589 | 5258 | 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) { |
| 4590 | 5259 | const name_tok = try p.expectIdentifier(); |
| 4591 | 5260 | const str = p.tokSlice(name_tok); |
| 4592 | 5261 | if (p.findLabel(str)) |some| { |
| 4593 | try p.errStr(.duplicate_label, name_tok, str); | |
| 4594 | try p.errStr(.previous_label, some, str); | |
| 5262 | try p.err(name_tok, .duplicate_label, .{str}); | |
| 5263 | try p.err(some, .previous_label, .{str}); | |
| 4595 | 5264 | } else { |
| 4596 | 5265 | p.label_count += 1; |
| 4597 | try p.labels.append(.{ .label = name_tok }); | |
| 5266 | try p.labels.append(p.comp.gpa, .{ .label = name_tok }); | |
| 4598 | 5267 | var i: usize = 0; |
| 4599 | 5268 | while (i < p.labels.items.len) { |
| 4600 | 5269 | if (p.labels.items[i] == .unresolved_goto and |
| ... | ... | @@ -4610,73 +5279,74 @@ fn labeledStmt(p: *Parser) Error!?NodeIndex { |
| 4610 | 5279 | defer p.attr_buf.len = attr_buf_top; |
| 4611 | 5280 | try p.attributeSpecifier(); |
| 4612 | 5281 | |
| 4613 | var labeled_stmt = Tree.Node{ | |
| 4614 | .tag = .labeled_stmt, | |
| 4615 | .data = .{ .decl = .{ .name = name_tok, .node = try p.labelableStmt() } }, | |
| 4616 | .loc = @enumFromInt(name_tok), | |
| 4617 | }; | |
| 4618 | labeled_stmt.ty = try Attribute.applyLabelAttributes(p, labeled_stmt.ty, attr_buf_top); | |
| 4619 | return try p.addNode(labeled_stmt); | |
| 5282 | return try p.addNode(.{ .labeled_stmt = .{ | |
| 5283 | .qt = try Attribute.applyLabelAttributes(p, attr_buf_top), | |
| 5284 | .body = try p.labelableStmt(), | |
| 5285 | .label_tok = name_tok, | |
| 5286 | } }); | |
| 4620 | 5287 | } else if (p.eatToken(.keyword_case)) |case| { |
| 4621 | const first_item = try p.integerConstExpr(.gnu_folding_extension); | |
| 5288 | var first_item = try p.integerConstExpr(.gnu_folding_extension); | |
| 4622 | 5289 | const ellipsis = p.tok_i; |
| 4623 | const second_item = if (p.eatToken(.ellipsis) != null) blk: { | |
| 4624 | try p.errTok(.gnu_switch_range, ellipsis); | |
| 5290 | var second_item = if (p.eatToken(.ellipsis) != null) blk: { | |
| 5291 | try p.err(ellipsis, .gnu_switch_range, .{}); | |
| 4625 | 5292 | break :blk try p.integerConstExpr(.gnu_folding_extension); |
| 4626 | 5293 | } else null; |
| 4627 | 5294 | _ = try p.expectToken(.colon); |
| 4628 | 5295 | |
| 4629 | if (p.@"switch") |some| check: { | |
| 4630 | if (some.ty.hasIncompleteSize()) break :check; // error already reported for incomplete size | |
| 5296 | if (p.@"switch") |@"switch"| check: { | |
| 5297 | if (@"switch".qt.hasIncompleteSize(p.comp)) break :check; // error already reported for incomplete size | |
| 5298 | ||
| 5299 | // Coerce to switch condition type | |
| 5300 | try first_item.coerce(p, @"switch".qt, case + 1, .assign); | |
| 5301 | try first_item.putValue(p); | |
| 5302 | if (second_item) |*item| { | |
| 5303 | try item.coerce(p, @"switch".qt, ellipsis + 1, .assign); | |
| 5304 | try item.putValue(p); | |
| 5305 | } | |
| 4631 | 5306 | |
| 4632 | 5307 | const first = first_item.val; |
| 4633 | 5308 | const last = if (second_item) |second| second.val else first; |
| 4634 | 5309 | if (first.opt_ref == .none) { |
| 4635 | try p.errTok(.case_val_unavailable, case + 1); | |
| 5310 | try p.err(case + 1, .case_val_unavailable, .{}); | |
| 4636 | 5311 | break :check; |
| 4637 | 5312 | } else if (last.opt_ref == .none) { |
| 4638 | try p.errTok(.case_val_unavailable, ellipsis + 1); | |
| 5313 | try p.err(ellipsis + 1, .case_val_unavailable, .{}); | |
| 4639 | 5314 | break :check; |
| 4640 | 5315 | } else if (last.compare(.lt, first, p.comp)) { |
| 4641 | try p.errTok(.empty_case_range, case + 1); | |
| 5316 | try p.err(case + 1, .empty_case_range, .{}); | |
| 4642 | 5317 | break :check; |
| 4643 | 5318 | } |
| 4644 | 5319 | |
| 4645 | 5320 | // TODO cast to target type |
| 4646 | const prev = (try some.add(first, last, case + 1)) orelse break :check; | |
| 5321 | const prev = (try @"switch".add(first, last, case + 1)) orelse break :check; | |
| 4647 | 5322 | |
| 4648 | 5323 | // TODO check which value was already handled |
| 4649 | try p.errStr(.duplicate_switch_case, case + 1, try first_item.str(p)); | |
| 4650 | try p.errTok(.previous_case, prev.tok); | |
| 5324 | try p.err(case + 1, .duplicate_switch_case, .{first_item}); | |
| 5325 | try p.err(prev.tok, .previous_case, .{}); | |
| 4651 | 5326 | } else { |
| 4652 | try p.errStr(.case_not_in_switch, case, "case"); | |
| 4653 | } | |
| 4654 | ||
| 4655 | const s = try p.labelableStmt(); | |
| 4656 | if (second_item) |some| return try p.addNode(.{ | |
| 4657 | .tag = .case_range_stmt, | |
| 4658 | .data = .{ .if3 = .{ .cond = s, .body = (try p.addList(&.{ first_item.node, some.node })).start } }, | |
| 4659 | .loc = @enumFromInt(case), | |
| 4660 | }) else return try p.addNode(.{ | |
| 4661 | .tag = .case_stmt, | |
| 4662 | .data = .{ .bin = .{ .lhs = first_item.node, .rhs = s } }, | |
| 4663 | .loc = @enumFromInt(case), | |
| 4664 | }); | |
| 5327 | try p.err(case, .case_not_in_switch, .{"case"}); | |
| 5328 | } | |
| 5329 | ||
| 5330 | return try p.addNode(.{ .case_stmt = .{ | |
| 5331 | .case_tok = case, | |
| 5332 | .start = first_item.node, | |
| 5333 | .end = if (second_item) |some| some.node else null, | |
| 5334 | .body = try p.labelableStmt(), | |
| 5335 | } }); | |
| 4665 | 5336 | } else if (p.eatToken(.keyword_default)) |default| { |
| 4666 | 5337 | _ = try p.expectToken(.colon); |
| 4667 | const s = try p.labelableStmt(); | |
| 4668 | const node = try p.addNode(.{ | |
| 4669 | .tag = .default_stmt, | |
| 4670 | .data = .{ .un = s }, | |
| 4671 | .loc = @enumFromInt(default), | |
| 4672 | }); | |
| 5338 | const node = try p.addNode(.{ .default_stmt = .{ | |
| 5339 | .default_tok = default, | |
| 5340 | .body = try p.labelableStmt(), | |
| 5341 | } }); | |
| 5342 | ||
| 4673 | 5343 | const @"switch" = p.@"switch" orelse { |
| 4674 | try p.errStr(.case_not_in_switch, default, "default"); | |
| 5344 | try p.err(default, .case_not_in_switch, .{"default"}); | |
| 4675 | 5345 | return node; |
| 4676 | 5346 | }; |
| 4677 | 5347 | if (@"switch".default) |previous| { |
| 4678 | try p.errTok(.multiple_default, default); | |
| 4679 | try p.errTok(.previous_case, previous); | |
| 5348 | try p.err(default, .multiple_default, .{}); | |
| 5349 | try p.err(previous, .previous_case, .{}); | |
| 4680 | 5350 | } else { |
| 4681 | 5351 | @"switch".default = default; |
| 4682 | 5352 | } |
| ... | ... | @@ -4684,23 +5354,27 @@ fn labeledStmt(p: *Parser) Error!?NodeIndex { |
| 4684 | 5354 | } else return null; |
| 4685 | 5355 | } |
| 4686 | 5356 | |
| 4687 | fn labelableStmt(p: *Parser) Error!NodeIndex { | |
| 5357 | fn labelableStmt(p: *Parser) Error!Node.Index { | |
| 4688 | 5358 | if (p.tok_ids[p.tok_i] == .r_brace) { |
| 4689 | try p.err(.label_compound_end); | |
| 4690 | return p.addNode(.{ .tag = .null_stmt, .data = undefined, .loc = @enumFromInt(p.tok_i) }); | |
| 5359 | try p.err(p.tok_i, .label_compound_end, .{}); | |
| 5360 | return p.addNode(.{ .null_stmt = .{ | |
| 5361 | .semicolon_or_r_brace_tok = p.tok_i, | |
| 5362 | .qt = .void, | |
| 5363 | } }); | |
| 4691 | 5364 | } |
| 4692 | 5365 | return p.stmt(); |
| 4693 | 5366 | } |
| 4694 | 5367 | |
| 4695 | 5368 | const StmtExprState = struct { |
| 4696 | 5369 | last_expr_tok: TokenIndex = 0, |
| 4697 | last_expr_res: Result = .{ .ty = .{ .specifier = .void } }, | |
| 5370 | last_expr_qt: QualType = .void, | |
| 4698 | 5371 | }; |
| 4699 | 5372 | |
| 4700 | 5373 | /// compoundStmt : '{' ( decl | keyword_extension decl | staticAssert | stmt)* '}' |
| 4701 | fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) Error!?NodeIndex { | |
| 5374 | fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) Error!?Node.Index { | |
| 4702 | 5375 | const l_brace = p.eatToken(.l_brace) orelse return null; |
| 4703 | 5376 | |
| 5377 | const gpa = p.comp.gpa; | |
| 4704 | 5378 | const decl_buf_top = p.decl_buf.items.len; |
| 4705 | 5379 | defer p.decl_buf.items.len = decl_buf_top; |
| 4706 | 5380 | |
| ... | ... | @@ -4731,23 +5405,19 @@ fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) |
| 4731 | 5405 | }, |
| 4732 | 5406 | else => |e| return e, |
| 4733 | 5407 | }; |
| 4734 | if (s == .none) continue; | |
| 4735 | 5408 | if (stmt_expr_state) |state| { |
| 4736 | 5409 | state.* = .{ |
| 4737 | 5410 | .last_expr_tok = stmt_tok, |
| 4738 | .last_expr_res = .{ | |
| 4739 | .node = s, | |
| 4740 | .ty = p.nodes.items(.ty)[@intFromEnum(s)], | |
| 4741 | }, | |
| 5411 | .last_expr_qt = s.qt(&p.tree), | |
| 4742 | 5412 | }; |
| 4743 | 5413 | } |
| 4744 | try p.decl_buf.append(s); | |
| 5414 | try p.decl_buf.append(gpa, s); | |
| 4745 | 5415 | |
| 4746 | 5416 | if (noreturn_index == null and p.nodeIsNoreturn(s) == .yes) { |
| 4747 | 5417 | noreturn_index = p.tok_i; |
| 4748 | 5418 | noreturn_label_count = p.label_count; |
| 4749 | 5419 | } |
| 4750 | switch (p.nodes.items(.tag)[@intFromEnum(s)]) { | |
| 5420 | switch (s.get(&p.tree)) { | |
| 4751 | 5421 | .case_stmt, .default_stmt, .labeled_stmt => noreturn_index = null, |
| 4752 | 5422 | else => {}, |
| 4753 | 5423 | } |
| ... | ... | @@ -4756,7 +5426,7 @@ fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) |
| 4756 | 5426 | |
| 4757 | 5427 | if (noreturn_index) |some| { |
| 4758 | 5428 | // if new labels were defined we cannot be certain that the code is unreachable |
| 4759 | if (some != p.tok_i - 1 and noreturn_label_count == p.label_count) try p.errTok(.unreachable_code, some); | |
| 5429 | if (some != p.tok_i - 1 and noreturn_label_count == p.label_count) try p.err(some, .unreachable_code, .{}); | |
| 4760 | 5430 | } |
| 4761 | 5431 | if (is_fn_body) { |
| 4762 | 5432 | const last_noreturn = if (p.decl_buf.items.len == decl_buf_top) |
| ... | ... | @@ -4764,82 +5434,84 @@ fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) |
| 4764 | 5434 | else |
| 4765 | 5435 | p.nodeIsNoreturn(p.decl_buf.items[p.decl_buf.items.len - 1]); |
| 4766 | 5436 | |
| 4767 | if (last_noreturn != .yes) { | |
| 4768 | const ret_ty = p.func.ty.?.returnType(); | |
| 5437 | const ret_qt: QualType = if (p.func.qt.?.get(p.comp, .func)) |func_ty| func_ty.return_type else .invalid; | |
| 5438 | if (last_noreturn != .yes and !ret_qt.isInvalid()) { | |
| 4769 | 5439 | var return_zero = false; |
| 4770 | if (last_noreturn == .no and !ret_ty.is(.void) and !ret_ty.isFunc() and !ret_ty.isArray()) { | |
| 4771 | const func_name = p.tokSlice(p.func.name); | |
| 4772 | const interned_name = try StrInt.intern(p.comp, func_name); | |
| 4773 | if (interned_name == p.string_ids.main_id and ret_ty.is(.int)) { | |
| 4774 | return_zero = true; | |
| 4775 | } else { | |
| 4776 | try p.errStr(.func_does_not_return, p.tok_i - 1, func_name); | |
| 4777 | } | |
| 4778 | } | |
| 4779 | 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) })); | |
| 5440 | if (last_noreturn == .no) switch (ret_qt.base(p.comp).type) { | |
| 5441 | .void => {}, | |
| 5442 | .func, .array => {}, // Invalid, error reported elsewhere | |
| 5443 | else => { | |
| 5444 | const func_name = p.tokSlice(p.func.name); | |
| 5445 | const interned_name = try p.comp.internString(func_name); | |
| 5446 | ||
| 5447 | if (interned_name == p.string_ids.main_id) { | |
| 5448 | if (ret_qt.get(p.comp, .int)) |int_ty| { | |
| 5449 | if (int_ty == .int) return_zero = true; | |
| 5450 | } | |
| 5451 | } | |
| 5452 | ||
| 5453 | if (!return_zero) { | |
| 5454 | try p.err(p.tok_i - 1, .func_does_not_return, .{func_name}); | |
| 5455 | } | |
| 5456 | }, | |
| 5457 | }; | |
| 5458 | ||
| 5459 | const implicit_ret = try p.addNode(.{ .return_stmt = .{ | |
| 5460 | .return_tok = r_brace, | |
| 5461 | .return_qt = ret_qt, | |
| 5462 | .operand = .{ .implicit = return_zero }, | |
| 5463 | } }); | |
| 5464 | try p.decl_buf.append(gpa, implicit_ret); | |
| 4780 | 5465 | } |
| 4781 | if (p.func.ident) |some| try p.decl_buf.insert(decl_buf_top, some.node); | |
| 4782 | if (p.func.pretty_ident) |some| try p.decl_buf.insert(decl_buf_top, some.node); | |
| 5466 | if (p.func.ident) |some| try p.decl_buf.insert(gpa, decl_buf_top, some.node); | |
| 5467 | if (p.func.pretty_ident) |some| try p.decl_buf.insert(gpa, decl_buf_top, some.node); | |
| 4783 | 5468 | } |
| 4784 | 5469 | |
| 4785 | var node: Tree.Node = .{ | |
| 4786 | .tag = .compound_stmt_two, | |
| 4787 | .data = .{ .two = .{ .none, .none } }, | |
| 4788 | .loc = @enumFromInt(l_brace), | |
| 4789 | }; | |
| 4790 | const statements = p.decl_buf.items[decl_buf_top..]; | |
| 4791 | switch (statements.len) { | |
| 4792 | 0 => {}, | |
| 4793 | 1 => node.data = .{ .two = .{ statements[0], .none } }, | |
| 4794 | 2 => node.data = .{ .two = .{ statements[0], statements[1] } }, | |
| 4795 | else => { | |
| 4796 | node.tag = .compound_stmt; | |
| 4797 | node.data = .{ .range = try p.addList(statements) }; | |
| 5470 | return try p.addNode(.{ .compound_stmt = .{ | |
| 5471 | .body = p.decl_buf.items[decl_buf_top..], | |
| 5472 | .l_brace_tok = l_brace, | |
| 5473 | } }); | |
| 5474 | } | |
| 5475 | ||
| 5476 | fn pointerValue(p: *Parser, node: Node.Index, offset: Value) !Value { | |
| 5477 | switch (node.get(&p.tree)) { | |
| 5478 | .decl_ref_expr => |decl_ref| { | |
| 5479 | const var_name = try p.comp.internString(p.tokSlice(decl_ref.name_tok)); | |
| 5480 | const sym = p.syms.findSymbol(var_name) orelse return .{}; | |
| 5481 | const sym_node = sym.node.unpack() orelse return .{}; | |
| 5482 | return Value.pointer(.{ .node = @intFromEnum(sym_node), .offset = offset.ref() }, p.comp); | |
| 4798 | 5483 | }, |
| 5484 | .string_literal_expr => return p.tree.value_map.get(node).?, | |
| 5485 | else => return .{}, | |
| 4799 | 5486 | } |
| 4800 | return try p.addNode(node); | |
| 4801 | 5487 | } |
| 4802 | 5488 | |
| 4803 | 5489 | const NoreturnKind = enum { no, yes, complex }; |
| 4804 | 5490 | |
| 4805 | fn nodeIsNoreturn(p: *Parser, node: NodeIndex) NoreturnKind { | |
| 4806 | switch (p.nodes.items(.tag)[@intFromEnum(node)]) { | |
| 5491 | fn nodeIsNoreturn(p: *Parser, node: Node.Index) NoreturnKind { | |
| 5492 | switch (node.get(&p.tree)) { | |
| 4807 | 5493 | .break_stmt, .continue_stmt, .return_stmt => return .yes, |
| 4808 | .if_then_else_stmt => { | |
| 4809 | const data = p.data.items[p.nodes.items(.data)[@intFromEnum(node)].if3.body..]; | |
| 4810 | const then_type = p.nodeIsNoreturn(data[0]); | |
| 4811 | const else_type = p.nodeIsNoreturn(data[1]); | |
| 5494 | .if_stmt => |@"if"| { | |
| 5495 | const else_type = p.nodeIsNoreturn(@"if".else_body orelse return .no); | |
| 5496 | const then_type = p.nodeIsNoreturn(@"if".then_body); | |
| 4812 | 5497 | if (then_type == .complex or else_type == .complex) return .complex; |
| 4813 | 5498 | if (then_type == .yes and else_type == .yes) return .yes; |
| 4814 | 5499 | return .no; |
| 4815 | 5500 | }, |
| 4816 | .compound_stmt_two => { | |
| 4817 | const data = p.nodes.items(.data)[@intFromEnum(node)]; | |
| 4818 | const lhs_type = if (data.two[0] != .none) p.nodeIsNoreturn(data.two[0]) else .no; | |
| 4819 | const rhs_type = if (data.two[1] != .none) p.nodeIsNoreturn(data.two[1]) else .no; | |
| 4820 | if (lhs_type == .complex or rhs_type == .complex) return .complex; | |
| 4821 | if (lhs_type == .yes or rhs_type == .yes) return .yes; | |
| 4822 | return .no; | |
| 4823 | }, | |
| 4824 | .compound_stmt => { | |
| 4825 | const data = p.nodes.items(.data)[@intFromEnum(node)]; | |
| 4826 | var it = data.range.start; | |
| 4827 | while (it != data.range.end) : (it += 1) { | |
| 4828 | const kind = p.nodeIsNoreturn(p.data.items[it]); | |
| 5501 | .compound_stmt => |compound| { | |
| 5502 | for (compound.body) |body_stmt| { | |
| 5503 | const kind = p.nodeIsNoreturn(body_stmt); | |
| 4829 | 5504 | if (kind != .no) return kind; |
| 4830 | 5505 | } |
| 4831 | 5506 | return .no; |
| 4832 | 5507 | }, |
| 4833 | .labeled_stmt => { | |
| 4834 | const data = p.nodes.items(.data)[@intFromEnum(node)]; | |
| 4835 | return p.nodeIsNoreturn(data.decl.node); | |
| 5508 | .labeled_stmt => |labeled| { | |
| 5509 | return p.nodeIsNoreturn(labeled.body); | |
| 4836 | 5510 | }, |
| 4837 | .default_stmt => { | |
| 4838 | const data = p.nodes.items(.data)[@intFromEnum(node)]; | |
| 4839 | if (data.un == .none) return .no; | |
| 4840 | return p.nodeIsNoreturn(data.un); | |
| 5511 | .default_stmt => |default| { | |
| 5512 | return p.nodeIsNoreturn(default.body); | |
| 4841 | 5513 | }, |
| 4842 | .while_stmt, .do_while_stmt, .for_decl_stmt, .forever_stmt, .for_stmt, .switch_stmt => return .complex, | |
| 5514 | .while_stmt, .do_while_stmt, .for_stmt, .switch_stmt => return .complex, | |
| 4843 | 5515 | else => return .no, |
| 4844 | 5516 | } |
| 4845 | 5517 | } |
| ... | ... | @@ -4928,61 +5600,63 @@ fn nextStmt(p: *Parser, l_brace: TokenIndex) !void { |
| 4928 | 5600 | unreachable; |
| 4929 | 5601 | } |
| 4930 | 5602 | |
| 4931 | fn returnStmt(p: *Parser) Error!?NodeIndex { | |
| 5603 | fn returnStmt(p: *Parser) Error!?Node.Index { | |
| 4932 | 5604 | const ret_tok = p.eatToken(.keyword_return) orelse return null; |
| 4933 | 5605 | |
| 4934 | 5606 | const e_tok = p.tok_i; |
| 4935 | var e = try p.expr(); | |
| 5607 | var ret_expr = try p.expr(); | |
| 4936 | 5608 | _ = try p.expectToken(.semicolon); |
| 4937 | const ret_ty = p.func.ty.?.returnType(); | |
| 4938 | 5609 | |
| 4939 | if (p.func.ty.?.hasAttribute(.noreturn)) { | |
| 4940 | try p.errStr(.invalid_noreturn, e_tok, p.tokSlice(p.func.name)); | |
| 4941 | } | |
| 5610 | const func_qt = p.func.qt.?; // `return` cannot be parsed outside of a function. | |
| 5611 | const ret_qt: QualType = if (func_qt.get(p.comp, .func)) |func_ty| func_ty.return_type else .invalid; | |
| 5612 | const ret_void = !ret_qt.isInvalid() and ret_qt.is(p.comp, .void); | |
| 4942 | 5613 | |
| 4943 | if (e.node == .none) { | |
| 4944 | if (!ret_ty.is(.void)) try p.errStr(.func_should_return, ret_tok, p.tokSlice(p.func.name)); | |
| 4945 | return try p.addNode(.{ .tag = .return_stmt, .data = .{ .un = e.node }, .loc = @enumFromInt(ret_tok) }); | |
| 4946 | } else if (ret_ty.is(.void)) { | |
| 4947 | try p.errStr(.void_func_returns_value, e_tok, p.tokSlice(p.func.name)); | |
| 4948 | return try p.addNode(.{ .tag = .return_stmt, .data = .{ .un = e.node }, .loc = @enumFromInt(ret_tok) }); | |
| 5614 | if (func_qt.hasAttribute(p.comp, .noreturn)) { | |
| 5615 | try p.err(e_tok, .invalid_noreturn, .{p.tokSlice(p.func.name)}); | |
| 4949 | 5616 | } |
| 4950 | 5617 | |
| 4951 | try e.lvalConversion(p); | |
| 4952 | try e.coerce(p, ret_ty, e_tok, .ret); | |
| 5618 | if (ret_expr) |*some| { | |
| 5619 | if (ret_void) { | |
| 5620 | try p.err(e_tok, .void_func_returns_value, .{p.tokSlice(p.func.name)}); | |
| 5621 | } else { | |
| 5622 | try some.coerce(p, ret_qt, e_tok, .ret); | |
| 5623 | ||
| 5624 | try some.saveValue(p); | |
| 5625 | } | |
| 5626 | } else if (!ret_void) { | |
| 5627 | try p.err(ret_tok, .func_should_return, .{p.tokSlice(p.func.name)}); | |
| 5628 | } | |
| 4953 | 5629 | |
| 4954 | try e.saveValue(p); | |
| 4955 | return try p.addNode(.{ .tag = .return_stmt, .data = .{ .un = e.node }, .loc = @enumFromInt(ret_tok) }); | |
| 5630 | return try p.addNode(.{ .return_stmt = .{ | |
| 5631 | .return_tok = ret_tok, | |
| 5632 | .operand = if (ret_expr) |some| .{ .expr = some.node } else .none, | |
| 5633 | .return_qt = ret_qt, | |
| 5634 | } }); | |
| 4956 | 5635 | } |
| 4957 | 5636 | |
| 4958 | 5637 | // ====== expressions ====== |
| 4959 | 5638 | |
| 4960 | 5639 | pub fn macroExpr(p: *Parser) Compilation.Error!bool { |
| 4961 | const res = p.condExpr() catch |e| switch (e) { | |
| 5640 | const res = p.expect(condExpr) catch |e| switch (e) { | |
| 4962 | 5641 | error.OutOfMemory => return error.OutOfMemory, |
| 4963 | 5642 | error.FatalError => return error.FatalError, |
| 4964 | 5643 | error.ParsingFailed => return false, |
| 4965 | 5644 | }; |
| 4966 | if (res.val.opt_ref == .none) { | |
| 4967 | try p.errTok(.expected_expr, p.tok_i); | |
| 4968 | return false; | |
| 4969 | } | |
| 4970 | 5645 | return res.val.toBool(p.comp); |
| 4971 | 5646 | } |
| 4972 | 5647 | |
| 4973 | 5648 | const CallExpr = union(enum) { |
| 4974 | standard: NodeIndex, | |
| 5649 | standard: Node.Index, | |
| 4975 | 5650 | builtin: struct { |
| 4976 | node: NodeIndex, | |
| 5651 | builtin_tok: TokenIndex, | |
| 4977 | 5652 | tag: Builtin.Tag, |
| 4978 | 5653 | }, |
| 4979 | 5654 | |
| 4980 | fn init(p: *Parser, call_node: NodeIndex, func_node: NodeIndex) CallExpr { | |
| 4981 | if (p.getNode(call_node, .builtin_call_expr_one)) |node| { | |
| 4982 | const data = p.nodes.items(.data)[@intFromEnum(node)]; | |
| 4983 | const name = p.tokSlice(data.decl.name); | |
| 4984 | const builtin_ty = p.comp.builtins.lookup(name); | |
| 4985 | return .{ .builtin = .{ .node = node, .tag = builtin_ty.builtin.tag } }; | |
| 5655 | fn init(p: *Parser, call_node: Node.Index, func_node: Node.Index) CallExpr { | |
| 5656 | if (p.getNode(call_node, .builtin_ref)) |builtin_ref| { | |
| 5657 | const name = p.tokSlice(builtin_ref.name_tok); | |
| 5658 | const expanded = p.comp.builtins.lookup(name); | |
| 5659 | return .{ .builtin = .{ .builtin_tok = builtin_ref.name_tok, .tag = expanded.builtin.tag } }; | |
| 4986 | 5660 | } |
| 4987 | 5661 | return .{ .standard = func_node }; |
| 4988 | 5662 | } |
| ... | ... | @@ -4991,9 +5665,9 @@ const CallExpr = union(enum) { |
| 4991 | 5665 | return switch (self) { |
| 4992 | 5666 | .standard => true, |
| 4993 | 5667 | .builtin => |builtin| switch (builtin.tag) { |
| 4994 | Builtin.tagFromName("__builtin_va_start").?, | |
| 4995 | Builtin.tagFromName("__va_start").?, | |
| 4996 | Builtin.tagFromName("va_start").?, | |
| 5668 | .__builtin_va_start, | |
| 5669 | .__va_start, | |
| 5670 | .va_start, | |
| 4997 | 5671 | => arg_idx != 1, |
| 4998 | 5672 | else => true, |
| 4999 | 5673 | }, |
| ... | ... | @@ -5004,17 +5678,17 @@ const CallExpr = union(enum) { |
| 5004 | 5678 | return switch (self) { |
| 5005 | 5679 | .standard => true, |
| 5006 | 5680 | .builtin => |builtin| switch (builtin.tag) { |
| 5007 | Builtin.tagFromName("__builtin_va_start").?, | |
| 5008 | Builtin.tagFromName("__va_start").?, | |
| 5009 | Builtin.tagFromName("va_start").?, | |
| 5681 | .__builtin_va_start, | |
| 5682 | .__va_start, | |
| 5683 | .va_start, | |
| 5010 | 5684 | => arg_idx != 1, |
| 5011 | Builtin.tagFromName("__builtin_add_overflow").?, | |
| 5012 | Builtin.tagFromName("__builtin_complex").?, | |
| 5013 | Builtin.tagFromName("__builtin_isinf").?, | |
| 5014 | Builtin.tagFromName("__builtin_isinf_sign").?, | |
| 5015 | Builtin.tagFromName("__builtin_mul_overflow").?, | |
| 5016 | Builtin.tagFromName("__builtin_isnan").?, | |
| 5017 | Builtin.tagFromName("__builtin_sub_overflow").?, | |
| 5685 | .__builtin_add_overflow, | |
| 5686 | .__builtin_complex, | |
| 5687 | .__builtin_isinf, | |
| 5688 | .__builtin_isinf_sign, | |
| 5689 | .__builtin_mul_overflow, | |
| 5690 | .__builtin_isnan, | |
| 5691 | .__builtin_sub_overflow, | |
| 5018 | 5692 | => false, |
| 5019 | 5693 | else => true, |
| 5020 | 5694 | }, |
| ... | ... | @@ -5030,16 +5704,16 @@ const CallExpr = union(enum) { |
| 5030 | 5704 | fn checkVarArg(self: CallExpr, p: *Parser, first_after: TokenIndex, param_tok: TokenIndex, arg: *Result, arg_idx: u32) Error!void { |
| 5031 | 5705 | if (self == .standard) return; |
| 5032 | 5706 | |
| 5033 | const builtin_tok = p.nodes.items(.data)[@intFromEnum(self.builtin.node)].decl.name; | |
| 5707 | const builtin_tok = self.builtin.builtin_tok; | |
| 5034 | 5708 | switch (self.builtin.tag) { |
| 5035 | Builtin.tagFromName("__builtin_va_start").?, | |
| 5036 | Builtin.tagFromName("__va_start").?, | |
| 5037 | Builtin.tagFromName("va_start").?, | |
| 5709 | .__builtin_va_start, | |
| 5710 | .__va_start, | |
| 5711 | .va_start, | |
| 5038 | 5712 | => return p.checkVaStartArg(builtin_tok, first_after, param_tok, arg, arg_idx), |
| 5039 | Builtin.tagFromName("__builtin_complex").? => return p.checkComplexArg(builtin_tok, first_after, param_tok, arg, arg_idx), | |
| 5040 | Builtin.tagFromName("__builtin_add_overflow").?, | |
| 5041 | Builtin.tagFromName("__builtin_sub_overflow").?, | |
| 5042 | Builtin.tagFromName("__builtin_mul_overflow").?, | |
| 5713 | .__builtin_complex => return p.checkComplexArg(builtin_tok, first_after, param_tok, arg, arg_idx), | |
| 5714 | .__builtin_add_overflow, | |
| 5715 | .__builtin_sub_overflow, | |
| 5716 | .__builtin_mul_overflow, | |
| 5043 | 5717 | => return p.checkArithOverflowArg(builtin_tok, first_after, param_tok, arg, arg_idx), |
| 5044 | 5718 | |
| 5045 | 5719 | else => {}, |
| ... | ... | @@ -5055,222 +5729,165 @@ const CallExpr = union(enum) { |
| 5055 | 5729 | return switch (self) { |
| 5056 | 5730 | .standard => null, |
| 5057 | 5731 | .builtin => |builtin| switch (builtin.tag) { |
| 5058 | Builtin.tagFromName("__c11_atomic_thread_fence").?, | |
| 5059 | Builtin.tagFromName("__c11_atomic_signal_fence").?, | |
| 5060 | Builtin.tagFromName("__c11_atomic_is_lock_free").?, | |
| 5061 | Builtin.tagFromName("__builtin_isinf").?, | |
| 5062 | Builtin.tagFromName("__builtin_isinf_sign").?, | |
| 5063 | Builtin.tagFromName("__builtin_isnan").?, | |
| 5732 | .__c11_atomic_thread_fence, | |
| 5733 | .__c11_atomic_signal_fence, | |
| 5734 | .__c11_atomic_is_lock_free, | |
| 5735 | .__builtin_isinf, | |
| 5736 | .__builtin_isinf_sign, | |
| 5737 | .__builtin_isnan, | |
| 5064 | 5738 | => 1, |
| 5065 | 5739 | |
| 5066 | Builtin.tagFromName("__builtin_complex").?, | |
| 5067 | Builtin.tagFromName("__c11_atomic_load").?, | |
| 5068 | Builtin.tagFromName("__c11_atomic_init").?, | |
| 5740 | .__builtin_complex, | |
| 5741 | .__c11_atomic_load, | |
| 5742 | .__c11_atomic_init, | |
| 5069 | 5743 | => 2, |
| 5070 | 5744 | |
| 5071 | Builtin.tagFromName("__c11_atomic_store").?, | |
| 5072 | Builtin.tagFromName("__c11_atomic_exchange").?, | |
| 5073 | Builtin.tagFromName("__c11_atomic_fetch_add").?, | |
| 5074 | Builtin.tagFromName("__c11_atomic_fetch_sub").?, | |
| 5075 | Builtin.tagFromName("__c11_atomic_fetch_or").?, | |
| 5076 | Builtin.tagFromName("__c11_atomic_fetch_xor").?, | |
| 5077 | Builtin.tagFromName("__c11_atomic_fetch_and").?, | |
| 5078 | Builtin.tagFromName("__atomic_fetch_add").?, | |
| 5079 | Builtin.tagFromName("__atomic_fetch_sub").?, | |
| 5080 | Builtin.tagFromName("__atomic_fetch_and").?, | |
| 5081 | Builtin.tagFromName("__atomic_fetch_xor").?, | |
| 5082 | Builtin.tagFromName("__atomic_fetch_or").?, | |
| 5083 | Builtin.tagFromName("__atomic_fetch_nand").?, | |
| 5084 | Builtin.tagFromName("__atomic_add_fetch").?, | |
| 5085 | Builtin.tagFromName("__atomic_sub_fetch").?, | |
| 5086 | Builtin.tagFromName("__atomic_and_fetch").?, | |
| 5087 | Builtin.tagFromName("__atomic_xor_fetch").?, | |
| 5088 | Builtin.tagFromName("__atomic_or_fetch").?, | |
| 5089 | Builtin.tagFromName("__atomic_nand_fetch").?, | |
| 5090 | Builtin.tagFromName("__builtin_add_overflow").?, | |
| 5091 | Builtin.tagFromName("__builtin_sub_overflow").?, | |
| 5092 | Builtin.tagFromName("__builtin_mul_overflow").?, | |
| 5745 | .__c11_atomic_store, | |
| 5746 | .__c11_atomic_exchange, | |
| 5747 | .__c11_atomic_fetch_add, | |
| 5748 | .__c11_atomic_fetch_sub, | |
| 5749 | .__c11_atomic_fetch_or, | |
| 5750 | .__c11_atomic_fetch_xor, | |
| 5751 | .__c11_atomic_fetch_and, | |
| 5752 | .__atomic_fetch_add, | |
| 5753 | .__atomic_fetch_sub, | |
| 5754 | .__atomic_fetch_and, | |
| 5755 | .__atomic_fetch_xor, | |
| 5756 | .__atomic_fetch_or, | |
| 5757 | .__atomic_fetch_nand, | |
| 5758 | .__atomic_add_fetch, | |
| 5759 | .__atomic_sub_fetch, | |
| 5760 | .__atomic_and_fetch, | |
| 5761 | .__atomic_xor_fetch, | |
| 5762 | .__atomic_or_fetch, | |
| 5763 | .__atomic_nand_fetch, | |
| 5764 | .__builtin_add_overflow, | |
| 5765 | .__builtin_sub_overflow, | |
| 5766 | .__builtin_mul_overflow, | |
| 5093 | 5767 | => 3, |
| 5094 | 5768 | |
| 5095 | Builtin.tagFromName("__c11_atomic_compare_exchange_strong").?, | |
| 5096 | Builtin.tagFromName("__c11_atomic_compare_exchange_weak").?, | |
| 5769 | .__c11_atomic_compare_exchange_strong, | |
| 5770 | .__c11_atomic_compare_exchange_weak, | |
| 5097 | 5771 | => 5, |
| 5098 | 5772 | |
| 5099 | Builtin.tagFromName("__atomic_compare_exchange").?, | |
| 5100 | Builtin.tagFromName("__atomic_compare_exchange_n").?, | |
| 5773 | .__atomic_compare_exchange, | |
| 5774 | .__atomic_compare_exchange_n, | |
| 5101 | 5775 | => 6, |
| 5102 | 5776 | else => null, |
| 5103 | 5777 | }, |
| 5104 | 5778 | }; |
| 5105 | 5779 | } |
| 5106 | 5780 | |
| 5107 | fn returnType(self: CallExpr, p: *Parser, callable_ty: Type) Type { | |
| 5108 | return switch (self) { | |
| 5109 | .standard => callable_ty.returnType(), | |
| 5110 | .builtin => |builtin| switch (builtin.tag) { | |
| 5111 | Builtin.tagFromName("__c11_atomic_exchange").? => { | |
| 5112 | if (p.list_buf.items.len != 4) return Type.invalid; // wrong number of arguments; already an error | |
| 5113 | const second_param = p.list_buf.items[2]; | |
| 5114 | return p.nodes.items(.ty)[@intFromEnum(second_param)]; | |
| 5115 | }, | |
| 5116 | Builtin.tagFromName("__c11_atomic_load").? => { | |
| 5117 | if (p.list_buf.items.len != 3) return Type.invalid; // wrong number of arguments; already an error | |
| 5118 | const first_param = p.list_buf.items[1]; | |
| 5119 | const ty = p.nodes.items(.ty)[@intFromEnum(first_param)]; | |
| 5120 | if (!ty.isPtr()) return Type.invalid; | |
| 5121 | return ty.elemType(); | |
| 5122 | }, | |
| 5781 | fn returnType(self: CallExpr, p: *Parser, func_qt: QualType) !QualType { | |
| 5782 | if (self == .standard) { | |
| 5783 | return if (func_qt.get(p.comp, .func)) |func_ty| func_ty.return_type else .invalid; | |
| 5784 | } | |
| 5785 | const builtin = self.builtin; | |
| 5786 | const func_ty = func_qt.get(p.comp, .func).?; | |
| 5787 | return switch (builtin.tag) { | |
| 5788 | .__c11_atomic_exchange => { | |
| 5789 | if (p.list_buf.items.len != 4) return .invalid; // wrong number of arguments; already an error | |
| 5790 | const second_param = p.list_buf.items[2]; | |
| 5791 | return second_param.qt(&p.tree); | |
| 5792 | }, | |
| 5793 | .__c11_atomic_load => { | |
| 5794 | if (p.list_buf.items.len != 3) return .invalid; // wrong number of arguments; already an error | |
| 5795 | const first_param = p.list_buf.items[1]; | |
| 5796 | const qt = first_param.qt(&p.tree); | |
| 5797 | if (!qt.isPointer(p.comp)) return .invalid; | |
| 5798 | return qt.childType(p.comp); | |
| 5799 | }, | |
| 5123 | 5800 | |
| 5124 | Builtin.tagFromName("__atomic_fetch_add").?, | |
| 5125 | Builtin.tagFromName("__atomic_add_fetch").?, | |
| 5126 | Builtin.tagFromName("__c11_atomic_fetch_add").?, | |
| 5127 | ||
| 5128 | Builtin.tagFromName("__atomic_fetch_sub").?, | |
| 5129 | Builtin.tagFromName("__atomic_sub_fetch").?, | |
| 5130 | Builtin.tagFromName("__c11_atomic_fetch_sub").?, | |
| 5131 | ||
| 5132 | Builtin.tagFromName("__atomic_fetch_and").?, | |
| 5133 | Builtin.tagFromName("__atomic_and_fetch").?, | |
| 5134 | Builtin.tagFromName("__c11_atomic_fetch_and").?, | |
| 5135 | ||
| 5136 | Builtin.tagFromName("__atomic_fetch_xor").?, | |
| 5137 | Builtin.tagFromName("__atomic_xor_fetch").?, | |
| 5138 | Builtin.tagFromName("__c11_atomic_fetch_xor").?, | |
| 5139 | ||
| 5140 | Builtin.tagFromName("__atomic_fetch_or").?, | |
| 5141 | Builtin.tagFromName("__atomic_or_fetch").?, | |
| 5142 | Builtin.tagFromName("__c11_atomic_fetch_or").?, | |
| 5143 | ||
| 5144 | Builtin.tagFromName("__atomic_fetch_nand").?, | |
| 5145 | Builtin.tagFromName("__atomic_nand_fetch").?, | |
| 5146 | Builtin.tagFromName("__c11_atomic_fetch_nand").?, | |
| 5147 | => { | |
| 5148 | if (p.list_buf.items.len != 3) return Type.invalid; // wrong number of arguments; already an error | |
| 5149 | const second_param = p.list_buf.items[2]; | |
| 5150 | return p.nodes.items(.ty)[@intFromEnum(second_param)]; | |
| 5151 | }, | |
| 5152 | Builtin.tagFromName("__builtin_complex").? => { | |
| 5153 | if (p.list_buf.items.len < 1) return Type.invalid; // not enough arguments; already an error | |
| 5154 | const last_param = p.list_buf.items[p.list_buf.items.len - 1]; | |
| 5155 | return p.nodes.items(.ty)[@intFromEnum(last_param)].makeComplex(); | |
| 5156 | }, | |
| 5157 | Builtin.tagFromName("__atomic_compare_exchange").?, | |
| 5158 | Builtin.tagFromName("__atomic_compare_exchange_n").?, | |
| 5159 | Builtin.tagFromName("__c11_atomic_is_lock_free").?, | |
| 5160 | => .{ .specifier = .bool }, | |
| 5161 | else => callable_ty.returnType(), | |
| 5162 | ||
| 5163 | Builtin.tagFromName("__c11_atomic_compare_exchange_strong").?, | |
| 5164 | Builtin.tagFromName("__c11_atomic_compare_exchange_weak").?, | |
| 5165 | => { | |
| 5166 | if (p.list_buf.items.len != 6) return Type.invalid; // wrong number of arguments | |
| 5167 | const third_param = p.list_buf.items[3]; | |
| 5168 | return p.nodes.items(.ty)[@intFromEnum(third_param)]; | |
| 5169 | }, | |
| 5801 | .__atomic_fetch_add, | |
| 5802 | .__atomic_add_fetch, | |
| 5803 | .__c11_atomic_fetch_add, | |
| 5804 | ||
| 5805 | .__atomic_fetch_sub, | |
| 5806 | .__atomic_sub_fetch, | |
| 5807 | .__c11_atomic_fetch_sub, | |
| 5808 | ||
| 5809 | .__atomic_fetch_and, | |
| 5810 | .__atomic_and_fetch, | |
| 5811 | .__c11_atomic_fetch_and, | |
| 5812 | ||
| 5813 | .__atomic_fetch_xor, | |
| 5814 | .__atomic_xor_fetch, | |
| 5815 | .__c11_atomic_fetch_xor, | |
| 5816 | ||
| 5817 | .__atomic_fetch_or, | |
| 5818 | .__atomic_or_fetch, | |
| 5819 | .__c11_atomic_fetch_or, | |
| 5820 | ||
| 5821 | .__atomic_fetch_nand, | |
| 5822 | .__atomic_nand_fetch, | |
| 5823 | .__c11_atomic_fetch_nand, | |
| 5824 | => { | |
| 5825 | if (p.list_buf.items.len != 3) return .invalid; // wrong number of arguments; already an error | |
| 5826 | const second_param = p.list_buf.items[2]; | |
| 5827 | return second_param.qt(&p.tree); | |
| 5828 | }, | |
| 5829 | .__builtin_complex => { | |
| 5830 | if (p.list_buf.items.len < 1) return .invalid; // not enough arguments; already an error | |
| 5831 | const last_param = p.list_buf.items[p.list_buf.items.len - 1]; | |
| 5832 | return try last_param.qt(&p.tree).toComplex(p.comp); | |
| 5833 | }, | |
| 5834 | .__atomic_compare_exchange, | |
| 5835 | .__atomic_compare_exchange_n, | |
| 5836 | .__c11_atomic_is_lock_free, | |
| 5837 | => .bool, | |
| 5838 | else => func_ty.return_type, | |
| 5839 | ||
| 5840 | .__c11_atomic_compare_exchange_strong, | |
| 5841 | .__c11_atomic_compare_exchange_weak, | |
| 5842 | => { | |
| 5843 | if (p.list_buf.items.len != 6) return .invalid; // wrong number of arguments | |
| 5844 | const third_param = p.list_buf.items[3]; | |
| 5845 | return third_param.qt(&p.tree); | |
| 5170 | 5846 | }, |
| 5171 | 5847 | }; |
| 5172 | 5848 | } |
| 5173 | 5849 | |
| 5174 | fn finish(self: CallExpr, p: *Parser, ty: Type, list_buf_top: usize, arg_count: u32) Error!Result { | |
| 5175 | const ret_ty = self.returnType(p, ty); | |
| 5850 | fn finish(self: CallExpr, p: *Parser, func_qt: QualType, list_buf_top: usize, l_paren: TokenIndex) Error!Result { | |
| 5851 | const args = p.list_buf.items[list_buf_top..]; | |
| 5852 | const return_qt = try self.returnType(p, func_qt); | |
| 5176 | 5853 | switch (self) { |
| 5177 | .standard => |func_node| { | |
| 5178 | var call_node: Tree.Node = .{ | |
| 5179 | .tag = .call_expr_one, | |
| 5180 | .ty = ret_ty, | |
| 5181 | .data = .{ .two = .{ func_node, .none } }, | |
| 5182 | }; | |
| 5183 | const args = p.list_buf.items[list_buf_top..]; | |
| 5184 | switch (arg_count) { | |
| 5185 | 0 => {}, | |
| 5186 | 1 => call_node.data.two[1] = args[1], // args[0] == func.node | |
| 5187 | else => { | |
| 5188 | call_node.tag = .call_expr; | |
| 5189 | call_node.data = .{ .range = try p.addList(args) }; | |
| 5190 | }, | |
| 5191 | } | |
| 5192 | return Result{ .node = try p.addNode(call_node), .ty = ret_ty }; | |
| 5854 | .standard => |func_node| return .{ | |
| 5855 | .qt = return_qt, | |
| 5856 | .node = try p.addNode(.{ .call_expr = .{ | |
| 5857 | .l_paren_tok = l_paren, | |
| 5858 | .qt = return_qt.unqualified(), | |
| 5859 | .callee = func_node, | |
| 5860 | .args = args, | |
| 5861 | } }), | |
| 5193 | 5862 | }, |
| 5194 | .builtin => |builtin| { | |
| 5195 | const index = @intFromEnum(builtin.node); | |
| 5196 | var call_node = p.nodes.get(index); | |
| 5197 | defer p.nodes.set(index, call_node); | |
| 5198 | call_node.ty = ret_ty; | |
| 5199 | const args = p.list_buf.items[list_buf_top..]; | |
| 5200 | switch (arg_count) { | |
| 5201 | 0 => {}, | |
| 5202 | 1 => call_node.data.decl.node = args[1], // args[0] == func.node | |
| 5203 | else => { | |
| 5204 | call_node.tag = .builtin_call_expr; | |
| 5205 | args[0] = @enumFromInt(call_node.data.decl.name); | |
| 5206 | call_node.data = .{ .range = try p.addList(args) }; | |
| 5207 | }, | |
| 5208 | } | |
| 5209 | const val = try evalBuiltin(builtin.tag, p, args[1..]); | |
| 5210 | return Result{ .node = builtin.node, .ty = ret_ty, .val = val }; | |
| 5863 | .builtin => |builtin| return .{ | |
| 5864 | .val = try evalBuiltin(builtin.tag, p, args), | |
| 5865 | .qt = return_qt, | |
| 5866 | .node = try p.addNode(.{ .builtin_call_expr = .{ | |
| 5867 | .builtin_tok = builtin.builtin_tok, | |
| 5868 | .qt = return_qt, | |
| 5869 | .args = args, | |
| 5870 | } }), | |
| 5211 | 5871 | }, |
| 5212 | 5872 | } |
| 5213 | 5873 | } |
| 5214 | 5874 | }; |
| 5215 | 5875 | |
| 5216 | 5876 | pub const Result = struct { |
| 5217 | node: NodeIndex = .none, | |
| 5218 | ty: Type = .{ .specifier = .int }, | |
| 5877 | node: Node.Index, | |
| 5878 | qt: QualType = .int, | |
| 5219 | 5879 | val: Value = .{}, |
| 5220 | 5880 | |
| 5221 | const invalid: Result = .{ .ty = Type.invalid }; | |
| 5222 | ||
| 5223 | pub fn str(res: Result, p: *Parser) ![]const u8 { | |
| 5224 | switch (res.val.opt_ref) { | |
| 5225 | .none => return "(none)", | |
| 5226 | .null => return "nullptr_t", | |
| 5227 | else => {}, | |
| 5228 | } | |
| 5229 | const strings_top = p.strings.items.len; | |
| 5230 | defer p.strings.items.len = strings_top; | |
| 5231 | ||
| 5232 | { | |
| 5233 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 5234 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 5235 | defer { | |
| 5236 | unmanaged = allocating.toArrayList(); | |
| 5237 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 5238 | } | |
| 5239 | res.val.print(res.ty, p.comp, &allocating.writer) catch |e| switch (e) { | |
| 5240 | error.WriteFailed => return error.OutOfMemory, | |
| 5241 | }; | |
| 5242 | } | |
| 5243 | return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); | |
| 5244 | } | |
| 5245 | ||
| 5246 | fn expect(res: Result, p: *Parser) Error!void { | |
| 5247 | if (p.in_macro) { | |
| 5248 | if (res.val.opt_ref == .none) { | |
| 5249 | try p.errTok(.expected_expr, p.tok_i); | |
| 5250 | return error.ParsingFailed; | |
| 5251 | } | |
| 5252 | return; | |
| 5253 | } | |
| 5254 | if (res.node == .none) { | |
| 5255 | try p.errTok(.expected_expr, p.tok_i); | |
| 5256 | return error.ParsingFailed; | |
| 5257 | } | |
| 5258 | } | |
| 5259 | ||
| 5260 | fn empty(res: Result, p: *Parser) bool { | |
| 5261 | if (p.in_macro) return res.val.opt_ref == .none; | |
| 5262 | return res.node == .none; | |
| 5263 | } | |
| 5264 | ||
| 5265 | fn maybeWarnUnused(res: Result, p: *Parser, expr_start: TokenIndex, err_start: usize) Error!void { | |
| 5266 | if (res.ty.is(.void) or res.node == .none) return; | |
| 5267 | // don't warn about unused result if the expression contained errors besides other unused results | |
| 5268 | for (p.comp.diagnostics.list.items[err_start..]) |err_item| { | |
| 5269 | if (err_item.tag != .unused_value) return; | |
| 5270 | } | |
| 5881 | fn maybeWarnUnused(res: Result, p: *Parser, expr_start: TokenIndex, prev_total: usize) Error!void { | |
| 5882 | if (res.qt.is(p.comp, .void)) return; | |
| 5883 | if (res.qt.isInvalid()) return; | |
| 5884 | // // don't warn about unused result if the expression contained errors besides other unused results | |
| 5885 | if (p.diagnostics.total != prev_total) return; // TODO improve | |
| 5886 | // for (p.diagnostics.list.items[err_start..]) |err_item| { | |
| 5887 | // if (err_item.tag != .unused_value) return; | |
| 5888 | // } | |
| 5271 | 5889 | var cur_node = res.node; |
| 5272 | while (true) switch (p.nodes.items(.tag)[@intFromEnum(cur_node)]) { | |
| 5273 | .invalid, // So that we don't need to check for node == 0 | |
| 5890 | while (true) switch (cur_node.get(&p.tree)) { | |
| 5274 | 5891 | .assign_expr, |
| 5275 | 5892 | .mul_assign_expr, |
| 5276 | 5893 | .div_assign_expr, |
| ... | ... | @@ -5287,109 +5904,136 @@ pub const Result = struct { |
| 5287 | 5904 | .post_inc_expr, |
| 5288 | 5905 | .post_dec_expr, |
| 5289 | 5906 | => return, |
| 5290 | .call_expr, .call_expr_one => { | |
| 5291 | const tmp_tree = p.tmpTree(); | |
| 5292 | const child_nodes = tmp_tree.childNodes(cur_node); | |
| 5293 | const fn_ptr = child_nodes[0]; | |
| 5294 | const call_info = tmp_tree.callableResultUsage(fn_ptr) orelse return; | |
| 5295 | if (call_info.nodiscard) try p.errStr(.nodiscard_unused, expr_start, p.tokSlice(call_info.tok)); | |
| 5296 | if (call_info.warn_unused_result) try p.errStr(.warn_unused_result, expr_start, p.tokSlice(call_info.tok)); | |
| 5907 | .call_expr => |call| { | |
| 5908 | const call_info = p.tree.callableResultUsage(call.callee) orelse return; | |
| 5909 | if (call_info.nodiscard) try p.err(expr_start, .nodiscard_unused, .{p.tokSlice(call_info.tok)}); | |
| 5910 | if (call_info.warn_unused_result) try p.err(expr_start, .warn_unused_result, .{p.tokSlice(call_info.tok)}); | |
| 5297 | 5911 | return; |
| 5298 | 5912 | }, |
| 5299 | .stmt_expr => { | |
| 5300 | const body = p.nodes.items(.data)[@intFromEnum(cur_node)].un; | |
| 5301 | switch (p.nodes.items(.tag)[@intFromEnum(body)]) { | |
| 5302 | .compound_stmt_two => { | |
| 5303 | const body_stmt = p.nodes.items(.data)[@intFromEnum(body)].two; | |
| 5304 | cur_node = if (body_stmt[1] != .none) body_stmt[1] else body_stmt[0]; | |
| 5305 | }, | |
| 5306 | .compound_stmt => { | |
| 5307 | const data = p.nodes.items(.data)[@intFromEnum(body)]; | |
| 5308 | cur_node = p.data.items[data.range.end - 1]; | |
| 5309 | }, | |
| 5310 | else => unreachable, | |
| 5311 | } | |
| 5913 | .builtin_call_expr => |call| { | |
| 5914 | const expanded = p.comp.builtins.lookup(p.tokSlice(call.builtin_tok)); | |
| 5915 | const attributes = expanded.builtin.properties.attributes; | |
| 5916 | if (attributes.pure) try p.err(call.builtin_tok, .builtin_unused, .{"pure"}); | |
| 5917 | if (attributes.@"const") try p.err(call.builtin_tok, .builtin_unused, .{"const"}); | |
| 5918 | return; | |
| 5312 | 5919 | }, |
| 5313 | .comma_expr => cur_node = p.nodes.items(.data)[@intFromEnum(cur_node)].bin.rhs, | |
| 5314 | .paren_expr => cur_node = p.nodes.items(.data)[@intFromEnum(cur_node)].un, | |
| 5920 | .stmt_expr => |stmt_expr| { | |
| 5921 | const compound = stmt_expr.operand.get(&p.tree).compound_stmt; | |
| 5922 | cur_node = compound.body[compound.body.len - 1]; | |
| 5923 | }, | |
| 5924 | .comma_expr => |comma| cur_node = comma.rhs, | |
| 5925 | .paren_expr => |grouped| cur_node = grouped.operand, | |
| 5315 | 5926 | else => break, |
| 5316 | 5927 | }; |
| 5317 | try p.errTok(.unused_value, expr_start); | |
| 5928 | try p.err(expr_start, .unused_value, .{}); | |
| 5318 | 5929 | } |
| 5319 | 5930 | |
| 5320 | fn boolRes(lhs: *Result, p: *Parser, tag: Tree.Tag, rhs: Result, tok_i: TokenIndex) !void { | |
| 5931 | fn boolRes(lhs: *Result, p: *Parser, tag: std.meta.Tag(Node), rhs: Result, tok_i: TokenIndex) !void { | |
| 5321 | 5932 | if (lhs.val.opt_ref == .null) { |
| 5322 | lhs.val = Value.zero; | |
| 5933 | lhs.val = .zero; | |
| 5323 | 5934 | } |
| 5324 | if (lhs.ty.specifier != .invalid) { | |
| 5325 | lhs.ty = Type.int; | |
| 5935 | if (!lhs.qt.isInvalid()) { | |
| 5936 | lhs.qt = .int; | |
| 5326 | 5937 | } |
| 5327 | 5938 | return lhs.bin(p, tag, rhs, tok_i); |
| 5328 | 5939 | } |
| 5329 | 5940 | |
| 5330 | fn bin(lhs: *Result, p: *Parser, tag: Tree.Tag, rhs: Result, tok_i: TokenIndex) !void { | |
| 5331 | lhs.node = try p.addNode(.{ | |
| 5332 | .tag = tag, | |
| 5333 | .ty = lhs.ty, | |
| 5334 | .data = .{ .bin = .{ .lhs = lhs.node, .rhs = rhs.node } }, | |
| 5335 | .loc = @enumFromInt(tok_i), | |
| 5336 | }); | |
| 5941 | fn bin(lhs: *Result, p: *Parser, rt_tag: std.meta.Tag(Node), rhs: Result, tok_i: TokenIndex) !void { | |
| 5942 | const bin_data: Node.Binary = .{ | |
| 5943 | .op_tok = tok_i, | |
| 5944 | .lhs = lhs.node, | |
| 5945 | .rhs = rhs.node, | |
| 5946 | .qt = lhs.qt, | |
| 5947 | }; | |
| 5948 | switch (rt_tag) { | |
| 5949 | // zig fmt: off | |
| 5950 | inline .comma_expr, .assign_expr, .mul_assign_expr, .div_assign_expr, | |
| 5951 | .mod_assign_expr, .add_assign_expr, .sub_assign_expr, .shl_assign_expr, | |
| 5952 | .shr_assign_expr, .bit_and_assign_expr, .bit_xor_assign_expr, | |
| 5953 | .bit_or_assign_expr, .bool_or_expr, .bool_and_expr, .bit_or_expr, | |
| 5954 | .bit_xor_expr, .bit_and_expr, .equal_expr, .not_equal_expr, | |
| 5955 | .less_than_expr, .less_than_equal_expr, .greater_than_expr, | |
| 5956 | .greater_than_equal_expr, .shl_expr, .shr_expr, .add_expr, | |
| 5957 | .sub_expr, .mul_expr, .div_expr, .mod_expr, | |
| 5958 | // zig fmt: on | |
| 5959 | => |tag| lhs.node = try p.addNode(@unionInit(Node, @tagName(tag), bin_data)), | |
| 5960 | else => unreachable, | |
| 5961 | } | |
| 5337 | 5962 | } |
| 5338 | 5963 | |
| 5339 | fn un(operand: *Result, p: *Parser, tag: Tree.Tag, tok_i: TokenIndex) Error!void { | |
| 5340 | operand.node = try p.addNode(.{ | |
| 5341 | .tag = tag, | |
| 5342 | .ty = operand.ty, | |
| 5343 | .data = .{ .un = operand.node }, | |
| 5344 | .loc = @enumFromInt(tok_i), | |
| 5345 | }); | |
| 5964 | fn un(operand: *Result, p: *Parser, rt_tag: std.meta.Tag(Node), tok_i: TokenIndex) Error!void { | |
| 5965 | const un_data: Node.Unary = .{ | |
| 5966 | .op_tok = tok_i, | |
| 5967 | .operand = operand.node, | |
| 5968 | .qt = operand.qt, | |
| 5969 | }; | |
| 5970 | switch (rt_tag) { | |
| 5971 | // zig fmt: off | |
| 5972 | inline .addr_of_expr, .deref_expr, .plus_expr, .negate_expr, | |
| 5973 | .bit_not_expr, .bool_not_expr, .pre_inc_expr, .pre_dec_expr, | |
| 5974 | .imag_expr, .real_expr, .post_inc_expr,.post_dec_expr, | |
| 5975 | .paren_expr, .stmt_expr, .imaginary_literal, .compound_assign_dummy_expr, | |
| 5976 | // zig fmt: on | |
| 5977 | => |tag| operand.node = try p.addNode(@unionInit(Node, @tagName(tag), un_data)), | |
| 5978 | else => unreachable, | |
| 5979 | } | |
| 5346 | 5980 | } |
| 5347 | 5981 | |
| 5348 | fn implicitCast(operand: *Result, p: *Parser, kind: Tree.CastKind) Error!void { | |
| 5982 | fn implicitCast(operand: *Result, p: *Parser, kind: Node.Cast.Kind, tok: TokenIndex) Error!void { | |
| 5349 | 5983 | operand.node = try p.addNode(.{ |
| 5350 | .tag = .implicit_cast, | |
| 5351 | .ty = operand.ty, | |
| 5352 | .data = .{ .cast = .{ .operand = operand.node, .kind = kind } }, | |
| 5984 | .cast = .{ | |
| 5985 | .l_paren = tok, | |
| 5986 | .kind = kind, | |
| 5987 | .operand = operand.node, | |
| 5988 | .qt = operand.qt, | |
| 5989 | .implicit = true, | |
| 5990 | }, | |
| 5353 | 5991 | }); |
| 5354 | 5992 | } |
| 5355 | 5993 | |
| 5356 | 5994 | fn adjustCondExprPtrs(a: *Result, tok: TokenIndex, b: *Result, p: *Parser) !bool { |
| 5357 | assert(a.ty.isPtr() and b.ty.isPtr()); | |
| 5995 | assert(a.qt.isPointer(p.comp) and b.qt.isPointer(p.comp)); | |
| 5996 | const gpa = p.comp.gpa; | |
| 5358 | 5997 | |
| 5359 | const a_elem = a.ty.elemType(); | |
| 5360 | const b_elem = b.ty.elemType(); | |
| 5361 | if (a_elem.eql(b_elem, p.comp, true)) return true; | |
| 5998 | const a_elem = a.qt.childType(p.comp); | |
| 5999 | const b_elem = b.qt.childType(p.comp); | |
| 6000 | if (a_elem.eqlQualified(b_elem, p.comp)) return true; | |
| 5362 | 6001 | |
| 5363 | var adjusted_elem_ty = try p.arena.create(Type); | |
| 5364 | adjusted_elem_ty.* = a_elem; | |
| 6002 | const has_void_pointer_branch = a.qt.scalarKind(p.comp) == .void_pointer or | |
| 6003 | b.qt.scalarKind(p.comp) == .void_pointer; | |
| 5365 | 6004 | |
| 5366 | const has_void_star_branch = a.ty.isVoidStar() or b.ty.isVoidStar(); | |
| 5367 | const only_quals_differ = a_elem.eql(b_elem, p.comp, false); | |
| 5368 | const pointers_compatible = only_quals_differ or has_void_star_branch; | |
| 6005 | const only_quals_differ = a_elem.eql(b_elem, p.comp); | |
| 6006 | const pointers_compatible = only_quals_differ or has_void_pointer_branch; | |
| 5369 | 6007 | |
| 5370 | if (!pointers_compatible or has_void_star_branch) { | |
| 6008 | var adjusted_elem_qt = a_elem; | |
| 6009 | if (!pointers_compatible or has_void_pointer_branch) { | |
| 5371 | 6010 | if (!pointers_compatible) { |
| 5372 | try p.errStr(.pointer_mismatch, tok, try p.typePairStrExtra(a.ty, " and ", b.ty)); | |
| 6011 | try p.err(tok, .pointer_mismatch, .{ a.qt, b.qt }); | |
| 5373 | 6012 | } |
| 5374 | adjusted_elem_ty.* = .{ .specifier = .void }; | |
| 6013 | adjusted_elem_qt = .void; | |
| 5375 | 6014 | } |
| 6015 | ||
| 5376 | 6016 | if (pointers_compatible) { |
| 5377 | adjusted_elem_ty.qual = a_elem.qual.mergeCV(b_elem.qual); | |
| 6017 | adjusted_elem_qt.@"const" = a_elem.@"const" or b_elem.@"const"; | |
| 6018 | adjusted_elem_qt.@"volatile" = a_elem.@"volatile" or b_elem.@"volatile"; | |
| 6019 | // TODO restrict? | |
| 5378 | 6020 | } |
| 5379 | if (!adjusted_elem_ty.eql(a_elem, p.comp, true)) { | |
| 5380 | a.ty = .{ | |
| 5381 | .data = .{ .sub_type = adjusted_elem_ty }, | |
| 5382 | .specifier = .pointer, | |
| 5383 | }; | |
| 5384 | try a.implicitCast(p, .bitcast); | |
| 6021 | ||
| 6022 | if (!adjusted_elem_qt.eqlQualified(a_elem, p.comp)) { | |
| 6023 | a.qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ | |
| 6024 | .child = adjusted_elem_qt, | |
| 6025 | .decayed = null, | |
| 6026 | } }); | |
| 6027 | try a.implicitCast(p, .bitcast, tok); | |
| 5385 | 6028 | } |
| 5386 | if (!adjusted_elem_ty.eql(b_elem, p.comp, true)) { | |
| 5387 | b.ty = .{ | |
| 5388 | .data = .{ .sub_type = adjusted_elem_ty }, | |
| 5389 | .specifier = .pointer, | |
| 5390 | }; | |
| 5391 | try b.implicitCast(p, .bitcast); | |
| 6029 | if (!adjusted_elem_qt.eqlQualified(b_elem, p.comp)) { | |
| 6030 | b.qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ | |
| 6031 | .child = adjusted_elem_qt, | |
| 6032 | .decayed = null, | |
| 6033 | } }); | |
| 6034 | try b.implicitCast(p, .bitcast, tok); | |
| 5392 | 6035 | } |
| 6036 | ||
| 5393 | 6037 | return true; |
| 5394 | 6038 | } |
| 5395 | 6039 | |
| ... | ... | @@ -5403,37 +6047,48 @@ pub const Result = struct { |
| 5403 | 6047 | conditional, |
| 5404 | 6048 | add, |
| 5405 | 6049 | sub, |
| 5406 | }) Error!bool { | |
| 5407 | if (b.ty.specifier == .invalid) { | |
| 6050 | }) !bool { | |
| 6051 | if (b.qt.isInvalid()) { | |
| 5408 | 6052 | try a.saveValue(p); |
| 5409 | a.ty = Type.invalid; | |
| 6053 | a.qt = .invalid; | |
| 5410 | 6054 | } |
| 5411 | if (a.ty.specifier == .invalid) { | |
| 6055 | if (a.qt.isInvalid()) { | |
| 5412 | 6056 | return false; |
| 5413 | 6057 | } |
| 5414 | try a.lvalConversion(p); | |
| 5415 | try b.lvalConversion(p); | |
| 6058 | try a.lvalConversion(p, tok); | |
| 6059 | try b.lvalConversion(p, tok); | |
| 5416 | 6060 | |
| 5417 | const a_vec = a.ty.is(.vector); | |
| 5418 | const b_vec = b.ty.is(.vector); | |
| 6061 | const a_vec = a.qt.is(p.comp, .vector); | |
| 6062 | const b_vec = b.qt.is(p.comp, .vector); | |
| 5419 | 6063 | if (a_vec and b_vec) { |
| 5420 | if (a.ty.eql(b.ty, p.comp, false)) { | |
| 6064 | if (a.qt.eql(b.qt, p.comp)) { | |
| 5421 | 6065 | return a.shouldEval(b, p); |
| 5422 | 6066 | } |
| 5423 | return a.invalidBinTy(tok, b, p); | |
| 6067 | if (a.qt.sizeCompare(b.qt, p.comp) == .eq) { | |
| 6068 | b.qt = a.qt; | |
| 6069 | try b.implicitCast(p, .bitcast, tok); | |
| 6070 | return a.shouldEval(b, p); | |
| 6071 | } | |
| 6072 | try p.err(tok, .incompatible_vec_types, .{ a.qt, b.qt }); | |
| 6073 | a.val = .{}; | |
| 6074 | b.val = .{}; | |
| 6075 | a.qt = .invalid; | |
| 6076 | return false; | |
| 5424 | 6077 | } else if (a_vec) { |
| 5425 | if (b.coerceExtra(p, a.ty.elemType(), tok, .test_coerce)) { | |
| 6078 | if (b.coerceExtra(p, a.qt.childType(p.comp), tok, .test_coerce)) { | |
| 5426 | 6079 | try b.saveValue(p); |
| 5427 | try b.implicitCast(p, .vector_splat); | |
| 6080 | b.qt = a.qt; | |
| 6081 | try b.implicitCast(p, .vector_splat, tok); | |
| 5428 | 6082 | return a.shouldEval(b, p); |
| 5429 | 6083 | } else |er| switch (er) { |
| 5430 | 6084 | error.CoercionFailed => return a.invalidBinTy(tok, b, p), |
| 5431 | 6085 | else => |e| return e, |
| 5432 | 6086 | } |
| 5433 | 6087 | } else if (b_vec) { |
| 5434 | if (a.coerceExtra(p, b.ty.elemType(), tok, .test_coerce)) { | |
| 6088 | if (a.coerceExtra(p, b.qt.childType(p.comp), tok, .test_coerce)) { | |
| 5435 | 6089 | try a.saveValue(p); |
| 5436 | try a.implicitCast(p, .vector_splat); | |
| 6090 | a.qt = b.qt; | |
| 6091 | try a.implicitCast(p, .vector_splat, tok); | |
| 5437 | 6092 | return a.shouldEval(b, p); |
| 5438 | 6093 | } else |er| switch (er) { |
| 5439 | 6094 | error.CoercionFailed => return a.invalidBinTy(tok, b, p), |
| ... | ... | @@ -5441,21 +6096,18 @@ pub const Result = struct { |
| 5441 | 6096 | } |
| 5442 | 6097 | } |
| 5443 | 6098 | |
| 5444 | const a_int = a.ty.isInt(); | |
| 5445 | const b_int = b.ty.isInt(); | |
| 5446 | if (a_int and b_int) { | |
| 6099 | const a_sk = a.qt.scalarKind(p.comp); | |
| 6100 | const b_sk = b.qt.scalarKind(p.comp); | |
| 6101 | ||
| 6102 | if (a_sk.isInt() and b_sk.isInt()) { | |
| 5447 | 6103 | try a.usualArithmeticConversion(b, p, tok); |
| 5448 | 6104 | return a.shouldEval(b, p); |
| 5449 | 6105 | } |
| 5450 | 6106 | if (kind == .integer) return a.invalidBinTy(tok, b, p); |
| 5451 | 6107 | |
| 5452 | const a_float = a.ty.isFloat(); | |
| 5453 | const b_float = b.ty.isFloat(); | |
| 5454 | const a_arithmetic = a_int or a_float; | |
| 5455 | const b_arithmetic = b_int or b_float; | |
| 5456 | if (a_arithmetic and b_arithmetic) { | |
| 6108 | if (a_sk.isArithmetic() and b_sk.isArithmetic()) { | |
| 5457 | 6109 | // <, <=, >, >= only work on real types |
| 5458 | if (kind == .relational and (!a.ty.isReal() or !b.ty.isReal())) | |
| 6110 | if (kind == .relational and (!a_sk.isReal() or !b_sk.isReal())) | |
| 5459 | 6111 | return a.invalidBinTy(tok, b, p); |
| 5460 | 6112 | |
| 5461 | 6113 | try a.usualArithmeticConversion(b, p, tok); |
| ... | ... | @@ -5463,372 +6115,443 @@ pub const Result = struct { |
| 5463 | 6115 | } |
| 5464 | 6116 | if (kind == .arithmetic) return a.invalidBinTy(tok, b, p); |
| 5465 | 6117 | |
| 5466 | const a_nullptr = a.ty.is(.nullptr_t); | |
| 5467 | const b_nullptr = b.ty.is(.nullptr_t); | |
| 5468 | const a_ptr = a.ty.isPtr(); | |
| 5469 | const b_ptr = b.ty.isPtr(); | |
| 5470 | const a_scalar = a_arithmetic or a_ptr; | |
| 5471 | const b_scalar = b_arithmetic or b_ptr; | |
| 5472 | 6118 | switch (kind) { |
| 5473 | 6119 | .boolean_logic => { |
| 5474 | if (!(a_scalar or a_nullptr) or !(b_scalar or b_nullptr)) return a.invalidBinTy(tok, b, p); | |
| 6120 | if (!(a_sk != .none or a_sk == .nullptr_t) or | |
| 6121 | !(b_sk != .none or b_sk == .nullptr_t)) | |
| 6122 | { | |
| 6123 | return a.invalidBinTy(tok, b, p); | |
| 6124 | } | |
| 5475 | 6125 | |
| 5476 | 6126 | // Do integer promotions but nothing else |
| 5477 | if (a_int) try a.intCast(p, a.ty.integerPromotion(p.comp), tok); | |
| 5478 | if (b_int) try b.intCast(p, b.ty.integerPromotion(p.comp), tok); | |
| 6127 | if (a_sk.isInt()) try a.castToInt(p, a.qt.promoteInt(p.comp), tok); | |
| 6128 | if (b_sk.isInt()) try b.castToInt(p, b.qt.promoteInt(p.comp), tok); | |
| 5479 | 6129 | return a.shouldEval(b, p); |
| 5480 | 6130 | }, |
| 5481 | 6131 | .relational, .equality => { |
| 5482 | if (kind == .equality and (a_nullptr or b_nullptr)) { | |
| 5483 | if (a_nullptr and b_nullptr) return a.shouldEval(b, p); | |
| 5484 | const nullptr_res = if (a_nullptr) a else b; | |
| 5485 | const other_res = if (a_nullptr) b else a; | |
| 5486 | if (other_res.ty.isPtr()) { | |
| 5487 | try nullptr_res.nullCast(p, other_res.ty); | |
| 6132 | if (kind == .equality and (a_sk == .nullptr_t or b_sk == .nullptr_t)) { | |
| 6133 | if (a_sk == .nullptr_t and b_sk == .nullptr_t) return a.shouldEval(b, p); | |
| 6134 | ||
| 6135 | const nullptr_res = if (a_sk == .nullptr_t) a else b; | |
| 6136 | const other_res = if (a_sk == .nullptr_t) b else a; | |
| 6137 | ||
| 6138 | if (other_res.qt.isPointer(p.comp)) { | |
| 6139 | try nullptr_res.nullToPointer(p, other_res.qt, tok); | |
| 5488 | 6140 | return other_res.shouldEval(nullptr_res, p); |
| 5489 | 6141 | } else if (other_res.val.isZero(p.comp)) { |
| 5490 | other_res.val = Value.null; | |
| 5491 | try other_res.nullCast(p, nullptr_res.ty); | |
| 6142 | other_res.val = .null; | |
| 6143 | try other_res.nullToPointer(p, nullptr_res.qt, tok); | |
| 5492 | 6144 | return other_res.shouldEval(nullptr_res, p); |
| 5493 | 6145 | } |
| 5494 | 6146 | return a.invalidBinTy(tok, b, p); |
| 5495 | 6147 | } |
| 6148 | ||
| 5496 | 6149 | // comparisons between floats and pointes not allowed |
| 5497 | if (!a_scalar or !b_scalar or (a_float and b_ptr) or (b_float and a_ptr)) | |
| 6150 | if (a_sk == .none or b_sk == .none or (a_sk.isFloat() and b_sk.isPointer()) or (b_sk.isFloat() and a_sk.isPointer())) | |
| 5498 | 6151 | return a.invalidBinTy(tok, b, p); |
| 5499 | ||
| 5500 | if ((a_int or b_int) and !(a.val.isZero(p.comp) or b.val.isZero(p.comp))) { | |
| 5501 | try p.errStr(.comparison_ptr_int, tok, try p.typePairStr(a.ty, b.ty)); | |
| 5502 | } else if (a_ptr and b_ptr) { | |
| 5503 | if (!a.ty.isVoidStar() and !b.ty.isVoidStar() and !a.ty.eql(b.ty, p.comp, false)) | |
| 5504 | try p.errStr(.comparison_distinct_ptr, tok, try p.typePairStr(a.ty, b.ty)); | |
| 5505 | } else if (a_ptr) { | |
| 5506 | try b.ptrCast(p, a.ty); | |
| 6152 | if (a_sk == .nullptr_t or b_sk == .nullptr_t) return a.invalidBinTy(tok, b, p); | |
| 6153 | ||
| 6154 | if ((a_sk.isInt() or b_sk.isInt()) and !(a.val.isZero(p.comp) or b.val.isZero(p.comp))) { | |
| 6155 | try p.err(tok, .comparison_ptr_int, .{ a.qt, b.qt }); | |
| 6156 | } else if (a_sk.isPointer() and b_sk.isPointer()) { | |
| 6157 | if (a_sk != .void_pointer and b_sk != .void_pointer) { | |
| 6158 | const a_elem = a.qt.childType(p.comp); | |
| 6159 | const b_elem = b.qt.childType(p.comp); | |
| 6160 | if (!a_elem.eql(b_elem, p.comp)) { | |
| 6161 | try p.err(tok, .comparison_distinct_ptr, .{ a.qt, b.qt }); | |
| 6162 | try b.castToPointer(p, a.qt, tok); | |
| 6163 | } | |
| 6164 | } else if (a_sk == .void_pointer) { | |
| 6165 | try b.castToPointer(p, a.qt, tok); | |
| 6166 | } else if (b_sk == .void_pointer) { | |
| 6167 | try a.castToPointer(p, b.qt, tok); | |
| 6168 | } | |
| 6169 | } else if (a_sk.isPointer()) { | |
| 6170 | try b.castToPointer(p, a.qt, tok); | |
| 5507 | 6171 | } else { |
| 5508 | assert(b_ptr); | |
| 5509 | try a.ptrCast(p, b.ty); | |
| 6172 | assert(b_sk.isPointer()); | |
| 6173 | try a.castToPointer(p, b.qt, tok); | |
| 5510 | 6174 | } |
| 5511 | 6175 | |
| 5512 | 6176 | return a.shouldEval(b, p); |
| 5513 | 6177 | }, |
| 5514 | 6178 | .conditional => { |
| 5515 | 6179 | // doesn't matter what we return here, as the result is ignored |
| 5516 | if (a.ty.is(.void) or b.ty.is(.void)) { | |
| 5517 | try a.toVoid(p); | |
| 5518 | try b.toVoid(p); | |
| 6180 | if (a.qt.is(p.comp, .void) or b.qt.is(p.comp, .void)) { | |
| 6181 | try a.castToVoid(p, tok); | |
| 6182 | try b.castToVoid(p, tok); | |
| 5519 | 6183 | return true; |
| 5520 | 6184 | } |
| 5521 | if (a_nullptr and b_nullptr) return true; | |
| 5522 | if ((a_ptr and b_int) or (a_int and b_ptr)) { | |
| 6185 | ||
| 6186 | if (a_sk == .nullptr_t and b_sk == .nullptr_t) return true; | |
| 6187 | ||
| 6188 | if ((a_sk.isPointer() and b_sk.isInt()) or (a_sk.isInt() and b_sk.isPointer())) { | |
| 5523 | 6189 | if (a.val.isZero(p.comp) or b.val.isZero(p.comp)) { |
| 5524 | try a.nullCast(p, b.ty); | |
| 5525 | try b.nullCast(p, a.ty); | |
| 6190 | try a.nullToPointer(p, b.qt, tok); | |
| 6191 | try b.nullToPointer(p, a.qt, tok); | |
| 5526 | 6192 | return true; |
| 5527 | 6193 | } |
| 5528 | const int_ty = if (a_int) a else b; | |
| 5529 | const ptr_ty = if (a_ptr) a else b; | |
| 5530 | try p.errStr(.implicit_int_to_ptr, tok, try p.typePairStrExtra(int_ty.ty, " to ", ptr_ty.ty)); | |
| 5531 | try int_ty.ptrCast(p, ptr_ty.ty); | |
| 6194 | const int_ty = if (a_sk.isInt()) a else b; | |
| 6195 | const ptr_ty = if (a_sk.isPointer()) a else b; | |
| 6196 | try p.err(tok, .implicit_int_to_ptr, .{ int_ty.qt, ptr_ty.qt }); | |
| 6197 | try int_ty.castToPointer(p, ptr_ty.qt, tok); | |
| 5532 | 6198 | |
| 5533 | 6199 | return true; |
| 5534 | 6200 | } |
| 5535 | if (a_ptr and b_ptr) return a.adjustCondExprPtrs(tok, b, p); | |
| 5536 | if ((a_ptr and b_nullptr) or (a_nullptr and b_ptr)) { | |
| 5537 | const nullptr_res = if (a_nullptr) a else b; | |
| 5538 | const ptr_res = if (a_nullptr) b else a; | |
| 5539 | try nullptr_res.nullCast(p, ptr_res.ty); | |
| 6201 | if ((a_sk.isPointer() and b_sk == .nullptr_t) or (a_sk == .nullptr_t and b_sk.isPointer())) { | |
| 6202 | const nullptr_res = if (a_sk == .nullptr_t) a else b; | |
| 6203 | const ptr_res = if (a_sk == .nullptr_t) b else a; | |
| 6204 | try nullptr_res.nullToPointer(p, ptr_res.qt, tok); | |
| 5540 | 6205 | return true; |
| 5541 | 6206 | } |
| 5542 | if (a.ty.isRecord() and b.ty.isRecord() and a.ty.eql(b.ty, p.comp, false)) { | |
| 6207 | if (a_sk.isPointer() and b_sk.isPointer()) return a.adjustCondExprPtrs(tok, b, p); | |
| 6208 | ||
| 6209 | if (a.qt.getRecord(p.comp) != null and b.qt.getRecord(p.comp) != null and a.qt.eql(b.qt, p.comp)) { | |
| 5543 | 6210 | return true; |
| 5544 | 6211 | } |
| 5545 | 6212 | return a.invalidBinTy(tok, b, p); |
| 5546 | 6213 | }, |
| 5547 | 6214 | .add => { |
| 5548 | 6215 | // if both aren't arithmetic one should be pointer and the other an integer |
| 5549 | if (a_ptr == b_ptr or a_int == b_int) return a.invalidBinTy(tok, b, p); | |
| 6216 | if (a_sk.isPointer() == b_sk.isPointer() or a_sk.isInt() == b_sk.isInt()) return a.invalidBinTy(tok, b, p); | |
| 6217 | ||
| 6218 | if (a_sk == .void_pointer or b_sk == .void_pointer) | |
| 6219 | try p.err(tok, .gnu_pointer_arith, .{}); | |
| 6220 | ||
| 6221 | if (a_sk == .nullptr_t) try a.nullToPointer(p, .void_pointer, tok); | |
| 6222 | if (b_sk == .nullptr_t) try b.nullToPointer(p, .void_pointer, tok); | |
| 5550 | 6223 | |
| 5551 | 6224 | // Do integer promotions but nothing else |
| 5552 | if (a_int) try a.intCast(p, a.ty.integerPromotion(p.comp), tok); | |
| 5553 | if (b_int) try b.intCast(p, b.ty.integerPromotion(p.comp), tok); | |
| 6225 | if (a_sk.isInt()) try a.castToInt(p, a.qt.promoteInt(p.comp), tok); | |
| 6226 | if (b_sk.isInt()) try b.castToInt(p, b.qt.promoteInt(p.comp), tok); | |
| 5554 | 6227 | |
| 5555 | 6228 | // The result type is the type of the pointer operand |
| 5556 | if (a_int) a.ty = b.ty else b.ty = a.ty; | |
| 6229 | if (a_sk.isInt()) a.qt = b.qt else b.qt = a.qt; | |
| 5557 | 6230 | return a.shouldEval(b, p); |
| 5558 | 6231 | }, |
| 5559 | 6232 | .sub => { |
| 5560 | // if both aren't arithmetic then either both should be pointers or just a | |
| 5561 | if (!a_ptr or !(b_ptr or b_int)) return a.invalidBinTy(tok, b, p); | |
| 6233 | // if both aren't arithmetic then either both should be pointers or just the left one. | |
| 6234 | if (!a_sk.isPointer() or !(b_sk.isPointer() or b_sk.isInt())) return a.invalidBinTy(tok, b, p); | |
| 6235 | ||
| 6236 | if (a_sk == .void_pointer) | |
| 6237 | try p.err(tok, .gnu_pointer_arith, .{}); | |
| 6238 | ||
| 6239 | if (a_sk == .nullptr_t) try a.nullToPointer(p, .void_pointer, tok); | |
| 6240 | if (b_sk == .nullptr_t) try b.nullToPointer(p, .void_pointer, tok); | |
| 5562 | 6241 | |
| 5563 | if (a_ptr and b_ptr) { | |
| 5564 | if (!a.ty.eql(b.ty, p.comp, false)) try p.errStr(.incompatible_pointers, tok, try p.typePairStr(a.ty, b.ty)); | |
| 5565 | a.ty = p.comp.types.ptrdiff; | |
| 6242 | if (a_sk.isPointer() and b_sk.isPointer()) { | |
| 6243 | const a_child_qt = a.qt.get(p.comp, .pointer).?.child; | |
| 6244 | const b_child_qt = b.qt.get(p.comp, .pointer).?.child; | |
| 6245 | ||
| 6246 | if (!a_child_qt.eql(b_child_qt, p.comp)) try p.err(tok, .incompatible_pointers, .{ a.qt, b.qt }); | |
| 6247 | 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)}); | |
| 6248 | a.qt = p.comp.type_store.ptrdiff; | |
| 5566 | 6249 | } |
| 5567 | 6250 | |
| 5568 | 6251 | // Do integer promotion on b if needed |
| 5569 | if (b_int) try b.intCast(p, b.ty.integerPromotion(p.comp), tok); | |
| 6252 | if (b_sk.isInt()) try b.castToInt(p, b.qt.promoteInt(p.comp), tok); | |
| 5570 | 6253 | return a.shouldEval(b, p); |
| 5571 | 6254 | }, |
| 5572 | 6255 | else => return a.invalidBinTy(tok, b, p), |
| 5573 | 6256 | } |
| 5574 | 6257 | } |
| 5575 | 6258 | |
| 5576 | fn lvalConversion(res: *Result, p: *Parser) Error!void { | |
| 5577 | if (res.ty.isFunc()) { | |
| 5578 | if (res.ty.isInvalidFunc()) { | |
| 5579 | res.ty = .{ .specifier = .invalid }; | |
| 5580 | } else { | |
| 5581 | const elem_ty = try p.arena.create(Type); | |
| 5582 | elem_ty.* = res.ty; | |
| 5583 | res.ty.specifier = .pointer; | |
| 5584 | res.ty.data = .{ .sub_type = elem_ty }; | |
| 5585 | } | |
| 5586 | try res.implicitCast(p, .function_to_pointer); | |
| 5587 | } else if (res.ty.isArray()) { | |
| 5588 | res.val = .{}; | |
| 5589 | res.ty.decayArray(); | |
| 5590 | try res.implicitCast(p, .array_to_pointer); | |
| 5591 | } else if (!p.in_macro and p.tmpTree().isLval(res.node)) { | |
| 5592 | res.ty.qual = .{}; | |
| 5593 | try res.implicitCast(p, .lval_to_rval); | |
| 6259 | fn lvalConversion(res: *Result, p: *Parser, tok: TokenIndex) Error!void { | |
| 6260 | if (res.qt.is(p.comp, .func)) { | |
| 6261 | res.val = try p.pointerValue(res.node, .zero); | |
| 6262 | ||
| 6263 | res.qt = try res.qt.decay(p.comp); | |
| 6264 | try res.implicitCast(p, .function_to_pointer, tok); | |
| 6265 | } else if (res.qt.is(p.comp, .array)) { | |
| 6266 | res.val = try p.pointerValue(res.node, .zero); | |
| 6267 | ||
| 6268 | res.qt = try res.qt.decay(p.comp); | |
| 6269 | try res.implicitCast(p, .array_to_pointer, tok); | |
| 6270 | } else if (!p.in_macro and p.tree.isLval(res.node)) { | |
| 6271 | res.qt = res.qt.unqualified(); | |
| 6272 | try res.implicitCast(p, .lval_to_rval, tok); | |
| 5594 | 6273 | } |
| 5595 | 6274 | } |
| 5596 | 6275 | |
| 5597 | fn boolCast(res: *Result, p: *Parser, bool_ty: Type, tok: TokenIndex) Error!void { | |
| 5598 | if (res.ty.isArray()) { | |
| 6276 | fn castToBool(res: *Result, p: *Parser, bool_qt: QualType, tok: TokenIndex) Error!void { | |
| 6277 | if (res.qt.isInvalid()) return; | |
| 6278 | std.debug.assert(!bool_qt.isInvalid()); | |
| 6279 | ||
| 6280 | const src_sk = res.qt.scalarKind(p.comp); | |
| 6281 | if (res.qt.is(p.comp, .array)) { | |
| 5599 | 6282 | if (res.val.is(.bytes, p.comp)) { |
| 5600 | try p.errStr(.string_literal_to_bool, tok, try p.typePairStrExtra(res.ty, " to ", bool_ty)); | |
| 6283 | try p.err(tok, .string_literal_to_bool, .{ res.qt, bool_qt }); | |
| 5601 | 6284 | } else { |
| 5602 | try p.errStr(.array_address_to_bool, tok, p.tokSlice(tok)); | |
| 6285 | try p.err(tok, .array_address_to_bool, .{p.tokSlice(tok)}); | |
| 5603 | 6286 | } |
| 5604 | try res.lvalConversion(p); | |
| 5605 | res.val = Value.one; | |
| 5606 | res.ty = bool_ty; | |
| 5607 | try res.implicitCast(p, .pointer_to_bool); | |
| 5608 | } else if (res.ty.isPtr()) { | |
| 6287 | try res.lvalConversion(p, tok); | |
| 6288 | res.val = .one; | |
| 6289 | res.qt = bool_qt; | |
| 6290 | try res.implicitCast(p, .pointer_to_bool, tok); | |
| 6291 | } else if (src_sk.isPointer()) { | |
| 5609 | 6292 | res.val.boolCast(p.comp); |
| 5610 | res.ty = bool_ty; | |
| 5611 | try res.implicitCast(p, .pointer_to_bool); | |
| 5612 | } else if (res.ty.isInt() and !res.ty.is(.bool)) { | |
| 6293 | res.qt = bool_qt; | |
| 6294 | try res.implicitCast(p, .pointer_to_bool, tok); | |
| 6295 | } else if (src_sk.isInt() and src_sk != .bool) { | |
| 5613 | 6296 | res.val.boolCast(p.comp); |
| 5614 | res.ty = bool_ty; | |
| 5615 | try res.implicitCast(p, .int_to_bool); | |
| 5616 | } else if (res.ty.isFloat()) { | |
| 5617 | const old_value = res.val; | |
| 5618 | const value_change_kind = try res.val.floatToInt(bool_ty, p.comp); | |
| 5619 | try res.floatToIntWarning(p, bool_ty, old_value, value_change_kind, tok); | |
| 5620 | if (!res.ty.isReal()) { | |
| 5621 | res.ty = res.ty.makeReal(); | |
| 5622 | try res.implicitCast(p, .complex_float_to_real); | |
| 5623 | } | |
| 5624 | res.ty = bool_ty; | |
| 5625 | try res.implicitCast(p, .float_to_bool); | |
| 5626 | } | |
| 5627 | } | |
| 5628 | ||
| 5629 | fn intCast(res: *Result, p: *Parser, int_ty: Type, tok: TokenIndex) Error!void { | |
| 5630 | if (int_ty.hasIncompleteSize()) return error.ParsingFailed; // Diagnostic already issued | |
| 5631 | if (res.ty.is(.bool)) { | |
| 5632 | res.ty = int_ty.makeReal(); | |
| 5633 | try res.implicitCast(p, .bool_to_int); | |
| 5634 | if (!int_ty.isReal()) { | |
| 5635 | res.ty = int_ty; | |
| 5636 | try res.implicitCast(p, .real_to_complex_int); | |
| 5637 | } | |
| 5638 | } else if (res.ty.isPtr()) { | |
| 5639 | res.ty = int_ty.makeReal(); | |
| 5640 | try res.implicitCast(p, .pointer_to_int); | |
| 5641 | if (!int_ty.isReal()) { | |
| 5642 | res.ty = int_ty; | |
| 5643 | try res.implicitCast(p, .real_to_complex_int); | |
| 5644 | } | |
| 5645 | } else if (res.ty.isFloat()) { | |
| 5646 | const old_value = res.val; | |
| 5647 | const value_change_kind = try res.val.floatToInt(int_ty, p.comp); | |
| 5648 | try res.floatToIntWarning(p, int_ty, old_value, value_change_kind, tok); | |
| 5649 | const old_real = res.ty.isReal(); | |
| 5650 | const new_real = int_ty.isReal(); | |
| 5651 | if (old_real and new_real) { | |
| 5652 | res.ty = int_ty; | |
| 5653 | try res.implicitCast(p, .float_to_int); | |
| 5654 | } else if (old_real) { | |
| 5655 | res.ty = int_ty.makeReal(); | |
| 5656 | try res.implicitCast(p, .float_to_int); | |
| 5657 | res.ty = int_ty; | |
| 5658 | try res.implicitCast(p, .real_to_complex_int); | |
| 5659 | } else if (new_real) { | |
| 5660 | res.ty = res.ty.makeReal(); | |
| 5661 | try res.implicitCast(p, .complex_float_to_real); | |
| 5662 | res.ty = int_ty; | |
| 5663 | try res.implicitCast(p, .float_to_int); | |
| 6297 | if (!src_sk.isReal()) { | |
| 6298 | res.qt = res.qt.toReal(p.comp); | |
| 6299 | try res.implicitCast(p, .complex_int_to_real, tok); | |
| 6300 | } | |
| 6301 | res.qt = bool_qt; | |
| 6302 | try res.implicitCast(p, .int_to_bool, tok); | |
| 6303 | } else if (src_sk.isFloat()) { | |
| 6304 | const old_val = res.val; | |
| 6305 | const value_change_kind = try res.val.floatToInt(bool_qt, p.comp); | |
| 6306 | try res.floatToIntWarning(p, bool_qt, old_val, value_change_kind, tok); | |
| 6307 | if (!src_sk.isReal()) { | |
| 6308 | res.qt = res.qt.toReal(p.comp); | |
| 6309 | try res.implicitCast(p, .complex_float_to_real, tok); | |
| 6310 | } | |
| 6311 | res.qt = bool_qt; | |
| 6312 | try res.implicitCast(p, .float_to_bool, tok); | |
| 6313 | } | |
| 6314 | } | |
| 6315 | ||
| 6316 | fn castToInt(res: *Result, p: *Parser, int_qt: QualType, tok: TokenIndex) Error!void { | |
| 6317 | if (res.qt.isInvalid()) return; | |
| 6318 | std.debug.assert(!int_qt.isInvalid()); | |
| 6319 | if (int_qt.hasIncompleteSize(p.comp)) { | |
| 6320 | return error.ParsingFailed; // Cast to incomplete enum, diagnostic already issued | |
| 6321 | } | |
| 6322 | ||
| 6323 | const src_sk = res.qt.scalarKind(p.comp); | |
| 6324 | const dest_sk = int_qt.scalarKind(p.comp); | |
| 6325 | ||
| 6326 | if (src_sk == .bool) { | |
| 6327 | res.qt = int_qt.toReal(p.comp); | |
| 6328 | try res.implicitCast(p, .bool_to_int, tok); | |
| 6329 | if (!dest_sk.isReal()) { | |
| 6330 | res.qt = int_qt; | |
| 6331 | try res.implicitCast(p, .real_to_complex_int, tok); | |
| 6332 | } | |
| 6333 | } else if (src_sk.isPointer()) { | |
| 6334 | res.val = .{}; | |
| 6335 | res.qt = int_qt.toReal(p.comp); | |
| 6336 | try res.implicitCast(p, .pointer_to_int, tok); | |
| 6337 | if (!dest_sk.isReal()) { | |
| 6338 | res.qt = int_qt; | |
| 6339 | try res.implicitCast(p, .real_to_complex_int, tok); | |
| 6340 | } | |
| 6341 | } else if (res.qt.isFloat(p.comp)) { | |
| 6342 | const old_val = res.val; | |
| 6343 | const value_change_kind = try res.val.floatToInt(int_qt, p.comp); | |
| 6344 | try res.floatToIntWarning(p, int_qt, old_val, value_change_kind, tok); | |
| 6345 | if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6346 | res.qt = int_qt; | |
| 6347 | try res.implicitCast(p, .float_to_int, tok); | |
| 6348 | } else if (src_sk.isReal()) { | |
| 6349 | res.qt = int_qt.toReal(p.comp); | |
| 6350 | try res.implicitCast(p, .float_to_int, tok); | |
| 6351 | res.qt = int_qt; | |
| 6352 | try res.implicitCast(p, .real_to_complex_int, tok); | |
| 6353 | } else if (dest_sk.isReal()) { | |
| 6354 | res.qt = res.qt.toReal(p.comp); | |
| 6355 | try res.implicitCast(p, .complex_float_to_real, tok); | |
| 6356 | res.qt = int_qt; | |
| 6357 | try res.implicitCast(p, .float_to_int, tok); | |
| 5664 | 6358 | } else { |
| 5665 | res.ty = int_ty; | |
| 5666 | try res.implicitCast(p, .complex_float_to_complex_int); | |
| 6359 | res.qt = int_qt; | |
| 6360 | try res.implicitCast(p, .complex_float_to_complex_int, tok); | |
| 5667 | 6361 | } |
| 5668 | } else if (!res.ty.eql(int_ty, p.comp, true)) { | |
| 6362 | } else if (!res.qt.eql(int_qt, p.comp)) { | |
| 5669 | 6363 | const old_val = res.val; |
| 5670 | const value_change_kind = try res.val.intCast(int_ty, p.comp); | |
| 6364 | const value_change_kind = try res.val.intCast(int_qt, p.comp); | |
| 5671 | 6365 | switch (value_change_kind) { |
| 5672 | 6366 | .none => {}, |
| 5673 | .truncated => try p.errStr(.int_value_changed, tok, try p.valueChangedStr(res, old_val, int_ty)), | |
| 5674 | .sign_changed => try p.errStr(.sign_conversion, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), | |
| 5675 | } | |
| 5676 | ||
| 5677 | const old_real = res.ty.isReal(); | |
| 5678 | const new_real = int_ty.isReal(); | |
| 5679 | if (old_real and new_real) { | |
| 5680 | res.ty = int_ty; | |
| 5681 | try res.implicitCast(p, .int_cast); | |
| 5682 | } else if (old_real) { | |
| 5683 | const real_int_ty = int_ty.makeReal(); | |
| 5684 | if (!res.ty.eql(real_int_ty, p.comp, false)) { | |
| 5685 | res.ty = real_int_ty; | |
| 5686 | try res.implicitCast(p, .int_cast); | |
| 6367 | .truncated => try p.errValueChanged(tok, .int_value_changed, res.*, old_val, int_qt), | |
| 6368 | .sign_changed => try p.err(tok, .sign_conversion, .{ res.qt, int_qt }), | |
| 6369 | } | |
| 6370 | ||
| 6371 | if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6372 | res.qt = int_qt; | |
| 6373 | try res.implicitCast(p, .int_cast, tok); | |
| 6374 | } else if (src_sk.isReal()) { | |
| 6375 | const real_int_qt = int_qt.toReal(p.comp); | |
| 6376 | if (!res.qt.eql(real_int_qt, p.comp)) { | |
| 6377 | res.qt = real_int_qt; | |
| 6378 | try res.implicitCast(p, .int_cast, tok); | |
| 5687 | 6379 | } |
| 5688 | res.ty = int_ty; | |
| 5689 | try res.implicitCast(p, .real_to_complex_int); | |
| 5690 | } else if (new_real) { | |
| 5691 | res.ty = res.ty.makeReal(); | |
| 5692 | try res.implicitCast(p, .complex_int_to_real); | |
| 5693 | res.ty = int_ty; | |
| 5694 | try res.implicitCast(p, .int_cast); | |
| 6380 | res.qt = int_qt; | |
| 6381 | try res.implicitCast(p, .real_to_complex_int, tok); | |
| 6382 | } else if (dest_sk.isReal()) { | |
| 6383 | res.qt = res.qt.toReal(p.comp); | |
| 6384 | try res.implicitCast(p, .complex_int_to_real, tok); | |
| 6385 | res.qt = int_qt; | |
| 6386 | try res.implicitCast(p, .int_cast, tok); | |
| 5695 | 6387 | } else { |
| 5696 | res.ty = int_ty; | |
| 5697 | try res.implicitCast(p, .complex_int_cast); | |
| 6388 | res.qt = int_qt; | |
| 6389 | try res.implicitCast(p, .complex_int_cast, tok); | |
| 5698 | 6390 | } |
| 5699 | 6391 | } |
| 5700 | 6392 | } |
| 5701 | 6393 | |
| 5702 | fn floatToIntWarning(res: *Result, p: *Parser, int_ty: Type, old_value: Value, change_kind: Value.FloatToIntChangeKind, tok: TokenIndex) Error!void { | |
| 6394 | fn floatToIntWarning( | |
| 6395 | res: Result, | |
| 6396 | p: *Parser, | |
| 6397 | int_qt: QualType, | |
| 6398 | old_val: Value, | |
| 6399 | change_kind: Value.FloatToIntChangeKind, | |
| 6400 | tok: TokenIndex, | |
| 6401 | ) !void { | |
| 5703 | 6402 | switch (change_kind) { |
| 5704 | .none => return p.errStr(.float_to_int, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), | |
| 5705 | .out_of_range => return p.errStr(.float_out_of_range, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), | |
| 5706 | .overflow => return p.errStr(.float_overflow_conversion, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), | |
| 5707 | .nonzero_to_zero => return p.errStr(.float_zero_conversion, tok, try p.valueChangedStr(res, old_value, int_ty)), | |
| 5708 | .value_changed => return p.errStr(.float_value_changed, tok, try p.valueChangedStr(res, old_value, int_ty)), | |
| 5709 | } | |
| 5710 | } | |
| 5711 | ||
| 5712 | fn floatCast(res: *Result, p: *Parser, float_ty: Type) Error!void { | |
| 5713 | if (res.ty.is(.bool)) { | |
| 5714 | try res.val.intToFloat(float_ty, p.comp); | |
| 5715 | res.ty = float_ty.makeReal(); | |
| 5716 | try res.implicitCast(p, .bool_to_float); | |
| 5717 | if (!float_ty.isReal()) { | |
| 5718 | res.ty = float_ty; | |
| 5719 | try res.implicitCast(p, .real_to_complex_float); | |
| 5720 | } | |
| 5721 | } else if (res.ty.isInt()) { | |
| 5722 | try res.val.intToFloat(float_ty, p.comp); | |
| 5723 | const old_real = res.ty.isReal(); | |
| 5724 | const new_real = float_ty.isReal(); | |
| 5725 | if (old_real and new_real) { | |
| 5726 | res.ty = float_ty; | |
| 5727 | try res.implicitCast(p, .int_to_float); | |
| 5728 | } else if (old_real) { | |
| 5729 | res.ty = float_ty.makeReal(); | |
| 5730 | try res.implicitCast(p, .int_to_float); | |
| 5731 | res.ty = float_ty; | |
| 5732 | try res.implicitCast(p, .real_to_complex_float); | |
| 5733 | } else if (new_real) { | |
| 5734 | res.ty = res.ty.makeReal(); | |
| 5735 | try res.implicitCast(p, .complex_int_to_real); | |
| 5736 | res.ty = float_ty; | |
| 5737 | try res.implicitCast(p, .int_to_float); | |
| 6403 | .none => return p.err(tok, .float_to_int, .{ res.qt, int_qt }), | |
| 6404 | .out_of_range => return p.err(tok, .float_out_of_range, .{ res.qt, int_qt }), | |
| 6405 | .overflow => return p.err(tok, .float_overflow_conversion, .{ res.qt, int_qt }), | |
| 6406 | .nonzero_to_zero => return p.errValueChanged(tok, .float_zero_conversion, res, old_val, int_qt), | |
| 6407 | .value_changed => return p.errValueChanged(tok, .float_value_changed, res, old_val, int_qt), | |
| 6408 | } | |
| 6409 | } | |
| 6410 | ||
| 6411 | fn castToFloat(res: *Result, p: *Parser, float_qt: QualType, tok: TokenIndex) Error!void { | |
| 6412 | const src_sk = res.qt.scalarKind(p.comp); | |
| 6413 | const dest_sk = float_qt.scalarKind(p.comp); | |
| 6414 | ||
| 6415 | if (src_sk == .bool) { | |
| 6416 | try res.val.intToFloat(float_qt, p.comp); | |
| 6417 | res.qt = float_qt.toReal(p.comp); | |
| 6418 | try res.implicitCast(p, .bool_to_float, tok); | |
| 6419 | if (!dest_sk.isReal()) { | |
| 6420 | res.qt = float_qt; | |
| 6421 | try res.implicitCast(p, .real_to_complex_float, tok); | |
| 6422 | } | |
| 6423 | } else if (src_sk.isInt()) { | |
| 6424 | try res.val.intToFloat(float_qt, p.comp); | |
| 6425 | if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6426 | res.qt = float_qt; | |
| 6427 | try res.implicitCast(p, .int_to_float, tok); | |
| 6428 | } else if (src_sk.isReal()) { | |
| 6429 | res.qt = float_qt.toReal(p.comp); | |
| 6430 | try res.implicitCast(p, .int_to_float, tok); | |
| 6431 | res.qt = float_qt; | |
| 6432 | try res.implicitCast(p, .real_to_complex_float, tok); | |
| 6433 | } else if (dest_sk.isReal()) { | |
| 6434 | res.qt = res.qt.toReal(p.comp); | |
| 6435 | try res.implicitCast(p, .complex_int_to_real, tok); | |
| 6436 | res.qt = float_qt; | |
| 6437 | try res.implicitCast(p, .int_to_float, tok); | |
| 5738 | 6438 | } else { |
| 5739 | res.ty = float_ty; | |
| 5740 | try res.implicitCast(p, .complex_int_to_complex_float); | |
| 5741 | } | |
| 5742 | } else if (!res.ty.eql(float_ty, p.comp, true)) { | |
| 5743 | try res.val.floatCast(float_ty, p.comp); | |
| 5744 | const old_real = res.ty.isReal(); | |
| 5745 | const new_real = float_ty.isReal(); | |
| 5746 | if (old_real and new_real) { | |
| 5747 | res.ty = float_ty; | |
| 5748 | try res.implicitCast(p, .float_cast); | |
| 5749 | } else if (old_real) { | |
| 5750 | if (res.ty.floatRank() != float_ty.floatRank()) { | |
| 5751 | res.ty = float_ty.makeReal(); | |
| 5752 | try res.implicitCast(p, .float_cast); | |
| 6439 | res.qt = float_qt; | |
| 6440 | try res.implicitCast(p, .complex_int_to_complex_float, tok); | |
| 6441 | } | |
| 6442 | } else if (!res.qt.eql(float_qt, p.comp)) { | |
| 6443 | try res.val.floatCast(float_qt, p.comp); | |
| 6444 | if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6445 | res.qt = float_qt; | |
| 6446 | try res.implicitCast(p, .float_cast, tok); | |
| 6447 | } else if (src_sk.isReal()) { | |
| 6448 | if (res.qt.floatRank(p.comp) != float_qt.floatRank(p.comp)) { | |
| 6449 | res.qt = float_qt.toReal(p.comp); | |
| 6450 | try res.implicitCast(p, .float_cast, tok); | |
| 5753 | 6451 | } |
| 5754 | res.ty = float_ty; | |
| 5755 | try res.implicitCast(p, .real_to_complex_float); | |
| 5756 | } else if (new_real) { | |
| 5757 | res.ty = res.ty.makeReal(); | |
| 5758 | try res.implicitCast(p, .complex_float_to_real); | |
| 5759 | if (res.ty.floatRank() != float_ty.floatRank()) { | |
| 5760 | res.ty = float_ty; | |
| 5761 | try res.implicitCast(p, .float_cast); | |
| 6452 | res.qt = float_qt; | |
| 6453 | try res.implicitCast(p, .real_to_complex_float, tok); | |
| 6454 | } else if (dest_sk.isReal()) { | |
| 6455 | res.qt = res.qt.toReal(p.comp); | |
| 6456 | try res.implicitCast(p, .complex_float_to_real, tok); | |
| 6457 | if (res.qt.floatRank(p.comp) != float_qt.floatRank(p.comp)) { | |
| 6458 | res.qt = float_qt; | |
| 6459 | try res.implicitCast(p, .float_cast, tok); | |
| 5762 | 6460 | } |
| 5763 | 6461 | } else { |
| 5764 | res.ty = float_ty; | |
| 5765 | try res.implicitCast(p, .complex_float_cast); | |
| 6462 | res.qt = float_qt; | |
| 6463 | try res.implicitCast(p, .complex_float_cast, tok); | |
| 5766 | 6464 | } |
| 5767 | 6465 | } |
| 5768 | 6466 | } |
| 5769 | 6467 | |
| 5770 | 6468 | /// Converts a bool or integer to a pointer |
| 5771 | fn ptrCast(res: *Result, p: *Parser, ptr_ty: Type) Error!void { | |
| 5772 | if (res.ty.is(.bool)) { | |
| 5773 | res.ty = ptr_ty; | |
| 5774 | try res.implicitCast(p, .bool_to_pointer); | |
| 5775 | } else if (res.ty.isInt()) { | |
| 5776 | _ = try res.val.intCast(ptr_ty, p.comp); | |
| 5777 | res.ty = ptr_ty; | |
| 5778 | try res.implicitCast(p, .int_to_pointer); | |
| 5779 | } | |
| 5780 | } | |
| 6469 | fn castToPointer(res: *Result, p: *Parser, ptr_qt: QualType, tok: TokenIndex) Error!void { | |
| 6470 | const src_sk = res.qt.scalarKind(p.comp); | |
| 6471 | if (src_sk == .bool) { | |
| 6472 | res.qt = ptr_qt; | |
| 6473 | try res.implicitCast(p, .bool_to_pointer, tok); | |
| 6474 | } else if (src_sk.isInt()) { | |
| 6475 | _ = try res.val.intCast(ptr_qt, p.comp); | |
| 6476 | res.qt = ptr_qt; | |
| 6477 | try res.implicitCast(p, .int_to_pointer, tok); | |
| 6478 | } else if (src_sk == .nullptr_t) { | |
| 6479 | try res.nullToPointer(p, ptr_qt, tok); | |
| 6480 | } else if (src_sk.isPointer() and !res.qt.eql(ptr_qt, p.comp)) { | |
| 6481 | if (ptr_qt.is(p.comp, .nullptr_t)) { | |
| 6482 | res.qt = .invalid; | |
| 6483 | return; | |
| 6484 | } | |
| 5781 | 6485 | |
| 5782 | /// Convert pointer to one with a different child type | |
| 5783 | fn ptrChildTypeCast(res: *Result, p: *Parser, ptr_ty: Type) Error!void { | |
| 5784 | res.ty = ptr_ty; | |
| 5785 | return res.implicitCast(p, .bitcast); | |
| 6486 | const src_elem = res.qt.childType(p.comp); | |
| 6487 | const dest_elem = ptr_qt.childType(p.comp); | |
| 6488 | res.qt = ptr_qt; | |
| 6489 | ||
| 6490 | if (dest_elem.eql(src_elem, p.comp) and | |
| 6491 | (dest_elem.@"const" == src_elem.@"const" or dest_elem.@"const") and | |
| 6492 | (dest_elem.@"volatile" == src_elem.@"volatile" or dest_elem.@"volatile")) | |
| 6493 | { | |
| 6494 | // Gaining qualifiers is a no-op. | |
| 6495 | try res.implicitCast(p, .no_op, tok); | |
| 6496 | } else { | |
| 6497 | try res.implicitCast(p, .bitcast, tok); | |
| 6498 | } | |
| 6499 | } | |
| 5786 | 6500 | } |
| 5787 | 6501 | |
| 5788 | fn toVoid(res: *Result, p: *Parser) Error!void { | |
| 5789 | if (!res.ty.is(.void)) { | |
| 5790 | res.ty = .{ .specifier = .void }; | |
| 5791 | try res.implicitCast(p, .to_void); | |
| 6502 | fn castToVoid(res: *Result, p: *Parser, tok: TokenIndex) Error!void { | |
| 6503 | if (!res.qt.is(p.comp, .void)) { | |
| 6504 | res.qt = .void; | |
| 6505 | try res.implicitCast(p, .to_void, tok); | |
| 5792 | 6506 | } |
| 5793 | 6507 | } |
| 5794 | 6508 | |
| 5795 | fn nullCast(res: *Result, p: *Parser, ptr_ty: Type) Error!void { | |
| 5796 | if (!res.ty.is(.nullptr_t) and !res.val.isZero(p.comp)) return; | |
| 5797 | res.ty = ptr_ty; | |
| 5798 | try res.implicitCast(p, .null_to_pointer); | |
| 6509 | fn nullToPointer(res: *Result, p: *Parser, ptr_ty: QualType, tok: TokenIndex) Error!void { | |
| 6510 | if (!res.qt.is(p.comp, .nullptr_t) and !res.val.isZero(p.comp)) return; | |
| 6511 | res.val = .null; | |
| 6512 | res.qt = ptr_ty; | |
| 6513 | try res.implicitCast(p, .null_to_pointer, tok); | |
| 5799 | 6514 | } |
| 5800 | 6515 | |
| 5801 | 6516 | fn usualUnaryConversion(res: *Result, p: *Parser, tok: TokenIndex) Error!void { |
| 5802 | if (res.ty.isFloat()) fp_eval: { | |
| 6517 | if (res.qt.isInvalid()) return; | |
| 6518 | if (res.qt.isFloat(p.comp)) fp_eval: { | |
| 5803 | 6519 | const eval_method = p.comp.langopts.fp_eval_method orelse break :fp_eval; |
| 5804 | 6520 | switch (eval_method) { |
| 5805 | 6521 | .source => {}, |
| 5806 | 6522 | .indeterminate => unreachable, |
| 5807 | 6523 | .double => { |
| 5808 | if (res.ty.floatRank() < (Type{ .specifier = .double }).floatRank()) { | |
| 5809 | const spec: Type.Specifier = if (res.ty.isReal()) .double else .complex_double; | |
| 5810 | return res.floatCast(p, .{ .specifier = spec }); | |
| 6524 | if (res.qt.floatRank(p.comp) < QualType.double.floatRank(p.comp)) { | |
| 6525 | var res_qt: QualType = .double; | |
| 6526 | if (res.qt.is(p.comp, .complex)) res_qt = try res_qt.toComplex(p.comp); | |
| 6527 | return res.castToFloat(p, res_qt, tok); | |
| 5811 | 6528 | } |
| 5812 | 6529 | }, |
| 5813 | 6530 | .extended => { |
| 5814 | if (res.ty.floatRank() < (Type{ .specifier = .long_double }).floatRank()) { | |
| 5815 | const spec: Type.Specifier = if (res.ty.isReal()) .long_double else .complex_long_double; | |
| 5816 | return res.floatCast(p, .{ .specifier = spec }); | |
| 6531 | if (res.qt.floatRank(p.comp) < QualType.long_double.floatRank(p.comp)) { | |
| 6532 | var res_qt: QualType = .long_double; | |
| 6533 | if (res.qt.is(p.comp, .complex)) res_qt = try res_qt.toComplex(p.comp); | |
| 6534 | return res.castToFloat(p, res_qt, tok); | |
| 5817 | 6535 | } |
| 5818 | 6536 | }, |
| 5819 | 6537 | } |
| 5820 | 6538 | } |
| 5821 | 6539 | |
| 5822 | if (res.ty.is(.fp16) and !p.comp.langopts.use_native_half_type) { | |
| 5823 | return res.floatCast(p, .{ .specifier = .float }); | |
| 6540 | if (!p.comp.langopts.use_native_half_type) { | |
| 6541 | if (res.qt.get(p.comp, .float)) |float_ty| { | |
| 6542 | if (float_ty == .fp16) { | |
| 6543 | return res.castToFloat(p, .float, tok); | |
| 6544 | } | |
| 6545 | } | |
| 5824 | 6546 | } |
| 5825 | if (res.ty.isInt()) { | |
| 5826 | if (p.tmpTree().bitfieldWidth(res.node, true)) |width| { | |
| 5827 | if (res.ty.bitfieldPromotion(p.comp, width)) |promotion_ty| { | |
| 5828 | return res.intCast(p, promotion_ty, tok); | |
| 6547 | ||
| 6548 | if (res.qt.isInt(p.comp) and !p.in_macro) { | |
| 6549 | if (p.tree.bitfieldWidth(res.node, true)) |width| { | |
| 6550 | if (res.qt.promoteBitfield(p.comp, width)) |promotion_ty| { | |
| 6551 | return res.castToInt(p, promotion_ty, tok); | |
| 5829 | 6552 | } |
| 5830 | 6553 | } |
| 5831 | return res.intCast(p, res.ty.integerPromotion(p.comp), tok); | |
| 6554 | return res.castToInt(p, res.qt.promoteInt(p.comp), tok); | |
| 5832 | 6555 | } |
| 5833 | 6556 | } |
| 5834 | 6557 | |
| ... | ... | @@ -5837,70 +6560,88 @@ pub const Result = struct { |
| 5837 | 6560 | try b.usualUnaryConversion(p, tok); |
| 5838 | 6561 | |
| 5839 | 6562 | // if either is a float cast to that type |
| 5840 | if (a.ty.isFloat() or b.ty.isFloat()) { | |
| 5841 | const float_types = [6][2]Type.Specifier{ | |
| 5842 | .{ .complex_long_double, .long_double }, | |
| 5843 | .{ .complex_float128, .float128 }, | |
| 5844 | .{ .complex_double, .double }, | |
| 5845 | .{ .complex_float, .float }, | |
| 5846 | // No `_Complex __fp16` type | |
| 5847 | .{ .invalid, .fp16 }, | |
| 5848 | .{ .complex_float16, .float16 }, | |
| 5849 | }; | |
| 5850 | const a_spec = a.ty.canonicalize(.standard).specifier; | |
| 5851 | const b_spec = b.ty.canonicalize(.standard).specifier; | |
| 5852 | if (p.comp.target.cTypeBitSize(.longdouble) == 128) { | |
| 5853 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; | |
| 5854 | } | |
| 5855 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[1])) return; | |
| 5856 | if (p.comp.target.cTypeBitSize(.longdouble) == 80) { | |
| 5857 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; | |
| 5858 | } | |
| 5859 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[2])) return; | |
| 5860 | if (p.comp.target.cTypeBitSize(.longdouble) == 64) { | |
| 5861 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; | |
| 5862 | } | |
| 5863 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[3])) return; | |
| 5864 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[4])) return; | |
| 5865 | if (try a.floatConversion(b, a_spec, b_spec, p, float_types[5])) return; | |
| 5866 | unreachable; | |
| 6563 | const a_float = a.qt.isFloat(p.comp); | |
| 6564 | const b_float = b.qt.isFloat(p.comp); | |
| 6565 | if (a_float and b_float) { | |
| 6566 | const a_complex = a.qt.is(p.comp, .complex); | |
| 6567 | const b_complex = b.qt.is(p.comp, .complex); | |
| 6568 | ||
| 6569 | const res_qt = if (a.qt.floatRank(p.comp) > b.qt.floatRank(p.comp)) | |
| 6570 | (if (!a_complex and b_complex) | |
| 6571 | try a.qt.toComplex(p.comp) | |
| 6572 | else | |
| 6573 | a.qt) | |
| 6574 | else | |
| 6575 | (if (!b_complex and a_complex) | |
| 6576 | try b.qt.toComplex(p.comp) | |
| 6577 | else | |
| 6578 | b.qt); | |
| 6579 | ||
| 6580 | try a.castToFloat(p, res_qt, tok); | |
| 6581 | try b.castToFloat(p, res_qt, tok); | |
| 6582 | return; | |
| 6583 | } else if (a_float) { | |
| 6584 | try b.castToFloat(p, a.qt, tok); | |
| 6585 | return; | |
| 6586 | } else if (b_float) { | |
| 6587 | try a.castToFloat(p, b.qt, tok); | |
| 6588 | return; | |
| 6589 | } | |
| 6590 | ||
| 6591 | if (a.qt.eql(b.qt, p.comp)) { | |
| 6592 | // cast to promoted type | |
| 6593 | try a.castToInt(p, a.qt, tok); | |
| 6594 | try b.castToInt(p, b.qt, tok); | |
| 6595 | return; | |
| 6596 | } | |
| 6597 | ||
| 6598 | const a_real = a.qt.toReal(p.comp); | |
| 6599 | const b_real = b.qt.toReal(p.comp); | |
| 6600 | ||
| 6601 | const type_order = a.qt.intRankOrder(b.qt, p.comp); | |
| 6602 | const a_signed = a.qt.signedness(p.comp) == .signed; | |
| 6603 | const b_signed = b.qt.signedness(p.comp) == .signed; | |
| 6604 | ||
| 6605 | var target_qt: QualType = .invalid; | |
| 6606 | if (a_signed == b_signed) { | |
| 6607 | // If both have the same sign, use higher-rank type. | |
| 6608 | target_qt = switch (type_order) { | |
| 6609 | .lt => b.qt, | |
| 6610 | .eq, .gt => a_real, | |
| 6611 | }; | |
| 6612 | } else if (type_order != if (a_signed) std.math.Order.gt else std.math.Order.lt) { | |
| 6613 | // Only one is signed; and the unsigned type has rank >= the signed type | |
| 6614 | // Use the unsigned type | |
| 6615 | target_qt = if (b_signed) a_real else b_real; | |
| 6616 | } else if (a_real.bitSizeof(p.comp) != b_real.bitSizeof(p.comp)) { | |
| 6617 | // Signed type is higher rank and sizes are not equal | |
| 6618 | // Use the signed type | |
| 6619 | target_qt = if (a_signed) a_real else b_real; | |
| 6620 | } else { | |
| 6621 | // Signed type is higher rank but same size as unsigned type | |
| 6622 | // e.g. `long` and `unsigned` on x86-linux-gnu | |
| 6623 | // Use unsigned version of the signed type | |
| 6624 | target_qt = if (a_signed) try a_real.makeIntUnsigned(p.comp) else try b_real.makeIntUnsigned(p.comp); | |
| 5867 | 6625 | } |
| 5868 | 6626 | |
| 5869 | if (a.ty.eql(b.ty, p.comp, true)) { | |
| 5870 | // cast to promoted type | |
| 5871 | try a.intCast(p, a.ty, tok); | |
| 5872 | try b.intCast(p, b.ty, tok); | |
| 5873 | return; | |
| 6627 | if (a.qt.is(p.comp, .complex) or b.qt.is(p.comp, .complex)) { | |
| 6628 | target_qt = try target_qt.toComplex(p.comp); | |
| 5874 | 6629 | } |
| 5875 | 6630 | |
| 5876 | const target = a.ty.integerConversion(b.ty, p.comp); | |
| 5877 | if (!target.isReal()) { | |
| 6631 | if (target_qt.is(p.comp, .complex)) { | |
| 6632 | // TODO implement complex int values | |
| 5878 | 6633 | try a.saveValue(p); |
| 5879 | 6634 | try b.saveValue(p); |
| 5880 | 6635 | } |
| 5881 | try a.intCast(p, target, tok); | |
| 5882 | try b.intCast(p, target, tok); | |
| 5883 | } | |
| 5884 | ||
| 5885 | fn floatConversion(a: *Result, b: *Result, a_spec: Type.Specifier, b_spec: Type.Specifier, p: *Parser, pair: [2]Type.Specifier) !bool { | |
| 5886 | if (a_spec == pair[0] or a_spec == pair[1] or | |
| 5887 | b_spec == pair[0] or b_spec == pair[1]) | |
| 5888 | { | |
| 5889 | const both_real = a.ty.isReal() and b.ty.isReal(); | |
| 5890 | const res_spec = pair[@intFromBool(both_real)]; | |
| 5891 | const ty = Type{ .specifier = res_spec }; | |
| 5892 | try a.floatCast(p, ty); | |
| 5893 | try b.floatCast(p, ty); | |
| 5894 | return true; | |
| 5895 | } | |
| 5896 | return false; | |
| 6636 | try a.castToInt(p, target_qt, tok); | |
| 6637 | try b.castToInt(p, target_qt, tok); | |
| 5897 | 6638 | } |
| 5898 | 6639 | |
| 5899 | 6640 | fn invalidBinTy(a: *Result, tok: TokenIndex, b: *Result, p: *Parser) Error!bool { |
| 5900 | try p.errStr(.invalid_bin_types, tok, try p.typePairStr(a.ty, b.ty)); | |
| 6641 | try p.err(tok, .invalid_bin_types, .{ a.qt, b.qt }); | |
| 5901 | 6642 | a.val = .{}; |
| 5902 | 6643 | b.val = .{}; |
| 5903 | a.ty = Type.invalid; | |
| 6644 | a.qt = .invalid; | |
| 5904 | 6645 | return false; |
| 5905 | 6646 | } |
| 5906 | 6647 | |
| ... | ... | @@ -5917,168 +6658,213 @@ pub const Result = struct { |
| 5917 | 6658 | /// Saves value and replaces it with `.unavailable`. |
| 5918 | 6659 | fn saveValue(res: *Result, p: *Parser) !void { |
| 5919 | 6660 | assert(!p.in_macro); |
| 5920 | if (res.val.opt_ref == .none or res.val.opt_ref == .null) return; | |
| 5921 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 6661 | try res.putValue(p); | |
| 5922 | 6662 | res.val = .{}; |
| 5923 | 6663 | } |
| 5924 | 6664 | |
| 5925 | fn castType(res: *Result, p: *Parser, to: Type, operand_tok: TokenIndex, l_paren: TokenIndex) Error!void { | |
| 5926 | var cast_kind: Tree.CastKind = undefined; | |
| 6665 | /// Saves value without altering the result. | |
| 6666 | fn putValue(res: *const Result, p: *Parser) !void { | |
| 6667 | if (res.val.opt_ref == .none or res.val.opt_ref == .null) return; | |
| 6668 | if (!p.in_macro) try p.tree.value_map.put(p.comp.gpa, res.node, res.val); | |
| 6669 | } | |
| 6670 | ||
| 6671 | fn castType(res: *Result, p: *Parser, dest_qt: QualType, operand_tok: TokenIndex, l_paren: TokenIndex) !void { | |
| 6672 | if (res.qt.isInvalid()) { | |
| 6673 | res.val = .{}; | |
| 6674 | return; | |
| 6675 | } else if (dest_qt.isInvalid()) { | |
| 6676 | res.val = .{}; | |
| 6677 | res.qt = .invalid; | |
| 6678 | return; | |
| 6679 | } | |
| 6680 | var cast_kind: Node.Cast.Kind = undefined; | |
| 6681 | ||
| 6682 | const dest_sk = dest_qt.scalarKind(p.comp); | |
| 6683 | const src_sk = res.qt.scalarKind(p.comp); | |
| 6684 | ||
| 6685 | const dest_vec = dest_qt.is(p.comp, .vector); | |
| 6686 | const src_vec = res.qt.is(p.comp, .vector); | |
| 5927 | 6687 | |
| 5928 | if (to.is(.void)) { | |
| 6688 | if (dest_qt.is(p.comp, .void)) { | |
| 5929 | 6689 | // everything can cast to void |
| 5930 | 6690 | cast_kind = .to_void; |
| 5931 | 6691 | res.val = .{}; |
| 5932 | } else if (to.is(.nullptr_t)) { | |
| 5933 | if (res.ty.is(.nullptr_t)) { | |
| 6692 | } else if (res.qt.is(p.comp, .void)) { | |
| 6693 | try p.err(operand_tok, .invalid_cast_operand_type, .{res.qt}); | |
| 6694 | return error.ParsingFailed; | |
| 6695 | } else if (dest_vec and src_vec) { | |
| 6696 | if (dest_qt.eql(res.qt, p.comp)) { | |
| 6697 | cast_kind = .no_op; | |
| 6698 | } else if (dest_qt.sizeCompare(res.qt, p.comp) == .eq) { | |
| 6699 | cast_kind = .bitcast; | |
| 6700 | } else { | |
| 6701 | try p.err(l_paren, .invalid_vec_conversion, .{ dest_qt, res.qt }); | |
| 6702 | return error.ParsingFailed; | |
| 6703 | } | |
| 6704 | } else if (dest_vec or src_vec) { | |
| 6705 | const non_vec_sk = if (dest_vec) src_sk else dest_sk; | |
| 6706 | const vec_qt = if (dest_vec) dest_qt else res.qt; | |
| 6707 | const non_vec_qt = if (dest_vec) res.qt else dest_qt; | |
| 6708 | const non_vec_tok = if (dest_vec) operand_tok else l_paren; | |
| 6709 | if (non_vec_sk == .none) { | |
| 6710 | try p.err(non_vec_tok, .invalid_cast_operand_type, .{non_vec_qt}); | |
| 6711 | return error.ParsingFailed; | |
| 6712 | } else if (!non_vec_sk.isInt()) { | |
| 6713 | try p.err(non_vec_tok, .invalid_vec_conversion_scalar, .{ vec_qt, non_vec_qt }); | |
| 6714 | return error.ParsingFailed; | |
| 6715 | } else if (dest_qt.sizeCompare(res.qt, p.comp) != .eq) { | |
| 6716 | try p.err(non_vec_tok, .invalid_vec_conversion_int, .{ vec_qt, non_vec_qt }); | |
| 6717 | return error.ParsingFailed; | |
| 6718 | } else { | |
| 6719 | cast_kind = .bitcast; | |
| 6720 | } | |
| 6721 | } else if (dest_sk == .nullptr_t) { | |
| 6722 | res.val = .{}; | |
| 6723 | if (src_sk == .nullptr_t) { | |
| 5934 | 6724 | cast_kind = .no_op; |
| 5935 | 6725 | } else { |
| 5936 | try p.errStr(.invalid_object_cast, l_paren, try p.typePairStrExtra(res.ty, " to ", to)); | |
| 6726 | try p.err(l_paren, .invalid_object_cast, .{ res.qt, dest_qt }); | |
| 5937 | 6727 | return error.ParsingFailed; |
| 5938 | 6728 | } |
| 5939 | } else if (res.ty.is(.nullptr_t)) { | |
| 5940 | if (to.is(.bool)) { | |
| 5941 | try res.nullCast(p, res.ty); | |
| 6729 | } else if (src_sk == .nullptr_t) { | |
| 6730 | if (dest_sk == .bool) { | |
| 6731 | try res.nullToPointer(p, res.qt, l_paren); | |
| 5942 | 6732 | res.val.boolCast(p.comp); |
| 5943 | res.ty = .{ .specifier = .bool }; | |
| 5944 | try res.implicitCast(p, .pointer_to_bool); | |
| 6733 | res.qt = .bool; | |
| 6734 | try res.implicitCast(p, .pointer_to_bool, l_paren); | |
| 5945 | 6735 | try res.saveValue(p); |
| 5946 | } else if (to.isPtr()) { | |
| 5947 | try res.nullCast(p, to); | |
| 6736 | } else if (dest_sk.isPointer()) { | |
| 6737 | try res.nullToPointer(p, dest_qt, l_paren); | |
| 5948 | 6738 | } else { |
| 5949 | try p.errStr(.invalid_object_cast, l_paren, try p.typePairStrExtra(res.ty, " to ", to)); | |
| 6739 | try p.err(l_paren, .invalid_object_cast, .{ res.qt, dest_qt }); | |
| 5950 | 6740 | return error.ParsingFailed; |
| 5951 | 6741 | } |
| 5952 | 6742 | cast_kind = .no_op; |
| 5953 | } else if (res.val.isZero(p.comp) and to.isPtr()) { | |
| 6743 | } else if (res.val.isZero(p.comp) and dest_sk.isPointer()) { | |
| 5954 | 6744 | cast_kind = .null_to_pointer; |
| 5955 | } else if (to.isScalar()) cast: { | |
| 5956 | const old_float = res.ty.isFloat(); | |
| 5957 | const new_float = to.isFloat(); | |
| 5958 | ||
| 5959 | if (new_float and res.ty.isPtr()) { | |
| 5960 | try p.errStr(.invalid_cast_to_float, l_paren, try p.typeStr(to)); | |
| 6745 | } else if (dest_sk != .none) cast: { | |
| 6746 | if (dest_sk.isFloat() and src_sk.isPointer()) { | |
| 6747 | try p.err(l_paren, .invalid_cast_to_float, .{dest_qt}); | |
| 5961 | 6748 | return error.ParsingFailed; |
| 5962 | } else if (old_float and to.isPtr()) { | |
| 5963 | try p.errStr(.invalid_cast_to_pointer, l_paren, try p.typeStr(res.ty)); | |
| 6749 | } else if ((src_sk.isFloat() or !src_sk.isReal()) and dest_sk.isPointer()) { | |
| 6750 | try p.err(l_paren, .invalid_cast_to_pointer, .{res.qt}); | |
| 5964 | 6751 | return error.ParsingFailed; |
| 5965 | 6752 | } |
| 5966 | const old_real = res.ty.isReal(); | |
| 5967 | const new_real = to.isReal(); | |
| 5968 | 6753 | |
| 5969 | if (to.eql(res.ty, p.comp, false)) { | |
| 6754 | if (dest_qt.eql(res.qt, p.comp)) { | |
| 5970 | 6755 | cast_kind = .no_op; |
| 5971 | } else if (to.is(.bool)) { | |
| 5972 | if (res.ty.isPtr()) { | |
| 6756 | } else if (dest_sk == .bool) { | |
| 6757 | if (src_sk.isPointer()) { | |
| 5973 | 6758 | cast_kind = .pointer_to_bool; |
| 5974 | } else if (res.ty.isInt()) { | |
| 5975 | if (!old_real) { | |
| 5976 | res.ty = res.ty.makeReal(); | |
| 5977 | try res.implicitCast(p, .complex_int_to_real); | |
| 6759 | } else if (src_sk.isInt()) { | |
| 6760 | if (!src_sk.isReal()) { | |
| 6761 | res.qt = res.qt.toReal(p.comp); | |
| 6762 | try res.implicitCast(p, .complex_int_to_real, l_paren); | |
| 5978 | 6763 | } |
| 5979 | 6764 | cast_kind = .int_to_bool; |
| 5980 | } else if (old_float) { | |
| 5981 | if (!old_real) { | |
| 5982 | res.ty = res.ty.makeReal(); | |
| 5983 | try res.implicitCast(p, .complex_float_to_real); | |
| 6765 | } else if (src_sk.isFloat()) { | |
| 6766 | if (!src_sk.isReal()) { | |
| 6767 | res.qt = res.qt.toReal(p.comp); | |
| 6768 | try res.implicitCast(p, .complex_float_to_real, l_paren); | |
| 5984 | 6769 | } |
| 5985 | 6770 | cast_kind = .float_to_bool; |
| 5986 | 6771 | } |
| 5987 | } else if (to.isInt()) { | |
| 5988 | if (res.ty.is(.bool)) { | |
| 5989 | if (!new_real) { | |
| 5990 | res.ty = to.makeReal(); | |
| 5991 | try res.implicitCast(p, .bool_to_int); | |
| 6772 | } else if (dest_sk.isInt()) { | |
| 6773 | if (src_sk == .bool) { | |
| 6774 | if (!dest_sk.isReal()) { | |
| 6775 | res.qt = dest_qt.toReal(p.comp); | |
| 6776 | try res.implicitCast(p, .bool_to_int, l_paren); | |
| 5992 | 6777 | cast_kind = .real_to_complex_int; |
| 5993 | 6778 | } else { |
| 5994 | 6779 | cast_kind = .bool_to_int; |
| 5995 | 6780 | } |
| 5996 | } else if (res.ty.isInt()) { | |
| 5997 | if (old_real and new_real) { | |
| 6781 | } else if (src_sk.isInt()) { | |
| 6782 | if (src_sk.isReal() and dest_sk.isReal()) { | |
| 5998 | 6783 | cast_kind = .int_cast; |
| 5999 | } else if (old_real) { | |
| 6000 | res.ty = to.makeReal(); | |
| 6001 | try res.implicitCast(p, .int_cast); | |
| 6784 | } else if (src_sk.isReal()) { | |
| 6785 | res.qt = dest_qt.toReal(p.comp); | |
| 6786 | try res.implicitCast(p, .int_cast, l_paren); | |
| 6002 | 6787 | cast_kind = .real_to_complex_int; |
| 6003 | } else if (new_real) { | |
| 6004 | res.ty = res.ty.makeReal(); | |
| 6005 | try res.implicitCast(p, .complex_int_to_real); | |
| 6788 | } else if (dest_sk.isReal()) { | |
| 6789 | res.qt = res.qt.toReal(p.comp); | |
| 6790 | try res.implicitCast(p, .complex_int_to_real, l_paren); | |
| 6006 | 6791 | cast_kind = .int_cast; |
| 6007 | 6792 | } else { |
| 6008 | 6793 | cast_kind = .complex_int_cast; |
| 6009 | 6794 | } |
| 6010 | } else if (res.ty.isPtr()) { | |
| 6011 | if (!new_real) { | |
| 6012 | res.ty = to.makeReal(); | |
| 6013 | try res.implicitCast(p, .pointer_to_int); | |
| 6795 | } else if (src_sk.isPointer()) { | |
| 6796 | res.val = .{}; | |
| 6797 | if (!dest_sk.isReal()) { | |
| 6798 | res.qt = dest_qt.toReal(p.comp); | |
| 6799 | try res.implicitCast(p, .pointer_to_int, l_paren); | |
| 6014 | 6800 | cast_kind = .real_to_complex_int; |
| 6015 | 6801 | } else { |
| 6016 | 6802 | cast_kind = .pointer_to_int; |
| 6017 | 6803 | } |
| 6018 | } else if (old_real and new_real) { | |
| 6804 | } else if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6019 | 6805 | cast_kind = .float_to_int; |
| 6020 | } else if (old_real) { | |
| 6021 | res.ty = to.makeReal(); | |
| 6022 | try res.implicitCast(p, .float_to_int); | |
| 6806 | } else if (src_sk.isReal()) { | |
| 6807 | res.qt = dest_qt.toReal(p.comp); | |
| 6808 | try res.implicitCast(p, .float_to_int, l_paren); | |
| 6023 | 6809 | cast_kind = .real_to_complex_int; |
| 6024 | } else if (new_real) { | |
| 6025 | res.ty = res.ty.makeReal(); | |
| 6026 | try res.implicitCast(p, .complex_float_to_real); | |
| 6810 | } else if (dest_sk.isReal()) { | |
| 6811 | res.qt = res.qt.toReal(p.comp); | |
| 6812 | try res.implicitCast(p, .complex_float_to_real, l_paren); | |
| 6027 | 6813 | cast_kind = .float_to_int; |
| 6028 | 6814 | } else { |
| 6029 | 6815 | cast_kind = .complex_float_to_complex_int; |
| 6030 | 6816 | } |
| 6031 | } else if (to.isPtr()) { | |
| 6032 | if (res.ty.isArray()) | |
| 6033 | cast_kind = .array_to_pointer | |
| 6034 | else if (res.ty.isPtr()) | |
| 6035 | cast_kind = .bitcast | |
| 6036 | else if (res.ty.isFunc()) | |
| 6037 | cast_kind = .function_to_pointer | |
| 6038 | else if (res.ty.is(.bool)) | |
| 6039 | cast_kind = .bool_to_pointer | |
| 6040 | else if (res.ty.isInt()) { | |
| 6041 | if (!old_real) { | |
| 6042 | res.ty = res.ty.makeReal(); | |
| 6043 | try res.implicitCast(p, .complex_int_to_real); | |
| 6817 | } else if (dest_sk.isPointer()) { | |
| 6818 | if (src_sk.isPointer()) { | |
| 6819 | cast_kind = .bitcast; | |
| 6820 | } else if (src_sk.isInt()) { | |
| 6821 | if (!src_sk.isReal()) { | |
| 6822 | res.qt = res.qt.toReal(p.comp); | |
| 6823 | try res.implicitCast(p, .complex_int_to_real, l_paren); | |
| 6044 | 6824 | } |
| 6045 | 6825 | cast_kind = .int_to_pointer; |
| 6826 | } else if (src_sk == .bool) { | |
| 6827 | cast_kind = .bool_to_pointer; | |
| 6828 | } else if (res.qt.is(p.comp, .array)) { | |
| 6829 | cast_kind = .array_to_pointer; | |
| 6830 | } else if (res.qt.is(p.comp, .func)) { | |
| 6831 | cast_kind = .function_to_pointer; | |
| 6046 | 6832 | } else { |
| 6047 | try p.errStr(.cond_expr_type, operand_tok, try p.typeStr(res.ty)); | |
| 6833 | try p.err(operand_tok, .invalid_cast_operand_type, .{res.qt}); | |
| 6048 | 6834 | return error.ParsingFailed; |
| 6049 | 6835 | } |
| 6050 | } else if (new_float) { | |
| 6051 | if (res.ty.is(.bool)) { | |
| 6052 | if (!new_real) { | |
| 6053 | res.ty = to.makeReal(); | |
| 6054 | try res.implicitCast(p, .bool_to_float); | |
| 6836 | } else if (dest_sk.isFloat()) { | |
| 6837 | if (src_sk == .bool) { | |
| 6838 | if (!dest_sk.isReal()) { | |
| 6839 | res.qt = dest_qt.toReal(p.comp); | |
| 6840 | try res.implicitCast(p, .bool_to_float, l_paren); | |
| 6055 | 6841 | cast_kind = .real_to_complex_float; |
| 6056 | 6842 | } else { |
| 6057 | 6843 | cast_kind = .bool_to_float; |
| 6058 | 6844 | } |
| 6059 | } else if (res.ty.isInt()) { | |
| 6060 | if (old_real and new_real) { | |
| 6845 | } else if (src_sk.isInt()) { | |
| 6846 | if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6061 | 6847 | cast_kind = .int_to_float; |
| 6062 | } else if (old_real) { | |
| 6063 | res.ty = to.makeReal(); | |
| 6064 | try res.implicitCast(p, .int_to_float); | |
| 6848 | } else if (src_sk.isReal()) { | |
| 6849 | res.qt = dest_qt.toReal(p.comp); | |
| 6850 | try res.implicitCast(p, .int_to_float, l_paren); | |
| 6065 | 6851 | cast_kind = .real_to_complex_float; |
| 6066 | } else if (new_real) { | |
| 6067 | res.ty = res.ty.makeReal(); | |
| 6068 | try res.implicitCast(p, .complex_int_to_real); | |
| 6852 | } else if (dest_sk.isReal()) { | |
| 6853 | res.qt = res.qt.toReal(p.comp); | |
| 6854 | try res.implicitCast(p, .complex_int_to_real, l_paren); | |
| 6069 | 6855 | cast_kind = .int_to_float; |
| 6070 | 6856 | } else { |
| 6071 | 6857 | cast_kind = .complex_int_to_complex_float; |
| 6072 | 6858 | } |
| 6073 | } else if (old_real and new_real) { | |
| 6859 | } else if (src_sk.isReal() and dest_sk.isReal()) { | |
| 6074 | 6860 | cast_kind = .float_cast; |
| 6075 | } else if (old_real) { | |
| 6076 | res.ty = to.makeReal(); | |
| 6077 | try res.implicitCast(p, .float_cast); | |
| 6861 | } else if (src_sk.isReal()) { | |
| 6862 | res.qt = dest_qt.toReal(p.comp); | |
| 6863 | try res.implicitCast(p, .float_cast, l_paren); | |
| 6078 | 6864 | cast_kind = .real_to_complex_float; |
| 6079 | } else if (new_real) { | |
| 6080 | res.ty = res.ty.makeReal(); | |
| 6081 | try res.implicitCast(p, .complex_float_to_real); | |
| 6865 | } else if (dest_sk.isReal()) { | |
| 6866 | res.qt = res.qt.toReal(p.comp); | |
| 6867 | try res.implicitCast(p, .complex_float_to_real, l_paren); | |
| 6082 | 6868 | cast_kind = .float_cast; |
| 6083 | 6869 | } else { |
| 6084 | 6870 | cast_kind = .complex_float_cast; |
| ... | ... | @@ -6086,67 +6872,74 @@ pub const Result = struct { |
| 6086 | 6872 | } |
| 6087 | 6873 | if (res.val.opt_ref == .none) break :cast; |
| 6088 | 6874 | |
| 6089 | const old_int = res.ty.isInt() or res.ty.isPtr(); | |
| 6090 | const new_int = to.isInt() or to.isPtr(); | |
| 6091 | if (to.is(.bool)) { | |
| 6875 | const src_int = src_sk.isInt() or src_sk.isPointer(); | |
| 6876 | const dest_int = dest_sk.isInt() or dest_sk.isPointer(); | |
| 6877 | if (dest_sk == .bool) { | |
| 6092 | 6878 | res.val.boolCast(p.comp); |
| 6093 | } else if (old_float and new_int) { | |
| 6094 | if (to.hasIncompleteSize()) { | |
| 6095 | try p.errStr(.cast_to_incomplete_type, l_paren, try p.typeStr(to)); | |
| 6879 | } else if (src_sk.isFloat() and dest_int) { | |
| 6880 | if (dest_qt.hasIncompleteSize(p.comp)) { | |
| 6881 | try p.err(l_paren, .cast_to_incomplete_type, .{dest_qt}); | |
| 6096 | 6882 | return error.ParsingFailed; |
| 6097 | 6883 | } |
| 6098 | 6884 | // Explicit cast, no conversion warning |
| 6099 | _ = try res.val.floatToInt(to, p.comp); | |
| 6100 | } else if (new_float and old_int) { | |
| 6101 | try res.val.intToFloat(to, p.comp); | |
| 6102 | } else if (new_float and old_float) { | |
| 6103 | try res.val.floatCast(to, p.comp); | |
| 6104 | } else if (old_int and new_int) { | |
| 6105 | if (to.hasIncompleteSize()) { | |
| 6106 | try p.errStr(.cast_to_incomplete_type, l_paren, try p.typeStr(to)); | |
| 6885 | _ = try res.val.floatToInt(dest_qt, p.comp); | |
| 6886 | } else if (dest_sk.isFloat() and src_int) { | |
| 6887 | try res.val.intToFloat(dest_qt, p.comp); | |
| 6888 | } else if (dest_sk.isFloat() and src_sk.isFloat()) { | |
| 6889 | try res.val.floatCast(dest_qt, p.comp); | |
| 6890 | } else if (src_int and dest_int) { | |
| 6891 | if (dest_qt.hasIncompleteSize(p.comp)) { | |
| 6892 | try p.err(l_paren, .cast_to_incomplete_type, .{dest_qt}); | |
| 6107 | 6893 | return error.ParsingFailed; |
| 6108 | 6894 | } |
| 6109 | _ = try res.val.intCast(to, p.comp); | |
| 6895 | _ = try res.val.intCast(dest_qt, p.comp); | |
| 6110 | 6896 | } |
| 6111 | } else if (to.get(.@"union")) |union_ty| { | |
| 6112 | if (union_ty.data.record.hasFieldOfType(res.ty, p.comp)) { | |
| 6113 | cast_kind = .union_cast; | |
| 6114 | try p.errTok(.gnu_union_cast, l_paren); | |
| 6115 | } else { | |
| 6116 | if (union_ty.data.record.isIncomplete()) { | |
| 6117 | try p.errStr(.cast_to_incomplete_type, l_paren, try p.typeStr(to)); | |
| 6118 | } else { | |
| 6119 | try p.errStr(.invalid_union_cast, l_paren, try p.typeStr(res.ty)); | |
| 6120 | } | |
| 6897 | } else if (dest_qt.get(p.comp, .@"union")) |union_ty| { | |
| 6898 | if (union_ty.layout == null) { | |
| 6899 | try p.err(l_paren, .cast_to_incomplete_type, .{dest_qt}); | |
| 6121 | 6900 | return error.ParsingFailed; |
| 6122 | 6901 | } |
| 6123 | } else { | |
| 6124 | if (to.is(.auto_type)) { | |
| 6125 | try p.errTok(.invalid_cast_to_auto_type, l_paren); | |
| 6902 | ||
| 6903 | for (union_ty.fields) |field| { | |
| 6904 | if (field.qt.eql(res.qt, p.comp)) { | |
| 6905 | cast_kind = .union_cast; | |
| 6906 | try p.err(l_paren, .gnu_union_cast, .{}); | |
| 6907 | break; | |
| 6908 | } | |
| 6126 | 6909 | } else { |
| 6127 | try p.errStr(.invalid_cast_type, l_paren, try p.typeStr(to)); | |
| 6910 | try p.err(l_paren, .invalid_union_cast, .{res.qt}); | |
| 6911 | return error.ParsingFailed; | |
| 6128 | 6912 | } |
| 6913 | } else if (dest_qt.eql(res.qt, p.comp)) { | |
| 6914 | try p.err(l_paren, .cast_to_same_type, .{dest_qt}); | |
| 6915 | cast_kind = .no_op; | |
| 6916 | } else { | |
| 6917 | try p.err(l_paren, .invalid_cast_type, .{dest_qt}); | |
| 6129 | 6918 | return error.ParsingFailed; |
| 6130 | 6919 | } |
| 6131 | if (to.anyQual()) try p.errStr(.qual_cast, l_paren, try p.typeStr(to)); | |
| 6132 | if (to.isInt() and res.ty.isPtr() and to.sizeCompare(res.ty, p.comp) == .lt) { | |
| 6133 | try p.errStr(.cast_to_smaller_int, l_paren, try p.typePairStrExtra(to, " from ", res.ty)); | |
| 6920 | ||
| 6921 | if (dest_qt.isQualified()) try p.err(l_paren, .qual_cast, .{dest_qt}); | |
| 6922 | if (dest_sk.isInt() and src_sk.isPointer() and dest_qt.sizeCompare(res.qt, p.comp) == .lt) { | |
| 6923 | try p.err(l_paren, .cast_to_smaller_int, .{ dest_qt, res.qt }); | |
| 6134 | 6924 | } |
| 6135 | res.ty = to; | |
| 6136 | res.ty.qual = .{}; | |
| 6925 | ||
| 6926 | res.qt = dest_qt.unqualified(); | |
| 6137 | 6927 | res.node = try p.addNode(.{ |
| 6138 | .tag = .explicit_cast, | |
| 6139 | .ty = res.ty, | |
| 6140 | .data = .{ .cast = .{ .operand = res.node, .kind = cast_kind } }, | |
| 6141 | .loc = @enumFromInt(l_paren), | |
| 6928 | .cast = .{ | |
| 6929 | .l_paren = l_paren, | |
| 6930 | .qt = res.qt, | |
| 6931 | .operand = res.node, | |
| 6932 | .kind = cast_kind, | |
| 6933 | .implicit = false, | |
| 6934 | }, | |
| 6142 | 6935 | }); |
| 6143 | 6936 | } |
| 6144 | 6937 | |
| 6145 | fn intFitsInType(res: Result, p: *Parser, ty: Type) !bool { | |
| 6938 | fn intFitsInType(res: Result, p: *Parser, ty: QualType) !bool { | |
| 6146 | 6939 | const max_int = try Value.maxInt(ty, p.comp); |
| 6147 | 6940 | const min_int = try Value.minInt(ty, p.comp); |
| 6148 | 6941 | return res.val.compare(.lte, max_int, p.comp) and |
| 6149 | (res.ty.isUnsignedInt(p.comp) or res.val.compare(.gte, min_int, p.comp)); | |
| 6942 | (res.qt.signedness(p.comp) == .unsigned or res.val.compare(.gte, min_int, p.comp)); | |
| 6150 | 6943 | } |
| 6151 | 6944 | |
| 6152 | 6945 | const CoerceContext = union(enum) { |
| ... | ... | @@ -6158,26 +6951,17 @@ pub const Result = struct { |
| 6158 | 6951 | |
| 6159 | 6952 | fn note(c: CoerceContext, p: *Parser) !void { |
| 6160 | 6953 | switch (c) { |
| 6161 | .arg => |tok| try p.errTok(.parameter_here, tok), | |
| 6954 | .arg => |tok| try p.err(tok, .parameter_here, .{}), | |
| 6162 | 6955 | .test_coerce => unreachable, |
| 6163 | 6956 | else => {}, |
| 6164 | 6957 | } |
| 6165 | 6958 | } |
| 6166 | ||
| 6167 | fn typePairStr(c: CoerceContext, p: *Parser, dest_ty: Type, src_ty: Type) ![]const u8 { | |
| 6168 | switch (c) { | |
| 6169 | .assign, .init => return p.typePairStrExtra(dest_ty, " from incompatible type ", src_ty), | |
| 6170 | .ret => return p.typePairStrExtra(src_ty, " from a function with incompatible result type ", dest_ty), | |
| 6171 | .arg => return p.typePairStrExtra(src_ty, " to parameter of incompatible type ", dest_ty), | |
| 6172 | .test_coerce => unreachable, | |
| 6173 | } | |
| 6174 | } | |
| 6175 | 6959 | }; |
| 6176 | 6960 | |
| 6177 | 6961 | /// Perform assignment-like coercion to `dest_ty`. |
| 6178 | fn coerce(res: *Result, p: *Parser, dest_ty: Type, tok: TokenIndex, c: CoerceContext) Error!void { | |
| 6179 | if (res.ty.specifier == .invalid or dest_ty.specifier == .invalid) { | |
| 6180 | res.ty = Type.invalid; | |
| 6962 | fn coerce(res: *Result, p: *Parser, dest_ty: QualType, tok: TokenIndex, c: CoerceContext) Error!void { | |
| 6963 | if (dest_ty.isInvalid()) { | |
| 6964 | res.qt = .invalid; | |
| 6181 | 6965 | return; |
| 6182 | 6966 | } |
| 6183 | 6967 | return res.coerceExtra(p, dest_ty, tok, c) catch |er| switch (er) { |
| ... | ... | @@ -6189,104 +6973,131 @@ pub const Result = struct { |
| 6189 | 6973 | fn coerceExtra( |
| 6190 | 6974 | res: *Result, |
| 6191 | 6975 | p: *Parser, |
| 6192 | dest_ty: Type, | |
| 6976 | dest_qt: QualType, | |
| 6193 | 6977 | tok: TokenIndex, |
| 6194 | 6978 | c: CoerceContext, |
| 6195 | 6979 | ) (Error || error{CoercionFailed})!void { |
| 6196 | 6980 | // Subject of the coercion does not need to be qualified. |
| 6197 | var unqual_ty = dest_ty.canonicalize(.standard); | |
| 6198 | unqual_ty.qual = .{}; | |
| 6199 | if (unqual_ty.is(.nullptr_t)) { | |
| 6200 | if (res.ty.is(.nullptr_t)) return; | |
| 6201 | } else if (unqual_ty.is(.bool)) { | |
| 6202 | if (res.ty.isScalar() and !res.ty.is(.nullptr_t)) { | |
| 6981 | const src_original_qt = res.qt; | |
| 6982 | switch (c) { | |
| 6983 | .init, .ret, .assign => try res.lvalConversion(p, tok), | |
| 6984 | else => {}, | |
| 6985 | } | |
| 6986 | if (res.qt.isInvalid()) return; | |
| 6987 | const dest_unqual = dest_qt.unqualified(); | |
| 6988 | const dest_sk = dest_unqual.scalarKind(p.comp); | |
| 6989 | const src_sk = res.qt.scalarKind(p.comp); | |
| 6990 | ||
| 6991 | if (dest_qt.is(p.comp, .vector) and res.qt.is(p.comp, .vector)) { | |
| 6992 | if (dest_unqual.eql(res.qt, p.comp)) return; | |
| 6993 | if (dest_unqual.sizeCompare(res.qt, p.comp) == .eq) { | |
| 6994 | res.qt = dest_unqual; | |
| 6995 | return res.implicitCast(p, .bitcast, tok); | |
| 6996 | } | |
| 6997 | } else if (dest_sk == .nullptr_t) { | |
| 6998 | if (src_sk == .nullptr_t) return; | |
| 6999 | } else if (dest_sk == .bool) { | |
| 7000 | if (src_sk != .none and src_sk != .nullptr_t) { | |
| 6203 | 7001 | // this is ridiculous but it's what clang does |
| 6204 | try res.boolCast(p, unqual_ty, tok); | |
| 7002 | try res.castToBool(p, dest_unqual, tok); | |
| 6205 | 7003 | return; |
| 6206 | 7004 | } |
| 6207 | } else if (unqual_ty.isInt()) { | |
| 6208 | if (res.ty.isInt() or res.ty.isFloat()) { | |
| 6209 | try res.intCast(p, unqual_ty, tok); | |
| 7005 | } else if (dest_sk.isInt()) { | |
| 7006 | if (src_sk.isInt() or src_sk.isFloat()) { | |
| 7007 | try res.castToInt(p, dest_unqual, tok); | |
| 6210 | 7008 | return; |
| 6211 | } else if (res.ty.isPtr()) { | |
| 7009 | } else if (src_sk.isPointer()) { | |
| 6212 | 7010 | if (c == .test_coerce) return error.CoercionFailed; |
| 6213 | try p.errStr(.implicit_ptr_to_int, tok, try p.typePairStrExtra(res.ty, " to ", dest_ty)); | |
| 7011 | try p.err(tok, .implicit_ptr_to_int, .{ src_original_qt, dest_unqual }); | |
| 6214 | 7012 | try c.note(p); |
| 6215 | try res.intCast(p, unqual_ty, tok); | |
| 7013 | try res.castToInt(p, dest_unqual, tok); | |
| 6216 | 7014 | return; |
| 6217 | 7015 | } |
| 6218 | } else if (unqual_ty.isFloat()) { | |
| 6219 | if (res.ty.isInt() or res.ty.isFloat()) { | |
| 6220 | try res.floatCast(p, unqual_ty); | |
| 7016 | } else if (dest_sk.isFloat()) { | |
| 7017 | if (src_sk.isInt() or src_sk.isFloat()) { | |
| 7018 | try res.castToFloat(p, dest_unqual, tok); | |
| 6221 | 7019 | return; |
| 6222 | 7020 | } |
| 6223 | } else if (unqual_ty.isPtr()) { | |
| 6224 | if (res.ty.is(.nullptr_t) or res.val.isZero(p.comp)) { | |
| 6225 | try res.nullCast(p, dest_ty); | |
| 7021 | } else if (dest_sk.isPointer()) { | |
| 7022 | if (src_sk == .nullptr_t or res.val.isZero(p.comp)) { | |
| 7023 | try res.nullToPointer(p, dest_unqual, tok); | |
| 6226 | 7024 | return; |
| 6227 | } else if (res.ty.isInt() and res.ty.isReal()) { | |
| 7025 | } else if (src_sk.isInt() and src_sk.isReal()) { | |
| 6228 | 7026 | if (c == .test_coerce) return error.CoercionFailed; |
| 6229 | try p.errStr(.implicit_int_to_ptr, tok, try p.typePairStrExtra(res.ty, " to ", dest_ty)); | |
| 7027 | try p.err(tok, .implicit_int_to_ptr, .{ src_original_qt, dest_unqual }); | |
| 6230 | 7028 | try c.note(p); |
| 6231 | try res.ptrCast(p, unqual_ty); | |
| 7029 | try res.castToPointer(p, dest_unqual, tok); | |
| 6232 | 7030 | return; |
| 6233 | } else if (res.ty.isVoidStar() or unqual_ty.eql(res.ty, p.comp, true)) { | |
| 6234 | return; // ok | |
| 6235 | } else if (unqual_ty.isVoidStar() and res.ty.isPtr() or (res.ty.isInt() and res.ty.isReal())) { | |
| 6236 | return; // ok | |
| 6237 | } else if (unqual_ty.eql(res.ty, p.comp, false)) { | |
| 6238 | if (!unqual_ty.elemType().qual.hasQuals(res.ty.elemType().qual)) { | |
| 6239 | try p.errStr(switch (c) { | |
| 6240 | .assign => .ptr_assign_discards_quals, | |
| 6241 | .init => .ptr_init_discards_quals, | |
| 6242 | .ret => .ptr_ret_discards_quals, | |
| 6243 | .arg => .ptr_arg_discards_quals, | |
| 6244 | .test_coerce => return error.CoercionFailed, | |
| 6245 | }, tok, try c.typePairStr(p, dest_ty, res.ty)); | |
| 7031 | } else if (src_sk == .void_pointer or dest_unqual.eql(res.qt, p.comp)) { | |
| 7032 | return res.castToPointer(p, dest_unqual, tok); | |
| 7033 | } else if (dest_sk == .void_pointer and src_sk.isPointer()) { | |
| 7034 | return res.castToPointer(p, dest_unqual, tok); | |
| 7035 | } else if (src_sk.isPointer()) { | |
| 7036 | const src_child = res.qt.childType(p.comp); | |
| 7037 | const dest_child = dest_unqual.childType(p.comp); | |
| 7038 | if (src_child.eql(dest_child, p.comp)) { | |
| 7039 | if ((src_child.@"const" and !dest_child.@"const") or | |
| 7040 | (src_child.@"volatile" and !dest_child.@"volatile") or | |
| 7041 | (src_child.restrict and !dest_child.restrict)) | |
| 7042 | { | |
| 7043 | try p.err(tok, switch (c) { | |
| 7044 | .assign => .ptr_assign_discards_quals, | |
| 7045 | .init => .ptr_init_discards_quals, | |
| 7046 | .ret => .ptr_ret_discards_quals, | |
| 7047 | .arg => .ptr_arg_discards_quals, | |
| 7048 | .test_coerce => return error.CoercionFailed, | |
| 7049 | }, .{ dest_qt, src_original_qt }); | |
| 7050 | } | |
| 7051 | try res.castToPointer(p, dest_unqual, tok); | |
| 7052 | return; | |
| 6246 | 7053 | } |
| 6247 | try res.ptrCast(p, unqual_ty); | |
| 6248 | return; | |
| 6249 | } else if (res.ty.isPtr()) { | |
| 6250 | const different_sign_only = unqual_ty.elemType().sameRankDifferentSign(res.ty.elemType(), p.comp); | |
| 6251 | try p.errStr(switch (c) { | |
| 6252 | .assign => ([2]Diagnostics.Tag{ .incompatible_ptr_assign, .incompatible_ptr_assign_sign })[@intFromBool(different_sign_only)], | |
| 6253 | .init => ([2]Diagnostics.Tag{ .incompatible_ptr_init, .incompatible_ptr_init_sign })[@intFromBool(different_sign_only)], | |
| 6254 | .ret => ([2]Diagnostics.Tag{ .incompatible_return, .incompatible_return_sign })[@intFromBool(different_sign_only)], | |
| 6255 | .arg => ([2]Diagnostics.Tag{ .incompatible_ptr_arg, .incompatible_ptr_arg_sign })[@intFromBool(different_sign_only)], | |
| 7054 | ||
| 7055 | const different_sign_only = src_child.sameRankDifferentSign(dest_child, p.comp); | |
| 7056 | switch (c) { | |
| 7057 | .assign => try p.err(tok, if (different_sign_only) .incompatible_ptr_assign_sign else .incompatible_ptr_assign, .{ dest_qt, src_original_qt }), | |
| 7058 | .init => try p.err(tok, if (different_sign_only) .incompatible_ptr_init_sign else .incompatible_ptr_init, .{ dest_qt, src_original_qt }), | |
| 7059 | .ret => try p.err(tok, if (different_sign_only) .incompatible_return_sign else .incompatible_return, .{ src_original_qt, dest_qt }), | |
| 7060 | .arg => try p.err(tok, if (different_sign_only) .incompatible_ptr_arg_sign else .incompatible_ptr_arg, .{ src_original_qt, dest_qt }), | |
| 6256 | 7061 | .test_coerce => return error.CoercionFailed, |
| 6257 | }, tok, try c.typePairStr(p, dest_ty, res.ty)); | |
| 7062 | } | |
| 6258 | 7063 | try c.note(p); |
| 6259 | try res.ptrChildTypeCast(p, unqual_ty); | |
| 6260 | return; | |
| 7064 | ||
| 7065 | res.qt = dest_unqual; | |
| 7066 | return res.implicitCast(p, .bitcast, tok); | |
| 6261 | 7067 | } |
| 6262 | } else if (unqual_ty.isRecord()) { | |
| 6263 | if (unqual_ty.eql(res.ty, p.comp, false)) { | |
| 7068 | } else if (dest_unqual.getRecord(p.comp) != null) { | |
| 7069 | if (dest_unqual.eql(res.qt, p.comp)) { | |
| 6264 | 7070 | return; // ok |
| 6265 | 7071 | } |
| 6266 | 7072 | |
| 6267 | if (c == .arg) if (unqual_ty.get(.@"union")) |union_ty| { | |
| 6268 | if (dest_ty.hasAttribute(.transparent_union)) transparent_union: { | |
| 6269 | res.coerceExtra(p, union_ty.data.record.fields[0].ty, tok, .test_coerce) catch |er| switch (er) { | |
| 7073 | if (c == .arg) if (dest_unqual.get(p.comp, .@"union")) |union_ty| { | |
| 7074 | if (dest_unqual.hasAttribute(p.comp, .transparent_union)) transparent_union: { | |
| 7075 | res.coerceExtra(p, union_ty.fields[0].qt, tok, .test_coerce) catch |er| switch (er) { | |
| 6270 | 7076 | error.CoercionFailed => break :transparent_union, |
| 6271 | 7077 | else => |e| return e, |
| 6272 | 7078 | }; |
| 6273 | res.node = try p.addNode(.{ | |
| 6274 | .tag = .union_init_expr, | |
| 6275 | .ty = dest_ty, | |
| 6276 | .data = .{ .union_init = .{ .field_index = 0, .node = res.node } }, | |
| 6277 | }); | |
| 6278 | res.ty = dest_ty; | |
| 7079 | res.node = try p.addNode(.{ .union_init_expr = .{ | |
| 7080 | .field_index = 0, | |
| 7081 | .initializer = res.node, | |
| 7082 | .l_brace_tok = tok, | |
| 7083 | .union_qt = dest_unqual, | |
| 7084 | } }); | |
| 7085 | res.qt = dest_unqual; | |
| 6279 | 7086 | return; |
| 6280 | 7087 | } |
| 6281 | 7088 | }; |
| 6282 | } else if (unqual_ty.is(.vector)) { | |
| 6283 | if (unqual_ty.eql(res.ty, p.comp, false)) { | |
| 7089 | } else if (dest_unqual.is(p.comp, .vector)) { | |
| 7090 | if (dest_unqual.eql(res.qt, p.comp)) { | |
| 6284 | 7091 | return; // ok |
| 6285 | 7092 | } |
| 6286 | 7093 | } else { |
| 6287 | if (c == .assign and (unqual_ty.isArray() or unqual_ty.isFunc())) { | |
| 6288 | try p.errTok(.not_assignable, tok); | |
| 6289 | return; | |
| 7094 | if (c == .assign) { | |
| 7095 | const base_type = dest_unqual.base(p.comp); | |
| 7096 | switch (base_type.type) { | |
| 7097 | .array => return p.err(tok, .array_not_assignable, .{base_type.qt}), | |
| 7098 | .func => return p.err(tok, .non_object_not_assignable, .{base_type.qt}), | |
| 7099 | else => {}, | |
| 7100 | } | |
| 6290 | 7101 | } else if (c == .test_coerce) { |
| 6291 | 7102 | return error.CoercionFailed; |
| 6292 | 7103 | } |
| ... | ... | @@ -6295,40 +7106,52 @@ pub const Result = struct { |
| 6295 | 7106 | return error.ParsingFailed; |
| 6296 | 7107 | } |
| 6297 | 7108 | |
| 6298 | try p.errStr(switch (c) { | |
| 6299 | .assign => .incompatible_assign, | |
| 6300 | .init => .incompatible_init, | |
| 6301 | .ret => .incompatible_return, | |
| 6302 | .arg => .incompatible_arg, | |
| 7109 | switch (c) { | |
| 7110 | .assign => try p.err(tok, .incompatible_assign, .{ dest_unqual, res.qt }), | |
| 7111 | .init => try p.err(tok, .incompatible_init, .{ dest_unqual, res.qt }), | |
| 7112 | .ret => try p.err(tok, .incompatible_return, .{ res.qt, dest_unqual }), | |
| 7113 | .arg => try p.err(tok, .incompatible_arg, .{ res.qt, dest_unqual }), | |
| 6303 | 7114 | .test_coerce => return error.CoercionFailed, |
| 6304 | }, tok, try c.typePairStr(p, dest_ty, res.ty)); | |
| 7115 | } | |
| 6305 | 7116 | try c.note(p); |
| 6306 | 7117 | } |
| 6307 | 7118 | }; |
| 6308 | 7119 | |
| 7120 | fn expect(p: *Parser, comptime func: fn (*Parser) Error!?Result) Error!Result { | |
| 7121 | return p.expectResult(try func(p)); | |
| 7122 | } | |
| 7123 | ||
| 7124 | fn expectResult(p: *Parser, res: ?Result) Error!Result { | |
| 7125 | return res orelse { | |
| 7126 | try p.err(p.tok_i, .expected_expr, .{}); | |
| 7127 | return error.ParsingFailed; | |
| 7128 | }; | |
| 7129 | } | |
| 7130 | ||
| 6309 | 7131 | /// expr : assignExpr (',' assignExpr)* |
| 6310 | fn expr(p: *Parser) Error!Result { | |
| 7132 | fn expr(p: *Parser) Error!?Result { | |
| 6311 | 7133 | var expr_start = p.tok_i; |
| 6312 | var err_start = p.comp.diagnostics.list.items.len; | |
| 6313 | var lhs = try p.assignExpr(); | |
| 6314 | if (p.tok_ids[p.tok_i] == .comma) try lhs.expect(p); | |
| 7134 | var prev_total = p.diagnostics.total; | |
| 7135 | var lhs = (try p.assignExpr()) orelse { | |
| 7136 | if (p.tok_ids[p.tok_i] == .comma) _ = try p.expectResult(null); | |
| 7137 | return null; | |
| 7138 | }; | |
| 6315 | 7139 | while (p.eatToken(.comma)) |comma| { |
| 6316 | try lhs.maybeWarnUnused(p, expr_start, err_start); | |
| 7140 | try lhs.maybeWarnUnused(p, expr_start, prev_total); | |
| 6317 | 7141 | expr_start = p.tok_i; |
| 6318 | err_start = p.comp.diagnostics.list.items.len; | |
| 7142 | prev_total = p.diagnostics.total; | |
| 6319 | 7143 | |
| 6320 | var rhs = try p.assignExpr(); | |
| 6321 | try rhs.expect(p); | |
| 6322 | try rhs.lvalConversion(p); | |
| 7144 | var rhs = try p.expect(assignExpr); | |
| 7145 | try rhs.lvalConversion(p, expr_start); | |
| 6323 | 7146 | lhs.val = rhs.val; |
| 6324 | lhs.ty = rhs.ty; | |
| 7147 | lhs.qt = rhs.qt; | |
| 6325 | 7148 | try lhs.bin(p, .comma_expr, rhs, comma); |
| 6326 | 7149 | } |
| 6327 | 7150 | return lhs; |
| 6328 | 7151 | } |
| 6329 | 7152 | |
| 6330 | fn tokToTag(p: *Parser, tok: TokenIndex) Tree.Tag { | |
| 6331 | return switch (p.tok_ids[tok]) { | |
| 7153 | fn eatTag(p: *Parser, id: Token.Id) ?std.meta.Tag(Node) { | |
| 7154 | if (p.eatToken(id)) |_| return switch (id) { | |
| 6332 | 7155 | .equal => .assign_expr, |
| 6333 | 7156 | .asterisk_equal => .mul_assign_expr, |
| 6334 | 7157 | .slash_equal => .div_assign_expr, |
| ... | ... | @@ -6354,69 +7177,125 @@ fn tokToTag(p: *Parser, tok: TokenIndex) Tree.Tag { |
| 6354 | 7177 | .slash => .div_expr, |
| 6355 | 7178 | .percent => .mod_expr, |
| 6356 | 7179 | else => unreachable, |
| 7180 | } else return null; | |
| 7181 | } | |
| 7182 | ||
| 7183 | fn nonAssignExpr(assign_node: std.meta.Tag(Node)) std.meta.Tag(Node) { | |
| 7184 | return switch (assign_node) { | |
| 7185 | .mul_assign_expr => .mul_expr, | |
| 7186 | .div_assign_expr => .div_expr, | |
| 7187 | .mod_assign_expr => .mod_expr, | |
| 7188 | .add_assign_expr => .add_expr, | |
| 7189 | .sub_assign_expr => .sub_expr, | |
| 7190 | .shl_assign_expr => .shl_expr, | |
| 7191 | .shr_assign_expr => .shr_expr, | |
| 7192 | .bit_and_assign_expr => .bit_and_expr, | |
| 7193 | .bit_xor_assign_expr => .bit_xor_expr, | |
| 7194 | .bit_or_assign_expr => .bit_or_expr, | |
| 7195 | else => unreachable, | |
| 7196 | }; | |
| 7197 | } | |
| 7198 | ||
| 7199 | fn unwrapNestedOperation(p: *Parser, node_idx: Node.Index) ?Node.DeclRef { | |
| 7200 | return loop: switch (node_idx.get(&p.tree)) { | |
| 7201 | inline .array_access_expr, | |
| 7202 | .member_access_ptr_expr, | |
| 7203 | .member_access_expr, | |
| 7204 | => |memb_or_arr_access| continue :loop memb_or_arr_access.base.get(&p.tree), | |
| 7205 | inline .cast, | |
| 7206 | .paren_expr, | |
| 7207 | .pre_inc_expr, | |
| 7208 | .post_inc_expr, | |
| 7209 | .pre_dec_expr, | |
| 7210 | .post_dec_expr, | |
| 7211 | => |cast_or_unary| continue :loop cast_or_unary.operand.get(&p.tree), | |
| 7212 | .sub_expr, | |
| 7213 | .add_expr, | |
| 7214 | => |bin| continue :loop bin.lhs.get(&p.tree), | |
| 7215 | .call_expr => |call| continue :loop call.callee.get(&p.tree), | |
| 7216 | .decl_ref_expr => |decl_ref| decl_ref, | |
| 7217 | else => null, | |
| 7218 | }; | |
| 7219 | } | |
| 7220 | ||
| 7221 | fn issueDeclaredConstHereNote(p: *Parser, decl_ref: Tree.Node.DeclRef, var_name: []const u8) Compilation.Error!void { | |
| 7222 | const location = switch (decl_ref.decl.get(&p.tree)) { | |
| 7223 | .variable => |variable| variable.name_tok, | |
| 7224 | .param => |param| param.name_tok, | |
| 7225 | else => return, | |
| 6357 | 7226 | }; |
| 7227 | try p.err(location, .declared_const_here, .{var_name}); | |
| 7228 | } | |
| 7229 | ||
| 7230 | fn issueConstAssignmetDiagnostics(p: *Parser, node_idx: Node.Index, tok: TokenIndex) Compilation.Error!void { | |
| 7231 | if (p.unwrapNestedOperation(node_idx)) |unwrapped| { | |
| 7232 | const name = p.tokSlice(unwrapped.name_tok); | |
| 7233 | try p.err(tok, .const_var_assignment, .{ name, unwrapped.qt }); | |
| 7234 | try p.issueDeclaredConstHereNote(unwrapped, name); | |
| 7235 | } else { | |
| 7236 | try p.err(tok, .not_assignable, .{}); | |
| 7237 | } | |
| 6358 | 7238 | } |
| 6359 | 7239 | |
| 6360 | 7240 | /// assignExpr |
| 6361 | 7241 | /// : condExpr |
| 6362 | 7242 | /// | unExpr ('=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=') assignExpr |
| 6363 | fn assignExpr(p: *Parser) Error!Result { | |
| 6364 | var lhs = try p.condExpr(); | |
| 6365 | if (lhs.empty(p)) return lhs; | |
| 7243 | fn assignExpr(p: *Parser) Error!?Result { | |
| 7244 | var lhs = (try p.condExpr()) orelse return null; | |
| 6366 | 7245 | |
| 6367 | 7246 | const tok = p.tok_i; |
| 6368 | const eq = p.eatToken(.equal); | |
| 6369 | const mul = eq orelse p.eatToken(.asterisk_equal); | |
| 6370 | const div = mul orelse p.eatToken(.slash_equal); | |
| 6371 | const mod = div orelse p.eatToken(.percent_equal); | |
| 6372 | const add = mod orelse p.eatToken(.plus_equal); | |
| 6373 | const sub = add orelse p.eatToken(.minus_equal); | |
| 6374 | const shl = sub orelse p.eatToken(.angle_bracket_angle_bracket_left_equal); | |
| 6375 | const shr = shl orelse p.eatToken(.angle_bracket_angle_bracket_right_equal); | |
| 6376 | const bit_and = shr orelse p.eatToken(.ampersand_equal); | |
| 6377 | const bit_xor = bit_and orelse p.eatToken(.caret_equal); | |
| 6378 | const bit_or = bit_xor orelse p.eatToken(.pipe_equal); | |
| 6379 | ||
| 6380 | const tag = p.tokToTag(bit_or orelse return lhs); | |
| 6381 | var rhs = try p.assignExpr(); | |
| 6382 | try rhs.expect(p); | |
| 6383 | try rhs.lvalConversion(p); | |
| 7247 | const tag = p.eatTag(.equal) orelse | |
| 7248 | p.eatTag(.asterisk_equal) orelse | |
| 7249 | p.eatTag(.slash_equal) orelse | |
| 7250 | p.eatTag(.percent_equal) orelse | |
| 7251 | p.eatTag(.plus_equal) orelse | |
| 7252 | p.eatTag(.minus_equal) orelse | |
| 7253 | p.eatTag(.angle_bracket_angle_bracket_left_equal) orelse | |
| 7254 | p.eatTag(.angle_bracket_angle_bracket_right_equal) orelse | |
| 7255 | p.eatTag(.ampersand_equal) orelse | |
| 7256 | p.eatTag(.caret_equal) orelse | |
| 7257 | p.eatTag(.pipe_equal) orelse return lhs; | |
| 7258 | ||
| 7259 | var rhs = try p.expect(assignExpr); | |
| 6384 | 7260 | |
| 6385 | 7261 | var is_const: bool = undefined; |
| 6386 | if (!p.tmpTree().isLvalExtra(lhs.node, &is_const) or is_const) { | |
| 6387 | try p.errTok(.not_assignable, tok); | |
| 6388 | return error.ParsingFailed; | |
| 7262 | if (!p.tree.isLvalExtra(lhs.node, &is_const) or is_const) { | |
| 7263 | try p.issueConstAssignmetDiagnostics(lhs.node, tok); | |
| 7264 | lhs.qt = .invalid; | |
| 7265 | } | |
| 7266 | ||
| 7267 | if (tag == .assign_expr) { | |
| 7268 | try rhs.coerce(p, lhs.qt, tok, .assign); | |
| 7269 | ||
| 7270 | try lhs.bin(p, tag, rhs, tok); | |
| 7271 | return lhs; | |
| 6389 | 7272 | } |
| 6390 | 7273 | |
| 6391 | // adjustTypes will do do lvalue conversion but we do not want that | |
| 6392 | var lhs_copy = lhs; | |
| 7274 | var lhs_dummy = blk: { | |
| 7275 | var lhs_copy = lhs; | |
| 7276 | try lhs_copy.un(p, .compound_assign_dummy_expr, tok); | |
| 7277 | try lhs_copy.lvalConversion(p, tok); | |
| 7278 | break :blk lhs_copy; | |
| 7279 | }; | |
| 6393 | 7280 | switch (tag) { |
| 6394 | .assign_expr => {}, // handle plain assignment separately | |
| 6395 | 7281 | .mul_assign_expr, |
| 6396 | 7282 | .div_assign_expr, |
| 6397 | 7283 | .mod_assign_expr, |
| 6398 | 7284 | => { |
| 6399 | if (rhs.val.isZero(p.comp) and lhs.ty.isInt() and rhs.ty.isInt()) { | |
| 7285 | if (!lhs.qt.isInvalid() and rhs.val.isZero(p.comp) and lhs.qt.isInt(p.comp) and rhs.qt.isInt(p.comp)) { | |
| 6400 | 7286 | switch (tag) { |
| 6401 | .div_assign_expr => try p.errStr(.division_by_zero, div.?, "division"), | |
| 6402 | .mod_assign_expr => try p.errStr(.division_by_zero, mod.?, "remainder"), | |
| 7287 | .div_assign_expr => try p.err(tok, .division_by_zero, .{"division"}), | |
| 7288 | .mod_assign_expr => try p.err(tok, .division_by_zero, .{"remainder"}), | |
| 6403 | 7289 | else => {}, |
| 6404 | 7290 | } |
| 6405 | 7291 | } |
| 6406 | _ = try lhs_copy.adjustTypes(tok, &rhs, p, if (tag == .mod_assign_expr) .integer else .arithmetic); | |
| 6407 | try lhs.bin(p, tag, rhs, bit_or.?); | |
| 6408 | return lhs; | |
| 7292 | _ = try lhs_dummy.adjustTypes(tok, &rhs, p, if (tag == .mod_assign_expr) .integer else .arithmetic); | |
| 6409 | 7293 | }, |
| 6410 | .sub_assign_expr, | |
| 6411 | .add_assign_expr, | |
| 6412 | => { | |
| 6413 | if (lhs.ty.isPtr() and rhs.ty.isInt()) { | |
| 6414 | try rhs.ptrCast(p, lhs.ty); | |
| 6415 | } else { | |
| 6416 | _ = try lhs_copy.adjustTypes(tok, &rhs, p, .arithmetic); | |
| 6417 | } | |
| 6418 | try lhs.bin(p, tag, rhs, bit_or.?); | |
| 6419 | return lhs; | |
| 7294 | .sub_assign_expr => { | |
| 7295 | _ = try lhs_dummy.adjustTypes(tok, &rhs, p, .sub); | |
| 7296 | }, | |
| 7297 | .add_assign_expr => { | |
| 7298 | _ = try lhs_dummy.adjustTypes(tok, &rhs, p, .add); | |
| 6420 | 7299 | }, |
| 6421 | 7300 | .shl_assign_expr, |
| 6422 | 7301 | .shr_assign_expr, |
| ... | ... | @@ -6424,16 +7303,14 @@ fn assignExpr(p: *Parser) Error!Result { |
| 6424 | 7303 | .bit_xor_assign_expr, |
| 6425 | 7304 | .bit_or_assign_expr, |
| 6426 | 7305 | => { |
| 6427 | _ = try lhs_copy.adjustTypes(tok, &rhs, p, .integer); | |
| 6428 | try lhs.bin(p, tag, rhs, bit_or.?); | |
| 6429 | return lhs; | |
| 7306 | _ = try lhs_dummy.adjustTypes(tok, &rhs, p, .integer); | |
| 6430 | 7307 | }, |
| 6431 | 7308 | else => unreachable, |
| 6432 | 7309 | } |
| 6433 | 7310 | |
| 6434 | try rhs.coerce(p, lhs.ty, tok, .assign); | |
| 6435 | ||
| 6436 | try lhs.bin(p, tag, rhs, bit_or.?); | |
| 7311 | _ = try lhs_dummy.bin(p, nonAssignExpr(tag), rhs, tok); | |
| 7312 | try lhs_dummy.coerce(p, lhs.qt, tok, .assign); | |
| 7313 | try lhs.bin(p, tag, lhs_dummy, tok); | |
| 6437 | 7314 | return lhs; |
| 6438 | 7315 | } |
| 6439 | 7316 | |
| ... | ... | @@ -6442,8 +7319,8 @@ fn assignExpr(p: *Parser) Error!Result { |
| 6442 | 7319 | fn integerConstExpr(p: *Parser, decl_folding: ConstDeclFoldingMode) Error!Result { |
| 6443 | 7320 | const start = p.tok_i; |
| 6444 | 7321 | const res = try p.constExpr(decl_folding); |
| 6445 | if (!res.ty.isInt() and res.ty.specifier != .invalid) { | |
| 6446 | try p.errTok(.expected_integer_constant_expr, start); | |
| 7322 | if (!res.qt.isInvalid() and !res.qt.isRealInt(p.comp)) { | |
| 7323 | try p.err(start, .expected_integer_constant_expr, .{}); | |
| 6447 | 7324 | return error.ParsingFailed; |
| 6448 | 7325 | } |
| 6449 | 7326 | return res; |
| ... | ... | @@ -6456,27 +7333,24 @@ fn constExpr(p: *Parser, decl_folding: ConstDeclFoldingMode) Error!Result { |
| 6456 | 7333 | defer p.const_decl_folding = const_decl_folding; |
| 6457 | 7334 | p.const_decl_folding = decl_folding; |
| 6458 | 7335 | |
| 6459 | const res = try p.condExpr(); | |
| 6460 | try res.expect(p); | |
| 7336 | const res = try p.expect(condExpr); | |
| 6461 | 7337 | |
| 6462 | if (res.ty.specifier == .invalid or res.val.opt_ref == .none) return res; | |
| 7338 | if (res.qt.isInvalid() or res.val.opt_ref == .none) return res; | |
| 6463 | 7339 | |
| 6464 | // saveValue sets val to unavailable | |
| 6465 | var copy = res; | |
| 6466 | try copy.saveValue(p); | |
| 7340 | try res.putValue(p); | |
| 6467 | 7341 | return res; |
| 6468 | 7342 | } |
| 6469 | 7343 | |
| 6470 | 7344 | /// condExpr : lorExpr ('?' expression? ':' condExpr)? |
| 6471 | fn condExpr(p: *Parser) Error!Result { | |
| 7345 | fn condExpr(p: *Parser) Error!?Result { | |
| 6472 | 7346 | const cond_tok = p.tok_i; |
| 6473 | var cond = try p.lorExpr(); | |
| 6474 | if (cond.empty(p) or p.eatToken(.question_mark) == null) return cond; | |
| 6475 | try cond.lvalConversion(p); | |
| 7347 | var cond = (try p.lorExpr()) orelse return null; | |
| 7348 | if (p.eatToken(.question_mark) == null) return cond; | |
| 7349 | try cond.lvalConversion(p, cond_tok); | |
| 6476 | 7350 | const saved_eval = p.no_eval; |
| 6477 | 7351 | |
| 6478 | if (!cond.ty.isScalar()) { | |
| 6479 | try p.errStr(.cond_expr_type, cond_tok, try p.typeStr(cond.ty)); | |
| 7352 | if (cond.qt.scalarKind(p.comp) == .none) { | |
| 7353 | try p.err(cond_tok, .cond_expr_type, .{cond.qt}); | |
| 6480 | 7354 | return error.ParsingFailed; |
| 6481 | 7355 | } |
| 6482 | 7356 | |
| ... | ... | @@ -6487,21 +7361,29 @@ fn condExpr(p: *Parser) Error!Result { |
| 6487 | 7361 | var then_expr = blk: { |
| 6488 | 7362 | defer p.no_eval = saved_eval; |
| 6489 | 7363 | if (cond.val.opt_ref != .none and !cond.val.toBool(p.comp)) p.no_eval = true; |
| 6490 | break :blk try p.expr(); | |
| 7364 | break :blk try p.expect(expr); | |
| 6491 | 7365 | }; |
| 6492 | try then_expr.expect(p); | |
| 6493 | 7366 | |
| 6494 | 7367 | // If we saw a colon then this is a binary conditional expression. |
| 6495 | 7368 | if (maybe_colon) |colon| { |
| 6496 | 7369 | var cond_then = cond; |
| 6497 | cond_then.node = try p.addNode(.{ .tag = .cond_dummy_expr, .ty = cond.ty, .data = .{ .un = cond.node } }); | |
| 7370 | cond_then.node = try p.addNode(.{ | |
| 7371 | .cond_dummy_expr = .{ | |
| 7372 | .op_tok = colon, | |
| 7373 | .operand = cond.node, | |
| 7374 | .qt = cond.qt, | |
| 7375 | }, | |
| 7376 | }); | |
| 6498 | 7377 | _ = try cond_then.adjustTypes(colon, &then_expr, p, .conditional); |
| 6499 | cond.ty = then_expr.ty; | |
| 7378 | cond.qt = then_expr.qt; | |
| 6500 | 7379 | cond.node = try p.addNode(.{ |
| 6501 | .tag = .binary_cond_expr, | |
| 6502 | .ty = cond.ty, | |
| 6503 | .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ cond_then.node, then_expr.node })).start } }, | |
| 6504 | .loc = @enumFromInt(cond_tok), | |
| 7380 | .binary_cond_expr = .{ | |
| 7381 | .cond_tok = cond_tok, | |
| 7382 | .cond = cond.node, | |
| 7383 | .then_expr = cond_then.node, | |
| 7384 | .else_expr = then_expr.node, | |
| 7385 | .qt = cond.qt, | |
| 7386 | }, | |
| 6505 | 7387 | }); |
| 6506 | 7388 | return cond; |
| 6507 | 7389 | } |
| ... | ... | @@ -6510,9 +7392,8 @@ fn condExpr(p: *Parser) Error!Result { |
| 6510 | 7392 | var else_expr = blk: { |
| 6511 | 7393 | defer p.no_eval = saved_eval; |
| 6512 | 7394 | if (cond.val.opt_ref != .none and cond.val.toBool(p.comp)) p.no_eval = true; |
| 6513 | break :blk try p.condExpr(); | |
| 7395 | break :blk try p.expect(condExpr); | |
| 6514 | 7396 | }; |
| 6515 | try else_expr.expect(p); | |
| 6516 | 7397 | |
| 6517 | 7398 | _ = try then_expr.adjustTypes(colon, &else_expr, p, .conditional); |
| 6518 | 7399 | |
| ... | ... | @@ -6522,27 +7403,28 @@ fn condExpr(p: *Parser) Error!Result { |
| 6522 | 7403 | try then_expr.saveValue(p); |
| 6523 | 7404 | try else_expr.saveValue(p); |
| 6524 | 7405 | } |
| 6525 | cond.ty = then_expr.ty; | |
| 7406 | cond.qt = then_expr.qt; | |
| 6526 | 7407 | cond.node = try p.addNode(.{ |
| 6527 | .tag = .cond_expr, | |
| 6528 | .ty = cond.ty, | |
| 6529 | .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then_expr.node, else_expr.node })).start } }, | |
| 6530 | .loc = @enumFromInt(cond_tok), | |
| 7408 | .cond_expr = .{ | |
| 7409 | .cond_tok = cond_tok, | |
| 7410 | .qt = cond.qt, | |
| 7411 | .cond = cond.node, | |
| 7412 | .then_expr = then_expr.node, | |
| 7413 | .else_expr = else_expr.node, | |
| 7414 | }, | |
| 6531 | 7415 | }); |
| 6532 | 7416 | return cond; |
| 6533 | 7417 | } |
| 6534 | 7418 | |
| 6535 | 7419 | /// lorExpr : landExpr ('||' landExpr)* |
| 6536 | fn lorExpr(p: *Parser) Error!Result { | |
| 6537 | var lhs = try p.landExpr(); | |
| 6538 | if (lhs.empty(p)) return lhs; | |
| 7420 | fn lorExpr(p: *Parser) Error!?Result { | |
| 7421 | var lhs = (try p.landExpr()) orelse return null; | |
| 6539 | 7422 | const saved_eval = p.no_eval; |
| 6540 | 7423 | defer p.no_eval = saved_eval; |
| 6541 | 7424 | |
| 6542 | 7425 | while (p.eatToken(.pipe_pipe)) |tok| { |
| 6543 | 7426 | if (lhs.val.opt_ref != .none and lhs.val.toBool(p.comp)) p.no_eval = true; |
| 6544 | var rhs = try p.landExpr(); | |
| 6545 | try rhs.expect(p); | |
| 7427 | var rhs = try p.expect(landExpr); | |
| 6546 | 7428 | |
| 6547 | 7429 | if (try lhs.adjustTypes(tok, &rhs, p, .boolean_logic)) { |
| 6548 | 7430 | const res = lhs.val.toBool(p.comp) or rhs.val.toBool(p.comp); |
| ... | ... | @@ -6556,16 +7438,14 @@ fn lorExpr(p: *Parser) Error!Result { |
| 6556 | 7438 | } |
| 6557 | 7439 | |
| 6558 | 7440 | /// landExpr : orExpr ('&&' orExpr)* |
| 6559 | fn landExpr(p: *Parser) Error!Result { | |
| 6560 | var lhs = try p.orExpr(); | |
| 6561 | if (lhs.empty(p)) return lhs; | |
| 7441 | fn landExpr(p: *Parser) Error!?Result { | |
| 7442 | var lhs = (try p.orExpr()) orelse return null; | |
| 6562 | 7443 | const saved_eval = p.no_eval; |
| 6563 | 7444 | defer p.no_eval = saved_eval; |
| 6564 | 7445 | |
| 6565 | 7446 | while (p.eatToken(.ampersand_ampersand)) |tok| { |
| 6566 | 7447 | if (lhs.val.opt_ref != .none and !lhs.val.toBool(p.comp)) p.no_eval = true; |
| 6567 | var rhs = try p.orExpr(); | |
| 6568 | try rhs.expect(p); | |
| 7448 | var rhs = try p.expect(orExpr); | |
| 6569 | 7449 | |
| 6570 | 7450 | if (try lhs.adjustTypes(tok, &rhs, p, .boolean_logic)) { |
| 6571 | 7451 | const res = lhs.val.toBool(p.comp) and rhs.val.toBool(p.comp); |
| ... | ... | @@ -6579,12 +7459,10 @@ fn landExpr(p: *Parser) Error!Result { |
| 6579 | 7459 | } |
| 6580 | 7460 | |
| 6581 | 7461 | /// orExpr : xorExpr ('|' xorExpr)* |
| 6582 | fn orExpr(p: *Parser) Error!Result { | |
| 6583 | var lhs = try p.xorExpr(); | |
| 6584 | if (lhs.empty(p)) return lhs; | |
| 7462 | fn orExpr(p: *Parser) Error!?Result { | |
| 7463 | var lhs = (try p.xorExpr()) orelse return null; | |
| 6585 | 7464 | while (p.eatToken(.pipe)) |tok| { |
| 6586 | var rhs = try p.xorExpr(); | |
| 6587 | try rhs.expect(p); | |
| 7465 | var rhs = try p.expect(xorExpr); | |
| 6588 | 7466 | |
| 6589 | 7467 | if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { |
| 6590 | 7468 | lhs.val = try lhs.val.bitOr(rhs.val, p.comp); |
| ... | ... | @@ -6595,12 +7473,10 @@ fn orExpr(p: *Parser) Error!Result { |
| 6595 | 7473 | } |
| 6596 | 7474 | |
| 6597 | 7475 | /// xorExpr : andExpr ('^' andExpr)* |
| 6598 | fn xorExpr(p: *Parser) Error!Result { | |
| 6599 | var lhs = try p.andExpr(); | |
| 6600 | if (lhs.empty(p)) return lhs; | |
| 7476 | fn xorExpr(p: *Parser) Error!?Result { | |
| 7477 | var lhs = (try p.andExpr()) orelse return null; | |
| 6601 | 7478 | while (p.eatToken(.caret)) |tok| { |
| 6602 | var rhs = try p.andExpr(); | |
| 6603 | try rhs.expect(p); | |
| 7479 | var rhs = try p.expect(andExpr); | |
| 6604 | 7480 | |
| 6605 | 7481 | if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { |
| 6606 | 7482 | lhs.val = try lhs.val.bitXor(rhs.val, p.comp); |
| ... | ... | @@ -6611,12 +7487,10 @@ fn xorExpr(p: *Parser) Error!Result { |
| 6611 | 7487 | } |
| 6612 | 7488 | |
| 6613 | 7489 | /// andExpr : eqExpr ('&' eqExpr)* |
| 6614 | fn andExpr(p: *Parser) Error!Result { | |
| 6615 | var lhs = try p.eqExpr(); | |
| 6616 | if (lhs.empty(p)) return lhs; | |
| 7490 | fn andExpr(p: *Parser) Error!?Result { | |
| 7491 | var lhs = (try p.eqExpr()) orelse return null; | |
| 6617 | 7492 | while (p.eatToken(.ampersand)) |tok| { |
| 6618 | var rhs = try p.eqExpr(); | |
| 6619 | try rhs.expect(p); | |
| 7493 | var rhs = try p.expect(eqExpr); | |
| 6620 | 7494 | |
| 6621 | 7495 | if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { |
| 6622 | 7496 | lhs.val = try lhs.val.bitAnd(rhs.val, p.comp); |
| ... | ... | @@ -6627,42 +7501,43 @@ fn andExpr(p: *Parser) Error!Result { |
| 6627 | 7501 | } |
| 6628 | 7502 | |
| 6629 | 7503 | /// eqExpr : compExpr (('==' | '!=') compExpr)* |
| 6630 | fn eqExpr(p: *Parser) Error!Result { | |
| 6631 | var lhs = try p.compExpr(); | |
| 6632 | if (lhs.empty(p)) return lhs; | |
| 7504 | fn eqExpr(p: *Parser) Error!?Result { | |
| 7505 | var lhs = (try p.compExpr()) orelse return null; | |
| 6633 | 7506 | while (true) { |
| 6634 | const eq = p.eatToken(.equal_equal); | |
| 6635 | const ne = eq orelse p.eatToken(.bang_equal); | |
| 6636 | const tag = p.tokToTag(ne orelse break); | |
| 6637 | var rhs = try p.compExpr(); | |
| 6638 | try rhs.expect(p); | |
| 7507 | const tok = p.tok_i; | |
| 7508 | const tag = p.eatTag(.equal_equal) orelse | |
| 7509 | p.eatTag(.bang_equal) orelse break; | |
| 7510 | var rhs = try p.expect(compExpr); | |
| 6639 | 7511 | |
| 6640 | if (try lhs.adjustTypes(ne.?, &rhs, p, .equality)) { | |
| 7512 | if (try lhs.adjustTypes(tok, &rhs, p, .equality)) { | |
| 6641 | 7513 | const op: std.math.CompareOperator = if (tag == .equal_expr) .eq else .neq; |
| 6642 | const res = lhs.val.compare(op, rhs.val, p.comp); | |
| 6643 | lhs.val = Value.fromBool(res); | |
| 7514 | ||
| 7515 | const res: ?bool = if (lhs.qt.isPointer(p.comp) or rhs.qt.isPointer(p.comp)) | |
| 7516 | lhs.val.comparePointers(op, rhs.val, p.comp) | |
| 7517 | else | |
| 7518 | lhs.val.compare(op, rhs.val, p.comp); | |
| 7519 | ||
| 7520 | lhs.val = if (res) |val| Value.fromBool(val) else .{}; | |
| 6644 | 7521 | } else { |
| 6645 | 7522 | lhs.val.boolCast(p.comp); |
| 6646 | 7523 | } |
| 6647 | try lhs.boolRes(p, tag, rhs, ne.?); | |
| 7524 | try lhs.boolRes(p, tag, rhs, tok); | |
| 6648 | 7525 | } |
| 6649 | 7526 | return lhs; |
| 6650 | 7527 | } |
| 6651 | 7528 | |
| 6652 | 7529 | /// compExpr : shiftExpr (('<' | '<=' | '>' | '>=') shiftExpr)* |
| 6653 | fn compExpr(p: *Parser) Error!Result { | |
| 6654 | var lhs = try p.shiftExpr(); | |
| 6655 | if (lhs.empty(p)) return lhs; | |
| 7530 | fn compExpr(p: *Parser) Error!?Result { | |
| 7531 | var lhs = (try p.shiftExpr()) orelse return null; | |
| 6656 | 7532 | while (true) { |
| 6657 | const lt = p.eatToken(.angle_bracket_left); | |
| 6658 | const le = lt orelse p.eatToken(.angle_bracket_left_equal); | |
| 6659 | const gt = le orelse p.eatToken(.angle_bracket_right); | |
| 6660 | const ge = gt orelse p.eatToken(.angle_bracket_right_equal); | |
| 6661 | const tag = p.tokToTag(ge orelse break); | |
| 6662 | var rhs = try p.shiftExpr(); | |
| 6663 | try rhs.expect(p); | |
| 6664 | ||
| 6665 | if (try lhs.adjustTypes(ge.?, &rhs, p, .relational)) { | |
| 7533 | const tok = p.tok_i; | |
| 7534 | const tag = p.eatTag(.angle_bracket_left) orelse | |
| 7535 | p.eatTag(.angle_bracket_left_equal) orelse | |
| 7536 | p.eatTag(.angle_bracket_right) orelse | |
| 7537 | p.eatTag(.angle_bracket_right_equal) orelse break; | |
| 7538 | var rhs = try p.expect(shiftExpr); | |
| 7539 | ||
| 7540 | if (try lhs.adjustTypes(tok, &rhs, p, .relational)) { | |
| 6666 | 7541 | const op: std.math.CompareOperator = switch (tag) { |
| 6667 | 7542 | .less_than_expr => .lt, |
| 6668 | 7543 | .less_than_equal_expr => .lte, |
| ... | ... | @@ -6670,171 +7545,168 @@ fn compExpr(p: *Parser) Error!Result { |
| 6670 | 7545 | .greater_than_equal_expr => .gte, |
| 6671 | 7546 | else => unreachable, |
| 6672 | 7547 | }; |
| 6673 | const res = lhs.val.compare(op, rhs.val, p.comp); | |
| 6674 | lhs.val = Value.fromBool(res); | |
| 7548 | ||
| 7549 | const res: ?bool = if (lhs.qt.isPointer(p.comp) or rhs.qt.isPointer(p.comp)) | |
| 7550 | lhs.val.comparePointers(op, rhs.val, p.comp) | |
| 7551 | else | |
| 7552 | lhs.val.compare(op, rhs.val, p.comp); | |
| 7553 | lhs.val = if (res) |val| Value.fromBool(val) else .{}; | |
| 6675 | 7554 | } else { |
| 6676 | 7555 | lhs.val.boolCast(p.comp); |
| 6677 | 7556 | } |
| 6678 | try lhs.boolRes(p, tag, rhs, ge.?); | |
| 7557 | try lhs.boolRes(p, tag, rhs, tok); | |
| 6679 | 7558 | } |
| 6680 | 7559 | return lhs; |
| 6681 | 7560 | } |
| 6682 | 7561 | |
| 6683 | 7562 | /// shiftExpr : addExpr (('<<' | '>>') addExpr)* |
| 6684 | fn shiftExpr(p: *Parser) Error!Result { | |
| 6685 | var lhs = try p.addExpr(); | |
| 6686 | if (lhs.empty(p)) return lhs; | |
| 7563 | fn shiftExpr(p: *Parser) Error!?Result { | |
| 7564 | var lhs = (try p.addExpr()) orelse return null; | |
| 6687 | 7565 | while (true) { |
| 6688 | const shl = p.eatToken(.angle_bracket_angle_bracket_left); | |
| 6689 | const shr = shl orelse p.eatToken(.angle_bracket_angle_bracket_right); | |
| 6690 | const tag = p.tokToTag(shr orelse break); | |
| 6691 | var rhs = try p.addExpr(); | |
| 6692 | try rhs.expect(p); | |
| 6693 | ||
| 6694 | if (try lhs.adjustTypes(shr.?, &rhs, p, .integer)) { | |
| 6695 | if (rhs.val.compare(.lt, Value.zero, p.comp)) { | |
| 6696 | try p.errStr(.negative_shift_count, shl orelse shr.?, try rhs.str(p)); | |
| 6697 | } | |
| 6698 | if (rhs.val.compare(.gte, try Value.int(lhs.ty.bitSizeof(p.comp).?, p.comp), p.comp)) { | |
| 6699 | try p.errStr(.too_big_shift_count, shl orelse shr.?, try rhs.str(p)); | |
| 6700 | } | |
| 6701 | if (shl != null) { | |
| 6702 | if (try lhs.val.shl(lhs.val, rhs.val, lhs.ty, p.comp) and | |
| 6703 | lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(shl.?, lhs); | |
| 7566 | const tok = p.tok_i; | |
| 7567 | const tag = p.eatTag(.angle_bracket_angle_bracket_left) orelse | |
| 7568 | p.eatTag(.angle_bracket_angle_bracket_right) orelse break; | |
| 7569 | var rhs = try p.expect(addExpr); | |
| 7570 | ||
| 7571 | if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { | |
| 7572 | if (rhs.val.compare(.lt, .zero, p.comp)) { | |
| 7573 | try p.err(tok, .negative_shift_count, .{}); | |
| 7574 | } | |
| 7575 | if (rhs.val.compare(.gte, try Value.int(lhs.qt.bitSizeof(p.comp), p.comp), p.comp)) { | |
| 7576 | try p.err(tok, .too_big_shift_count, .{}); | |
| 7577 | } | |
| 7578 | if (tag == .shl_expr) { | |
| 7579 | if (try lhs.val.shl(lhs.val, rhs.val, lhs.qt, p.comp) and | |
| 7580 | lhs.qt.signedness(p.comp) != .unsigned) try p.err(tok, .overflow, .{lhs}); | |
| 6704 | 7581 | } else { |
| 6705 | lhs.val = try lhs.val.shr(rhs.val, lhs.ty, p.comp); | |
| 7582 | lhs.val = try lhs.val.shr(rhs.val, lhs.qt, p.comp); | |
| 6706 | 7583 | } |
| 6707 | 7584 | } |
| 6708 | try lhs.bin(p, tag, rhs, shr.?); | |
| 7585 | try lhs.bin(p, tag, rhs, tok); | |
| 6709 | 7586 | } |
| 6710 | 7587 | return lhs; |
| 6711 | 7588 | } |
| 6712 | 7589 | |
| 6713 | 7590 | /// addExpr : mulExpr (('+' | '-') mulExpr)* |
| 6714 | fn addExpr(p: *Parser) Error!Result { | |
| 6715 | var lhs = try p.mulExpr(); | |
| 6716 | if (lhs.empty(p)) return lhs; | |
| 7591 | fn addExpr(p: *Parser) Error!?Result { | |
| 7592 | var lhs = (try p.mulExpr()) orelse return null; | |
| 6717 | 7593 | while (true) { |
| 6718 | const plus = p.eatToken(.plus); | |
| 6719 | const minus = plus orelse p.eatToken(.minus); | |
| 6720 | const tag = p.tokToTag(minus orelse break); | |
| 6721 | var rhs = try p.mulExpr(); | |
| 6722 | try rhs.expect(p); | |
| 6723 | ||
| 6724 | const lhs_ty = lhs.ty; | |
| 6725 | if (try lhs.adjustTypes(minus.?, &rhs, p, if (plus != null) .add else .sub)) { | |
| 6726 | if (plus != null) { | |
| 6727 | if (try lhs.val.add(lhs.val, rhs.val, lhs.ty, p.comp) and | |
| 6728 | lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(plus.?, lhs); | |
| 7594 | const tok = p.tok_i; | |
| 7595 | const tag = p.eatTag(.plus) orelse | |
| 7596 | p.eatTag(.minus) orelse break; | |
| 7597 | var rhs = try p.expect(mulExpr); | |
| 7598 | ||
| 7599 | // We'll want to check this for invalid pointer arithmetic. | |
| 7600 | const original_lhs_qt = lhs.qt; | |
| 7601 | ||
| 7602 | if (try lhs.adjustTypes(tok, &rhs, p, if (tag == .add_expr) .add else .sub)) { | |
| 7603 | const lhs_sk = lhs.qt.scalarKind(p.comp); | |
| 7604 | if (tag == .add_expr) { | |
| 7605 | if (try lhs.val.add(lhs.val, rhs.val, lhs.qt, p.comp)) { | |
| 7606 | if (lhs_sk.isPointer()) { | |
| 7607 | const increment = lhs; | |
| 7608 | const ptr_bits = p.comp.type_store.intptr.bitSizeof(p.comp); | |
| 7609 | const element_size = increment.qt.childType(p.comp).sizeofOrNull(p.comp) orelse 1; | |
| 7610 | const max_elems = p.comp.maxArrayBytes() / element_size; | |
| 7611 | ||
| 7612 | try p.err(tok, .array_overflow, .{ increment, ptr_bits, element_size * 8, element_size, max_elems }); | |
| 7613 | } else if (lhs.qt.signedness(p.comp) != .unsigned) { | |
| 7614 | try p.err(tok, .overflow, .{lhs}); | |
| 7615 | } | |
| 7616 | } | |
| 6729 | 7617 | } else { |
| 6730 | if (try lhs.val.sub(lhs.val, rhs.val, lhs.ty, p.comp) and | |
| 6731 | lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(minus.?, lhs); | |
| 7618 | const elem_size = if (original_lhs_qt.isPointer(p.comp)) original_lhs_qt.childType(p.comp).sizeofOrNull(p.comp) orelse 1 else 1; | |
| 7619 | if (elem_size == 0 and rhs.qt.isPointer(p.comp)) { | |
| 7620 | lhs.val = .{}; | |
| 7621 | } else { | |
| 7622 | if (try lhs.val.sub(lhs.val, rhs.val, lhs.qt, elem_size, p.comp) and | |
| 7623 | lhs.qt.signedness(p.comp) != .unsigned) | |
| 7624 | { | |
| 7625 | try p.err(tok, .overflow, .{lhs}); | |
| 7626 | } | |
| 7627 | } | |
| 6732 | 7628 | } |
| 6733 | 7629 | } |
| 6734 | if (lhs.ty.specifier != .invalid and lhs_ty.isPtr() and !lhs_ty.isVoidStar() and lhs_ty.elemType().hasIncompleteSize()) { | |
| 6735 | try p.errStr(.ptr_arithmetic_incomplete, minus.?, try p.typeStr(lhs_ty.elemType())); | |
| 6736 | lhs.ty = Type.invalid; | |
| 7630 | if (!lhs.qt.isInvalid()) { | |
| 7631 | const lhs_sk = original_lhs_qt.scalarKind(p.comp); | |
| 7632 | if (lhs_sk == .pointer and original_lhs_qt.childType(p.comp).hasIncompleteSize(p.comp)) { | |
| 7633 | try p.err(tok, .ptr_arithmetic_incomplete, .{original_lhs_qt.childType(p.comp)}); | |
| 7634 | lhs.qt = .invalid; | |
| 7635 | } | |
| 6737 | 7636 | } |
| 6738 | try lhs.bin(p, tag, rhs, minus.?); | |
| 7637 | try lhs.bin(p, tag, rhs, tok); | |
| 6739 | 7638 | } |
| 6740 | 7639 | return lhs; |
| 6741 | 7640 | } |
| 6742 | 7641 | |
| 6743 | 7642 | /// mulExpr : castExpr (('*' | '/' | '%') castExpr)*´ |
| 6744 | fn mulExpr(p: *Parser) Error!Result { | |
| 6745 | var lhs = try p.castExpr(); | |
| 6746 | if (lhs.empty(p)) return lhs; | |
| 7643 | fn mulExpr(p: *Parser) Error!?Result { | |
| 7644 | var lhs = (try p.castExpr()) orelse return null; | |
| 6747 | 7645 | while (true) { |
| 6748 | const mul = p.eatToken(.asterisk); | |
| 6749 | const div = mul orelse p.eatToken(.slash); | |
| 6750 | const percent = div orelse p.eatToken(.percent); | |
| 6751 | const tag = p.tokToTag(percent orelse break); | |
| 6752 | var rhs = try p.castExpr(); | |
| 6753 | try rhs.expect(p); | |
| 6754 | ||
| 6755 | if (rhs.val.isZero(p.comp) and mul == null and !p.no_eval and lhs.ty.isInt() and rhs.ty.isInt()) { | |
| 6756 | const err_tag: Diagnostics.Tag = if (p.in_macro) .division_by_zero_macro else .division_by_zero; | |
| 7646 | const tok = p.tok_i; | |
| 7647 | const tag = p.eatTag(.asterisk) orelse | |
| 7648 | p.eatTag(.slash) orelse | |
| 7649 | p.eatTag(.percent) orelse break; | |
| 7650 | var rhs = try p.expect(castExpr); | |
| 7651 | ||
| 7652 | 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)) { | |
| 6757 | 7653 | lhs.val = .{}; |
| 6758 | if (div != null) { | |
| 6759 | try p.errStr(err_tag, div.?, "division"); | |
| 6760 | } else { | |
| 6761 | try p.errStr(err_tag, percent.?, "remainder"); | |
| 6762 | } | |
| 7654 | try p.err(tok, if (p.in_macro) .division_by_zero_macro else .division_by_zero, if (tag == .div_expr) .{"division"} else .{"remainder"}); | |
| 6763 | 7655 | if (p.in_macro) return error.ParsingFailed; |
| 6764 | 7656 | } |
| 6765 | 7657 | |
| 6766 | if (try lhs.adjustTypes(percent.?, &rhs, p, if (tag == .mod_expr) .integer else .arithmetic)) { | |
| 6767 | if (mul != null) { | |
| 6768 | if (try lhs.val.mul(lhs.val, rhs.val, lhs.ty, p.comp) and | |
| 6769 | lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(mul.?, lhs); | |
| 6770 | } else if (div != null) { | |
| 6771 | if (try lhs.val.div(lhs.val, rhs.val, lhs.ty, p.comp) and | |
| 6772 | lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(div.?, lhs); | |
| 6773 | } else { | |
| 6774 | var res = try Value.rem(lhs.val, rhs.val, lhs.ty, p.comp); | |
| 6775 | if (res.opt_ref == .none) { | |
| 6776 | if (p.in_macro) { | |
| 6777 | // match clang behavior by defining invalid remainder to be zero in macros | |
| 6778 | res = Value.zero; | |
| 6779 | } else { | |
| 6780 | try lhs.saveValue(p); | |
| 6781 | try rhs.saveValue(p); | |
| 7658 | if (try lhs.adjustTypes(tok, &rhs, p, if (tag == .mod_expr) .integer else .arithmetic)) { | |
| 7659 | switch (tag) { | |
| 7660 | .mul_expr => if (try lhs.val.mul(lhs.val, rhs.val, lhs.qt, p.comp) and | |
| 7661 | lhs.qt.signedness(p.comp) != .unsigned) try p.err(tok, .overflow, .{lhs}), | |
| 7662 | .div_expr => if (try lhs.val.div(lhs.val, rhs.val, lhs.qt, p.comp) and | |
| 7663 | lhs.qt.signedness(p.comp) != .unsigned) try p.err(tok, .overflow, .{lhs}), | |
| 7664 | .mod_expr => { | |
| 7665 | var res = try Value.rem(lhs.val, rhs.val, lhs.qt, p.comp); | |
| 7666 | if (res.opt_ref == .none) { | |
| 7667 | if (p.in_macro) { | |
| 7668 | // match clang behavior by defining invalid remainder to be zero in macros | |
| 7669 | res = .zero; | |
| 7670 | } else { | |
| 7671 | try lhs.saveValue(p); | |
| 7672 | try rhs.saveValue(p); | |
| 7673 | } | |
| 6782 | 7674 | } |
| 6783 | } | |
| 6784 | lhs.val = res; | |
| 7675 | lhs.val = res; | |
| 7676 | }, | |
| 7677 | else => unreachable, | |
| 6785 | 7678 | } |
| 6786 | 7679 | } |
| 6787 | 7680 | |
| 6788 | try lhs.bin(p, tag, rhs, percent.?); | |
| 7681 | try lhs.bin(p, tag, rhs, tok); | |
| 6789 | 7682 | } |
| 6790 | 7683 | return lhs; |
| 6791 | 7684 | } |
| 6792 | 7685 | |
| 6793 | /// This will always be the last message, if present | |
| 6794 | fn removeUnusedWarningForTok(p: *Parser, last_expr_tok: TokenIndex) void { | |
| 6795 | if (last_expr_tok == 0) return; | |
| 6796 | if (p.comp.diagnostics.list.items.len == 0) return; | |
| 6797 | ||
| 6798 | const last_expr_loc = p.pp.tokens.items(.loc)[last_expr_tok]; | |
| 6799 | const last_msg = p.comp.diagnostics.list.items[p.comp.diagnostics.list.items.len - 1]; | |
| 6800 | ||
| 6801 | if (last_msg.tag == .unused_value and last_msg.loc.eql(last_expr_loc)) { | |
| 6802 | p.comp.diagnostics.list.items.len = p.comp.diagnostics.list.items.len - 1; | |
| 6803 | } | |
| 6804 | } | |
| 6805 | ||
| 6806 | 7686 | /// castExpr |
| 6807 | 7687 | /// : '(' compoundStmt ')' suffixExpr* |
| 6808 | 7688 | /// | '(' typeName ')' castExpr |
| 6809 | 7689 | /// | '(' typeName ')' '{' initializerItems '}' |
| 6810 | /// | __builtin_choose_expr '(' integerConstExpr ',' assignExpr ',' assignExpr ')' | |
| 6811 | /// | __builtin_va_arg '(' assignExpr ',' typeName ')' | |
| 6812 | /// | __builtin_offsetof '(' typeName ',' offsetofMemberDesignator ')' | |
| 6813 | /// | __builtin_bitoffsetof '(' typeName ',' offsetofMemberDesignator ')' | |
| 6814 | 7690 | /// | unExpr |
| 6815 | fn castExpr(p: *Parser) Error!Result { | |
| 7691 | fn castExpr(p: *Parser) Error!?Result { | |
| 6816 | 7692 | if (p.eatToken(.l_paren)) |l_paren| cast_expr: { |
| 6817 | 7693 | if (p.tok_ids[p.tok_i] == .l_brace) { |
| 6818 | 7694 | const tok = p.tok_i; |
| 6819 | try p.err(.gnu_statement_expression); | |
| 6820 | if (p.func.ty == null) { | |
| 6821 | try p.err(.stmt_expr_not_allowed_file_scope); | |
| 7695 | try p.err(p.tok_i, .gnu_statement_expression, .{}); | |
| 7696 | if (p.func.qt == null) { | |
| 7697 | try p.err(p.tok_i, .stmt_expr_not_allowed_file_scope, .{}); | |
| 6822 | 7698 | return error.ParsingFailed; |
| 6823 | 7699 | } |
| 6824 | 7700 | var stmt_expr_state: StmtExprState = .{}; |
| 6825 | 7701 | const body_node = (try p.compoundStmt(false, &stmt_expr_state)).?; // compoundStmt only returns null if .l_brace isn't the first token |
| 6826 | p.removeUnusedWarningForTok(stmt_expr_state.last_expr_tok); | |
| 6827 | 7702 | |
| 6828 | var res = Result{ | |
| 7703 | var res: Result = .{ | |
| 6829 | 7704 | .node = body_node, |
| 6830 | .ty = stmt_expr_state.last_expr_res.ty, | |
| 6831 | .val = stmt_expr_state.last_expr_res.val, | |
| 7705 | .qt = stmt_expr_state.last_expr_qt, | |
| 6832 | 7706 | }; |
| 6833 | 7707 | try p.expectClosing(l_paren, .r_paren); |
| 6834 | 7708 | try res.un(p, .stmt_expr, tok); |
| 6835 | while (true) { | |
| 6836 | const suffix = try p.suffixExpr(res); | |
| 6837 | if (suffix.empty(p)) break; | |
| 7709 | while (try p.suffixExpr(res)) |suffix| { | |
| 6838 | 7710 | res = suffix; |
| 6839 | 7711 | } |
| 6840 | 7712 | return res; |
| ... | ... | @@ -6846,242 +7718,415 @@ fn castExpr(p: *Parser) Error!Result { |
| 6846 | 7718 | try p.expectClosing(l_paren, .r_paren); |
| 6847 | 7719 | |
| 6848 | 7720 | if (p.tok_ids[p.tok_i] == .l_brace) { |
| 6849 | // Compound literal; handled in unExpr | |
| 6850 | p.tok_i = l_paren; | |
| 6851 | break :cast_expr; | |
| 7721 | var lhs = (try p.compoundLiteral(ty, l_paren)).?; | |
| 7722 | while (try p.suffixExpr(lhs)) |suffix| { | |
| 7723 | lhs = suffix; | |
| 7724 | } | |
| 7725 | return lhs; | |
| 6852 | 7726 | } |
| 6853 | 7727 | |
| 6854 | 7728 | const operand_tok = p.tok_i; |
| 6855 | var operand = try p.castExpr(); | |
| 6856 | try operand.expect(p); | |
| 6857 | try operand.lvalConversion(p); | |
| 7729 | var operand = try p.expect(castExpr); | |
| 7730 | try operand.lvalConversion(p, operand_tok); | |
| 6858 | 7731 | try operand.castType(p, ty, operand_tok, l_paren); |
| 6859 | 7732 | return operand; |
| 6860 | 7733 | } |
| 6861 | switch (p.tok_ids[p.tok_i]) { | |
| 6862 | .builtin_choose_expr => return p.builtinChooseExpr(), | |
| 6863 | .builtin_va_arg => return p.builtinVaArg(), | |
| 6864 | .builtin_offsetof => return p.builtinOffsetof(false), | |
| 6865 | .builtin_bitoffsetof => return p.builtinOffsetof(true), | |
| 6866 | .builtin_types_compatible_p => return p.typesCompatible(), | |
| 6867 | // TODO: other special-cased builtins | |
| 6868 | else => {}, | |
| 6869 | } | |
| 6870 | 7734 | return p.unExpr(); |
| 6871 | 7735 | } |
| 6872 | 7736 | |
| 6873 | fn typesCompatible(p: *Parser) Error!Result { | |
| 6874 | const builtin_tok = p.tok_i; | |
| 6875 | p.tok_i += 1; | |
| 7737 | /// shufflevector : __builtin_shufflevector '(' assignExpr ',' assignExpr (',' integerConstExpr)* ')' | |
| 7738 | fn shufflevector(p: *Parser, builtin_tok: TokenIndex) Error!Result { | |
| 6876 | 7739 | const l_paren = try p.expectToken(.l_paren); |
| 6877 | 7740 | |
| 6878 | 7741 | const first_tok = p.tok_i; |
| 6879 | const first = (try p.typeName()) orelse { | |
| 6880 | try p.err(.expected_type); | |
| 6881 | p.skipTo(.r_paren); | |
| 6882 | return error.ParsingFailed; | |
| 7742 | const lhs = try p.expect(assignExpr); | |
| 7743 | _ = try p.expectToken(.comma); | |
| 7744 | const second_tok = p.tok_i; | |
| 7745 | const rhs = try p.expect(assignExpr); | |
| 7746 | ||
| 7747 | const max_index: ?Value = blk: { | |
| 7748 | if (lhs.qt.isInvalid() or rhs.qt.isInvalid()) break :blk null; | |
| 7749 | const lhs_vec = lhs.qt.get(p.comp, .vector) orelse break :blk null; | |
| 7750 | const rhs_vec = rhs.qt.get(p.comp, .vector) orelse break :blk null; | |
| 7751 | ||
| 7752 | break :blk try Value.int(lhs_vec.len + rhs_vec.len, p.comp); | |
| 7753 | }; | |
| 7754 | const negative_one = try Value.intern(p.comp, .{ .int = .{ .i64 = -1 } }); | |
| 7755 | ||
| 7756 | const gpa = p.comp.gpa; | |
| 7757 | const list_buf_top = p.list_buf.items.len; | |
| 7758 | defer p.list_buf.items.len = list_buf_top; | |
| 7759 | while (p.eatToken(.comma)) |_| { | |
| 7760 | const index_tok = p.tok_i; | |
| 7761 | const index = try p.integerConstExpr(.gnu_folding_extension); | |
| 7762 | try p.list_buf.append(gpa, index.node); | |
| 7763 | if (index.val.compare(.lt, negative_one, p.comp)) { | |
| 7764 | try p.err(index_tok, .shufflevector_negative_index, .{}); | |
| 7765 | } else if (max_index != null and index.val.compare(.gte, max_index.?, p.comp)) { | |
| 7766 | try p.err(index_tok, .shufflevector_index_too_big, .{}); | |
| 7767 | } | |
| 7768 | } | |
| 7769 | ||
| 7770 | try p.expectClosing(l_paren, .r_paren); | |
| 7771 | ||
| 7772 | var res_qt: QualType = .invalid; | |
| 7773 | if (!lhs.qt.isInvalid() and !lhs.qt.is(p.comp, .vector)) { | |
| 7774 | try p.err(first_tok, .shufflevector_arg, .{"first"}); | |
| 7775 | } else if (!rhs.qt.isInvalid() and !rhs.qt.is(p.comp, .vector)) { | |
| 7776 | try p.err(second_tok, .shufflevector_arg, .{"second"}); | |
| 7777 | } else if (!lhs.qt.eql(rhs.qt, p.comp)) { | |
| 7778 | try p.err(builtin_tok, .shufflevector_same_type, .{}); | |
| 7779 | } else if (p.list_buf.items.len == list_buf_top) { | |
| 7780 | res_qt = lhs.qt; | |
| 7781 | } else { | |
| 7782 | res_qt = try p.comp.type_store.put(gpa, .{ .vector = .{ | |
| 7783 | .elem = lhs.qt.childType(p.comp), | |
| 7784 | .len = @intCast(p.list_buf.items.len - list_buf_top), | |
| 7785 | } }); | |
| 7786 | } | |
| 7787 | ||
| 7788 | return .{ | |
| 7789 | .qt = res_qt, | |
| 7790 | .node = try p.addNode(.{ | |
| 7791 | .builtin_shufflevector = .{ | |
| 7792 | .builtin_tok = builtin_tok, | |
| 7793 | .qt = res_qt, | |
| 7794 | .lhs = lhs.node, | |
| 7795 | .rhs = rhs.node, | |
| 7796 | .indexes = p.list_buf.items[list_buf_top..], | |
| 7797 | }, | |
| 7798 | }), | |
| 6883 | 7799 | }; |
| 6884 | const lhs = try p.addNode(.{ .tag = .invalid, .ty = first, .data = undefined, .loc = @enumFromInt(first_tok) }); | |
| 7800 | } | |
| 7801 | ||
| 7802 | /// convertvector : __builtin_convertvector '(' assignExpr ',' typeName ')' | |
| 7803 | fn convertvector(p: *Parser, builtin_tok: TokenIndex) Error!Result { | |
| 7804 | const l_paren = try p.expectToken(.l_paren); | |
| 7805 | ||
| 7806 | const operand = try p.expect(assignExpr); | |
| 6885 | 7807 | _ = try p.expectToken(.comma); |
| 6886 | 7808 | |
| 6887 | const second_tok = p.tok_i; | |
| 6888 | const second = (try p.typeName()) orelse { | |
| 6889 | try p.err(.expected_type); | |
| 7809 | var dest_qt = (try p.typeName()) orelse { | |
| 7810 | try p.err(p.tok_i, .expected_type, .{}); | |
| 6890 | 7811 | p.skipTo(.r_paren); |
| 6891 | 7812 | return error.ParsingFailed; |
| 6892 | 7813 | }; |
| 6893 | const rhs = try p.addNode(.{ .tag = .invalid, .ty = second, .data = undefined, .loc = @enumFromInt(second_tok) }); | |
| 6894 | 7814 | |
| 6895 | 7815 | try p.expectClosing(l_paren, .r_paren); |
| 6896 | 7816 | |
| 6897 | var first_unqual = first.canonicalize(.standard); | |
| 6898 | first_unqual.qual.@"const" = false; | |
| 6899 | first_unqual.qual.@"volatile" = false; | |
| 6900 | var second_unqual = second.canonicalize(.standard); | |
| 6901 | second_unqual.qual.@"const" = false; | |
| 6902 | second_unqual.qual.@"volatile" = false; | |
| 7817 | if (operand.qt.isInvalid() or operand.qt.isInvalid()) { | |
| 7818 | dest_qt = .invalid; | |
| 7819 | } else check: { | |
| 7820 | const operand_vec = operand.qt.get(p.comp, .vector) orelse { | |
| 7821 | try p.err(builtin_tok, .convertvector_arg, .{"first"}); | |
| 7822 | dest_qt = .invalid; | |
| 7823 | break :check; | |
| 7824 | }; | |
| 7825 | const dest_vec = dest_qt.get(p.comp, .vector) orelse { | |
| 7826 | try p.err(builtin_tok, .convertvector_arg, .{"second"}); | |
| 7827 | dest_qt = .invalid; | |
| 7828 | break :check; | |
| 7829 | }; | |
| 7830 | if (operand_vec.len != dest_vec.len) { | |
| 7831 | try p.err(builtin_tok, .convertvector_size, .{}); | |
| 7832 | dest_qt = .invalid; | |
| 7833 | } | |
| 7834 | } | |
| 7835 | ||
| 7836 | return .{ | |
| 7837 | .qt = dest_qt, | |
| 7838 | .node = try p.addNode(.{ | |
| 7839 | .builtin_convertvector = .{ | |
| 7840 | .builtin_tok = builtin_tok, | |
| 7841 | .dest_qt = dest_qt, | |
| 7842 | .operand = operand.node, | |
| 7843 | }, | |
| 7844 | }), | |
| 7845 | }; | |
| 7846 | } | |
| 7847 | ||
| 7848 | /// typesCompatible : __builtin_types_compatible_p '(' typeName ',' typeName ')' | |
| 7849 | fn typesCompatible(p: *Parser, builtin_tok: TokenIndex) Error!Result { | |
| 7850 | const l_paren = try p.expectToken(.l_paren); | |
| 7851 | ||
| 7852 | const lhs = (try p.typeName()) orelse { | |
| 7853 | try p.err(p.tok_i, .expected_type, .{}); | |
| 7854 | p.skipTo(.r_paren); | |
| 7855 | return error.ParsingFailed; | |
| 7856 | }; | |
| 7857 | _ = try p.expectToken(.comma); | |
| 7858 | ||
| 7859 | const rhs = (try p.typeName()) orelse { | |
| 7860 | try p.err(p.tok_i, .expected_type, .{}); | |
| 7861 | p.skipTo(.r_paren); | |
| 7862 | return error.ParsingFailed; | |
| 7863 | }; | |
| 6903 | 7864 | |
| 6904 | const compatible = first_unqual.eql(second_unqual, p.comp, true); | |
| 7865 | try p.expectClosing(l_paren, .r_paren); | |
| 6905 | 7866 | |
| 6906 | const res = Result{ | |
| 7867 | const compatible = lhs.eql(rhs, p.comp); | |
| 7868 | const res: Result = .{ | |
| 6907 | 7869 | .val = Value.fromBool(compatible), |
| 7870 | .qt = .int, | |
| 6908 | 7871 | .node = try p.addNode(.{ |
| 6909 | .tag = .builtin_types_compatible_p, | |
| 6910 | .ty = Type.int, | |
| 6911 | .data = .{ .bin = .{ | |
| 7872 | .builtin_types_compatible_p = .{ | |
| 7873 | .builtin_tok = builtin_tok, | |
| 6912 | 7874 | .lhs = lhs, |
| 6913 | 7875 | .rhs = rhs, |
| 6914 | } }, | |
| 6915 | .loc = @enumFromInt(builtin_tok), | |
| 7876 | }, | |
| 6916 | 7877 | }), |
| 6917 | 7878 | }; |
| 6918 | try p.value_map.put(res.node, res.val); | |
| 7879 | try res.putValue(p); | |
| 6919 | 7880 | return res; |
| 6920 | 7881 | } |
| 6921 | 7882 | |
| 7883 | /// chooseExpr : __builtin_choose_expr '(' integerConstExpr ',' assignExpr ',' assignExpr ')' | |
| 6922 | 7884 | fn builtinChooseExpr(p: *Parser) Error!Result { |
| 6923 | p.tok_i += 1; | |
| 6924 | 7885 | const l_paren = try p.expectToken(.l_paren); |
| 6925 | 7886 | const cond_tok = p.tok_i; |
| 6926 | 7887 | var cond = try p.integerConstExpr(.no_const_decl_folding); |
| 6927 | 7888 | if (cond.val.opt_ref == .none) { |
| 6928 | try p.errTok(.builtin_choose_cond, cond_tok); | |
| 7889 | try p.err(cond_tok, .builtin_choose_cond, .{}); | |
| 6929 | 7890 | return error.ParsingFailed; |
| 6930 | 7891 | } |
| 6931 | 7892 | |
| 6932 | 7893 | _ = try p.expectToken(.comma); |
| 6933 | 7894 | |
| 6934 | var then_expr = if (cond.val.toBool(p.comp)) try p.assignExpr() else try p.parseNoEval(assignExpr); | |
| 6935 | try then_expr.expect(p); | |
| 7895 | const then_expr = if (cond.val.toBool(p.comp)) | |
| 7896 | try p.expect(assignExpr) | |
| 7897 | else | |
| 7898 | try p.parseNoEval(assignExpr); | |
| 6936 | 7899 | |
| 6937 | 7900 | _ = try p.expectToken(.comma); |
| 6938 | 7901 | |
| 6939 | var else_expr = if (!cond.val.toBool(p.comp)) try p.assignExpr() else try p.parseNoEval(assignExpr); | |
| 6940 | try else_expr.expect(p); | |
| 7902 | const else_expr = if (!cond.val.toBool(p.comp)) | |
| 7903 | try p.expect(assignExpr) | |
| 7904 | else | |
| 7905 | try p.parseNoEval(assignExpr); | |
| 6941 | 7906 | |
| 6942 | 7907 | try p.expectClosing(l_paren, .r_paren); |
| 6943 | 7908 | |
| 6944 | 7909 | if (cond.val.toBool(p.comp)) { |
| 6945 | 7910 | cond.val = then_expr.val; |
| 6946 | cond.ty = then_expr.ty; | |
| 7911 | cond.qt = then_expr.qt; | |
| 6947 | 7912 | } else { |
| 6948 | 7913 | cond.val = else_expr.val; |
| 6949 | cond.ty = else_expr.ty; | |
| 7914 | cond.qt = else_expr.qt; | |
| 6950 | 7915 | } |
| 6951 | 7916 | cond.node = try p.addNode(.{ |
| 6952 | .tag = .builtin_choose_expr, | |
| 6953 | .ty = cond.ty, | |
| 6954 | .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then_expr.node, else_expr.node })).start } }, | |
| 7917 | .builtin_choose_expr = .{ | |
| 7918 | .cond_tok = cond_tok, | |
| 7919 | .qt = cond.qt, | |
| 7920 | .cond = cond.node, | |
| 7921 | .then_expr = then_expr.node, | |
| 7922 | .else_expr = else_expr.node, | |
| 7923 | }, | |
| 6955 | 7924 | }); |
| 6956 | 7925 | return cond; |
| 6957 | 7926 | } |
| 6958 | 7927 | |
| 6959 | fn builtinVaArg(p: *Parser) Error!Result { | |
| 6960 | const builtin_tok = p.tok_i; | |
| 6961 | p.tok_i += 1; | |
| 6962 | ||
| 7928 | /// vaStart : __builtin_va_arg '(' assignExpr ',' typeName ')' | |
| 7929 | fn builtinVaArg(p: *Parser, builtin_tok: TokenIndex) Error!Result { | |
| 6963 | 7930 | const l_paren = try p.expectToken(.l_paren); |
| 6964 | 7931 | const va_list_tok = p.tok_i; |
| 6965 | var va_list = try p.assignExpr(); | |
| 6966 | try va_list.expect(p); | |
| 6967 | try va_list.lvalConversion(p); | |
| 7932 | var va_list = try p.expect(assignExpr); | |
| 7933 | try va_list.lvalConversion(p, va_list_tok); | |
| 6968 | 7934 | |
| 6969 | 7935 | _ = try p.expectToken(.comma); |
| 6970 | 7936 | |
| 6971 | 7937 | const ty = (try p.typeName()) orelse { |
| 6972 | try p.err(.expected_type); | |
| 7938 | try p.err(p.tok_i, .expected_type, .{}); | |
| 6973 | 7939 | return error.ParsingFailed; |
| 6974 | 7940 | }; |
| 6975 | 7941 | try p.expectClosing(l_paren, .r_paren); |
| 6976 | 7942 | |
| 6977 | if (!va_list.ty.eql(p.comp.types.va_list, p.comp, true)) { | |
| 6978 | try p.errStr(.incompatible_va_arg, va_list_tok, try p.typeStr(va_list.ty)); | |
| 7943 | if (!va_list.qt.eql(p.comp.type_store.va_list, p.comp)) { | |
| 7944 | try p.err(va_list_tok, .incompatible_va_arg, .{va_list.qt}); | |
| 6979 | 7945 | return error.ParsingFailed; |
| 6980 | 7946 | } |
| 6981 | 7947 | |
| 6982 | return Result{ .ty = ty, .node = try p.addNode(.{ | |
| 6983 | .tag = .special_builtin_call_one, | |
| 6984 | .ty = ty, | |
| 6985 | .data = .{ .decl = .{ .name = builtin_tok, .node = va_list.node } }, | |
| 6986 | }) }; | |
| 7948 | return .{ | |
| 7949 | .qt = ty, | |
| 7950 | .node = try p.addNode(.{ | |
| 7951 | .builtin_call_expr = .{ | |
| 7952 | .builtin_tok = builtin_tok, | |
| 7953 | .qt = ty, | |
| 7954 | .args = &.{va_list.node}, | |
| 7955 | }, | |
| 7956 | }), | |
| 7957 | }; | |
| 6987 | 7958 | } |
| 6988 | 7959 | |
| 6989 | fn builtinOffsetof(p: *Parser, want_bits: bool) Error!Result { | |
| 6990 | const builtin_tok = p.tok_i; | |
| 6991 | p.tok_i += 1; | |
| 7960 | const OffsetKind = enum { bits, bytes }; | |
| 6992 | 7961 | |
| 7962 | /// offsetof | |
| 7963 | /// : __builtin_offsetof '(' typeName ',' offsetofMemberDesignator ')' | |
| 7964 | /// | __builtin_bitoffsetof '(' typeName ',' offsetofMemberDesignator ')' | |
| 7965 | fn builtinOffsetof(p: *Parser, builtin_tok: TokenIndex, offset_kind: OffsetKind) Error!Result { | |
| 6993 | 7966 | const l_paren = try p.expectToken(.l_paren); |
| 6994 | 7967 | const ty_tok = p.tok_i; |
| 6995 | 7968 | |
| 6996 | const ty = (try p.typeName()) orelse { | |
| 6997 | try p.err(.expected_type); | |
| 7969 | const operand_qt = (try p.typeName()) orelse { | |
| 7970 | try p.err(p.tok_i, .expected_type, .{}); | |
| 6998 | 7971 | p.skipTo(.r_paren); |
| 6999 | 7972 | return error.ParsingFailed; |
| 7000 | 7973 | }; |
| 7001 | 7974 | |
| 7002 | if (!ty.isRecord()) { | |
| 7003 | try p.errStr(.offsetof_ty, ty_tok, try p.typeStr(ty)); | |
| 7975 | const record_ty = operand_qt.getRecord(p.comp) orelse { | |
| 7976 | try p.err(ty_tok, .offsetof_ty, .{operand_qt}); | |
| 7004 | 7977 | p.skipTo(.r_paren); |
| 7005 | 7978 | return error.ParsingFailed; |
| 7006 | } else if (ty.hasIncompleteSize()) { | |
| 7007 | try p.errStr(.offsetof_incomplete, ty_tok, try p.typeStr(ty)); | |
| 7979 | }; | |
| 7980 | ||
| 7981 | if (record_ty.layout == null) { | |
| 7982 | try p.err(ty_tok, .offsetof_incomplete, .{operand_qt}); | |
| 7008 | 7983 | p.skipTo(.r_paren); |
| 7009 | 7984 | return error.ParsingFailed; |
| 7010 | 7985 | } |
| 7011 | 7986 | |
| 7012 | 7987 | _ = try p.expectToken(.comma); |
| 7013 | 7988 | |
| 7014 | const offsetof_expr = try p.offsetofMemberDesignator(ty, want_bits); | |
| 7989 | const offsetof_expr = try p.offsetofMemberDesignator(record_ty, operand_qt, offset_kind, builtin_tok); | |
| 7015 | 7990 | |
| 7016 | 7991 | try p.expectClosing(l_paren, .r_paren); |
| 7017 | 7992 | |
| 7018 | return Result{ | |
| 7019 | .ty = p.comp.types.size, | |
| 7993 | const res: Result = .{ | |
| 7994 | .qt = p.comp.type_store.size, | |
| 7020 | 7995 | .val = offsetof_expr.val, |
| 7021 | 7996 | .node = try p.addNode(.{ |
| 7022 | .tag = .special_builtin_call_one, | |
| 7023 | .ty = p.comp.types.size, | |
| 7024 | .data = .{ .decl = .{ .name = builtin_tok, .node = offsetof_expr.node } }, | |
| 7997 | .builtin_call_expr = .{ | |
| 7998 | .builtin_tok = builtin_tok, | |
| 7999 | .qt = p.comp.type_store.size, | |
| 8000 | .args = &.{offsetof_expr.node}, | |
| 8001 | }, | |
| 7025 | 8002 | }), |
| 7026 | 8003 | }; |
| 8004 | try res.putValue(p); | |
| 8005 | return res; | |
| 7027 | 8006 | } |
| 7028 | 8007 | |
| 7029 | /// offsetofMemberDesignator: IDENTIFIER ('.' IDENTIFIER | '[' expr ']' )* | |
| 7030 | fn offsetofMemberDesignator(p: *Parser, base_ty: Type, want_bits: bool) Error!Result { | |
| 8008 | /// offsetofMemberDesignator : IDENTIFIER ('.' IDENTIFIER | '[' expr ']' )* | |
| 8009 | fn offsetofMemberDesignator( | |
| 8010 | p: *Parser, | |
| 8011 | base_record_ty: Type.Record, | |
| 8012 | base_qt: QualType, | |
| 8013 | offset_kind: OffsetKind, | |
| 8014 | access_tok: TokenIndex, | |
| 8015 | ) Error!Result { | |
| 7031 | 8016 | errdefer p.skipTo(.r_paren); |
| 7032 | 8017 | const base_field_name_tok = try p.expectIdentifier(); |
| 7033 | const base_field_name = try StrInt.intern(p.comp, p.tokSlice(base_field_name_tok)); | |
| 7034 | const base_record_ty = base_ty.getRecord().?; | |
| 7035 | try p.validateFieldAccess(base_record_ty, base_ty, base_field_name_tok, base_field_name); | |
| 7036 | const base_node = try p.addNode(.{ .tag = .default_init_expr, .ty = base_ty, .data = undefined }); | |
| 8018 | const base_field_name = try p.comp.internString(p.tokSlice(base_field_name_tok)); | |
| 8019 | ||
| 8020 | try p.validateFieldAccess(base_record_ty, base_qt, base_field_name_tok, base_field_name); | |
| 8021 | const base_node = try p.addNode(.{ .default_init_expr = .{ | |
| 8022 | .last_tok = p.tok_i, | |
| 8023 | .qt = base_qt, | |
| 8024 | } }); | |
| 7037 | 8025 | |
| 7038 | 8026 | var cur_offset: u64 = 0; |
| 7039 | var lhs = try p.fieldAccessExtra(base_node, base_record_ty, base_field_name, false, &cur_offset); | |
| 8027 | var lhs = try p.fieldAccessExtra(base_node, base_record_ty, base_field_name, false, access_tok, &cur_offset); | |
| 7040 | 8028 | |
| 7041 | var total_offset = cur_offset; | |
| 8029 | var total_offset: i64 = @intCast(cur_offset); | |
| 8030 | var runtime_offset = false; | |
| 7042 | 8031 | while (true) switch (p.tok_ids[p.tok_i]) { |
| 7043 | 8032 | .period => { |
| 7044 | 8033 | p.tok_i += 1; |
| 7045 | 8034 | const field_name_tok = try p.expectIdentifier(); |
| 7046 | const field_name = try StrInt.intern(p.comp, p.tokSlice(field_name_tok)); | |
| 8035 | const field_name = try p.comp.internString(p.tokSlice(field_name_tok)); | |
| 7047 | 8036 | |
| 7048 | const lhs_record_ty = lhs.ty.getRecord() orelse { | |
| 7049 | try p.errStr(.offsetof_ty, field_name_tok, try p.typeStr(lhs.ty)); | |
| 8037 | const lhs_record_ty = lhs.qt.getRecord(p.comp) orelse { | |
| 8038 | try p.err(field_name_tok, .offsetof_ty, .{lhs.qt}); | |
| 7050 | 8039 | return error.ParsingFailed; |
| 7051 | 8040 | }; |
| 7052 | try p.validateFieldAccess(lhs_record_ty, lhs.ty, field_name_tok, field_name); | |
| 7053 | lhs = try p.fieldAccessExtra(lhs.node, lhs_record_ty, field_name, false, &cur_offset); | |
| 7054 | total_offset += cur_offset; | |
| 8041 | try p.validateFieldAccess(lhs_record_ty, lhs.qt, field_name_tok, field_name); | |
| 8042 | lhs = try p.fieldAccessExtra(lhs.node, lhs_record_ty, field_name, false, access_tok, &cur_offset); | |
| 8043 | total_offset += @intCast(cur_offset); | |
| 7055 | 8044 | }, |
| 7056 | 8045 | .l_bracket => { |
| 7057 | 8046 | const l_bracket_tok = p.tok_i; |
| 7058 | 8047 | p.tok_i += 1; |
| 7059 | var index = try p.expr(); | |
| 7060 | try index.expect(p); | |
| 8048 | var index = try p.expect(expr); | |
| 7061 | 8049 | _ = try p.expectClosing(l_bracket_tok, .r_bracket); |
| 7062 | 8050 | |
| 7063 | if (!lhs.ty.isArray()) { | |
| 7064 | try p.errStr(.offsetof_array, l_bracket_tok, try p.typeStr(lhs.ty)); | |
| 8051 | const array_ty = lhs.qt.get(p.comp, .array) orelse { | |
| 8052 | try p.err(l_bracket_tok, .offsetof_array, .{lhs.qt}); | |
| 7065 | 8053 | return error.ParsingFailed; |
| 7066 | } | |
| 8054 | }; | |
| 7067 | 8055 | var ptr = lhs; |
| 7068 | try ptr.lvalConversion(p); | |
| 7069 | try index.lvalConversion(p); | |
| 8056 | try ptr.lvalConversion(p, l_bracket_tok); | |
| 8057 | try index.lvalConversion(p, l_bracket_tok); | |
| 7070 | 8058 | |
| 7071 | if (index.ty.isInt()) { | |
| 8059 | if (!index.qt.isInvalid() and index.qt.isRealInt(p.comp)) { | |
| 7072 | 8060 | try p.checkArrayBounds(index, lhs, l_bracket_tok); |
| 8061 | } else if (!index.qt.isInvalid()) { | |
| 8062 | try p.err(l_bracket_tok, .invalid_index, .{}); | |
| 8063 | } | |
| 8064 | ||
| 8065 | if (index.val.toInt(i64, p.comp)) |index_int| { | |
| 8066 | total_offset += @as(i64, @intCast(array_ty.elem.bitSizeof(p.comp))) * index_int; | |
| 7073 | 8067 | } else { |
| 7074 | try p.errTok(.invalid_index, l_bracket_tok); | |
| 8068 | runtime_offset = true; | |
| 7075 | 8069 | } |
| 7076 | 8070 | |
| 7077 | 8071 | try index.saveValue(p); |
| 7078 | try ptr.bin(p, .array_access_expr, index, l_bracket_tok); | |
| 8072 | ptr.node = try p.addNode(.{ .array_access_expr = .{ | |
| 8073 | .l_bracket_tok = l_bracket_tok, | |
| 8074 | .base = ptr.node, | |
| 8075 | .index = index.node, | |
| 8076 | .qt = ptr.qt, | |
| 8077 | } }); | |
| 7079 | 8078 | lhs = ptr; |
| 7080 | 8079 | }, |
| 7081 | 8080 | else => break, |
| 7082 | 8081 | }; |
| 7083 | const val = try Value.int(if (want_bits) total_offset else total_offset / 8, p.comp); | |
| 7084 | return Result{ .ty = base_ty, .val = val, .node = lhs.node }; | |
| 8082 | return .{ | |
| 8083 | .qt = base_qt, | |
| 8084 | .val = if (runtime_offset) | |
| 8085 | .{} | |
| 8086 | else | |
| 8087 | try Value.int(if (offset_kind == .bits) total_offset else @divExact(total_offset, 8), p.comp), | |
| 8088 | .node = lhs.node, | |
| 8089 | }; | |
| 8090 | } | |
| 8091 | ||
| 8092 | fn computeOffsetExtra(p: *Parser, node: Node.Index, offset_so_far: *Value) !Value { | |
| 8093 | switch (node.get(&p.tree)) { | |
| 8094 | .cast => |cast| { | |
| 8095 | return switch (cast.kind) { | |
| 8096 | .array_to_pointer, .no_op, .bitcast => p.computeOffsetExtra(cast.operand, offset_so_far), | |
| 8097 | .lval_to_rval => .{}, | |
| 8098 | else => unreachable, | |
| 8099 | }; | |
| 8100 | }, | |
| 8101 | .paren_expr => |un| return p.computeOffsetExtra(un.operand, offset_so_far), | |
| 8102 | .decl_ref_expr => return p.pointerValue(node, offset_so_far.*), | |
| 8103 | .array_access_expr => |access| { | |
| 8104 | const index_val = p.tree.value_map.get(access.index) orelse return .{}; | |
| 8105 | var size = try Value.int(access.qt.sizeof(p.comp), p.comp); | |
| 8106 | const mul_overflow = try size.mul(size, index_val, p.comp.type_store.ptrdiff, p.comp); | |
| 8107 | ||
| 8108 | const add_overflow = try offset_so_far.add(size, offset_so_far.*, p.comp.type_store.ptrdiff, p.comp); | |
| 8109 | _ = mul_overflow; | |
| 8110 | _ = add_overflow; | |
| 8111 | return p.computeOffsetExtra(access.base, offset_so_far); | |
| 8112 | }, | |
| 8113 | .member_access_expr, .member_access_ptr_expr => |access| { | |
| 8114 | var ty = access.base.qt(&p.tree); | |
| 8115 | if (ty.isPointer(p.comp)) ty = ty.childType(p.comp); | |
| 8116 | const record_ty = ty.getRecord(p.comp).?; | |
| 8117 | ||
| 8118 | const field_offset = try Value.int(@divExact(record_ty.fields[access.member_index].layout.offset_bits, 8), p.comp); | |
| 8119 | _ = try offset_so_far.add(field_offset, offset_so_far.*, p.comp.type_store.ptrdiff, p.comp); | |
| 8120 | return p.computeOffsetExtra(access.base, offset_so_far); | |
| 8121 | }, | |
| 8122 | else => return .{}, | |
| 8123 | } | |
| 8124 | } | |
| 8125 | ||
| 8126 | /// Compute the offset (in bytes) of an expression from a base pointer. | |
| 8127 | fn computeOffset(p: *Parser, res: Result) !Value { | |
| 8128 | var val: Value = if (res.val.opt_ref == .none) .zero else res.val; | |
| 8129 | return p.computeOffsetExtra(res.node, &val); | |
| 7085 | 8130 | } |
| 7086 | 8131 | |
| 7087 | 8132 | /// unExpr |
| ... | ... | @@ -7092,92 +8137,115 @@ fn offsetofMemberDesignator(p: *Parser, base_ty: Type, want_bits: bool) Error!Re |
| 7092 | 8137 | /// | keyword_sizeof '(' typeName ')' |
| 7093 | 8138 | /// | keyword_alignof '(' typeName ')' |
| 7094 | 8139 | /// | keyword_c23_alignof '(' typeName ')' |
| 7095 | fn unExpr(p: *Parser) Error!Result { | |
| 8140 | fn unExpr(p: *Parser) Error!?Result { | |
| 8141 | const gpa = p.comp.gpa; | |
| 7096 | 8142 | const tok = p.tok_i; |
| 7097 | 8143 | switch (p.tok_ids[tok]) { |
| 7098 | 8144 | .ampersand_ampersand => { |
| 7099 | 8145 | const address_tok = p.tok_i; |
| 7100 | 8146 | p.tok_i += 1; |
| 7101 | 8147 | const name_tok = try p.expectIdentifier(); |
| 7102 | try p.errTok(.gnu_label_as_value, address_tok); | |
| 8148 | try p.err(address_tok, .gnu_label_as_value, .{}); | |
| 7103 | 8149 | p.contains_address_of_label = true; |
| 7104 | 8150 | |
| 7105 | 8151 | const str = p.tokSlice(name_tok); |
| 7106 | 8152 | if (p.findLabel(str) == null) { |
| 7107 | try p.labels.append(.{ .unresolved_goto = name_tok }); | |
| 8153 | try p.labels.append(gpa, .{ .unresolved_goto = name_tok }); | |
| 7108 | 8154 | } |
| 7109 | const elem_ty = try p.arena.create(Type); | |
| 7110 | elem_ty.* = .{ .specifier = .void }; | |
| 7111 | const result_ty = Type{ .specifier = .pointer, .data = .{ .sub_type = elem_ty } }; | |
| 7112 | return Result{ | |
| 8155 | ||
| 8156 | return .{ | |
| 7113 | 8157 | .node = try p.addNode(.{ |
| 7114 | .tag = .addr_of_label, | |
| 7115 | .data = .{ .decl_ref = name_tok }, | |
| 7116 | .ty = result_ty, | |
| 7117 | .loc = @enumFromInt(address_tok), | |
| 8158 | .addr_of_label = .{ | |
| 8159 | .label_tok = name_tok, | |
| 8160 | .qt = .void_pointer, | |
| 8161 | }, | |
| 7118 | 8162 | }), |
| 7119 | .ty = result_ty, | |
| 8163 | .qt = .void_pointer, | |
| 7120 | 8164 | }; |
| 7121 | 8165 | }, |
| 7122 | 8166 | .ampersand => { |
| 7123 | 8167 | if (p.in_macro) { |
| 7124 | try p.err(.invalid_preproc_operator); | |
| 8168 | try p.err(p.tok_i, .invalid_preproc_operator, .{}); | |
| 7125 | 8169 | return error.ParsingFailed; |
| 7126 | 8170 | } |
| 8171 | const orig_tok_i = p.tok_i; | |
| 7127 | 8172 | p.tok_i += 1; |
| 7128 | var operand = try p.castExpr(); | |
| 7129 | try operand.expect(p); | |
| 8173 | var operand = try p.expect(castExpr); | |
| 8174 | var addr_val: Value = .{}; | |
| 7130 | 8175 | |
| 7131 | const tree = p.tmpTree(); | |
| 7132 | 8176 | if (p.getNode(operand.node, .member_access_expr) orelse |
| 7133 | p.getNode(operand.node, .member_access_ptr_expr)) |member_node| | |
| 8177 | p.getNode(operand.node, .member_access_ptr_expr)) |access| | |
| 7134 | 8178 | { |
| 7135 | if (tree.isBitfield(member_node)) try p.errTok(.addr_of_bitfield, tok); | |
| 8179 | if (access.isBitFieldWidth(&p.tree) != null) try p.err(tok, .addr_of_bitfield, .{}); | |
| 8180 | const lhs_qt = access.base.qt(&p.tree); | |
| 8181 | if (lhs_qt.hasAttribute(p.comp, .@"packed")) { | |
| 8182 | const record_ty = lhs_qt.getRecord(p.comp).?; | |
| 8183 | try p.err(orig_tok_i, .packed_member_address, .{ | |
| 8184 | record_ty.fields[access.member_index].name.lookup(p.comp), | |
| 8185 | record_ty.name.lookup(p.comp), | |
| 8186 | }); | |
| 8187 | } | |
| 8188 | } | |
| 8189 | if (!operand.qt.isInvalid()) { | |
| 8190 | if (!p.tree.isLval(operand.node)) { | |
| 8191 | try p.err(tok, .addr_of_rvalue, .{}); | |
| 8192 | } | |
| 8193 | addr_val = try p.computeOffset(operand); | |
| 8194 | ||
| 8195 | operand.qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ | |
| 8196 | .child = operand.qt, | |
| 8197 | .decayed = null, | |
| 8198 | } }); | |
| 7136 | 8199 | } |
| 7137 | if (!tree.isLval(operand.node) and !operand.ty.is(.invalid)) { | |
| 7138 | try p.errTok(.addr_of_rvalue, tok); | |
| 8200 | if (p.getNode(operand.node, .decl_ref_expr)) |decl_ref| { | |
| 8201 | switch (decl_ref.decl.get(&p.tree)) { | |
| 8202 | .variable => |variable| { | |
| 8203 | if (variable.storage_class == .register) try p.err(tok, .addr_of_register, .{}); | |
| 8204 | }, | |
| 8205 | else => {}, | |
| 8206 | } | |
| 8207 | } else if (p.getNode(operand.node, .compound_literal_expr)) |literal| { | |
| 8208 | switch (literal.storage_class) { | |
| 8209 | .register => try p.err(tok, .addr_of_register, .{}), | |
| 8210 | else => {}, | |
| 8211 | } | |
| 7139 | 8212 | } |
| 7140 | if (operand.ty.qual.register) try p.errTok(.addr_of_register, tok); | |
| 7141 | 8213 | |
| 7142 | if (!operand.ty.is(.invalid)) { | |
| 7143 | const elem_ty = try p.arena.create(Type); | |
| 7144 | elem_ty.* = operand.ty; | |
| 7145 | operand.ty = Type{ | |
| 7146 | .specifier = .pointer, | |
| 7147 | .data = .{ .sub_type = elem_ty }, | |
| 7148 | }; | |
| 7149 | } | |
| 7150 | 8214 | try operand.saveValue(p); |
| 7151 | 8215 | try operand.un(p, .addr_of_expr, tok); |
| 8216 | operand.val = addr_val; | |
| 7152 | 8217 | return operand; |
| 7153 | 8218 | }, |
| 7154 | 8219 | .asterisk => { |
| 7155 | const asterisk_loc = p.tok_i; | |
| 7156 | 8220 | p.tok_i += 1; |
| 7157 | var operand = try p.castExpr(); | |
| 7158 | try operand.expect(p); | |
| 8221 | var operand = try p.expect(castExpr); | |
| 7159 | 8222 | |
| 7160 | if (operand.ty.isArray() or operand.ty.isPtr() or operand.ty.isFunc()) { | |
| 7161 | try operand.lvalConversion(p); | |
| 7162 | operand.ty = operand.ty.elemType(); | |
| 7163 | } else { | |
| 7164 | try p.errTok(.indirection_ptr, tok); | |
| 8223 | switch (operand.qt.base(p.comp).type) { | |
| 8224 | .array, .func, .pointer => { | |
| 8225 | try operand.lvalConversion(p, tok); | |
| 8226 | operand.qt = operand.qt.childType(p.comp); | |
| 8227 | operand.val = .{}; | |
| 8228 | }, | |
| 8229 | else => { | |
| 8230 | try p.err(tok, .indirection_ptr, .{}); | |
| 8231 | }, | |
| 7165 | 8232 | } |
| 7166 | if (operand.ty.hasIncompleteSize() and !operand.ty.is(.void)) { | |
| 7167 | try p.errStr(.deref_incomplete_ty_ptr, asterisk_loc, try p.typeStr(operand.ty)); | |
| 8233 | ||
| 8234 | if (operand.qt.hasIncompleteSize(p.comp) and !operand.qt.is(p.comp, .void)) { | |
| 8235 | try p.err(tok, .deref_incomplete_ty_ptr, .{operand.qt}); | |
| 7168 | 8236 | } |
| 7169 | operand.ty.qual = .{}; | |
| 8237 | ||
| 8238 | operand.qt = operand.qt.unqualified(); | |
| 7170 | 8239 | try operand.un(p, .deref_expr, tok); |
| 7171 | 8240 | return operand; |
| 7172 | 8241 | }, |
| 7173 | 8242 | .plus => { |
| 7174 | 8243 | p.tok_i += 1; |
| 7175 | 8244 | |
| 7176 | var operand = try p.castExpr(); | |
| 7177 | try operand.expect(p); | |
| 7178 | try operand.lvalConversion(p); | |
| 7179 | if (!operand.ty.isInt() and !operand.ty.isFloat()) | |
| 7180 | try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); | |
| 8245 | var operand = try p.expect(castExpr); | |
| 8246 | try operand.lvalConversion(p, tok); | |
| 8247 | if (!operand.qt.isInt(p.comp) and !operand.qt.isFloat(p.comp)) | |
| 8248 | try p.err(tok, .invalid_argument_un, .{operand.qt}); | |
| 7181 | 8249 | |
| 7182 | 8250 | try operand.usualUnaryConversion(p, tok); |
| 7183 | 8251 | |
| ... | ... | @@ -7186,15 +8254,14 @@ fn unExpr(p: *Parser) Error!Result { |
| 7186 | 8254 | .minus => { |
| 7187 | 8255 | p.tok_i += 1; |
| 7188 | 8256 | |
| 7189 | var operand = try p.castExpr(); | |
| 7190 | try operand.expect(p); | |
| 7191 | try operand.lvalConversion(p); | |
| 7192 | if (!operand.ty.isInt() and !operand.ty.isFloat()) | |
| 7193 | try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); | |
| 8257 | var operand = try p.expect(castExpr); | |
| 8258 | try operand.lvalConversion(p, tok); | |
| 8259 | if (!operand.qt.isInt(p.comp) and !operand.qt.isFloat(p.comp)) | |
| 8260 | try p.err(tok, .invalid_argument_un, .{operand.qt}); | |
| 7194 | 8261 | |
| 7195 | 8262 | try operand.usualUnaryConversion(p, tok); |
| 7196 | 8263 | if (operand.val.isArithmetic(p.comp)) { |
| 7197 | _ = try operand.val.sub(Value.zero, operand.val, operand.ty, p.comp); | |
| 8264 | _ = try operand.val.negate(operand.val, operand.qt, p.comp); | |
| 7198 | 8265 | } else { |
| 7199 | 8266 | operand.val = .{}; |
| 7200 | 8267 | } |
| ... | ... | @@ -7204,22 +8271,24 @@ fn unExpr(p: *Parser) Error!Result { |
| 7204 | 8271 | .plus_plus => { |
| 7205 | 8272 | p.tok_i += 1; |
| 7206 | 8273 | |
| 7207 | var operand = try p.castExpr(); | |
| 7208 | try operand.expect(p); | |
| 7209 | if (!operand.ty.isScalar()) | |
| 7210 | try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); | |
| 7211 | if (operand.ty.isComplex()) | |
| 7212 | try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); | |
| 7213 | ||
| 7214 | if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { | |
| 7215 | try p.errTok(.not_assignable, tok); | |
| 8274 | var operand = try p.expect(castExpr); | |
| 8275 | const scalar_kind = operand.qt.scalarKind(p.comp); | |
| 8276 | if (scalar_kind == .void_pointer) | |
| 8277 | try p.err(tok, .gnu_pointer_arith, .{}); | |
| 8278 | if (scalar_kind == .none) | |
| 8279 | try p.err(tok, .invalid_argument_un, .{operand.qt}); | |
| 8280 | if (!scalar_kind.isReal()) | |
| 8281 | try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); | |
| 8282 | ||
| 8283 | if (!p.tree.isLval(operand.node) or operand.qt.@"const") { | |
| 8284 | try p.err(tok, .not_assignable, .{}); | |
| 7216 | 8285 | return error.ParsingFailed; |
| 7217 | 8286 | } |
| 7218 | 8287 | try operand.usualUnaryConversion(p, tok); |
| 7219 | 8288 | |
| 7220 | 8289 | if (operand.val.is(.int, p.comp) or operand.val.is(.int, p.comp)) { |
| 7221 | if (try operand.val.add(operand.val, Value.one, operand.ty, p.comp)) | |
| 7222 | try p.errOverflow(tok, operand); | |
| 8290 | if (try operand.val.add(operand.val, .one, operand.qt, p.comp)) | |
| 8291 | try p.err(tok, .overflow, .{operand}); | |
| 7223 | 8292 | } else { |
| 7224 | 8293 | operand.val = .{}; |
| 7225 | 8294 | } |
| ... | ... | @@ -7230,22 +8299,24 @@ fn unExpr(p: *Parser) Error!Result { |
| 7230 | 8299 | .minus_minus => { |
| 7231 | 8300 | p.tok_i += 1; |
| 7232 | 8301 | |
| 7233 | var operand = try p.castExpr(); | |
| 7234 | try operand.expect(p); | |
| 7235 | if (!operand.ty.isScalar()) | |
| 7236 | try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); | |
| 7237 | if (operand.ty.isComplex()) | |
| 7238 | try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); | |
| 7239 | ||
| 7240 | if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { | |
| 7241 | try p.errTok(.not_assignable, tok); | |
| 8302 | var operand = try p.expect(castExpr); | |
| 8303 | const scalar_kind = operand.qt.scalarKind(p.comp); | |
| 8304 | if (scalar_kind == .void_pointer) | |
| 8305 | try p.err(tok, .gnu_pointer_arith, .{}); | |
| 8306 | if (scalar_kind == .none) | |
| 8307 | try p.err(tok, .invalid_argument_un, .{operand.qt}); | |
| 8308 | if (!scalar_kind.isReal()) | |
| 8309 | try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); | |
| 8310 | ||
| 8311 | if (!p.tree.isLval(operand.node) or operand.qt.@"const") { | |
| 8312 | try p.err(tok, .not_assignable, .{}); | |
| 7242 | 8313 | return error.ParsingFailed; |
| 7243 | 8314 | } |
| 7244 | 8315 | try operand.usualUnaryConversion(p, tok); |
| 7245 | 8316 | |
| 7246 | 8317 | if (operand.val.is(.int, p.comp) or operand.val.is(.int, p.comp)) { |
| 7247 | if (try operand.val.sub(operand.val, Value.one, operand.ty, p.comp)) | |
| 7248 | try p.errOverflow(tok, operand); | |
| 8318 | if (try operand.val.decrement(operand.val, operand.qt, p.comp)) | |
| 8319 | try p.err(tok, .overflow, .{operand}); | |
| 7249 | 8320 | } else { |
| 7250 | 8321 | operand.val = .{}; |
| 7251 | 8322 | } |
| ... | ... | @@ -7256,21 +8327,21 @@ fn unExpr(p: *Parser) Error!Result { |
| 7256 | 8327 | .tilde => { |
| 7257 | 8328 | p.tok_i += 1; |
| 7258 | 8329 | |
| 7259 | var operand = try p.castExpr(); | |
| 7260 | try operand.expect(p); | |
| 7261 | try operand.lvalConversion(p); | |
| 8330 | var operand = try p.expect(castExpr); | |
| 8331 | try operand.lvalConversion(p, tok); | |
| 7262 | 8332 | try operand.usualUnaryConversion(p, tok); |
| 7263 | if (operand.ty.isInt()) { | |
| 7264 | if (operand.val.is(.int, p.comp)) { | |
| 7265 | operand.val = try operand.val.bitNot(operand.ty, p.comp); | |
| 7266 | } | |
| 7267 | } else if (operand.ty.isComplex()) { | |
| 7268 | try p.errStr(.complex_conj, tok, try p.typeStr(operand.ty)); | |
| 8333 | const scalar_kind = operand.qt.scalarKind(p.comp); | |
| 8334 | if (!scalar_kind.isReal()) { | |
| 8335 | try p.err(tok, .complex_conj, .{operand.qt}); | |
| 7269 | 8336 | if (operand.val.is(.complex, p.comp)) { |
| 7270 | operand.val = try operand.val.complexConj(operand.ty, p.comp); | |
| 8337 | operand.val = try operand.val.complexConj(operand.qt, p.comp); | |
| 8338 | } | |
| 8339 | } else if (scalar_kind.isInt()) { | |
| 8340 | if (operand.val.is(.int, p.comp)) { | |
| 8341 | operand.val = try operand.val.bitNot(operand.qt, p.comp); | |
| 7271 | 8342 | } |
| 7272 | 8343 | } else { |
| 7273 | try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); | |
| 8344 | try p.err(tok, .invalid_argument_un, .{operand.qt}); | |
| 7274 | 8345 | operand.val = .{}; |
| 7275 | 8346 | } |
| 7276 | 8347 | try operand.un(p, .bit_not_expr, tok); |
| ... | ... | @@ -7279,70 +8350,87 @@ fn unExpr(p: *Parser) Error!Result { |
| 7279 | 8350 | .bang => { |
| 7280 | 8351 | p.tok_i += 1; |
| 7281 | 8352 | |
| 7282 | var operand = try p.castExpr(); | |
| 7283 | try operand.expect(p); | |
| 7284 | try operand.lvalConversion(p); | |
| 7285 | if (!operand.ty.isScalar()) | |
| 7286 | try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); | |
| 8353 | var operand = try p.expect(castExpr); | |
| 8354 | try operand.lvalConversion(p, tok); | |
| 8355 | if (operand.qt.scalarKind(p.comp) == .none) | |
| 8356 | try p.err(tok, .invalid_argument_un, .{operand.qt}); | |
| 7287 | 8357 | |
| 7288 | 8358 | try operand.usualUnaryConversion(p, tok); |
| 7289 | 8359 | if (operand.val.is(.int, p.comp)) { |
| 7290 | 8360 | operand.val = Value.fromBool(!operand.val.toBool(p.comp)); |
| 7291 | 8361 | } else if (operand.val.opt_ref == .null) { |
| 7292 | operand.val = Value.one; | |
| 8362 | operand.val = .one; | |
| 7293 | 8363 | } else { |
| 7294 | if (operand.ty.isDecayed()) { | |
| 7295 | operand.val = Value.zero; | |
| 7296 | } else { | |
| 7297 | operand.val = .{}; | |
| 8364 | operand.val = .{}; | |
| 8365 | if (operand.qt.get(p.comp, .pointer)) |pointer_ty| { | |
| 8366 | if (pointer_ty.decayed != null) operand.val = .zero; | |
| 7298 | 8367 | } |
| 7299 | 8368 | } |
| 7300 | operand.ty = .{ .specifier = .int }; | |
| 8369 | operand.qt = .int; | |
| 7301 | 8370 | try operand.un(p, .bool_not_expr, tok); |
| 7302 | 8371 | return operand; |
| 7303 | 8372 | }, |
| 7304 | 8373 | .keyword_sizeof => { |
| 7305 | 8374 | p.tok_i += 1; |
| 7306 | 8375 | const expected_paren = p.tok_i; |
| 7307 | var res = Result{}; | |
| 7308 | if (try p.typeName()) |ty| { | |
| 7309 | res.ty = ty; | |
| 7310 | try p.errTok(.expected_parens_around_typename, expected_paren); | |
| 8376 | ||
| 8377 | var has_expr = false; | |
| 8378 | var res: Result = .{ | |
| 8379 | .node = undefined, // check has_expr | |
| 8380 | }; | |
| 8381 | if (try p.typeName()) |qt| { | |
| 8382 | res.qt = qt; | |
| 8383 | try p.err(expected_paren, .expected_parens_around_typename, .{}); | |
| 7311 | 8384 | } else if (p.eatToken(.l_paren)) |l_paren| { |
| 7312 | 8385 | if (try p.typeName()) |ty| { |
| 7313 | res.ty = ty; | |
| 8386 | res.qt = ty; | |
| 7314 | 8387 | try p.expectClosing(l_paren, .r_paren); |
| 7315 | 8388 | } else { |
| 7316 | 8389 | p.tok_i = expected_paren; |
| 7317 | 8390 | res = try p.parseNoEval(unExpr); |
| 8391 | has_expr = true; | |
| 7318 | 8392 | } |
| 7319 | 8393 | } else { |
| 7320 | 8394 | res = try p.parseNoEval(unExpr); |
| 8395 | has_expr = true; | |
| 7321 | 8396 | } |
| 8397 | const operand_qt = res.qt; | |
| 7322 | 8398 | |
| 7323 | if (res.ty.is(.void)) { | |
| 7324 | try p.errStr(.pointer_arith_void, tok, "sizeof"); | |
| 7325 | } else if (res.ty.isDecayed()) { | |
| 7326 | const array_ty = res.ty.originalTypeOfDecayedArray(); | |
| 7327 | const err_str = try p.typePairStrExtra(res.ty, " instead of ", array_ty); | |
| 7328 | try p.errStr(.sizeof_array_arg, tok, err_str); | |
| 7329 | } | |
| 7330 | if (res.ty.sizeof(p.comp)) |size| { | |
| 7331 | if (size == 0) { | |
| 7332 | try p.errTok(.sizeof_returns_zero, tok); | |
| 7333 | } | |
| 7334 | res.val = try Value.int(size, p.comp); | |
| 7335 | res.ty = p.comp.types.size; | |
| 7336 | } else { | |
| 8399 | if (res.qt.isInvalid()) { | |
| 7337 | 8400 | res.val = .{}; |
| 7338 | if (res.ty.hasIncompleteSize()) { | |
| 7339 | try p.errStr(.invalid_sizeof, expected_paren - 1, try p.typeStr(res.ty)); | |
| 7340 | res.ty = Type.invalid; | |
| 8401 | } else { | |
| 8402 | const base_type = res.qt.base(p.comp); | |
| 8403 | switch (base_type.type) { | |
| 8404 | .void => try p.err(tok, .pointer_arith_void, .{"sizeof"}), | |
| 8405 | .pointer => |pointer_ty| if (pointer_ty.decayed) |decayed_qt| { | |
| 8406 | try p.err(tok, .sizeof_array_arg, .{ res.qt, decayed_qt }); | |
| 8407 | }, | |
| 8408 | else => {}, | |
| 8409 | } | |
| 8410 | ||
| 8411 | if (base_type.qt.sizeofOrNull(p.comp)) |size| { | |
| 8412 | if (size == 0 and p.comp.langopts.emulate == .msvc) { | |
| 8413 | try p.err(tok, .sizeof_returns_zero, .{}); | |
| 8414 | } | |
| 8415 | res.val = try Value.int(size, p.comp); | |
| 8416 | res.qt = p.comp.type_store.size; | |
| 7341 | 8417 | } else { |
| 7342 | res.ty = p.comp.types.size; | |
| 8418 | res.val = .{}; | |
| 8419 | if (res.qt.hasIncompleteSize(p.comp)) { | |
| 8420 | try p.err(expected_paren - 1, .invalid_sizeof, .{res.qt}); | |
| 8421 | res.qt = .invalid; | |
| 8422 | } else { | |
| 8423 | res.qt = p.comp.type_store.size; | |
| 8424 | } | |
| 7343 | 8425 | } |
| 7344 | 8426 | } |
| 7345 | try res.un(p, .sizeof_expr, tok); | |
| 8427 | ||
| 8428 | res.node = try p.addNode(.{ .sizeof_expr = .{ | |
| 8429 | .op_tok = tok, | |
| 8430 | .qt = res.qt, | |
| 8431 | .expr = if (has_expr) res.node else null, | |
| 8432 | .operand_qt = operand_qt, | |
| 8433 | } }); | |
| 7346 | 8434 | return res; |
| 7347 | 8435 | }, |
| 7348 | 8436 | .keyword_alignof, |
| ... | ... | @@ -7352,35 +8440,51 @@ fn unExpr(p: *Parser) Error!Result { |
| 7352 | 8440 | => { |
| 7353 | 8441 | p.tok_i += 1; |
| 7354 | 8442 | const expected_paren = p.tok_i; |
| 7355 | var res = Result{}; | |
| 7356 | if (try p.typeName()) |ty| { | |
| 7357 | res.ty = ty; | |
| 7358 | try p.errTok(.expected_parens_around_typename, expected_paren); | |
| 8443 | ||
| 8444 | var has_expr = false; | |
| 8445 | var res: Result = .{ | |
| 8446 | .node = undefined, // check has_expr | |
| 8447 | }; | |
| 8448 | if (try p.typeName()) |qt| { | |
| 8449 | res.qt = qt; | |
| 8450 | try p.err(expected_paren, .expected_parens_around_typename, .{}); | |
| 7359 | 8451 | } else if (p.eatToken(.l_paren)) |l_paren| { |
| 7360 | if (try p.typeName()) |ty| { | |
| 7361 | res.ty = ty; | |
| 8452 | if (try p.typeName()) |qt| { | |
| 8453 | res.qt = qt; | |
| 7362 | 8454 | try p.expectClosing(l_paren, .r_paren); |
| 7363 | 8455 | } else { |
| 7364 | 8456 | p.tok_i = expected_paren; |
| 7365 | 8457 | res = try p.parseNoEval(unExpr); |
| 7366 | try p.errTok(.alignof_expr, expected_paren); | |
| 8458 | has_expr = true; | |
| 8459 | ||
| 8460 | try p.err(expected_paren, .alignof_expr, .{}); | |
| 7367 | 8461 | } |
| 7368 | 8462 | } else { |
| 7369 | 8463 | res = try p.parseNoEval(unExpr); |
| 7370 | try p.errTok(.alignof_expr, expected_paren); | |
| 8464 | has_expr = true; | |
| 8465 | ||
| 8466 | try p.err(expected_paren, .alignof_expr, .{}); | |
| 7371 | 8467 | } |
| 8468 | const operand_qt = res.qt; | |
| 7372 | 8469 | |
| 7373 | if (res.ty.is(.void)) { | |
| 7374 | try p.errStr(.pointer_arith_void, tok, "alignof"); | |
| 8470 | if (res.qt.is(p.comp, .void)) { | |
| 8471 | try p.err(tok, .pointer_arith_void, .{"alignof"}); | |
| 7375 | 8472 | } |
| 7376 | if (res.ty.alignable()) { | |
| 7377 | res.val = try Value.int(res.ty.alignof(p.comp), p.comp); | |
| 7378 | res.ty = p.comp.types.size; | |
| 7379 | } else { | |
| 7380 | try p.errStr(.invalid_alignof, expected_paren, try p.typeStr(res.ty)); | |
| 7381 | res.ty = Type.invalid; | |
| 8473 | ||
| 8474 | if (res.qt.sizeofOrNull(p.comp) != null) { | |
| 8475 | res.val = try Value.int(res.qt.alignof(p.comp), p.comp); | |
| 8476 | res.qt = p.comp.type_store.size; | |
| 8477 | } else if (!res.qt.isInvalid()) { | |
| 8478 | try p.err(expected_paren, .invalid_alignof, .{res.qt}); | |
| 8479 | res.qt = .invalid; | |
| 7382 | 8480 | } |
| 7383 | try res.un(p, .alignof_expr, tok); | |
| 8481 | ||
| 8482 | res.node = try p.addNode(.{ .alignof_expr = .{ | |
| 8483 | .op_tok = tok, | |
| 8484 | .qt = res.qt, | |
| 8485 | .expr = if (has_expr) res.node else null, | |
| 8486 | .operand_qt = operand_qt, | |
| 8487 | } }); | |
| 7384 | 8488 | return res; |
| 7385 | 8489 | }, |
| 7386 | 8490 | .keyword_extension => { |
| ... | ... | @@ -7389,38 +8493,35 @@ fn unExpr(p: *Parser) Error!Result { |
| 7389 | 8493 | defer p.extension_suppressed = saved_extension; |
| 7390 | 8494 | p.extension_suppressed = true; |
| 7391 | 8495 | |
| 7392 | var child = try p.castExpr(); | |
| 7393 | try child.expect(p); | |
| 7394 | return child; | |
| 8496 | return try p.expect(castExpr); | |
| 7395 | 8497 | }, |
| 7396 | 8498 | .keyword_imag1, .keyword_imag2 => { |
| 7397 | 8499 | const imag_tok = p.tok_i; |
| 7398 | 8500 | p.tok_i += 1; |
| 7399 | 8501 | |
| 7400 | var operand = try p.castExpr(); | |
| 7401 | try operand.expect(p); | |
| 7402 | try operand.lvalConversion(p); | |
| 7403 | if (operand.ty.is(.invalid)) return Result.invalid; | |
| 7404 | if (!operand.ty.isInt() and !operand.ty.isFloat()) { | |
| 7405 | try p.errStr(.invalid_imag, imag_tok, try p.typeStr(operand.ty)); | |
| 8502 | var operand = try p.expect(castExpr); | |
| 8503 | try operand.lvalConversion(p, tok); | |
| 8504 | if (operand.qt.isInvalid()) return operand; | |
| 8505 | ||
| 8506 | const scalar_kind = operand.qt.scalarKind(p.comp); | |
| 8507 | if (!scalar_kind.isArithmetic()) { | |
| 8508 | try p.err(imag_tok, .invalid_imag, .{operand.qt}); | |
| 7406 | 8509 | } |
| 7407 | if (operand.ty.isComplex()) { | |
| 8510 | if (!scalar_kind.isReal()) { | |
| 7408 | 8511 | operand.val = try operand.val.imaginaryPart(p.comp); |
| 7409 | } else if (operand.ty.isReal()) { | |
| 7410 | switch (p.comp.langopts.emulate) { | |
| 7411 | .msvc => {}, // Doesn't support `_Complex` or `__imag` in the first place | |
| 7412 | .gcc => operand.val = Value.zero, | |
| 7413 | .clang => { | |
| 7414 | if (operand.val.is(.int, p.comp) or operand.val.is(.float, p.comp)) { | |
| 7415 | operand.val = Value.zero; | |
| 7416 | } else { | |
| 7417 | operand.val = .{}; | |
| 7418 | } | |
| 7419 | }, | |
| 7420 | } | |
| 8512 | } else switch (p.comp.langopts.emulate) { | |
| 8513 | .msvc => {}, // Doesn't support `_Complex` or `__imag` in the first place | |
| 8514 | .gcc => operand.val = .zero, | |
| 8515 | .clang => { | |
| 8516 | if (operand.val.is(.int, p.comp) or operand.val.is(.float, p.comp)) { | |
| 8517 | operand.val = .zero; | |
| 8518 | } else { | |
| 8519 | operand.val = .{}; | |
| 8520 | } | |
| 8521 | }, | |
| 7421 | 8522 | } |
| 7422 | 8523 | // convert _Complex T to T |
| 7423 | operand.ty = operand.ty.makeReal(); | |
| 8524 | operand.qt = operand.qt.toReal(p.comp); | |
| 7424 | 8525 | try operand.un(p, .imag_expr, tok); |
| 7425 | 8526 | return operand; |
| 7426 | 8527 | }, |
| ... | ... | @@ -7428,28 +8529,24 @@ fn unExpr(p: *Parser) Error!Result { |
| 7428 | 8529 | const real_tok = p.tok_i; |
| 7429 | 8530 | p.tok_i += 1; |
| 7430 | 8531 | |
| 7431 | var operand = try p.castExpr(); | |
| 7432 | try operand.expect(p); | |
| 7433 | try operand.lvalConversion(p); | |
| 7434 | if (operand.ty.is(.invalid)) return Result.invalid; | |
| 7435 | if (!operand.ty.isInt() and !operand.ty.isFloat()) { | |
| 7436 | try p.errStr(.invalid_real, real_tok, try p.typeStr(operand.ty)); | |
| 8532 | var operand = try p.expect(castExpr); | |
| 8533 | try operand.lvalConversion(p, tok); | |
| 8534 | if (operand.qt.isInvalid()) return operand; | |
| 8535 | if (!operand.qt.isInt(p.comp) and !operand.qt.isFloat(p.comp)) { | |
| 8536 | try p.err(real_tok, .invalid_real, .{operand.qt}); | |
| 7437 | 8537 | } |
| 7438 | 8538 | // convert _Complex T to T |
| 7439 | operand.ty = operand.ty.makeReal(); | |
| 8539 | operand.qt = operand.qt.toReal(p.comp); | |
| 7440 | 8540 | operand.val = try operand.val.realPart(p.comp); |
| 7441 | 8541 | try operand.un(p, .real_expr, tok); |
| 7442 | 8542 | return operand; |
| 7443 | 8543 | }, |
| 7444 | 8544 | else => { |
| 7445 | var lhs = try p.compoundLiteral(); | |
| 7446 | if (lhs.empty(p)) { | |
| 7447 | lhs = try p.primaryExpr(); | |
| 7448 | if (lhs.empty(p)) return lhs; | |
| 7449 | } | |
| 7450 | while (true) { | |
| 7451 | const suffix = try p.suffixExpr(lhs); | |
| 7452 | if (suffix.empty(p)) break; | |
| 8545 | var lhs = (try p.compoundLiteral(null, null)) orelse | |
| 8546 | (try p.primaryExpr()) orelse | |
| 8547 | return null; | |
| 8548 | ||
| 8549 | while (try p.suffixExpr(lhs)) |suffix| { | |
| 7453 | 8550 | lhs = suffix; |
| 7454 | 8551 | } |
| 7455 | 8552 | return lhs; |
| ... | ... | @@ -7460,58 +8557,68 @@ fn unExpr(p: *Parser) Error!Result { |
| 7460 | 8557 | /// compoundLiteral |
| 7461 | 8558 | /// : '(' storageClassSpec* type_name ')' '{' initializer_list '}' |
| 7462 | 8559 | /// | '(' storageClassSpec* type_name ')' '{' initializer_list ',' '}' |
| 7463 | fn compoundLiteral(p: *Parser) Error!Result { | |
| 7464 | const l_paren = p.eatToken(.l_paren) orelse return Result{}; | |
| 7465 | ||
| 7466 | var d: DeclSpec = .{ .ty = .{ .specifier = undefined } }; | |
| 7467 | const any = if (p.comp.langopts.standard.atLeast(.c23)) | |
| 7468 | try p.storageClassSpec(&d) | |
| 7469 | else | |
| 7470 | false; | |
| 8560 | fn compoundLiteral(p: *Parser, qt_opt: ?QualType, opt_l_paren: ?TokenIndex) Error!?Result { | |
| 8561 | const l_paren, const d = if (qt_opt) |some| .{ opt_l_paren.?, DeclSpec{ .qt = some } } else blk: { | |
| 8562 | const l_paren = p.eatToken(.l_paren) orelse return null; | |
| 7471 | 8563 | |
| 7472 | const tag: Tree.Tag = switch (d.storage_class) { | |
| 7473 | .static => if (d.thread_local != null) | |
| 7474 | .static_thread_local_compound_literal_expr | |
| 7475 | else | |
| 7476 | .static_compound_literal_expr, | |
| 7477 | .register, .none => if (d.thread_local != null) | |
| 7478 | .thread_local_compound_literal_expr | |
| 8564 | var d: DeclSpec = .{ .qt = .invalid }; | |
| 8565 | const any = if (p.comp.langopts.standard.atLeast(.c23)) | |
| 8566 | try p.storageClassSpec(&d) | |
| 7479 | 8567 | else |
| 7480 | .compound_literal_expr, | |
| 7481 | .auto, .@"extern", .typedef => |tok| blk: { | |
| 7482 | try p.errStr(.invalid_compound_literal_storage_class, tok, @tagName(d.storage_class)); | |
| 7483 | d.storage_class = .none; | |
| 7484 | break :blk if (d.thread_local != null) | |
| 7485 | .thread_local_compound_literal_expr | |
| 7486 | else | |
| 7487 | .compound_literal_expr; | |
| 7488 | }, | |
| 7489 | }; | |
| 8568 | false; | |
| 7490 | 8569 | |
| 7491 | var ty = (try p.typeName()) orelse { | |
| 7492 | p.tok_i = l_paren; | |
| 7493 | if (any) { | |
| 7494 | try p.err(.expected_type); | |
| 7495 | return error.ParsingFailed; | |
| 8570 | switch (d.storage_class) { | |
| 8571 | .auto, .@"extern", .typedef => |tok| { | |
| 8572 | try p.err(tok, .invalid_compound_literal_storage_class, .{@tagName(d.storage_class)}); | |
| 8573 | d.storage_class = .none; | |
| 8574 | }, | |
| 8575 | .register => if (p.func.qt == null) try p.err(p.tok_i, .illegal_storage_on_global, .{}), | |
| 8576 | else => {}, | |
| 7496 | 8577 | } |
| 7497 | return Result{}; | |
| 8578 | ||
| 8579 | d.qt = (try p.typeName()) orelse { | |
| 8580 | p.tok_i = l_paren; | |
| 8581 | if (any) { | |
| 8582 | try p.err(p.tok_i, .expected_type, .{}); | |
| 8583 | return error.ParsingFailed; | |
| 8584 | } | |
| 8585 | return null; | |
| 8586 | }; | |
| 8587 | try p.expectClosing(l_paren, .r_paren); | |
| 8588 | break :blk .{ l_paren, d }; | |
| 7498 | 8589 | }; |
| 7499 | if (d.storage_class == .register) ty.qual.register = true; | |
| 7500 | try p.expectClosing(l_paren, .r_paren); | |
| 8590 | var qt = d.qt; | |
| 7501 | 8591 | |
| 7502 | if (ty.isFunc()) { | |
| 7503 | try p.err(.func_init); | |
| 7504 | } else if (ty.is(.variable_len_array)) { | |
| 7505 | try p.err(.vla_init); | |
| 7506 | } else if (ty.hasIncompleteSize() and !ty.is(.incomplete_array)) { | |
| 7507 | try p.errStr(.variable_incomplete_ty, p.tok_i, try p.typeStr(ty)); | |
| 7508 | return error.ParsingFailed; | |
| 8592 | switch (qt.base(p.comp).type) { | |
| 8593 | .func => try p.err(p.tok_i, .func_init, .{}), | |
| 8594 | .array => |array_ty| if (array_ty.len == .variable) { | |
| 8595 | try p.err(p.tok_i, .vla_init, .{}); | |
| 8596 | }, | |
| 8597 | else => if (qt.hasIncompleteSize(p.comp)) { | |
| 8598 | try p.err(p.tok_i, .variable_incomplete_ty, .{qt}); | |
| 8599 | return error.ParsingFailed; | |
| 8600 | }, | |
| 7509 | 8601 | } |
| 7510 | var init_list_expr = try p.initializer(ty); | |
| 8602 | ||
| 8603 | const init_context = p.init_context; | |
| 8604 | defer p.init_context = init_context; | |
| 8605 | p.init_context = d.initContext(p); | |
| 8606 | var init_list_expr = try p.initializer(qt); | |
| 7511 | 8607 | if (d.constexpr) |_| { |
| 7512 | 8608 | // TODO error if not constexpr |
| 7513 | 8609 | } |
| 7514 | try init_list_expr.un(p, tag, l_paren); | |
| 8610 | ||
| 8611 | init_list_expr.node = try p.addNode(.{ .compound_literal_expr = .{ | |
| 8612 | .l_paren_tok = l_paren, | |
| 8613 | .storage_class = switch (d.storage_class) { | |
| 8614 | .register => .register, | |
| 8615 | .static => .static, | |
| 8616 | else => .auto, | |
| 8617 | }, | |
| 8618 | .thread_local = d.thread_local != null, | |
| 8619 | .initializer = init_list_expr.node, | |
| 8620 | .qt = init_list_expr.qt, | |
| 8621 | } }); | |
| 7515 | 8622 | return init_list_expr; |
| 7516 | 8623 | } |
| 7517 | 8624 | |
| ... | ... | @@ -7523,21 +8630,23 @@ fn compoundLiteral(p: *Parser) Error!Result { |
| 7523 | 8630 | /// | '++' |
| 7524 | 8631 | /// | '--' |
| 7525 | 8632 | /// argumentExprList : assignExpr (',' assignExpr)* |
| 7526 | fn suffixExpr(p: *Parser, lhs: Result) Error!Result { | |
| 7527 | assert(!lhs.empty(p)); | |
| 8633 | fn suffixExpr(p: *Parser, lhs: Result) Error!?Result { | |
| 7528 | 8634 | switch (p.tok_ids[p.tok_i]) { |
| 7529 | .l_paren => return p.callExpr(lhs), | |
| 8635 | .l_paren => return try p.callExpr(lhs), | |
| 7530 | 8636 | .plus_plus => { |
| 7531 | 8637 | defer p.tok_i += 1; |
| 7532 | 8638 | |
| 7533 | 8639 | var operand = lhs; |
| 7534 | if (!operand.ty.isScalar()) | |
| 7535 | try p.errStr(.invalid_argument_un, p.tok_i, try p.typeStr(operand.ty)); | |
| 7536 | if (operand.ty.isComplex()) | |
| 7537 | try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); | |
| 7538 | ||
| 7539 | if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { | |
| 7540 | try p.err(.not_assignable); | |
| 8640 | const scalar_kind = operand.qt.scalarKind(p.comp); | |
| 8641 | if (scalar_kind == .void_pointer) | |
| 8642 | try p.err(p.tok_i, .gnu_pointer_arith, .{}); | |
| 8643 | if (scalar_kind == .none) | |
| 8644 | try p.err(p.tok_i, .invalid_argument_un, .{operand.qt}); | |
| 8645 | if (!scalar_kind.isReal()) | |
| 8646 | try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); | |
| 8647 | ||
| 8648 | if (!p.tree.isLval(operand.node) or operand.qt.@"const") { | |
| 8649 | try p.err(p.tok_i, .not_assignable, .{}); | |
| 7541 | 8650 | return error.ParsingFailed; |
| 7542 | 8651 | } |
| 7543 | 8652 | try operand.usualUnaryConversion(p, p.tok_i); |
| ... | ... | @@ -7549,13 +8658,16 @@ fn suffixExpr(p: *Parser, lhs: Result) Error!Result { |
| 7549 | 8658 | defer p.tok_i += 1; |
| 7550 | 8659 | |
| 7551 | 8660 | var operand = lhs; |
| 7552 | if (!operand.ty.isScalar()) | |
| 7553 | try p.errStr(.invalid_argument_un, p.tok_i, try p.typeStr(operand.ty)); | |
| 7554 | if (operand.ty.isComplex()) | |
| 7555 | try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); | |
| 7556 | ||
| 7557 | if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { | |
| 7558 | try p.err(.not_assignable); | |
| 8661 | const scalar_kind = operand.qt.scalarKind(p.comp); | |
| 8662 | if (scalar_kind == .void_pointer) | |
| 8663 | try p.err(p.tok_i, .gnu_pointer_arith, .{}); | |
| 8664 | if (scalar_kind == .none) | |
| 8665 | try p.err(p.tok_i, .invalid_argument_un, .{operand.qt}); | |
| 8666 | if (!scalar_kind.isReal()) | |
| 8667 | try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); | |
| 8668 | ||
| 8669 | if (!p.tree.isLval(operand.node) or operand.qt.@"const") { | |
| 8670 | try p.err(p.tok_i, .not_assignable, .{}); | |
| 7559 | 8671 | return error.ParsingFailed; |
| 7560 | 8672 | } |
| 7561 | 8673 | try operand.usualUnaryConversion(p, p.tok_i); |
| ... | ... | @@ -7566,56 +8678,68 @@ fn suffixExpr(p: *Parser, lhs: Result) Error!Result { |
| 7566 | 8678 | .l_bracket => { |
| 7567 | 8679 | const l_bracket = p.tok_i; |
| 7568 | 8680 | p.tok_i += 1; |
| 7569 | var index = try p.expr(); | |
| 7570 | try index.expect(p); | |
| 8681 | var index = try p.expect(expr); | |
| 7571 | 8682 | try p.expectClosing(l_bracket, .r_bracket); |
| 7572 | 8683 | |
| 7573 | 8684 | const array_before_conversion = lhs; |
| 7574 | 8685 | const index_before_conversion = index; |
| 7575 | 8686 | var ptr = lhs; |
| 7576 | try ptr.lvalConversion(p); | |
| 7577 | try index.lvalConversion(p); | |
| 7578 | if (ptr.ty.isPtr()) { | |
| 7579 | ptr.ty = ptr.ty.elemType(); | |
| 7580 | if (index.ty.isInt()) { | |
| 8687 | try ptr.lvalConversion(p, l_bracket); | |
| 8688 | try index.lvalConversion(p, l_bracket); | |
| 8689 | if (ptr.qt.get(p.comp, .pointer)) |pointer_ty| { | |
| 8690 | ptr.qt = pointer_ty.child; | |
| 8691 | if (index.qt.isRealInt(p.comp)) { | |
| 7581 | 8692 | try p.checkArrayBounds(index_before_conversion, array_before_conversion, l_bracket); |
| 7582 | 8693 | } else { |
| 7583 | try p.errTok(.invalid_index, l_bracket); | |
| 8694 | try p.err(l_bracket, .invalid_index, .{}); | |
| 7584 | 8695 | } |
| 7585 | } else if (index.ty.isPtr()) { | |
| 7586 | index.ty = index.ty.elemType(); | |
| 7587 | if (ptr.ty.isInt()) { | |
| 8696 | } else if (index.qt.get(p.comp, .pointer)) |pointer_ty| { | |
| 8697 | index.qt = pointer_ty.child; | |
| 8698 | if (ptr.qt.isRealInt(p.comp)) { | |
| 7588 | 8699 | try p.checkArrayBounds(array_before_conversion, index_before_conversion, l_bracket); |
| 7589 | 8700 | } else { |
| 7590 | try p.errTok(.invalid_index, l_bracket); | |
| 8701 | try p.err(l_bracket, .invalid_index, .{}); | |
| 7591 | 8702 | } |
| 7592 | 8703 | std.mem.swap(Result, &ptr, &index); |
| 7593 | } else { | |
| 7594 | try p.errTok(.invalid_subscript, l_bracket); | |
| 8704 | } else if (ptr.qt.get(p.comp, .vector)) |vector_ty| { | |
| 8705 | ptr = array_before_conversion; | |
| 8706 | ptr.qt = vector_ty.elem; | |
| 8707 | if (!index.qt.isRealInt(p.comp)) { | |
| 8708 | try p.err(l_bracket, .invalid_index, .{}); | |
| 8709 | } | |
| 8710 | } else if (!index.qt.isInvalid() and !ptr.qt.isInvalid()) { | |
| 8711 | try p.err(l_bracket, .invalid_subscript, .{}); | |
| 7595 | 8712 | } |
| 7596 | 8713 | |
| 7597 | 8714 | try ptr.saveValue(p); |
| 7598 | 8715 | try index.saveValue(p); |
| 7599 | try ptr.bin(p, .array_access_expr, index, l_bracket); | |
| 8716 | ptr.node = try p.addNode(.{ .array_access_expr = .{ | |
| 8717 | .l_bracket_tok = l_bracket, | |
| 8718 | .base = ptr.node, | |
| 8719 | .index = index.node, | |
| 8720 | .qt = ptr.qt, | |
| 8721 | } }); | |
| 7600 | 8722 | return ptr; |
| 7601 | 8723 | }, |
| 7602 | 8724 | .period => { |
| 8725 | const period = p.tok_i; | |
| 7603 | 8726 | p.tok_i += 1; |
| 7604 | 8727 | const name = try p.expectIdentifier(); |
| 7605 | return p.fieldAccess(lhs, name, false); | |
| 8728 | return try p.fieldAccess(lhs, name, false, period); | |
| 7606 | 8729 | }, |
| 7607 | 8730 | .arrow => { |
| 8731 | const arrow = p.tok_i; | |
| 7608 | 8732 | p.tok_i += 1; |
| 7609 | 8733 | const name = try p.expectIdentifier(); |
| 7610 | if (lhs.ty.isArray()) { | |
| 8734 | if (lhs.qt.is(p.comp, .array)) { | |
| 7611 | 8735 | var copy = lhs; |
| 7612 | copy.ty.decayArray(); | |
| 7613 | try copy.implicitCast(p, .array_to_pointer); | |
| 7614 | return p.fieldAccess(copy, name, true); | |
| 8736 | copy.qt = try copy.qt.decay(p.comp); | |
| 8737 | try copy.implicitCast(p, .array_to_pointer, arrow); | |
| 8738 | return try p.fieldAccess(copy, name, true, arrow); | |
| 7615 | 8739 | } |
| 7616 | return p.fieldAccess(lhs, name, true); | |
| 8740 | return try p.fieldAccess(lhs, name, true, arrow); | |
| 7617 | 8741 | }, |
| 7618 | else => return Result{}, | |
| 8742 | else => return null, | |
| 7619 | 8743 | } |
| 7620 | 8744 | } |
| 7621 | 8745 | |
| ... | ... | @@ -7624,76 +8748,99 @@ fn fieldAccess( |
| 7624 | 8748 | lhs: Result, |
| 7625 | 8749 | field_name_tok: TokenIndex, |
| 7626 | 8750 | is_arrow: bool, |
| 8751 | access_tok: TokenIndex, | |
| 7627 | 8752 | ) !Result { |
| 7628 | const expr_ty = lhs.ty; | |
| 7629 | const is_ptr = expr_ty.isPtr(); | |
| 7630 | const expr_base_ty = if (is_ptr) expr_ty.elemType() else expr_ty; | |
| 7631 | const record_ty = expr_base_ty.getRecord() orelse { | |
| 7632 | try p.errStr(.expected_record_ty, field_name_tok, try p.typeStr(expr_ty)); | |
| 8753 | if (lhs.qt.isInvalid()) { | |
| 8754 | const access: Node.MemberAccess = .{ | |
| 8755 | .access_tok = access_tok, | |
| 8756 | .qt = .invalid, | |
| 8757 | .base = lhs.node, | |
| 8758 | .member_index = std.math.maxInt(u32), | |
| 8759 | }; | |
| 8760 | return .{ | |
| 8761 | .qt = .invalid, | |
| 8762 | .node = try p.addNode(if (is_arrow) | |
| 8763 | .{ .member_access_ptr_expr = access } | |
| 8764 | else | |
| 8765 | .{ .member_access_expr = access }), | |
| 8766 | }; | |
| 8767 | } | |
| 8768 | ||
| 8769 | const expr_qt = if (lhs.qt.get(p.comp, .atomic)) |atomic| atomic else lhs.qt; | |
| 8770 | const is_ptr = expr_qt.isPointer(p.comp); | |
| 8771 | const expr_base_qt = if (is_ptr) expr_qt.childType(p.comp) else expr_qt; | |
| 8772 | const record_qt = if (expr_base_qt.get(p.comp, .atomic)) |atomic| atomic else expr_base_qt; | |
| 8773 | const record_ty = record_qt.getRecord(p.comp) orelse { | |
| 8774 | try p.err(field_name_tok, .expected_record_ty, .{expr_qt}); | |
| 7633 | 8775 | return error.ParsingFailed; |
| 7634 | 8776 | }; |
| 7635 | 8777 | |
| 7636 | if (record_ty.isIncomplete()) { | |
| 7637 | try p.errStr(.deref_incomplete_ty_ptr, field_name_tok - 2, try p.typeStr(expr_base_ty)); | |
| 8778 | if (record_ty.layout == null) { | |
| 8779 | // Invalid use of incomplete type, error reported elsewhere. | |
| 8780 | if (!is_ptr) return error.ParsingFailed; | |
| 8781 | ||
| 8782 | try p.err(field_name_tok - 2, .deref_incomplete_ty_ptr, .{expr_base_qt}); | |
| 7638 | 8783 | return error.ParsingFailed; |
| 7639 | 8784 | } |
| 7640 | if (is_arrow and !is_ptr) try p.errStr(.member_expr_not_ptr, field_name_tok, try p.typeStr(expr_ty)); | |
| 7641 | if (!is_arrow and is_ptr) try p.errStr(.member_expr_ptr, field_name_tok, try p.typeStr(expr_ty)); | |
| 8785 | if (expr_qt != lhs.qt) try p.err(field_name_tok, .member_expr_atomic, .{lhs.qt}); | |
| 8786 | if (expr_base_qt != record_qt) try p.err(field_name_tok, .member_expr_atomic, .{expr_base_qt}); | |
| 7642 | 8787 | |
| 7643 | const field_name = try StrInt.intern(p.comp, p.tokSlice(field_name_tok)); | |
| 7644 | try p.validateFieldAccess(record_ty, expr_ty, field_name_tok, field_name); | |
| 8788 | if (is_arrow and !is_ptr) try p.err(field_name_tok, .member_expr_not_ptr, .{expr_qt}); | |
| 8789 | if (!is_arrow and is_ptr) try p.err(field_name_tok, .member_expr_ptr, .{expr_qt}); | |
| 8790 | ||
| 8791 | const field_name = try p.comp.internString(p.tokSlice(field_name_tok)); | |
| 8792 | try p.validateFieldAccess(record_ty, record_qt, field_name_tok, field_name); | |
| 7645 | 8793 | var discard: u64 = 0; |
| 7646 | return p.fieldAccessExtra(lhs.node, record_ty, field_name, is_arrow, &discard); | |
| 8794 | return p.fieldAccessExtra(lhs.node, record_ty, field_name, is_arrow, access_tok, &discard); | |
| 7647 | 8795 | } |
| 7648 | 8796 | |
| 7649 | fn validateFieldAccess(p: *Parser, record_ty: *const Type.Record, expr_ty: Type, field_name_tok: TokenIndex, field_name: StringId) Error!void { | |
| 7650 | if (record_ty.hasField(field_name)) return; | |
| 7651 | ||
| 7652 | p.strings.items.len = 0; | |
| 7653 | ||
| 7654 | try p.strings.print("'{s}' in '", .{p.tokSlice(field_name_tok)}); | |
| 7655 | const mapper = p.comp.string_interner.getSlowTypeMapper(); | |
| 7656 | { | |
| 7657 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 7658 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 7659 | defer { | |
| 7660 | unmanaged = allocating.toArrayList(); | |
| 7661 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 7662 | } | |
| 7663 | expr_ty.print(mapper, p.comp.langopts, &allocating.writer) catch |e| switch (e) { | |
| 7664 | error.WriteFailed => return error.OutOfMemory, | |
| 7665 | }; | |
| 7666 | } | |
| 7667 | try p.strings.append('\''); | |
| 7668 | ||
| 7669 | const duped = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items); | |
| 7670 | try p.errStr(.no_such_member, field_name_tok, duped); | |
| 8797 | fn validateFieldAccess(p: *Parser, record_ty: Type.Record, record_qt: QualType, field_name_tok: TokenIndex, field_name: StringId) Error!void { | |
| 8798 | if (record_ty.hasField(p.comp, field_name)) return; | |
| 8799 | try p.err(field_name_tok, .no_such_member, .{ p.tokSlice(field_name_tok), record_qt }); | |
| 7671 | 8800 | return error.ParsingFailed; |
| 7672 | 8801 | } |
| 7673 | 8802 | |
| 7674 | fn fieldAccessExtra(p: *Parser, lhs: NodeIndex, record_ty: *const Type.Record, field_name: StringId, is_arrow: bool, offset_bits: *u64) Error!Result { | |
| 7675 | for (record_ty.fields, 0..) |f, i| { | |
| 7676 | if (f.isAnonymousRecord()) { | |
| 7677 | if (!f.ty.hasField(field_name)) continue; | |
| 7678 | const inner = try p.addNode(.{ | |
| 7679 | .tag = if (is_arrow) .member_access_ptr_expr else .member_access_expr, | |
| 7680 | .ty = f.ty, | |
| 7681 | .data = .{ .member = .{ .lhs = lhs, .index = @intCast(i) } }, | |
| 7682 | }); | |
| 7683 | const ret = p.fieldAccessExtra(inner, f.ty.getRecord().?, field_name, false, offset_bits); | |
| 7684 | offset_bits.* = f.layout.offset_bits; | |
| 8803 | fn fieldAccessExtra( | |
| 8804 | p: *Parser, | |
| 8805 | base: Node.Index, | |
| 8806 | record_ty: Type.Record, | |
| 8807 | target_name: StringId, | |
| 8808 | is_arrow: bool, | |
| 8809 | access_tok: TokenIndex, | |
| 8810 | offset_bits: *u64, | |
| 8811 | ) Error!Result { | |
| 8812 | for (record_ty.fields, 0..) |field, field_index| { | |
| 8813 | if (field.name_tok == 0) if (field.qt.getRecord(p.comp)) |field_record_ty| { | |
| 8814 | if (!field_record_ty.hasField(p.comp, target_name)) continue; | |
| 8815 | ||
| 8816 | const access: Node.MemberAccess = .{ | |
| 8817 | .access_tok = access_tok, | |
| 8818 | .qt = field.qt, | |
| 8819 | .base = base, | |
| 8820 | .member_index = @intCast(field_index), | |
| 8821 | }; | |
| 8822 | const inner = try p.addNode(if (is_arrow) | |
| 8823 | .{ .member_access_ptr_expr = access } | |
| 8824 | else | |
| 8825 | .{ .member_access_expr = access }); | |
| 8826 | ||
| 8827 | const ret = p.fieldAccessExtra(inner, field_record_ty, target_name, false, access_tok, offset_bits); | |
| 8828 | offset_bits.* = field.layout.offset_bits; | |
| 7685 | 8829 | return ret; |
| 7686 | } | |
| 7687 | if (field_name == f.name) { | |
| 7688 | offset_bits.* = f.layout.offset_bits; | |
| 7689 | return Result{ | |
| 7690 | .ty = f.ty, | |
| 7691 | .node = try p.addNode(.{ | |
| 7692 | .tag = if (is_arrow) .member_access_ptr_expr else .member_access_expr, | |
| 7693 | .ty = f.ty, | |
| 7694 | .data = .{ .member = .{ .lhs = lhs, .index = @intCast(i) } }, | |
| 7695 | }), | |
| 8830 | }; | |
| 8831 | if (target_name == field.name) { | |
| 8832 | offset_bits.* = field.layout.offset_bits; | |
| 8833 | ||
| 8834 | const access: Node.MemberAccess = .{ | |
| 8835 | .access_tok = access_tok, | |
| 8836 | .qt = field.qt, | |
| 8837 | .base = base, | |
| 8838 | .member_index = @intCast(field_index), | |
| 7696 | 8839 | }; |
| 8840 | return .{ .qt = field.qt, .node = try p.addNode(if (is_arrow) | |
| 8841 | .{ .member_access_ptr_expr = access } | |
| 8842 | else | |
| 8843 | .{ .member_access_expr = access }) }; | |
| 7697 | 8844 | } |
| 7698 | 8845 | } |
| 7699 | 8846 | // We already checked that this container has a field by the name. |
| ... | ... | @@ -7703,22 +8850,22 @@ fn fieldAccessExtra(p: *Parser, lhs: NodeIndex, record_ty: *const Type.Record, f |
| 7703 | 8850 | fn checkVaStartArg(p: *Parser, builtin_tok: TokenIndex, first_after: TokenIndex, param_tok: TokenIndex, arg: *Result, idx: u32) !void { |
| 7704 | 8851 | assert(idx != 0); |
| 7705 | 8852 | if (idx > 1) { |
| 7706 | try p.errTok(.closing_paren, first_after); | |
| 8853 | try p.err(first_after, .closing_paren, .{}); | |
| 7707 | 8854 | return error.ParsingFailed; |
| 7708 | 8855 | } |
| 7709 | 8856 | |
| 7710 | var func_ty = p.func.ty orelse { | |
| 7711 | try p.errTok(.va_start_not_in_func, builtin_tok); | |
| 8857 | const func_qt = p.func.qt orelse { | |
| 8858 | try p.err(builtin_tok, .va_start_not_in_func, .{}); | |
| 7712 | 8859 | return; |
| 7713 | 8860 | }; |
| 7714 | const func_params = func_ty.params(); | |
| 7715 | if (func_ty.specifier != .var_args_func or func_params.len == 0) { | |
| 7716 | return p.errTok(.va_start_fixed_args, builtin_tok); | |
| 8861 | const func_ty = func_qt.get(p.comp, .func) orelse return; | |
| 8862 | if (func_ty.kind != .variadic or func_ty.params.len == 0) { | |
| 8863 | return p.err(builtin_tok, .va_start_fixed_args, .{}); | |
| 7717 | 8864 | } |
| 7718 | const last_param_name = func_params[func_params.len - 1].name; | |
| 8865 | const last_param_name = func_ty.params[func_ty.params.len - 1].name; | |
| 7719 | 8866 | const decl_ref = p.getNode(arg.node, .decl_ref_expr); |
| 7720 | if (decl_ref == null or last_param_name != try StrInt.intern(p.comp, p.tokSlice(p.nodes.items(.data)[@intFromEnum(decl_ref.?)].decl_ref))) { | |
| 7721 | try p.errTok(.va_start_not_last_param, param_tok); | |
| 8867 | if (decl_ref == null or last_param_name != try p.comp.internString(p.tokSlice(decl_ref.?.name_tok))) { | |
| 8868 | try p.err(param_tok, .va_start_not_last_param, .{}); | |
| 7722 | 8869 | } |
| 7723 | 8870 | } |
| 7724 | 8871 | |
| ... | ... | @@ -7726,44 +8873,55 @@ fn checkArithOverflowArg(p: *Parser, builtin_tok: TokenIndex, first_after: Token |
| 7726 | 8873 | _ = builtin_tok; |
| 7727 | 8874 | _ = first_after; |
| 7728 | 8875 | if (idx <= 1) { |
| 7729 | if (!arg.ty.isInt()) { | |
| 7730 | return p.errStr(.overflow_builtin_requires_int, param_tok, try p.typeStr(arg.ty)); | |
| 8876 | if (!arg.qt.isRealInt(p.comp)) { | |
| 8877 | return p.err(param_tok, .overflow_builtin_requires_int, .{arg.qt}); | |
| 7731 | 8878 | } |
| 7732 | 8879 | } else if (idx == 2) { |
| 7733 | if (!arg.ty.isPtr()) return p.errStr(.overflow_result_requires_ptr, param_tok, try p.typeStr(arg.ty)); | |
| 7734 | const child = arg.ty.elemType(); | |
| 7735 | 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)); | |
| 8880 | if (!arg.qt.isPointer(p.comp)) return p.err(param_tok, .overflow_result_requires_ptr, .{arg.qt}); | |
| 8881 | const child = arg.qt.childType(p.comp); | |
| 8882 | if (child.scalarKind(p.comp) != .int or child.@"const") return p.err(param_tok, .overflow_result_requires_ptr, .{arg.qt}); | |
| 7736 | 8883 | } |
| 7737 | 8884 | } |
| 7738 | 8885 | |
| 7739 | 8886 | fn checkComplexArg(p: *Parser, builtin_tok: TokenIndex, first_after: TokenIndex, param_tok: TokenIndex, arg: *Result, idx: u32) !void { |
| 7740 | 8887 | _ = builtin_tok; |
| 7741 | 8888 | _ = first_after; |
| 7742 | if (idx <= 1 and !arg.ty.isFloat()) { | |
| 7743 | try p.errStr(.not_floating_type, param_tok, try p.typeStr(arg.ty)); | |
| 8889 | if (idx <= 1 and !arg.qt.isFloat(p.comp)) { | |
| 8890 | try p.err(param_tok, .not_floating_type, .{arg.qt}); | |
| 7744 | 8891 | } else if (idx == 1) { |
| 7745 | 8892 | const prev_idx = p.list_buf.items[p.list_buf.items.len - 1]; |
| 7746 | const prev_ty = p.nodes.items(.ty)[@intFromEnum(prev_idx)]; | |
| 7747 | if (!prev_ty.eql(arg.ty, p.comp, false)) { | |
| 7748 | try p.errStr(.argument_types_differ, param_tok, try p.typePairStrExtra(prev_ty, " vs ", arg.ty)); | |
| 8893 | const prev_qt = prev_idx.qt(&p.tree); | |
| 8894 | if (!prev_qt.eql(arg.qt, p.comp)) { | |
| 8895 | try p.err(param_tok, .argument_types_differ, .{ prev_qt, arg.qt }); | |
| 7749 | 8896 | } |
| 7750 | 8897 | } |
| 7751 | 8898 | } |
| 7752 | 8899 | |
| 7753 | 8900 | fn callExpr(p: *Parser, lhs: Result) Error!Result { |
| 8901 | const gpa = p.comp.gpa; | |
| 7754 | 8902 | const l_paren = p.tok_i; |
| 7755 | 8903 | p.tok_i += 1; |
| 7756 | const ty = lhs.ty.isCallable() orelse { | |
| 7757 | try p.errStr(.not_callable, l_paren, try p.typeStr(lhs.ty)); | |
| 7758 | return error.ParsingFailed; | |
| 8904 | ||
| 8905 | // We cannot refer to the function type here because the pointer to | |
| 8906 | // type_store.extra might get invalidated while parsing args. | |
| 8907 | const func_qt, const params_len, const func_kind = blk: { | |
| 8908 | var base_qt = lhs.qt; | |
| 8909 | if (base_qt.get(p.comp, .pointer)) |pointer_ty| base_qt = pointer_ty.child; | |
| 8910 | if (base_qt.isInvalid()) break :blk .{ base_qt, std.math.maxInt(usize), undefined }; | |
| 8911 | ||
| 8912 | const func_type_qt = base_qt.base(p.comp); | |
| 8913 | if (func_type_qt.type != .func) { | |
| 8914 | try p.err(l_paren, .not_callable, .{lhs.qt}); | |
| 8915 | return error.ParsingFailed; | |
| 8916 | } | |
| 8917 | break :blk .{ func_type_qt.qt, func_type_qt.type.func.params.len, func_type_qt.type.func.kind }; | |
| 7759 | 8918 | }; |
| 7760 | const params = ty.params(); | |
| 8919 | ||
| 7761 | 8920 | var func = lhs; |
| 7762 | try func.lvalConversion(p); | |
| 8921 | try func.lvalConversion(p, l_paren); | |
| 7763 | 8922 | |
| 7764 | 8923 | const list_buf_top = p.list_buf.items.len; |
| 7765 | 8924 | defer p.list_buf.items.len = list_buf_top; |
| 7766 | try p.list_buf.append(func.node); | |
| 7767 | 8925 | var arg_count: u32 = 0; |
| 7768 | 8926 | var first_after = l_paren; |
| 7769 | 8927 | |
| ... | ... | @@ -7771,23 +8929,24 @@ fn callExpr(p: *Parser, lhs: Result) Error!Result { |
| 7771 | 8929 | |
| 7772 | 8930 | while (p.eatToken(.r_paren) == null) { |
| 7773 | 8931 | const param_tok = p.tok_i; |
| 7774 | if (arg_count == params.len) first_after = p.tok_i; | |
| 7775 | var arg = try p.assignExpr(); | |
| 7776 | try arg.expect(p); | |
| 8932 | if (arg_count == params_len) first_after = p.tok_i; | |
| 8933 | var arg = try p.expect(assignExpr); | |
| 7777 | 8934 | |
| 7778 | 8935 | if (call_expr.shouldPerformLvalConversion(arg_count)) { |
| 7779 | try arg.lvalConversion(p); | |
| 8936 | try arg.lvalConversion(p, param_tok); | |
| 7780 | 8937 | } |
| 7781 | if (arg.ty.hasIncompleteSize() and !arg.ty.is(.void)) return error.ParsingFailed; | |
| 8938 | if ((arg.qt.hasIncompleteSize(p.comp) and !arg.qt.is(p.comp, .void)) or arg.qt.isInvalid()) return error.ParsingFailed; | |
| 8939 | ||
| 8940 | if (arg_count >= params_len) { | |
| 8941 | if (call_expr.shouldPromoteVarArg(arg_count)) switch (arg.qt.base(p.comp).type) { | |
| 8942 | .int => |int_ty| if (int_ty == .int) try arg.castToInt(p, arg.qt.promoteInt(p.comp), param_tok), | |
| 8943 | .float => |float_ty| if (float_ty == .double) try arg.castToFloat(p, .double, param_tok), | |
| 8944 | else => {}, | |
| 8945 | }; | |
| 7782 | 8946 | |
| 7783 | if (arg_count >= params.len) { | |
| 7784 | if (call_expr.shouldPromoteVarArg(arg_count)) { | |
| 7785 | if (arg.ty.isInt()) try arg.intCast(p, arg.ty.integerPromotion(p.comp), param_tok); | |
| 7786 | if (arg.ty.is(.float)) try arg.floatCast(p, .{ .specifier = .double }); | |
| 7787 | } | |
| 7788 | 8947 | try call_expr.checkVarArg(p, first_after, param_tok, &arg, arg_count); |
| 7789 | 8948 | try arg.saveValue(p); |
| 7790 | try p.list_buf.append(arg.node); | |
| 8949 | try p.list_buf.append(gpa, arg.node); | |
| 7791 | 8950 | arg_count += 1; |
| 7792 | 8951 | |
| 7793 | 8952 | _ = p.eatToken(.comma) orelse { |
| ... | ... | @@ -7796,29 +8955,33 @@ fn callExpr(p: *Parser, lhs: Result) Error!Result { |
| 7796 | 8955 | }; |
| 7797 | 8956 | continue; |
| 7798 | 8957 | } |
| 7799 | const p_ty = params[arg_count].ty; | |
| 7800 | if (p_ty.specifier == .static_array) { | |
| 7801 | const arg_array_len: u64 = arg.ty.arrayLen() orelse std.math.maxInt(u64); | |
| 7802 | const param_array_len: u64 = p_ty.arrayLen().?; | |
| 7803 | if (arg_array_len < param_array_len) { | |
| 7804 | const extra = Diagnostics.Message.Extra{ .arguments = .{ | |
| 7805 | .expected = @intCast(arg_array_len), | |
| 7806 | .actual = @intCast(param_array_len), | |
| 7807 | } }; | |
| 7808 | try p.errExtra(.array_argument_too_small, param_tok, extra); | |
| 7809 | try p.errTok(.callee_with_static_array, params[arg_count].name_tok); | |
| 7810 | } | |
| 7811 | if (arg.val.isZero(p.comp)) { | |
| 7812 | try p.errTok(.non_null_argument, param_tok); | |
| 7813 | try p.errTok(.callee_with_static_array, params[arg_count].name_tok); | |
| 8958 | ||
| 8959 | if (func_qt.get(p.comp, .func)) |func_ty| { | |
| 8960 | const param = func_ty.params[arg_count]; | |
| 8961 | ||
| 8962 | if (param.qt.get(p.comp, .pointer)) |pointer_ty| static_check: { | |
| 8963 | const decayed_child_qt = pointer_ty.decayed orelse break :static_check; | |
| 8964 | const param_array_ty = decayed_child_qt.get(p.comp, .array).?; | |
| 8965 | if (param_array_ty.len != .static) break :static_check; | |
| 8966 | const param_array_len = param_array_ty.len.static; | |
| 8967 | const arg_array_len = arg.qt.arrayLen(p.comp); | |
| 8968 | ||
| 8969 | if (arg_array_len != null and arg_array_len.? < param_array_len) { | |
| 8970 | try p.err(param_tok, .array_argument_too_small, .{ arg_array_len.?, param_array_len }); | |
| 8971 | try p.err(param.name_tok, .callee_with_static_array, .{}); | |
| 8972 | } | |
| 8973 | if (arg.val.isZero(p.comp)) { | |
| 8974 | try p.err(param_tok, .non_null_argument, .{}); | |
| 8975 | try p.err(param.name_tok, .callee_with_static_array, .{}); | |
| 8976 | } | |
| 7814 | 8977 | } |
| 7815 | } | |
| 7816 | 8978 | |
| 7817 | if (call_expr.shouldCoerceArg(arg_count)) { | |
| 7818 | try arg.coerce(p, p_ty, param_tok, .{ .arg = params[arg_count].name_tok }); | |
| 8979 | if (call_expr.shouldCoerceArg(arg_count)) { | |
| 8980 | try arg.coerce(p, param.qt, param_tok, .{ .arg = param.name_tok }); | |
| 8981 | } | |
| 7819 | 8982 | } |
| 7820 | 8983 | try arg.saveValue(p); |
| 7821 | try p.list_buf.append(arg.node); | |
| 8984 | try p.list_buf.append(gpa, arg.node); | |
| 7822 | 8985 | arg_count += 1; |
| 7823 | 8986 | |
| 7824 | 8987 | _ = p.eatToken(.comma) orelse { |
| ... | ... | @@ -7826,48 +8989,49 @@ fn callExpr(p: *Parser, lhs: Result) Error!Result { |
| 7826 | 8989 | break; |
| 7827 | 8990 | }; |
| 7828 | 8991 | } |
| 8992 | if (func_qt.isInvalid()) { | |
| 8993 | // Skip argument count checks. | |
| 8994 | return try call_expr.finish(p, func_qt, list_buf_top, l_paren); | |
| 8995 | } | |
| 7829 | 8996 | |
| 7830 | const actual: u32 = @intCast(arg_count); | |
| 7831 | const extra = Diagnostics.Message.Extra{ .arguments = .{ | |
| 7832 | .expected = @intCast(params.len), | |
| 7833 | .actual = actual, | |
| 7834 | } }; | |
| 7835 | 8997 | if (call_expr.paramCountOverride()) |expected| { |
| 7836 | if (expected != actual) { | |
| 7837 | try p.errExtra(.expected_arguments, first_after, .{ .arguments = .{ .expected = expected, .actual = actual } }); | |
| 7838 | } | |
| 7839 | } else if (ty.is(.func) and params.len != arg_count) { | |
| 7840 | try p.errExtra(.expected_arguments, first_after, extra); | |
| 7841 | } else if (ty.is(.old_style_func) and params.len != arg_count) { | |
| 7842 | if (params.len == 0) | |
| 7843 | try p.errTok(.passing_args_to_kr, first_after) | |
| 7844 | else | |
| 7845 | try p.errExtra(.expected_arguments_old, first_after, extra); | |
| 7846 | } else if (ty.is(.var_args_func) and arg_count < params.len) { | |
| 7847 | try p.errExtra(.expected_at_least_arguments, first_after, extra); | |
| 8998 | if (expected != arg_count) { | |
| 8999 | try p.err(first_after, .expected_arguments, .{ expected, arg_count }); | |
| 9000 | } | |
| 9001 | } else switch (func_kind) { | |
| 9002 | .normal => if (params_len != arg_count) { | |
| 9003 | try p.err(first_after, .expected_arguments, .{ params_len, arg_count }); | |
| 9004 | }, | |
| 9005 | .variadic => if (arg_count < params_len) { | |
| 9006 | try p.err(first_after, .expected_at_least_arguments, .{ params_len, arg_count }); | |
| 9007 | }, | |
| 9008 | .old_style => if (params_len != arg_count) { | |
| 9009 | if (params_len == 0) | |
| 9010 | try p.err(first_after, .passing_args_to_kr, .{}) | |
| 9011 | else | |
| 9012 | try p.err(first_after, .expected_arguments_old, .{ params_len, arg_count }); | |
| 9013 | }, | |
| 7848 | 9014 | } |
| 7849 | 9015 | |
| 7850 | return call_expr.finish(p, ty, list_buf_top, arg_count); | |
| 9016 | return try call_expr.finish(p, func_qt, list_buf_top, l_paren); | |
| 7851 | 9017 | } |
| 7852 | 9018 | |
| 7853 | 9019 | fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) !void { |
| 7854 | 9020 | if (index.val.opt_ref == .none) return; |
| 7855 | 9021 | |
| 7856 | const array_len = array.ty.arrayLen() orelse return; | |
| 9022 | const array_len = array.qt.arrayLen(p.comp) orelse return; | |
| 7857 | 9023 | if (array_len == 0) return; |
| 7858 | 9024 | |
| 7859 | 9025 | if (array_len == 1) { |
| 7860 | if (p.getNode(array.node, .member_access_expr) orelse p.getNode(array.node, .member_access_ptr_expr)) |node| { | |
| 7861 | const data = p.nodes.items(.data)[@intFromEnum(node)]; | |
| 7862 | var lhs = p.nodes.items(.ty)[@intFromEnum(data.member.lhs)]; | |
| 7863 | if (lhs.get(.pointer)) |ptr| { | |
| 7864 | lhs = ptr.data.sub_type.*; | |
| 7865 | } | |
| 7866 | if (lhs.is(.@"struct")) { | |
| 7867 | const record = lhs.getRecord().?; | |
| 7868 | if (data.member.index + 1 == record.fields.len) { | |
| 9026 | if (p.getNode(array.node, .member_access_expr) orelse p.getNode(array.node, .member_access_ptr_expr)) |access| { | |
| 9027 | var base_ty = access.base.qt(&p.tree); | |
| 9028 | if (base_ty.get(p.comp, .pointer)) |pointer_ty| { | |
| 9029 | base_ty = pointer_ty.child; | |
| 9030 | } | |
| 9031 | if (base_ty.getRecord(p.comp)) |record_ty| { | |
| 9032 | if (access.member_index + 1 == record_ty.fields.len) { | |
| 7869 | 9033 | if (!index.val.isZero(p.comp)) { |
| 7870 | try p.errStr(.old_style_flexible_struct, tok, try index.str(p)); | |
| 9034 | try p.err(tok, .old_style_flexible_struct, .{index}); | |
| 7871 | 9035 | } |
| 7872 | 9036 | return; |
| 7873 | 9037 | } |
| ... | ... | @@ -7875,15 +9039,15 @@ fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) ! |
| 7875 | 9039 | } |
| 7876 | 9040 | } |
| 7877 | 9041 | const index_int = index.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); |
| 7878 | if (index.ty.isUnsignedInt(p.comp)) { | |
| 9042 | if (index.qt.signedness(p.comp) == .unsigned) { | |
| 7879 | 9043 | if (index_int >= array_len) { |
| 7880 | try p.errStr(.array_after, tok, try index.str(p)); | |
| 9044 | try p.err(tok, .array_after, .{index}); | |
| 7881 | 9045 | } |
| 7882 | 9046 | } else { |
| 7883 | if (index.val.compare(.lt, Value.zero, p.comp)) { | |
| 7884 | try p.errStr(.array_before, tok, try index.str(p)); | |
| 9047 | if (index.val.compare(.lt, .zero, p.comp)) { | |
| 9048 | try p.err(tok, .array_before, .{index}); | |
| 7885 | 9049 | } else if (index_int >= array_len) { |
| 7886 | try p.errStr(.array_after, tok, try index.str(p)); | |
| 9050 | try p.err(tok, .array_after, .{index}); | |
| 7887 | 9051 | } |
| 7888 | 9052 | } |
| 7889 | 9053 | } |
| ... | ... | @@ -7900,221 +9064,266 @@ fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) ! |
| 7900 | 9064 | /// | STRING_LITERAL |
| 7901 | 9065 | /// | '(' expr ')' |
| 7902 | 9066 | /// | genericSelection |
| 7903 | fn primaryExpr(p: *Parser) Error!Result { | |
| 9067 | /// | shufflevector | |
| 9068 | /// | convertvector | |
| 9069 | /// | typesCompatible | |
| 9070 | /// | chooseExpr | |
| 9071 | /// | vaStart | |
| 9072 | /// | offsetof | |
| 9073 | fn primaryExpr(p: *Parser) Error!?Result { | |
| 7904 | 9074 | if (p.eatToken(.l_paren)) |l_paren| { |
| 7905 | var e = try p.expr(); | |
| 7906 | try e.expect(p); | |
| 9075 | var grouped_expr = try p.expect(expr); | |
| 7907 | 9076 | try p.expectClosing(l_paren, .r_paren); |
| 7908 | try e.un(p, .paren_expr, l_paren); | |
| 7909 | return e; | |
| 9077 | try grouped_expr.un(p, .paren_expr, l_paren); | |
| 9078 | return grouped_expr; | |
| 7910 | 9079 | } |
| 9080 | ||
| 9081 | const gpa = p.comp.gpa; | |
| 7911 | 9082 | switch (p.tok_ids[p.tok_i]) { |
| 7912 | 9083 | .identifier, .extended_identifier => { |
| 7913 | 9084 | const name_tok = try p.expectIdentifier(); |
| 7914 | 9085 | const name = p.tokSlice(name_tok); |
| 7915 | const interned_name = try StrInt.intern(p.comp, name); | |
| 9086 | const interned_name = try p.comp.internString(name); | |
| 7916 | 9087 | if (interned_name == p.auto_type_decl_name) { |
| 7917 | try p.errStr(.auto_type_self_initialized, name_tok, name); | |
| 9088 | try p.err(name_tok, .auto_type_self_initialized, .{name}); | |
| 7918 | 9089 | return error.ParsingFailed; |
| 7919 | 9090 | } |
| 9091 | ||
| 7920 | 9092 | if (p.syms.findSymbol(interned_name)) |sym| { |
| 7921 | try p.checkDeprecatedUnavailable(sym.ty, name_tok, sym.tok); | |
| 9093 | if (sym.kind == .typedef) { | |
| 9094 | try p.err(name_tok, .unexpected_type_name, .{name}); | |
| 9095 | return error.ParsingFailed; | |
| 9096 | } | |
| 9097 | if (sym.out_of_scope) { | |
| 9098 | try p.err(name_tok, .out_of_scope_use, .{name}); | |
| 9099 | try p.err(sym.tok, .previous_definition, .{}); | |
| 9100 | } | |
| 9101 | try p.checkDeprecatedUnavailable(sym.qt, name_tok, sym.tok); | |
| 7922 | 9102 | if (sym.kind == .constexpr) { |
| 7923 | return Result{ | |
| 9103 | return .{ | |
| 7924 | 9104 | .val = sym.val, |
| 7925 | .ty = sym.ty, | |
| 9105 | .qt = sym.qt, | |
| 7926 | 9106 | .node = try p.addNode(.{ |
| 7927 | .tag = .decl_ref_expr, | |
| 7928 | .ty = sym.ty, | |
| 7929 | .data = .{ .decl_ref = name_tok }, | |
| 7930 | .loc = @enumFromInt(name_tok), | |
| 9107 | .decl_ref_expr = .{ | |
| 9108 | .name_tok = name_tok, | |
| 9109 | .qt = sym.qt, | |
| 9110 | .decl = sym.node.unpack().?, | |
| 9111 | }, | |
| 7931 | 9112 | }), |
| 7932 | 9113 | }; |
| 7933 | 9114 | } |
| 7934 | 9115 | if (sym.val.is(.int, p.comp)) { |
| 7935 | 9116 | switch (p.const_decl_folding) { |
| 7936 | .gnu_folding_extension => try p.errTok(.const_decl_folded, name_tok), | |
| 7937 | .gnu_vla_folding_extension => try p.errTok(.const_decl_folded_vla, name_tok), | |
| 9117 | .gnu_folding_extension => try p.err(name_tok, .const_decl_folded, .{}), | |
| 9118 | .gnu_vla_folding_extension => try p.err(name_tok, .const_decl_folded_vla, .{}), | |
| 7938 | 9119 | else => {}, |
| 7939 | 9120 | } |
| 7940 | 9121 | } |
| 7941 | return Result{ | |
| 9122 | ||
| 9123 | const node = try p.addNode(if (sym.kind == .enumeration) | |
| 9124 | .{ .enumeration_ref = .{ | |
| 9125 | .name_tok = name_tok, | |
| 9126 | .qt = sym.qt, | |
| 9127 | .decl = sym.node.unpack().?, | |
| 9128 | } } | |
| 9129 | else | |
| 9130 | .{ .decl_ref_expr = .{ | |
| 9131 | .name_tok = name_tok, | |
| 9132 | .qt = sym.qt, | |
| 9133 | .decl = sym.node.unpack().?, | |
| 9134 | } }); | |
| 9135 | ||
| 9136 | const res: Result = .{ | |
| 7942 | 9137 | .val = if (p.const_decl_folding == .no_const_decl_folding and sym.kind != .enumeration) Value{} else sym.val, |
| 7943 | .ty = sym.ty, | |
| 7944 | .node = try p.addNode(.{ | |
| 7945 | .tag = if (sym.kind == .enumeration) .enumeration_ref else .decl_ref_expr, | |
| 7946 | .ty = sym.ty, | |
| 7947 | .data = .{ .decl_ref = name_tok }, | |
| 7948 | .loc = @enumFromInt(name_tok), | |
| 7949 | }), | |
| 9138 | .qt = sym.qt, | |
| 9139 | .node = node, | |
| 7950 | 9140 | }; |
| 9141 | try res.putValue(p); | |
| 9142 | return res; | |
| 7951 | 9143 | } |
| 7952 | if (try p.comp.builtins.getOrCreate(p.comp, name, p.arena)) |some| { | |
| 9144 | ||
| 9145 | // Check if this is a builtin call. | |
| 9146 | if (try p.comp.builtins.getOrCreate(p.comp, name)) |some| { | |
| 7953 | 9147 | for (p.tok_ids[p.tok_i..]) |id| switch (id) { |
| 7954 | 9148 | .r_paren => {}, // closing grouped expr |
| 7955 | 9149 | .l_paren => break, // beginning of a call |
| 7956 | 9150 | else => { |
| 7957 | try p.errTok(.builtin_must_be_called, name_tok); | |
| 9151 | try p.err(name_tok, .builtin_must_be_called, .{}); | |
| 7958 | 9152 | return error.ParsingFailed; |
| 7959 | 9153 | }, |
| 7960 | 9154 | }; |
| 7961 | 9155 | if (some.builtin.properties.header != .none) { |
| 7962 | try p.errStr(.implicit_builtin, name_tok, name); | |
| 7963 | try p.errExtra(.implicit_builtin_header_note, name_tok, .{ .builtin_with_header = .{ | |
| 7964 | .builtin = some.builtin.tag, | |
| 7965 | .header = some.builtin.properties.header, | |
| 7966 | } }); | |
| 9156 | try p.err(name_tok, .implicit_builtin, .{name}); | |
| 9157 | try p.err(name_tok, .implicit_builtin_header_note, .{ | |
| 9158 | @tagName(some.builtin.properties.header), Builtin.nameFromTag(some.builtin.tag).span(), | |
| 9159 | }); | |
| 9160 | } | |
| 9161 | ||
| 9162 | switch (some.builtin.tag) { | |
| 9163 | .__builtin_choose_expr => return try p.builtinChooseExpr(), | |
| 9164 | .__builtin_va_arg => return try p.builtinVaArg(name_tok), | |
| 9165 | .__builtin_offsetof => return try p.builtinOffsetof(name_tok, .bytes), | |
| 9166 | .__builtin_bitoffsetof => return try p.builtinOffsetof(name_tok, .bits), | |
| 9167 | .__builtin_types_compatible_p => return try p.typesCompatible(name_tok), | |
| 9168 | .__builtin_convertvector => return try p.convertvector(name_tok), | |
| 9169 | .__builtin_shufflevector => return try p.shufflevector(name_tok), | |
| 9170 | else => {}, | |
| 7967 | 9171 | } |
| 7968 | 9172 | |
| 7969 | return Result{ | |
| 7970 | .ty = some.ty, | |
| 9173 | return .{ | |
| 9174 | .qt = some.qt, | |
| 7971 | 9175 | .node = try p.addNode(.{ |
| 7972 | .tag = .builtin_call_expr_one, | |
| 7973 | .ty = some.ty, | |
| 7974 | .data = .{ .decl = .{ .name = name_tok, .node = .none } }, | |
| 7975 | .loc = @enumFromInt(name_tok), | |
| 9176 | .builtin_ref = .{ | |
| 9177 | .name_tok = name_tok, | |
| 9178 | .qt = some.qt, | |
| 9179 | }, | |
| 7976 | 9180 | }), |
| 7977 | 9181 | }; |
| 7978 | 9182 | } |
| 9183 | ||
| 9184 | // Check for unknown builtin or implicit function declaration. | |
| 7979 | 9185 | if (p.tok_ids[p.tok_i] == .l_paren and !p.comp.langopts.standard.atLeast(.c23)) { |
| 7980 | 9186 | // allow implicitly declaring functions before C99 like `puts("foo")` |
| 7981 | 9187 | if (mem.startsWith(u8, name, "__builtin_")) |
| 7982 | try p.errStr(.unknown_builtin, name_tok, name) | |
| 9188 | try p.err(name_tok, .unknown_builtin, .{name}) | |
| 7983 | 9189 | else |
| 7984 | try p.errStr(.implicit_func_decl, name_tok, name); | |
| 9190 | try p.err(name_tok, .implicit_func_decl, .{name}); | |
| 7985 | 9191 | |
| 7986 | const func_ty = try p.arena.create(Type.Func); | |
| 7987 | func_ty.* = .{ .return_type = .{ .specifier = .int }, .params = &.{} }; | |
| 7988 | const ty: Type = .{ .specifier = .old_style_func, .data = .{ .func = func_ty } }; | |
| 9192 | const func_qt = try p.comp.type_store.put(gpa, .{ .func = .{ | |
| 9193 | .return_type = .int, | |
| 9194 | .kind = .old_style, | |
| 9195 | .params = &.{}, | |
| 9196 | } }); | |
| 7989 | 9197 | const node = try p.addNode(.{ |
| 7990 | .ty = ty, | |
| 7991 | .tag = .fn_proto, | |
| 7992 | .data = .{ .decl = .{ .name = name_tok } }, | |
| 7993 | .loc = @enumFromInt(name_tok), | |
| 9198 | .function = .{ | |
| 9199 | .name_tok = name_tok, | |
| 9200 | .qt = func_qt, | |
| 9201 | .static = false, | |
| 9202 | .@"inline" = false, | |
| 9203 | .definition = null, | |
| 9204 | .body = null, | |
| 9205 | }, | |
| 7994 | 9206 | }); |
| 7995 | 9207 | |
| 7996 | try p.decl_buf.append(node); | |
| 7997 | try p.syms.declareSymbol(p, interned_name, ty, name_tok, node); | |
| 9208 | try p.decl_buf.append(gpa, node); | |
| 9209 | try p.syms.declareSymbol(p, interned_name, func_qt, name_tok, node); | |
| 7998 | 9210 | |
| 7999 | return Result{ | |
| 8000 | .ty = ty, | |
| 9211 | return .{ | |
| 9212 | .qt = func_qt, | |
| 8001 | 9213 | .node = try p.addNode(.{ |
| 8002 | .tag = .decl_ref_expr, | |
| 8003 | .ty = ty, | |
| 8004 | .data = .{ .decl_ref = name_tok }, | |
| 8005 | .loc = @enumFromInt(name_tok), | |
| 9214 | .decl_ref_expr = .{ | |
| 9215 | .name_tok = name_tok, | |
| 9216 | .qt = func_qt, | |
| 9217 | .decl = node, | |
| 9218 | }, | |
| 8006 | 9219 | }), |
| 8007 | 9220 | }; |
| 8008 | 9221 | } |
| 8009 | try p.errStr(.undeclared_identifier, name_tok, p.tokSlice(name_tok)); | |
| 9222 | ||
| 9223 | try p.err(name_tok, .undeclared_identifier, .{p.tokSlice(name_tok)}); | |
| 8010 | 9224 | return error.ParsingFailed; |
| 8011 | 9225 | }, |
| 8012 | 9226 | .keyword_true, .keyword_false => |id| { |
| 8013 | 9227 | const tok_i = p.tok_i; |
| 8014 | 9228 | p.tok_i += 1; |
| 8015 | const res = Result{ | |
| 8016 | .val = Value.fromBool(id == .keyword_true), | |
| 8017 | .ty = .{ .specifier = .bool }, | |
| 8018 | .node = try p.addNode(.{ .tag = .bool_literal, .ty = .{ .specifier = .bool }, .data = undefined, .loc = @enumFromInt(tok_i) }), | |
| 9229 | const res: Result = .{ | |
| 9230 | .val = .fromBool(id == .keyword_true), | |
| 9231 | .qt = .bool, | |
| 9232 | .node = try p.addNode(.{ | |
| 9233 | .bool_literal = .{ | |
| 9234 | .qt = .bool, | |
| 9235 | .literal_tok = tok_i, | |
| 9236 | }, | |
| 9237 | }), | |
| 8019 | 9238 | }; |
| 8020 | 9239 | std.debug.assert(!p.in_macro); // Should have been replaced with .one / .zero |
| 8021 | try p.value_map.put(res.node, res.val); | |
| 9240 | try res.putValue(p); | |
| 8022 | 9241 | return res; |
| 8023 | 9242 | }, |
| 8024 | 9243 | .keyword_nullptr => { |
| 8025 | 9244 | defer p.tok_i += 1; |
| 8026 | try p.errStr(.pre_c23_compat, p.tok_i, "'nullptr'"); | |
| 8027 | return Result{ | |
| 8028 | .val = Value.null, | |
| 8029 | .ty = .{ .specifier = .nullptr_t }, | |
| 9245 | try p.err(p.tok_i, .pre_c23_compat, .{"'nullptr'"}); | |
| 9246 | return .{ | |
| 9247 | .val = .null, | |
| 9248 | .qt = .nullptr_t, | |
| 8030 | 9249 | .node = try p.addNode(.{ |
| 8031 | .tag = .nullptr_literal, | |
| 8032 | .ty = .{ .specifier = .nullptr_t }, | |
| 8033 | .data = undefined, | |
| 8034 | .loc = @enumFromInt(p.tok_i), | |
| 9250 | .nullptr_literal = .{ | |
| 9251 | .qt = .nullptr_t, | |
| 9252 | .literal_tok = p.tok_i, | |
| 9253 | }, | |
| 8035 | 9254 | }), |
| 8036 | 9255 | }; |
| 8037 | 9256 | }, |
| 8038 | 9257 | .macro_func, .macro_function => { |
| 8039 | 9258 | defer p.tok_i += 1; |
| 8040 | var ty: Type = undefined; | |
| 9259 | var ty: QualType = undefined; | |
| 8041 | 9260 | var tok = p.tok_i; |
| 9261 | ||
| 8042 | 9262 | if (p.func.ident) |some| { |
| 8043 | ty = some.ty; | |
| 8044 | tok = p.nodes.items(.data)[@intFromEnum(some.node)].decl.name; | |
| 8045 | } else if (p.func.ty) |_| { | |
| 9263 | ty = some.qt; | |
| 9264 | tok = some.node.get(&p.tree).variable.name_tok; | |
| 9265 | } else if (p.func.qt) |_| { | |
| 8046 | 9266 | const strings_top = p.strings.items.len; |
| 8047 | 9267 | defer p.strings.items.len = strings_top; |
| 8048 | 9268 | |
| 8049 | try p.strings.appendSlice(p.tokSlice(p.func.name)); | |
| 8050 | try p.strings.append(0); | |
| 8051 | const predef = try p.makePredefinedIdentifier(strings_top); | |
| 8052 | ty = predef.ty; | |
| 9269 | const name = p.tokSlice(p.func.name); | |
| 9270 | try p.strings.ensureUnusedCapacity(gpa, name.len + 1); | |
| 9271 | ||
| 9272 | p.strings.appendSliceAssumeCapacity(name); | |
| 9273 | p.strings.appendAssumeCapacity(0); | |
| 9274 | const predef = try p.makePredefinedIdentifier(p.strings.items[strings_top..]); | |
| 9275 | ty = predef.qt; | |
| 8053 | 9276 | p.func.ident = predef; |
| 8054 | 9277 | } else { |
| 8055 | const strings_top = p.strings.items.len; | |
| 8056 | defer p.strings.items.len = strings_top; | |
| 8057 | ||
| 8058 | try p.strings.append(0); | |
| 8059 | const predef = try p.makePredefinedIdentifier(strings_top); | |
| 8060 | ty = predef.ty; | |
| 9278 | const predef = try p.makePredefinedIdentifier("\x00"); | |
| 9279 | ty = predef.qt; | |
| 8061 | 9280 | p.func.ident = predef; |
| 8062 | try p.decl_buf.append(predef.node); | |
| 9281 | try p.decl_buf.append(gpa, predef.node); | |
| 8063 | 9282 | } |
| 8064 | if (p.func.ty == null) try p.err(.predefined_top_level); | |
| 8065 | return Result{ | |
| 8066 | .ty = ty, | |
| 9283 | if (p.func.qt == null) try p.err(p.tok_i, .predefined_top_level, .{}); | |
| 9284 | ||
| 9285 | return .{ | |
| 9286 | .qt = ty, | |
| 8067 | 9287 | .node = try p.addNode(.{ |
| 8068 | .tag = .decl_ref_expr, | |
| 8069 | .ty = ty, | |
| 8070 | .data = .{ .decl_ref = tok }, | |
| 8071 | .loc = @enumFromInt(tok), | |
| 9288 | .decl_ref_expr = .{ | |
| 9289 | .name_tok = tok, | |
| 9290 | .qt = ty, | |
| 9291 | .decl = p.func.ident.?.node, | |
| 9292 | }, | |
| 8072 | 9293 | }), |
| 8073 | 9294 | }; |
| 8074 | 9295 | }, |
| 8075 | 9296 | .macro_pretty_func => { |
| 8076 | 9297 | defer p.tok_i += 1; |
| 8077 | var ty: Type = undefined; | |
| 9298 | var qt: QualType = undefined; | |
| 8078 | 9299 | if (p.func.pretty_ident) |some| { |
| 8079 | ty = some.ty; | |
| 8080 | } else if (p.func.ty) |func_ty| { | |
| 8081 | const strings_top = p.strings.items.len; | |
| 8082 | defer p.strings.items.len = strings_top; | |
| 9300 | qt = some.qt; | |
| 9301 | } else if (p.func.qt) |func_qt| { | |
| 9302 | var sf = std.heap.stackFallback(1024, gpa); | |
| 9303 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 9304 | defer allocating.deinit(); | |
| 8083 | 9305 | |
| 8084 | const mapper = p.comp.string_interner.getSlowTypeMapper(); | |
| 8085 | { | |
| 8086 | var unmanaged = p.strings.moveToUnmanaged(); | |
| 8087 | var allocating: std.Io.Writer.Allocating = .fromArrayList(p.comp.gpa, &unmanaged); | |
| 8088 | defer { | |
| 8089 | unmanaged = allocating.toArrayList(); | |
| 8090 | p.strings = unmanaged.toManaged(p.comp.gpa); | |
| 8091 | } | |
| 8092 | Type.printNamed(func_ty, p.tokSlice(p.func.name), mapper, p.comp.langopts, &allocating.writer) catch |e| switch (e) { | |
| 8093 | error.WriteFailed => return error.OutOfMemory, | |
| 8094 | }; | |
| 8095 | } | |
| 8096 | try p.strings.append(0); | |
| 8097 | const predef = try p.makePredefinedIdentifier(strings_top); | |
| 8098 | ty = predef.ty; | |
| 9306 | func_qt.printNamed(p.tokSlice(p.func.name), p.comp, &allocating.writer) catch return error.OutOfMemory; | |
| 9307 | allocating.writer.writeByte(0) catch return error.OutOfMemory; | |
| 9308 | ||
| 9309 | const predef = try p.makePredefinedIdentifier(allocating.written()); | |
| 9310 | qt = predef.qt; | |
| 8099 | 9311 | p.func.pretty_ident = predef; |
| 8100 | 9312 | } else { |
| 8101 | const strings_top = p.strings.items.len; | |
| 8102 | defer p.strings.items.len = strings_top; | |
| 8103 | ||
| 8104 | try p.strings.appendSlice("top level\x00"); | |
| 8105 | const predef = try p.makePredefinedIdentifier(strings_top); | |
| 8106 | ty = predef.ty; | |
| 9313 | const predef = try p.makePredefinedIdentifier("top level\x00"); | |
| 9314 | qt = predef.qt; | |
| 8107 | 9315 | p.func.pretty_ident = predef; |
| 8108 | try p.decl_buf.append(predef.node); | |
| 9316 | try p.decl_buf.append(gpa, predef.node); | |
| 8109 | 9317 | } |
| 8110 | if (p.func.ty == null) try p.err(.predefined_top_level); | |
| 8111 | return Result{ | |
| 8112 | .ty = ty, | |
| 9318 | if (p.func.qt == null) try p.err(p.tok_i, .predefined_top_level, .{}); | |
| 9319 | return .{ | |
| 9320 | .qt = qt, | |
| 8113 | 9321 | .node = try p.addNode(.{ |
| 8114 | .tag = .decl_ref_expr, | |
| 8115 | .ty = ty, | |
| 8116 | .data = .{ .decl_ref = p.tok_i }, | |
| 8117 | .loc = @enumFromInt(p.tok_i), | |
| 9322 | .decl_ref_expr = .{ | |
| 9323 | .name_tok = p.tok_i, | |
| 9324 | .qt = qt, | |
| 9325 | .decl = p.func.pretty_ident.?.node, | |
| 9326 | }, | |
| 8118 | 9327 | }), |
| 8119 | 9328 | }; |
| 8120 | 9329 | }, |
| ... | ... | @@ -8124,7 +9333,7 @@ fn primaryExpr(p: *Parser) Error!Result { |
| 8124 | 9333 | .string_literal_utf_32, |
| 8125 | 9334 | .string_literal_wide, |
| 8126 | 9335 | .unterminated_string_literal, |
| 8127 | => return p.stringLiteral(), | |
| 9336 | => return try p.stringLiteral(), | |
| 8128 | 9337 | .char_literal, |
| 8129 | 9338 | .char_literal_utf_8, |
| 8130 | 9339 | .char_literal_utf_16, |
| ... | ... | @@ -8132,22 +9341,30 @@ fn primaryExpr(p: *Parser) Error!Result { |
| 8132 | 9341 | .char_literal_wide, |
| 8133 | 9342 | .empty_char_literal, |
| 8134 | 9343 | .unterminated_char_literal, |
| 8135 | => return p.charLiteral(), | |
| 9344 | => return try p.charLiteral(), | |
| 8136 | 9345 | .zero => { |
| 8137 | 9346 | defer p.tok_i += 1; |
| 8138 | var res: Result = .{ .val = Value.zero, .ty = if (p.in_macro) p.comp.types.intmax else Type.int }; | |
| 8139 | res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); | |
| 8140 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9347 | const int_qt: QualType = if (p.in_macro) p.comp.type_store.intmax else .int; | |
| 9348 | const res: Result = .{ | |
| 9349 | .val = .zero, | |
| 9350 | .qt = int_qt, | |
| 9351 | .node = try p.addNode(.{ .int_literal = .{ .qt = int_qt, .literal_tok = p.tok_i } }), | |
| 9352 | }; | |
| 9353 | try res.putValue(p); | |
| 8141 | 9354 | return res; |
| 8142 | 9355 | }, |
| 8143 | 9356 | .one => { |
| 8144 | 9357 | defer p.tok_i += 1; |
| 8145 | var res: Result = .{ .val = Value.one, .ty = if (p.in_macro) p.comp.types.intmax else Type.int }; | |
| 8146 | res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); | |
| 8147 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9358 | const int_qt: QualType = if (p.in_macro) p.comp.type_store.intmax else .int; | |
| 9359 | const res: Result = .{ | |
| 9360 | .val = .one, | |
| 9361 | .qt = int_qt, | |
| 9362 | .node = try p.addNode(.{ .int_literal = .{ .qt = int_qt, .literal_tok = p.tok_i } }), | |
| 9363 | }; | |
| 9364 | try res.putValue(p); | |
| 8148 | 9365 | return res; |
| 8149 | 9366 | }, |
| 8150 | .pp_num => return p.ppNum(), | |
| 9367 | .pp_num => return try p.ppNum(), | |
| 8151 | 9368 | .embed_byte => { |
| 8152 | 9369 | assert(!p.in_macro); |
| 8153 | 9370 | const loc = p.pp.tokens.items(.loc)[p.tok_i]; |
| ... | ... | @@ -8159,49 +9376,57 @@ fn primaryExpr(p: *Parser) Error!Result { |
| 8159 | 9376 | byte *= 10; |
| 8160 | 9377 | byte += c - '0'; |
| 8161 | 9378 | } |
| 8162 | var res: Result = .{ .val = try Value.int(byte, p.comp) }; | |
| 8163 | res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); | |
| 8164 | try p.value_map.put(res.node, res.val); | |
| 9379 | const res: Result = .{ | |
| 9380 | .val = try Value.int(byte, p.comp), | |
| 9381 | .qt = .int, | |
| 9382 | .node = try p.addNode(.{ .int_literal = .{ .qt = .int, .literal_tok = p.tok_i } }), | |
| 9383 | }; | |
| 9384 | try res.putValue(p); | |
| 8165 | 9385 | return res; |
| 8166 | 9386 | }, |
| 8167 | 9387 | .keyword_generic => return p.genericSelection(), |
| 8168 | else => return Result{}, | |
| 9388 | else => return null, | |
| 8169 | 9389 | } |
| 8170 | 9390 | } |
| 8171 | 9391 | |
| 8172 | fn makePredefinedIdentifier(p: *Parser, strings_top: usize) !Result { | |
| 8173 | const end: u32 = @intCast(p.strings.items.len); | |
| 8174 | const elem_ty: Type = .{ .specifier = .char, .qual = .{ .@"const" = true } }; | |
| 8175 | const arr_ty = try p.arena.create(Type.Array); | |
| 8176 | arr_ty.* = .{ .elem = elem_ty, .len = end - strings_top }; | |
| 8177 | const ty: Type = .{ .specifier = .array, .data = .{ .array = arr_ty } }; | |
| 9392 | fn makePredefinedIdentifier(p: *Parser, slice: []const u8) !Result { | |
| 9393 | const gpa = p.comp.gpa; | |
| 9394 | const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 9395 | .elem = .{ .@"const" = true, ._index = .int_char }, | |
| 9396 | .len = .{ .fixed = slice.len }, | |
| 9397 | } }); | |
| 8178 | 9398 | |
| 8179 | const slice = p.strings.items[strings_top..]; | |
| 8180 | 9399 | const val = try Value.intern(p.comp, .{ .bytes = slice }); |
| 8181 | 9400 | |
| 8182 | const str_lit = try p.addNode(.{ .tag = .string_literal_expr, .ty = ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); | |
| 8183 | if (!p.in_macro) try p.value_map.put(str_lit, val); | |
| 8184 | ||
| 8185 | return Result{ .ty = ty, .node = try p.addNode(.{ | |
| 8186 | .tag = .implicit_static_var, | |
| 8187 | .ty = ty, | |
| 8188 | .data = .{ .decl = .{ .name = p.tok_i, .node = str_lit } }, | |
| 8189 | .loc = @enumFromInt(p.tok_i), | |
| 9401 | const str_lit = try p.addNode(.{ .string_literal_expr = .{ .qt = array_qt, .literal_tok = p.tok_i, .kind = .ascii } }); | |
| 9402 | if (!p.in_macro) try p.tree.value_map.put(gpa, str_lit, val); | |
| 9403 | ||
| 9404 | return .{ .qt = array_qt, .node = try p.addNode(.{ | |
| 9405 | .variable = .{ | |
| 9406 | .name_tok = p.tok_i, | |
| 9407 | .qt = array_qt, | |
| 9408 | .storage_class = .static, | |
| 9409 | .thread_local = false, | |
| 9410 | .implicit = true, | |
| 9411 | .initializer = str_lit, | |
| 9412 | .definition = null, | |
| 9413 | }, | |
| 8190 | 9414 | }) }; |
| 8191 | 9415 | } |
| 8192 | 9416 | |
| 8193 | 9417 | fn stringLiteral(p: *Parser) Error!Result { |
| 9418 | const gpa = p.comp.gpa; | |
| 8194 | 9419 | const string_start = p.tok_i; |
| 8195 | 9420 | var string_end = p.tok_i; |
| 8196 | 9421 | var string_kind: text_literal.Kind = .char; |
| 8197 | 9422 | while (text_literal.Kind.classify(p.tok_ids[string_end], .string_literal)) |next| : (string_end += 1) { |
| 8198 | 9423 | string_kind = string_kind.concat(next) catch { |
| 8199 | try p.errTok(.unsupported_str_cat, string_end); | |
| 9424 | try p.err(string_end, .unsupported_str_cat, .{}); | |
| 8200 | 9425 | while (p.tok_ids[p.tok_i].isStringLiteral()) : (p.tok_i += 1) {} |
| 8201 | 9426 | return error.ParsingFailed; |
| 8202 | 9427 | }; |
| 8203 | 9428 | if (string_kind == .unterminated) { |
| 8204 | try p.errTok(.unterminated_string_literal_error, string_end); | |
| 9429 | // Diagnostic issued in preprocessor. | |
| 8205 | 9430 | p.tok_i = string_end + 1; |
| 8206 | 9431 | return error.ParsingFailed; |
| 8207 | 9432 | } |
| ... | ... | @@ -8215,15 +9440,23 @@ fn stringLiteral(p: *Parser) Error!Result { |
| 8215 | 9440 | defer p.strings.items.len = strings_top; |
| 8216 | 9441 | |
| 8217 | 9442 | const literal_start = mem.alignForward(usize, strings_top, @intFromEnum(char_width)); |
| 8218 | try p.strings.resize(literal_start); | |
| 9443 | try p.strings.resize(gpa, literal_start); | |
| 8219 | 9444 | |
| 8220 | 9445 | while (p.tok_i < string_end) : (p.tok_i += 1) { |
| 8221 | 9446 | const this_kind = text_literal.Kind.classify(p.tok_ids[p.tok_i], .string_literal).?; |
| 8222 | 9447 | const slice = this_kind.contentSlice(p.tokSlice(p.tok_i)); |
| 8223 | var char_literal_parser = text_literal.Parser.init(slice, this_kind, 0x10ffff, p.comp); | |
| 9448 | var char_literal_parser: text_literal.Parser = .{ | |
| 9449 | .comp = p.comp, | |
| 9450 | .literal = slice, | |
| 9451 | .kind = this_kind, | |
| 9452 | .max_codepoint = 0x10ffff, | |
| 9453 | .loc = p.pp.tokens.items(.loc)[p.tok_i], | |
| 9454 | .expansion_locs = p.pp.expansionSlice(p.tok_i), | |
| 9455 | .incorrect_encoding_is_error = count > 1, | |
| 9456 | }; | |
| 8224 | 9457 | |
| 8225 | try p.strings.ensureUnusedCapacity((slice.len + 1) * @intFromEnum(char_width)); // +1 for null terminator | |
| 8226 | while (char_literal_parser.next()) |item| switch (item) { | |
| 9458 | try p.strings.ensureUnusedCapacity(gpa, (slice.len + 1) * @intFromEnum(char_width)); // +1 for null terminator | |
| 9459 | while (try char_literal_parser.next()) |item| switch (item) { | |
| 8227 | 9460 | .value => |v| { |
| 8228 | 9461 | switch (char_width) { |
| 8229 | 9462 | .@"1" => p.strings.appendAssumeCapacity(@intCast(v)), |
| ... | ... | @@ -8258,7 +9491,6 @@ fn stringLiteral(p: *Parser) Error!Result { |
| 8258 | 9491 | }, |
| 8259 | 9492 | .improperly_encoded => |bytes| { |
| 8260 | 9493 | if (count > 1) { |
| 8261 | try p.errTok(.illegal_char_encoding_error, p.tok_i); | |
| 8262 | 9494 | return error.ParsingFailed; |
| 8263 | 9495 | } |
| 8264 | 9496 | p.strings.appendSliceAssumeCapacity(bytes); |
| ... | ... | @@ -8271,7 +9503,7 @@ fn stringLiteral(p: *Parser) Error!Result { |
| 8271 | 9503 | const dest_len = std.mem.alignBackward(usize, capacity_slice.len, 2); |
| 8272 | 9504 | const dest = std.mem.bytesAsSlice(u16, capacity_slice[0..dest_len]); |
| 8273 | 9505 | const words_written = std.unicode.utf8ToUtf16Le(dest, view.bytes) catch unreachable; |
| 8274 | p.strings.resize(p.strings.items.len + words_written * 2) catch unreachable; | |
| 9506 | p.strings.resize(gpa, p.strings.items.len + words_written * 2) catch unreachable; | |
| 8275 | 9507 | }, |
| 8276 | 9508 | .@"4" => { |
| 8277 | 9509 | var it = view.iterator(); |
| ... | ... | @@ -8283,9 +9515,6 @@ fn stringLiteral(p: *Parser) Error!Result { |
| 8283 | 9515 | } |
| 8284 | 9516 | }, |
| 8285 | 9517 | }; |
| 8286 | for (char_literal_parser.errors()) |item| { | |
| 8287 | try p.errExtra(item.tag, p.tok_i, item.extra); | |
| 8288 | } | |
| 8289 | 9518 | } |
| 8290 | 9519 | p.strings.appendNTimesAssumeCapacity(0, @intFromEnum(char_width)); |
| 8291 | 9520 | const slice = p.strings.items[literal_start..]; |
| ... | ... | @@ -8296,42 +9525,52 @@ fn stringLiteral(p: *Parser) Error!Result { |
| 8296 | 9525 | p.comp.interner.strings.items.len, |
| 8297 | 9526 | string_kind.internalStorageAlignment(p.comp), |
| 8298 | 9527 | ); |
| 8299 | try p.comp.interner.strings.resize(p.gpa, interned_align); | |
| 9528 | try p.comp.interner.strings.resize(gpa, interned_align); | |
| 8300 | 9529 | |
| 8301 | 9530 | const val = try Value.intern(p.comp, .{ .bytes = slice }); |
| 8302 | 9531 | |
| 8303 | const arr_ty = try p.arena.create(Type.Array); | |
| 8304 | arr_ty.* = .{ .elem = string_kind.elementType(p.comp), .len = @divExact(slice.len, @intFromEnum(char_width)) }; | |
| 8305 | var res: Result = .{ | |
| 8306 | .ty = .{ | |
| 8307 | .specifier = .array, | |
| 8308 | .data = .{ .array = arr_ty }, | |
| 8309 | }, | |
| 9532 | const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ | |
| 9533 | .elem = string_kind.elementType(p.comp), | |
| 9534 | .len = .{ .fixed = @divExact(slice.len, @intFromEnum(char_width)) }, | |
| 9535 | } }); | |
| 9536 | const res: Result = .{ | |
| 9537 | .qt = array_qt, | |
| 8310 | 9538 | .val = val, |
| 9539 | .node = try p.addNode(.{ .string_literal_expr = .{ | |
| 9540 | .literal_tok = string_start, | |
| 9541 | .qt = array_qt, | |
| 9542 | .kind = switch (string_kind) { | |
| 9543 | .char, .unterminated => .ascii, | |
| 9544 | .wide => .wide, | |
| 9545 | .utf_8 => .utf8, | |
| 9546 | .utf_16 => .utf16, | |
| 9547 | .utf_32 => .utf32, | |
| 9548 | }, | |
| 9549 | } }), | |
| 8311 | 9550 | }; |
| 8312 | res.node = try p.addNode(.{ .tag = .string_literal_expr, .ty = res.ty, .data = undefined, .loc = @enumFromInt(string_start) }); | |
| 8313 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9551 | try res.putValue(p); | |
| 8314 | 9552 | return res; |
| 8315 | 9553 | } |
| 8316 | 9554 | |
| 8317 | fn charLiteral(p: *Parser) Error!Result { | |
| 9555 | fn charLiteral(p: *Parser) Error!?Result { | |
| 8318 | 9556 | defer p.tok_i += 1; |
| 8319 | 9557 | const tok_id = p.tok_ids[p.tok_i]; |
| 8320 | 9558 | const char_kind = text_literal.Kind.classify(tok_id, .char_literal) orelse { |
| 8321 | 9559 | if (tok_id == .empty_char_literal) { |
| 8322 | try p.err(.empty_char_literal_error); | |
| 9560 | try p.err(p.tok_i, .empty_char_literal_error, .{}); | |
| 8323 | 9561 | } else if (tok_id == .unterminated_char_literal) { |
| 8324 | try p.err(.unterminated_char_literal_error); | |
| 9562 | try p.err(p.tok_i, .unterminated_char_literal_error, .{}); | |
| 8325 | 9563 | } else unreachable; |
| 8326 | 9564 | return .{ |
| 8327 | .ty = Type.int, | |
| 8328 | .val = Value.zero, | |
| 8329 | .node = try p.addNode(.{ .tag = .char_literal, .ty = Type.int, .data = undefined, .loc = @enumFromInt(p.tok_i) }), | |
| 9565 | .qt = .int, | |
| 9566 | .val = .zero, | |
| 9567 | .node = try p.addNode(.{ .char_literal = .{ .qt = .int, .literal_tok = p.tok_i, .kind = .ascii } }), | |
| 8330 | 9568 | }; |
| 8331 | 9569 | }; |
| 8332 | if (char_kind == .utf_8) try p.err(.u8_char_lit); | |
| 9570 | if (char_kind == .utf_8) try p.err(p.tok_i, .u8_char_lit, .{}); | |
| 8333 | 9571 | var val: u32 = 0; |
| 8334 | 9572 | |
| 9573 | const gpa = p.comp.gpa; | |
| 8335 | 9574 | const slice = char_kind.contentSlice(p.tokSlice(p.tok_i)); |
| 8336 | 9575 | |
| 8337 | 9576 | var is_multichar = false; |
| ... | ... | @@ -8340,30 +9579,40 @@ fn charLiteral(p: *Parser) Error!Result { |
| 8340 | 9579 | val = slice[0]; |
| 8341 | 9580 | } else { |
| 8342 | 9581 | const max_codepoint = char_kind.maxCodepoint(p.comp); |
| 8343 | var char_literal_parser = text_literal.Parser.init(slice, char_kind, max_codepoint, p.comp); | |
| 9582 | var char_literal_parser: text_literal.Parser = .{ | |
| 9583 | .comp = p.comp, | |
| 9584 | .literal = slice, | |
| 9585 | .kind = char_kind, | |
| 9586 | .max_codepoint = max_codepoint, | |
| 9587 | .loc = p.pp.tokens.items(.loc)[p.tok_i], | |
| 9588 | .expansion_locs = p.pp.expansionSlice(p.tok_i), | |
| 9589 | }; | |
| 8344 | 9590 | |
| 8345 | 9591 | const max_chars_expected = 4; |
| 8346 | var stack_fallback = std.heap.stackFallback(max_chars_expected * @sizeOf(u32), p.comp.gpa); | |
| 8347 | var chars = std.array_list.Managed(u32).initCapacity(stack_fallback.get(), max_chars_expected) catch unreachable; // stack allocation already succeeded | |
| 8348 | defer chars.deinit(); | |
| 9592 | var sf = std.heap.stackFallback(max_chars_expected * @sizeOf(u32), gpa); | |
| 9593 | const allocator = sf.get(); | |
| 9594 | var chars: std.ArrayList(u32) = .empty; | |
| 9595 | defer chars.deinit(allocator); | |
| 8349 | 9596 | |
| 8350 | while (char_literal_parser.next()) |item| switch (item) { | |
| 8351 | .value => |v| try chars.append(v), | |
| 8352 | .codepoint => |c| try chars.append(c), | |
| 9597 | chars.ensureUnusedCapacity(allocator, max_chars_expected) catch unreachable; // stack allocation already succeeded | |
| 9598 | ||
| 9599 | while (try char_literal_parser.next()) |item| switch (item) { | |
| 9600 | .value => |v| try chars.append(allocator, v), | |
| 9601 | .codepoint => |c| try chars.append(allocator, c), | |
| 8353 | 9602 | .improperly_encoded => |s| { |
| 8354 | try chars.ensureUnusedCapacity(s.len); | |
| 9603 | try chars.ensureUnusedCapacity(allocator, s.len); | |
| 8355 | 9604 | for (s) |c| chars.appendAssumeCapacity(c); |
| 8356 | 9605 | }, |
| 8357 | 9606 | .utf8_text => |view| { |
| 8358 | 9607 | var it = view.iterator(); |
| 8359 | 9608 | var max_codepoint_seen: u21 = 0; |
| 8360 | try chars.ensureUnusedCapacity(view.bytes.len); | |
| 9609 | try chars.ensureUnusedCapacity(allocator, view.bytes.len); | |
| 8361 | 9610 | while (it.nextCodepoint()) |c| { |
| 8362 | 9611 | max_codepoint_seen = @max(max_codepoint_seen, c); |
| 8363 | 9612 | chars.appendAssumeCapacity(c); |
| 8364 | 9613 | } |
| 8365 | 9614 | if (max_codepoint_seen > max_codepoint) { |
| 8366 | char_literal_parser.err(.char_too_large, .{ .none = {} }); | |
| 9615 | try char_literal_parser.err(.char_too_large, .{}); | |
| 8367 | 9616 | } |
| 8368 | 9617 | }, |
| 8369 | 9618 | }; |
| ... | ... | @@ -8371,16 +9620,16 @@ fn charLiteral(p: *Parser) Error!Result { |
| 8371 | 9620 | is_multichar = chars.items.len > 1; |
| 8372 | 9621 | if (is_multichar) { |
| 8373 | 9622 | if (char_kind == .char and chars.items.len == 4) { |
| 8374 | char_literal_parser.warn(.four_char_char_literal, .{ .none = {} }); | |
| 9623 | try char_literal_parser.warn(.four_char_char_literal, .{}); | |
| 8375 | 9624 | } else if (char_kind == .char) { |
| 8376 | char_literal_parser.warn(.multichar_literal_warning, .{ .none = {} }); | |
| 9625 | try char_literal_parser.warn(.multichar_literal_warning, .{}); | |
| 8377 | 9626 | } else { |
| 8378 | const kind = switch (char_kind) { | |
| 9627 | const kind: []const u8 = switch (char_kind) { | |
| 8379 | 9628 | .wide => "wide", |
| 8380 | 9629 | .utf_8, .utf_16, .utf_32 => "Unicode", |
| 8381 | 9630 | else => unreachable, |
| 8382 | 9631 | }; |
| 8383 | char_literal_parser.err(.invalid_multichar_literal, .{ .str = kind }); | |
| 9632 | try char_literal_parser.err(.invalid_multichar_literal, .{kind}); | |
| 8384 | 9633 | } |
| 8385 | 9634 | } |
| 8386 | 9635 | |
| ... | ... | @@ -8396,20 +9645,17 @@ fn charLiteral(p: *Parser) Error!Result { |
| 8396 | 9645 | } |
| 8397 | 9646 | |
| 8398 | 9647 | if (multichar_overflow) { |
| 8399 | char_literal_parser.err(.char_lit_too_wide, .{ .none = {} }); | |
| 8400 | } | |
| 8401 | ||
| 8402 | for (char_literal_parser.errors()) |item| { | |
| 8403 | try p.errExtra(item.tag, p.tok_i, item.extra); | |
| 9648 | try char_literal_parser.err(.char_lit_too_wide, .{}); | |
| 8404 | 9649 | } |
| 8405 | 9650 | } |
| 8406 | 9651 | |
| 8407 | const ty = char_kind.charLiteralType(p.comp); | |
| 9652 | const char_literal_qt = char_kind.charLiteralType(p.comp); | |
| 8408 | 9653 | // This is the type the literal will have if we're in a macro; macros always operate on intmax_t/uintmax_t values |
| 8409 | const macro_ty = if (ty.isUnsignedInt(p.comp) or (char_kind == .char and p.comp.getCharSignedness() == .unsigned)) | |
| 8410 | p.comp.types.intmax.makeIntegerUnsigned() | |
| 9654 | const macro_qt = if (char_literal_qt.signedness(p.comp) == .unsigned or | |
| 9655 | (char_kind == .char and p.comp.getCharSignedness() == .unsigned)) | |
| 9656 | try p.comp.type_store.intmax.makeIntUnsigned(p.comp) | |
| 8411 | 9657 | else |
| 8412 | p.comp.types.intmax; | |
| 9658 | p.comp.type_store.intmax; | |
| 8413 | 9659 | |
| 8414 | 9660 | var value = try Value.int(val, p.comp); |
| 8415 | 9661 | // C99 6.4.4.4.10 |
| ... | ... | @@ -8418,30 +9664,40 @@ fn charLiteral(p: *Parser) Error!Result { |
| 8418 | 9664 | // > that of the single character or escape sequence is converted to type int. |
| 8419 | 9665 | // This conversion only matters if `char` is signed and has a high-order bit of `1` |
| 8420 | 9666 | if (char_kind == .char and !is_multichar and val > 0x7F and p.comp.getCharSignedness() == .signed) { |
| 8421 | _ = try value.intCast(.{ .specifier = .char }, p.comp); | |
| 9667 | _ = try value.intCast(.char, p.comp); | |
| 8422 | 9668 | } |
| 8423 | 9669 | |
| 8424 | const res = Result{ | |
| 8425 | .ty = if (p.in_macro) macro_ty else ty, | |
| 9670 | const res: Result = .{ | |
| 9671 | .qt = if (p.in_macro) macro_qt else char_literal_qt, | |
| 8426 | 9672 | .val = value, |
| 8427 | .node = try p.addNode(.{ .tag = .char_literal, .ty = ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }), | |
| 9673 | .node = try p.addNode(.{ .char_literal = .{ | |
| 9674 | .qt = char_literal_qt, | |
| 9675 | .literal_tok = p.tok_i, | |
| 9676 | .kind = switch (char_kind) { | |
| 9677 | .char, .unterminated => .ascii, | |
| 9678 | .wide => .wide, | |
| 9679 | .utf_8 => .utf8, | |
| 9680 | .utf_16 => .utf16, | |
| 9681 | .utf_32 => .utf32, | |
| 9682 | }, | |
| 9683 | } }), | |
| 8428 | 9684 | }; |
| 8429 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9685 | if (!p.in_macro) try p.tree.value_map.put(gpa, res.node, res.val); | |
| 8430 | 9686 | return res; |
| 8431 | 9687 | } |
| 8432 | 9688 | |
| 8433 | 9689 | fn parseFloat(p: *Parser, buf: []const u8, suffix: NumberSuffix, tok_i: TokenIndex) !Result { |
| 8434 | const ty = Type{ .specifier = switch (suffix) { | |
| 9690 | const qt: QualType = switch (suffix) { | |
| 8435 | 9691 | .None, .I => .double, |
| 8436 | 9692 | .F, .IF => .float, |
| 8437 | 9693 | .F16, .IF16 => .float16, |
| 8438 | 9694 | .L, .IL => .long_double, |
| 8439 | .W, .IW => p.comp.float80Type().?.specifier, | |
| 9695 | .W, .IW => p.comp.float80Type().?, | |
| 8440 | 9696 | .Q, .IQ, .F128, .IF128 => .float128, |
| 8441 | 9697 | else => unreachable, |
| 8442 | } }; | |
| 9698 | }; | |
| 8443 | 9699 | const val = try Value.intern(p.comp, key: { |
| 8444 | try p.strings.ensureUnusedCapacity(buf.len); | |
| 9700 | try p.strings.ensureUnusedCapacity(p.comp.gpa, buf.len); | |
| 8445 | 9701 | |
| 8446 | 9702 | const strings_top = p.strings.items.len; |
| 8447 | 9703 | defer p.strings.items.len = strings_top; |
| ... | ... | @@ -8450,8 +9706,7 @@ fn parseFloat(p: *Parser, buf: []const u8, suffix: NumberSuffix, tok_i: TokenInd |
| 8450 | 9706 | } |
| 8451 | 9707 | |
| 8452 | 9708 | const float = std.fmt.parseFloat(f128, p.strings.items[strings_top..]) catch unreachable; |
| 8453 | const bits = ty.bitSizeof(p.comp).?; | |
| 8454 | break :key switch (bits) { | |
| 9709 | break :key switch (qt.bitSizeof(p.comp)) { | |
| 8455 | 9710 | 16 => .{ .float = .{ .f16 = @floatCast(float) } }, |
| 8456 | 9711 | 32 => .{ .float = .{ .f32 = @floatCast(float) } }, |
| 8457 | 9712 | 64 => .{ .float = .{ .f64 = @floatCast(float) } }, |
| ... | ... | @@ -8461,22 +9716,15 @@ fn parseFloat(p: *Parser, buf: []const u8, suffix: NumberSuffix, tok_i: TokenInd |
| 8461 | 9716 | }; |
| 8462 | 9717 | }); |
| 8463 | 9718 | var res = Result{ |
| 8464 | .ty = ty, | |
| 8465 | .node = try p.addNode(.{ .tag = .float_literal, .ty = ty, .data = undefined, .loc = @enumFromInt(tok_i) }), | |
| 9719 | .qt = qt, | |
| 9720 | .node = try p.addNode(.{ .float_literal = .{ .qt = qt, .literal_tok = tok_i } }), | |
| 8466 | 9721 | .val = val, |
| 8467 | 9722 | }; |
| 8468 | 9723 | if (suffix.isImaginary()) { |
| 8469 | try p.err(.gnu_imaginary_constant); | |
| 8470 | res.ty = .{ .specifier = switch (suffix) { | |
| 8471 | .I => .complex_double, | |
| 8472 | .IF16 => .complex_float16, | |
| 8473 | .IF => .complex_float, | |
| 8474 | .IL => .complex_long_double, | |
| 8475 | .IW => p.comp.float80Type().?.makeComplex().specifier, | |
| 8476 | .IQ, .IF128 => .complex_float128, | |
| 8477 | else => unreachable, | |
| 8478 | } }; | |
| 8479 | res.val = try Value.intern(p.comp, switch (res.ty.bitSizeof(p.comp).?) { | |
| 9724 | try p.err(p.tok_i, .gnu_imaginary_constant, .{}); | |
| 9725 | res.qt = try qt.toComplex(p.comp); | |
| 9726 | ||
| 9727 | res.val = try Value.intern(p.comp, switch (res.qt.bitSizeof(p.comp)) { | |
| 8480 | 9728 | 32 => .{ .complex = .{ .cf16 = .{ 0.0, val.toFloat(f16, p.comp) } } }, |
| 8481 | 9729 | 64 => .{ .complex = .{ .cf32 = .{ 0.0, val.toFloat(f32, p.comp) } } }, |
| 8482 | 9730 | 128 => .{ .complex = .{ .cf64 = .{ 0.0, val.toFloat(f64, p.comp) } } }, |
| ... | ... | @@ -8494,9 +9742,9 @@ fn getIntegerPart(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: Toke |
| 8494 | 9742 | |
| 8495 | 9743 | if (!prefix.digitAllowed(buf[0])) { |
| 8496 | 9744 | switch (prefix) { |
| 8497 | .binary => try p.errExtra(.invalid_binary_digit, tok_i, .{ .ascii = @intCast(buf[0]) }), | |
| 8498 | .octal => try p.errExtra(.invalid_octal_digit, tok_i, .{ .ascii = @intCast(buf[0]) }), | |
| 8499 | .hex => try p.errStr(.invalid_int_suffix, tok_i, buf), | |
| 9745 | .binary => try p.err(tok_i, .invalid_binary_digit, .{text_literal.Ascii.init(buf[0])}), | |
| 9746 | .octal => try p.err(tok_i, .invalid_octal_digit, .{text_literal.Ascii.init(buf[0])}), | |
| 9747 | .hex => try p.err(tok_i, .invalid_int_suffix, .{buf}), | |
| 8500 | 9748 | .decimal => unreachable, |
| 8501 | 9749 | } |
| 8502 | 9750 | return error.ParsingFailed; |
| ... | ... | @@ -8507,24 +9755,24 @@ fn getIntegerPart(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: Toke |
| 8507 | 9755 | switch (c) { |
| 8508 | 9756 | '.' => return buf[0..idx], |
| 8509 | 9757 | 'p', 'P' => return if (prefix == .hex) buf[0..idx] else { |
| 8510 | try p.errStr(.invalid_int_suffix, tok_i, buf[idx..]); | |
| 9758 | try p.err(tok_i, .invalid_int_suffix, .{buf[idx..]}); | |
| 8511 | 9759 | return error.ParsingFailed; |
| 8512 | 9760 | }, |
| 8513 | 9761 | 'e', 'E' => { |
| 8514 | 9762 | switch (prefix) { |
| 8515 | 9763 | .hex => continue, |
| 8516 | 9764 | .decimal => return buf[0..idx], |
| 8517 | .binary => try p.errExtra(.invalid_binary_digit, tok_i, .{ .ascii = @intCast(c) }), | |
| 8518 | .octal => try p.errExtra(.invalid_octal_digit, tok_i, .{ .ascii = @intCast(c) }), | |
| 9765 | .binary => try p.err(tok_i, .invalid_binary_digit, .{text_literal.Ascii.init(c)}), | |
| 9766 | .octal => try p.err(tok_i, .invalid_octal_digit, .{text_literal.Ascii.init(c)}), | |
| 8519 | 9767 | } |
| 8520 | 9768 | return error.ParsingFailed; |
| 8521 | 9769 | }, |
| 8522 | 9770 | '0'...'9', 'a'...'d', 'A'...'D', 'f', 'F' => { |
| 8523 | 9771 | if (!prefix.digitAllowed(c)) { |
| 8524 | 9772 | switch (prefix) { |
| 8525 | .binary => try p.errExtra(.invalid_binary_digit, tok_i, .{ .ascii = @intCast(c) }), | |
| 8526 | .octal => try p.errExtra(.invalid_octal_digit, tok_i, .{ .ascii = @intCast(c) }), | |
| 8527 | .decimal, .hex => try p.errStr(.invalid_int_suffix, tok_i, buf[idx..]), | |
| 9773 | .binary => try p.err(tok_i, .invalid_binary_digit, .{text_literal.Ascii.init(c)}), | |
| 9774 | .octal => try p.err(tok_i, .invalid_octal_digit, .{text_literal.Ascii.init(c)}), | |
| 9775 | .decimal, .hex => try p.err(tok_i, .invalid_int_suffix, .{buf[idx..]}), | |
| 8528 | 9776 | } |
| 8529 | 9777 | return error.ParsingFailed; |
| 8530 | 9778 | } |
| ... | ... | @@ -8559,33 +9807,33 @@ fn fixedSizeInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok |
| 8559 | 9807 | if (overflowed != 0) overflow = true; |
| 8560 | 9808 | val = sum; |
| 8561 | 9809 | } |
| 8562 | var res: Result = .{ .val = try Value.int(val, p.comp) }; | |
| 9810 | var res: Result = .{ | |
| 9811 | .val = try Value.int(val, p.comp), | |
| 9812 | .node = undefined, // set later | |
| 9813 | }; | |
| 8563 | 9814 | if (overflow) { |
| 8564 | try p.errTok(.int_literal_too_big, tok_i); | |
| 8565 | res.ty = .{ .specifier = .ulong_long }; | |
| 8566 | res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(tok_i) }); | |
| 8567 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9815 | try p.err(tok_i, .int_literal_too_big, .{}); | |
| 9816 | res.qt = .ulong_long; | |
| 9817 | res.node = try p.addNode(.{ .int_literal = .{ .qt = res.qt, .literal_tok = tok_i } }); | |
| 9818 | try res.putValue(p); | |
| 8568 | 9819 | return res; |
| 8569 | 9820 | } |
| 8570 | 9821 | const interned_val = try Value.int(val, p.comp); |
| 8571 | if (suffix.isSignedInteger()) { | |
| 8572 | const max_int = try Value.maxInt(p.comp.types.intmax, p.comp); | |
| 9822 | if (suffix.isSignedInteger() and base == 10) { | |
| 9823 | const max_int = try Value.maxInt(p.comp.type_store.intmax, p.comp); | |
| 8573 | 9824 | if (interned_val.compare(.gt, max_int, p.comp)) { |
| 8574 | try p.errTok(.implicitly_unsigned_literal, tok_i); | |
| 9825 | try p.err(tok_i, .implicitly_unsigned_literal, .{}); | |
| 8575 | 9826 | } |
| 8576 | 9827 | } |
| 8577 | 9828 | |
| 8578 | const signed_specs = .{ .int, .long, .long_long }; | |
| 8579 | const unsigned_specs = .{ .uint, .ulong, .ulong_long }; | |
| 8580 | const signed_oct_hex_specs = .{ .int, .uint, .long, .ulong, .long_long, .ulong_long }; | |
| 8581 | const specs: []const Type.Specifier = if (suffix.signedness() == .unsigned) | |
| 8582 | &unsigned_specs | |
| 9829 | const qts: []const QualType = if (suffix.signedness() == .unsigned) | |
| 9830 | &.{ .uint, .ulong, .ulong_long } | |
| 8583 | 9831 | else if (base == 10) |
| 8584 | &signed_specs | |
| 9832 | &.{ .int, .long, .long_long } | |
| 8585 | 9833 | else |
| 8586 | &signed_oct_hex_specs; | |
| 9834 | &.{ .int, .uint, .long, .ulong, .long_long, .ulong_long }; | |
| 8587 | 9835 | |
| 8588 | const suffix_ty: Type = .{ .specifier = switch (suffix) { | |
| 9836 | const suffix_qt: QualType = switch (suffix) { | |
| 8589 | 9837 | .None, .I => .int, |
| 8590 | 9838 | .U, .IU => .uint, |
| 8591 | 9839 | .UL, .IUL => .ulong, |
| ... | ... | @@ -8593,35 +9841,33 @@ fn fixedSizeInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok |
| 8593 | 9841 | .L, .IL => .long, |
| 8594 | 9842 | .LL, .ILL => .long_long, |
| 8595 | 9843 | else => unreachable, |
| 8596 | } }; | |
| 9844 | }; | |
| 8597 | 9845 | |
| 8598 | for (specs) |spec| { | |
| 8599 | res.ty = Type{ .specifier = spec }; | |
| 8600 | if (res.ty.compareIntegerRanks(suffix_ty, p.comp).compare(.lt)) continue; | |
| 8601 | const max_int = try Value.maxInt(res.ty, p.comp); | |
| 9846 | for (qts) |qt| { | |
| 9847 | res.qt = qt; | |
| 9848 | if (res.qt.intRankOrder(suffix_qt, p.comp).compare(.lt)) continue; | |
| 9849 | const max_int = try Value.maxInt(res.qt, p.comp); | |
| 8602 | 9850 | if (interned_val.compare(.lte, max_int, p.comp)) break; |
| 8603 | 9851 | } else { |
| 8604 | res.ty = .{ .specifier = spec: { | |
| 8605 | if (p.comp.langopts.emulate == .gcc) { | |
| 8606 | if (target_util.hasInt128(p.comp.target)) { | |
| 8607 | break :spec .int128; | |
| 8608 | } else { | |
| 8609 | break :spec .long_long; | |
| 8610 | } | |
| 9852 | if (p.comp.langopts.emulate == .gcc) { | |
| 9853 | if (target_util.hasInt128(p.comp.target)) { | |
| 9854 | res.qt = .int128; | |
| 8611 | 9855 | } else { |
| 8612 | break :spec .ulong_long; | |
| 9856 | res.qt = .long_long; | |
| 8613 | 9857 | } |
| 8614 | } }; | |
| 9858 | } else { | |
| 9859 | res.qt = .ulong_long; | |
| 9860 | } | |
| 8615 | 9861 | } |
| 8616 | 9862 | |
| 8617 | res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(tok_i) }); | |
| 8618 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9863 | res.node = try p.addNode(.{ .int_literal = .{ .qt = res.qt, .literal_tok = tok_i } }); | |
| 9864 | try res.putValue(p); | |
| 8619 | 9865 | return res; |
| 8620 | 9866 | } |
| 8621 | 9867 | |
| 8622 | 9868 | fn parseInt(p: *Parser, prefix: NumberPrefix, buf: []const u8, suffix: NumberSuffix, tok_i: TokenIndex) !Result { |
| 8623 | 9869 | if (prefix == .binary) { |
| 8624 | try p.errTok(.binary_integer_literal, tok_i); | |
| 9870 | try p.err(tok_i, .binary_integer_literal, .{}); | |
| 8625 | 9871 | } |
| 8626 | 9872 | const base = @intFromEnum(prefix); |
| 8627 | 9873 | var res = if (suffix.isBitInt()) |
| ... | ... | @@ -8630,8 +9876,8 @@ fn parseInt(p: *Parser, prefix: NumberPrefix, buf: []const u8, suffix: NumberSuf |
| 8630 | 9876 | try p.fixedSizeInt(base, buf, suffix, tok_i); |
| 8631 | 9877 | |
| 8632 | 9878 | if (suffix.isImaginary()) { |
| 8633 | try p.errTok(.gnu_imaginary_constant, tok_i); | |
| 8634 | res.ty = res.ty.makeComplex(); | |
| 9879 | try p.err(tok_i, .gnu_imaginary_constant, .{}); | |
| 9880 | res.qt = try res.qt.toComplex(p.comp); | |
| 8635 | 9881 | res.val = .{}; |
| 8636 | 9882 | try res.un(p, .imaginary_literal, tok_i); |
| 8637 | 9883 | } |
| ... | ... | @@ -8639,14 +9885,15 @@ fn parseInt(p: *Parser, prefix: NumberPrefix, buf: []const u8, suffix: NumberSuf |
| 8639 | 9885 | } |
| 8640 | 9886 | |
| 8641 | 9887 | fn bitInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok_i: TokenIndex) Error!Result { |
| 8642 | try p.errStr(.pre_c23_compat, tok_i, "'_BitInt' suffix for literals"); | |
| 8643 | try p.errTok(.bitint_suffix, tok_i); | |
| 9888 | const gpa = p.comp.gpa; | |
| 9889 | try p.err(tok_i, .pre_c23_compat, .{"'_BitInt' suffix for literals"}); | |
| 9890 | try p.err(tok_i, .bitint_suffix, .{}); | |
| 8644 | 9891 | |
| 8645 | var managed = try big.int.Managed.init(p.gpa); | |
| 9892 | var managed = try big.int.Managed.init(gpa); | |
| 8646 | 9893 | defer managed.deinit(); |
| 8647 | 9894 | |
| 8648 | 9895 | { |
| 8649 | try p.strings.ensureUnusedCapacity(buf.len); | |
| 9896 | try p.strings.ensureUnusedCapacity(gpa, buf.len); | |
| 8650 | 9897 | |
| 8651 | 9898 | const strings_top = p.strings.items.len; |
| 8652 | 9899 | defer p.strings.items.len = strings_top; |
| ... | ... | @@ -8671,15 +9918,16 @@ fn bitInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok_i: To |
| 8671 | 9918 | break :blk @intCast(bits_needed); |
| 8672 | 9919 | }; |
| 8673 | 9920 | |
| 8674 | var res: Result = .{ | |
| 9921 | const int_qt = try p.comp.type_store.put(gpa, .{ .bit_int = .{ | |
| 9922 | .bits = bits_needed, | |
| 9923 | .signedness = suffix.signedness(), | |
| 9924 | } }); | |
| 9925 | const res: Result = .{ | |
| 8675 | 9926 | .val = try Value.intern(p.comp, .{ .int = .{ .big_int = c } }), |
| 8676 | .ty = .{ | |
| 8677 | .specifier = .bit_int, | |
| 8678 | .data = .{ .int = .{ .bits = bits_needed, .signedness = suffix.signedness() } }, | |
| 8679 | }, | |
| 9927 | .qt = int_qt, | |
| 9928 | .node = try p.addNode(.{ .int_literal = .{ .qt = int_qt, .literal_tok = tok_i } }), | |
| 8680 | 9929 | }; |
| 8681 | res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(tok_i) }); | |
| 8682 | if (!p.in_macro) try p.value_map.put(res.node, res.val); | |
| 9930 | try res.putValue(p); | |
| 8683 | 9931 | return res; |
| 8684 | 9932 | } |
| 8685 | 9933 | |
| ... | ... | @@ -8687,7 +9935,7 @@ fn getFracPart(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: TokenIn |
| 8687 | 9935 | if (buf.len == 0 or buf[0] != '.') return ""; |
| 8688 | 9936 | assert(prefix != .octal); |
| 8689 | 9937 | if (prefix == .binary) { |
| 8690 | try p.errStr(.invalid_int_suffix, tok_i, buf); | |
| 9938 | try p.err(tok_i, .invalid_int_suffix, .{buf}); | |
| 8691 | 9939 | return error.ParsingFailed; |
| 8692 | 9940 | } |
| 8693 | 9941 | for (buf, 0..) |c, idx| { |
| ... | ... | @@ -8704,7 +9952,7 @@ fn getExponent(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: TokenIn |
| 8704 | 9952 | switch (buf[0]) { |
| 8705 | 9953 | 'e', 'E' => assert(prefix == .decimal), |
| 8706 | 9954 | 'p', 'P' => if (prefix != .hex) { |
| 8707 | try p.errStr(.invalid_float_suffix, tok_i, buf); | |
| 9955 | try p.err(tok_i, .invalid_float_suffix, .{buf}); | |
| 8708 | 9956 | return error.ParsingFailed; |
| 8709 | 9957 | }, |
| 8710 | 9958 | else => return "", |
| ... | ... | @@ -8720,7 +9968,7 @@ fn getExponent(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: TokenIn |
| 8720 | 9968 | } else buf.len; |
| 8721 | 9969 | const exponent = buf[0..end]; |
| 8722 | 9970 | if (std.mem.indexOfAny(u8, exponent, "0123456789") == null) { |
| 8723 | try p.errTok(.exponent_has_no_digits, tok_i); | |
| 9971 | try p.err(tok_i, .exponent_has_no_digits, .{}); | |
| 8724 | 9972 | return error.ParsingFailed; |
| 8725 | 9973 | } |
| 8726 | 9974 | return exponent; |
| ... | ... | @@ -8745,21 +9993,21 @@ pub fn parseNumberToken(p: *Parser, tok_i: TokenIndex) !Result { |
| 8745 | 9993 | const is_float = (exponent.len > 0 or frac.len > 0); |
| 8746 | 9994 | const suffix = NumberSuffix.fromString(suffix_str, if (is_float) .float else .int) orelse { |
| 8747 | 9995 | if (is_float) { |
| 8748 | try p.errStr(.invalid_float_suffix, tok_i, suffix_str); | |
| 9996 | try p.err(tok_i, .invalid_float_suffix, .{suffix_str}); | |
| 8749 | 9997 | } else { |
| 8750 | try p.errStr(.invalid_int_suffix, tok_i, suffix_str); | |
| 9998 | try p.err(tok_i, .invalid_int_suffix, .{suffix_str}); | |
| 8751 | 9999 | } |
| 8752 | 10000 | return error.ParsingFailed; |
| 8753 | 10001 | }; |
| 8754 | 10002 | if (suffix.isFloat80() and p.comp.float80Type() == null) { |
| 8755 | try p.errStr(.invalid_float_suffix, tok_i, suffix_str); | |
| 10003 | try p.err(tok_i, .invalid_float_suffix, .{suffix_str}); | |
| 8756 | 10004 | return error.ParsingFailed; |
| 8757 | 10005 | } |
| 8758 | 10006 | |
| 8759 | 10007 | if (is_float) { |
| 8760 | 10008 | assert(prefix == .hex or prefix == .decimal); |
| 8761 | 10009 | if (prefix == .hex and exponent.len == 0) { |
| 8762 | try p.errTok(.hex_floating_constant_requires_exponent, tok_i); | |
| 10010 | try p.err(tok_i, .hex_floating_constant_requires_exponent, .{}); | |
| 8763 | 10011 | return error.ParsingFailed; |
| 8764 | 10012 | } |
| 8765 | 10013 | const number = buf[0 .. buf.len - suffix_str.len]; |
| ... | ... | @@ -8773,107 +10021,118 @@ fn ppNum(p: *Parser) Error!Result { |
| 8773 | 10021 | defer p.tok_i += 1; |
| 8774 | 10022 | var res = try p.parseNumberToken(p.tok_i); |
| 8775 | 10023 | if (p.in_macro) { |
| 8776 | if (res.ty.isFloat() or !res.ty.isReal()) { | |
| 8777 | try p.errTok(.float_literal_in_pp_expr, p.tok_i); | |
| 10024 | const res_sk = res.qt.scalarKind(p.comp); | |
| 10025 | if (res_sk.isFloat() or !res_sk.isReal()) { | |
| 10026 | try p.err(p.tok_i, .float_literal_in_pp_expr, .{}); | |
| 8778 | 10027 | return error.ParsingFailed; |
| 8779 | 10028 | } |
| 8780 | res.ty = if (res.ty.isUnsignedInt(p.comp)) p.comp.types.intmax.makeIntegerUnsigned() else p.comp.types.intmax; | |
| 10029 | res.qt = if (res.qt.signedness(p.comp) == .unsigned) | |
| 10030 | try p.comp.type_store.intmax.makeIntUnsigned(p.comp) | |
| 10031 | else | |
| 10032 | p.comp.type_store.intmax; | |
| 8781 | 10033 | } else if (res.val.opt_ref != .none) { |
| 8782 | try p.value_map.put(res.node, res.val); | |
| 10034 | try res.putValue(p); | |
| 8783 | 10035 | } |
| 8784 | 10036 | return res; |
| 8785 | 10037 | } |
| 8786 | 10038 | |
| 8787 | 10039 | /// Run a parser function but do not evaluate the result |
| 8788 | fn parseNoEval(p: *Parser, comptime func: fn (*Parser) Error!Result) Error!Result { | |
| 10040 | fn parseNoEval(p: *Parser, comptime func: fn (*Parser) Error!?Result) Error!Result { | |
| 8789 | 10041 | const no_eval = p.no_eval; |
| 8790 | 10042 | defer p.no_eval = no_eval; |
| 8791 | 10043 | p.no_eval = true; |
| 10044 | ||
| 8792 | 10045 | const parsed = try func(p); |
| 8793 | try parsed.expect(p); | |
| 8794 | return parsed; | |
| 10046 | return p.expectResult(parsed); | |
| 8795 | 10047 | } |
| 8796 | 10048 | |
| 8797 | 10049 | /// genericSelection : keyword_generic '(' assignExpr ',' genericAssoc (',' genericAssoc)* ')' |
| 8798 | 10050 | /// genericAssoc |
| 8799 | 10051 | /// : typeName ':' assignExpr |
| 8800 | 10052 | /// | keyword_default ':' assignExpr |
| 8801 | fn genericSelection(p: *Parser) Error!Result { | |
| 10053 | fn genericSelection(p: *Parser) Error!?Result { | |
| 10054 | const gpa = p.comp.gpa; | |
| 8802 | 10055 | const kw_generic = p.tok_i; |
| 8803 | 10056 | p.tok_i += 1; |
| 8804 | 10057 | const l_paren = try p.expectToken(.l_paren); |
| 8805 | 10058 | const controlling_tok = p.tok_i; |
| 10059 | ||
| 8806 | 10060 | const controlling = try p.parseNoEval(assignExpr); |
| 10061 | var controlling_qt = controlling.qt; | |
| 10062 | if (controlling_qt.is(p.comp, .array)) { | |
| 10063 | controlling_qt = try controlling_qt.decay(p.comp); | |
| 10064 | } | |
| 8807 | 10065 | _ = try p.expectToken(.comma); |
| 8808 | var controlling_ty = controlling.ty; | |
| 8809 | if (controlling_ty.isArray()) controlling_ty.decayArray(); | |
| 8810 | 10066 | |
| 8811 | 10067 | const list_buf_top = p.list_buf.items.len; |
| 8812 | 10068 | defer p.list_buf.items.len = list_buf_top; |
| 8813 | try p.list_buf.append(controlling.node); | |
| 8814 | 10069 | |
| 8815 | // Use decl_buf to store the token indexes of previous cases | |
| 8816 | const decl_buf_top = p.decl_buf.items.len; | |
| 8817 | defer p.decl_buf.items.len = decl_buf_top; | |
| 10070 | // Use param_buf to store the token indexes of previous cases | |
| 10071 | const param_buf_top = p.param_buf.items.len; | |
| 10072 | defer p.param_buf.items.len = param_buf_top; | |
| 8818 | 10073 | |
| 8819 | 10074 | var default_tok: ?TokenIndex = null; |
| 8820 | 10075 | var default: Result = undefined; |
| 8821 | var chosen_tok: TokenIndex = undefined; | |
| 8822 | var chosen: Result = .{}; | |
| 10076 | var chosen_tok: ?TokenIndex = null; | |
| 10077 | var chosen: Result = undefined; | |
| 10078 | ||
| 8823 | 10079 | while (true) { |
| 8824 | 10080 | const start = p.tok_i; |
| 8825 | if (try p.typeName()) |ty| blk: { | |
| 8826 | if (ty.isArray()) { | |
| 8827 | try p.errTok(.generic_array_type, start); | |
| 8828 | } else if (ty.isFunc()) { | |
| 8829 | try p.errTok(.generic_func_type, start); | |
| 8830 | } else if (ty.anyQual()) { | |
| 8831 | try p.errTok(.generic_qual_type, start); | |
| 10081 | if (try p.typeName()) |qt| blk: { | |
| 10082 | switch (qt.base(p.comp).type) { | |
| 10083 | .array => try p.err(start, .generic_array_type, .{}), | |
| 10084 | .func => try p.err(start, .generic_func_type, .{}), | |
| 10085 | else => if (qt.isQualified()) { | |
| 10086 | try p.err(start, .generic_qual_type, .{}); | |
| 10087 | }, | |
| 8832 | 10088 | } |
| 8833 | _ = try p.expectToken(.colon); | |
| 8834 | const node = try p.assignExpr(); | |
| 8835 | try node.expect(p); | |
| 8836 | 10089 | |
| 8837 | if (ty.eql(controlling_ty, p.comp, false)) { | |
| 8838 | if (chosen.node == .none) { | |
| 8839 | chosen = node; | |
| 10090 | const colon = try p.expectToken(.colon); | |
| 10091 | var res = try p.expect(assignExpr); | |
| 10092 | res.node = try p.addNode(.{ | |
| 10093 | .generic_association_expr = .{ | |
| 10094 | .colon_tok = colon, | |
| 10095 | .association_qt = qt, | |
| 10096 | .expr = res.node, | |
| 10097 | }, | |
| 10098 | }); | |
| 10099 | try p.list_buf.append(gpa, res.node); | |
| 10100 | try p.param_buf.append(gpa, .{ .name = undefined, .qt = qt, .name_tok = start, .node = .null }); | |
| 10101 | ||
| 10102 | if (qt.eql(controlling_qt, p.comp)) { | |
| 10103 | if (chosen_tok == null) { | |
| 10104 | chosen = res; | |
| 8840 | 10105 | chosen_tok = start; |
| 8841 | 10106 | break :blk; |
| 8842 | 10107 | } |
| 8843 | try p.errStr(.generic_duplicate, start, try p.typeStr(ty)); | |
| 8844 | try p.errStr(.generic_duplicate_here, chosen_tok, try p.typeStr(ty)); | |
| 8845 | } | |
| 8846 | const list_buf = p.list_buf.items[list_buf_top + 1 ..]; | |
| 8847 | const decl_buf = p.decl_buf.items[decl_buf_top..]; | |
| 8848 | if (list_buf.len == decl_buf.len) { | |
| 8849 | // If these do not have the same length, there is already an error | |
| 8850 | for (list_buf, decl_buf) |item, prev_tok| { | |
| 8851 | const prev_ty = p.nodes.items(.ty)[@intFromEnum(item)]; | |
| 8852 | if (prev_ty.eql(ty, p.comp, true)) { | |
| 8853 | try p.errStr(.generic_duplicate, start, try p.typeStr(ty)); | |
| 8854 | try p.errStr(.generic_duplicate_here, @intFromEnum(prev_tok), try p.typeStr(ty)); | |
| 8855 | } | |
| 10108 | } | |
| 10109 | ||
| 10110 | const previous_items = p.param_buf.items[0 .. p.param_buf.items.len - 1][param_buf_top..]; | |
| 10111 | for (previous_items) |prev_item| { | |
| 10112 | if (prev_item.qt.eql(qt, p.comp)) { | |
| 10113 | try p.err(start, .generic_duplicate, .{qt}); | |
| 10114 | try p.err(prev_item.name_tok, .generic_duplicate_here, .{qt}); | |
| 8856 | 10115 | } |
| 8857 | 10116 | } |
| 8858 | try p.list_buf.append(try p.addNode(.{ | |
| 8859 | .tag = .generic_association_expr, | |
| 8860 | .ty = ty, | |
| 8861 | .data = .{ .un = node.node }, | |
| 8862 | .loc = @enumFromInt(start), | |
| 8863 | })); | |
| 8864 | try p.decl_buf.append(@enumFromInt(start)); | |
| 8865 | 10117 | } else if (p.eatToken(.keyword_default)) |tok| { |
| 10118 | _ = try p.expectToken(.colon); | |
| 10119 | var res = try p.expect(assignExpr); | |
| 10120 | res.node = try p.addNode(.{ | |
| 10121 | .generic_default_expr = .{ | |
| 10122 | .default_tok = tok, | |
| 10123 | .expr = res.node, | |
| 10124 | }, | |
| 10125 | }); | |
| 10126 | ||
| 8866 | 10127 | if (default_tok) |prev| { |
| 8867 | try p.errTok(.generic_duplicate_default, tok); | |
| 8868 | try p.errTok(.previous_case, prev); | |
| 10128 | try p.err(tok, .generic_duplicate_default, .{}); | |
| 10129 | try p.err(prev, .previous_case, .{}); | |
| 8869 | 10130 | } |
| 10131 | default = res; | |
| 8870 | 10132 | default_tok = tok; |
| 8871 | _ = try p.expectToken(.colon); | |
| 8872 | default = try p.assignExpr(); | |
| 8873 | try default.expect(p); | |
| 8874 | 10133 | } else { |
| 8875 | if (p.list_buf.items.len == list_buf_top + 1) { | |
| 8876 | try p.err(.expected_type); | |
| 10134 | if (p.list_buf.items.len == list_buf_top) { | |
| 10135 | try p.err(p.tok_i, .expected_type, .{}); | |
| 8877 | 10136 | return error.ParsingFailed; |
| 8878 | 10137 | } |
| 8879 | 10138 | break; |
| ... | ... | @@ -8882,53 +10141,46 @@ fn genericSelection(p: *Parser) Error!Result { |
| 8882 | 10141 | } |
| 8883 | 10142 | try p.expectClosing(l_paren, .r_paren); |
| 8884 | 10143 | |
| 8885 | if (chosen.node == .none) { | |
| 8886 | if (default_tok) |tok| { | |
| 8887 | try p.list_buf.insert(list_buf_top + 1, try p.addNode(.{ | |
| 8888 | .tag = .generic_default_expr, | |
| 8889 | .data = .{ .un = default.node }, | |
| 8890 | .ty = default.ty, | |
| 8891 | .loc = @enumFromInt(tok), | |
| 8892 | })); | |
| 10144 | if (chosen_tok == null) { | |
| 10145 | if (default_tok != null) { | |
| 8893 | 10146 | chosen = default; |
| 8894 | 10147 | } else { |
| 8895 | try p.errStr(.generic_no_match, controlling_tok, try p.typeStr(controlling_ty)); | |
| 10148 | try p.err(controlling_tok, .generic_no_match, .{controlling_qt}); | |
| 8896 | 10149 | return error.ParsingFailed; |
| 8897 | 10150 | } |
| 8898 | } else { | |
| 8899 | try p.list_buf.insert(list_buf_top + 1, try p.addNode(.{ | |
| 8900 | .tag = .generic_association_expr, | |
| 8901 | .data = .{ .un = chosen.node }, | |
| 8902 | .ty = chosen.ty, | |
| 8903 | .loc = @enumFromInt(chosen_tok), | |
| 8904 | })); | |
| 8905 | if (default_tok) |tok| { | |
| 8906 | try p.list_buf.append(try p.addNode(.{ | |
| 8907 | .tag = .generic_default_expr, | |
| 8908 | .data = .{ .un = default.node }, | |
| 8909 | .ty = default.ty, | |
| 8910 | .loc = @enumFromInt(tok), | |
| 8911 | })); | |
| 8912 | } | |
| 8913 | } | |
| 8914 | ||
| 8915 | var generic_node: Tree.Node = .{ | |
| 8916 | .tag = .generic_expr_one, | |
| 8917 | .ty = chosen.ty, | |
| 8918 | .data = .{ .two = .{ controlling.node, chosen.node } }, | |
| 8919 | .loc = @enumFromInt(kw_generic), | |
| 8920 | }; | |
| 8921 | const associations = p.list_buf.items[list_buf_top..]; | |
| 8922 | if (associations.len > 2) { // associations[0] == controlling.node | |
| 8923 | generic_node.tag = .generic_expr; | |
| 8924 | generic_node.data = .{ .range = try p.addList(associations) }; | |
| 10151 | } else if (default_tok != null) { | |
| 10152 | try p.list_buf.append(gpa, default.node); | |
| 10153 | } | |
| 10154 | ||
| 10155 | for (p.list_buf.items[list_buf_top..], list_buf_top..) |item, i| { | |
| 10156 | if (item == chosen.node) { | |
| 10157 | _ = p.list_buf.orderedRemove(i); | |
| 10158 | break; | |
| 10159 | } | |
| 8925 | 10160 | } |
| 8926 | chosen.node = try p.addNode(generic_node); | |
| 8927 | return chosen; | |
| 10161 | ||
| 10162 | return .{ | |
| 10163 | .qt = chosen.qt, | |
| 10164 | .val = chosen.val, | |
| 10165 | .node = try p.addNode(.{ | |
| 10166 | .generic_expr = .{ | |
| 10167 | .generic_tok = kw_generic, | |
| 10168 | .controlling = controlling.node, | |
| 10169 | .chosen = chosen.node, | |
| 10170 | .qt = chosen.qt, | |
| 10171 | .rest = p.list_buf.items[list_buf_top..], | |
| 10172 | }, | |
| 10173 | }), | |
| 10174 | }; | |
| 8928 | 10175 | } |
| 8929 | 10176 | |
| 8930 | 10177 | test "Node locations" { |
| 8931 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 10178 | var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 10179 | defer arena_state.deinit(); | |
| 10180 | const arena = arena_state.allocator(); | |
| 10181 | ||
| 10182 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 10183 | var comp = Compilation.init(std.testing.allocator, arena, &diagnostics, std.fs.cwd()); | |
| 8932 | 10184 | defer comp.deinit(); |
| 8933 | 10185 | |
| 8934 | 10186 | const file = try comp.addSourceFromBuffer("file.c", |
| ... | ... | @@ -8940,7 +10192,7 @@ test "Node locations" { |
| 8940 | 10192 | |
| 8941 | 10193 | const builtin_macros = try comp.generateBuiltinMacros(.no_system_defines); |
| 8942 | 10194 | |
| 8943 | var pp = Preprocessor.init(&comp); | |
| 10195 | var pp = Preprocessor.init(&comp, .default); | |
| 8944 | 10196 | defer pp.deinit(); |
| 8945 | 10197 | try pp.addBuiltinMacros(); |
| 8946 | 10198 | |
| ... | ... | @@ -8952,16 +10204,33 @@ test "Node locations" { |
| 8952 | 10204 | var tree = try Parser.parse(&pp); |
| 8953 | 10205 | defer tree.deinit(); |
| 8954 | 10206 | |
| 8955 | try std.testing.expectEqual(0, comp.diagnostics.list.items.len); | |
| 8956 | for (tree.root_decls, 0..) |node, i| { | |
| 8957 | const tok_i = tree.nodeTok(node).?; | |
| 8958 | const slice = tree.tokSlice(tok_i); | |
| 8959 | const expected = switch (i) { | |
| 10207 | try std.testing.expectEqual(0, comp.diagnostics.total); | |
| 10208 | for (tree.root_decls.items[tree.root_decls.items.len - 3 ..], 0..) |node, i| { | |
| 10209 | const slice = tree.tokSlice(node.tok(&tree)); | |
| 10210 | const expected_slice = switch (i) { | |
| 8960 | 10211 | 0 => "foo", |
| 8961 | 10212 | 1 => "bar", |
| 8962 | 10213 | 2 => "main", |
| 8963 | 10214 | else => unreachable, |
| 8964 | 10215 | }; |
| 8965 | try std.testing.expectEqualStrings(expected, slice); | |
| 10216 | try std.testing.expectEqualStrings(expected_slice, slice); | |
| 10217 | ||
| 10218 | const loc = node.loc(&tree).expand(&comp); | |
| 10219 | const expected_col: u32 = switch (i) { | |
| 10220 | 0 => 5, | |
| 10221 | 1 => 5, | |
| 10222 | 2 => 5, | |
| 10223 | else => unreachable, | |
| 10224 | }; | |
| 10225 | try std.testing.expectEqual(expected_col, loc.col); | |
| 10226 | ||
| 10227 | const expected_line_no = i + 1; | |
| 10228 | try std.testing.expectEqual(expected_line_no, loc.line_no); | |
| 10229 | ||
| 10230 | const expected_source_path = "file.c"; | |
| 10231 | try std.testing.expectEqualStrings(expected_source_path, loc.path); | |
| 10232 | ||
| 10233 | const expected_source_kind = Source.Kind.user; | |
| 10234 | try std.testing.expectEqual(expected_source_kind, loc.kind); | |
| 8966 | 10235 | } |
| 8967 | 10236 | } |
lib/compiler/aro/aro/Parser/Diagnostic.zig created+2424| ... | ... | @@ -0,0 +1,2424 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | const Diagnostics = @import("../Diagnostics.zig"); | |
| 4 | const LangOpts = @import("../LangOpts.zig"); | |
| 5 | const Compilation = @import("../Compilation.zig"); | |
| 6 | ||
| 7 | const Diagnostic = @This(); | |
| 8 | ||
| 9 | fmt: []const u8, | |
| 10 | kind: Diagnostics.Message.Kind, | |
| 11 | opt: ?Diagnostics.Option = null, | |
| 12 | extension: bool = false, | |
| 13 | ||
| 14 | // TODO look into removing these | |
| 15 | suppress_version: ?LangOpts.Standard = null, | |
| 16 | suppress_unless_version: ?LangOpts.Standard = null, | |
| 17 | ||
| 18 | const pointer_sign_message = " converts between pointers to integer types with different sign"; | |
| 19 | ||
| 20 | // Maybe someday this will no longer be needed. | |
| 21 | pub const todo: Diagnostic = .{ | |
| 22 | .fmt = "TODO: {s}", | |
| 23 | .kind = .@"error", | |
| 24 | }; | |
| 25 | ||
| 26 | pub const closing_paren: Diagnostic = .{ | |
| 27 | .fmt = "expected closing ')'", | |
| 28 | .kind = .@"error", | |
| 29 | }; | |
| 30 | ||
| 31 | pub const to_match_paren: Diagnostic = .{ | |
| 32 | .fmt = "to match this '('", | |
| 33 | .kind = .note, | |
| 34 | }; | |
| 35 | ||
| 36 | pub const to_match_brace: Diagnostic = .{ | |
| 37 | .fmt = "to match this '{'", | |
| 38 | .kind = .note, | |
| 39 | }; | |
| 40 | ||
| 41 | pub const to_match_bracket: Diagnostic = .{ | |
| 42 | .fmt = "to match this '['", | |
| 43 | .kind = .note, | |
| 44 | }; | |
| 45 | ||
| 46 | pub const float_literal_in_pp_expr: Diagnostic = .{ | |
| 47 | .fmt = "floating point literal in preprocessor expression", | |
| 48 | .kind = .@"error", | |
| 49 | }; | |
| 50 | ||
| 51 | pub const expected_invalid: Diagnostic = .{ | |
| 52 | .fmt = "expected '{tok_id}', found invalid bytes", | |
| 53 | .kind = .@"error", | |
| 54 | }; | |
| 55 | ||
| 56 | pub const expected_eof: Diagnostic = .{ | |
| 57 | .fmt = "expected '{tok_id}' before end of file", | |
| 58 | .kind = .@"error", | |
| 59 | }; | |
| 60 | ||
| 61 | pub const expected_token: Diagnostic = .{ | |
| 62 | .fmt = "expected '{tok_id}', found '{tok_id}'", | |
| 63 | .kind = .@"error", | |
| 64 | }; | |
| 65 | ||
| 66 | pub const expected_expr: Diagnostic = .{ | |
| 67 | .fmt = "expected expression", | |
| 68 | .kind = .@"error", | |
| 69 | }; | |
| 70 | ||
| 71 | pub const unexpected_type_name: Diagnostic = .{ | |
| 72 | .fmt = "unexpected type name '{s}': expected expression", | |
| 73 | .kind = .@"error", | |
| 74 | }; | |
| 75 | ||
| 76 | pub const expected_integer_constant_expr: Diagnostic = .{ | |
| 77 | .fmt = "expression is not an integer constant expression", | |
| 78 | .kind = .@"error", | |
| 79 | }; | |
| 80 | ||
| 81 | pub const missing_type_specifier: Diagnostic = .{ | |
| 82 | .fmt = "type specifier missing, defaults to 'int'", | |
| 83 | .opt = .@"implicit-int", | |
| 84 | .kind = .warning, | |
| 85 | }; | |
| 86 | ||
| 87 | pub const missing_type_specifier_c23: Diagnostic = .{ | |
| 88 | .fmt = "a type specifier is required for all declarations", | |
| 89 | .kind = .@"error", | |
| 90 | }; | |
| 91 | ||
| 92 | pub const param_not_declared: Diagnostic = .{ | |
| 93 | .fmt = "parameter '{s}' was not declared, defaults to 'int'", | |
| 94 | .opt = .@"implicit-int", | |
| 95 | .kind = .warning, | |
| 96 | .extension = true, | |
| 97 | }; | |
| 98 | ||
| 99 | pub const multiple_storage_class: Diagnostic = .{ | |
| 100 | .fmt = "cannot combine with previous '{s}' declaration specifier", | |
| 101 | .kind = .@"error", | |
| 102 | }; | |
| 103 | ||
| 104 | pub const static_assert_failure: Diagnostic = .{ | |
| 105 | .fmt = "static assertion failed", | |
| 106 | .kind = .@"error", | |
| 107 | }; | |
| 108 | ||
| 109 | pub const static_assert_failure_message: Diagnostic = .{ | |
| 110 | .fmt = "static assertion failed {s}", | |
| 111 | .kind = .@"error", | |
| 112 | }; | |
| 113 | ||
| 114 | pub const expected_type: Diagnostic = .{ | |
| 115 | .fmt = "expected a type", | |
| 116 | .kind = .@"error", | |
| 117 | }; | |
| 118 | ||
| 119 | pub const cannot_combine_spec: Diagnostic = .{ | |
| 120 | .fmt = "cannot combine with previous '{s}' specifier", | |
| 121 | .kind = .@"error", | |
| 122 | }; | |
| 123 | ||
| 124 | pub const cannot_combine_spec_qt: Diagnostic = .{ | |
| 125 | .fmt = "cannot combine with previous {qt} specifier", | |
| 126 | .kind = .@"error", | |
| 127 | }; | |
| 128 | ||
| 129 | pub const cannot_combine_with_typeof: Diagnostic = .{ | |
| 130 | .fmt = "'{s} typeof' is invalid", | |
| 131 | .kind = .@"error", | |
| 132 | }; | |
| 133 | ||
| 134 | pub const duplicate_decl_spec: Diagnostic = .{ | |
| 135 | .fmt = "duplicate '{s}' declaration specifier", | |
| 136 | .opt = .@"duplicate-decl-specifier", | |
| 137 | .kind = .warning, | |
| 138 | }; | |
| 139 | ||
| 140 | pub const restrict_non_pointer: Diagnostic = .{ | |
| 141 | .fmt = "restrict requires a pointer or reference ({qt} is invalid)", | |
| 142 | .kind = .@"error", | |
| 143 | }; | |
| 144 | ||
| 145 | pub const expected_external_decl: Diagnostic = .{ | |
| 146 | .fmt = "expected external declaration", | |
| 147 | .kind = .@"error", | |
| 148 | }; | |
| 149 | ||
| 150 | pub const expected_ident_or_l_paren: Diagnostic = .{ | |
| 151 | .fmt = "expected identifier or '('", | |
| 152 | .kind = .@"error", | |
| 153 | }; | |
| 154 | ||
| 155 | pub const missing_declaration: Diagnostic = .{ | |
| 156 | .fmt = "declaration does not declare anything", | |
| 157 | .opt = .@"missing-declaration", | |
| 158 | .kind = .warning, | |
| 159 | .extension = true, | |
| 160 | }; | |
| 161 | ||
| 162 | pub const func_not_in_root: Diagnostic = .{ | |
| 163 | .fmt = "function definition is not allowed here", | |
| 164 | .kind = .@"error", | |
| 165 | }; | |
| 166 | ||
| 167 | pub const illegal_initializer: Diagnostic = .{ | |
| 168 | .fmt = "illegal initializer (only variables can be initialized)", | |
| 169 | .kind = .@"error", | |
| 170 | }; | |
| 171 | ||
| 172 | pub const extern_initializer: Diagnostic = .{ | |
| 173 | .fmt = "extern variable has initializer", | |
| 174 | .opt = .@"extern-initializer", | |
| 175 | .kind = .warning, | |
| 176 | }; | |
| 177 | ||
| 178 | pub const param_before_var_args: Diagnostic = .{ | |
| 179 | .fmt = "ISO C requires a named parameter before '...'", | |
| 180 | .kind = .@"error", | |
| 181 | .suppress_version = .c23, | |
| 182 | }; | |
| 183 | ||
| 184 | pub const void_only_param: Diagnostic = .{ | |
| 185 | .fmt = "'void' must be the only parameter if specified", | |
| 186 | .kind = .@"error", | |
| 187 | }; | |
| 188 | ||
| 189 | pub const void_param_qualified: Diagnostic = .{ | |
| 190 | .fmt = "'void' parameter cannot be qualified", | |
| 191 | .kind = .@"error", | |
| 192 | }; | |
| 193 | ||
| 194 | pub const void_must_be_first_param: Diagnostic = .{ | |
| 195 | .fmt = "'void' must be the first parameter if specified", | |
| 196 | .kind = .@"error", | |
| 197 | }; | |
| 198 | ||
| 199 | pub const invalid_storage_on_param: Diagnostic = .{ | |
| 200 | .fmt = "invalid storage class on function parameter", | |
| 201 | .kind = .@"error", | |
| 202 | }; | |
| 203 | ||
| 204 | pub const threadlocal_non_var: Diagnostic = .{ | |
| 205 | .fmt = "_Thread_local only allowed on variables", | |
| 206 | .kind = .@"error", | |
| 207 | }; | |
| 208 | ||
| 209 | pub const func_spec_non_func: Diagnostic = .{ | |
| 210 | .fmt = "'{s}' can only appear on functions", | |
| 211 | .kind = .@"error", | |
| 212 | }; | |
| 213 | ||
| 214 | pub const illegal_storage_on_func: Diagnostic = .{ | |
| 215 | .fmt = "illegal storage class on function", | |
| 216 | .kind = .@"error", | |
| 217 | }; | |
| 218 | ||
| 219 | pub const illegal_storage_on_global: Diagnostic = .{ | |
| 220 | .fmt = "illegal storage class on global variable", | |
| 221 | .kind = .@"error", | |
| 222 | }; | |
| 223 | ||
| 224 | pub const expected_stmt: Diagnostic = .{ | |
| 225 | .fmt = "expected statement", | |
| 226 | .kind = .@"error", | |
| 227 | }; | |
| 228 | ||
| 229 | pub const func_cannot_return_func: Diagnostic = .{ | |
| 230 | .fmt = "function cannot return a function", | |
| 231 | .kind = .@"error", | |
| 232 | }; | |
| 233 | ||
| 234 | pub const func_cannot_return_array: Diagnostic = .{ | |
| 235 | .fmt = "function cannot return an array", | |
| 236 | .kind = .@"error", | |
| 237 | }; | |
| 238 | ||
| 239 | pub const undeclared_identifier: Diagnostic = .{ | |
| 240 | .fmt = "use of undeclared identifier '{s}'", | |
| 241 | .kind = .@"error", | |
| 242 | }; | |
| 243 | ||
| 244 | pub const not_callable: Diagnostic = .{ | |
| 245 | .fmt = "cannot call non function type {qt}", | |
| 246 | .kind = .@"error", | |
| 247 | }; | |
| 248 | ||
| 249 | pub const unsupported_str_cat: Diagnostic = .{ | |
| 250 | .fmt = "unsupported string literal concatenation", | |
| 251 | .kind = .@"error", | |
| 252 | }; | |
| 253 | ||
| 254 | pub const static_func_not_global: Diagnostic = .{ | |
| 255 | .fmt = "static functions must be global", | |
| 256 | .kind = .@"error", | |
| 257 | }; | |
| 258 | ||
| 259 | pub const implicit_func_decl: Diagnostic = .{ | |
| 260 | .fmt = "call to undeclared function '{s}'; ISO C99 and later do not support implicit function declarations", | |
| 261 | .opt = .@"implicit-function-declaration", | |
| 262 | .kind = .@"error", | |
| 263 | }; | |
| 264 | ||
| 265 | pub const unknown_builtin: Diagnostic = .{ | |
| 266 | .fmt = "use of unknown builtin '{s}'", | |
| 267 | .opt = .@"implicit-function-declaration", | |
| 268 | .kind = .@"error", | |
| 269 | }; | |
| 270 | ||
| 271 | pub const implicit_builtin: Diagnostic = .{ | |
| 272 | .fmt = "implicitly declaring library function '{s}'", | |
| 273 | .kind = .@"error", | |
| 274 | .opt = .@"implicit-function-declaration", | |
| 275 | }; | |
| 276 | ||
| 277 | pub const implicit_builtin_header_note: Diagnostic = .{ | |
| 278 | .fmt = "include the header <{s}.h> or explicitly provide a declaration for '{s}'", | |
| 279 | .kind = .note, | |
| 280 | .opt = .@"implicit-function-declaration", | |
| 281 | }; | |
| 282 | ||
| 283 | pub const expected_param_decl: Diagnostic = .{ | |
| 284 | .fmt = "expected parameter declaration", | |
| 285 | .kind = .@"error", | |
| 286 | }; | |
| 287 | ||
| 288 | pub const invalid_old_style_params: Diagnostic = .{ | |
| 289 | .fmt = "identifier parameter lists are only allowed in function definitions", | |
| 290 | .kind = .@"error", | |
| 291 | }; | |
| 292 | ||
| 293 | pub const expected_fn_body: Diagnostic = .{ | |
| 294 | .fmt = "expected function body after function declaration", | |
| 295 | .kind = .@"error", | |
| 296 | }; | |
| 297 | ||
| 298 | pub const invalid_void_param: Diagnostic = .{ | |
| 299 | .fmt = "parameter cannot have void type", | |
| 300 | .kind = .@"error", | |
| 301 | }; | |
| 302 | ||
| 303 | pub const continue_not_in_loop: Diagnostic = .{ | |
| 304 | .fmt = "'continue' statement not in a loop", | |
| 305 | .kind = .@"error", | |
| 306 | }; | |
| 307 | ||
| 308 | pub const break_not_in_loop_or_switch: Diagnostic = .{ | |
| 309 | .fmt = "'break' statement not in a loop or a switch", | |
| 310 | .kind = .@"error", | |
| 311 | }; | |
| 312 | ||
| 313 | pub const unreachable_code: Diagnostic = .{ | |
| 314 | .fmt = "unreachable code", | |
| 315 | .opt = .@"unreachable-code", | |
| 316 | .kind = .warning, | |
| 317 | }; | |
| 318 | ||
| 319 | pub const duplicate_label: Diagnostic = .{ | |
| 320 | .fmt = "duplicate label '{s}'", | |
| 321 | .kind = .@"error", | |
| 322 | }; | |
| 323 | ||
| 324 | pub const previous_label: Diagnostic = .{ | |
| 325 | .fmt = "previous definition of label '{s}' was here", | |
| 326 | .kind = .note, | |
| 327 | }; | |
| 328 | ||
| 329 | pub const undeclared_label: Diagnostic = .{ | |
| 330 | .fmt = "use of undeclared label '{s}'", | |
| 331 | .kind = .@"error", | |
| 332 | }; | |
| 333 | ||
| 334 | pub const case_not_in_switch: Diagnostic = .{ | |
| 335 | .fmt = "'{s}' statement not in a switch statement", | |
| 336 | .kind = .@"error", | |
| 337 | }; | |
| 338 | ||
| 339 | pub const duplicate_switch_case: Diagnostic = .{ | |
| 340 | .fmt = "duplicate case value '{value}'", | |
| 341 | .kind = .@"error", | |
| 342 | }; | |
| 343 | ||
| 344 | pub const multiple_default: Diagnostic = .{ | |
| 345 | .fmt = "multiple default cases in the same switch", | |
| 346 | .kind = .@"error", | |
| 347 | }; | |
| 348 | ||
| 349 | pub const previous_case: Diagnostic = .{ | |
| 350 | .fmt = "previous case defined here", | |
| 351 | .kind = .note, | |
| 352 | }; | |
| 353 | ||
| 354 | pub const expected_arguments: Diagnostic = .{ | |
| 355 | .fmt = "expected {d} argument(s) got {d}", | |
| 356 | .kind = .@"error", | |
| 357 | }; | |
| 358 | ||
| 359 | pub const expected_arguments_old: Diagnostic = .{ | |
| 360 | .fmt = expected_arguments.fmt, | |
| 361 | .kind = .warning, | |
| 362 | }; | |
| 363 | ||
| 364 | pub const callee_with_static_array: Diagnostic = .{ | |
| 365 | .fmt = "callee declares array parameter as static here", | |
| 366 | .kind = .note, | |
| 367 | }; | |
| 368 | ||
| 369 | pub const array_argument_too_small: Diagnostic = .{ | |
| 370 | .fmt = "array argument is too small; contains {d} elements, callee requires at least {d}", | |
| 371 | .kind = .warning, | |
| 372 | .opt = .@"array-bounds", | |
| 373 | }; | |
| 374 | ||
| 375 | pub const non_null_argument: Diagnostic = .{ | |
| 376 | .fmt = "null passed to a callee that requires a non-null argument", | |
| 377 | .kind = .warning, | |
| 378 | .opt = .nonnull, | |
| 379 | }; | |
| 380 | ||
| 381 | pub const expected_at_least_arguments: Diagnostic = .{ | |
| 382 | .fmt = "expected at least {d} argument(s) got {d}", | |
| 383 | .kind = .warning, | |
| 384 | }; | |
| 385 | ||
| 386 | pub const invalid_static_star: Diagnostic = .{ | |
| 387 | .fmt = "'static' may not be used with an unspecified variable length array size", | |
| 388 | .kind = .@"error", | |
| 389 | }; | |
| 390 | ||
| 391 | pub const static_non_param: Diagnostic = .{ | |
| 392 | .fmt = "'static' used outside of function parameters", | |
| 393 | .kind = .@"error", | |
| 394 | }; | |
| 395 | ||
| 396 | pub const array_qualifiers: Diagnostic = .{ | |
| 397 | .fmt = "type qualifier in non parameter array type", | |
| 398 | .kind = .@"error", | |
| 399 | }; | |
| 400 | ||
| 401 | pub const star_non_param: Diagnostic = .{ | |
| 402 | .fmt = "star modifier used outside of function parameters", | |
| 403 | .kind = .@"error", | |
| 404 | }; | |
| 405 | ||
| 406 | pub const variable_len_array_file_scope: Diagnostic = .{ | |
| 407 | .fmt = "variable length arrays not allowed at file scope", | |
| 408 | .kind = .@"error", | |
| 409 | }; | |
| 410 | ||
| 411 | pub const useless_static: Diagnostic = .{ | |
| 412 | .fmt = "'static' useless without a constant size", | |
| 413 | .kind = .warning, | |
| 414 | }; | |
| 415 | ||
| 416 | pub const negative_array_size: Diagnostic = .{ | |
| 417 | .fmt = "array size must be 0 or greater", | |
| 418 | .kind = .@"error", | |
| 419 | }; | |
| 420 | ||
| 421 | pub const array_incomplete_elem: Diagnostic = .{ | |
| 422 | .fmt = "array has incomplete element type {qt}", | |
| 423 | .kind = .@"error", | |
| 424 | }; | |
| 425 | ||
| 426 | pub const array_func_elem: Diagnostic = .{ | |
| 427 | .fmt = "arrays cannot have functions as their element type", | |
| 428 | .kind = .@"error", | |
| 429 | }; | |
| 430 | ||
| 431 | pub const static_non_outermost_array: Diagnostic = .{ | |
| 432 | .fmt = "'static' used in non-outermost array type", | |
| 433 | .kind = .@"error", | |
| 434 | }; | |
| 435 | ||
| 436 | pub const qualifier_non_outermost_array: Diagnostic = .{ | |
| 437 | .fmt = "type qualifier used in non-outermost array type", | |
| 438 | .kind = .@"error", | |
| 439 | }; | |
| 440 | ||
| 441 | pub const array_overflow: Diagnostic = .{ | |
| 442 | .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)", | |
| 443 | .opt = .@"array-bounds", | |
| 444 | .kind = .warning, | |
| 445 | }; | |
| 446 | ||
| 447 | pub const overflow: Diagnostic = .{ | |
| 448 | .fmt = "overflow in expression; result is '{value}'", | |
| 449 | .kind = .warning, | |
| 450 | .opt = .@"integer-overflow", | |
| 451 | }; | |
| 452 | ||
| 453 | pub const int_literal_too_big: Diagnostic = .{ | |
| 454 | .fmt = "integer literal is too large to be represented in any integer type", | |
| 455 | .kind = .@"error", | |
| 456 | }; | |
| 457 | ||
| 458 | pub const indirection_ptr: Diagnostic = .{ | |
| 459 | .fmt = "indirection requires pointer operand", | |
| 460 | .kind = .@"error", | |
| 461 | }; | |
| 462 | ||
| 463 | pub const addr_of_rvalue: Diagnostic = .{ | |
| 464 | .fmt = "cannot take the address of an rvalue", | |
| 465 | .kind = .@"error", | |
| 466 | }; | |
| 467 | ||
| 468 | pub const addr_of_bitfield: Diagnostic = .{ | |
| 469 | .fmt = "address of bit-field requested", | |
| 470 | .kind = .@"error", | |
| 471 | }; | |
| 472 | ||
| 473 | pub const not_assignable: Diagnostic = .{ | |
| 474 | .fmt = "expression is not assignable", | |
| 475 | .kind = .@"error", | |
| 476 | }; | |
| 477 | ||
| 478 | pub const ident_or_l_brace: Diagnostic = .{ | |
| 479 | .fmt = "expected identifier or '{'", | |
| 480 | .kind = .@"error", | |
| 481 | }; | |
| 482 | ||
| 483 | pub const empty_enum: Diagnostic = .{ | |
| 484 | .fmt = "empty enum is invalid", | |
| 485 | .kind = .@"error", | |
| 486 | }; | |
| 487 | ||
| 488 | pub const redefinition: Diagnostic = .{ | |
| 489 | .fmt = "redefinition of '{s}'", | |
| 490 | .kind = .@"error", | |
| 491 | }; | |
| 492 | ||
| 493 | pub const previous_definition: Diagnostic = .{ | |
| 494 | .fmt = "previous definition is here", | |
| 495 | .kind = .note, | |
| 496 | }; | |
| 497 | ||
| 498 | pub const previous_declaration: Diagnostic = .{ | |
| 499 | .fmt = "previous declaration is here", | |
| 500 | .kind = .note, | |
| 501 | }; | |
| 502 | ||
| 503 | pub const out_of_scope_use: Diagnostic = .{ | |
| 504 | .fmt = "use of out-of-scope declaration of '{s}'", | |
| 505 | .kind = .warning, | |
| 506 | .opt = .@"out-of-scope-function", | |
| 507 | }; | |
| 508 | ||
| 509 | pub const expected_identifier: Diagnostic = .{ | |
| 510 | .fmt = "expected identifier", | |
| 511 | .kind = .@"error", | |
| 512 | }; | |
| 513 | ||
| 514 | pub const expected_str_literal: Diagnostic = .{ | |
| 515 | .fmt = "expected string literal for diagnostic message in static_assert", | |
| 516 | .kind = .@"error", | |
| 517 | }; | |
| 518 | ||
| 519 | pub const expected_str_literal_in: Diagnostic = .{ | |
| 520 | .fmt = "expected string literal in '{s}'", | |
| 521 | .kind = .@"error", | |
| 522 | }; | |
| 523 | ||
| 524 | pub const parameter_missing: Diagnostic = .{ | |
| 525 | .fmt = "parameter named '{s}' is missing", | |
| 526 | .kind = .@"error", | |
| 527 | }; | |
| 528 | ||
| 529 | pub const empty_record: Diagnostic = .{ | |
| 530 | .fmt = "empty {s} is a GNU extension", | |
| 531 | .opt = .@"gnu-empty-struct", | |
| 532 | .kind = .off, | |
| 533 | .extension = true, | |
| 534 | }; | |
| 535 | ||
| 536 | pub const empty_record_size: Diagnostic = .{ | |
| 537 | .fmt = "empty {s} has size 0 in C, size 1 in C++", | |
| 538 | .opt = .@"c++-compat", | |
| 539 | .kind = .off, | |
| 540 | }; | |
| 541 | ||
| 542 | pub const wrong_tag: Diagnostic = .{ | |
| 543 | .fmt = "use of '{s}' with tag type that does not match previous definition", | |
| 544 | .kind = .@"error", | |
| 545 | }; | |
| 546 | ||
| 547 | pub const expected_parens_around_typename: Diagnostic = .{ | |
| 548 | .fmt = "expected parentheses around type name", | |
| 549 | .kind = .@"error", | |
| 550 | }; | |
| 551 | ||
| 552 | pub const alignof_expr: Diagnostic = .{ | |
| 553 | .fmt = "'_Alignof' applied to an expression is a GNU extension", | |
| 554 | .opt = .@"gnu-alignof-expression", | |
| 555 | .kind = .warning, | |
| 556 | .extension = true, | |
| 557 | }; | |
| 558 | ||
| 559 | pub const invalid_alignof: Diagnostic = .{ | |
| 560 | .fmt = "invalid application of 'alignof' to an incomplete type {qt}", | |
| 561 | .kind = .@"error", | |
| 562 | }; | |
| 563 | ||
| 564 | pub const invalid_sizeof: Diagnostic = .{ | |
| 565 | .fmt = "invalid application of 'sizeof' to an incomplete type {qt}", | |
| 566 | .kind = .@"error", | |
| 567 | }; | |
| 568 | ||
| 569 | pub const generic_qual_type: Diagnostic = .{ | |
| 570 | .fmt = "generic association with qualifiers cannot be matched with", | |
| 571 | .opt = .@"generic-qual-type", | |
| 572 | .kind = .warning, | |
| 573 | }; | |
| 574 | ||
| 575 | pub const generic_array_type: Diagnostic = .{ | |
| 576 | .fmt = "generic association array type cannot be matched with", | |
| 577 | .opt = .@"generic-qual-type", | |
| 578 | .kind = .warning, | |
| 579 | }; | |
| 580 | ||
| 581 | pub const generic_func_type: Diagnostic = .{ | |
| 582 | .fmt = "generic association function type cannot be matched with", | |
| 583 | .opt = .@"generic-qual-type", | |
| 584 | .kind = .warning, | |
| 585 | }; | |
| 586 | ||
| 587 | pub const generic_duplicate: Diagnostic = .{ | |
| 588 | .fmt = "type {qt} in generic association compatible with previously specified type", | |
| 589 | .kind = .@"error", | |
| 590 | }; | |
| 591 | ||
| 592 | pub const generic_duplicate_here: Diagnostic = .{ | |
| 593 | .fmt = "compatible type {qt} specified here", | |
| 594 | .kind = .note, | |
| 595 | }; | |
| 596 | ||
| 597 | pub const generic_duplicate_default: Diagnostic = .{ | |
| 598 | .fmt = "duplicate default generic association", | |
| 599 | .kind = .@"error", | |
| 600 | }; | |
| 601 | ||
| 602 | pub const generic_no_match: Diagnostic = .{ | |
| 603 | .fmt = "controlling expression type {qt} not compatible with any generic association type", | |
| 604 | .kind = .@"error", | |
| 605 | }; | |
| 606 | ||
| 607 | pub const must_use_struct: Diagnostic = .{ | |
| 608 | .fmt = "must use 'struct' tag to refer to type '{s}'", | |
| 609 | .kind = .@"error", | |
| 610 | }; | |
| 611 | ||
| 612 | pub const must_use_union: Diagnostic = .{ | |
| 613 | .fmt = "must use 'union' tag to refer to type '{s}'", | |
| 614 | .kind = .@"error", | |
| 615 | }; | |
| 616 | ||
| 617 | pub const must_use_enum: Diagnostic = .{ | |
| 618 | .fmt = "must use 'enum' tag to refer to type '{s}'", | |
| 619 | .kind = .@"error", | |
| 620 | }; | |
| 621 | ||
| 622 | pub const redefinition_different_sym: Diagnostic = .{ | |
| 623 | .fmt = "redefinition of '{s}' as different kind of symbol", | |
| 624 | .kind = .@"error", | |
| 625 | }; | |
| 626 | ||
| 627 | pub const redefinition_incompatible: Diagnostic = .{ | |
| 628 | .fmt = "redefinition of '{s}' with a different type", | |
| 629 | .kind = .@"error", | |
| 630 | }; | |
| 631 | ||
| 632 | pub const redefinition_of_parameter: Diagnostic = .{ | |
| 633 | .fmt = "redefinition of parameter '{s}'", | |
| 634 | .kind = .@"error", | |
| 635 | }; | |
| 636 | ||
| 637 | pub const invalid_bin_types: Diagnostic = .{ | |
| 638 | .fmt = "invalid operands to binary expression ({qt} and {qt})", | |
| 639 | .kind = .@"error", | |
| 640 | }; | |
| 641 | ||
| 642 | pub const incompatible_vec_types: Diagnostic = .{ | |
| 643 | .fmt = "cannot convert between vector type {qt} and vector type {qt} as implicit conversion would cause truncation", | |
| 644 | .kind = .@"error", | |
| 645 | }; | |
| 646 | ||
| 647 | pub const comparison_ptr_int: Diagnostic = .{ | |
| 648 | .fmt = "comparison between pointer and integer ({qt} and {qt})", | |
| 649 | .kind = .warning, | |
| 650 | .opt = .@"pointer-integer-compare", | |
| 651 | .extension = true, | |
| 652 | }; | |
| 653 | ||
| 654 | pub const comparison_distinct_ptr: Diagnostic = .{ | |
| 655 | .fmt = "comparison of distinct pointer types ({qt} and {qt})", | |
| 656 | .kind = .warning, | |
| 657 | .opt = .@"compare-distinct-pointer-types", | |
| 658 | .extension = true, | |
| 659 | }; | |
| 660 | ||
| 661 | pub const incompatible_pointers: Diagnostic = .{ | |
| 662 | .fmt = "incompatible pointer types ({qt} and {qt})", | |
| 663 | .kind = .@"error", | |
| 664 | }; | |
| 665 | ||
| 666 | pub const invalid_argument_un: Diagnostic = .{ | |
| 667 | .fmt = "invalid argument type {qt} to unary expression", | |
| 668 | .kind = .@"error", | |
| 669 | }; | |
| 670 | ||
| 671 | pub const incompatible_assign: Diagnostic = .{ | |
| 672 | .fmt = "assignment to {qt} from incompatible type {qt}", | |
| 673 | .kind = .@"error", | |
| 674 | }; | |
| 675 | ||
| 676 | pub const implicit_ptr_to_int: Diagnostic = .{ | |
| 677 | .fmt = "implicit pointer to integer conversion from {qt} to {qt}", | |
| 678 | .kind = .warning, | |
| 679 | .opt = .@"int-conversion", | |
| 680 | }; | |
| 681 | ||
| 682 | pub const invalid_cast_to_float: Diagnostic = .{ | |
| 683 | .fmt = "pointer cannot be cast to type {qt}", | |
| 684 | .kind = .@"error", | |
| 685 | }; | |
| 686 | ||
| 687 | pub const invalid_cast_to_pointer: Diagnostic = .{ | |
| 688 | .fmt = "operand of type {qt} cannot be cast to a pointer type", | |
| 689 | .kind = .@"error", | |
| 690 | }; | |
| 691 | ||
| 692 | pub const invalid_cast_type: Diagnostic = .{ | |
| 693 | .fmt = "cannot cast to non arithmetic or pointer type {qt}", | |
| 694 | .kind = .@"error", | |
| 695 | }; | |
| 696 | ||
| 697 | pub const cast_to_same_type: Diagnostic = .{ | |
| 698 | .fmt = "C99 forbids casting nonscalar type {qt} to the same type", | |
| 699 | .kind = .off, | |
| 700 | .extension = true, | |
| 701 | }; | |
| 702 | ||
| 703 | pub const invalid_cast_operand_type: Diagnostic = .{ | |
| 704 | .fmt = "operand of type {qt} where arithmetic or pointer type is required", | |
| 705 | .kind = .@"error", | |
| 706 | }; | |
| 707 | ||
| 708 | pub const qual_cast: Diagnostic = .{ | |
| 709 | .fmt = "cast to type {qt} will not preserve qualifiers", | |
| 710 | .opt = .@"cast-qualifiers", | |
| 711 | .kind = .warning, | |
| 712 | }; | |
| 713 | ||
| 714 | pub const invalid_vec_conversion: Diagnostic = .{ | |
| 715 | .fmt = "invalid conversion between vector type {qt} and {qt} of different size", | |
| 716 | .kind = .@"error", | |
| 717 | }; | |
| 718 | ||
| 719 | pub const invalid_vec_conversion_scalar: Diagnostic = .{ | |
| 720 | .fmt = "invalid conversion between vector type {qt} and scalar type {qt}", | |
| 721 | .kind = .@"error", | |
| 722 | }; | |
| 723 | ||
| 724 | pub const invalid_vec_conversion_int: Diagnostic = .{ | |
| 725 | .fmt = "invalid conversion between vector type {qt} and integer type {qt} of different size", | |
| 726 | .kind = .@"error", | |
| 727 | }; | |
| 728 | ||
| 729 | pub const invalid_index: Diagnostic = .{ | |
| 730 | .fmt = "array subscript is not an integer", | |
| 731 | .kind = .@"error", | |
| 732 | }; | |
| 733 | ||
| 734 | pub const invalid_subscript: Diagnostic = .{ | |
| 735 | .fmt = "subscripted value is not an array, pointer or vector", | |
| 736 | .kind = .@"error", | |
| 737 | }; | |
| 738 | ||
| 739 | pub const array_after: Diagnostic = .{ | |
| 740 | .fmt = "array index {value} is past the end of the array", | |
| 741 | .opt = .@"array-bounds", | |
| 742 | .kind = .warning, | |
| 743 | }; | |
| 744 | ||
| 745 | pub const array_before: Diagnostic = .{ | |
| 746 | .fmt = "array index {value} is before the beginning of the array", | |
| 747 | .opt = .@"array-bounds", | |
| 748 | .kind = .warning, | |
| 749 | }; | |
| 750 | ||
| 751 | pub const statement_int: Diagnostic = .{ | |
| 752 | .fmt = "statement requires expression with integer type ({qt} invalid)", | |
| 753 | .kind = .@"error", | |
| 754 | }; | |
| 755 | ||
| 756 | pub const statement_scalar: Diagnostic = .{ | |
| 757 | .fmt = "statement requires expression with scalar type ({qt} invalid)", | |
| 758 | .kind = .@"error", | |
| 759 | }; | |
| 760 | ||
| 761 | pub const func_should_return: Diagnostic = .{ | |
| 762 | .fmt = "non-void function '{s}' should return a value", | |
| 763 | .opt = .@"return-type", | |
| 764 | .kind = .@"error", | |
| 765 | }; | |
| 766 | ||
| 767 | pub const incompatible_return: Diagnostic = .{ | |
| 768 | .fmt = "returning {qt} from a function with incompatible result type {qt}", | |
| 769 | .kind = .@"error", | |
| 770 | }; | |
| 771 | ||
| 772 | pub const incompatible_return_sign: Diagnostic = .{ | |
| 773 | .fmt = incompatible_return.fmt ++ pointer_sign_message, | |
| 774 | .kind = .warning, | |
| 775 | .opt = .@"pointer-sign", | |
| 776 | }; | |
| 777 | ||
| 778 | pub const implicit_int_to_ptr: Diagnostic = .{ | |
| 779 | .fmt = "implicit integer to pointer conversion from {qt} to {qt}", | |
| 780 | .opt = .@"int-conversion", | |
| 781 | .kind = .warning, | |
| 782 | }; | |
| 783 | ||
| 784 | pub const func_does_not_return: Diagnostic = .{ | |
| 785 | .fmt = "non-void function '{s}' does not return a value", | |
| 786 | .opt = .@"return-type", | |
| 787 | .kind = .warning, | |
| 788 | }; | |
| 789 | ||
| 790 | pub const void_func_returns_value: Diagnostic = .{ | |
| 791 | .fmt = "void function '{s}' should not return a value", | |
| 792 | .opt = .@"return-type", | |
| 793 | .kind = .@"error", | |
| 794 | }; | |
| 795 | ||
| 796 | pub const incompatible_arg: Diagnostic = .{ | |
| 797 | .fmt = "passing {qt} to parameter of incompatible type {qt}", | |
| 798 | .kind = .@"error", | |
| 799 | }; | |
| 800 | ||
| 801 | pub const incompatible_ptr_arg: Diagnostic = .{ | |
| 802 | .fmt = "passing {qt} to parameter of incompatible type {qt}", | |
| 803 | .kind = .warning, | |
| 804 | .opt = .@"incompatible-pointer-types", | |
| 805 | }; | |
| 806 | ||
| 807 | pub const incompatible_ptr_arg_sign: Diagnostic = .{ | |
| 808 | .fmt = incompatible_ptr_arg.fmt ++ pointer_sign_message, | |
| 809 | .kind = .warning, | |
| 810 | .opt = .@"pointer-sign", | |
| 811 | }; | |
| 812 | ||
| 813 | pub const parameter_here: Diagnostic = .{ | |
| 814 | .fmt = "passing argument to parameter here", | |
| 815 | .kind = .note, | |
| 816 | }; | |
| 817 | ||
| 818 | pub const atomic_array: Diagnostic = .{ | |
| 819 | .fmt = "_Atomic cannot be applied to array type {qt}", | |
| 820 | .kind = .@"error", | |
| 821 | }; | |
| 822 | ||
| 823 | pub const atomic_func: Diagnostic = .{ | |
| 824 | .fmt = "_Atomic cannot be applied to function type {qt}", | |
| 825 | .kind = .@"error", | |
| 826 | }; | |
| 827 | ||
| 828 | pub const atomic_incomplete: Diagnostic = .{ | |
| 829 | .fmt = "_Atomic cannot be applied to incomplete type {qt}", | |
| 830 | .kind = .@"error", | |
| 831 | }; | |
| 832 | ||
| 833 | pub const atomic_atomic: Diagnostic = .{ | |
| 834 | .fmt = "_Atomic cannot be applied to atomic type {qt}", | |
| 835 | .kind = .@"error", | |
| 836 | }; | |
| 837 | ||
| 838 | pub const atomic_complex: Diagnostic = .{ | |
| 839 | .fmt = "_Atomic cannot be applied to complex type {qt}", | |
| 840 | .kind = .@"error", | |
| 841 | }; | |
| 842 | ||
| 843 | pub const atomic_qualified: Diagnostic = .{ | |
| 844 | .fmt = "_Atomic cannot be applied to qualified type {qt}", | |
| 845 | .kind = .@"error", | |
| 846 | }; | |
| 847 | ||
| 848 | pub const atomic_auto: Diagnostic = .{ | |
| 849 | .fmt = "_Atomic cannot be applied to type 'auto' in C23", | |
| 850 | .kind = .@"error", | |
| 851 | }; | |
| 852 | ||
| 853 | // pub const atomic_access: Diagnostic = .{ | |
| 854 | // .fmt = "accessing a member of an atomic structure or union is undefined behavior", | |
| 855 | // .opt = .@"atomic-access", | |
| 856 | // .kind = .@"error", | |
| 857 | // }; | |
| 858 | ||
| 859 | pub const addr_of_register: Diagnostic = .{ | |
| 860 | .fmt = "address of register variable requested", | |
| 861 | .kind = .@"error", | |
| 862 | }; | |
| 863 | ||
| 864 | pub const variable_incomplete_ty: Diagnostic = .{ | |
| 865 | .fmt = "variable has incomplete type {qt}", | |
| 866 | .kind = .@"error", | |
| 867 | }; | |
| 868 | ||
| 869 | pub const parameter_incomplete_ty: Diagnostic = .{ | |
| 870 | .fmt = "parameter has incomplete type {qt}", | |
| 871 | .kind = .@"error", | |
| 872 | }; | |
| 873 | ||
| 874 | pub const tentative_array: Diagnostic = .{ | |
| 875 | .fmt = "tentative array definition assumed to have one element", | |
| 876 | .kind = .warning, | |
| 877 | }; | |
| 878 | ||
| 879 | pub const deref_incomplete_ty_ptr: Diagnostic = .{ | |
| 880 | .fmt = "dereferencing pointer to incomplete type {qt}", | |
| 881 | .kind = .@"error", | |
| 882 | }; | |
| 883 | ||
| 884 | pub const alignas_on_func: Diagnostic = .{ | |
| 885 | .fmt = "'_Alignas' attribute only applies to variables and fields", | |
| 886 | .kind = .@"error", | |
| 887 | }; | |
| 888 | ||
| 889 | pub const alignas_on_param: Diagnostic = .{ | |
| 890 | .fmt = "'_Alignas' attribute cannot be applied to a function parameter", | |
| 891 | .kind = .@"error", | |
| 892 | }; | |
| 893 | ||
| 894 | pub const minimum_alignment: Diagnostic = .{ | |
| 895 | .fmt = "requested alignment is less than minimum alignment of {d}", | |
| 896 | .kind = .@"error", | |
| 897 | }; | |
| 898 | ||
| 899 | pub const maximum_alignment: Diagnostic = .{ | |
| 900 | .fmt = "requested alignment of {value} is too large", | |
| 901 | .kind = .@"error", | |
| 902 | }; | |
| 903 | ||
| 904 | pub const negative_alignment: Diagnostic = .{ | |
| 905 | .fmt = "requested negative alignment of {value} is invalid", | |
| 906 | .kind = .@"error", | |
| 907 | }; | |
| 908 | ||
| 909 | pub const align_ignored: Diagnostic = .{ | |
| 910 | .fmt = "'_Alignas' attribute is ignored here", | |
| 911 | .kind = .warning, | |
| 912 | }; | |
| 913 | ||
| 914 | // pub const zero_align_ignored: Diagnostic = .{ | |
| 915 | // .fmt = "requested alignment of zero is ignored", | |
| 916 | // .kind = .warning, | |
| 917 | // }; | |
| 918 | ||
| 919 | pub const non_pow2_align: Diagnostic = .{ | |
| 920 | .fmt = "requested alignment is not a power of 2", | |
| 921 | .kind = .@"error", | |
| 922 | }; | |
| 923 | ||
| 924 | pub const pointer_mismatch: Diagnostic = .{ | |
| 925 | .fmt = "pointer type mismatch ({qt} and {qt})", | |
| 926 | .opt = .@"pointer-type-mismatch", | |
| 927 | .kind = .warning, | |
| 928 | .extension = true, | |
| 929 | }; | |
| 930 | ||
| 931 | pub const static_assert_not_constant: Diagnostic = .{ | |
| 932 | .fmt = "static assertion expression is not an integral constant expression", | |
| 933 | .kind = .@"error", | |
| 934 | }; | |
| 935 | ||
| 936 | pub const static_assert_missing_message: Diagnostic = .{ | |
| 937 | .fmt = "'_Static_assert' with no message is a C23 extension", | |
| 938 | .opt = .@"c23-extensions", | |
| 939 | .kind = .warning, | |
| 940 | .suppress_version = .c23, | |
| 941 | .extension = true, | |
| 942 | }; | |
| 943 | ||
| 944 | pub const pre_c23_compat: Diagnostic = .{ | |
| 945 | .fmt = "{s} is incompatible with C standards before C23", | |
| 946 | .kind = .off, | |
| 947 | .suppress_unless_version = .c23, | |
| 948 | .opt = .@"pre-c23-compat", | |
| 949 | }; | |
| 950 | ||
| 951 | pub const unbound_vla: Diagnostic = .{ | |
| 952 | .fmt = "variable length array must be bound in function definition", | |
| 953 | .kind = .@"error", | |
| 954 | }; | |
| 955 | ||
| 956 | pub const array_too_large: Diagnostic = .{ | |
| 957 | .fmt = "array is too large", | |
| 958 | .kind = .@"error", | |
| 959 | }; | |
| 960 | ||
| 961 | pub const record_too_large: Diagnostic = .{ | |
| 962 | .fmt = "type {qt} is too large", | |
| 963 | .kind = .@"error", | |
| 964 | }; | |
| 965 | ||
| 966 | pub const incompatible_ptr_init: Diagnostic = .{ | |
| 967 | .fmt = "incompatible pointer types initializing {qt} from incompatible type {qt}", | |
| 968 | .opt = .@"incompatible-pointer-types", | |
| 969 | .kind = .warning, | |
| 970 | }; | |
| 971 | ||
| 972 | pub const incompatible_ptr_init_sign: Diagnostic = .{ | |
| 973 | .fmt = incompatible_ptr_init.fmt ++ pointer_sign_message, | |
| 974 | .opt = .@"pointer-sign", | |
| 975 | .kind = .warning, | |
| 976 | }; | |
| 977 | ||
| 978 | pub const incompatible_ptr_assign: Diagnostic = .{ | |
| 979 | .fmt = "incompatible pointer types assigning to {qt} from incompatible type {qt}", | |
| 980 | .opt = .@"incompatible-pointer-types", | |
| 981 | .kind = .warning, | |
| 982 | }; | |
| 983 | ||
| 984 | pub const incompatible_ptr_assign_sign: Diagnostic = .{ | |
| 985 | .fmt = incompatible_ptr_assign.fmt ++ pointer_sign_message, | |
| 986 | .opt = .@"pointer-sign", | |
| 987 | .kind = .warning, | |
| 988 | }; | |
| 989 | ||
| 990 | pub const vla_init: Diagnostic = .{ | |
| 991 | .fmt = "variable-sized object may not be initialized", | |
| 992 | .kind = .@"error", | |
| 993 | }; | |
| 994 | ||
| 995 | pub const func_init: Diagnostic = .{ | |
| 996 | .fmt = "illegal initializer type", | |
| 997 | .kind = .@"error", | |
| 998 | }; | |
| 999 | ||
| 1000 | pub const incompatible_init: Diagnostic = .{ | |
| 1001 | .fmt = "initializing {qt} from incompatible type {qt}", | |
| 1002 | .kind = .@"error", | |
| 1003 | }; | |
| 1004 | ||
| 1005 | pub const excess_scalar_init: Diagnostic = .{ | |
| 1006 | .fmt = "excess elements in scalar initializer", | |
| 1007 | .kind = .warning, | |
| 1008 | .opt = .@"excess-initializers", | |
| 1009 | }; | |
| 1010 | ||
| 1011 | pub const excess_str_init: Diagnostic = .{ | |
| 1012 | .fmt = "excess elements in string initializer", | |
| 1013 | .kind = .warning, | |
| 1014 | .opt = .@"excess-initializers", | |
| 1015 | }; | |
| 1016 | ||
| 1017 | pub const excess_struct_init: Diagnostic = .{ | |
| 1018 | .fmt = "excess elements in struct initializer", | |
| 1019 | .kind = .warning, | |
| 1020 | .opt = .@"excess-initializers", | |
| 1021 | }; | |
| 1022 | ||
| 1023 | pub const excess_union_init: Diagnostic = .{ | |
| 1024 | .fmt = "excess elements in union initializer", | |
| 1025 | .kind = .warning, | |
| 1026 | .opt = .@"excess-initializers", | |
| 1027 | }; | |
| 1028 | ||
| 1029 | pub const excess_array_init: Diagnostic = .{ | |
| 1030 | .fmt = "excess elements in array initializer", | |
| 1031 | .kind = .warning, | |
| 1032 | .opt = .@"excess-initializers", | |
| 1033 | }; | |
| 1034 | ||
| 1035 | pub const excess_vector_init: Diagnostic = .{ | |
| 1036 | .fmt = "excess elements in vector initializer", | |
| 1037 | .kind = .warning, | |
| 1038 | .opt = .@"excess-initializers", | |
| 1039 | }; | |
| 1040 | ||
| 1041 | pub const str_init_too_long: Diagnostic = .{ | |
| 1042 | .fmt = "initializer-string for char array is too long", | |
| 1043 | .opt = .@"excess-initializers", | |
| 1044 | .kind = .warning, | |
| 1045 | .extension = true, | |
| 1046 | }; | |
| 1047 | ||
| 1048 | pub const arr_init_too_long: Diagnostic = .{ | |
| 1049 | .fmt = "cannot initialize type {qt} with array of type {qt}", | |
| 1050 | .kind = .@"error", | |
| 1051 | }; | |
| 1052 | ||
| 1053 | pub const empty_initializer: Diagnostic = .{ | |
| 1054 | .fmt = "use of an empty initializer is a C23 extension", | |
| 1055 | .opt = .@"c23-extensions", | |
| 1056 | .kind = .off, | |
| 1057 | .suppress_version = .c23, | |
| 1058 | .extension = true, | |
| 1059 | }; | |
| 1060 | ||
| 1061 | pub const division_by_zero: Diagnostic = .{ | |
| 1062 | .fmt = "{s} by zero is undefined", | |
| 1063 | .kind = .warning, | |
| 1064 | .opt = .@"division-by-zero", | |
| 1065 | }; | |
| 1066 | ||
| 1067 | pub const division_by_zero_macro: Diagnostic = .{ | |
| 1068 | .fmt = "{s} by zero in preprocessor expression", | |
| 1069 | .kind = .@"error", | |
| 1070 | }; | |
| 1071 | ||
| 1072 | pub const builtin_choose_cond: Diagnostic = .{ | |
| 1073 | .fmt = "'__builtin_choose_expr' requires a constant expression", | |
| 1074 | .kind = .@"error", | |
| 1075 | }; | |
| 1076 | ||
| 1077 | pub const convertvector_arg: Diagnostic = .{ | |
| 1078 | .fmt = "{s} argument to __builtin_convertvector must be a vector type", | |
| 1079 | .kind = .@"error", | |
| 1080 | }; | |
| 1081 | ||
| 1082 | pub const convertvector_size: Diagnostic = .{ | |
| 1083 | .fmt = "first two arguments to __builtin_convertvector must have the same number of elements", | |
| 1084 | .kind = .@"error", | |
| 1085 | }; | |
| 1086 | ||
| 1087 | pub const shufflevector_arg: Diagnostic = .{ | |
| 1088 | .fmt = "{s} argument to __builtin_shufflevector must be a vector type", | |
| 1089 | .kind = .@"error", | |
| 1090 | }; | |
| 1091 | ||
| 1092 | pub const shufflevector_same_type: Diagnostic = .{ | |
| 1093 | .fmt = "first two arguments to '__builtin_shufflevector' must have the same type", | |
| 1094 | .kind = .@"error", | |
| 1095 | }; | |
| 1096 | ||
| 1097 | pub const shufflevector_negative_index: Diagnostic = .{ | |
| 1098 | .fmt = "index for __builtin_shufflevector must be positive or -1", | |
| 1099 | .kind = .@"error", | |
| 1100 | }; | |
| 1101 | ||
| 1102 | pub const shufflevector_index_too_big: Diagnostic = .{ | |
| 1103 | .fmt = "index for __builtin_shufflevector must be less than the total number of vector elements", | |
| 1104 | .kind = .@"error", | |
| 1105 | }; | |
| 1106 | ||
| 1107 | pub const alignas_unavailable: Diagnostic = .{ | |
| 1108 | .fmt = "'_Alignas' attribute requires integer constant expression", | |
| 1109 | .kind = .@"error", | |
| 1110 | }; | |
| 1111 | ||
| 1112 | pub const case_val_unavailable: Diagnostic = .{ | |
| 1113 | .fmt = "case value must be an integer constant expression", | |
| 1114 | .kind = .@"error", | |
| 1115 | }; | |
| 1116 | ||
| 1117 | pub const enum_val_unavailable: Diagnostic = .{ | |
| 1118 | .fmt = "enum value must be an integer constant expression", | |
| 1119 | .kind = .@"error", | |
| 1120 | }; | |
| 1121 | ||
| 1122 | pub const incompatible_array_init: Diagnostic = .{ | |
| 1123 | .fmt = "cannot initialize array of type {qt} with array of type {qt}", | |
| 1124 | .kind = .@"error", | |
| 1125 | }; | |
| 1126 | ||
| 1127 | pub const array_init_str: Diagnostic = .{ | |
| 1128 | .fmt = "array initializer must be an initializer list or wide string literal", | |
| 1129 | .kind = .@"error", | |
| 1130 | }; | |
| 1131 | ||
| 1132 | pub const initializer_overrides: Diagnostic = .{ | |
| 1133 | .fmt = "initializer overrides previous initialization", | |
| 1134 | .opt = .@"initializer-overrides", | |
| 1135 | .kind = .warning, | |
| 1136 | }; | |
| 1137 | ||
| 1138 | pub const previous_initializer: Diagnostic = .{ | |
| 1139 | .fmt = "previous initialization", | |
| 1140 | .kind = .note, | |
| 1141 | }; | |
| 1142 | ||
| 1143 | pub const invalid_array_designator: Diagnostic = .{ | |
| 1144 | .fmt = "array designator used for non-array type {qt}", | |
| 1145 | .kind = .@"error", | |
| 1146 | }; | |
| 1147 | ||
| 1148 | pub const negative_array_designator: Diagnostic = .{ | |
| 1149 | .fmt = "array designator value {value} is negative", | |
| 1150 | .kind = .@"error", | |
| 1151 | }; | |
| 1152 | ||
| 1153 | pub const oob_array_designator: Diagnostic = .{ | |
| 1154 | .fmt = "array designator index {value} exceeds array bounds", | |
| 1155 | .kind = .@"error", | |
| 1156 | }; | |
| 1157 | ||
| 1158 | pub const invalid_field_designator: Diagnostic = .{ | |
| 1159 | .fmt = "field designator used for non-record type {qt}", | |
| 1160 | .kind = .@"error", | |
| 1161 | }; | |
| 1162 | ||
| 1163 | pub const no_such_field_designator: Diagnostic = .{ | |
| 1164 | .fmt = "record type has no field named '{s}'", | |
| 1165 | .kind = .@"error", | |
| 1166 | }; | |
| 1167 | ||
| 1168 | pub const empty_aggregate_init_braces: Diagnostic = .{ | |
| 1169 | .fmt = "initializer for aggregate with no elements requires explicit braces", | |
| 1170 | .kind = .@"error", | |
| 1171 | }; | |
| 1172 | ||
| 1173 | pub const ptr_init_discards_quals: Diagnostic = .{ | |
| 1174 | .fmt = "initializing {qt} from incompatible type {qt} discards qualifiers", | |
| 1175 | .kind = .warning, | |
| 1176 | .opt = .@"incompatible-pointer-types-discards-qualifiers", | |
| 1177 | }; | |
| 1178 | ||
| 1179 | pub const ptr_assign_discards_quals: Diagnostic = .{ | |
| 1180 | .fmt = "assigning to {qt} from incompatible type {qt} discards qualifiers", | |
| 1181 | .kind = .warning, | |
| 1182 | .opt = .@"incompatible-pointer-types-discards-qualifiers", | |
| 1183 | }; | |
| 1184 | ||
| 1185 | pub const ptr_ret_discards_quals: Diagnostic = .{ | |
| 1186 | .fmt = "returning {qt} from a function with incompatible result type {qt} discards qualifiers", | |
| 1187 | .kind = .warning, | |
| 1188 | .opt = .@"incompatible-pointer-types-discards-qualifiers", | |
| 1189 | }; | |
| 1190 | ||
| 1191 | pub const ptr_arg_discards_quals: Diagnostic = .{ | |
| 1192 | .fmt = "passing {qt} to parameter of incompatible type {qt} discards qualifiers", | |
| 1193 | .kind = .warning, | |
| 1194 | .opt = .@"incompatible-pointer-types-discards-qualifiers", | |
| 1195 | }; | |
| 1196 | ||
| 1197 | pub const unknown_attribute: Diagnostic = .{ | |
| 1198 | .fmt = "unknown attribute '{s}' ignored", | |
| 1199 | .kind = .warning, | |
| 1200 | .opt = .@"unknown-attributes", | |
| 1201 | }; | |
| 1202 | ||
| 1203 | pub const ignored_attribute: Diagnostic = .{ | |
| 1204 | .fmt = "attribute '{s}' ignored on {s}", | |
| 1205 | .kind = .warning, | |
| 1206 | .opt = .@"ignored-attributes", | |
| 1207 | }; | |
| 1208 | ||
| 1209 | pub const invalid_fallthrough: Diagnostic = .{ | |
| 1210 | .fmt = "fallthrough annotation does not directly precede switch label", | |
| 1211 | .kind = .@"error", | |
| 1212 | }; | |
| 1213 | ||
| 1214 | pub const cannot_apply_attribute_to_statement: Diagnostic = .{ | |
| 1215 | .fmt = "'{s}' attribute cannot be applied to a statement", | |
| 1216 | .kind = .@"error", | |
| 1217 | }; | |
| 1218 | ||
| 1219 | pub const gnu_label_as_value: Diagnostic = .{ | |
| 1220 | .fmt = "use of GNU address-of-label extension", | |
| 1221 | .opt = .@"gnu-label-as-value", | |
| 1222 | .kind = .off, | |
| 1223 | .extension = true, | |
| 1224 | }; | |
| 1225 | ||
| 1226 | pub const expected_record_ty: Diagnostic = .{ | |
| 1227 | .fmt = "member reference base type {qt} is not a structure or union", | |
| 1228 | .kind = .@"error", | |
| 1229 | }; | |
| 1230 | ||
| 1231 | pub const member_expr_not_ptr: Diagnostic = .{ | |
| 1232 | .fmt = "member reference type {qt} is not a pointer; did you mean to use '.'?", | |
| 1233 | .kind = .@"error", | |
| 1234 | }; | |
| 1235 | ||
| 1236 | pub const member_expr_ptr: Diagnostic = .{ | |
| 1237 | .fmt = "member reference type {qt} is a pointer; did you mean to use '->'?", | |
| 1238 | .kind = .@"error", | |
| 1239 | }; | |
| 1240 | ||
| 1241 | pub const member_expr_atomic: Diagnostic = .{ | |
| 1242 | .fmt = "accessing a member of atomic type {qt} is undefined behavior", | |
| 1243 | .kind = .@"error", | |
| 1244 | }; | |
| 1245 | ||
| 1246 | pub const no_such_member: Diagnostic = .{ | |
| 1247 | .fmt = "no member named '{s}' in {qt}", | |
| 1248 | .kind = .@"error", | |
| 1249 | }; | |
| 1250 | ||
| 1251 | pub const invalid_computed_goto: Diagnostic = .{ | |
| 1252 | .fmt = "computed goto in function with no address-of-label expressions", | |
| 1253 | .kind = .@"error", | |
| 1254 | }; | |
| 1255 | ||
| 1256 | pub const empty_translation_unit: Diagnostic = .{ | |
| 1257 | .fmt = "ISO C requires a translation unit to contain at least one declaration", | |
| 1258 | .opt = .@"empty-translation-unit", | |
| 1259 | .kind = .off, | |
| 1260 | .extension = true, | |
| 1261 | }; | |
| 1262 | ||
| 1263 | pub const omitting_parameter_name: Diagnostic = .{ | |
| 1264 | .fmt = "omitting the parameter name in a function definition is a C23 extension", | |
| 1265 | .opt = .@"c23-extensions", | |
| 1266 | .kind = .warning, | |
| 1267 | .suppress_version = .c23, | |
| 1268 | .extension = true, | |
| 1269 | }; | |
| 1270 | ||
| 1271 | pub const non_int_bitfield: Diagnostic = .{ | |
| 1272 | .fmt = "bit-field has non-integer type {qt}", | |
| 1273 | .kind = .@"error", | |
| 1274 | }; | |
| 1275 | ||
| 1276 | pub const negative_bitwidth: Diagnostic = .{ | |
| 1277 | .fmt = "bit-field has negative width ({value})", | |
| 1278 | .kind = .@"error", | |
| 1279 | }; | |
| 1280 | ||
| 1281 | pub const zero_width_named_field: Diagnostic = .{ | |
| 1282 | .fmt = "named bit-field has zero width", | |
| 1283 | .kind = .@"error", | |
| 1284 | }; | |
| 1285 | ||
| 1286 | pub const bitfield_too_big: Diagnostic = .{ | |
| 1287 | .fmt = "width of bit-field exceeds width of its type", | |
| 1288 | .kind = .@"error", | |
| 1289 | }; | |
| 1290 | ||
| 1291 | pub const invalid_utf8: Diagnostic = .{ | |
| 1292 | .fmt = "source file is not valid UTF-8", | |
| 1293 | .kind = .@"error", | |
| 1294 | }; | |
| 1295 | ||
| 1296 | pub const implicitly_unsigned_literal: Diagnostic = .{ | |
| 1297 | .fmt = "integer literal is too large to be represented in a signed integer type, interpreting as unsigned", | |
| 1298 | .opt = .@"implicitly-unsigned-literal", | |
| 1299 | .kind = .warning, | |
| 1300 | .extension = true, | |
| 1301 | }; | |
| 1302 | ||
| 1303 | pub const invalid_preproc_operator: Diagnostic = .{ | |
| 1304 | .fmt = "token is not a valid binary operator in a preprocessor subexpression", | |
| 1305 | .kind = .@"error", | |
| 1306 | }; | |
| 1307 | ||
| 1308 | pub const c99_compat: Diagnostic = .{ | |
| 1309 | .fmt = "using this character in an identifier is incompatible with C99", | |
| 1310 | .kind = .off, | |
| 1311 | .opt = .@"c99-compat", | |
| 1312 | }; | |
| 1313 | ||
| 1314 | pub const unexpected_character: Diagnostic = .{ | |
| 1315 | .fmt = "unexpected character <U+{codepoint}>", | |
| 1316 | .kind = .@"error", | |
| 1317 | }; | |
| 1318 | ||
| 1319 | pub const invalid_identifier_start_char: Diagnostic = .{ | |
| 1320 | .fmt = "character <U+{codepoint}> not allowed at the start of an identifier", | |
| 1321 | .kind = .@"error", | |
| 1322 | }; | |
| 1323 | ||
| 1324 | pub const unicode_zero_width: Diagnostic = .{ | |
| 1325 | .fmt = "identifier contains Unicode character <U+{codepoint}> that is invisible in some environments", | |
| 1326 | .kind = .warning, | |
| 1327 | .opt = .@"unicode-homoglyph", | |
| 1328 | }; | |
| 1329 | ||
| 1330 | pub const unicode_homoglyph: Diagnostic = .{ | |
| 1331 | .fmt = "treating Unicode character <U+{codepoint}> as identifier character rather than as '{s}' symbol", | |
| 1332 | .kind = .warning, | |
| 1333 | .opt = .@"unicode-homoglyph", | |
| 1334 | }; | |
| 1335 | ||
| 1336 | pub const meaningless_asm_qual: Diagnostic = .{ | |
| 1337 | .fmt = "meaningless '{s}' on assembly outside function", | |
| 1338 | .kind = .@"error", | |
| 1339 | }; | |
| 1340 | ||
| 1341 | pub const duplicate_asm_qual: Diagnostic = .{ | |
| 1342 | .fmt = "duplicate asm qualifier '{s}'", | |
| 1343 | .kind = .@"error", | |
| 1344 | }; | |
| 1345 | ||
| 1346 | pub const invalid_asm_str: Diagnostic = .{ | |
| 1347 | .fmt = "cannot use {s} string literal in assembly", | |
| 1348 | .kind = .@"error", | |
| 1349 | }; | |
| 1350 | ||
| 1351 | pub const dollar_in_identifier_extension: Diagnostic = .{ | |
| 1352 | .fmt = "'$' in identifier", | |
| 1353 | .opt = .@"dollar-in-identifier-extension", | |
| 1354 | .kind = .off, | |
| 1355 | .extension = true, | |
| 1356 | }; | |
| 1357 | ||
| 1358 | pub const dollars_in_identifiers: Diagnostic = .{ | |
| 1359 | .fmt = "illegal character '$' in identifier", | |
| 1360 | .kind = .@"error", | |
| 1361 | }; | |
| 1362 | ||
| 1363 | pub const predefined_top_level: Diagnostic = .{ | |
| 1364 | .fmt = "predefined identifier is only valid inside function", | |
| 1365 | .opt = .@"predefined-identifier-outside-function", | |
| 1366 | .kind = .warning, | |
| 1367 | }; | |
| 1368 | ||
| 1369 | pub const incompatible_va_arg: Diagnostic = .{ | |
| 1370 | .fmt = "first argument to va_arg, is of type {qt} and not 'va_list'", | |
| 1371 | .kind = .@"error", | |
| 1372 | }; | |
| 1373 | ||
| 1374 | pub const too_many_scalar_init_braces: Diagnostic = .{ | |
| 1375 | .fmt = "too many braces around scalar initializer", | |
| 1376 | .opt = .@"many-braces-around-scalar-init", | |
| 1377 | .kind = .warning, | |
| 1378 | .extension = true, | |
| 1379 | }; | |
| 1380 | ||
| 1381 | // pub const uninitialized_in_own_init: Diagnostic = .{ | |
| 1382 | // .fmt = "variable '{s}' is uninitialized when used within its own initialization", | |
| 1383 | // .opt = .uninitialized, | |
| 1384 | // .kind = .off, | |
| 1385 | // }; | |
| 1386 | ||
| 1387 | pub const gnu_statement_expression: Diagnostic = .{ | |
| 1388 | .fmt = "use of GNU statement expression extension", | |
| 1389 | .opt = .@"gnu-statement-expression", | |
| 1390 | .kind = .off, | |
| 1391 | .extension = true, | |
| 1392 | }; | |
| 1393 | ||
| 1394 | pub const stmt_expr_not_allowed_file_scope: Diagnostic = .{ | |
| 1395 | .fmt = "statement expression not allowed at file scope", | |
| 1396 | .kind = .@"error", | |
| 1397 | }; | |
| 1398 | ||
| 1399 | pub const gnu_imaginary_constant: Diagnostic = .{ | |
| 1400 | .fmt = "imaginary constants are a GNU extension", | |
| 1401 | .opt = .@"gnu-imaginary-constant", | |
| 1402 | .kind = .off, | |
| 1403 | .extension = true, | |
| 1404 | }; | |
| 1405 | ||
| 1406 | pub const plain_complex: Diagnostic = .{ | |
| 1407 | .fmt = "plain '_Complex' requires a type specifier; assuming '_Complex double'", | |
| 1408 | .kind = .warning, | |
| 1409 | .extension = true, | |
| 1410 | }; | |
| 1411 | ||
| 1412 | pub const complex_int: Diagnostic = .{ | |
| 1413 | .fmt = "complex integer types are a GNU extension", | |
| 1414 | .opt = .@"gnu-complex-integer", | |
| 1415 | .kind = .off, | |
| 1416 | .extension = true, | |
| 1417 | }; | |
| 1418 | ||
| 1419 | pub const qual_on_ret_type: Diagnostic = .{ | |
| 1420 | .fmt = "'{s}' type qualifier on return type has no effect", | |
| 1421 | .opt = .@"ignored-qualifiers", | |
| 1422 | .kind = .off, | |
| 1423 | }; | |
| 1424 | ||
| 1425 | pub const extra_semi: Diagnostic = .{ | |
| 1426 | .fmt = "extra ';' outside of a function", | |
| 1427 | .opt = .@"extra-semi", | |
| 1428 | .kind = .off, | |
| 1429 | }; | |
| 1430 | ||
| 1431 | pub const func_field: Diagnostic = .{ | |
| 1432 | .fmt = "field declared as a function", | |
| 1433 | .kind = .@"error", | |
| 1434 | }; | |
| 1435 | ||
| 1436 | pub const expected_member_name: Diagnostic = .{ | |
| 1437 | .fmt = "expected member name after declarator", | |
| 1438 | .kind = .@"error", | |
| 1439 | }; | |
| 1440 | ||
| 1441 | pub const vla_field: Diagnostic = .{ | |
| 1442 | .fmt = "variable length array fields extension is not supported", | |
| 1443 | .kind = .@"error", | |
| 1444 | }; | |
| 1445 | ||
| 1446 | pub const field_incomplete_ty: Diagnostic = .{ | |
| 1447 | .fmt = "field has incomplete type {qt}", | |
| 1448 | .kind = .@"error", | |
| 1449 | }; | |
| 1450 | ||
| 1451 | pub const flexible_in_union: Diagnostic = .{ | |
| 1452 | .fmt = "flexible array member in union is not allowed", | |
| 1453 | .kind = .@"error", | |
| 1454 | }; | |
| 1455 | ||
| 1456 | pub const flexible_in_union_msvc: Diagnostic = .{ | |
| 1457 | .fmt = "flexible array member in union is a Microsoft extension", | |
| 1458 | .kind = .off, | |
| 1459 | .opt = .@"microsoft-flexible-array", | |
| 1460 | .extension = true, | |
| 1461 | }; | |
| 1462 | ||
| 1463 | pub const flexible_non_final: Diagnostic = .{ | |
| 1464 | .fmt = "flexible array member is not at the end of struct", | |
| 1465 | .kind = .@"error", | |
| 1466 | }; | |
| 1467 | ||
| 1468 | pub const flexible_in_empty: Diagnostic = .{ | |
| 1469 | .fmt = "flexible array member in otherwise empty struct", | |
| 1470 | .kind = .@"error", | |
| 1471 | }; | |
| 1472 | ||
| 1473 | pub const flexible_in_empty_msvc: Diagnostic = .{ | |
| 1474 | .fmt = "flexible array member in otherwise empty struct is a Microsoft extension", | |
| 1475 | .kind = .off, | |
| 1476 | .opt = .@"microsoft-flexible-array", | |
| 1477 | .extension = true, | |
| 1478 | }; | |
| 1479 | ||
| 1480 | pub const anonymous_struct: Diagnostic = .{ | |
| 1481 | .fmt = "anonymous structs are a Microsoft extension", | |
| 1482 | .kind = .warning, | |
| 1483 | .opt = .@"microsoft-anon-tag", | |
| 1484 | .extension = true, | |
| 1485 | }; | |
| 1486 | ||
| 1487 | pub const duplicate_member: Diagnostic = .{ | |
| 1488 | .fmt = "duplicate member '{s}'", | |
| 1489 | .kind = .@"error", | |
| 1490 | }; | |
| 1491 | ||
| 1492 | pub const binary_integer_literal: Diagnostic = .{ | |
| 1493 | .fmt = "binary integer literals are a C23 extension", | |
| 1494 | .opt = .@"c23-extensions", | |
| 1495 | .kind = .off, | |
| 1496 | .suppress_version = .c23, | |
| 1497 | .extension = true, | |
| 1498 | }; | |
| 1499 | ||
| 1500 | pub const builtin_must_be_called: Diagnostic = .{ | |
| 1501 | .fmt = "builtin function must be directly called", | |
| 1502 | .kind = .@"error", | |
| 1503 | }; | |
| 1504 | ||
| 1505 | pub const va_start_not_in_func: Diagnostic = .{ | |
| 1506 | .fmt = "'va_start' cannot be used outside a function", | |
| 1507 | .kind = .@"error", | |
| 1508 | }; | |
| 1509 | ||
| 1510 | pub const va_start_fixed_args: Diagnostic = .{ | |
| 1511 | .fmt = "'va_start' used in a function with fixed args", | |
| 1512 | .kind = .@"error", | |
| 1513 | }; | |
| 1514 | ||
| 1515 | pub const va_start_not_last_param: Diagnostic = .{ | |
| 1516 | .fmt = "second argument to 'va_start' is not the last named parameter", | |
| 1517 | .opt = .varargs, | |
| 1518 | .kind = .warning, | |
| 1519 | }; | |
| 1520 | ||
| 1521 | pub const attribute_not_enough_args: Diagnostic = .{ | |
| 1522 | .fmt = "'{s}' attribute takes at least {d} argument(s)", | |
| 1523 | .kind = .@"error", | |
| 1524 | }; | |
| 1525 | ||
| 1526 | pub const attribute_too_many_args: Diagnostic = .{ | |
| 1527 | .fmt = "'{s}' attribute takes at most {d} argument(s)", | |
| 1528 | .kind = .@"error", | |
| 1529 | }; | |
| 1530 | ||
| 1531 | pub const attribute_arg_invalid: Diagnostic = .{ | |
| 1532 | .fmt = "attribute argument is invalid, expected {s} but got {s}", | |
| 1533 | .kind = .@"error", | |
| 1534 | }; | |
| 1535 | ||
| 1536 | pub const unknown_attr_enum: Diagnostic = .{ | |
| 1537 | .fmt = "unknown `{s}` argument. Possible values are: {s}", | |
| 1538 | .kind = .warning, | |
| 1539 | .opt = .@"ignored-attributes", | |
| 1540 | }; | |
| 1541 | ||
| 1542 | pub const attribute_requires_identifier: Diagnostic = .{ | |
| 1543 | .fmt = "'{s}' attribute requires an identifier", | |
| 1544 | .kind = .@"error", | |
| 1545 | }; | |
| 1546 | ||
| 1547 | pub const attribute_int_out_of_range: Diagnostic = .{ | |
| 1548 | .fmt = "attribute value '{value}' out of range", | |
| 1549 | .kind = .@"error", | |
| 1550 | }; | |
| 1551 | ||
| 1552 | pub const declspec_not_enabled: Diagnostic = .{ | |
| 1553 | .fmt = "'__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes", | |
| 1554 | .kind = .@"error", | |
| 1555 | }; | |
| 1556 | ||
| 1557 | pub const declspec_attr_not_supported: Diagnostic = .{ | |
| 1558 | .fmt = "__declspec attribute '{s}' is not supported", | |
| 1559 | .opt = .@"ignored-attributes", | |
| 1560 | .kind = .warning, | |
| 1561 | }; | |
| 1562 | ||
| 1563 | pub const deprecated_declarations: Diagnostic = .{ | |
| 1564 | .fmt = "'{s}' is deprecated{s}{s}", | |
| 1565 | .opt = .@"deprecated-declarations", | |
| 1566 | .kind = .warning, | |
| 1567 | }; | |
| 1568 | ||
| 1569 | pub const deprecated_note: Diagnostic = .{ | |
| 1570 | .fmt = "'{s}' has been explicitly marked deprecated here", | |
| 1571 | .opt = .@"deprecated-declarations", | |
| 1572 | .kind = .note, | |
| 1573 | }; | |
| 1574 | ||
| 1575 | pub const unavailable: Diagnostic = .{ | |
| 1576 | .fmt = "'{s}' is unavailable{s}{s}", | |
| 1577 | .kind = .@"error", | |
| 1578 | }; | |
| 1579 | ||
| 1580 | pub const unavailable_note: Diagnostic = .{ | |
| 1581 | .fmt = "'{s}' has been explicitly marked unavailable here", | |
| 1582 | .kind = .note, | |
| 1583 | }; | |
| 1584 | ||
| 1585 | pub const warning_attribute: Diagnostic = .{ | |
| 1586 | .fmt = "call to '{s}' declared with attribute warning: {s}", | |
| 1587 | .kind = .warning, | |
| 1588 | .opt = .@"attribute-warning", | |
| 1589 | }; | |
| 1590 | ||
| 1591 | pub const error_attribute: Diagnostic = .{ | |
| 1592 | .fmt = "call to '{s}' declared with attribute error: {s}", | |
| 1593 | .kind = .@"error", | |
| 1594 | }; | |
| 1595 | ||
| 1596 | pub const ignored_record_attr: Diagnostic = .{ | |
| 1597 | .fmt = "attribute '{s}' is ignored, place it after \"{s}\" to apply attribute to type declaration", | |
| 1598 | .kind = .warning, | |
| 1599 | .opt = .@"ignored-attributes", | |
| 1600 | }; | |
| 1601 | ||
| 1602 | pub const array_size_non_int: Diagnostic = .{ | |
| 1603 | .fmt = "size of array has non-integer type {qt}", | |
| 1604 | .kind = .@"error", | |
| 1605 | }; | |
| 1606 | ||
| 1607 | pub const cast_to_smaller_int: Diagnostic = .{ | |
| 1608 | .fmt = "cast to smaller integer type {qt} from {qt}", | |
| 1609 | .kind = .warning, | |
| 1610 | .opt = .@"pointer-to-int-cast", | |
| 1611 | }; | |
| 1612 | ||
| 1613 | pub const gnu_switch_range: Diagnostic = .{ | |
| 1614 | .fmt = "use of GNU case range extension", | |
| 1615 | .opt = .@"gnu-case-range", | |
| 1616 | .kind = .off, | |
| 1617 | .extension = true, | |
| 1618 | }; | |
| 1619 | ||
| 1620 | pub const empty_case_range: Diagnostic = .{ | |
| 1621 | .fmt = "empty case range specified", | |
| 1622 | .kind = .warning, | |
| 1623 | }; | |
| 1624 | ||
| 1625 | pub const vla: Diagnostic = .{ | |
| 1626 | .fmt = "variable length array used", | |
| 1627 | .kind = .off, | |
| 1628 | .opt = .vla, | |
| 1629 | }; | |
| 1630 | ||
| 1631 | pub const int_value_changed: Diagnostic = .{ | |
| 1632 | .fmt = "implicit conversion from {qt} to {qt} changes {s}value from {value} to {value}", | |
| 1633 | .kind = .warning, | |
| 1634 | .opt = .@"constant-conversion", | |
| 1635 | }; | |
| 1636 | ||
| 1637 | pub const sign_conversion: Diagnostic = .{ | |
| 1638 | .fmt = "implicit conversion changes signedness: {qt} to {qt}", | |
| 1639 | .kind = .off, | |
| 1640 | .opt = .@"sign-conversion", | |
| 1641 | }; | |
| 1642 | ||
| 1643 | pub const float_overflow_conversion: Diagnostic = .{ | |
| 1644 | .fmt = "implicit conversion of non-finite value from {qt} to {qt} is undefined", | |
| 1645 | .kind = .off, | |
| 1646 | .opt = .@"float-overflow-conversion", | |
| 1647 | }; | |
| 1648 | ||
| 1649 | pub const float_out_of_range: Diagnostic = .{ | |
| 1650 | .fmt = "implicit conversion of out of range value from {qt} to {qt} is undefined", | |
| 1651 | .kind = .warning, | |
| 1652 | .opt = .@"literal-conversion", | |
| 1653 | }; | |
| 1654 | ||
| 1655 | pub const float_zero_conversion: Diagnostic = .{ | |
| 1656 | .fmt = "implicit conversion from {qt} to {qt} changes {s}value from {value} to {value}", | |
| 1657 | .kind = .off, | |
| 1658 | .opt = .@"float-zero-conversion", | |
| 1659 | }; | |
| 1660 | ||
| 1661 | pub const float_value_changed: Diagnostic = .{ | |
| 1662 | .fmt = "implicit conversion from {qt} to {qt} changes {s}value from {value} to {value}", | |
| 1663 | .kind = .warning, | |
| 1664 | .opt = .@"float-conversion", | |
| 1665 | }; | |
| 1666 | ||
| 1667 | pub const float_to_int: Diagnostic = .{ | |
| 1668 | .fmt = "implicit conversion turns floating-point number into integer: {qt} to {qt}", | |
| 1669 | .kind = .off, | |
| 1670 | .opt = .@"literal-conversion", | |
| 1671 | }; | |
| 1672 | ||
| 1673 | pub const const_decl_folded: Diagnostic = .{ | |
| 1674 | .fmt = "expression is not an integer constant expression; folding it to a constant is a GNU extension", | |
| 1675 | .kind = .off, | |
| 1676 | .opt = .@"gnu-folding-constant", | |
| 1677 | .extension = true, | |
| 1678 | }; | |
| 1679 | ||
| 1680 | pub const const_decl_folded_vla: Diagnostic = .{ | |
| 1681 | .fmt = "variable length array folded to constant array as an extension", | |
| 1682 | .kind = .off, | |
| 1683 | .opt = .@"gnu-folding-constant", | |
| 1684 | .extension = true, | |
| 1685 | }; | |
| 1686 | ||
| 1687 | pub const redefinition_of_typedef: Diagnostic = .{ | |
| 1688 | .fmt = "typedef redefinition with different types ({qt} vs {qt})", | |
| 1689 | .kind = .@"error", | |
| 1690 | }; | |
| 1691 | ||
| 1692 | pub const offsetof_ty: Diagnostic = .{ | |
| 1693 | .fmt = "offsetof requires struct or union type, {qt} invalid", | |
| 1694 | .kind = .@"error", | |
| 1695 | }; | |
| 1696 | ||
| 1697 | pub const offsetof_incomplete: Diagnostic = .{ | |
| 1698 | .fmt = "offsetof of incomplete type {qt}", | |
| 1699 | .kind = .@"error", | |
| 1700 | }; | |
| 1701 | ||
| 1702 | pub const offsetof_array: Diagnostic = .{ | |
| 1703 | .fmt = "offsetof requires array type, {qt} invalid", | |
| 1704 | .kind = .@"error", | |
| 1705 | }; | |
| 1706 | ||
| 1707 | pub const cond_expr_type: Diagnostic = .{ | |
| 1708 | .fmt = "used type {qt} where arithmetic or pointer type is required", | |
| 1709 | .kind = .@"error", | |
| 1710 | }; | |
| 1711 | ||
| 1712 | pub const enumerator_too_small: Diagnostic = .{ | |
| 1713 | .fmt = "ISO C restricts enumerator values to range of 'int' ({value} is too small)", | |
| 1714 | .kind = .off, | |
| 1715 | .extension = true, | |
| 1716 | }; | |
| 1717 | ||
| 1718 | pub const enumerator_too_large: Diagnostic = .{ | |
| 1719 | .fmt = "ISO C restricts enumerator values to range of 'int' ({value} is too large)", | |
| 1720 | .kind = .off, | |
| 1721 | .extension = true, | |
| 1722 | }; | |
| 1723 | ||
| 1724 | pub const enumerator_overflow: Diagnostic = .{ | |
| 1725 | .fmt = "overflow in enumeration value", | |
| 1726 | .kind = .warning, | |
| 1727 | }; | |
| 1728 | ||
| 1729 | pub const enum_not_representable: Diagnostic = .{ | |
| 1730 | .fmt = "incremented enumerator value {s} is not representable in the largest integer type", | |
| 1731 | .kind = .warning, | |
| 1732 | .opt = .@"enum-too-large", | |
| 1733 | .extension = true, | |
| 1734 | }; | |
| 1735 | ||
| 1736 | pub const enum_too_large: Diagnostic = .{ | |
| 1737 | .fmt = "enumeration values exceed range of largest integer", | |
| 1738 | .kind = .warning, | |
| 1739 | .opt = .@"enum-too-large", | |
| 1740 | .extension = true, | |
| 1741 | }; | |
| 1742 | ||
| 1743 | pub const enum_fixed: Diagnostic = .{ | |
| 1744 | .fmt = "enumeration types with a fixed underlying type are a Clang extension", | |
| 1745 | .kind = .off, | |
| 1746 | .opt = .@"fixed-enum-extension", | |
| 1747 | .extension = true, | |
| 1748 | }; | |
| 1749 | ||
| 1750 | pub const enum_prev_nonfixed: Diagnostic = .{ | |
| 1751 | .fmt = "enumeration previously declared with nonfixed underlying type", | |
| 1752 | .kind = .@"error", | |
| 1753 | }; | |
| 1754 | ||
| 1755 | pub const enum_prev_fixed: Diagnostic = .{ | |
| 1756 | .fmt = "enumeration previously declared with fixed underlying type", | |
| 1757 | .kind = .@"error", | |
| 1758 | }; | |
| 1759 | ||
| 1760 | pub const enum_different_explicit_ty: Diagnostic = .{ | |
| 1761 | .fmt = "enumeration redeclared with different underlying type {qt} (was {qt})", | |
| 1762 | .kind = .@"error", | |
| 1763 | }; | |
| 1764 | ||
| 1765 | pub const enum_not_representable_fixed: Diagnostic = .{ | |
| 1766 | .fmt = "enumerator value is not representable in the underlying type {qt}", | |
| 1767 | .kind = .@"error", | |
| 1768 | }; | |
| 1769 | ||
| 1770 | pub const transparent_union_wrong_type: Diagnostic = .{ | |
| 1771 | .fmt = "'transparent_union' attribute only applies to unions", | |
| 1772 | .opt = .@"ignored-attributes", | |
| 1773 | .kind = .warning, | |
| 1774 | }; | |
| 1775 | ||
| 1776 | pub const transparent_union_one_field: Diagnostic = .{ | |
| 1777 | .fmt = "transparent union definition must contain at least one field; transparent_union attribute ignored", | |
| 1778 | .opt = .@"ignored-attributes", | |
| 1779 | .kind = .warning, | |
| 1780 | }; | |
| 1781 | ||
| 1782 | pub const transparent_union_size: Diagnostic = .{ | |
| 1783 | .fmt = "size of field '{s}' ({d} bits) does not match the size of the first field in transparent union; transparent_union attribute ignored", | |
| 1784 | .kind = .warning, | |
| 1785 | .opt = .@"ignored-attributes", | |
| 1786 | }; | |
| 1787 | ||
| 1788 | pub const transparent_union_size_note: Diagnostic = .{ | |
| 1789 | .fmt = "size of first field is {d}", | |
| 1790 | .kind = .note, | |
| 1791 | }; | |
| 1792 | ||
| 1793 | pub const designated_init_invalid: Diagnostic = .{ | |
| 1794 | .fmt = "'designated_init' attribute is only valid on 'struct' type'", | |
| 1795 | .kind = .@"error", | |
| 1796 | }; | |
| 1797 | ||
| 1798 | pub const designated_init_needed: Diagnostic = .{ | |
| 1799 | .fmt = "positional initialization of field in 'struct' declared with 'designated_init' attribute", | |
| 1800 | .opt = .@"designated-init", | |
| 1801 | .kind = .warning, | |
| 1802 | }; | |
| 1803 | ||
| 1804 | pub const ignore_common: Diagnostic = .{ | |
| 1805 | .fmt = "ignoring attribute 'common' because it conflicts with attribute 'nocommon'", | |
| 1806 | .opt = .@"ignored-attributes", | |
| 1807 | .kind = .warning, | |
| 1808 | }; | |
| 1809 | ||
| 1810 | pub const ignore_nocommon: Diagnostic = .{ | |
| 1811 | .fmt = "ignoring attribute 'nocommon' because it conflicts with attribute 'common'", | |
| 1812 | .opt = .@"ignored-attributes", | |
| 1813 | .kind = .warning, | |
| 1814 | }; | |
| 1815 | ||
| 1816 | pub const non_string_ignored: Diagnostic = .{ | |
| 1817 | .fmt = "'nonstring' attribute ignored on objects of type {qt}", | |
| 1818 | .opt = .@"ignored-attributes", | |
| 1819 | .kind = .warning, | |
| 1820 | }; | |
| 1821 | ||
| 1822 | pub const local_variable_attribute: Diagnostic = .{ | |
| 1823 | .fmt = "'{s}' attribute only applies to local variables", | |
| 1824 | .opt = .@"ignored-attributes", | |
| 1825 | .kind = .warning, | |
| 1826 | }; | |
| 1827 | ||
| 1828 | pub const ignore_cold: Diagnostic = .{ | |
| 1829 | .fmt = "ignoring attribute 'cold' because it conflicts with attribute 'hot'", | |
| 1830 | .opt = .@"ignored-attributes", | |
| 1831 | .kind = .warning, | |
| 1832 | }; | |
| 1833 | ||
| 1834 | pub const ignore_hot: Diagnostic = .{ | |
| 1835 | .fmt = "ignoring attribute 'hot' because it conflicts with attribute 'cold'", | |
| 1836 | .opt = .@"ignored-attributes", | |
| 1837 | .kind = .warning, | |
| 1838 | }; | |
| 1839 | ||
| 1840 | pub const ignore_noinline: Diagnostic = .{ | |
| 1841 | .fmt = "ignoring attribute 'noinline' because it conflicts with attribute 'always_inline'", | |
| 1842 | .opt = .@"ignored-attributes", | |
| 1843 | .kind = .warning, | |
| 1844 | }; | |
| 1845 | ||
| 1846 | pub const ignore_always_inline: Diagnostic = .{ | |
| 1847 | .fmt = "ignoring attribute 'always_inline' because it conflicts with attribute 'noinline'", | |
| 1848 | .opt = .@"ignored-attributes", | |
| 1849 | .kind = .warning, | |
| 1850 | }; | |
| 1851 | ||
| 1852 | pub const invalid_noreturn: Diagnostic = .{ | |
| 1853 | .fmt = "function '{s}' declared 'noreturn' should not return", | |
| 1854 | .kind = .warning, | |
| 1855 | .opt = .@"invalid-noreturn", | |
| 1856 | }; | |
| 1857 | ||
| 1858 | pub const nodiscard_unused: Diagnostic = .{ | |
| 1859 | .fmt = "ignoring return value of '{s}', declared with 'nodiscard' attribute", | |
| 1860 | .kind = .warning, | |
| 1861 | .opt = .@"unused-result", | |
| 1862 | }; | |
| 1863 | ||
| 1864 | pub const warn_unused_result: Diagnostic = .{ | |
| 1865 | .fmt = "ignoring return value of '{s}', declared with 'warn_unused_result' attribute", | |
| 1866 | .kind = .warning, | |
| 1867 | .opt = .@"unused-result", | |
| 1868 | }; | |
| 1869 | ||
| 1870 | pub const builtin_unused: Diagnostic = .{ | |
| 1871 | .fmt = "ignoring return value of function declared with {s} attribute", | |
| 1872 | .kind = .warning, | |
| 1873 | .opt = .@"unused-value", | |
| 1874 | }; | |
| 1875 | ||
| 1876 | pub const unused_value: Diagnostic = .{ | |
| 1877 | .fmt = "expression result unused", | |
| 1878 | .kind = .warning, | |
| 1879 | .opt = .@"unused-value", | |
| 1880 | }; | |
| 1881 | ||
| 1882 | pub const invalid_vec_elem_ty: Diagnostic = .{ | |
| 1883 | .fmt = "invalid vector element type {qt}", | |
| 1884 | .kind = .@"error", | |
| 1885 | }; | |
| 1886 | ||
| 1887 | pub const bit_int_vec_too_small: Diagnostic = .{ | |
| 1888 | .fmt = "'_BitInt' vector element width must be at least as wide as 'CHAR_BIT'", | |
| 1889 | .kind = .@"error", | |
| 1890 | }; | |
| 1891 | ||
| 1892 | pub const bit_int_vec_not_pow2: Diagnostic = .{ | |
| 1893 | .fmt = "'_BitInt' vector element width must be a power of 2", | |
| 1894 | .kind = .@"error", | |
| 1895 | }; | |
| 1896 | ||
| 1897 | pub const vec_size_not_multiple: Diagnostic = .{ | |
| 1898 | .fmt = "vector size not an integral multiple of component size", | |
| 1899 | .kind = .@"error", | |
| 1900 | }; | |
| 1901 | ||
| 1902 | pub const invalid_imag: Diagnostic = .{ | |
| 1903 | .fmt = "invalid type {qt} to __imag operator", | |
| 1904 | .kind = .@"error", | |
| 1905 | }; | |
| 1906 | ||
| 1907 | pub const invalid_real: Diagnostic = .{ | |
| 1908 | .fmt = "invalid type {qt} to __real operator", | |
| 1909 | .kind = .@"error", | |
| 1910 | }; | |
| 1911 | ||
| 1912 | pub const zero_length_array: Diagnostic = .{ | |
| 1913 | .fmt = "zero size arrays are an extension", | |
| 1914 | .kind = .off, | |
| 1915 | .opt = .@"zero-length-array", | |
| 1916 | .extension = true, | |
| 1917 | }; | |
| 1918 | ||
| 1919 | pub const old_style_flexible_struct: Diagnostic = .{ | |
| 1920 | .fmt = "array index {value} is past the end of the array", | |
| 1921 | .kind = .off, | |
| 1922 | .opt = .@"old-style-flexible-struct", | |
| 1923 | }; | |
| 1924 | ||
| 1925 | pub const main_return_type: Diagnostic = .{ | |
| 1926 | .fmt = "return type of 'main' is not 'int'", | |
| 1927 | .kind = .warning, | |
| 1928 | .opt = .@"main-return-type", | |
| 1929 | .extension = true, | |
| 1930 | }; | |
| 1931 | ||
| 1932 | pub const invalid_int_suffix: Diagnostic = .{ | |
| 1933 | .fmt = "invalid suffix '{s}' on integer constant", | |
| 1934 | .kind = .@"error", | |
| 1935 | }; | |
| 1936 | ||
| 1937 | pub const invalid_float_suffix: Diagnostic = .{ | |
| 1938 | .fmt = "invalid suffix '{s}' on floating constant", | |
| 1939 | .kind = .@"error", | |
| 1940 | }; | |
| 1941 | ||
| 1942 | pub const invalid_octal_digit: Diagnostic = .{ | |
| 1943 | .fmt = "invalid digit '{c}' in octal constant", | |
| 1944 | .kind = .@"error", | |
| 1945 | }; | |
| 1946 | ||
| 1947 | pub const invalid_binary_digit: Diagnostic = .{ | |
| 1948 | .fmt = "invalid digit '{c}' in binary constant", | |
| 1949 | .kind = .@"error", | |
| 1950 | }; | |
| 1951 | ||
| 1952 | pub const exponent_has_no_digits: Diagnostic = .{ | |
| 1953 | .fmt = "exponent has no digits", | |
| 1954 | .kind = .@"error", | |
| 1955 | }; | |
| 1956 | ||
| 1957 | pub const hex_floating_constant_requires_exponent: Diagnostic = .{ | |
| 1958 | .fmt = "hexadecimal floating constant requires an exponent", | |
| 1959 | .kind = .@"error", | |
| 1960 | }; | |
| 1961 | ||
| 1962 | pub const sizeof_returns_zero: Diagnostic = .{ | |
| 1963 | .fmt = "sizeof returns 0", | |
| 1964 | .kind = .warning, | |
| 1965 | }; | |
| 1966 | ||
| 1967 | pub const declspec_not_allowed_after_declarator: Diagnostic = .{ | |
| 1968 | .fmt = "'declspec' attribute not allowed after declarator", | |
| 1969 | .kind = .@"error", | |
| 1970 | }; | |
| 1971 | ||
| 1972 | pub const declarator_name_tok: Diagnostic = .{ | |
| 1973 | .fmt = "this declarator", | |
| 1974 | .kind = .note, | |
| 1975 | }; | |
| 1976 | ||
| 1977 | pub const type_not_supported_on_target: Diagnostic = .{ | |
| 1978 | .fmt = "{s} is not supported on this target", | |
| 1979 | .kind = .@"error", | |
| 1980 | }; | |
| 1981 | ||
| 1982 | pub const bit_int: Diagnostic = .{ | |
| 1983 | .fmt = "'_BitInt' in C17 and earlier is a Clang extension", | |
| 1984 | .kind = .off, | |
| 1985 | .opt = .@"bit-int-extension", | |
| 1986 | .suppress_version = .c23, | |
| 1987 | .extension = true, | |
| 1988 | }; | |
| 1989 | ||
| 1990 | pub const unsigned_bit_int_too_small: Diagnostic = .{ | |
| 1991 | .fmt = "{s}unsigned _BitInt must have a bit size of at least 1", | |
| 1992 | .kind = .@"error", | |
| 1993 | }; | |
| 1994 | ||
| 1995 | pub const signed_bit_int_too_small: Diagnostic = .{ | |
| 1996 | .fmt = "{s}signed _BitInt must have a bit size of at least 2", | |
| 1997 | .kind = .@"error", | |
| 1998 | }; | |
| 1999 | ||
| 2000 | pub const unsigned_bit_int_too_big: Diagnostic = .{ | |
| 2001 | .fmt = "{s}unsigned _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Compilation.bit_int_max_bits}) ++ " not supported", | |
| 2002 | .kind = .@"error", | |
| 2003 | }; | |
| 2004 | ||
| 2005 | pub const signed_bit_int_too_big: Diagnostic = .{ | |
| 2006 | .fmt = "{s}signed _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Compilation.bit_int_max_bits}) ++ " not supported", | |
| 2007 | .kind = .@"error", | |
| 2008 | }; | |
| 2009 | ||
| 2010 | pub const ptr_arithmetic_incomplete: Diagnostic = .{ | |
| 2011 | .fmt = "arithmetic on a pointer to an incomplete type {qt}", | |
| 2012 | .kind = .@"error", | |
| 2013 | }; | |
| 2014 | ||
| 2015 | pub const callconv_not_supported: Diagnostic = .{ | |
| 2016 | .fmt = "'{s}' calling convention is not supported for this target", | |
| 2017 | .kind = .warning, | |
| 2018 | .opt = .@"ignored-attributes", | |
| 2019 | }; | |
| 2020 | ||
| 2021 | pub const callconv_non_func: Diagnostic = .{ | |
| 2022 | .fmt = "'{s}' only applies to function types; type here is {qt}", | |
| 2023 | .kind = .warning, | |
| 2024 | .opt = .@"ignored-attributes", | |
| 2025 | }; | |
| 2026 | ||
| 2027 | pub const pointer_arith_void: Diagnostic = .{ | |
| 2028 | .fmt = "invalid application of '{s}' to a void type", | |
| 2029 | .kind = .off, | |
| 2030 | .opt = .@"pointer-arith", | |
| 2031 | .extension = true, | |
| 2032 | }; | |
| 2033 | ||
| 2034 | pub const sizeof_array_arg: Diagnostic = .{ | |
| 2035 | .fmt = "sizeof on array function parameter will return size of {qt} instead of {qt}", | |
| 2036 | .kind = .warning, | |
| 2037 | .opt = .@"sizeof-array-argument", | |
| 2038 | }; | |
| 2039 | ||
| 2040 | pub const array_address_to_bool: Diagnostic = .{ | |
| 2041 | .fmt = "address of array '{s}' will always evaluate to 'true'", | |
| 2042 | .kind = .warning, | |
| 2043 | .opt = .@"pointer-bool-conversion", | |
| 2044 | }; | |
| 2045 | ||
| 2046 | pub const string_literal_to_bool: Diagnostic = .{ | |
| 2047 | .fmt = "implicit conversion turns string literal into bool: {qt} to {qt}", | |
| 2048 | .kind = .off, | |
| 2049 | .opt = .@"string-conversion", | |
| 2050 | }; | |
| 2051 | ||
| 2052 | // pub const constant_expression_conversion_not_allowed: Diagnostic = .{ | |
| 2053 | // .fmt = "this conversion is not allowed in a constant expression", | |
| 2054 | // .kind = .note, | |
| 2055 | // }; | |
| 2056 | ||
| 2057 | pub const invalid_object_cast: Diagnostic = .{ | |
| 2058 | .fmt = "cannot cast an object of type {qt} to {qt}", | |
| 2059 | .kind = .@"error", | |
| 2060 | }; | |
| 2061 | ||
| 2062 | pub const suggest_pointer_for_invalid_fp16: Diagnostic = .{ | |
| 2063 | .fmt = "{s} cannot have __fp16 type; did you forget * ?", | |
| 2064 | .kind = .@"error", | |
| 2065 | }; | |
| 2066 | ||
| 2067 | pub const bitint_suffix: Diagnostic = .{ | |
| 2068 | .fmt = "'_BitInt' suffix for literals is a C23 extension", | |
| 2069 | .opt = .@"c23-extensions", | |
| 2070 | .kind = .warning, | |
| 2071 | .suppress_version = .c23, | |
| 2072 | .extension = true, | |
| 2073 | }; | |
| 2074 | ||
| 2075 | pub const auto_type_extension: Diagnostic = .{ | |
| 2076 | .fmt = "'__auto_type' is a GNU extension", | |
| 2077 | .opt = .@"gnu-auto-type", | |
| 2078 | .kind = .off, | |
| 2079 | .extension = true, | |
| 2080 | }; | |
| 2081 | ||
| 2082 | pub const gnu_pointer_arith: Diagnostic = .{ | |
| 2083 | .fmt = "arithmetic on pointers to void is a GNU extension", | |
| 2084 | .opt = .@"gnu-pointer-arith", | |
| 2085 | .kind = .off, | |
| 2086 | .extension = true, | |
| 2087 | }; | |
| 2088 | ||
| 2089 | pub const auto_type_not_allowed: Diagnostic = .{ | |
| 2090 | .fmt = "'__auto_type' not allowed in {s}", | |
| 2091 | .kind = .@"error", | |
| 2092 | }; | |
| 2093 | ||
| 2094 | pub const auto_type_requires_initializer: Diagnostic = .{ | |
| 2095 | .fmt = "declaration of variable '{s}' with deduced type requires an initializer", | |
| 2096 | .kind = .@"error", | |
| 2097 | }; | |
| 2098 | ||
| 2099 | pub const auto_type_requires_single_declarator: Diagnostic = .{ | |
| 2100 | .fmt = "'__auto_type' may only be used with a single declarator", | |
| 2101 | .kind = .@"error", | |
| 2102 | }; | |
| 2103 | ||
| 2104 | pub const auto_type_requires_plain_declarator: Diagnostic = .{ | |
| 2105 | .fmt = "'__auto_type' requires a plain identifier as declarator", | |
| 2106 | .kind = .@"error", | |
| 2107 | }; | |
| 2108 | ||
| 2109 | pub const auto_type_from_bitfield: Diagnostic = .{ | |
| 2110 | .fmt = "cannot use bit-field as '__auto_type' initializer", | |
| 2111 | .kind = .@"error", | |
| 2112 | }; | |
| 2113 | ||
| 2114 | pub const auto_type_array: Diagnostic = .{ | |
| 2115 | .fmt = "'{s}' declared as array of '__auto_type'", | |
| 2116 | .kind = .@"error", | |
| 2117 | }; | |
| 2118 | ||
| 2119 | pub const auto_type_with_init_list: Diagnostic = .{ | |
| 2120 | .fmt = "cannot use '__auto_type' with initializer list", | |
| 2121 | .kind = .@"error", | |
| 2122 | }; | |
| 2123 | ||
| 2124 | pub const missing_semicolon: Diagnostic = .{ | |
| 2125 | .fmt = "expected ';' at end of declaration list", | |
| 2126 | .kind = .warning, | |
| 2127 | .extension = true, | |
| 2128 | }; | |
| 2129 | ||
| 2130 | pub const tentative_definition_incomplete: Diagnostic = .{ | |
| 2131 | .fmt = "tentative definition has type {qt} that is never completed", | |
| 2132 | .kind = .@"error", | |
| 2133 | }; | |
| 2134 | ||
| 2135 | pub const forward_declaration_here: Diagnostic = .{ | |
| 2136 | .fmt = "forward declaration of {qt}", | |
| 2137 | .kind = .note, | |
| 2138 | }; | |
| 2139 | ||
| 2140 | pub const gnu_union_cast: Diagnostic = .{ | |
| 2141 | .fmt = "cast to union type is a GNU extension", | |
| 2142 | .opt = .@"gnu-union-cast", | |
| 2143 | .kind = .off, | |
| 2144 | .extension = true, | |
| 2145 | }; | |
| 2146 | ||
| 2147 | pub const invalid_union_cast: Diagnostic = .{ | |
| 2148 | .fmt = "cast to union type from type {qt} not present in union", | |
| 2149 | .kind = .@"error", | |
| 2150 | }; | |
| 2151 | ||
| 2152 | pub const cast_to_incomplete_type: Diagnostic = .{ | |
| 2153 | .fmt = "cast to incomplete type {qt}", | |
| 2154 | .kind = .@"error", | |
| 2155 | }; | |
| 2156 | ||
| 2157 | pub const gnu_asm_disabled: Diagnostic = .{ | |
| 2158 | .fmt = "GNU-style inline assembly is disabled", | |
| 2159 | .kind = .@"error", | |
| 2160 | }; | |
| 2161 | ||
| 2162 | pub const extension_token_used: Diagnostic = .{ | |
| 2163 | .fmt = "extension used", | |
| 2164 | .kind = .off, | |
| 2165 | .opt = .@"language-extension-token", | |
| 2166 | .extension = true, | |
| 2167 | }; | |
| 2168 | ||
| 2169 | pub const complex_component_init: Diagnostic = .{ | |
| 2170 | .fmt = "complex initialization specifying real and imaginary components is an extension", | |
| 2171 | .opt = .@"complex-component-init", | |
| 2172 | .kind = .off, | |
| 2173 | .extension = true, | |
| 2174 | }; | |
| 2175 | ||
| 2176 | pub const complex_prefix_postfix_op: Diagnostic = .{ | |
| 2177 | .fmt = "ISO C does not support '++'/'--' on complex type {qt}", | |
| 2178 | .kind = .off, | |
| 2179 | .extension = true, | |
| 2180 | }; | |
| 2181 | ||
| 2182 | pub const not_floating_type: Diagnostic = .{ | |
| 2183 | .fmt = "argument type {qt} is not a real floating point type", | |
| 2184 | .kind = .@"error", | |
| 2185 | }; | |
| 2186 | ||
| 2187 | pub const argument_types_differ: Diagnostic = .{ | |
| 2188 | .fmt = "arguments are of different types ({qt} vs {qt})", | |
| 2189 | .kind = .@"error", | |
| 2190 | }; | |
| 2191 | ||
| 2192 | pub const attribute_requires_string: Diagnostic = .{ | |
| 2193 | .fmt = "attribute '{s}' requires an ordinary string", | |
| 2194 | .kind = .@"error", | |
| 2195 | }; | |
| 2196 | ||
| 2197 | pub const empty_char_literal_error: Diagnostic = .{ | |
| 2198 | .fmt = "empty character constant", | |
| 2199 | .kind = .@"error", | |
| 2200 | }; | |
| 2201 | ||
| 2202 | pub const unterminated_char_literal_error: Diagnostic = .{ | |
| 2203 | .fmt = "missing terminating ' character", | |
| 2204 | .kind = .@"error", | |
| 2205 | }; | |
| 2206 | ||
| 2207 | // pub const def_no_proto_deprecated: Diagnostic = .{ | |
| 2208 | // .fmt = "a function definition without a prototype is deprecated in all versions of C and is not supported in C23", | |
| 2209 | // .kind = .warning, | |
| 2210 | // .opt = .@"deprecated-non-prototype", | |
| 2211 | // }; | |
| 2212 | ||
| 2213 | pub const passing_args_to_kr: Diagnostic = .{ | |
| 2214 | .fmt = "passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23", | |
| 2215 | .kind = .warning, | |
| 2216 | .opt = .@"deprecated-non-prototype", | |
| 2217 | }; | |
| 2218 | ||
| 2219 | pub const unknown_type_name: Diagnostic = .{ | |
| 2220 | .fmt = "unknown type name '{s}'", | |
| 2221 | .kind = .@"error", | |
| 2222 | }; | |
| 2223 | ||
| 2224 | pub const label_compound_end: Diagnostic = .{ | |
| 2225 | .fmt = "label at end of compound statement is a C23 extension", | |
| 2226 | .opt = .@"c23-extensions", | |
| 2227 | .kind = .warning, | |
| 2228 | .suppress_version = .c23, | |
| 2229 | .extension = true, | |
| 2230 | }; | |
| 2231 | ||
| 2232 | pub const u8_char_lit: Diagnostic = .{ | |
| 2233 | .fmt = "UTF-8 character literal is a C23 extension", | |
| 2234 | .opt = .@"c23-extensions", | |
| 2235 | .kind = .warning, | |
| 2236 | .suppress_version = .c23, | |
| 2237 | .extension = true, | |
| 2238 | }; | |
| 2239 | ||
| 2240 | pub const invalid_compound_literal_storage_class: Diagnostic = .{ | |
| 2241 | .fmt = "compound literal cannot have {s} storage class", | |
| 2242 | .kind = .@"error", | |
| 2243 | }; | |
| 2244 | ||
| 2245 | pub const identifier_not_normalized: Diagnostic = .{ | |
| 2246 | .fmt = "'{normalized}' is not in NFC", | |
| 2247 | .kind = .warning, | |
| 2248 | .opt = .normalized, | |
| 2249 | }; | |
| 2250 | ||
| 2251 | pub const c23_auto_single_declarator: Diagnostic = .{ | |
| 2252 | .fmt = "'auto' can only be used with a single declarator", | |
| 2253 | .kind = .@"error", | |
| 2254 | }; | |
| 2255 | ||
| 2256 | pub const c23_auto_requires_initializer: Diagnostic = .{ | |
| 2257 | .fmt = "'auto' requires an initializer", | |
| 2258 | .kind = .@"error", | |
| 2259 | }; | |
| 2260 | ||
| 2261 | pub const c23_auto_not_allowed: Diagnostic = .{ | |
| 2262 | .fmt = "'auto' not allowed in {s}", | |
| 2263 | .kind = .@"error", | |
| 2264 | }; | |
| 2265 | ||
| 2266 | pub const c23_auto_with_init_list: Diagnostic = .{ | |
| 2267 | .fmt = "cannot use 'auto' with array", | |
| 2268 | .kind = .@"error", | |
| 2269 | }; | |
| 2270 | ||
| 2271 | pub const c23_auto_array: Diagnostic = .{ | |
| 2272 | .fmt = "'{s}' declared as array of 'auto'", | |
| 2273 | .kind = .@"error", | |
| 2274 | }; | |
| 2275 | ||
| 2276 | pub const negative_shift_count: Diagnostic = .{ | |
| 2277 | .fmt = "shift count is negative", | |
| 2278 | .opt = .@"shift-count-negative", | |
| 2279 | .kind = .warning, | |
| 2280 | }; | |
| 2281 | ||
| 2282 | pub const too_big_shift_count: Diagnostic = .{ | |
| 2283 | .fmt = "shift count >= width of type", | |
| 2284 | .opt = .@"shift-count-overflow", | |
| 2285 | .kind = .warning, | |
| 2286 | }; | |
| 2287 | ||
| 2288 | pub const complex_conj: Diagnostic = .{ | |
| 2289 | .fmt = "ISO C does not support '~' for complex conjugation of {qt}", | |
| 2290 | .kind = .off, | |
| 2291 | .extension = true, | |
| 2292 | }; | |
| 2293 | ||
| 2294 | pub const overflow_builtin_requires_int: Diagnostic = .{ | |
| 2295 | .fmt = "operand argument to overflow builtin must be an integer ({qt} invalid)", | |
| 2296 | .kind = .@"error", | |
| 2297 | }; | |
| 2298 | ||
| 2299 | pub const overflow_result_requires_ptr: Diagnostic = .{ | |
| 2300 | .fmt = "result argument to overflow builtin must be a pointer to a non-const integer ({qt} invalid)", | |
| 2301 | .kind = .@"error", | |
| 2302 | }; | |
| 2303 | ||
| 2304 | pub const attribute_todo: Diagnostic = .{ | |
| 2305 | .fmt = "TODO: implement '{s}' attribute for {s}", | |
| 2306 | .kind = .warning, | |
| 2307 | .opt = .@"attribute-todo", | |
| 2308 | }; | |
| 2309 | ||
| 2310 | pub const invalid_type_underlying_enum: Diagnostic = .{ | |
| 2311 | .fmt = "non-integral type {qt} is an invalid underlying type", | |
| 2312 | .kind = .@"error", | |
| 2313 | }; | |
| 2314 | ||
| 2315 | pub const auto_type_self_initialized: Diagnostic = .{ | |
| 2316 | .fmt = "variable '{s}' declared with deduced type '__auto_type' cannot appear in its own initializer", | |
| 2317 | .kind = .@"error", | |
| 2318 | }; | |
| 2319 | ||
| 2320 | // pub const non_constant_initializer: Diagnostic = .{ | |
| 2321 | // .fmt = "initializer element is not a compile-time constant", | |
| 2322 | // .kind = .@"error", | |
| 2323 | // }; | |
| 2324 | ||
| 2325 | pub const constexpr_requires_const: Diagnostic = .{ | |
| 2326 | .fmt = "constexpr variable must be initialized by a constant expression", | |
| 2327 | .kind = .@"error", | |
| 2328 | }; | |
| 2329 | ||
| 2330 | pub const subtract_pointers_zero_elem_size: Diagnostic = .{ | |
| 2331 | .fmt = "subtraction of pointers to type {qt} of zero size has undefined behavior", | |
| 2332 | .kind = .warning, | |
| 2333 | .opt = .@"pointer-arith", | |
| 2334 | }; | |
| 2335 | ||
| 2336 | pub const packed_member_address: Diagnostic = .{ | |
| 2337 | .fmt = "taking address of packed member '{s}' of class or structure '{s}' may result in an unaligned pointer value", | |
| 2338 | .kind = .warning, | |
| 2339 | .opt = .@"address-of-packed-member", | |
| 2340 | }; | |
| 2341 | ||
| 2342 | pub const attribute_param_out_of_bounds: Diagnostic = .{ | |
| 2343 | .fmt = "'{s}' attribute parameter {d} is out of bounds", | |
| 2344 | .kind = .@"error", | |
| 2345 | }; | |
| 2346 | ||
| 2347 | pub const alloc_align_requires_ptr_return: Diagnostic = .{ | |
| 2348 | .fmt = "'alloc_align' attribute only applies to return values that are pointers", | |
| 2349 | .opt = .@"ignored-attributes", | |
| 2350 | .kind = .warning, | |
| 2351 | }; | |
| 2352 | ||
| 2353 | pub const alloc_align_required_int_param: Diagnostic = .{ | |
| 2354 | .fmt = "'alloc_align' attribute argument may only refer to a function parameter of integer type", | |
| 2355 | .kind = .@"error", | |
| 2356 | }; | |
| 2357 | ||
| 2358 | pub const gnu_missing_eq_designator: Diagnostic = .{ | |
| 2359 | .fmt = "use of GNU 'missing =' extension in designator", | |
| 2360 | .kind = .warning, | |
| 2361 | .opt = .@"gnu-designator", | |
| 2362 | .extension = true, | |
| 2363 | }; | |
| 2364 | ||
| 2365 | pub const empty_if_body: Diagnostic = .{ | |
| 2366 | .fmt = "if statement has empty body", | |
| 2367 | .kind = .warning, | |
| 2368 | .opt = .@"empty-body", | |
| 2369 | }; | |
| 2370 | ||
| 2371 | pub const empty_if_body_note: Diagnostic = .{ | |
| 2372 | .fmt = "put the semicolon on a separate line to silence this warning", | |
| 2373 | .kind = .note, | |
| 2374 | .opt = .@"empty-body", | |
| 2375 | }; | |
| 2376 | ||
| 2377 | pub const nullability_extension: Diagnostic = .{ | |
| 2378 | .fmt = "type nullability specifier '{s}' is a Clang extension", | |
| 2379 | .kind = .off, | |
| 2380 | .opt = .@"nullability-extension", | |
| 2381 | .extension = true, | |
| 2382 | }; | |
| 2383 | ||
| 2384 | pub const duplicate_nullability: Diagnostic = .{ | |
| 2385 | .fmt = "duplicate nullability specifier '{s}'", | |
| 2386 | .kind = .warning, | |
| 2387 | .opt = .nullability, | |
| 2388 | }; | |
| 2389 | ||
| 2390 | pub const conflicting_nullability: Diagnostic = .{ | |
| 2391 | .fmt = "nullaibility specifier '{tok_id}' conflicts with existing specifier '{tok_id}'", | |
| 2392 | .kind = .@"error", | |
| 2393 | }; | |
| 2394 | ||
| 2395 | pub const invalid_nullability: Diagnostic = .{ | |
| 2396 | .fmt = "nullability specifier cannot be applied to non-pointer type {qt}", | |
| 2397 | .kind = .@"error", | |
| 2398 | }; | |
| 2399 | ||
| 2400 | pub const array_not_assignable: Diagnostic = .{ | |
| 2401 | .fmt = "array type {qt} is not assignable", | |
| 2402 | .kind = .@"error", | |
| 2403 | }; | |
| 2404 | ||
| 2405 | pub const non_object_not_assignable: Diagnostic = .{ | |
| 2406 | .fmt = "non-object type {qt} is not assignable", | |
| 2407 | .kind = .@"error", | |
| 2408 | }; | |
| 2409 | ||
| 2410 | pub const const_var_assignment: Diagnostic = .{ | |
| 2411 | .fmt = "cannot assign to variable '{s}' with const-qualified type {qt}", | |
| 2412 | .kind = .@"error", | |
| 2413 | }; | |
| 2414 | ||
| 2415 | pub const declared_const_here: Diagnostic = .{ | |
| 2416 | .fmt = "variable '{s}' declared const here", | |
| 2417 | .kind = .note, | |
| 2418 | }; | |
| 2419 | ||
| 2420 | pub const nonnull_not_applicable: Diagnostic = .{ | |
| 2421 | .fmt = "'nonnull' attribute only applies to functions, methods, and parameters", | |
| 2422 | .kind = .warning, | |
| 2423 | .opt = .@"ignored-attributes", | |
| 2424 | }; |
lib/compiler/aro/aro/Pragma.zig+130-3| ... | ... | @@ -1,7 +1,9 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | ||
| 2 | 3 | const Compilation = @import("Compilation.zig"); |
| 3 | const Preprocessor = @import("Preprocessor.zig"); | |
| 4 | const Diagnostics = @import("Diagnostics.zig"); | |
| 4 | 5 | const Parser = @import("Parser.zig"); |
| 6 | const Preprocessor = @import("Preprocessor.zig"); | |
| 5 | 7 | const TokenIndex = @import("Tree.zig").TokenIndex; |
| 6 | 8 | |
| 7 | 9 | pub const Error = Compilation.Error || error{ UnknownPragma, StopPreprocessing }; |
| ... | ... | @@ -58,7 +60,7 @@ pub fn pasteTokens(pp: *Preprocessor, start_idx: TokenIndex) ![]const u8 { |
| 58 | 60 | .string_literal => { |
| 59 | 61 | if (rparen_count != 0) return error.ExpectedStringLiteral; |
| 60 | 62 | const str = pp.expandedSlice(tok); |
| 61 | try pp.char_buf.appendSlice(str[1 .. str.len - 1]); | |
| 63 | try pp.char_buf.appendSlice(pp.comp.gpa, str[1 .. str.len - 1]); | |
| 62 | 64 | }, |
| 63 | 65 | else => return error.ExpectedStringLiteral, |
| 64 | 66 | } |
| ... | ... | @@ -69,7 +71,7 @@ pub fn pasteTokens(pp: *Preprocessor, start_idx: TokenIndex) ![]const u8 { |
| 69 | 71 | |
| 70 | 72 | pub fn shouldPreserveTokens(self: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) bool { |
| 71 | 73 | if (self.preserveTokens) |func| return func(self, pp, start_idx); |
| 72 | return false; | |
| 74 | return true; | |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | 77 | 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 |
| 81 | 83 | defer std.debug.assert(tok_index == p.tok_i); |
| 82 | 84 | if (self.parserHandler) |func| return func(self, p, start_idx); |
| 83 | 85 | } |
| 86 | ||
| 87 | pub const Diagnostic = struct { | |
| 88 | fmt: []const u8, | |
| 89 | kind: Diagnostics.Message.Kind, | |
| 90 | opt: ?Diagnostics.Option = null, | |
| 91 | extension: bool = false, | |
| 92 | ||
| 93 | pub const pragma_warning_message: Diagnostic = .{ | |
| 94 | .fmt = "{s}", | |
| 95 | .kind = .warning, | |
| 96 | .opt = .@"#pragma-messages", | |
| 97 | }; | |
| 98 | ||
| 99 | pub const pragma_error_message: Diagnostic = .{ | |
| 100 | .fmt = "{s}", | |
| 101 | .kind = .@"error", | |
| 102 | }; | |
| 103 | ||
| 104 | pub const pragma_message: Diagnostic = .{ | |
| 105 | .fmt = "#pragma message: {s}", | |
| 106 | .kind = .note, | |
| 107 | }; | |
| 108 | ||
| 109 | pub const pragma_requires_string_literal: Diagnostic = .{ | |
| 110 | .fmt = "pragma {s} requires string literal", | |
| 111 | .kind = .@"error", | |
| 112 | }; | |
| 113 | ||
| 114 | pub const poisoned_identifier: Diagnostic = .{ | |
| 115 | .fmt = "attempt to use a poisoned identifier", | |
| 116 | .kind = .@"error", | |
| 117 | }; | |
| 118 | ||
| 119 | pub const pragma_poison_identifier: Diagnostic = .{ | |
| 120 | .fmt = "can only poison identifier tokens", | |
| 121 | .kind = .@"error", | |
| 122 | }; | |
| 123 | ||
| 124 | pub const pragma_poison_macro: Diagnostic = .{ | |
| 125 | .fmt = "poisoning existing macro", | |
| 126 | .kind = .warning, | |
| 127 | }; | |
| 128 | ||
| 129 | pub const unknown_gcc_pragma: Diagnostic = .{ | |
| 130 | .fmt = "pragma GCC expected 'error', 'warning', 'diagnostic', 'poison'", | |
| 131 | .kind = .off, | |
| 132 | .opt = .@"unknown-pragmas", | |
| 133 | }; | |
| 134 | ||
| 135 | pub const unknown_gcc_pragma_directive: Diagnostic = .{ | |
| 136 | .fmt = "pragma GCC diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'", | |
| 137 | .kind = .warning, | |
| 138 | .opt = .@"unknown-pragmas", | |
| 139 | .extension = true, | |
| 140 | }; | |
| 141 | ||
| 142 | pub const malformed_warning_check: Diagnostic = .{ | |
| 143 | .fmt = "{s} expected option name (e.g. \"-Wundef\")", | |
| 144 | .opt = .@"malformed-warning-check", | |
| 145 | .kind = .warning, | |
| 146 | .extension = true, | |
| 147 | }; | |
| 148 | ||
| 149 | pub const pragma_pack_lparen: Diagnostic = .{ | |
| 150 | .fmt = "missing '(' after '#pragma pack' - ignoring", | |
| 151 | .kind = .warning, | |
| 152 | .opt = .@"ignored-pragmas", | |
| 153 | }; | |
| 154 | ||
| 155 | pub const pragma_pack_rparen: Diagnostic = .{ | |
| 156 | .fmt = "missing ')' after '#pragma pack' - ignoring", | |
| 157 | .kind = .warning, | |
| 158 | .opt = .@"ignored-pragmas", | |
| 159 | }; | |
| 160 | ||
| 161 | pub const pragma_pack_unknown_action: Diagnostic = .{ | |
| 162 | .fmt = "unknown action for '#pragma pack' - ignoring", | |
| 163 | .kind = .warning, | |
| 164 | .opt = .@"ignored-pragmas", | |
| 165 | }; | |
| 166 | ||
| 167 | pub const pragma_pack_show: Diagnostic = .{ | |
| 168 | .fmt = "value of #pragma pack(show) == {d}", | |
| 169 | .kind = .warning, | |
| 170 | }; | |
| 171 | ||
| 172 | pub const pragma_pack_int_ident: Diagnostic = .{ | |
| 173 | .fmt = "expected integer or identifier in '#pragma pack' - ignored", | |
| 174 | .kind = .warning, | |
| 175 | .opt = .@"ignored-pragmas", | |
| 176 | }; | |
| 177 | ||
| 178 | pub const pragma_pack_int: Diagnostic = .{ | |
| 179 | .fmt = "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'", | |
| 180 | .opt = .@"ignored-pragmas", | |
| 181 | .kind = .warning, | |
| 182 | }; | |
| 183 | ||
| 184 | pub const pragma_pack_undefined_pop: Diagnostic = .{ | |
| 185 | .fmt = "specifying both a name and alignment to 'pop' is undefined", | |
| 186 | .kind = .warning, | |
| 187 | }; | |
| 188 | ||
| 189 | pub const pragma_pack_empty_stack: Diagnostic = .{ | |
| 190 | .fmt = "#pragma pack(pop, ...) failed: stack empty", | |
| 191 | .opt = .@"ignored-pragmas", | |
| 192 | .kind = .warning, | |
| 193 | }; | |
| 194 | }; | |
| 195 | ||
| 196 | pub fn err(pp: *Preprocessor, tok_i: TokenIndex, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { | |
| 197 | var sf = std.heap.stackFallback(1024, pp.comp.gpa); | |
| 198 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 199 | defer allocating.deinit(); | |
| 200 | ||
| 201 | Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; | |
| 202 | ||
| 203 | try pp.diagnostics.addWithLocation(pp.comp, .{ | |
| 204 | .kind = diagnostic.kind, | |
| 205 | .opt = diagnostic.opt, | |
| 206 | .text = allocating.written(), | |
| 207 | .location = pp.tokens.items(.loc)[tok_i].expand(pp.comp), | |
| 208 | .extension = diagnostic.extension, | |
| 209 | }, pp.expansionSlice(tok_i), true); | |
| 210 | } |
lib/compiler/aro/aro/Preprocessor.zig+939-774| ... | ... | @@ -2,23 +2,26 @@ const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | 3 | const Allocator = mem.Allocator; |
| 4 | 4 | const assert = std.debug.assert; |
| 5 | ||
| 6 | const Attribute = @import("Attribute.zig"); | |
| 5 | 7 | const Compilation = @import("Compilation.zig"); |
| 6 | 8 | const Error = Compilation.Error; |
| 9 | const Diagnostics = @import("Diagnostics.zig"); | |
| 10 | const DepFile = @import("DepFile.zig"); | |
| 11 | const features = @import("features.zig"); | |
| 12 | const Hideset = @import("Hideset.zig"); | |
| 13 | const Parser = @import("Parser.zig"); | |
| 7 | 14 | const Source = @import("Source.zig"); |
| 15 | const text_literal = @import("text_literal.zig"); | |
| 8 | 16 | const Tokenizer = @import("Tokenizer.zig"); |
| 9 | 17 | const RawToken = Tokenizer.Token; |
| 10 | const Parser = @import("Parser.zig"); | |
| 11 | const Diagnostics = @import("Diagnostics.zig"); | |
| 18 | const SourceEpoch = Compilation.Environment.SourceEpoch; | |
| 12 | 19 | const Tree = @import("Tree.zig"); |
| 13 | 20 | const Token = Tree.Token; |
| 14 | 21 | const TokenWithExpansionLocs = Tree.TokenWithExpansionLocs; |
| 15 | const Attribute = @import("Attribute.zig"); | |
| 16 | const features = @import("features.zig"); | |
| 17 | const Hideset = @import("Hideset.zig"); | |
| 18 | const Writer = std.Io.Writer; | |
| 19 | 22 | |
| 20 | const DefineMap = std.StringHashMapUnmanaged(Macro); | |
| 21 | const RawTokenList = std.array_list.Managed(RawToken); | |
| 23 | const DefineMap = std.StringArrayHashMapUnmanaged(Macro); | |
| 24 | const RawTokenList = std.ArrayList(RawToken); | |
| 22 | 25 | const max_include_depth = 200; |
| 23 | 26 | |
| 24 | 27 | /// Errors that can be returned when expanding a macro. |
| ... | ... | @@ -26,7 +29,41 @@ const max_include_depth = 200; |
| 26 | 29 | /// it is handled there and doesn't escape that function |
| 27 | 30 | const MacroError = Error || error{StopPreprocessing}; |
| 28 | 31 | |
| 29 | const Macro = struct { | |
| 32 | const IfContext = struct { | |
| 33 | const Backing = u2; | |
| 34 | const Nesting = enum(Backing) { | |
| 35 | until_else, | |
| 36 | until_endif, | |
| 37 | until_endif_seen_else, | |
| 38 | }; | |
| 39 | ||
| 40 | const buf_size_bits = @bitSizeOf(Backing) * 256; | |
| 41 | kind: [buf_size_bits / std.mem.byte_size_in_bits]u8, | |
| 42 | level: u8, | |
| 43 | ||
| 44 | fn get(self: *const IfContext) Nesting { | |
| 45 | return @enumFromInt(std.mem.readPackedIntNative(Backing, &self.kind, @as(usize, self.level) * 2)); | |
| 46 | } | |
| 47 | ||
| 48 | fn set(self: *IfContext, context: Nesting) void { | |
| 49 | std.mem.writePackedIntNative(Backing, &self.kind, @as(usize, self.level) * 2, @intFromEnum(context)); | |
| 50 | } | |
| 51 | ||
| 52 | fn increment(self: *IfContext) bool { | |
| 53 | self.level, const overflowed = @addWithOverflow(self.level, 1); | |
| 54 | return overflowed != 0; | |
| 55 | } | |
| 56 | ||
| 57 | fn decrement(self: *IfContext) void { | |
| 58 | self.level -= 1; | |
| 59 | } | |
| 60 | ||
| 61 | /// Initialize `kind` to an invalid value since it is an error to read the kind before setting it. | |
| 62 | /// Doing so will trigger safety-checked undefined behavior in `IfContext.get` | |
| 63 | const default: IfContext = .{ .kind = @splat(0xFF), .level = 0 }; | |
| 64 | }; | |
| 65 | ||
| 66 | pub const Macro = struct { | |
| 30 | 67 | /// Parameters of the function type macro |
| 31 | 68 | params: []const []const u8, |
| 32 | 69 | |
| ... | ... | @@ -77,15 +114,16 @@ const TokenState = struct { |
| 77 | 114 | }; |
| 78 | 115 | |
| 79 | 116 | comp: *Compilation, |
| 80 | gpa: mem.Allocator, | |
| 117 | diagnostics: *Diagnostics, | |
| 118 | ||
| 81 | 119 | arena: std.heap.ArenaAllocator, |
| 82 | defines: DefineMap = .{}, | |
| 120 | defines: DefineMap = .empty, | |
| 83 | 121 | /// Do not directly mutate this; use addToken / addTokenAssumeCapacity / ensureTotalTokenCapacity / ensureUnusedTokenCapacity |
| 84 | tokens: Token.List = .{}, | |
| 122 | tokens: Token.List = .empty, | |
| 85 | 123 | /// Do not directly mutate this; must be kept in sync with `tokens` |
| 86 | expansion_entries: std.MultiArrayList(ExpansionEntry) = .{}, | |
| 87 | token_buf: RawTokenList, | |
| 88 | char_buf: std.array_list.Managed(u8), | |
| 124 | expansion_entries: std.MultiArrayList(ExpansionEntry) = .empty, | |
| 125 | token_buf: RawTokenList = .empty, | |
| 126 | char_buf: std.ArrayList(u8) = .empty, | |
| 89 | 127 | /// Counter that is incremented each time preprocess() is called |
| 90 | 128 | /// Can be used to distinguish multiple preprocessings of the same file |
| 91 | 129 | preprocess_count: u32 = 0, |
| ... | ... | @@ -94,7 +132,7 @@ add_expansion_nl: u32 = 0, |
| 94 | 132 | include_depth: u8 = 0, |
| 95 | 133 | counter: u32 = 0, |
| 96 | 134 | expansion_source_loc: Source.Location = undefined, |
| 97 | poisoned_identifiers: std.StringHashMap(void), | |
| 135 | poisoned_identifiers: std.StringHashMapUnmanaged(void) = .empty, | |
| 98 | 136 | /// Map from Source.Id to macro name in the `#ifndef` condition which guards the source, if any |
| 99 | 137 | include_guards: std.AutoHashMapUnmanaged(Source.Id, []const u8) = .empty, |
| 100 | 138 | |
| ... | ... | @@ -104,7 +142,7 @@ include_guards: std.AutoHashMapUnmanaged(Source.Id, []const u8) = .empty, |
| 104 | 142 | store_macro_tokens: bool = false, |
| 105 | 143 | |
| 106 | 144 | /// Memory is retained to avoid allocation on every single token. |
| 107 | top_expansion_buf: ExpandBuf, | |
| 145 | top_expansion_buf: ExpandBuf = .empty, | |
| 108 | 146 | |
| 109 | 147 | /// Dump current state to stderr. |
| 110 | 148 | verbose: bool = false, |
| ... | ... | @@ -115,6 +153,13 @@ linemarkers: Linemarkers = .none, |
| 115 | 153 | |
| 116 | 154 | hideset: Hideset, |
| 117 | 155 | |
| 156 | /// Epoch used for __DATE__, __TIME__, and possibly __TIMESTAMP__ | |
| 157 | source_epoch: SourceEpoch, | |
| 158 | m_times: std.AutoHashMapUnmanaged(Source.Id, u64) = .empty, | |
| 159 | ||
| 160 | /// The dependency file tracking all includes and embeds. | |
| 161 | dep_file: ?*DepFile = null, | |
| 162 | ||
| 118 | 163 | pub const parse = Parser.parse; |
| 119 | 164 | |
| 120 | 165 | pub const Linemarkers = enum { |
| ... | ... | @@ -126,16 +171,13 @@ pub const Linemarkers = enum { |
| 126 | 171 | numeric_directives, |
| 127 | 172 | }; |
| 128 | 173 | |
| 129 | pub fn init(comp: *Compilation) Preprocessor { | |
| 130 | const pp = Preprocessor{ | |
| 174 | pub fn init(comp: *Compilation, source_epoch: SourceEpoch) Preprocessor { | |
| 175 | const pp: Preprocessor = .{ | |
| 131 | 176 | .comp = comp, |
| 132 | .gpa = comp.gpa, | |
| 133 | .arena = std.heap.ArenaAllocator.init(comp.gpa), | |
| 134 | .token_buf = RawTokenList.init(comp.gpa), | |
| 135 | .char_buf = std.array_list.Managed(u8).init(comp.gpa), | |
| 136 | .poisoned_identifiers = std.StringHashMap(void).init(comp.gpa), | |
| 137 | .top_expansion_buf = ExpandBuf.init(comp.gpa), | |
| 177 | .diagnostics = comp.diagnostics, | |
| 178 | .arena = .init(comp.gpa), | |
| 138 | 179 | .hideset = .{ .comp = comp }, |
| 180 | .source_epoch = source_epoch, | |
| 139 | 181 | }; |
| 140 | 182 | comp.pragmaEvent(.before_preprocess); |
| 141 | 183 | return pp; |
| ... | ... | @@ -143,84 +185,28 @@ pub fn init(comp: *Compilation) Preprocessor { |
| 143 | 185 | |
| 144 | 186 | /// Initialize Preprocessor with builtin macros. |
| 145 | 187 | pub fn initDefault(comp: *Compilation) !Preprocessor { |
| 146 | var pp = init(comp); | |
| 188 | const source_epoch: SourceEpoch = comp.environment.sourceEpoch() catch |er| switch (er) { | |
| 189 | error.InvalidEpoch => blk: { | |
| 190 | const diagnostic: Diagnostic = .invalid_source_epoch; | |
| 191 | try comp.diagnostics.add(.{ .text = diagnostic.fmt, .kind = diagnostic.kind, .opt = diagnostic.opt, .location = null }); | |
| 192 | break :blk .default; | |
| 193 | }, | |
| 194 | }; | |
| 195 | ||
| 196 | var pp = init(comp, source_epoch); | |
| 147 | 197 | errdefer pp.deinit(); |
| 148 | 198 | try pp.addBuiltinMacros(); |
| 149 | 199 | return pp; |
| 150 | 200 | } |
| 151 | 201 | |
| 152 | const builtin_macros = struct { | |
| 153 | const args = [1][]const u8{"X"}; | |
| 154 | ||
| 155 | const has_attribute = [1]RawToken{.{ | |
| 156 | .id = .macro_param_has_attribute, | |
| 157 | .source = .generated, | |
| 158 | }}; | |
| 159 | const has_c_attribute = [1]RawToken{.{ | |
| 160 | .id = .macro_param_has_c_attribute, | |
| 161 | .source = .generated, | |
| 162 | }}; | |
| 163 | const has_declspec_attribute = [1]RawToken{.{ | |
| 164 | .id = .macro_param_has_declspec_attribute, | |
| 165 | .source = .generated, | |
| 166 | }}; | |
| 167 | const has_warning = [1]RawToken{.{ | |
| 168 | .id = .macro_param_has_warning, | |
| 169 | .source = .generated, | |
| 170 | }}; | |
| 171 | const has_feature = [1]RawToken{.{ | |
| 172 | .id = .macro_param_has_feature, | |
| 173 | .source = .generated, | |
| 174 | }}; | |
| 175 | const has_extension = [1]RawToken{.{ | |
| 176 | .id = .macro_param_has_extension, | |
| 177 | .source = .generated, | |
| 178 | }}; | |
| 179 | const has_builtin = [1]RawToken{.{ | |
| 180 | .id = .macro_param_has_builtin, | |
| 181 | .source = .generated, | |
| 182 | }}; | |
| 183 | const has_include = [1]RawToken{.{ | |
| 184 | .id = .macro_param_has_include, | |
| 185 | .source = .generated, | |
| 186 | }}; | |
| 187 | const has_include_next = [1]RawToken{.{ | |
| 188 | .id = .macro_param_has_include_next, | |
| 189 | .source = .generated, | |
| 190 | }}; | |
| 191 | const has_embed = [1]RawToken{.{ | |
| 192 | .id = .macro_param_has_embed, | |
| 193 | .source = .generated, | |
| 194 | }}; | |
| 195 | ||
| 196 | const is_identifier = [1]RawToken{.{ | |
| 197 | .id = .macro_param_is_identifier, | |
| 198 | .source = .generated, | |
| 199 | }}; | |
| 200 | ||
| 201 | const pragma_operator = [1]RawToken{.{ | |
| 202 | .id = .macro_param_pragma_operator, | |
| 203 | .source = .generated, | |
| 204 | }}; | |
| 205 | ||
| 206 | const file = [1]RawToken{.{ | |
| 207 | .id = .macro_file, | |
| 208 | .source = .generated, | |
| 209 | }}; | |
| 210 | const line = [1]RawToken{.{ | |
| 211 | .id = .macro_line, | |
| 212 | .source = .generated, | |
| 213 | }}; | |
| 214 | const counter = [1]RawToken{.{ | |
| 215 | .id = .macro_counter, | |
| 216 | .source = .generated, | |
| 217 | }}; | |
| 218 | }; | |
| 219 | ||
| 220 | fn addBuiltinMacro(pp: *Preprocessor, name: []const u8, is_func: bool, tokens: []const RawToken) !void { | |
| 221 | try pp.defines.putNoClobber(pp.gpa, name, .{ | |
| 222 | .params = &builtin_macros.args, | |
| 223 | .tokens = tokens, | |
| 202 | // `param_tok_id` is comptime so that the generated `tokens` list is unique for every macro. | |
| 203 | fn addBuiltinMacro(pp: *Preprocessor, name: []const u8, is_func: bool, comptime param_tok_id: Token.Id) !void { | |
| 204 | try pp.defines.putNoClobber(pp.comp.gpa, name, .{ | |
| 205 | .params = &[1][]const u8{"X"}, | |
| 206 | .tokens = &[1]RawToken{.{ | |
| 207 | .id = param_tok_id, | |
| 208 | .source = .generated, | |
| 209 | }}, | |
| 224 | 210 | .var_args = false, |
| 225 | 211 | .is_func = is_func, |
| 226 | 212 | .loc = .{ .id = .generated }, |
| ... | ... | @@ -229,46 +215,66 @@ fn addBuiltinMacro(pp: *Preprocessor, name: []const u8, is_func: bool, tokens: [ |
| 229 | 215 | } |
| 230 | 216 | |
| 231 | 217 | pub fn addBuiltinMacros(pp: *Preprocessor) !void { |
| 232 | try pp.addBuiltinMacro("__has_attribute", true, &builtin_macros.has_attribute); | |
| 233 | try pp.addBuiltinMacro("__has_c_attribute", true, &builtin_macros.has_c_attribute); | |
| 234 | try pp.addBuiltinMacro("__has_declspec_attribute", true, &builtin_macros.has_declspec_attribute); | |
| 235 | try pp.addBuiltinMacro("__has_warning", true, &builtin_macros.has_warning); | |
| 236 | try pp.addBuiltinMacro("__has_feature", true, &builtin_macros.has_feature); | |
| 237 | try pp.addBuiltinMacro("__has_extension", true, &builtin_macros.has_extension); | |
| 238 | try pp.addBuiltinMacro("__has_builtin", true, &builtin_macros.has_builtin); | |
| 239 | try pp.addBuiltinMacro("__has_include", true, &builtin_macros.has_include); | |
| 240 | try pp.addBuiltinMacro("__has_include_next", true, &builtin_macros.has_include_next); | |
| 241 | try pp.addBuiltinMacro("__has_embed", true, &builtin_macros.has_embed); | |
| 242 | try pp.addBuiltinMacro("__is_identifier", true, &builtin_macros.is_identifier); | |
| 243 | try pp.addBuiltinMacro("_Pragma", true, &builtin_macros.pragma_operator); | |
| 244 | ||
| 245 | try pp.addBuiltinMacro("__FILE__", false, &builtin_macros.file); | |
| 246 | try pp.addBuiltinMacro("__LINE__", false, &builtin_macros.line); | |
| 247 | try pp.addBuiltinMacro("__COUNTER__", false, &builtin_macros.counter); | |
| 218 | try pp.addBuiltinMacro("__has_attribute", true, .macro_param_has_attribute); | |
| 219 | try pp.addBuiltinMacro("__has_c_attribute", true, .macro_param_has_c_attribute); | |
| 220 | try pp.addBuiltinMacro("__has_declspec_attribute", true, .macro_param_has_declspec_attribute); | |
| 221 | try pp.addBuiltinMacro("__has_warning", true, .macro_param_has_warning); | |
| 222 | try pp.addBuiltinMacro("__has_feature", true, .macro_param_has_feature); | |
| 223 | try pp.addBuiltinMacro("__has_extension", true, .macro_param_has_extension); | |
| 224 | try pp.addBuiltinMacro("__has_builtin", true, .macro_param_has_builtin); | |
| 225 | try pp.addBuiltinMacro("__has_include", true, .macro_param_has_include); | |
| 226 | try pp.addBuiltinMacro("__has_include_next", true, .macro_param_has_include_next); | |
| 227 | try pp.addBuiltinMacro("__has_embed", true, .macro_param_has_embed); | |
| 228 | try pp.addBuiltinMacro("__is_identifier", true, .macro_param_is_identifier); | |
| 229 | try pp.addBuiltinMacro("_Pragma", true, .macro_param_pragma_operator); | |
| 230 | ||
| 231 | if (pp.comp.langopts.ms_extensions) { | |
| 232 | try pp.addBuiltinMacro("__identifier", true, .macro_param_ms_identifier); | |
| 233 | try pp.addBuiltinMacro("__pragma", true, .macro_param_ms_pragma); | |
| 234 | } | |
| 235 | ||
| 236 | try pp.addBuiltinMacro("__FILE__", false, .macro_file); | |
| 237 | try pp.addBuiltinMacro("__LINE__", false, .macro_line); | |
| 238 | try pp.addBuiltinMacro("__COUNTER__", false, .macro_counter); | |
| 239 | try pp.addBuiltinMacro("__DATE__", false, .macro_date); | |
| 240 | try pp.addBuiltinMacro("__TIME__", false, .macro_time); | |
| 241 | try pp.addBuiltinMacro("__TIMESTAMP__", false, .macro_timestamp); | |
| 248 | 242 | } |
| 249 | 243 | |
| 250 | 244 | pub fn deinit(pp: *Preprocessor) void { |
| 251 | pp.defines.deinit(pp.gpa); | |
| 252 | pp.tokens.deinit(pp.gpa); | |
| 245 | const gpa = pp.comp.gpa; | |
| 246 | pp.defines.deinit(gpa); | |
| 247 | pp.tokens.deinit(gpa); | |
| 253 | 248 | pp.arena.deinit(); |
| 254 | pp.token_buf.deinit(); | |
| 255 | pp.char_buf.deinit(); | |
| 256 | pp.poisoned_identifiers.deinit(); | |
| 257 | pp.include_guards.deinit(pp.gpa); | |
| 258 | pp.top_expansion_buf.deinit(); | |
| 249 | pp.token_buf.deinit(gpa); | |
| 250 | pp.char_buf.deinit(gpa); | |
| 251 | pp.poisoned_identifiers.deinit(gpa); | |
| 252 | pp.include_guards.deinit(gpa); | |
| 253 | pp.top_expansion_buf.deinit(gpa); | |
| 259 | 254 | pp.hideset.deinit(); |
| 260 | for (pp.expansion_entries.items(.locs)) |locs| TokenWithExpansionLocs.free(locs, pp.gpa); | |
| 261 | pp.expansion_entries.deinit(pp.gpa); | |
| 255 | for (pp.expansion_entries.items(.locs)) |locs| TokenWithExpansionLocs.free(locs, gpa); | |
| 256 | pp.expansion_entries.deinit(gpa); | |
| 257 | pp.m_times.deinit(gpa); | |
| 258 | pp.* = undefined; | |
| 262 | 259 | } |
| 263 | 260 | |
| 264 | 261 | /// Free buffers that are not needed after preprocessing |
| 265 | 262 | fn clearBuffers(pp: *Preprocessor) void { |
| 266 | pp.token_buf.clearAndFree(); | |
| 267 | pp.char_buf.clearAndFree(); | |
| 268 | pp.top_expansion_buf.clearAndFree(); | |
| 263 | const gpa = pp.comp.gpa; | |
| 264 | pp.token_buf.clearAndFree(gpa); | |
| 265 | pp.char_buf.clearAndFree(gpa); | |
| 266 | pp.top_expansion_buf.clearAndFree(gpa); | |
| 269 | 267 | pp.hideset.clearAndFree(); |
| 270 | 268 | } |
| 271 | 269 | |
| 270 | fn mTime(pp: *Preprocessor, source_id: Source.Id) !u64 { | |
| 271 | const gop = try pp.m_times.getOrPut(pp.comp.gpa, source_id); | |
| 272 | if (!gop.found_existing) { | |
| 273 | gop.value_ptr.* = pp.comp.getSourceMTimeUncached(source_id) orelse 0; | |
| 274 | } | |
| 275 | return gop.value_ptr.*; | |
| 276 | } | |
| 277 | ||
| 272 | 278 | pub fn expansionSlice(pp: *Preprocessor, tok: Tree.TokenIndex) []Source.Location { |
| 273 | 279 | const S = struct { |
| 274 | 280 | fn orderTokenIndex(context: Tree.TokenIndex, item: Tree.TokenIndex) std.math.Order { |
| ... | ... | @@ -349,7 +355,7 @@ pub fn addIncludeResume(pp: *Preprocessor, source: Source.Id, offset: u32, line: |
| 349 | 355 | } }); |
| 350 | 356 | } |
| 351 | 357 | |
| 352 | fn invalidTokenDiagnostic(tok_id: Token.Id) Diagnostics.Tag { | |
| 358 | fn invalidTokenDiagnostic(tok_id: Token.Id) Diagnostic { | |
| 353 | 359 | return switch (tok_id) { |
| 354 | 360 | .unterminated_string_literal => .unterminated_string_literal_warning, |
| 355 | 361 | .empty_char_literal => .empty_char_literal_warning, |
| ... | ... | @@ -376,6 +382,7 @@ fn findIncludeGuard(pp: *Preprocessor, source: Source) ?[]const u8 { |
| 376 | 382 | } |
| 377 | 383 | |
| 378 | 384 | fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpansionLocs { |
| 385 | const gpa = pp.comp.gpa; | |
| 379 | 386 | var guard_name = pp.findIncludeGuard(source); |
| 380 | 387 | |
| 381 | 388 | pp.preprocess_count += 1; |
| ... | ... | @@ -389,11 +396,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 389 | 396 | const estimated_token_count = source.buf.len / 8; |
| 390 | 397 | try pp.ensureTotalTokenCapacity(pp.tokens.len + estimated_token_count); |
| 391 | 398 | |
| 392 | var if_level: u8 = 0; | |
| 393 | var if_kind: [64]u8 = .{0} ** 64; | |
| 394 | const until_else = 0; | |
| 395 | const until_endif = 1; | |
| 396 | const until_endif_seen_else = 2; | |
| 399 | var if_context: IfContext = .default; | |
| 397 | 400 | |
| 398 | 401 | var start_of_line = true; |
| 399 | 402 | while (true) { |
| ... | ... | @@ -401,6 +404,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 401 | 404 | switch (tok.id) { |
| 402 | 405 | .hash => if (!start_of_line) try pp.addToken(tokFromRaw(tok)) else { |
| 403 | 406 | const directive = tokenizer.nextNoWS(); |
| 407 | const directive_loc: Source.Location = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }; | |
| 404 | 408 | switch (directive.id) { |
| 405 | 409 | .keyword_error, .keyword_warning => { |
| 406 | 410 | // #error tokens.. |
| ... | ... | @@ -412,31 +416,29 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 412 | 416 | tok = tokenizer.next(); |
| 413 | 417 | if (tok.id == .nl or tok.id == .eof) break; |
| 414 | 418 | if (tok.id == .whitespace) tok.id = .macro_ws; |
| 415 | try pp.top_expansion_buf.append(tokFromRaw(tok)); | |
| 419 | try pp.top_expansion_buf.append(gpa, tokFromRaw(tok)); | |
| 416 | 420 | } |
| 417 | 421 | try pp.stringify(pp.top_expansion_buf.items); |
| 418 | 422 | const slice = pp.char_buf.items[char_top + 1 .. pp.char_buf.items.len - 2]; |
| 419 | const duped = try pp.comp.diagnostics.arena.allocator().dupe(u8, slice); | |
| 420 | 423 | |
| 421 | try pp.comp.addDiagnostic(.{ | |
| 422 | .tag = if (directive.id == .keyword_error) .error_directive else .warning_directive, | |
| 423 | .loc = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }, | |
| 424 | .extra = .{ .str = duped }, | |
| 425 | }, &.{}); | |
| 424 | try pp.err( | |
| 425 | directive_loc, | |
| 426 | if (directive.id == .keyword_error) .error_directive else .warning_directive, | |
| 427 | .{slice}, | |
| 428 | ); | |
| 426 | 429 | }, |
| 427 | 430 | .keyword_if => { |
| 428 | const sum, const overflowed = @addWithOverflow(if_level, 1); | |
| 429 | if (overflowed != 0) | |
| 431 | const overflowed = if_context.increment(); | |
| 432 | if (overflowed) | |
| 430 | 433 | return pp.fatal(directive, "too many #if nestings", .{}); |
| 431 | if_level = sum; | |
| 432 | 434 | |
| 433 | 435 | if (try pp.expr(&tokenizer)) { |
| 434 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); | |
| 436 | if_context.set(.until_endif); | |
| 435 | 437 | if (pp.verbose) { |
| 436 | 438 | pp.verboseLog(directive, "entering then branch of #if", .{}); |
| 437 | 439 | } |
| 438 | 440 | } else { |
| 439 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 441 | if_context.set(.until_else); | |
| 440 | 442 | try pp.skip(&tokenizer, .until_else); |
| 441 | 443 | if (pp.verbose) { |
| 442 | 444 | pp.verboseLog(directive, "entering else branch of #if", .{}); |
| ... | ... | @@ -444,20 +446,19 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 444 | 446 | } |
| 445 | 447 | }, |
| 446 | 448 | .keyword_ifdef => { |
| 447 | const sum, const overflowed = @addWithOverflow(if_level, 1); | |
| 448 | if (overflowed != 0) | |
| 449 | const overflowed = if_context.increment(); | |
| 450 | if (overflowed) | |
| 449 | 451 | return pp.fatal(directive, "too many #if nestings", .{}); |
| 450 | if_level = sum; | |
| 451 | 452 | |
| 452 | 453 | const macro_name = (try pp.expectMacroName(&tokenizer)) orelse continue; |
| 453 | 454 | try pp.expectNl(&tokenizer); |
| 454 | 455 | if (pp.defines.get(macro_name) != null) { |
| 455 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); | |
| 456 | if_context.set(.until_endif); | |
| 456 | 457 | if (pp.verbose) { |
| 457 | 458 | pp.verboseLog(directive, "entering then branch of #ifdef", .{}); |
| 458 | 459 | } |
| 459 | 460 | } else { |
| 460 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 461 | if_context.set(.until_else); | |
| 461 | 462 | try pp.skip(&tokenizer, .until_else); |
| 462 | 463 | if (pp.verbose) { |
| 463 | 464 | pp.verboseLog(directive, "entering else branch of #ifdef", .{}); |
| ... | ... | @@ -465,31 +466,30 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 465 | 466 | } |
| 466 | 467 | }, |
| 467 | 468 | .keyword_ifndef => { |
| 468 | const sum, const overflowed = @addWithOverflow(if_level, 1); | |
| 469 | if (overflowed != 0) | |
| 469 | const overflowed = if_context.increment(); | |
| 470 | if (overflowed) | |
| 470 | 471 | return pp.fatal(directive, "too many #if nestings", .{}); |
| 471 | if_level = sum; | |
| 472 | 472 | |
| 473 | 473 | const macro_name = (try pp.expectMacroName(&tokenizer)) orelse continue; |
| 474 | 474 | try pp.expectNl(&tokenizer); |
| 475 | 475 | if (pp.defines.get(macro_name) == null) { |
| 476 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); | |
| 476 | if_context.set(.until_endif); | |
| 477 | 477 | } else { |
| 478 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 478 | if_context.set(.until_else); | |
| 479 | 479 | try pp.skip(&tokenizer, .until_else); |
| 480 | 480 | } |
| 481 | 481 | }, |
| 482 | 482 | .keyword_elif => { |
| 483 | if (if_level == 0) { | |
| 484 | try pp.err(directive, .elif_without_if); | |
| 485 | if_level += 1; | |
| 486 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 487 | } else if (if_level == 1) { | |
| 483 | if (if_context.level == 0) { | |
| 484 | try pp.err(directive, .elif_without_if, .{}); | |
| 485 | _ = if_context.increment(); | |
| 486 | if_context.set(.until_else); | |
| 487 | } else if (if_context.level == 1) { | |
| 488 | 488 | guard_name = null; |
| 489 | 489 | } |
| 490 | switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { | |
| 491 | until_else => if (try pp.expr(&tokenizer)) { | |
| 492 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); | |
| 490 | switch (if_context.get()) { | |
| 491 | .until_else => if (try pp.expr(&tokenizer)) { | |
| 492 | if_context.set(.until_endif); | |
| 493 | 493 | if (pp.verbose) { |
| 494 | 494 | pp.verboseLog(directive, "entering then branch of #elif", .{}); |
| 495 | 495 | } |
| ... | ... | @@ -499,27 +499,26 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 499 | 499 | pp.verboseLog(directive, "entering else branch of #elif", .{}); |
| 500 | 500 | } |
| 501 | 501 | }, |
| 502 | until_endif => try pp.skip(&tokenizer, .until_endif), | |
| 503 | until_endif_seen_else => { | |
| 504 | try pp.err(directive, .elif_after_else); | |
| 502 | .until_endif => try pp.skip(&tokenizer, .until_endif), | |
| 503 | .until_endif_seen_else => { | |
| 504 | try pp.err(directive, .elif_after_else, .{}); | |
| 505 | 505 | skipToNl(&tokenizer); |
| 506 | 506 | }, |
| 507 | else => unreachable, | |
| 508 | 507 | } |
| 509 | 508 | }, |
| 510 | 509 | .keyword_elifdef => { |
| 511 | if (if_level == 0) { | |
| 512 | try pp.err(directive, .elifdef_without_if); | |
| 513 | if_level += 1; | |
| 514 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 515 | } else if (if_level == 1) { | |
| 510 | if (if_context.level == 0) { | |
| 511 | try pp.err(directive, .elifdef_without_if, .{}); | |
| 512 | _ = if_context.increment(); | |
| 513 | if_context.set(.until_else); | |
| 514 | } else if (if_context.level == 1) { | |
| 516 | 515 | guard_name = null; |
| 517 | 516 | } |
| 518 | switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { | |
| 519 | until_else => { | |
| 517 | switch (if_context.get()) { | |
| 518 | .until_else => { | |
| 520 | 519 | const macro_name = try pp.expectMacroName(&tokenizer); |
| 521 | 520 | if (macro_name == null) { |
| 522 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 521 | if_context.set(.until_else); | |
| 523 | 522 | try pp.skip(&tokenizer, .until_else); |
| 524 | 523 | if (pp.verbose) { |
| 525 | 524 | pp.verboseLog(directive, "entering else branch of #elifdef", .{}); |
| ... | ... | @@ -527,12 +526,12 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 527 | 526 | } else { |
| 528 | 527 | try pp.expectNl(&tokenizer); |
| 529 | 528 | if (pp.defines.get(macro_name.?) != null) { |
| 530 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); | |
| 529 | if_context.set(.until_endif); | |
| 531 | 530 | if (pp.verbose) { |
| 532 | 531 | pp.verboseLog(directive, "entering then branch of #elifdef", .{}); |
| 533 | 532 | } |
| 534 | 533 | } else { |
| 535 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 534 | if_context.set(.until_else); | |
| 536 | 535 | try pp.skip(&tokenizer, .until_else); |
| 537 | 536 | if (pp.verbose) { |
| 538 | 537 | pp.verboseLog(directive, "entering else branch of #elifdef", .{}); |
| ... | ... | @@ -540,27 +539,26 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 540 | 539 | } |
| 541 | 540 | } |
| 542 | 541 | }, |
| 543 | until_endif => try pp.skip(&tokenizer, .until_endif), | |
| 544 | until_endif_seen_else => { | |
| 545 | try pp.err(directive, .elifdef_after_else); | |
| 542 | .until_endif => try pp.skip(&tokenizer, .until_endif), | |
| 543 | .until_endif_seen_else => { | |
| 544 | try pp.err(directive, .elifdef_after_else, .{}); | |
| 546 | 545 | skipToNl(&tokenizer); |
| 547 | 546 | }, |
| 548 | else => unreachable, | |
| 549 | 547 | } |
| 550 | 548 | }, |
| 551 | 549 | .keyword_elifndef => { |
| 552 | if (if_level == 0) { | |
| 553 | try pp.err(directive, .elifdef_without_if); | |
| 554 | if_level += 1; | |
| 555 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 556 | } else if (if_level == 1) { | |
| 550 | if (if_context.level == 0) { | |
| 551 | try pp.err(directive, .elifndef_without_if, .{}); | |
| 552 | _ = if_context.increment(); | |
| 553 | if_context.set(.until_else); | |
| 554 | } else if (if_context.level == 1) { | |
| 557 | 555 | guard_name = null; |
| 558 | 556 | } |
| 559 | switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { | |
| 560 | until_else => { | |
| 557 | switch (if_context.get()) { | |
| 558 | .until_else => { | |
| 561 | 559 | const macro_name = try pp.expectMacroName(&tokenizer); |
| 562 | 560 | if (macro_name == null) { |
| 563 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 561 | if_context.set(.until_else); | |
| 564 | 562 | try pp.skip(&tokenizer, .until_else); |
| 565 | 563 | if (pp.verbose) { |
| 566 | 564 | pp.verboseLog(directive, "entering else branch of #elifndef", .{}); |
| ... | ... | @@ -568,12 +566,12 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 568 | 566 | } else { |
| 569 | 567 | try pp.expectNl(&tokenizer); |
| 570 | 568 | if (pp.defines.get(macro_name.?) == null) { |
| 571 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); | |
| 569 | if_context.set(.until_endif); | |
| 572 | 570 | if (pp.verbose) { |
| 573 | 571 | pp.verboseLog(directive, "entering then branch of #elifndef", .{}); |
| 574 | 572 | } |
| 575 | 573 | } else { |
| 576 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); | |
| 574 | if_context.set(.until_else); | |
| 577 | 575 | try pp.skip(&tokenizer, .until_else); |
| 578 | 576 | if (pp.verbose) { |
| 579 | 577 | pp.verboseLog(directive, "entering else branch of #elifndef", .{}); |
| ... | ... | @@ -581,44 +579,42 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 581 | 579 | } |
| 582 | 580 | } |
| 583 | 581 | }, |
| 584 | until_endif => try pp.skip(&tokenizer, .until_endif), | |
| 585 | until_endif_seen_else => { | |
| 586 | try pp.err(directive, .elifdef_after_else); | |
| 582 | .until_endif => try pp.skip(&tokenizer, .until_endif), | |
| 583 | .until_endif_seen_else => { | |
| 584 | try pp.err(directive, .elifdef_after_else, .{}); | |
| 587 | 585 | skipToNl(&tokenizer); |
| 588 | 586 | }, |
| 589 | else => unreachable, | |
| 590 | 587 | } |
| 591 | 588 | }, |
| 592 | 589 | .keyword_else => { |
| 593 | 590 | try pp.expectNl(&tokenizer); |
| 594 | if (if_level == 0) { | |
| 595 | try pp.err(directive, .else_without_if); | |
| 591 | if (if_context.level == 0) { | |
| 592 | try pp.err(directive, .else_without_if, .{}); | |
| 596 | 593 | continue; |
| 597 | } else if (if_level == 1) { | |
| 594 | } else if (if_context.level == 1) { | |
| 598 | 595 | guard_name = null; |
| 599 | 596 | } |
| 600 | switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { | |
| 601 | until_else => { | |
| 602 | std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif_seen_else); | |
| 597 | switch (if_context.get()) { | |
| 598 | .until_else => { | |
| 599 | if_context.set(.until_endif_seen_else); | |
| 603 | 600 | if (pp.verbose) { |
| 604 | 601 | pp.verboseLog(directive, "#else branch here", .{}); |
| 605 | 602 | } |
| 606 | 603 | }, |
| 607 | until_endif => try pp.skip(&tokenizer, .until_endif_seen_else), | |
| 608 | until_endif_seen_else => { | |
| 609 | try pp.err(directive, .else_after_else); | |
| 604 | .until_endif => try pp.skip(&tokenizer, .until_endif_seen_else), | |
| 605 | .until_endif_seen_else => { | |
| 606 | try pp.err(directive, .else_after_else, .{}); | |
| 610 | 607 | skipToNl(&tokenizer); |
| 611 | 608 | }, |
| 612 | else => unreachable, | |
| 613 | 609 | } |
| 614 | 610 | }, |
| 615 | 611 | .keyword_endif => { |
| 616 | 612 | try pp.expectNl(&tokenizer); |
| 617 | if (if_level == 0) { | |
| 613 | if (if_context.level == 0) { | |
| 618 | 614 | guard_name = null; |
| 619 | try pp.err(directive, .endif_without_if); | |
| 615 | try pp.err(directive, .endif_without_if, .{}); | |
| 620 | 616 | continue; |
| 621 | } else if (if_level == 1) { | |
| 617 | } else if (if_context.level == 1) { | |
| 622 | 618 | const saved_tokenizer = tokenizer; |
| 623 | 619 | defer tokenizer = saved_tokenizer; |
| 624 | 620 | |
| ... | ... | @@ -626,7 +622,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 626 | 622 | while (next.id == .nl) : (next = tokenizer.nextNoWS()) {} |
| 627 | 623 | if (next.id != .eof) guard_name = null; |
| 628 | 624 | } |
| 629 | if_level -= 1; | |
| 625 | if_context.decrement(); | |
| 630 | 626 | }, |
| 631 | 627 | .keyword_define => try pp.define(&tokenizer, directive), |
| 632 | 628 | .keyword_undef => { |
| ... | ... | @@ -635,7 +631,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 635 | 631 | try pp.addToken(tokFromRaw(directive)); |
| 636 | 632 | } |
| 637 | 633 | |
| 638 | _ = pp.defines.remove(macro_name); | |
| 634 | _ = pp.defines.orderedRemove(macro_name); | |
| 639 | 635 | try pp.expectNl(&tokenizer); |
| 640 | 636 | }, |
| 641 | 637 | .keyword_include => { |
| ... | ... | @@ -643,15 +639,10 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 643 | 639 | continue; |
| 644 | 640 | }, |
| 645 | 641 | .keyword_include_next => { |
| 646 | try pp.comp.addDiagnostic(.{ | |
| 647 | .tag = .include_next, | |
| 648 | .loc = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }, | |
| 649 | }, &.{}); | |
| 642 | try pp.err(directive_loc, .include_next, .{}); | |
| 643 | ||
| 650 | 644 | if (pp.include_depth == 0) { |
| 651 | try pp.comp.addDiagnostic(.{ | |
| 652 | .tag = .include_next_outside_header, | |
| 653 | .loc = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }, | |
| 654 | }, &.{}); | |
| 645 | try pp.err(directive_loc, .include_next_outside_header, .{}); | |
| 655 | 646 | try pp.include(&tokenizer, .first); |
| 656 | 647 | } else { |
| 657 | 648 | try pp.include(&tokenizer, .next); |
| ... | ... | @@ -665,13 +656,13 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 665 | 656 | .keyword_line => { |
| 666 | 657 | // #line number "file" |
| 667 | 658 | const digits = tokenizer.nextNoWS(); |
| 668 | if (digits.id != .pp_num) try pp.err(digits, .line_simple_digit); | |
| 659 | if (digits.id != .pp_num) try pp.err(digits, .line_simple_digit, .{}); | |
| 669 | 660 | // TODO: validate that the pp_num token is solely digits |
| 670 | 661 | |
| 671 | 662 | if (digits.id == .eof or digits.id == .nl) continue; |
| 672 | 663 | const name = tokenizer.nextNoWS(); |
| 673 | 664 | if (name.id == .eof or name.id == .nl) continue; |
| 674 | if (name.id != .string_literal) try pp.err(name, .line_invalid_filename); | |
| 665 | if (name.id != .string_literal) try pp.err(name, .line_invalid_filename, .{}); | |
| 675 | 666 | try pp.expectNl(&tokenizer); |
| 676 | 667 | }, |
| 677 | 668 | .pp_num => { |
| ... | ... | @@ -680,7 +671,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 680 | 671 | // if not, emit `GNU line marker directive requires a simple digit sequence` |
| 681 | 672 | const name = tokenizer.nextNoWS(); |
| 682 | 673 | if (name.id == .eof or name.id == .nl) continue; |
| 683 | if (name.id != .string_literal) try pp.err(name, .line_invalid_filename); | |
| 674 | if (name.id != .string_literal) try pp.err(name, .line_invalid_filename, .{}); | |
| 684 | 675 | |
| 685 | 676 | const flag_1 = tokenizer.nextNoWS(); |
| 686 | 677 | if (flag_1.id == .eof or flag_1.id == .nl) continue; |
| ... | ... | @@ -694,11 +685,11 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 694 | 685 | }, |
| 695 | 686 | .nl => {}, |
| 696 | 687 | .eof => { |
| 697 | if (if_level != 0) try pp.err(tok, .unterminated_conditional_directive); | |
| 688 | if (if_context.level != 0) try pp.err(tok, .unterminated_conditional_directive, .{}); | |
| 698 | 689 | return tokFromRaw(directive); |
| 699 | 690 | }, |
| 700 | 691 | else => { |
| 701 | try pp.err(tok, .invalid_preprocessing_directive); | |
| 692 | try pp.err(tok, .invalid_preprocessing_directive, .{}); | |
| 702 | 693 | skipToNl(&tokenizer); |
| 703 | 694 | }, |
| 704 | 695 | } |
| ... | ... | @@ -713,14 +704,14 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 713 | 704 | if (pp.preserve_whitespace) try pp.addToken(tokFromRaw(tok)); |
| 714 | 705 | }, |
| 715 | 706 | .eof => { |
| 716 | if (if_level != 0) try pp.err(tok, .unterminated_conditional_directive); | |
| 707 | if (if_context.level != 0) try pp.err(tok, .unterminated_conditional_directive, .{}); | |
| 717 | 708 | // The following check needs to occur here and not at the top of the function |
| 718 | 709 | // because a pragma may change the level during preprocessing |
| 719 | 710 | if (source.buf.len > 0 and source.buf[source.buf.len - 1] != '\n') { |
| 720 | try pp.err(tok, .newline_eof); | |
| 711 | try pp.err(tok, .newline_eof, .{}); | |
| 721 | 712 | } |
| 722 | 713 | if (guard_name) |name| { |
| 723 | if (try pp.include_guards.fetchPut(pp.gpa, source.id, name)) |prev| { | |
| 714 | if (try pp.include_guards.fetchPut(pp.comp.gpa, source.id, name)) |prev| { | |
| 724 | 715 | assert(mem.eql(u8, name, prev.value)); |
| 725 | 716 | } |
| 726 | 717 | } |
| ... | ... | @@ -728,13 +719,13 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 728 | 719 | }, |
| 729 | 720 | .unterminated_string_literal, .unterminated_char_literal, .empty_char_literal => |tag| { |
| 730 | 721 | start_of_line = false; |
| 731 | try pp.err(tok, invalidTokenDiagnostic(tag)); | |
| 722 | try pp.err(tok, invalidTokenDiagnostic(tag), .{}); | |
| 732 | 723 | try pp.expandMacro(&tokenizer, tok); |
| 733 | 724 | }, |
| 734 | .unterminated_comment => try pp.err(tok, .unterminated_comment), | |
| 725 | .unterminated_comment => try pp.err(tok, .unterminated_comment, .{}), | |
| 735 | 726 | else => { |
| 736 | 727 | if (tok.id.isMacroIdentifier() and pp.poisoned_identifiers.get(pp.tokSlice(tok)) != null) { |
| 737 | try pp.err(tok, .poisoned_identifier); | |
| 728 | try pp.err(tok, .poisoned_identifier, .{}); | |
| 738 | 729 | } |
| 739 | 730 | // Add the token to the buffer doing any necessary expansions. |
| 740 | 731 | start_of_line = false; |
| ... | ... | @@ -746,7 +737,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans |
| 746 | 737 | |
| 747 | 738 | /// Get raw token source string. |
| 748 | 739 | /// Returned slice is invalidated when comp.generated_buf is updated. |
| 749 | pub fn tokSlice(pp: *Preprocessor, token: anytype) []const u8 { | |
| 740 | pub fn tokSlice(pp: *const Preprocessor, token: anytype) []const u8 { | |
| 750 | 741 | if (token.id.lexeme()) |some| return some; |
| 751 | 742 | const source = pp.comp.getSource(token.source); |
| 752 | 743 | return source.buf[token.start..token.end]; |
| ... | ... | @@ -764,69 +755,101 @@ fn tokFromRaw(raw: RawToken) TokenWithExpansionLocs { |
| 764 | 755 | }; |
| 765 | 756 | } |
| 766 | 757 | |
| 767 | fn err(pp: *Preprocessor, raw: RawToken, tag: Diagnostics.Tag) !void { | |
| 768 | try pp.comp.addDiagnostic(.{ | |
| 769 | .tag = tag, | |
| 770 | .loc = .{ | |
| 771 | .id = raw.source, | |
| 772 | .byte_offset = raw.start, | |
| 773 | .line = raw.line, | |
| 758 | pub const Diagnostic = @import("Preprocessor/Diagnostic.zig"); | |
| 759 | ||
| 760 | fn err(pp: *Preprocessor, loc: anytype, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { | |
| 761 | if (pp.diagnostics.effectiveKind(diagnostic) == .off) return; | |
| 762 | const old_suppress_system = pp.diagnostics.state.suppress_system_headers; | |
| 763 | defer pp.diagnostics.state.suppress_system_headers = old_suppress_system; | |
| 764 | if (diagnostic.show_in_system_headers) pp.diagnostics.state.suppress_system_headers = false; | |
| 765 | ||
| 766 | var sf = std.heap.stackFallback(1024, pp.comp.gpa); | |
| 767 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 768 | defer allocating.deinit(); | |
| 769 | ||
| 770 | Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; | |
| 771 | try pp.diagnostics.addWithLocation(pp.comp, .{ | |
| 772 | .kind = diagnostic.kind, | |
| 773 | .text = allocating.written(), | |
| 774 | .opt = diagnostic.opt, | |
| 775 | .extension = diagnostic.extension, | |
| 776 | .location = switch (@TypeOf(loc)) { | |
| 777 | RawToken => (Source.Location{ | |
| 778 | .id = loc.source, | |
| 779 | .byte_offset = loc.start, | |
| 780 | .line = loc.line, | |
| 781 | }).expand(pp.comp), | |
| 782 | TokenWithExpansionLocs, *TokenWithExpansionLocs => loc.loc.expand(pp.comp), | |
| 783 | Source.Location => loc.expand(pp.comp), | |
| 784 | else => @compileError("invalid token type " ++ @typeName(@TypeOf(loc))), | |
| 774 | 785 | }, |
| 775 | }, &.{}); | |
| 776 | } | |
| 777 | ||
| 778 | fn errStr(pp: *Preprocessor, tok: TokenWithExpansionLocs, tag: Diagnostics.Tag, str: []const u8) !void { | |
| 779 | try pp.comp.addDiagnostic(.{ | |
| 780 | .tag = tag, | |
| 781 | .loc = tok.loc, | |
| 782 | .extra = .{ .str = str }, | |
| 783 | }, tok.expansionSlice()); | |
| 786 | }, switch (@TypeOf(loc)) { | |
| 787 | RawToken => &.{}, | |
| 788 | TokenWithExpansionLocs, *TokenWithExpansionLocs => loc.expansionSlice(), | |
| 789 | Source.Location => &.{}, | |
| 790 | else => @compileError("invalid token type"), | |
| 791 | }, true); | |
| 784 | 792 | } |
| 785 | 793 | |
| 786 | 794 | fn fatal(pp: *Preprocessor, raw: RawToken, comptime fmt: []const u8, args: anytype) Compilation.Error { |
| 787 | try pp.comp.diagnostics.list.append(pp.gpa, .{ | |
| 788 | .tag = .cli_error, | |
| 795 | var sf = std.heap.stackFallback(1024, pp.comp.gpa); | |
| 796 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 797 | defer allocating.deinit(); | |
| 798 | ||
| 799 | Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; | |
| 800 | try pp.diagnostics.add(.{ | |
| 789 | 801 | .kind = .@"fatal error", |
| 790 | .extra = .{ .str = try std.fmt.allocPrint(pp.comp.diagnostics.arena.allocator(), fmt, args) }, | |
| 791 | .loc = .{ | |
| 802 | .text = allocating.written(), | |
| 803 | .location = (Source.Location{ | |
| 792 | 804 | .id = raw.source, |
| 793 | 805 | .byte_offset = raw.start, |
| 794 | 806 | .line = raw.line, |
| 795 | }, | |
| 807 | }).expand(pp.comp), | |
| 796 | 808 | }); |
| 797 | return error.FatalError; | |
| 809 | unreachable; | |
| 798 | 810 | } |
| 799 | 811 | |
| 800 | 812 | fn fatalNotFound(pp: *Preprocessor, tok: TokenWithExpansionLocs, filename: []const u8) Compilation.Error { |
| 801 | const old = pp.comp.diagnostics.fatal_errors; | |
| 802 | pp.comp.diagnostics.fatal_errors = true; | |
| 803 | defer pp.comp.diagnostics.fatal_errors = old; | |
| 813 | const old = pp.diagnostics.state.fatal_errors; | |
| 814 | pp.diagnostics.state.fatal_errors = true; | |
| 815 | defer pp.diagnostics.state.fatal_errors = old; | |
| 804 | 816 | |
| 805 | try pp.comp.diagnostics.addExtra(pp.comp.langopts, .{ .tag = .cli_error, .loc = tok.loc, .extra = .{ | |
| 806 | .str = try std.fmt.allocPrint(pp.comp.diagnostics.arena.allocator(), "'{s}' not found", .{filename}), | |
| 807 | } }, tok.expansionSlice(), false); | |
| 808 | unreachable; // addExtra should've returned FatalError | |
| 817 | var sf = std.heap.stackFallback(1024, pp.comp.gpa); | |
| 818 | const allocator = sf.get(); | |
| 819 | var buf: std.ArrayList(u8) = .empty; | |
| 820 | defer buf.deinit(allocator); | |
| 821 | ||
| 822 | try buf.print(allocator, "'{s}' not found", .{filename}); | |
| 823 | try pp.diagnostics.addWithLocation(pp.comp, .{ | |
| 824 | .kind = .@"fatal error", | |
| 825 | .text = buf.items, | |
| 826 | .location = tok.loc.expand(pp.comp), | |
| 827 | }, tok.expansionSlice(), true); | |
| 828 | unreachable; // should've returned FatalError | |
| 809 | 829 | } |
| 810 | 830 | |
| 811 | 831 | fn verboseLog(pp: *Preprocessor, raw: RawToken, comptime fmt: []const u8, args: anytype) void { |
| 832 | @branchHint(.cold); | |
| 812 | 833 | const source = pp.comp.getSource(raw.source); |
| 813 | 834 | const line_col = source.lineCol(.{ .id = raw.source, .line = raw.line, .byte_offset = raw.start }); |
| 814 | 835 | |
| 815 | var stderr_buffer: [64]u8 = undefined; | |
| 816 | var writer = std.debug.lockStderrWriter(&stderr_buffer); | |
| 817 | defer std.debug.unlockStderrWriter(); | |
| 818 | writer.print("{s}:{d}:{d}: ", .{ source.path, line_col.line_no, line_col.col }) catch return; | |
| 819 | writer.print(fmt, args) catch return; | |
| 820 | writer.writeByte('\n') catch return; | |
| 821 | writer.writeAll(line_col.line) catch return; | |
| 822 | writer.writeByte('\n') catch return; | |
| 836 | var stderr_buf: [4096]u8 = undefined; | |
| 837 | var stderr = std.fs.File.stderr().writer(&stderr_buf); | |
| 838 | const w = &stderr.interface; | |
| 839 | ||
| 840 | w.print("{s}:{d}:{d}: ", .{ source.path, line_col.line_no, line_col.col }) catch return; | |
| 841 | w.print(fmt, args) catch return; | |
| 842 | w.writeByte('\n') catch return; | |
| 843 | w.writeAll(line_col.line) catch return; | |
| 844 | w.writeByte('\n') catch return; | |
| 845 | w.flush() catch return; | |
| 823 | 846 | } |
| 824 | 847 | |
| 825 | 848 | /// Consume next token, error if it is not an identifier. |
| 826 | 849 | fn expectMacroName(pp: *Preprocessor, tokenizer: *Tokenizer) Error!?[]const u8 { |
| 827 | 850 | const macro_name = tokenizer.nextNoWS(); |
| 828 | 851 | if (!macro_name.id.isMacroIdentifier()) { |
| 829 | try pp.err(macro_name, .macro_name_missing); | |
| 852 | try pp.err(macro_name, .macro_name_missing, .{}); | |
| 830 | 853 | skipToNl(tokenizer); |
| 831 | 854 | return null; |
| 832 | 855 | } |
| ... | ... | @@ -842,7 +865,7 @@ fn expectNl(pp: *Preprocessor, tokenizer: *Tokenizer) Error!void { |
| 842 | 865 | if (tok.id == .whitespace or tok.id == .comment) continue; |
| 843 | 866 | if (!sent_err) { |
| 844 | 867 | sent_err = true; |
| 845 | try pp.err(tok, .extra_tokens_directive_end); | |
| 868 | try pp.err(tok, .extra_tokens_directive_end, .{}); | |
| 846 | 869 | } |
| 847 | 870 | } |
| 848 | 871 | } |
| ... | ... | @@ -861,9 +884,10 @@ fn restoreTokenState(pp: *Preprocessor, state: TokenState) void { |
| 861 | 884 | |
| 862 | 885 | /// Consume all tokens until a newline and parse the result into a boolean. |
| 863 | 886 | fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 887 | const gpa = pp.comp.gpa; | |
| 864 | 888 | const token_state = pp.getTokenState(); |
| 865 | 889 | defer { |
| 866 | for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 890 | for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 867 | 891 | pp.restoreTokenState(token_state); |
| 868 | 892 | } |
| 869 | 893 | |
| ... | ... | @@ -875,7 +899,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 875 | 899 | .whitespace => if (pp.top_expansion_buf.items.len == 0) continue, |
| 876 | 900 | else => {}, |
| 877 | 901 | } |
| 878 | try pp.top_expansion_buf.append(tokFromRaw(tok)); | |
| 902 | try pp.top_expansion_buf.append(gpa, tokFromRaw(tok)); | |
| 879 | 903 | } else unreachable; |
| 880 | 904 | if (pp.top_expansion_buf.items.len != 0) { |
| 881 | 905 | pp.expansion_source_loc = pp.top_expansion_buf.items[0].loc; |
| ... | ... | @@ -885,15 +909,12 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 885 | 909 | for (pp.top_expansion_buf.items) |tok| { |
| 886 | 910 | if (tok.id == .macro_ws) continue; |
| 887 | 911 | if (!tok.id.validPreprocessorExprStart()) { |
| 888 | try pp.comp.addDiagnostic(.{ | |
| 889 | .tag = .invalid_preproc_expr_start, | |
| 890 | .loc = tok.loc, | |
| 891 | }, tok.expansionSlice()); | |
| 912 | try pp.err(tok, .invalid_preproc_expr_start, .{}); | |
| 892 | 913 | return false; |
| 893 | 914 | } |
| 894 | 915 | break; |
| 895 | 916 | } else { |
| 896 | try pp.err(eof, .expected_value_in_expr); | |
| 917 | try pp.err(eof, .expected_value_in_expr, .{}); | |
| 897 | 918 | return false; |
| 898 | 919 | } |
| 899 | 920 | |
| ... | ... | @@ -910,10 +931,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 910 | 931 | .string_literal_utf_32, |
| 911 | 932 | .string_literal_wide, |
| 912 | 933 | => { |
| 913 | try pp.comp.addDiagnostic(.{ | |
| 914 | .tag = .string_literal_in_pp_expr, | |
| 915 | .loc = tok.loc, | |
| 916 | }, tok.expansionSlice()); | |
| 934 | try pp.err(tok, .string_literal_in_pp_expr, .{}); | |
| 917 | 935 | return false; |
| 918 | 936 | }, |
| 919 | 937 | .plus_plus, |
| ... | ... | @@ -940,10 +958,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 940 | 958 | .arrow, |
| 941 | 959 | .period, |
| 942 | 960 | => { |
| 943 | try pp.comp.addDiagnostic(.{ | |
| 944 | .tag = .invalid_preproc_operator, | |
| 945 | .loc = tok.loc, | |
| 946 | }, tok.expansionSlice()); | |
| 961 | try pp.err(tok, .invalid_preproc_operator, .{}); | |
| 947 | 962 | return false; |
| 948 | 963 | }, |
| 949 | 964 | .macro_ws, .whitespace => continue, |
| ... | ... | @@ -954,12 +969,12 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 954 | 969 | const tokens_consumed = try pp.handleKeywordDefined(&tok, items[i + 1 ..], eof); |
| 955 | 970 | i += tokens_consumed; |
| 956 | 971 | } else { |
| 957 | try pp.errStr(tok, .undefined_macro, pp.expandedSlice(tok)); | |
| 972 | try pp.err(tok, .undefined_macro, .{pp.expandedSlice(tok)}); | |
| 958 | 973 | |
| 959 | 974 | if (i + 1 < pp.top_expansion_buf.items.len and |
| 960 | 975 | pp.top_expansion_buf.items[i + 1].id == .l_paren) |
| 961 | 976 | { |
| 962 | try pp.errStr(tok, .fn_macro_undefined, pp.expandedSlice(tok)); | |
| 977 | try pp.err(tok, .fn_macro_undefined, .{pp.expandedSlice(tok)}); | |
| 963 | 978 | return false; |
| 964 | 979 | } |
| 965 | 980 | |
| ... | ... | @@ -967,7 +982,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 967 | 982 | } |
| 968 | 983 | }, |
| 969 | 984 | } |
| 970 | pp.addTokenAssumeCapacity(tok); | |
| 985 | pp.addTokenAssumeCapacity(try pp.unescapeUcn(tok)); | |
| 971 | 986 | } |
| 972 | 987 | try pp.addToken(.{ |
| 973 | 988 | .id = .eof, |
| ... | ... | @@ -975,18 +990,15 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 975 | 990 | }); |
| 976 | 991 | |
| 977 | 992 | // Actually parse it. |
| 978 | var parser = Parser{ | |
| 993 | var parser: Parser = .{ | |
| 979 | 994 | .pp = pp, |
| 980 | 995 | .comp = pp.comp, |
| 981 | .gpa = pp.gpa, | |
| 996 | .diagnostics = pp.diagnostics, | |
| 982 | 997 | .tok_ids = pp.tokens.items(.id), |
| 983 | 998 | .tok_i = @intCast(token_state.tokens_len), |
| 984 | .arena = pp.arena.allocator(), | |
| 985 | 999 | .in_macro = true, |
| 986 | .strings = std.array_list.Managed(u8).init(pp.comp.gpa), | |
| 987 | 1000 | |
| 988 | .data = undefined, | |
| 989 | .value_map = undefined, | |
| 1001 | .tree = undefined, | |
| 990 | 1002 | .labels = undefined, |
| 991 | 1003 | .decl_buf = undefined, |
| 992 | 1004 | .list_buf = undefined, |
| ... | ... | @@ -994,10 +1006,9 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { |
| 994 | 1006 | .enum_buf = undefined, |
| 995 | 1007 | .record_buf = undefined, |
| 996 | 1008 | .attr_buf = undefined, |
| 997 | .field_attr_buf = undefined, | |
| 998 | 1009 | .string_ids = undefined, |
| 999 | 1010 | }; |
| 1000 | defer parser.strings.deinit(); | |
| 1011 | defer parser.strings.deinit(gpa); | |
| 1001 | 1012 | return parser.macroExpr(); |
| 1002 | 1013 | } |
| 1003 | 1014 | |
| ... | ... | @@ -1007,28 +1018,25 @@ fn handleKeywordDefined(pp: *Preprocessor, macro_tok: *TokenWithExpansionLocs, t |
| 1007 | 1018 | std.debug.assert(macro_tok.id == .keyword_defined); |
| 1008 | 1019 | var it = TokenIterator.init(tokens); |
| 1009 | 1020 | const first = it.nextNoWS() orelse { |
| 1010 | try pp.err(eof, .macro_name_missing); | |
| 1021 | try pp.err(eof, .macro_name_missing, .{}); | |
| 1011 | 1022 | return it.i; |
| 1012 | 1023 | }; |
| 1013 | 1024 | switch (first.id) { |
| 1014 | 1025 | .l_paren => {}, |
| 1015 | 1026 | else => { |
| 1016 | 1027 | if (!first.id.isMacroIdentifier()) { |
| 1017 | try pp.errStr(first, .macro_name_must_be_identifier, pp.expandedSlice(first)); | |
| 1028 | try pp.err(first, .macro_name_must_be_identifier, .{}); | |
| 1018 | 1029 | } |
| 1019 | 1030 | macro_tok.id = if (pp.defines.contains(pp.expandedSlice(first))) .one else .zero; |
| 1020 | 1031 | return it.i; |
| 1021 | 1032 | }, |
| 1022 | 1033 | } |
| 1023 | 1034 | const second = it.nextNoWS() orelse { |
| 1024 | try pp.err(eof, .macro_name_missing); | |
| 1035 | try pp.err(eof, .macro_name_missing, .{}); | |
| 1025 | 1036 | return it.i; |
| 1026 | 1037 | }; |
| 1027 | 1038 | if (!second.id.isMacroIdentifier()) { |
| 1028 | try pp.comp.addDiagnostic(.{ | |
| 1029 | .tag = .macro_name_must_be_identifier, | |
| 1030 | .loc = second.loc, | |
| 1031 | }, second.expansionSlice()); | |
| 1039 | try pp.err(second, .macro_name_must_be_identifier, .{}); | |
| 1032 | 1040 | return it.i; |
| 1033 | 1041 | } |
| 1034 | 1042 | macro_tok.id = if (pp.defines.contains(pp.expandedSlice(second))) .one else .zero; |
| ... | ... | @@ -1036,14 +1044,8 @@ fn handleKeywordDefined(pp: *Preprocessor, macro_tok: *TokenWithExpansionLocs, t |
| 1036 | 1044 | const last = it.nextNoWS(); |
| 1037 | 1045 | if (last == null or last.?.id != .r_paren) { |
| 1038 | 1046 | const tok = last orelse tokFromRaw(eof); |
| 1039 | try pp.comp.addDiagnostic(.{ | |
| 1040 | .tag = .closing_paren, | |
| 1041 | .loc = tok.loc, | |
| 1042 | }, tok.expansionSlice()); | |
| 1043 | try pp.comp.addDiagnostic(.{ | |
| 1044 | .tag = .to_match_paren, | |
| 1045 | .loc = first.loc, | |
| 1046 | }, first.expansionSlice()); | |
| 1047 | try pp.err(tok, .closing_paren, .{}); | |
| 1048 | try pp.err(first, .to_match_paren, .{}); | |
| 1047 | 1049 | } |
| 1048 | 1050 | |
| 1049 | 1051 | return it.i; |
| ... | ... | @@ -1070,7 +1072,7 @@ fn skip( |
| 1070 | 1072 | .keyword_else => { |
| 1071 | 1073 | if (ifs_seen != 0) continue; |
| 1072 | 1074 | if (cont == .until_endif_seen_else) { |
| 1073 | try pp.err(directive, .else_after_else); | |
| 1075 | try pp.err(directive, .else_after_else, .{}); | |
| 1074 | 1076 | continue; |
| 1075 | 1077 | } |
| 1076 | 1078 | tokenizer.* = saved_tokenizer; |
| ... | ... | @@ -1079,7 +1081,7 @@ fn skip( |
| 1079 | 1081 | .keyword_elif => { |
| 1080 | 1082 | if (ifs_seen != 0 or cont == .until_endif) continue; |
| 1081 | 1083 | if (cont == .until_endif_seen_else) { |
| 1082 | try pp.err(directive, .elif_after_else); | |
| 1084 | try pp.err(directive, .elif_after_else, .{}); | |
| 1083 | 1085 | continue; |
| 1084 | 1086 | } |
| 1085 | 1087 | tokenizer.* = saved_tokenizer; |
| ... | ... | @@ -1088,7 +1090,7 @@ fn skip( |
| 1088 | 1090 | .keyword_elifdef => { |
| 1089 | 1091 | if (ifs_seen != 0 or cont == .until_endif) continue; |
| 1090 | 1092 | if (cont == .until_endif_seen_else) { |
| 1091 | try pp.err(directive, .elifdef_after_else); | |
| 1093 | try pp.err(directive, .elifdef_after_else, .{}); | |
| 1092 | 1094 | continue; |
| 1093 | 1095 | } |
| 1094 | 1096 | tokenizer.* = saved_tokenizer; |
| ... | ... | @@ -1097,7 +1099,7 @@ fn skip( |
| 1097 | 1099 | .keyword_elifndef => { |
| 1098 | 1100 | if (ifs_seen != 0 or cont == .until_endif) continue; |
| 1099 | 1101 | if (cont == .until_endif_seen_else) { |
| 1100 | try pp.err(directive, .elifndef_after_else); | |
| 1102 | try pp.err(directive, .elifndef_after_else, .{}); | |
| 1101 | 1103 | continue; |
| 1102 | 1104 | } |
| 1103 | 1105 | tokenizer.* = saved_tokenizer; |
| ... | ... | @@ -1129,7 +1131,7 @@ fn skip( |
| 1129 | 1131 | } |
| 1130 | 1132 | } else { |
| 1131 | 1133 | const eof = tokenizer.next(); |
| 1132 | return pp.err(eof, .unterminated_conditional_directive); | |
| 1134 | return pp.err(eof, .unterminated_conditional_directive, .{}); | |
| 1133 | 1135 | } |
| 1134 | 1136 | } |
| 1135 | 1137 | |
| ... | ... | @@ -1141,34 +1143,35 @@ fn skipToNl(tokenizer: *Tokenizer) void { |
| 1141 | 1143 | } |
| 1142 | 1144 | } |
| 1143 | 1145 | |
| 1144 | const ExpandBuf = std.array_list.Managed(TokenWithExpansionLocs); | |
| 1145 | fn removePlacemarkers(buf: *ExpandBuf) void { | |
| 1146 | const ExpandBuf = std.ArrayList(TokenWithExpansionLocs); | |
| 1147 | fn removePlacemarkers(gpa: Allocator, buf: *ExpandBuf) void { | |
| 1146 | 1148 | var i: usize = buf.items.len -% 1; |
| 1147 | 1149 | while (i < buf.items.len) : (i -%= 1) { |
| 1148 | 1150 | if (buf.items[i].id == .placemarker) { |
| 1149 | 1151 | const placemarker = buf.orderedRemove(i); |
| 1150 | TokenWithExpansionLocs.free(placemarker.expansion_locs, buf.allocator); | |
| 1152 | TokenWithExpansionLocs.free(placemarker.expansion_locs, gpa); | |
| 1151 | 1153 | } |
| 1152 | 1154 | } |
| 1153 | 1155 | } |
| 1154 | 1156 | |
| 1155 | const MacroArguments = std.array_list.Managed([]const TokenWithExpansionLocs); | |
| 1156 | fn deinitMacroArguments(allocator: Allocator, args: *const MacroArguments) void { | |
| 1157 | const MacroArguments = std.ArrayList([]const TokenWithExpansionLocs); | |
| 1158 | fn deinitMacroArguments(gpa: Allocator, args: *MacroArguments) void { | |
| 1157 | 1159 | for (args.items) |item| { |
| 1158 | for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, allocator); | |
| 1159 | allocator.free(item); | |
| 1160 | for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 1161 | gpa.free(item); | |
| 1160 | 1162 | } |
| 1161 | args.deinit(); | |
| 1163 | args.deinit(gpa); | |
| 1162 | 1164 | } |
| 1163 | 1165 | |
| 1164 | 1166 | fn expandObjMacro(pp: *Preprocessor, simple_macro: *const Macro) Error!ExpandBuf { |
| 1165 | var buf = ExpandBuf.init(pp.gpa); | |
| 1166 | errdefer buf.deinit(); | |
| 1167 | const gpa = pp.comp.gpa; | |
| 1168 | var buf: ExpandBuf = .empty; | |
| 1169 | errdefer buf.deinit(gpa); | |
| 1167 | 1170 | if (simple_macro.tokens.len == 0) { |
| 1168 | try buf.append(.{ .id = .placemarker, .loc = .{ .id = .generated } }); | |
| 1171 | try buf.append(gpa, .{ .id = .placemarker, .loc = .{ .id = .generated } }); | |
| 1169 | 1172 | return buf; |
| 1170 | 1173 | } |
| 1171 | try buf.ensureTotalCapacity(simple_macro.tokens.len); | |
| 1174 | try buf.ensureTotalCapacity(gpa, simple_macro.tokens.len); | |
| 1172 | 1175 | |
| 1173 | 1176 | // Add all of the simple_macros tokens to the new buffer handling any concats. |
| 1174 | 1177 | var i: usize = 0; |
| ... | ... | @@ -1194,24 +1197,44 @@ fn expandObjMacro(pp: *Preprocessor, simple_macro: *const Macro) Error!ExpandBuf |
| 1194 | 1197 | .macro_file => { |
| 1195 | 1198 | const start = pp.comp.generated_buf.items.len; |
| 1196 | 1199 | const source = pp.comp.getSource(pp.expansion_source_loc.id); |
| 1197 | try pp.comp.generated_buf.print(pp.gpa, "\"{s}\"\n", .{source.path}); | |
| 1200 | try pp.comp.generated_buf.print(gpa, "\"{f}\"\n", .{fmtEscapes(source.path)}); | |
| 1198 | 1201 | |
| 1199 | 1202 | buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .string_literal, tok)); |
| 1200 | 1203 | }, |
| 1201 | 1204 | .macro_line => { |
| 1202 | 1205 | const start = pp.comp.generated_buf.items.len; |
| 1203 | 1206 | const source = pp.comp.getSource(pp.expansion_source_loc.id); |
| 1204 | try pp.comp.generated_buf.print(pp.gpa, "{d}\n", .{source.physicalLine(pp.expansion_source_loc)}); | |
| 1207 | try pp.comp.generated_buf.print(gpa, "{d}\n", .{source.physicalLine(pp.expansion_source_loc)}); | |
| 1205 | 1208 | |
| 1206 | 1209 | buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .pp_num, tok)); |
| 1207 | 1210 | }, |
| 1208 | 1211 | .macro_counter => { |
| 1209 | 1212 | defer pp.counter += 1; |
| 1210 | 1213 | const start = pp.comp.generated_buf.items.len; |
| 1211 | try pp.comp.generated_buf.print(pp.gpa, "{d}\n", .{pp.counter}); | |
| 1214 | try pp.comp.generated_buf.print(gpa, "{d}\n", .{pp.counter}); | |
| 1212 | 1215 | |
| 1213 | 1216 | buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .pp_num, tok)); |
| 1214 | 1217 | }, |
| 1218 | .macro_date, .macro_time => { | |
| 1219 | try pp.err(pp.expansion_source_loc, .date_time, .{}); | |
| 1220 | const start = pp.comp.generated_buf.items.len; | |
| 1221 | const timestamp = switch (pp.source_epoch) { | |
| 1222 | .system, .provided => |ts| ts, | |
| 1223 | }; | |
| 1224 | try pp.writeDateTimeStamp(.fromTokId(raw.id), timestamp); | |
| 1225 | buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .string_literal, tok)); | |
| 1226 | }, | |
| 1227 | .macro_timestamp => { | |
| 1228 | try pp.err(pp.expansion_source_loc, .date_time, .{}); | |
| 1229 | const start = pp.comp.generated_buf.items.len; | |
| 1230 | const timestamp = switch (pp.source_epoch) { | |
| 1231 | .provided => |ts| ts, | |
| 1232 | .system => try pp.mTime(pp.expansion_source_loc.id), | |
| 1233 | }; | |
| 1234 | ||
| 1235 | try pp.writeDateTimeStamp(.fromTokId(raw.id), timestamp); | |
| 1236 | buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .string_literal, tok)); | |
| 1237 | }, | |
| 1215 | 1238 | else => buf.appendAssumeCapacity(tok), |
| 1216 | 1239 | } |
| 1217 | 1240 | } |
| ... | ... | @@ -1219,6 +1242,65 @@ fn expandObjMacro(pp: *Preprocessor, simple_macro: *const Macro) Error!ExpandBuf |
| 1219 | 1242 | return buf; |
| 1220 | 1243 | } |
| 1221 | 1244 | |
| 1245 | const DateTimeStampKind = enum { | |
| 1246 | date, | |
| 1247 | time, | |
| 1248 | timestamp, | |
| 1249 | ||
| 1250 | fn fromTokId(tok_id: RawToken.Id) DateTimeStampKind { | |
| 1251 | return switch (tok_id) { | |
| 1252 | .macro_date => .date, | |
| 1253 | .macro_time => .time, | |
| 1254 | .macro_timestamp => .timestamp, | |
| 1255 | else => unreachable, | |
| 1256 | }; | |
| 1257 | } | |
| 1258 | }; | |
| 1259 | ||
| 1260 | fn writeDateTimeStamp(pp: *const Preprocessor, kind: DateTimeStampKind, timestamp: u64) !void { | |
| 1261 | std.debug.assert(std.time.epoch.Month.jan.numeric() == 1); | |
| 1262 | const gpa = pp.comp.gpa; | |
| 1263 | ||
| 1264 | const epoch_seconds = std.time.epoch.EpochSeconds{ .secs = timestamp }; | |
| 1265 | const epoch_day = epoch_seconds.getEpochDay(); | |
| 1266 | const day_seconds = epoch_seconds.getDaySeconds(); | |
| 1267 | const year_day = epoch_day.calculateYearDay(); | |
| 1268 | const month_day = year_day.calculateMonthDay(); | |
| 1269 | ||
| 1270 | const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; | |
| 1271 | const month_names = [_][]const u8{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; | |
| 1272 | const day_name = day_names[@intCast((epoch_day.day + 3) % 7)]; | |
| 1273 | const month_name = month_names[month_day.month.numeric() - 1]; | |
| 1274 | ||
| 1275 | switch (kind) { | |
| 1276 | .date => { | |
| 1277 | try pp.comp.generated_buf.print(gpa, "\"{s} {d: >2} {d}\"", .{ | |
| 1278 | month_name, | |
| 1279 | month_day.day_index + 1, | |
| 1280 | year_day.year, | |
| 1281 | }); | |
| 1282 | }, | |
| 1283 | .time => { | |
| 1284 | try pp.comp.generated_buf.print(gpa, "\"{d:0>2}:{d:0>2}:{d:0>2}\"", .{ | |
| 1285 | day_seconds.getHoursIntoDay(), | |
| 1286 | day_seconds.getMinutesIntoHour(), | |
| 1287 | day_seconds.getSecondsIntoMinute(), | |
| 1288 | }); | |
| 1289 | }, | |
| 1290 | .timestamp => { | |
| 1291 | try pp.comp.generated_buf.print(gpa, "\"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"", .{ | |
| 1292 | day_name, | |
| 1293 | month_name, | |
| 1294 | month_day.day_index + 1, | |
| 1295 | day_seconds.getHoursIntoDay(), | |
| 1296 | day_seconds.getMinutesIntoHour(), | |
| 1297 | day_seconds.getSecondsIntoMinute(), | |
| 1298 | year_day.year, | |
| 1299 | }); | |
| 1300 | }, | |
| 1301 | } | |
| 1302 | } | |
| 1303 | ||
| 1222 | 1304 | /// Join a possibly-parenthesized series of string literal tokens into a single string without |
| 1223 | 1305 | /// leading or trailing quotes. The returned slice is invalidated if pp.char_buf changes. |
| 1224 | 1306 | /// Returns error.ExpectedStringLiteral if parentheses are not balanced, a non-string-literal |
| ... | ... | @@ -1237,7 +1319,7 @@ fn pasteStringsUnsafe(pp: *Preprocessor, toks: []const TokenWithExpansionLocs) ! |
| 1237 | 1319 | if (tok.id == .macro_ws) continue; |
| 1238 | 1320 | if (tok.id != .string_literal) return error.ExpectedStringLiteral; |
| 1239 | 1321 | const str = pp.expandedSlice(tok); |
| 1240 | try pp.char_buf.appendSlice(str[1 .. str.len - 1]); | |
| 1322 | try pp.char_buf.appendSlice(pp.comp.gpa, str[1 .. str.len - 1]); | |
| 1241 | 1323 | } |
| 1242 | 1324 | return pp.char_buf.items[char_top..]; |
| 1243 | 1325 | } |
| ... | ... | @@ -1247,16 +1329,17 @@ fn pragmaOperator(pp: *Preprocessor, arg_tok: TokenWithExpansionLocs, operator_l |
| 1247 | 1329 | const arg_slice = pp.expandedSlice(arg_tok); |
| 1248 | 1330 | const content = arg_slice[1 .. arg_slice.len - 1]; |
| 1249 | 1331 | const directive = "#pragma "; |
| 1332 | const gpa = pp.comp.gpa; | |
| 1250 | 1333 | |
| 1251 | 1334 | pp.char_buf.clearRetainingCapacity(); |
| 1252 | 1335 | const total_len = directive.len + content.len + 1; // destringify can never grow the string, + 1 for newline |
| 1253 | try pp.char_buf.ensureUnusedCapacity(total_len); | |
| 1336 | try pp.char_buf.ensureUnusedCapacity(gpa, total_len); | |
| 1254 | 1337 | pp.char_buf.appendSliceAssumeCapacity(directive); |
| 1255 | 1338 | pp.destringify(content); |
| 1256 | 1339 | pp.char_buf.appendAssumeCapacity('\n'); |
| 1257 | 1340 | |
| 1258 | 1341 | const start = pp.comp.generated_buf.items.len; |
| 1259 | try pp.comp.generated_buf.appendSlice(pp.gpa, pp.char_buf.items); | |
| 1342 | try pp.comp.generated_buf.appendSlice(gpa, pp.char_buf.items); | |
| 1260 | 1343 | var tmp_tokenizer = Tokenizer{ |
| 1261 | 1344 | .buf = pp.comp.generated_buf.items, |
| 1262 | 1345 | .langopts = pp.comp.langopts, |
| ... | ... | @@ -1272,6 +1355,40 @@ fn pragmaOperator(pp: *Preprocessor, arg_tok: TokenWithExpansionLocs, operator_l |
| 1272 | 1355 | try pp.pragma(&tmp_tokenizer, pragma_tok, operator_loc, arg_tok.expansionSlice()); |
| 1273 | 1356 | } |
| 1274 | 1357 | |
| 1358 | /// Handle Microsoft __pragma operator | |
| 1359 | fn msPragmaOperator(pp: *Preprocessor, pragma_tok: TokenWithExpansionLocs, args: []const TokenWithExpansionLocs) !void { | |
| 1360 | if (args.len == 0) { | |
| 1361 | try pp.err(pragma_tok, .unknown_pragma, .{}); | |
| 1362 | return; | |
| 1363 | } | |
| 1364 | const gpa = pp.comp.gpa; | |
| 1365 | ||
| 1366 | { | |
| 1367 | var copy = try pragma_tok.dupe(gpa); | |
| 1368 | copy.id = .keyword_pragma; | |
| 1369 | try pp.addToken(copy); | |
| 1370 | } | |
| 1371 | ||
| 1372 | const pragma_start: u32 = @intCast(pp.tokens.len); | |
| 1373 | for (args) |tok| { | |
| 1374 | switch (tok.id) { | |
| 1375 | .macro_ws, .comment => continue, | |
| 1376 | else => try pp.addToken(try tok.dupe(gpa)), | |
| 1377 | } | |
| 1378 | } | |
| 1379 | try pp.addToken(.{ .id = .nl, .loc = .{ .id = .generated } }); | |
| 1380 | ||
| 1381 | const name = pp.expandedSlice(pp.tokens.get(pragma_start)); | |
| 1382 | if (pp.comp.getPragma(name)) |prag| unknown: { | |
| 1383 | return prag.preprocessorCB(pp, pragma_start) catch |er| switch (er) { | |
| 1384 | error.UnknownPragma => break :unknown, | |
| 1385 | else => |e| return e, | |
| 1386 | }; | |
| 1387 | } | |
| 1388 | ||
| 1389 | try pp.err(args[0], .unknown_pragma, .{}); | |
| 1390 | } | |
| 1391 | ||
| 1275 | 1392 | /// Inverts the output of the preprocessor stringify (#) operation |
| 1276 | 1393 | /// (except all whitespace is condensed to a single space) |
| 1277 | 1394 | /// writes output to pp.char_buf; assumes capacity is sufficient |
| ... | ... | @@ -1298,7 +1415,8 @@ fn destringify(pp: *Preprocessor, str: []const u8) void { |
| 1298 | 1415 | /// Stringify `tokens` into pp.char_buf. |
| 1299 | 1416 | /// See https://gcc.gnu.org/onlinedocs/gcc-11.2.0/cpp/Stringizing.html#Stringizing |
| 1300 | 1417 | fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { |
| 1301 | try pp.char_buf.append('"'); | |
| 1418 | const gpa = pp.comp.gpa; | |
| 1419 | try pp.char_buf.append(gpa, '"'); | |
| 1302 | 1420 | var ws_state: enum { start, need, not_needed } = .start; |
| 1303 | 1421 | for (tokens) |tok| { |
| 1304 | 1422 | if (tok.id == .macro_ws) { |
| ... | ... | @@ -1306,7 +1424,7 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { |
| 1306 | 1424 | ws_state = .need; |
| 1307 | 1425 | continue; |
| 1308 | 1426 | } |
| 1309 | if (ws_state == .need) try pp.char_buf.append(' '); | |
| 1427 | if (ws_state == .need) try pp.char_buf.append(gpa, ' '); | |
| 1310 | 1428 | ws_state = .not_needed; |
| 1311 | 1429 | |
| 1312 | 1430 | // backslashes not inside strings are not escaped |
| ... | ... | @@ -1326,14 +1444,14 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { |
| 1326 | 1444 | |
| 1327 | 1445 | for (pp.expandedSlice(tok)) |c| { |
| 1328 | 1446 | if (c == '"') |
| 1329 | try pp.char_buf.appendSlice("\\\"") | |
| 1447 | try pp.char_buf.appendSlice(gpa, "\\\"") | |
| 1330 | 1448 | else if (c == '\\' and is_str) |
| 1331 | try pp.char_buf.appendSlice("\\\\") | |
| 1449 | try pp.char_buf.appendSlice(gpa, "\\\\") | |
| 1332 | 1450 | else |
| 1333 | try pp.char_buf.append(c); | |
| 1451 | try pp.char_buf.append(gpa, c); | |
| 1334 | 1452 | } |
| 1335 | 1453 | } |
| 1336 | try pp.char_buf.ensureUnusedCapacity(2); | |
| 1454 | try pp.char_buf.ensureUnusedCapacity(gpa, 2); | |
| 1337 | 1455 | if (pp.char_buf.items[pp.char_buf.items.len - 1] != '\\') { |
| 1338 | 1456 | pp.char_buf.appendSliceAssumeCapacity("\"\n"); |
| 1339 | 1457 | return; |
| ... | ... | @@ -1349,10 +1467,7 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { |
| 1349 | 1467 | const item = tokenizer.next(); |
| 1350 | 1468 | if (item.id == .unterminated_string_literal) { |
| 1351 | 1469 | const tok = tokens[tokens.len - 1]; |
| 1352 | try pp.comp.addDiagnostic(.{ | |
| 1353 | .tag = .invalid_pp_stringify_escape, | |
| 1354 | .loc = tok.loc, | |
| 1355 | }, tok.expansionSlice()); | |
| 1470 | try pp.err(tok, .invalid_pp_stringify_escape, .{}); | |
| 1356 | 1471 | pp.char_buf.items.len -= 2; // erase unpaired backslash and appended end quote |
| 1357 | 1472 | pp.char_buf.appendAssumeCapacity('"'); |
| 1358 | 1473 | } |
| ... | ... | @@ -1361,10 +1476,7 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { |
| 1361 | 1476 | |
| 1362 | 1477 | fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpansionLocs, embed_args: ?*[]const TokenWithExpansionLocs, first: TokenWithExpansionLocs) !?[]const u8 { |
| 1363 | 1478 | if (param_toks.len == 0) { |
| 1364 | try pp.comp.addDiagnostic(.{ | |
| 1365 | .tag = .expected_filename, | |
| 1366 | .loc = first.loc, | |
| 1367 | }, first.expansionSlice()); | |
| 1479 | try pp.err(first, .expected_filename, .{}); | |
| 1368 | 1480 | return null; |
| 1369 | 1481 | } |
| 1370 | 1482 | |
| ... | ... | @@ -1379,24 +1491,18 @@ fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpa |
| 1379 | 1491 | const params = param_toks[begin..end]; |
| 1380 | 1492 | |
| 1381 | 1493 | if (params.len == 0) { |
| 1382 | try pp.comp.addDiagnostic(.{ | |
| 1383 | .tag = .expected_filename, | |
| 1384 | .loc = first.loc, | |
| 1385 | }, first.expansionSlice()); | |
| 1494 | try pp.err(first, .expected_filename, .{}); | |
| 1386 | 1495 | return null; |
| 1387 | 1496 | } |
| 1388 | 1497 | // no string pasting |
| 1389 | 1498 | if (embed_args == null and params[0].id == .string_literal and params.len > 1) { |
| 1390 | try pp.comp.addDiagnostic(.{ | |
| 1391 | .tag = .closing_paren, | |
| 1392 | .loc = params[1].loc, | |
| 1393 | }, params[1].expansionSlice()); | |
| 1499 | try pp.err(params[1], .closing_paren, .{}); | |
| 1394 | 1500 | return null; |
| 1395 | 1501 | } |
| 1396 | 1502 | |
| 1397 | 1503 | for (params, 0..) |tok, i| { |
| 1398 | 1504 | const str = pp.expandedSliceExtra(tok, .preserve_macro_ws); |
| 1399 | try pp.char_buf.appendSlice(str); | |
| 1505 | try pp.char_buf.appendSlice(pp.comp.gpa, str); | |
| 1400 | 1506 | if (embed_args) |some| { |
| 1401 | 1507 | if ((i == 0 and tok.id == .string_literal) or tok.id == .angle_bracket_right) { |
| 1402 | 1508 | some.* = params[i + 1 ..]; |
| ... | ... | @@ -1408,16 +1514,10 @@ fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpa |
| 1408 | 1514 | const include_str = pp.char_buf.items[char_top..]; |
| 1409 | 1515 | if (include_str.len < 3) { |
| 1410 | 1516 | if (include_str.len == 0) { |
| 1411 | try pp.comp.addDiagnostic(.{ | |
| 1412 | .tag = .expected_filename, | |
| 1413 | .loc = first.loc, | |
| 1414 | }, first.expansionSlice()); | |
| 1517 | try pp.err(first, .expected_filename, .{}); | |
| 1415 | 1518 | return null; |
| 1416 | 1519 | } |
| 1417 | try pp.comp.addDiagnostic(.{ | |
| 1418 | .tag = .empty_filename, | |
| 1419 | .loc = params[0].loc, | |
| 1420 | }, params[0].expansionSlice()); | |
| 1520 | try pp.err(params[0], .empty_filename, .{}); | |
| 1421 | 1521 | return null; |
| 1422 | 1522 | } |
| 1423 | 1523 | |
| ... | ... | @@ -1425,25 +1525,18 @@ fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpa |
| 1425 | 1525 | '<' => { |
| 1426 | 1526 | if (include_str[include_str.len - 1] != '>') { |
| 1427 | 1527 | // Ugly hack to find out where the '>' should go, since we don't have the closing ')' location |
| 1428 | const start = params[0].loc; | |
| 1429 | try pp.comp.addDiagnostic(.{ | |
| 1430 | .tag = .header_str_closing, | |
| 1431 | .loc = .{ .id = start.id, .byte_offset = start.byte_offset + @as(u32, @intCast(include_str.len)) + 1, .line = start.line }, | |
| 1432 | }, params[0].expansionSlice()); | |
| 1433 | try pp.comp.addDiagnostic(.{ | |
| 1434 | .tag = .header_str_match, | |
| 1435 | .loc = params[0].loc, | |
| 1436 | }, params[0].expansionSlice()); | |
| 1528 | var closing = params[0]; | |
| 1529 | closing.loc.byte_offset += @as(u32, @intCast(include_str.len)) + 1; | |
| 1530 | try pp.err(closing, .header_str_closing, .{}); | |
| 1531 | ||
| 1532 | try pp.err(params[0], .header_str_match, .{}); | |
| 1437 | 1533 | return null; |
| 1438 | 1534 | } |
| 1439 | 1535 | return include_str; |
| 1440 | 1536 | }, |
| 1441 | 1537 | '"' => return include_str, |
| 1442 | 1538 | else => { |
| 1443 | try pp.comp.addDiagnostic(.{ | |
| 1444 | .tag = .expected_filename, | |
| 1445 | .loc = params[0].loc, | |
| 1446 | }, params[0].expansionSlice()); | |
| 1539 | try pp.err(params[0], .expected_filename, .{}); | |
| 1447 | 1540 | return null; |
| 1448 | 1541 | }, |
| 1449 | 1542 | } |
| ... | ... | @@ -1470,10 +1563,7 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con |
| 1470 | 1563 | } |
| 1471 | 1564 | if (identifier == null and invalid == null) invalid = .{ .id = .eof, .loc = src_loc }; |
| 1472 | 1565 | if (invalid) |some| { |
| 1473 | try pp.comp.addDiagnostic( | |
| 1474 | .{ .tag = .feature_check_requires_identifier, .loc = some.loc }, | |
| 1475 | some.expansionSlice(), | |
| 1476 | ); | |
| 1566 | try pp.err(some, .feature_check_requires_identifier, .{}); | |
| 1477 | 1567 | return false; |
| 1478 | 1568 | } |
| 1479 | 1569 | |
| ... | ... | @@ -1487,7 +1577,11 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con |
| 1487 | 1577 | false; |
| 1488 | 1578 | }, |
| 1489 | 1579 | .macro_param_has_feature => features.hasFeature(pp.comp, ident_str), |
| 1490 | .macro_param_has_extension => features.hasExtension(pp.comp, ident_str), | |
| 1580 | // If -pedantic-errors is given __has_extension is equivalent to __has_feature | |
| 1581 | .macro_param_has_extension => if (pp.comp.diagnostics.state.extensions == .@"error") | |
| 1582 | features.hasFeature(pp.comp, ident_str) | |
| 1583 | else | |
| 1584 | features.hasExtension(pp.comp, ident_str), | |
| 1491 | 1585 | .macro_param_has_builtin => pp.comp.hasBuiltin(ident_str), |
| 1492 | 1586 | else => unreachable, |
| 1493 | 1587 | }; |
| ... | ... | @@ -1495,13 +1589,13 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con |
| 1495 | 1589 | .macro_param_has_warning => { |
| 1496 | 1590 | const actual_param = pp.pasteStringsUnsafe(param_toks) catch |er| switch (er) { |
| 1497 | 1591 | error.ExpectedStringLiteral => { |
| 1498 | try pp.errStr(param_toks[0], .expected_str_literal_in, "__has_warning"); | |
| 1592 | try pp.err(param_toks[0], .expected_str_literal_in, .{"__has_warning"}); | |
| 1499 | 1593 | return false; |
| 1500 | 1594 | }, |
| 1501 | 1595 | else => |e| return e, |
| 1502 | 1596 | }; |
| 1503 | 1597 | if (!mem.startsWith(u8, actual_param, "-W")) { |
| 1504 | try pp.errStr(param_toks[0], .malformed_warning_check, "__has_warning"); | |
| 1598 | try pp.err(param_toks[0], .malformed_warning_check, .{"__has_warning"}); | |
| 1505 | 1599 | return false; |
| 1506 | 1600 | } |
| 1507 | 1601 | const warning_name = actual_param[2..]; |
| ... | ... | @@ -1519,11 +1613,7 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con |
| 1519 | 1613 | }; |
| 1520 | 1614 | if (identifier == null and invalid == null) invalid = .{ .id = .eof, .loc = src_loc }; |
| 1521 | 1615 | if (invalid) |some| { |
| 1522 | try pp.comp.addDiagnostic(.{ | |
| 1523 | .tag = .missing_tok_builtin, | |
| 1524 | .loc = some.loc, | |
| 1525 | .extra = .{ .tok_id_expected = .r_paren }, | |
| 1526 | }, some.expansionSlice()); | |
| 1616 | try pp.err(some, .builtin_missing_r_paren, .{"builtin feature-check macro"}); | |
| 1527 | 1617 | return false; |
| 1528 | 1618 | } |
| 1529 | 1619 | |
| ... | ... | @@ -1540,14 +1630,11 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con |
| 1540 | 1630 | const filename = include_str[1 .. include_str.len - 1]; |
| 1541 | 1631 | if (builtin == .macro_param_has_include or pp.include_depth == 0) { |
| 1542 | 1632 | if (builtin == .macro_param_has_include_next) { |
| 1543 | try pp.comp.addDiagnostic(.{ | |
| 1544 | .tag = .include_next_outside_header, | |
| 1545 | .loc = src_loc, | |
| 1546 | }, &.{}); | |
| 1633 | try pp.err(src_loc, .include_next_outside_header, .{}); | |
| 1547 | 1634 | } |
| 1548 | return pp.comp.hasInclude(filename, src_loc.id, include_type, .first); | |
| 1635 | return pp.comp.hasInclude(filename, src_loc.id, include_type, .first, pp.dep_file); | |
| 1549 | 1636 | } |
| 1550 | return pp.comp.hasInclude(filename, src_loc.id, include_type, .next); | |
| 1637 | return pp.comp.hasInclude(filename, src_loc.id, include_type, .next, pp.dep_file); | |
| 1551 | 1638 | }, |
| 1552 | 1639 | else => unreachable, |
| 1553 | 1640 | } |
| ... | ... | @@ -1572,25 +1659,26 @@ fn expandFuncMacro( |
| 1572 | 1659 | expanded_args: *const MacroArguments, |
| 1573 | 1660 | hideset_arg: Hideset.Index, |
| 1574 | 1661 | ) MacroError!ExpandBuf { |
| 1662 | const gpa = pp.comp.gpa; | |
| 1575 | 1663 | var hideset = hideset_arg; |
| 1576 | var buf = ExpandBuf.init(pp.gpa); | |
| 1577 | try buf.ensureTotalCapacity(func_macro.tokens.len); | |
| 1578 | errdefer buf.deinit(); | |
| 1664 | var buf: ExpandBuf = .empty; | |
| 1665 | errdefer buf.deinit(gpa); | |
| 1666 | try buf.ensureTotalCapacity(gpa, func_macro.tokens.len); | |
| 1579 | 1667 | |
| 1580 | var expanded_variable_arguments = ExpandBuf.init(pp.gpa); | |
| 1581 | defer expanded_variable_arguments.deinit(); | |
| 1582 | var variable_arguments = ExpandBuf.init(pp.gpa); | |
| 1583 | defer variable_arguments.deinit(); | |
| 1668 | var expanded_variable_arguments: ExpandBuf = .empty; | |
| 1669 | defer expanded_variable_arguments.deinit(gpa); | |
| 1670 | var variable_arguments: ExpandBuf = .empty; | |
| 1671 | defer variable_arguments.deinit(gpa); | |
| 1584 | 1672 | |
| 1585 | 1673 | if (func_macro.var_args) { |
| 1586 | 1674 | var i: usize = func_macro.params.len; |
| 1587 | 1675 | while (i < expanded_args.items.len) : (i += 1) { |
| 1588 | try variable_arguments.appendSlice(args.items[i]); | |
| 1589 | try expanded_variable_arguments.appendSlice(expanded_args.items[i]); | |
| 1676 | try variable_arguments.appendSlice(gpa, args.items[i]); | |
| 1677 | try expanded_variable_arguments.appendSlice(gpa, expanded_args.items[i]); | |
| 1590 | 1678 | if (i != expanded_args.items.len - 1) { |
| 1591 | const comma = TokenWithExpansionLocs{ .id = .comma, .loc = .{ .id = .generated } }; | |
| 1592 | try variable_arguments.append(comma); | |
| 1593 | try expanded_variable_arguments.append(comma); | |
| 1679 | const comma: TokenWithExpansionLocs = .{ .id = .comma, .loc = .{ .id = .generated } }; | |
| 1680 | try variable_arguments.append(gpa, comma); | |
| 1681 | try expanded_variable_arguments.append(gpa, comma); | |
| 1594 | 1682 | } |
| 1595 | 1683 | } |
| 1596 | 1684 | } |
| ... | ... | @@ -1604,8 +1692,8 @@ fn expandFuncMacro( |
| 1604 | 1692 | const raw_next = func_macro.tokens[tok_i + 1]; |
| 1605 | 1693 | tok_i += 1; |
| 1606 | 1694 | |
| 1607 | var va_opt_buf = ExpandBuf.init(pp.gpa); | |
| 1608 | defer va_opt_buf.deinit(); | |
| 1695 | var va_opt_buf: ExpandBuf = .empty; | |
| 1696 | defer va_opt_buf.deinit(gpa); | |
| 1609 | 1697 | |
| 1610 | 1698 | const next = switch (raw_next.id) { |
| 1611 | 1699 | .macro_ws => continue, |
| ... | ... | @@ -1615,7 +1703,10 @@ fn expandFuncMacro( |
| 1615 | 1703 | else |
| 1616 | 1704 | &[1]TokenWithExpansionLocs{tokFromRaw(raw_next)}, |
| 1617 | 1705 | .macro_param, .macro_param_no_expand => getPasteArgs(args.items[raw_next.end]), |
| 1618 | .keyword_va_args => variable_arguments.items, | |
| 1706 | .keyword_va_args => if (variable_arguments.items.len == 0) blk: { | |
| 1707 | try pp.err(raw_next, .no_argument_variadic_macro, .{}); | |
| 1708 | break :blk &[1]TokenWithExpansionLocs{.{ .id = .placemarker, .loc = .{ .id = .generated } }}; | |
| 1709 | } else variable_arguments.items, | |
| 1619 | 1710 | .keyword_va_opt => blk: { |
| 1620 | 1711 | try pp.expandVaOpt(&va_opt_buf, raw_next, variable_arguments.items.len != 0); |
| 1621 | 1712 | if (va_opt_buf.items.len == 0) break; |
| ... | ... | @@ -1632,7 +1723,7 @@ fn expandFuncMacro( |
| 1632 | 1723 | } |
| 1633 | 1724 | const slice = getPasteArgs(args.items[raw.end]); |
| 1634 | 1725 | const raw_loc = Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line }; |
| 1635 | try bufCopyTokens(&buf, slice, &.{raw_loc}); | |
| 1726 | try bufCopyTokens(gpa, &buf, slice, &.{raw_loc}); | |
| 1636 | 1727 | }, |
| 1637 | 1728 | .macro_param => { |
| 1638 | 1729 | if (tok_i + 1 < func_macro.tokens.len and func_macro.tokens[tok_i + 1].id == .hash_hash) { |
| ... | ... | @@ -1640,11 +1731,11 @@ fn expandFuncMacro( |
| 1640 | 1731 | } |
| 1641 | 1732 | const arg = expanded_args.items[raw.end]; |
| 1642 | 1733 | const raw_loc = Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line }; |
| 1643 | try bufCopyTokens(&buf, arg, &.{raw_loc}); | |
| 1734 | try bufCopyTokens(gpa, &buf, arg, &.{raw_loc}); | |
| 1644 | 1735 | }, |
| 1645 | 1736 | .keyword_va_args => { |
| 1646 | 1737 | const raw_loc = Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line }; |
| 1647 | try bufCopyTokens(&buf, expanded_variable_arguments.items, &.{raw_loc}); | |
| 1738 | try bufCopyTokens(gpa, &buf, expanded_variable_arguments.items, &.{raw_loc}); | |
| 1648 | 1739 | }, |
| 1649 | 1740 | .keyword_va_opt => { |
| 1650 | 1741 | try pp.expandVaOpt(&buf, raw, variable_arguments.items.len != 0); |
| ... | ... | @@ -1659,9 +1750,9 @@ fn expandFuncMacro( |
| 1659 | 1750 | try pp.stringify(arg); |
| 1660 | 1751 | |
| 1661 | 1752 | const start = pp.comp.generated_buf.items.len; |
| 1662 | try pp.comp.generated_buf.appendSlice(pp.gpa, pp.char_buf.items); | |
| 1753 | try pp.comp.generated_buf.appendSlice(gpa, pp.char_buf.items); | |
| 1663 | 1754 | |
| 1664 | try buf.append(try pp.makeGeneratedToken(start, .string_literal, tokFromRaw(raw))); | |
| 1755 | try buf.append(gpa, try pp.makeGeneratedToken(start, .string_literal, tokFromRaw(raw))); | |
| 1665 | 1756 | }, |
| 1666 | 1757 | .macro_param_has_attribute, |
| 1667 | 1758 | .macro_param_has_declspec_attribute, |
| ... | ... | @@ -1675,20 +1766,19 @@ fn expandFuncMacro( |
| 1675 | 1766 | => { |
| 1676 | 1767 | const arg = expanded_args.items[0]; |
| 1677 | 1768 | const result = if (arg.len == 0) blk: { |
| 1678 | const extra = Diagnostics.Message.Extra{ .arguments = .{ .expected = 1, .actual = 0 } }; | |
| 1679 | try pp.comp.addDiagnostic(.{ .tag = .expected_arguments, .loc = macro_tok.loc, .extra = extra }, &.{}); | |
| 1769 | try pp.err(macro_tok, .expected_arguments, .{ 1, 0 }); | |
| 1680 | 1770 | break :blk false; |
| 1681 | 1771 | } else try pp.handleBuiltinMacro(raw.id, arg, macro_tok.loc); |
| 1682 | 1772 | const start = pp.comp.generated_buf.items.len; |
| 1683 | try pp.comp.generated_buf.print(pp.gpa, "{}\n", .{@intFromBool(result)}); | |
| 1684 | try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1773 | ||
| 1774 | try pp.comp.generated_buf.print(gpa, "{}\n", .{@intFromBool(result)}); | |
| 1775 | try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1685 | 1776 | }, |
| 1686 | 1777 | .macro_param_has_c_attribute => { |
| 1687 | 1778 | const arg = expanded_args.items[0]; |
| 1688 | 1779 | const not_found = "0\n"; |
| 1689 | 1780 | const result = if (arg.len == 0) blk: { |
| 1690 | const extra = Diagnostics.Message.Extra{ .arguments = .{ .expected = 1, .actual = 0 } }; | |
| 1691 | try pp.comp.addDiagnostic(.{ .tag = .expected_arguments, .loc = macro_tok.loc, .extra = extra }, &.{}); | |
| 1781 | try pp.err(macro_tok, .expected_arguments, .{ 1, 0 }); | |
| 1692 | 1782 | break :blk not_found; |
| 1693 | 1783 | } else res: { |
| 1694 | 1784 | var invalid: ?TokenWithExpansionLocs = null; |
| ... | ... | @@ -1723,10 +1813,7 @@ fn expandFuncMacro( |
| 1723 | 1813 | invalid = .{ .id = .eof, .loc = macro_tok.loc }; |
| 1724 | 1814 | } |
| 1725 | 1815 | if (invalid) |some| { |
| 1726 | try pp.comp.addDiagnostic( | |
| 1727 | .{ .tag = .feature_check_requires_identifier, .loc = some.loc }, | |
| 1728 | some.expansionSlice(), | |
| 1729 | ); | |
| 1816 | try pp.err(some, .feature_check_requires_identifier, .{}); | |
| 1730 | 1817 | break :res not_found; |
| 1731 | 1818 | } |
| 1732 | 1819 | if (vendor_ident) |some| { |
| ... | ... | @@ -1735,8 +1822,8 @@ fn expandFuncMacro( |
| 1735 | 1822 | const exists = Attribute.fromString(.gnu, vendor_str, attr_str) != null; |
| 1736 | 1823 | |
| 1737 | 1824 | const start = pp.comp.generated_buf.items.len; |
| 1738 | try pp.comp.generated_buf.appendSlice(pp.gpa, if (exists) "1\n" else "0\n"); | |
| 1739 | try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1825 | try pp.comp.generated_buf.appendSlice(gpa, if (exists) "1\n" else "0\n"); | |
| 1826 | try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1740 | 1827 | continue; |
| 1741 | 1828 | } |
| 1742 | 1829 | if (!pp.comp.langopts.standard.atLeast(.c23)) break :res not_found; |
| ... | ... | @@ -1756,15 +1843,14 @@ fn expandFuncMacro( |
| 1756 | 1843 | break :res attrs.get(attr_str) orelse not_found; |
| 1757 | 1844 | }; |
| 1758 | 1845 | const start = pp.comp.generated_buf.items.len; |
| 1759 | try pp.comp.generated_buf.appendSlice(pp.gpa, result); | |
| 1760 | try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1846 | try pp.comp.generated_buf.appendSlice(gpa, result); | |
| 1847 | try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1761 | 1848 | }, |
| 1762 | 1849 | .macro_param_has_embed => { |
| 1763 | 1850 | const arg = expanded_args.items[0]; |
| 1764 | 1851 | const not_found = "0\n"; |
| 1765 | 1852 | const result = if (arg.len == 0) blk: { |
| 1766 | const extra = Diagnostics.Message.Extra{ .arguments = .{ .expected = 1, .actual = 0 } }; | |
| 1767 | try pp.comp.addDiagnostic(.{ .tag = .expected_arguments, .loc = macro_tok.loc, .extra = extra }, &.{}); | |
| 1853 | try pp.err(macro_tok, .expected_arguments, .{ 1, 0 }); | |
| 1768 | 1854 | break :blk not_found; |
| 1769 | 1855 | } else res: { |
| 1770 | 1856 | var embed_args: []const TokenWithExpansionLocs = &.{}; |
| ... | ... | @@ -1793,10 +1879,7 @@ fn expandFuncMacro( |
| 1793 | 1879 | const param_first = it.next(); |
| 1794 | 1880 | if (param_first.id == .eof) break; |
| 1795 | 1881 | if (param_first.id != .identifier) { |
| 1796 | try pp.comp.addDiagnostic( | |
| 1797 | .{ .tag = .malformed_embed_param, .loc = param_first.loc }, | |
| 1798 | param_first.expansionSlice(), | |
| 1799 | ); | |
| 1882 | try pp.err(param_first, .malformed_embed_param, .{}); | |
| 1800 | 1883 | continue; |
| 1801 | 1884 | } |
| 1802 | 1885 | |
| ... | ... | @@ -1809,28 +1892,19 @@ fn expandFuncMacro( |
| 1809 | 1892 | // vendor::param |
| 1810 | 1893 | const param = it.next(); |
| 1811 | 1894 | if (param.id != .identifier) { |
| 1812 | try pp.comp.addDiagnostic( | |
| 1813 | .{ .tag = .malformed_embed_param, .loc = param.loc }, | |
| 1814 | param.expansionSlice(), | |
| 1815 | ); | |
| 1895 | try pp.err(param, .malformed_embed_param, .{}); | |
| 1816 | 1896 | continue; |
| 1817 | 1897 | } |
| 1818 | 1898 | const l_paren = it.next(); |
| 1819 | 1899 | if (l_paren.id != .l_paren) { |
| 1820 | try pp.comp.addDiagnostic( | |
| 1821 | .{ .tag = .malformed_embed_param, .loc = l_paren.loc }, | |
| 1822 | l_paren.expansionSlice(), | |
| 1823 | ); | |
| 1900 | try pp.err(l_paren, .malformed_embed_param, .{}); | |
| 1824 | 1901 | continue; |
| 1825 | 1902 | } |
| 1826 | 1903 | break :blk "doesn't exist"; |
| 1827 | 1904 | }, |
| 1828 | 1905 | .l_paren => Attribute.normalize(pp.expandedSlice(param_first)), |
| 1829 | 1906 | else => { |
| 1830 | try pp.comp.addDiagnostic( | |
| 1831 | .{ .tag = .malformed_embed_param, .loc = maybe_colon.loc }, | |
| 1832 | maybe_colon.expansionSlice(), | |
| 1833 | ); | |
| 1907 | try pp.err(maybe_colon, .malformed_embed_param, .{}); | |
| 1834 | 1908 | continue; |
| 1835 | 1909 | }, |
| 1836 | 1910 | }; |
| ... | ... | @@ -1840,10 +1914,7 @@ fn expandFuncMacro( |
| 1840 | 1914 | while (true) { |
| 1841 | 1915 | const next = it.next(); |
| 1842 | 1916 | if (next.id == .eof) { |
| 1843 | try pp.comp.addDiagnostic( | |
| 1844 | .{ .tag = .malformed_embed_limit, .loc = param_first.loc }, | |
| 1845 | param_first.expansionSlice(), | |
| 1846 | ); | |
| 1917 | try pp.err(param_first, .malformed_embed_limit, .{}); | |
| 1847 | 1918 | break; |
| 1848 | 1919 | } |
| 1849 | 1920 | if (next.id == .r_paren) break; |
| ... | ... | @@ -1853,17 +1924,11 @@ fn expandFuncMacro( |
| 1853 | 1924 | |
| 1854 | 1925 | if (std.mem.eql(u8, param, "limit")) { |
| 1855 | 1926 | if (arg_count != 1) { |
| 1856 | try pp.comp.addDiagnostic( | |
| 1857 | .{ .tag = .malformed_embed_limit, .loc = param_first.loc }, | |
| 1858 | param_first.expansionSlice(), | |
| 1859 | ); | |
| 1927 | try pp.err(param_first, .malformed_embed_limit, .{}); | |
| 1860 | 1928 | continue; |
| 1861 | 1929 | } |
| 1862 | 1930 | if (first_arg.id != .pp_num) { |
| 1863 | try pp.comp.addDiagnostic( | |
| 1864 | .{ .tag = .malformed_embed_limit, .loc = param_first.loc }, | |
| 1865 | param_first.expansionSlice(), | |
| 1866 | ); | |
| 1931 | try pp.err(param_first, .malformed_embed_limit, .{}); | |
| 1867 | 1932 | continue; |
| 1868 | 1933 | } |
| 1869 | 1934 | _ = std.fmt.parseInt(u32, pp.expandedSlice(first_arg), 10) catch { |
| ... | ... | @@ -1882,39 +1947,73 @@ fn expandFuncMacro( |
| 1882 | 1947 | else => unreachable, |
| 1883 | 1948 | }; |
| 1884 | 1949 | const filename = include_str[1 .. include_str.len - 1]; |
| 1885 | const contents = (try pp.comp.findEmbed(filename, arg[0].loc.id, include_type, 1)) orelse | |
| 1950 | const contents = (try pp.comp.findEmbed(filename, arg[0].loc.id, include_type, .limited(1), pp.dep_file)) orelse | |
| 1886 | 1951 | break :res not_found; |
| 1887 | 1952 | |
| 1888 | defer pp.comp.gpa.free(contents); | |
| 1953 | defer gpa.free(contents); | |
| 1889 | 1954 | break :res if (contents.len != 0) "1\n" else "2\n"; |
| 1890 | 1955 | }; |
| 1891 | 1956 | const start = pp.comp.generated_buf.items.len; |
| 1892 | try pp.comp.generated_buf.appendSlice(pp.comp.gpa, result); | |
| 1893 | try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1957 | try pp.comp.generated_buf.appendSlice(gpa, result); | |
| 1958 | try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); | |
| 1894 | 1959 | }, |
| 1895 | 1960 | .macro_param_pragma_operator => { |
| 1896 | const param_toks = expanded_args.items[0]; | |
| 1897 | 1961 | // Clang and GCC require exactly one token (so, no parentheses or string pasting) |
| 1898 | 1962 | // even though their error messages indicate otherwise. Ours is slightly more |
| 1899 | 1963 | // descriptive. |
| 1900 | 1964 | var invalid: ?TokenWithExpansionLocs = null; |
| 1901 | 1965 | var string: ?TokenWithExpansionLocs = null; |
| 1902 | for (param_toks) |tok| switch (tok.id) { | |
| 1903 | .string_literal => { | |
| 1904 | if (string) |_| invalid = tok else string = tok; | |
| 1905 | }, | |
| 1906 | .macro_ws => continue, | |
| 1907 | .comment => continue, | |
| 1908 | else => { | |
| 1909 | invalid = tok; | |
| 1910 | break; | |
| 1911 | }, | |
| 1912 | }; | |
| 1913 | if (string == null and invalid == null) invalid = .{ .loc = macro_tok.loc, .id = .eof }; | |
| 1914 | if (invalid) |some| try pp.comp.addDiagnostic( | |
| 1915 | .{ .tag = .pragma_operator_string_literal, .loc = some.loc }, | |
| 1916 | some.expansionSlice(), | |
| 1917 | ) else try pp.pragmaOperator(string.?, macro_tok.loc); | |
| 1966 | for (expanded_args.items[0]) |tok| { | |
| 1967 | switch (tok.id) { | |
| 1968 | .string_literal => { | |
| 1969 | if (string) |_| { | |
| 1970 | invalid = tok; | |
| 1971 | break; | |
| 1972 | } | |
| 1973 | string = tok; | |
| 1974 | }, | |
| 1975 | .macro_ws => continue, | |
| 1976 | .comment => continue, | |
| 1977 | else => { | |
| 1978 | invalid = tok; | |
| 1979 | break; | |
| 1980 | }, | |
| 1981 | } | |
| 1982 | } | |
| 1983 | if (string == null and invalid == null) invalid = macro_tok; | |
| 1984 | if (invalid) |some| | |
| 1985 | try pp.err(some, .pragma_operator_string_literal, .{}) | |
| 1986 | else | |
| 1987 | try pp.pragmaOperator(string.?, macro_tok.loc); | |
| 1988 | }, | |
| 1989 | .macro_param_ms_identifier => blk: { | |
| 1990 | // Expect '__identifier' '(' macro-identifier ')' | |
| 1991 | var ident: ?TokenWithExpansionLocs = null; | |
| 1992 | for (expanded_args.items[0]) |tok| { | |
| 1993 | switch (tok.id) { | |
| 1994 | .macro_ws => continue, | |
| 1995 | .comment => continue, | |
| 1996 | else => {}, | |
| 1997 | } | |
| 1998 | if (ident) |_| { | |
| 1999 | try pp.err(tok, .builtin_missing_r_paren, .{"identifier"}); | |
| 2000 | break :blk; | |
| 2001 | } else if (tok.id.isMacroIdentifier()) { | |
| 2002 | ident = tok; | |
| 2003 | } else { | |
| 2004 | try pp.err(tok, .cannot_convert_to_identifier, .{tok.id.symbol()}); | |
| 2005 | break :blk; | |
| 2006 | } | |
| 2007 | } | |
| 2008 | if (ident) |*some| { | |
| 2009 | some.id = .identifier; | |
| 2010 | try buf.append(gpa, some.*); | |
| 2011 | } else { | |
| 2012 | try pp.err(macro_tok, .expected_identifier, .{}); | |
| 2013 | } | |
| 2014 | }, | |
| 2015 | .macro_param_ms_pragma => { | |
| 2016 | try pp.msPragmaOperator(macro_tok, expanded_args.items[0]); | |
| 1918 | 2017 | }, |
| 1919 | 2018 | .comma => { |
| 1920 | 2019 | if (tok_i + 2 < func_macro.tokens.len and func_macro.tokens[tok_i + 1].id == .hash_hash) { |
| ... | ... | @@ -1930,43 +2029,43 @@ fn expandFuncMacro( |
| 1930 | 2029 | tok_i += consumed; |
| 1931 | 2030 | if (func_macro.params.len == expanded_args.items.len) { |
| 1932 | 2031 | // Empty __VA_ARGS__, drop the comma |
| 1933 | try pp.err(hash_hash, .comma_deletion_va_args); | |
| 2032 | try pp.err(hash_hash, .comma_deletion_va_args, .{}); | |
| 1934 | 2033 | } else if (func_macro.params.len == 0 and expanded_args.items.len == 1 and expanded_args.items[0].len == 0) { |
| 1935 | 2034 | // Ambiguous whether this is "empty __VA_ARGS__" or "__VA_ARGS__ omitted" |
| 1936 | 2035 | if (pp.comp.langopts.standard.isGNU()) { |
| 1937 | 2036 | // GNU standard, drop the comma |
| 1938 | try pp.err(hash_hash, .comma_deletion_va_args); | |
| 2037 | try pp.err(hash_hash, .comma_deletion_va_args, .{}); | |
| 1939 | 2038 | } else { |
| 1940 | 2039 | // C standard, retain the comma |
| 1941 | try buf.append(tokFromRaw(raw)); | |
| 2040 | try buf.append(gpa, tokFromRaw(raw)); | |
| 1942 | 2041 | } |
| 1943 | 2042 | } else { |
| 1944 | try buf.append(tokFromRaw(raw)); | |
| 2043 | try buf.append(gpa, tokFromRaw(raw)); | |
| 1945 | 2044 | if (expanded_variable_arguments.items.len > 0 or variable_arguments.items.len == func_macro.params.len) { |
| 1946 | try pp.err(hash_hash, .comma_deletion_va_args); | |
| 2045 | try pp.err(hash_hash, .comma_deletion_va_args, .{}); | |
| 1947 | 2046 | } |
| 1948 | 2047 | const raw_loc = Source.Location{ |
| 1949 | 2048 | .id = maybe_va_args.source, |
| 1950 | 2049 | .byte_offset = maybe_va_args.start, |
| 1951 | 2050 | .line = maybe_va_args.line, |
| 1952 | 2051 | }; |
| 1953 | try bufCopyTokens(&buf, expanded_variable_arguments.items, &.{raw_loc}); | |
| 2052 | try bufCopyTokens(gpa, &buf, expanded_variable_arguments.items, &.{raw_loc}); | |
| 1954 | 2053 | } |
| 1955 | 2054 | continue; |
| 1956 | 2055 | } |
| 1957 | 2056 | } |
| 1958 | 2057 | // Regular comma, no token pasting with __VA_ARGS__ |
| 1959 | try buf.append(tokFromRaw(raw)); | |
| 2058 | try buf.append(gpa, tokFromRaw(raw)); | |
| 1960 | 2059 | }, |
| 1961 | else => try buf.append(tokFromRaw(raw)), | |
| 2060 | else => try buf.append(gpa, tokFromRaw(raw)), | |
| 1962 | 2061 | } |
| 1963 | 2062 | } |
| 1964 | removePlacemarkers(&buf); | |
| 2063 | removePlacemarkers(gpa, &buf); | |
| 1965 | 2064 | |
| 1966 | 2065 | const macro_expansion_locs = macro_tok.expansionSlice(); |
| 1967 | 2066 | for (buf.items) |*tok| { |
| 1968 | try tok.addExpansionLocation(pp.gpa, &.{macro_tok.loc}); | |
| 1969 | try tok.addExpansionLocation(pp.gpa, macro_expansion_locs); | |
| 2067 | try tok.addExpansionLocation(gpa, &.{macro_tok.loc}); | |
| 2068 | try tok.addExpansionLocation(gpa, macro_expansion_locs); | |
| 1970 | 2069 | const tok_hidelist = pp.hideset.get(tok.loc); |
| 1971 | 2070 | const new_hidelist = try pp.hideset.@"union"(tok_hidelist, hideset); |
| 1972 | 2071 | try pp.hideset.put(tok.loc, new_hidelist); |
| ... | ... | @@ -1993,16 +2092,16 @@ fn expandVaOpt( |
| 1993 | 2092 | }; |
| 1994 | 2093 | while (tokenizer.index < raw.end) { |
| 1995 | 2094 | const tok = tokenizer.next(); |
| 1996 | try buf.append(tokFromRaw(tok)); | |
| 2095 | try buf.append(pp.comp.gpa, tokFromRaw(tok)); | |
| 1997 | 2096 | } |
| 1998 | 2097 | } |
| 1999 | 2098 | |
| 2000 | fn bufCopyTokens(buf: *ExpandBuf, tokens: []const TokenWithExpansionLocs, src: []const Source.Location) !void { | |
| 2001 | try buf.ensureUnusedCapacity(tokens.len); | |
| 2099 | fn bufCopyTokens(gpa: Allocator, buf: *ExpandBuf, tokens: []const TokenWithExpansionLocs, src: []const Source.Location) !void { | |
| 2100 | try buf.ensureUnusedCapacity(gpa, tokens.len); | |
| 2002 | 2101 | for (tokens) |tok| { |
| 2003 | var copy = try tok.dupe(buf.allocator); | |
| 2004 | errdefer TokenWithExpansionLocs.free(copy.expansion_locs, buf.allocator); | |
| 2005 | try copy.addExpansionLocation(buf.allocator, src); | |
| 2102 | var copy = try tok.dupe(gpa); | |
| 2103 | errdefer TokenWithExpansionLocs.free(copy.expansion_locs, gpa); | |
| 2104 | try copy.addExpansionLocation(gpa, src); | |
| 2006 | 2105 | buf.appendAssumeCapacity(copy); |
| 2007 | 2106 | } |
| 2008 | 2107 | } |
| ... | ... | @@ -2021,16 +2120,16 @@ fn nextBufToken( |
| 2021 | 2120 | const raw_tok = tokenizer.next(); |
| 2022 | 2121 | if (raw_tok.id.isMacroIdentifier() and |
| 2023 | 2122 | pp.poisoned_identifiers.get(pp.tokSlice(raw_tok)) != null) |
| 2024 | try pp.err(raw_tok, .poisoned_identifier); | |
| 2123 | try pp.err(raw_tok, .poisoned_identifier, .{}); | |
| 2025 | 2124 | |
| 2026 | 2125 | if (raw_tok.id == .nl) pp.add_expansion_nl += 1; |
| 2027 | 2126 | |
| 2028 | 2127 | const new_tok = tokFromRaw(raw_tok); |
| 2029 | 2128 | end_idx.* += 1; |
| 2030 | try buf.append(new_tok); | |
| 2129 | try buf.append(pp.comp.gpa, new_tok); | |
| 2031 | 2130 | return new_tok; |
| 2032 | 2131 | } else { |
| 2033 | return TokenWithExpansionLocs{ .id = .eof, .loc = .{ .id = .generated } }; | |
| 2132 | return .{ .id = .eof, .loc = .{ .id = .generated } }; | |
| 2034 | 2133 | } |
| 2035 | 2134 | } else { |
| 2036 | 2135 | return buf.items[start_idx.*]; |
| ... | ... | @@ -2047,6 +2146,7 @@ fn collectMacroFuncArguments( |
| 2047 | 2146 | is_builtin: bool, |
| 2048 | 2147 | r_paren: *TokenWithExpansionLocs, |
| 2049 | 2148 | ) !MacroArguments { |
| 2149 | const gpa = pp.comp.gpa; | |
| 2050 | 2150 | const name_tok = buf.items[start_idx.*]; |
| 2051 | 2151 | const saved_tokenizer = tokenizer.*; |
| 2052 | 2152 | const old_end = end_idx.*; |
| ... | ... | @@ -2058,7 +2158,7 @@ fn collectMacroFuncArguments( |
| 2058 | 2158 | .l_paren => break, |
| 2059 | 2159 | else => { |
| 2060 | 2160 | if (is_builtin) { |
| 2061 | try pp.errStr(name_tok, .missing_lparen_after_builtin, pp.expandedSlice(name_tok)); | |
| 2161 | try pp.err(name_tok, .missing_lparen_after_builtin, .{pp.expandedSlice(name_tok)}); | |
| 2062 | 2162 | } |
| 2063 | 2163 | // Not a macro function call, go over normal identifier, rewind |
| 2064 | 2164 | tokenizer.* = saved_tokenizer; |
| ... | ... | @@ -2070,65 +2170,62 @@ fn collectMacroFuncArguments( |
| 2070 | 2170 | |
| 2071 | 2171 | // collect the arguments. |
| 2072 | 2172 | var parens: u32 = 0; |
| 2073 | var args = MacroArguments.init(pp.gpa); | |
| 2074 | errdefer deinitMacroArguments(pp.gpa, &args); | |
| 2075 | var curArgument = std.array_list.Managed(TokenWithExpansionLocs).init(pp.gpa); | |
| 2076 | defer curArgument.deinit(); | |
| 2173 | var args: MacroArguments = .empty; | |
| 2174 | errdefer deinitMacroArguments(gpa, &args); | |
| 2175 | var cur_argument: std.ArrayList(TokenWithExpansionLocs) = .empty; | |
| 2176 | defer cur_argument.deinit(gpa); | |
| 2077 | 2177 | while (true) { |
| 2078 | 2178 | var tok = try nextBufToken(pp, tokenizer, buf, start_idx, end_idx, extend_buf); |
| 2079 | 2179 | tok.flags.is_macro_arg = true; |
| 2080 | 2180 | switch (tok.id) { |
| 2081 | 2181 | .comma => { |
| 2082 | 2182 | if (parens == 0) { |
| 2083 | const owned = try curArgument.toOwnedSlice(); | |
| 2084 | errdefer pp.gpa.free(owned); | |
| 2085 | try args.append(owned); | |
| 2183 | const owned = try cur_argument.toOwnedSlice(gpa); | |
| 2184 | errdefer gpa.free(owned); | |
| 2185 | try args.append(gpa, owned); | |
| 2086 | 2186 | } else { |
| 2087 | const duped = try tok.dupe(pp.gpa); | |
| 2088 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); | |
| 2089 | try curArgument.append(duped); | |
| 2187 | const duped = try tok.dupe(gpa); | |
| 2188 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); | |
| 2189 | try cur_argument.append(gpa, duped); | |
| 2090 | 2190 | } |
| 2091 | 2191 | }, |
| 2092 | 2192 | .l_paren => { |
| 2093 | const duped = try tok.dupe(pp.gpa); | |
| 2094 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); | |
| 2095 | try curArgument.append(duped); | |
| 2193 | const duped = try tok.dupe(gpa); | |
| 2194 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); | |
| 2195 | try cur_argument.append(gpa, duped); | |
| 2096 | 2196 | parens += 1; |
| 2097 | 2197 | }, |
| 2098 | 2198 | .r_paren => { |
| 2099 | 2199 | if (parens == 0) { |
| 2100 | const owned = try curArgument.toOwnedSlice(); | |
| 2101 | errdefer pp.gpa.free(owned); | |
| 2102 | try args.append(owned); | |
| 2200 | const owned = try cur_argument.toOwnedSlice(gpa); | |
| 2201 | errdefer gpa.free(owned); | |
| 2202 | try args.append(gpa, owned); | |
| 2103 | 2203 | r_paren.* = tok; |
| 2104 | 2204 | break; |
| 2105 | 2205 | } else { |
| 2106 | const duped = try tok.dupe(pp.gpa); | |
| 2107 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); | |
| 2108 | try curArgument.append(duped); | |
| 2206 | const duped = try tok.dupe(gpa); | |
| 2207 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); | |
| 2208 | try cur_argument.append(gpa, duped); | |
| 2109 | 2209 | parens -= 1; |
| 2110 | 2210 | } |
| 2111 | 2211 | }, |
| 2112 | 2212 | .eof => { |
| 2113 | 2213 | { |
| 2114 | const owned = try curArgument.toOwnedSlice(); | |
| 2115 | errdefer pp.gpa.free(owned); | |
| 2116 | try args.append(owned); | |
| 2214 | const owned = try cur_argument.toOwnedSlice(gpa); | |
| 2215 | errdefer gpa.free(owned); | |
| 2216 | try args.append(gpa, owned); | |
| 2117 | 2217 | } |
| 2118 | 2218 | tokenizer.* = saved_tokenizer; |
| 2119 | try pp.comp.addDiagnostic( | |
| 2120 | .{ .tag = .unterminated_macro_arg_list, .loc = name_tok.loc }, | |
| 2121 | name_tok.expansionSlice(), | |
| 2122 | ); | |
| 2219 | try pp.err(name_tok, .unterminated_macro_arg_list, .{}); | |
| 2123 | 2220 | return error.Unterminated; |
| 2124 | 2221 | }, |
| 2125 | 2222 | .nl, .whitespace => { |
| 2126 | try curArgument.append(.{ .id = .macro_ws, .loc = tok.loc }); | |
| 2223 | try cur_argument.append(gpa, .{ .id = .macro_ws, .loc = tok.loc }); | |
| 2127 | 2224 | }, |
| 2128 | 2225 | else => { |
| 2129 | const duped = try tok.dupe(pp.gpa); | |
| 2130 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); | |
| 2131 | try curArgument.append(duped); | |
| 2226 | const duped = try tok.dupe(gpa); | |
| 2227 | errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); | |
| 2228 | try cur_argument.append(gpa, duped); | |
| 2132 | 2229 | }, |
| 2133 | 2230 | } |
| 2134 | 2231 | } |
| ... | ... | @@ -2137,8 +2234,9 @@ fn collectMacroFuncArguments( |
| 2137 | 2234 | } |
| 2138 | 2235 | |
| 2139 | 2236 | fn removeExpandedTokens(pp: *Preprocessor, buf: *ExpandBuf, start: usize, len: usize, moving_end_idx: *usize) !void { |
| 2140 | for (buf.items[start .. start + len]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 2141 | try buf.replaceRange(start, len, &.{}); | |
| 2237 | const gpa = pp.comp.gpa; | |
| 2238 | for (buf.items[start .. start + len]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2239 | try buf.replaceRange(gpa, start, len, &.{}); | |
| 2142 | 2240 | moving_end_idx.* -|= len; |
| 2143 | 2241 | } |
| 2144 | 2242 | |
| ... | ... | @@ -2181,6 +2279,7 @@ fn expandMacroExhaustive( |
| 2181 | 2279 | extend_buf: bool, |
| 2182 | 2280 | eval_ctx: EvalContext, |
| 2183 | 2281 | ) MacroError!void { |
| 2282 | const gpa = pp.comp.gpa; | |
| 2184 | 2283 | var moving_end_idx = end_idx; |
| 2185 | 2284 | var advance_index: usize = 0; |
| 2186 | 2285 | // rescan loop |
| ... | ... | @@ -2227,7 +2326,7 @@ fn expandMacroExhaustive( |
| 2227 | 2326 | var r_paren: TokenWithExpansionLocs = undefined; |
| 2228 | 2327 | var macro_scan_idx = idx; |
| 2229 | 2328 | // to be saved in case this doesn't turn out to be a call |
| 2230 | const args = pp.collectMacroFuncArguments( | |
| 2329 | var args = pp.collectMacroFuncArguments( | |
| 2231 | 2330 | tokenizer, |
| 2232 | 2331 | buf, |
| 2233 | 2332 | &macro_scan_idx, |
| ... | ... | @@ -2252,10 +2351,10 @@ fn expandMacroExhaustive( |
| 2252 | 2351 | var free_arg_expansion_locs = false; |
| 2253 | 2352 | defer { |
| 2254 | 2353 | for (args.items) |item| { |
| 2255 | if (free_arg_expansion_locs) for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 2256 | pp.gpa.free(item); | |
| 2354 | if (free_arg_expansion_locs) for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2355 | gpa.free(item); | |
| 2257 | 2356 | } |
| 2258 | args.deinit(); | |
| 2357 | args.deinit(gpa); | |
| 2259 | 2358 | } |
| 2260 | 2359 | const r_paren_hidelist = pp.hideset.get(r_paren.loc); |
| 2261 | 2360 | var hs = try pp.hideset.intersection(macro_hidelist, r_paren_hidelist); |
| ... | ... | @@ -2274,48 +2373,39 @@ fn expandMacroExhaustive( |
| 2274 | 2373 | } |
| 2275 | 2374 | |
| 2276 | 2375 | // Validate argument count. |
| 2277 | const extra = Diagnostics.Message.Extra{ | |
| 2278 | .arguments = .{ .expected = @intCast(macro.params.len), .actual = args_count }, | |
| 2279 | }; | |
| 2280 | 2376 | if (macro.var_args and args_count < macro.params.len) { |
| 2281 | 2377 | free_arg_expansion_locs = true; |
| 2282 | try pp.comp.addDiagnostic( | |
| 2283 | .{ .tag = .expected_at_least_arguments, .loc = buf.items[idx].loc, .extra = extra }, | |
| 2284 | buf.items[idx].expansionSlice(), | |
| 2285 | ); | |
| 2378 | try pp.err(buf.items[idx], .expected_at_least_arguments, .{ macro.params.len, args_count }); | |
| 2286 | 2379 | idx += 1; |
| 2287 | 2380 | try pp.removeExpandedTokens(buf, idx, macro_scan_idx - idx + 1, &moving_end_idx); |
| 2288 | 2381 | continue; |
| 2289 | 2382 | } |
| 2290 | 2383 | if (!macro.var_args and args_count != macro.params.len) { |
| 2291 | 2384 | free_arg_expansion_locs = true; |
| 2292 | try pp.comp.addDiagnostic( | |
| 2293 | .{ .tag = .expected_arguments, .loc = buf.items[idx].loc, .extra = extra }, | |
| 2294 | buf.items[idx].expansionSlice(), | |
| 2295 | ); | |
| 2385 | try pp.err(buf.items[idx], .expected_arguments, .{ macro.params.len, args_count }); | |
| 2296 | 2386 | idx += 1; |
| 2297 | 2387 | try pp.removeExpandedTokens(buf, idx, macro_scan_idx - idx + 1, &moving_end_idx); |
| 2298 | 2388 | continue; |
| 2299 | 2389 | } |
| 2300 | var expanded_args = MacroArguments.init(pp.gpa); | |
| 2301 | defer deinitMacroArguments(pp.gpa, &expanded_args); | |
| 2302 | try expanded_args.ensureTotalCapacity(args.items.len); | |
| 2390 | var expanded_args: MacroArguments = .empty; | |
| 2391 | defer deinitMacroArguments(gpa, &expanded_args); | |
| 2392 | try expanded_args.ensureTotalCapacity(gpa, args.items.len); | |
| 2303 | 2393 | for (args.items) |arg| { |
| 2304 | var expand_buf = ExpandBuf.init(pp.gpa); | |
| 2305 | errdefer expand_buf.deinit(); | |
| 2306 | try expand_buf.appendSlice(arg); | |
| 2394 | var expand_buf: ExpandBuf = .empty; | |
| 2395 | errdefer expand_buf.deinit(gpa); | |
| 2396 | try expand_buf.appendSlice(gpa, arg); | |
| 2307 | 2397 | |
| 2308 | 2398 | try pp.expandMacroExhaustive(tokenizer, &expand_buf, 0, expand_buf.items.len, false, eval_ctx); |
| 2309 | 2399 | |
| 2310 | expanded_args.appendAssumeCapacity(try expand_buf.toOwnedSlice()); | |
| 2400 | expanded_args.appendAssumeCapacity(try expand_buf.toOwnedSlice(gpa)); | |
| 2311 | 2401 | } |
| 2312 | 2402 | |
| 2313 | 2403 | var res = try pp.expandFuncMacro(macro_tok, macro, &args, &expanded_args, hs); |
| 2314 | defer res.deinit(); | |
| 2404 | defer res.deinit(gpa); | |
| 2315 | 2405 | const tokens_added = res.items.len; |
| 2316 | 2406 | const tokens_removed = macro_scan_idx - idx + 1; |
| 2317 | for (buf.items[idx .. idx + tokens_removed]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 2318 | try buf.replaceRange(idx, tokens_removed, res.items); | |
| 2407 | for (buf.items[idx .. idx + tokens_removed]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2408 | try buf.replaceRange(gpa, idx, tokens_removed, res.items); | |
| 2319 | 2409 | |
| 2320 | 2410 | moving_end_idx += tokens_added; |
| 2321 | 2411 | // Overflow here means that we encountered an unterminated argument list |
| ... | ... | @@ -2324,8 +2414,8 @@ fn expandMacroExhaustive( |
| 2324 | 2414 | idx += tokens_added; |
| 2325 | 2415 | do_rescan = true; |
| 2326 | 2416 | } else { |
| 2327 | const res = try pp.expandObjMacro(macro); | |
| 2328 | defer res.deinit(); | |
| 2417 | var res = try pp.expandObjMacro(macro); | |
| 2418 | defer res.deinit(gpa); | |
| 2329 | 2419 | |
| 2330 | 2420 | const hs = try pp.hideset.prepend(macro_tok.loc, macro_hidelist); |
| 2331 | 2421 | |
| ... | ... | @@ -2333,18 +2423,19 @@ fn expandMacroExhaustive( |
| 2333 | 2423 | var increment_idx_by = res.items.len; |
| 2334 | 2424 | for (res.items, 0..) |*tok, i| { |
| 2335 | 2425 | tok.flags.is_macro_arg = macro_tok.flags.is_macro_arg; |
| 2336 | try tok.addExpansionLocation(pp.gpa, &.{macro_tok.loc}); | |
| 2337 | try tok.addExpansionLocation(pp.gpa, macro_expansion_locs); | |
| 2426 | try tok.addExpansionLocation(gpa, &.{macro_tok.loc}); | |
| 2427 | try tok.addExpansionLocation(gpa, macro_expansion_locs); | |
| 2338 | 2428 | |
| 2339 | 2429 | const tok_hidelist = pp.hideset.get(tok.loc); |
| 2340 | 2430 | const new_hidelist = try pp.hideset.@"union"(tok_hidelist, hs); |
| 2341 | 2431 | try pp.hideset.put(tok.loc, new_hidelist); |
| 2342 | 2432 | |
| 2343 | 2433 | if (tok.id == .keyword_defined and eval_ctx == .expr) { |
| 2344 | try pp.comp.addDiagnostic(.{ | |
| 2345 | .tag = .expansion_to_defined, | |
| 2346 | .loc = tok.loc, | |
| 2347 | }, tok.expansionSlice()); | |
| 2434 | if (macro.is_func) { | |
| 2435 | try pp.err(tok, .expansion_to_defined_func, .{}); | |
| 2436 | } else { | |
| 2437 | try pp.err(tok, .expansion_to_defined_obj, .{}); | |
| 2438 | } | |
| 2348 | 2439 | } |
| 2349 | 2440 | |
| 2350 | 2441 | if (i < increment_idx_by and (tok.id == .keyword_defined or pp.defines.contains(pp.expandedSlice(tok.*)))) { |
| ... | ... | @@ -2352,8 +2443,8 @@ fn expandMacroExhaustive( |
| 2352 | 2443 | } |
| 2353 | 2444 | } |
| 2354 | 2445 | |
| 2355 | TokenWithExpansionLocs.free(buf.items[idx].expansion_locs, pp.gpa); | |
| 2356 | try buf.replaceRange(idx, 1, res.items); | |
| 2446 | TokenWithExpansionLocs.free(buf.items[idx].expansion_locs, gpa); | |
| 2447 | try buf.replaceRange(gpa, idx, 1, res.items); | |
| 2357 | 2448 | idx += increment_idx_by; |
| 2358 | 2449 | moving_end_idx = moving_end_idx + res.items.len - 1; |
| 2359 | 2450 | do_rescan = true; |
| ... | ... | @@ -2368,11 +2459,60 @@ fn expandMacroExhaustive( |
| 2368 | 2459 | |
| 2369 | 2460 | // trim excess buffer |
| 2370 | 2461 | for (buf.items[moving_end_idx..]) |item| { |
| 2371 | TokenWithExpansionLocs.free(item.expansion_locs, pp.gpa); | |
| 2462 | TokenWithExpansionLocs.free(item.expansion_locs, gpa); | |
| 2372 | 2463 | } |
| 2373 | 2464 | buf.items.len = moving_end_idx; |
| 2374 | 2465 | } |
| 2375 | 2466 | |
| 2467 | fn unescapeUcn(pp: *Preprocessor, tok: TokenWithExpansionLocs) !TokenWithExpansionLocs { | |
| 2468 | switch (tok.id) { | |
| 2469 | .incomplete_ucn => { | |
| 2470 | @branchHint(.cold); | |
| 2471 | try pp.err(tok, .incomplete_ucn, .{}); | |
| 2472 | }, | |
| 2473 | .extended_identifier => { | |
| 2474 | @branchHint(.cold); | |
| 2475 | const identifier = pp.expandedSlice(tok); | |
| 2476 | const gpa = pp.comp.gpa; | |
| 2477 | if (mem.indexOfScalar(u8, identifier, '\\') != null) { | |
| 2478 | @branchHint(.cold); | |
| 2479 | const start = pp.comp.generated_buf.items.len; | |
| 2480 | try pp.comp.generated_buf.ensureUnusedCapacity(gpa, identifier.len + 1); | |
| 2481 | var identifier_parser: text_literal.Parser = .{ | |
| 2482 | .comp = pp.comp, | |
| 2483 | .literal = pp.expandedSlice(tok), // re-expand since previous line may have caused a reallocation, invalidating `identifier` | |
| 2484 | .kind = .utf_8, | |
| 2485 | .max_codepoint = 0x10ffff, | |
| 2486 | .loc = tok.loc, | |
| 2487 | .expansion_locs = tok.expansionSlice(), | |
| 2488 | .diagnose_incorrect_encoding = false, | |
| 2489 | }; | |
| 2490 | while (try identifier_parser.next()) |decoded| { | |
| 2491 | switch (decoded) { | |
| 2492 | .value => unreachable, // validated by tokenizer | |
| 2493 | .codepoint => |c| { | |
| 2494 | var buf: [4]u8 = undefined; | |
| 2495 | const written = std.unicode.utf8Encode(c, &buf) catch unreachable; | |
| 2496 | pp.comp.generated_buf.appendSliceAssumeCapacity(buf[0..written]); | |
| 2497 | }, | |
| 2498 | .improperly_encoded => |bytes| { | |
| 2499 | pp.comp.generated_buf.appendSliceAssumeCapacity(bytes); | |
| 2500 | }, | |
| 2501 | .utf8_text => |view| { | |
| 2502 | pp.comp.generated_buf.appendSliceAssumeCapacity(view.bytes); | |
| 2503 | }, | |
| 2504 | } | |
| 2505 | } | |
| 2506 | pp.comp.generated_buf.appendAssumeCapacity('\n'); | |
| 2507 | defer TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2508 | return pp.makeGeneratedToken(start, .extended_identifier, tok); | |
| 2509 | } | |
| 2510 | }, | |
| 2511 | else => {}, | |
| 2512 | } | |
| 2513 | return tok; | |
| 2514 | } | |
| 2515 | ||
| 2376 | 2516 | /// Try to expand a macro after a possible candidate has been read from the `tokenizer` |
| 2377 | 2517 | /// into the `raw` token passed as argument |
| 2378 | 2518 | fn expandMacro(pp: *Preprocessor, tokenizer: *Tokenizer, raw: RawToken) MacroError!void { |
| ... | ... | @@ -2381,8 +2521,9 @@ fn expandMacro(pp: *Preprocessor, tokenizer: *Tokenizer, raw: RawToken) MacroErr |
| 2381 | 2521 | source_tok.id.simplifyMacroKeyword(); |
| 2382 | 2522 | return pp.addToken(source_tok); |
| 2383 | 2523 | } |
| 2524 | const gpa = pp.comp.gpa; | |
| 2384 | 2525 | pp.top_expansion_buf.items.len = 0; |
| 2385 | try pp.top_expansion_buf.append(source_tok); | |
| 2526 | try pp.top_expansion_buf.append(gpa, source_tok); | |
| 2386 | 2527 | pp.expansion_source_loc = source_tok.loc; |
| 2387 | 2528 | |
| 2388 | 2529 | pp.hideset.clearRetainingCapacity(); |
| ... | ... | @@ -2390,19 +2531,19 @@ fn expandMacro(pp: *Preprocessor, tokenizer: *Tokenizer, raw: RawToken) MacroErr |
| 2390 | 2531 | try pp.ensureUnusedTokenCapacity(pp.top_expansion_buf.items.len); |
| 2391 | 2532 | for (pp.top_expansion_buf.items) |*tok| { |
| 2392 | 2533 | if (tok.id == .macro_ws and !pp.preserve_whitespace) { |
| 2393 | TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 2534 | TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2394 | 2535 | continue; |
| 2395 | 2536 | } |
| 2396 | 2537 | if (tok.id == .comment and !pp.comp.langopts.preserve_comments_in_macros) { |
| 2397 | TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 2538 | TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2398 | 2539 | continue; |
| 2399 | 2540 | } |
| 2400 | 2541 | if (tok.id == .placemarker) { |
| 2401 | TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 2542 | TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 2402 | 2543 | continue; |
| 2403 | 2544 | } |
| 2404 | 2545 | tok.id.simplifyMacroKeywordExtra(true); |
| 2405 | pp.addTokenAssumeCapacity(tok.*); | |
| 2546 | pp.addTokenAssumeCapacity(try pp.unescapeUcn(tok.*)); | |
| 2406 | 2547 | } |
| 2407 | 2548 | if (pp.preserve_whitespace) { |
| 2408 | 2549 | try pp.ensureUnusedTokenCapacity(pp.add_expansion_nl); |
| ... | ... | @@ -2419,7 +2560,7 @@ fn expandedSliceExtra(pp: *const Preprocessor, tok: anytype, macro_ws_handling: |
| 2419 | 2560 | if (tok.id.lexeme()) |some| { |
| 2420 | 2561 | if (!tok.id.allowsDigraphs(pp.comp.langopts) and !(tok.id == .macro_ws and macro_ws_handling == .preserve_macro_ws)) return some; |
| 2421 | 2562 | } |
| 2422 | var tmp_tokenizer = Tokenizer{ | |
| 2563 | var tmp_tokenizer: Tokenizer = .{ | |
| 2423 | 2564 | .buf = pp.comp.getSource(tok.loc.id).buf, |
| 2424 | 2565 | .langopts = pp.comp.langopts, |
| 2425 | 2566 | .index = tok.loc.byte_offset, |
| ... | ... | @@ -2442,14 +2583,15 @@ pub fn expandedSlice(pp: *const Preprocessor, tok: anytype) []const u8 { |
| 2442 | 2583 | |
| 2443 | 2584 | /// Concat two tokens and add the result to pp.generated |
| 2444 | 2585 | fn pasteTokens(pp: *Preprocessor, lhs_toks: *ExpandBuf, rhs_toks: []const TokenWithExpansionLocs) Error!void { |
| 2586 | const gpa = pp.comp.gpa; | |
| 2445 | 2587 | const lhs = while (lhs_toks.pop()) |lhs| { |
| 2446 | 2588 | if ((pp.comp.langopts.preserve_comments_in_macros and lhs.id == .comment) or |
| 2447 | 2589 | (lhs.id != .macro_ws and lhs.id != .comment)) |
| 2448 | 2590 | break lhs; |
| 2449 | 2591 | |
| 2450 | TokenWithExpansionLocs.free(lhs.expansion_locs, pp.gpa); | |
| 2592 | TokenWithExpansionLocs.free(lhs.expansion_locs, gpa); | |
| 2451 | 2593 | } else { |
| 2452 | return bufCopyTokens(lhs_toks, rhs_toks, &.{}); | |
| 2594 | return bufCopyTokens(gpa, lhs_toks, rhs_toks, &.{}); | |
| 2453 | 2595 | }; |
| 2454 | 2596 | |
| 2455 | 2597 | var rhs_rest: u32 = 1; |
| ... | ... | @@ -2462,11 +2604,11 @@ fn pasteTokens(pp: *Preprocessor, lhs_toks: *ExpandBuf, rhs_toks: []const TokenW |
| 2462 | 2604 | } else { |
| 2463 | 2605 | return lhs_toks.appendAssumeCapacity(lhs); |
| 2464 | 2606 | }; |
| 2465 | defer TokenWithExpansionLocs.free(lhs.expansion_locs, pp.gpa); | |
| 2607 | defer TokenWithExpansionLocs.free(lhs.expansion_locs, gpa); | |
| 2466 | 2608 | |
| 2467 | 2609 | const start = pp.comp.generated_buf.items.len; |
| 2468 | 2610 | const end = start + pp.expandedSlice(lhs).len + pp.expandedSlice(rhs).len; |
| 2469 | try pp.comp.generated_buf.ensureTotalCapacity(pp.gpa, end + 1); // +1 for a newline | |
| 2611 | try pp.comp.generated_buf.ensureTotalCapacity(gpa, end + 1); // +1 for a newline | |
| 2470 | 2612 | // We cannot use the same slices here since they might be invalidated by `ensureCapacity` |
| 2471 | 2613 | pp.comp.generated_buf.appendSliceAssumeCapacity(pp.expandedSlice(lhs)); |
| 2472 | 2614 | pp.comp.generated_buf.appendSliceAssumeCapacity(pp.expandedSlice(rhs)); |
| ... | ... | @@ -2485,53 +2627,49 @@ fn pasteTokens(pp: *Preprocessor, lhs_toks: *ExpandBuf, rhs_toks: []const TokenW |
| 2485 | 2627 | .placemarker |
| 2486 | 2628 | else |
| 2487 | 2629 | pasted_token.id; |
| 2488 | try lhs_toks.append(try pp.makeGeneratedToken(start, pasted_id, lhs)); | |
| 2630 | try lhs_toks.append(gpa, try pp.makeGeneratedToken(start, pasted_id, lhs)); | |
| 2489 | 2631 | |
| 2490 | 2632 | if (next.id != .nl and next.id != .eof) { |
| 2491 | try pp.errStr( | |
| 2492 | lhs, | |
| 2493 | .pasting_formed_invalid, | |
| 2494 | try pp.comp.diagnostics.arena.allocator().dupe(u8, pp.comp.generated_buf.items[start..end]), | |
| 2495 | ); | |
| 2496 | try lhs_toks.append(tokFromRaw(next)); | |
| 2633 | try pp.err(lhs, .pasting_formed_invalid, .{pp.comp.generated_buf.items[start..end]}); | |
| 2634 | try lhs_toks.append(gpa, tokFromRaw(next)); | |
| 2497 | 2635 | } |
| 2498 | 2636 | |
| 2499 | try bufCopyTokens(lhs_toks, rhs_toks[rhs_rest..], &.{}); | |
| 2637 | try bufCopyTokens(gpa, lhs_toks, rhs_toks[rhs_rest..], &.{}); | |
| 2500 | 2638 | } |
| 2501 | 2639 | |
| 2502 | 2640 | fn makeGeneratedToken(pp: *Preprocessor, start: usize, id: Token.Id, source: TokenWithExpansionLocs) !TokenWithExpansionLocs { |
| 2641 | const gpa = pp.comp.gpa; | |
| 2503 | 2642 | var pasted_token = TokenWithExpansionLocs{ .id = id, .loc = .{ |
| 2504 | 2643 | .id = .generated, |
| 2505 | 2644 | .byte_offset = @intCast(start), |
| 2506 | 2645 | .line = pp.generated_line, |
| 2507 | 2646 | } }; |
| 2508 | 2647 | pp.generated_line += 1; |
| 2509 | try pasted_token.addExpansionLocation(pp.gpa, &.{source.loc}); | |
| 2510 | try pasted_token.addExpansionLocation(pp.gpa, source.expansionSlice()); | |
| 2648 | try pasted_token.addExpansionLocation(gpa, &.{source.loc}); | |
| 2649 | try pasted_token.addExpansionLocation(gpa, source.expansionSlice()); | |
| 2511 | 2650 | return pasted_token; |
| 2512 | 2651 | } |
| 2513 | 2652 | |
| 2514 | 2653 | /// Defines a new macro and warns if it is a duplicate |
| 2515 | fn defineMacro(pp: *Preprocessor, define_tok: RawToken, name_tok: RawToken, macro: Macro) Error!void { | |
| 2516 | const name_str = pp.tokSlice(name_tok); | |
| 2517 | const gop = try pp.defines.getOrPut(pp.gpa, name_str); | |
| 2654 | fn defineMacro(pp: *Preprocessor, define_tok: RawToken, name_tok: TokenWithExpansionLocs, macro: Macro) Error!void { | |
| 2655 | const name_str = pp.expandedSlice(name_tok); | |
| 2656 | const gop = try pp.defines.getOrPut(pp.comp.gpa, name_str); | |
| 2518 | 2657 | if (gop.found_existing and !gop.value_ptr.eql(macro, pp)) { |
| 2519 | const tag: Diagnostics.Tag = if (gop.value_ptr.is_builtin) .builtin_macro_redefined else .macro_redefined; | |
| 2520 | const start = pp.comp.diagnostics.list.items.len; | |
| 2521 | try pp.comp.addDiagnostic(.{ | |
| 2522 | .tag = tag, | |
| 2523 | .loc = .{ .id = name_tok.source, .byte_offset = name_tok.start, .line = name_tok.line }, | |
| 2524 | .extra = .{ .str = name_str }, | |
| 2525 | }, &.{}); | |
| 2526 | if (!gop.value_ptr.is_builtin and pp.comp.diagnostics.list.items.len != start) { | |
| 2527 | try pp.comp.addDiagnostic(.{ | |
| 2528 | .tag = .previous_definition, | |
| 2529 | .loc = gop.value_ptr.loc, | |
| 2530 | }, &.{}); | |
| 2658 | const loc = name_tok.loc; | |
| 2659 | const prev_total = pp.diagnostics.total; | |
| 2660 | if (gop.value_ptr.is_builtin) { | |
| 2661 | try pp.err(loc, .builtin_macro_redefined, .{}); | |
| 2662 | } else { | |
| 2663 | try pp.err(loc, .macro_redefined, .{name_str}); | |
| 2664 | } | |
| 2665 | ||
| 2666 | if (!gop.value_ptr.is_builtin and pp.diagnostics.total != prev_total) { | |
| 2667 | try pp.err(gop.value_ptr.loc, .previous_definition, .{}); | |
| 2531 | 2668 | } |
| 2532 | 2669 | } |
| 2533 | 2670 | if (pp.verbose) { |
| 2534 | pp.verboseLog(name_tok, "macro {s} defined", .{name_str}); | |
| 2671 | const raw: RawToken = .{ .id = name_tok.id, .source = name_tok.loc.id, .start = name_tok.loc.byte_offset, .line = name_tok.loc.line }; | |
| 2672 | pp.verboseLog(raw, "macro {s} defined", .{name_str}); | |
| 2535 | 2673 | } |
| 2536 | 2674 | if (pp.store_macro_tokens) { |
| 2537 | 2675 | try pp.addToken(tokFromRaw(define_tok)); |
| ... | ... | @@ -2542,21 +2680,28 @@ fn defineMacro(pp: *Preprocessor, define_tok: RawToken, name_tok: RawToken, macr |
| 2542 | 2680 | /// Handle a #define directive. |
| 2543 | 2681 | fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error!void { |
| 2544 | 2682 | // Get macro name and validate it. |
| 2545 | const macro_name = tokenizer.nextNoWS(); | |
| 2546 | if (macro_name.id == .keyword_defined) { | |
| 2547 | try pp.err(macro_name, .defined_as_macro_name); | |
| 2683 | const escaped_macro_name = tokenizer.nextNoWS(); | |
| 2684 | if (escaped_macro_name.id == .keyword_defined) { | |
| 2685 | try pp.err(escaped_macro_name, .defined_as_macro_name, .{}); | |
| 2548 | 2686 | return skipToNl(tokenizer); |
| 2549 | 2687 | } |
| 2550 | if (!macro_name.id.isMacroIdentifier()) { | |
| 2551 | try pp.err(macro_name, .macro_name_must_be_identifier); | |
| 2688 | if (!escaped_macro_name.id.isMacroIdentifier()) { | |
| 2689 | try pp.err(escaped_macro_name, .macro_name_must_be_identifier, .{}); | |
| 2552 | 2690 | return skipToNl(tokenizer); |
| 2553 | 2691 | } |
| 2692 | const gpa = pp.comp.gpa; | |
| 2693 | const macro_name = try pp.unescapeUcn(tokFromRaw(escaped_macro_name)); | |
| 2694 | defer TokenWithExpansionLocs.free(macro_name.expansion_locs, gpa); | |
| 2695 | ||
| 2554 | 2696 | var macro_name_token_id = macro_name.id; |
| 2555 | 2697 | macro_name_token_id.simplifyMacroKeyword(); |
| 2556 | 2698 | switch (macro_name_token_id) { |
| 2557 | 2699 | .identifier, .extended_identifier => {}, |
| 2558 | else => if (macro_name_token_id.isMacroIdentifier()) { | |
| 2559 | try pp.err(macro_name, .keyword_macro); | |
| 2700 | // TODO allow #define <keyword> <keyword> and #define extern|inline|static|const | |
| 2701 | else => if (macro_name_token_id.isMacroIdentifier() and | |
| 2702 | !mem.eql(u8, pp.comp.getSource(tokenizer.source).path, "<builtin>")) | |
| 2703 | { | |
| 2704 | try pp.err(macro_name, .keyword_macro, .{}); | |
| 2560 | 2705 | }, |
| 2561 | 2706 | } |
| 2562 | 2707 | |
| ... | ... | @@ -2567,15 +2712,15 @@ fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error! |
| 2567 | 2712 | .params = &.{}, |
| 2568 | 2713 | .tokens = &.{}, |
| 2569 | 2714 | .var_args = false, |
| 2570 | .loc = tokFromRaw(macro_name).loc, | |
| 2715 | .loc = macro_name.loc, | |
| 2571 | 2716 | .is_func = false, |
| 2572 | 2717 | }), |
| 2573 | 2718 | .whitespace => first = tokenizer.next(), |
| 2574 | 2719 | .l_paren => return pp.defineFn(tokenizer, define_tok, macro_name, first), |
| 2575 | else => try pp.err(first, .whitespace_after_macro_name), | |
| 2720 | else => try pp.err(first, .whitespace_after_macro_name, .{}), | |
| 2576 | 2721 | } |
| 2577 | 2722 | if (first.id == .hash_hash) { |
| 2578 | try pp.err(first, .hash_hash_at_start); | |
| 2723 | try pp.err(first, .hash_hash_at_start, .{}); | |
| 2579 | 2724 | return skipToNl(tokenizer); |
| 2580 | 2725 | } |
| 2581 | 2726 | first.id.simplifyMacroKeyword(); |
| ... | ... | @@ -2592,38 +2737,42 @@ fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error! |
| 2592 | 2737 | const next = tokenizer.nextNoWSComments(); |
| 2593 | 2738 | switch (next.id) { |
| 2594 | 2739 | .nl, .eof => { |
| 2595 | try pp.err(tok, .hash_hash_at_end); | |
| 2740 | try pp.err(tok, .hash_hash_at_end, .{}); | |
| 2596 | 2741 | return; |
| 2597 | 2742 | }, |
| 2598 | 2743 | .hash_hash => { |
| 2599 | try pp.err(next, .hash_hash_at_end); | |
| 2744 | try pp.err(next, .hash_hash_at_end, .{}); | |
| 2600 | 2745 | return; |
| 2601 | 2746 | }, |
| 2602 | 2747 | else => {}, |
| 2603 | 2748 | } |
| 2604 | try pp.token_buf.append(tok); | |
| 2605 | try pp.token_buf.append(next); | |
| 2749 | try pp.token_buf.append(gpa, tok); | |
| 2750 | try pp.token_buf.append(gpa, next); | |
| 2606 | 2751 | }, |
| 2607 | 2752 | .nl, .eof => break, |
| 2608 | 2753 | .comment => if (pp.comp.langopts.preserve_comments_in_macros) { |
| 2609 | 2754 | if (need_ws) { |
| 2610 | 2755 | need_ws = false; |
| 2611 | try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); | |
| 2756 | try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); | |
| 2612 | 2757 | } |
| 2613 | try pp.token_buf.append(tok); | |
| 2758 | try pp.token_buf.append(gpa, tok); | |
| 2614 | 2759 | }, |
| 2615 | 2760 | .whitespace => need_ws = true, |
| 2616 | 2761 | .unterminated_string_literal, .unterminated_char_literal, .empty_char_literal => |tag| { |
| 2617 | try pp.err(tok, invalidTokenDiagnostic(tag)); | |
| 2618 | try pp.token_buf.append(tok); | |
| 2762 | try pp.err(tok, invalidTokenDiagnostic(tag), .{}); | |
| 2763 | try pp.token_buf.append(gpa, tok); | |
| 2619 | 2764 | }, |
| 2620 | .unterminated_comment => try pp.err(tok, .unterminated_comment), | |
| 2765 | .unterminated_comment => try pp.err(tok, .unterminated_comment, .{}), | |
| 2621 | 2766 | else => { |
| 2767 | if (tok.id == .incomplete_ucn) { | |
| 2768 | @branchHint(.cold); | |
| 2769 | try pp.err(tok, .incomplete_ucn, .{}); | |
| 2770 | } | |
| 2622 | 2771 | if (tok.id != .whitespace and need_ws) { |
| 2623 | 2772 | need_ws = false; |
| 2624 | try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); | |
| 2773 | try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); | |
| 2625 | 2774 | } |
| 2626 | try pp.token_buf.append(tok); | |
| 2775 | try pp.token_buf.append(gpa, tok); | |
| 2627 | 2776 | }, |
| 2628 | 2777 | } |
| 2629 | 2778 | tok = tokenizer.next(); |
| ... | ... | @@ -2631,19 +2780,20 @@ fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error! |
| 2631 | 2780 | |
| 2632 | 2781 | const list = try pp.arena.allocator().dupe(RawToken, pp.token_buf.items); |
| 2633 | 2782 | try pp.defineMacro(define_tok, macro_name, .{ |
| 2634 | .loc = tokFromRaw(macro_name).loc, | |
| 2783 | .loc = macro_name.loc, | |
| 2635 | 2784 | .tokens = list, |
| 2636 | .params = undefined, | |
| 2785 | .params = &.{}, | |
| 2637 | 2786 | .is_func = false, |
| 2638 | 2787 | .var_args = false, |
| 2639 | 2788 | }); |
| 2640 | 2789 | } |
| 2641 | 2790 | |
| 2642 | 2791 | /// Handle a function like #define directive. |
| 2643 | fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macro_name: RawToken, l_paren: RawToken) Error!void { | |
| 2792 | fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macro_name: TokenWithExpansionLocs, l_paren: RawToken) Error!void { | |
| 2644 | 2793 | assert(macro_name.id.isMacroIdentifier()); |
| 2645 | var params = std.array_list.Managed([]const u8).init(pp.gpa); | |
| 2646 | defer params.deinit(); | |
| 2794 | const gpa = pp.comp.gpa; | |
| 2795 | var params: std.ArrayList([]const u8) = .empty; | |
| 2796 | defer params.deinit(gpa); | |
| 2647 | 2797 | |
| 2648 | 2798 | // Parse the parameter list. |
| 2649 | 2799 | var gnu_var_args: []const u8 = ""; |
| ... | ... | @@ -2651,39 +2801,39 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2651 | 2801 | while (true) { |
| 2652 | 2802 | var tok = tokenizer.nextNoWS(); |
| 2653 | 2803 | if (tok.id == .r_paren) break; |
| 2654 | if (tok.id == .eof) return pp.err(tok, .unterminated_macro_param_list); | |
| 2804 | if (tok.id == .eof) return pp.err(tok, .unterminated_macro_param_list, .{}); | |
| 2655 | 2805 | if (tok.id == .ellipsis) { |
| 2656 | 2806 | var_args = true; |
| 2657 | 2807 | const r_paren = tokenizer.nextNoWS(); |
| 2658 | 2808 | if (r_paren.id != .r_paren) { |
| 2659 | try pp.err(r_paren, .missing_paren_param_list); | |
| 2660 | try pp.err(l_paren, .to_match_paren); | |
| 2809 | try pp.err(r_paren, .missing_paren_param_list, .{}); | |
| 2810 | try pp.err(l_paren, .to_match_paren, .{}); | |
| 2661 | 2811 | return skipToNl(tokenizer); |
| 2662 | 2812 | } |
| 2663 | 2813 | break; |
| 2664 | 2814 | } |
| 2665 | 2815 | if (!tok.id.isMacroIdentifier()) { |
| 2666 | try pp.err(tok, .invalid_token_param_list); | |
| 2816 | try pp.err(tok, .invalid_token_param_list, .{}); | |
| 2667 | 2817 | return skipToNl(tokenizer); |
| 2668 | 2818 | } |
| 2669 | 2819 | |
| 2670 | try params.append(pp.tokSlice(tok)); | |
| 2820 | try params.append(gpa, pp.tokSlice(tok)); | |
| 2671 | 2821 | |
| 2672 | 2822 | tok = tokenizer.nextNoWS(); |
| 2673 | 2823 | if (tok.id == .ellipsis) { |
| 2674 | try pp.err(tok, .gnu_va_macro); | |
| 2824 | try pp.err(tok, .gnu_va_macro, .{}); | |
| 2675 | 2825 | gnu_var_args = params.pop().?; |
| 2676 | 2826 | const r_paren = tokenizer.nextNoWS(); |
| 2677 | 2827 | if (r_paren.id != .r_paren) { |
| 2678 | try pp.err(r_paren, .missing_paren_param_list); | |
| 2679 | try pp.err(l_paren, .to_match_paren); | |
| 2828 | try pp.err(r_paren, .missing_paren_param_list, .{}); | |
| 2829 | try pp.err(l_paren, .to_match_paren, .{}); | |
| 2680 | 2830 | return skipToNl(tokenizer); |
| 2681 | 2831 | } |
| 2682 | 2832 | break; |
| 2683 | 2833 | } else if (tok.id == .r_paren) { |
| 2684 | 2834 | break; |
| 2685 | 2835 | } else if (tok.id != .comma) { |
| 2686 | try pp.err(tok, .expected_comma_param_list); | |
| 2836 | try pp.err(tok, .expected_comma_param_list, .{}); | |
| 2687 | 2837 | return skipToNl(tokenizer); |
| 2688 | 2838 | } |
| 2689 | 2839 | } |
| ... | ... | @@ -2699,39 +2849,39 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2699 | 2849 | .comment => if (!pp.comp.langopts.preserve_comments_in_macros) continue else { |
| 2700 | 2850 | if (need_ws) { |
| 2701 | 2851 | need_ws = false; |
| 2702 | try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); | |
| 2852 | try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); | |
| 2703 | 2853 | } |
| 2704 | try pp.token_buf.append(tok); | |
| 2854 | try pp.token_buf.append(gpa, tok); | |
| 2705 | 2855 | }, |
| 2706 | 2856 | .hash => { |
| 2707 | 2857 | if (tok.id != .whitespace and need_ws) { |
| 2708 | 2858 | need_ws = false; |
| 2709 | try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); | |
| 2859 | try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); | |
| 2710 | 2860 | } |
| 2711 | 2861 | const param = tokenizer.nextNoWS(); |
| 2712 | 2862 | blk: { |
| 2713 | 2863 | if (var_args and param.id == .keyword_va_args) { |
| 2714 | 2864 | tok.id = .stringify_va_args; |
| 2715 | try pp.token_buf.append(tok); | |
| 2865 | try pp.token_buf.append(gpa, tok); | |
| 2716 | 2866 | continue :tok_loop; |
| 2717 | 2867 | } |
| 2718 | 2868 | if (!param.id.isMacroIdentifier()) break :blk; |
| 2719 | 2869 | const s = pp.tokSlice(param); |
| 2720 | 2870 | if (mem.eql(u8, s, gnu_var_args)) { |
| 2721 | 2871 | tok.id = .stringify_va_args; |
| 2722 | try pp.token_buf.append(tok); | |
| 2872 | try pp.token_buf.append(gpa, tok); | |
| 2723 | 2873 | continue :tok_loop; |
| 2724 | 2874 | } |
| 2725 | 2875 | for (params.items, 0..) |p, i| { |
| 2726 | 2876 | if (mem.eql(u8, p, s)) { |
| 2727 | 2877 | tok.id = .stringify_param; |
| 2728 | 2878 | tok.end = @intCast(i); |
| 2729 | try pp.token_buf.append(tok); | |
| 2879 | try pp.token_buf.append(gpa, tok); | |
| 2730 | 2880 | continue :tok_loop; |
| 2731 | 2881 | } |
| 2732 | 2882 | } |
| 2733 | 2883 | } |
| 2734 | try pp.err(param, .hash_not_followed_param); | |
| 2884 | try pp.err(param, .hash_not_followed_param, .{}); | |
| 2735 | 2885 | return skipToNl(tokenizer); |
| 2736 | 2886 | }, |
| 2737 | 2887 | .hash_hash => { |
| ... | ... | @@ -2739,13 +2889,13 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2739 | 2889 | // if ## appears at the beginning, the token buf is still empty |
| 2740 | 2890 | // in this case, error out |
| 2741 | 2891 | if (pp.token_buf.items.len == 0) { |
| 2742 | try pp.err(tok, .hash_hash_at_start); | |
| 2892 | try pp.err(tok, .hash_hash_at_start, .{}); | |
| 2743 | 2893 | return skipToNl(tokenizer); |
| 2744 | 2894 | } |
| 2745 | 2895 | const saved_tokenizer = tokenizer.*; |
| 2746 | 2896 | const next = tokenizer.nextNoWSComments(); |
| 2747 | 2897 | if (next.id == .nl or next.id == .eof) { |
| 2748 | try pp.err(tok, .hash_hash_at_end); | |
| 2898 | try pp.err(tok, .hash_hash_at_end, .{}); | |
| 2749 | 2899 | return; |
| 2750 | 2900 | } |
| 2751 | 2901 | tokenizer.* = saved_tokenizer; |
| ... | ... | @@ -2753,24 +2903,24 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2753 | 2903 | if (pp.token_buf.items[pp.token_buf.items.len - 1].id == .macro_param) { |
| 2754 | 2904 | pp.token_buf.items[pp.token_buf.items.len - 1].id = .macro_param_no_expand; |
| 2755 | 2905 | } |
| 2756 | try pp.token_buf.append(tok); | |
| 2906 | try pp.token_buf.append(gpa, tok); | |
| 2757 | 2907 | }, |
| 2758 | 2908 | .unterminated_string_literal, .unterminated_char_literal, .empty_char_literal => |tag| { |
| 2759 | try pp.err(tok, invalidTokenDiagnostic(tag)); | |
| 2760 | try pp.token_buf.append(tok); | |
| 2909 | try pp.err(tok, invalidTokenDiagnostic(tag), .{}); | |
| 2910 | try pp.token_buf.append(gpa, tok); | |
| 2761 | 2911 | }, |
| 2762 | .unterminated_comment => try pp.err(tok, .unterminated_comment), | |
| 2912 | .unterminated_comment => try pp.err(tok, .unterminated_comment, .{}), | |
| 2763 | 2913 | else => { |
| 2764 | 2914 | if (tok.id != .whitespace and need_ws) { |
| 2765 | 2915 | need_ws = false; |
| 2766 | try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); | |
| 2916 | try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); | |
| 2767 | 2917 | } |
| 2768 | 2918 | if (var_args and tok.id == .keyword_va_args) { |
| 2769 | 2919 | // do nothing |
| 2770 | 2920 | } else if (var_args and tok.id == .keyword_va_opt) { |
| 2771 | 2921 | const opt_l_paren = tokenizer.next(); |
| 2772 | 2922 | if (opt_l_paren.id != .l_paren) { |
| 2773 | try pp.err(opt_l_paren, .va_opt_lparen); | |
| 2923 | try pp.err(opt_l_paren, .va_opt_lparen, .{}); | |
| 2774 | 2924 | return skipToNl(tokenizer); |
| 2775 | 2925 | } |
| 2776 | 2926 | tok.start = opt_l_paren.end; |
| ... | ... | @@ -2786,8 +2936,8 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2786 | 2936 | parens -= 1; |
| 2787 | 2937 | }, |
| 2788 | 2938 | .nl, .eof => { |
| 2789 | try pp.err(opt_tok, .va_opt_rparen); | |
| 2790 | try pp.err(opt_l_paren, .to_match_paren); | |
| 2939 | try pp.err(opt_tok, .va_opt_rparen, .{}); | |
| 2940 | try pp.err(opt_l_paren, .to_match_paren, .{}); | |
| 2791 | 2941 | return skipToNl(tokenizer); |
| 2792 | 2942 | }, |
| 2793 | 2943 | .whitespace => {}, |
| ... | ... | @@ -2810,7 +2960,7 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2810 | 2960 | } |
| 2811 | 2961 | } |
| 2812 | 2962 | } |
| 2813 | try pp.token_buf.append(tok); | |
| 2963 | try pp.token_buf.append(gpa, tok); | |
| 2814 | 2964 | }, |
| 2815 | 2965 | } |
| 2816 | 2966 | } |
| ... | ... | @@ -2822,7 +2972,7 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2822 | 2972 | .params = param_list, |
| 2823 | 2973 | .var_args = var_args or gnu_var_args.len != 0, |
| 2824 | 2974 | .tokens = token_list, |
| 2825 | .loc = tokFromRaw(macro_name).loc, | |
| 2975 | .loc = macro_name.loc, | |
| 2826 | 2976 | }); |
| 2827 | 2977 | } |
| 2828 | 2978 | |
| ... | ... | @@ -2830,17 +2980,18 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr |
| 2830 | 2980 | /// embedDirective : ("FILENAME" | <FILENAME>) embedParam* |
| 2831 | 2981 | /// embedParam : IDENTIFIER (:: IDENTIFIER)? '(' <tokens> ')' |
| 2832 | 2982 | fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { |
| 2983 | const gpa = pp.comp.gpa; | |
| 2833 | 2984 | const first = tokenizer.nextNoWS(); |
| 2834 | 2985 | const filename_tok = pp.findIncludeFilenameToken(first, tokenizer, .ignore_trailing_tokens) catch |er| switch (er) { |
| 2835 | 2986 | error.InvalidInclude => return, |
| 2836 | 2987 | else => |e| return e, |
| 2837 | 2988 | }; |
| 2838 | defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, pp.gpa); | |
| 2989 | defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, gpa); | |
| 2839 | 2990 | |
| 2840 | 2991 | // Check for empty filename. |
| 2841 | 2992 | const tok_slice = pp.expandedSliceExtra(filename_tok, .single_macro_ws); |
| 2842 | 2993 | if (tok_slice.len < 3) { |
| 2843 | try pp.err(first, .empty_filename); | |
| 2994 | try pp.err(first, .empty_filename, .{}); | |
| 2844 | 2995 | return; |
| 2845 | 2996 | } |
| 2846 | 2997 | const filename = tok_slice[1 .. tok_slice.len - 1]; |
| ... | ... | @@ -2865,7 +3016,7 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { |
| 2865 | 3016 | }; |
| 2866 | 3017 | pp.token_buf.items.len = 0; |
| 2867 | 3018 | |
| 2868 | var limit: ?u32 = null; | |
| 3019 | var limit: ?std.Io.Limit = null; | |
| 2869 | 3020 | var prefix: ?Range = null; |
| 2870 | 3021 | var suffix: ?Range = null; |
| 2871 | 3022 | var if_empty: ?Range = null; |
| ... | ... | @@ -2875,7 +3026,7 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { |
| 2875 | 3026 | .nl, .eof => break, |
| 2876 | 3027 | .identifier => {}, |
| 2877 | 3028 | else => { |
| 2878 | try pp.err(param_first, .malformed_embed_param); | |
| 3029 | try pp.err(param_first, .malformed_embed_param, .{}); | |
| 2879 | 3030 | continue; |
| 2880 | 3031 | }, |
| 2881 | 3032 | } |
| ... | ... | @@ -2889,22 +3040,25 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { |
| 2889 | 3040 | // vendor::param |
| 2890 | 3041 | const param = tokenizer.nextNoWS(); |
| 2891 | 3042 | if (param.id != .identifier) { |
| 2892 | try pp.err(param, .malformed_embed_param); | |
| 3043 | try pp.err(param, .malformed_embed_param, .{}); | |
| 2893 | 3044 | continue; |
| 2894 | 3045 | } |
| 2895 | 3046 | const l_paren = tokenizer.nextNoWS(); |
| 2896 | 3047 | if (l_paren.id != .l_paren) { |
| 2897 | try pp.err(l_paren, .malformed_embed_param); | |
| 3048 | try pp.err(l_paren, .malformed_embed_param, .{}); | |
| 2898 | 3049 | continue; |
| 2899 | 3050 | } |
| 2900 | try pp.char_buf.appendSlice(Attribute.normalize(pp.tokSlice(param_first))); | |
| 2901 | try pp.char_buf.appendSlice("::"); | |
| 2902 | try pp.char_buf.appendSlice(Attribute.normalize(pp.tokSlice(param))); | |
| 3051 | const vendor = Attribute.normalize(pp.tokSlice(param_first)); | |
| 3052 | const param_name = Attribute.normalize(pp.tokSlice(param)); | |
| 3053 | try pp.char_buf.ensureUnusedCapacity(gpa, vendor.len + 2 + param_name.len); | |
| 3054 | pp.char_buf.appendSliceAssumeCapacity(vendor); | |
| 3055 | pp.char_buf.appendSliceAssumeCapacity("::"); | |
| 3056 | pp.char_buf.appendSliceAssumeCapacity(param_name); | |
| 2903 | 3057 | break :blk pp.char_buf.items; |
| 2904 | 3058 | }, |
| 2905 | 3059 | .l_paren => Attribute.normalize(pp.tokSlice(param_first)), |
| 2906 | 3060 | else => { |
| 2907 | try pp.err(maybe_colon, .malformed_embed_param); | |
| 3061 | try pp.err(maybe_colon, .malformed_embed_param, .{}); | |
| 2908 | 3062 | continue; |
| 2909 | 3063 | }, |
| 2910 | 3064 | }; |
| ... | ... | @@ -2914,63 +3068,59 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { |
| 2914 | 3068 | const next = tokenizer.nextNoWS(); |
| 2915 | 3069 | if (next.id == .r_paren) break; |
| 2916 | 3070 | if (next.id == .eof) { |
| 2917 | try pp.err(maybe_colon, .malformed_embed_param); | |
| 3071 | try pp.err(maybe_colon, .malformed_embed_param, .{}); | |
| 2918 | 3072 | break; |
| 2919 | 3073 | } |
| 2920 | try pp.token_buf.append(next); | |
| 3074 | try pp.token_buf.append(gpa, next); | |
| 2921 | 3075 | } |
| 2922 | 3076 | const end: u32 = @intCast(pp.token_buf.items.len); |
| 2923 | 3077 | |
| 2924 | 3078 | if (std.mem.eql(u8, param, "limit")) { |
| 2925 | 3079 | if (limit != null) { |
| 2926 | try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "limit"); | |
| 3080 | try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"limit"}); | |
| 2927 | 3081 | continue; |
| 2928 | 3082 | } |
| 2929 | 3083 | if (start + 1 != end) { |
| 2930 | try pp.err(param_first, .malformed_embed_limit); | |
| 3084 | try pp.err(param_first, .malformed_embed_limit, .{}); | |
| 2931 | 3085 | continue; |
| 2932 | 3086 | } |
| 2933 | 3087 | const limit_tok = pp.token_buf.items[start]; |
| 2934 | 3088 | if (limit_tok.id != .pp_num) { |
| 2935 | try pp.err(param_first, .malformed_embed_limit); | |
| 3089 | try pp.err(param_first, .malformed_embed_limit, .{}); | |
| 2936 | 3090 | continue; |
| 2937 | 3091 | } |
| 2938 | limit = std.fmt.parseInt(u32, pp.tokSlice(limit_tok), 10) catch { | |
| 2939 | try pp.err(limit_tok, .malformed_embed_limit); | |
| 3092 | limit = .limited(std.fmt.parseInt(u32, pp.tokSlice(limit_tok), 10) catch { | |
| 3093 | try pp.err(limit_tok, .malformed_embed_limit, .{}); | |
| 2940 | 3094 | continue; |
| 2941 | }; | |
| 3095 | }); | |
| 2942 | 3096 | pp.token_buf.items.len = start; |
| 2943 | 3097 | } else if (std.mem.eql(u8, param, "prefix")) { |
| 2944 | 3098 | if (prefix != null) { |
| 2945 | try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "prefix"); | |
| 3099 | try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"prefix"}); | |
| 2946 | 3100 | continue; |
| 2947 | 3101 | } |
| 2948 | 3102 | prefix = .{ .start = start, .end = end }; |
| 2949 | 3103 | } else if (std.mem.eql(u8, param, "suffix")) { |
| 2950 | 3104 | if (suffix != null) { |
| 2951 | try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "suffix"); | |
| 3105 | try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"suffix"}); | |
| 2952 | 3106 | continue; |
| 2953 | 3107 | } |
| 2954 | 3108 | suffix = .{ .start = start, .end = end }; |
| 2955 | 3109 | } else if (std.mem.eql(u8, param, "if_empty")) { |
| 2956 | 3110 | if (if_empty != null) { |
| 2957 | try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "if_empty"); | |
| 3111 | try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"if_empty"}); | |
| 2958 | 3112 | continue; |
| 2959 | 3113 | } |
| 2960 | 3114 | if_empty = .{ .start = start, .end = end }; |
| 2961 | 3115 | } else { |
| 2962 | try pp.errStr( | |
| 2963 | tokFromRaw(param_first), | |
| 2964 | .unsupported_embed_param, | |
| 2965 | try pp.comp.diagnostics.arena.allocator().dupe(u8, param), | |
| 2966 | ); | |
| 3116 | try pp.err(tokFromRaw(param_first), .unsupported_embed_param, .{param}); | |
| 2967 | 3117 | pp.token_buf.items.len = start; |
| 2968 | 3118 | } |
| 2969 | 3119 | } |
| 2970 | 3120 | |
| 2971 | const embed_bytes = (try pp.comp.findEmbed(filename, first.source, include_type, limit)) orelse | |
| 3121 | const embed_bytes = (try pp.comp.findEmbed(filename, first.source, include_type, limit orelse .unlimited, pp.dep_file)) orelse | |
| 2972 | 3122 | return pp.fatalNotFound(filename_tok, filename); |
| 2973 | defer pp.comp.gpa.free(embed_bytes); | |
| 3123 | defer gpa.free(embed_bytes); | |
| 2974 | 3124 | |
| 2975 | 3125 | try Range.expand(prefix, pp, tokenizer); |
| 2976 | 3126 | |
| ... | ... | @@ -2988,17 +3138,17 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { |
| 2988 | 3138 | { |
| 2989 | 3139 | const byte = embed_bytes[0]; |
| 2990 | 3140 | const start = pp.comp.generated_buf.items.len; |
| 2991 | try pp.comp.generated_buf.print(pp.gpa, "{d}", .{byte}); | |
| 3141 | try pp.comp.generated_buf.print(gpa, "{d}", .{byte}); | |
| 2992 | 3142 | pp.addTokenAssumeCapacity(try pp.makeGeneratedToken(start, .embed_byte, filename_tok)); |
| 2993 | 3143 | } |
| 2994 | 3144 | |
| 2995 | 3145 | for (embed_bytes[1..]) |byte| { |
| 2996 | 3146 | const start = pp.comp.generated_buf.items.len; |
| 2997 | try pp.comp.generated_buf.print(pp.gpa, ",{d}", .{byte}); | |
| 3147 | try pp.comp.generated_buf.print(gpa, ",{d}", .{byte}); | |
| 2998 | 3148 | pp.addTokenAssumeCapacity(.{ .id = .comma, .loc = .{ .id = .generated, .byte_offset = @intCast(start) } }); |
| 2999 | 3149 | pp.addTokenAssumeCapacity(try pp.makeGeneratedToken(start + 1, .embed_byte, filename_tok)); |
| 3000 | 3150 | } |
| 3001 | try pp.comp.generated_buf.append(pp.gpa, '\n'); | |
| 3151 | try pp.comp.generated_buf.append(gpa, '\n'); | |
| 3002 | 3152 | |
| 3003 | 3153 | try Range.expand(suffix, pp, tokenizer); |
| 3004 | 3154 | } |
| ... | ... | @@ -3010,15 +3160,14 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc |
| 3010 | 3160 | error.InvalidInclude => return, |
| 3011 | 3161 | else => |e| return e, |
| 3012 | 3162 | }; |
| 3163 | const gpa = pp.comp.gpa; | |
| 3013 | 3164 | |
| 3014 | 3165 | // Prevent stack overflow |
| 3015 | 3166 | pp.include_depth += 1; |
| 3016 | 3167 | defer pp.include_depth -= 1; |
| 3017 | 3168 | if (pp.include_depth > max_include_depth) { |
| 3018 | try pp.comp.addDiagnostic(.{ | |
| 3019 | .tag = .too_many_includes, | |
| 3020 | .loc = .{ .id = first.source, .byte_offset = first.start, .line = first.line }, | |
| 3021 | }, &.{}); | |
| 3169 | const loc: Source.Location = .{ .id = first.source, .byte_offset = first.start, .line = first.line }; | |
| 3170 | try pp.err(loc, .too_many_includes, .{}); | |
| 3022 | 3171 | return error.StopPreprocessing; |
| 3023 | 3172 | } |
| 3024 | 3173 | |
| ... | ... | @@ -3026,6 +3175,7 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc |
| 3026 | 3175 | if (pp.defines.contains(guard)) return; |
| 3027 | 3176 | } |
| 3028 | 3177 | |
| 3178 | if (pp.dep_file) |dep| try dep.addDependency(gpa, new_source.path); | |
| 3029 | 3179 | if (pp.verbose) { |
| 3030 | 3180 | pp.verboseLog(first, "include file {s}", .{new_source.path}); |
| 3031 | 3181 | } |
| ... | ... | @@ -3034,7 +3184,7 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc |
| 3034 | 3184 | try pp.addIncludeStart(new_source); |
| 3035 | 3185 | const eof = pp.preprocessExtra(new_source) catch |er| switch (er) { |
| 3036 | 3186 | error.StopPreprocessing => { |
| 3037 | for (pp.expansion_entries.items(.locs)[token_state.expansion_entries_len..]) |loc| TokenWithExpansionLocs.free(loc, pp.gpa); | |
| 3187 | for (pp.expansion_entries.items(.locs)[token_state.expansion_entries_len..]) |loc| TokenWithExpansionLocs.free(loc, gpa); | |
| 3038 | 3188 | pp.restoreTokenState(token_state); |
| 3039 | 3189 | return; |
| 3040 | 3190 | }, |
| ... | ... | @@ -3065,19 +3215,22 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc |
| 3065 | 3215 | /// operator_loc: Location of `_Pragma`; null if this is from #pragma |
| 3066 | 3216 | /// arg_locs: expansion locations of the argument to _Pragma. empty if #pragma or a raw string literal was used |
| 3067 | 3217 | fn makePragmaToken(pp: *Preprocessor, raw: RawToken, operator_loc: ?Source.Location, arg_locs: []const Source.Location) !TokenWithExpansionLocs { |
| 3218 | const gpa = pp.comp.gpa; | |
| 3068 | 3219 | var tok = tokFromRaw(raw); |
| 3069 | 3220 | if (operator_loc) |loc| { |
| 3070 | try tok.addExpansionLocation(pp.gpa, &.{loc}); | |
| 3221 | try tok.addExpansionLocation(gpa, &.{loc}); | |
| 3071 | 3222 | } |
| 3072 | try tok.addExpansionLocation(pp.gpa, arg_locs); | |
| 3223 | try tok.addExpansionLocation(gpa, arg_locs); | |
| 3073 | 3224 | return tok; |
| 3074 | 3225 | } |
| 3075 | 3226 | |
| 3076 | pub fn addToken(pp: *Preprocessor, tok: TokenWithExpansionLocs) !void { | |
| 3227 | pub fn addToken(pp: *Preprocessor, tok_arg: TokenWithExpansionLocs) !void { | |
| 3228 | const gpa = pp.comp.gpa; | |
| 3229 | const tok = try pp.unescapeUcn(tok_arg); | |
| 3077 | 3230 | if (tok.expansion_locs) |expansion_locs| { |
| 3078 | try pp.expansion_entries.append(pp.gpa, .{ .idx = @intCast(pp.tokens.len), .locs = expansion_locs }); | |
| 3231 | try pp.expansion_entries.append(gpa, .{ .idx = @intCast(pp.tokens.len), .locs = expansion_locs }); | |
| 3079 | 3232 | } |
| 3080 | try pp.tokens.append(pp.gpa, .{ .id = tok.id, .loc = tok.loc }); | |
| 3233 | try pp.tokens.append(gpa, .{ .id = tok.id, .loc = tok.loc }); | |
| 3081 | 3234 | } |
| 3082 | 3235 | |
| 3083 | 3236 | pub fn addTokenAssumeCapacity(pp: *Preprocessor, tok: TokenWithExpansionLocs) void { |
| ... | ... | @@ -3088,13 +3241,15 @@ pub fn addTokenAssumeCapacity(pp: *Preprocessor, tok: TokenWithExpansionLocs) vo |
| 3088 | 3241 | } |
| 3089 | 3242 | |
| 3090 | 3243 | pub fn ensureTotalTokenCapacity(pp: *Preprocessor, capacity: usize) !void { |
| 3091 | try pp.tokens.ensureTotalCapacity(pp.gpa, capacity); | |
| 3092 | try pp.expansion_entries.ensureTotalCapacity(pp.gpa, capacity); | |
| 3244 | const gpa = pp.comp.gpa; | |
| 3245 | try pp.tokens.ensureTotalCapacity(gpa, capacity); | |
| 3246 | try pp.expansion_entries.ensureTotalCapacity(gpa, capacity); | |
| 3093 | 3247 | } |
| 3094 | 3248 | |
| 3095 | 3249 | pub fn ensureUnusedTokenCapacity(pp: *Preprocessor, capacity: usize) !void { |
| 3096 | try pp.tokens.ensureUnusedCapacity(pp.gpa, capacity); | |
| 3097 | try pp.expansion_entries.ensureUnusedCapacity(pp.gpa, capacity); | |
| 3250 | const gpa = pp.comp.gpa; | |
| 3251 | try pp.tokens.ensureUnusedCapacity(gpa, capacity); | |
| 3252 | try pp.expansion_entries.ensureUnusedCapacity(gpa, capacity); | |
| 3098 | 3253 | } |
| 3099 | 3254 | |
| 3100 | 3255 | /// Handle a pragma directive |
| ... | ... | @@ -3102,10 +3257,10 @@ fn pragma(pp: *Preprocessor, tokenizer: *Tokenizer, pragma_tok: RawToken, operat |
| 3102 | 3257 | const name_tok = tokenizer.nextNoWS(); |
| 3103 | 3258 | if (name_tok.id == .nl or name_tok.id == .eof) return; |
| 3104 | 3259 | |
| 3105 | const name = pp.tokSlice(name_tok); | |
| 3106 | 3260 | try pp.addToken(try pp.makePragmaToken(pragma_tok, operator_loc, arg_locs)); |
| 3107 | 3261 | const pragma_start: u32 = @intCast(pp.tokens.len); |
| 3108 | 3262 | |
| 3263 | const name = pp.tokSlice(name_tok); | |
| 3109 | 3264 | const pragma_name_tok = try pp.makePragmaToken(name_tok, operator_loc, arg_locs); |
| 3110 | 3265 | try pp.addToken(pragma_name_tok); |
| 3111 | 3266 | while (true) { |
| ... | ... | @@ -3127,10 +3282,8 @@ fn pragma(pp: *Preprocessor, tokenizer: *Tokenizer, pragma_tok: RawToken, operat |
| 3127 | 3282 | else => |e| return e, |
| 3128 | 3283 | }; |
| 3129 | 3284 | } |
| 3130 | return pp.comp.addDiagnostic(.{ | |
| 3131 | .tag = .unknown_pragma, | |
| 3132 | .loc = pragma_name_tok.loc, | |
| 3133 | }, pragma_name_tok.expansionSlice()); | |
| 3285 | ||
| 3286 | try pp.err(pragma_name_tok, .unknown_pragma, .{}); | |
| 3134 | 3287 | } |
| 3135 | 3288 | |
| 3136 | 3289 | fn findIncludeFilenameToken( |
| ... | ... | @@ -3155,21 +3308,20 @@ fn findIncludeFilenameToken( |
| 3155 | 3308 | else => {}, |
| 3156 | 3309 | } |
| 3157 | 3310 | } |
| 3158 | try pp.comp.addDiagnostic(.{ | |
| 3159 | .tag = .header_str_closing, | |
| 3160 | .loc = .{ .id = first.source, .byte_offset = tokenizer.index, .line = first.line }, | |
| 3161 | }, &.{}); | |
| 3162 | try pp.err(first, .header_str_match); | |
| 3311 | const loc: Source.Location = .{ .id = first.source, .byte_offset = tokenizer.index, .line = first.line }; | |
| 3312 | try pp.err(loc, .header_str_closing, .{}); | |
| 3313 | try pp.err(first, .header_str_match, .{}); | |
| 3163 | 3314 | } |
| 3164 | 3315 | |
| 3165 | 3316 | const source_tok = tokFromRaw(first); |
| 3166 | 3317 | const filename_tok, const expanded_trailing = switch (source_tok.id) { |
| 3167 | 3318 | .string_literal, .macro_string => .{ source_tok, false }, |
| 3168 | 3319 | else => expanded: { |
| 3320 | const gpa = pp.comp.gpa; | |
| 3169 | 3321 | // Try to expand if the argument is a macro. |
| 3170 | 3322 | pp.top_expansion_buf.items.len = 0; |
| 3171 | defer for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); | |
| 3172 | try pp.top_expansion_buf.append(source_tok); | |
| 3323 | defer for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); | |
| 3324 | try pp.top_expansion_buf.append(gpa, source_tok); | |
| 3173 | 3325 | pp.expansion_source_loc = source_tok.loc; |
| 3174 | 3326 | |
| 3175 | 3327 | try pp.expandMacroExhaustive(tokenizer, &pp.top_expansion_buf, 0, 1, true, .non_expr); |
| ... | ... | @@ -3179,7 +3331,7 @@ fn findIncludeFilenameToken( |
| 3179 | 3331 | return error.InvalidInclude; |
| 3180 | 3332 | }; |
| 3181 | 3333 | const start = pp.comp.generated_buf.items.len; |
| 3182 | try pp.comp.generated_buf.appendSlice(pp.gpa, include_str); | |
| 3334 | try pp.comp.generated_buf.appendSlice(gpa, include_str); | |
| 3183 | 3335 | |
| 3184 | 3336 | break :expanded .{ try pp.makeGeneratedToken(start, switch (include_str[0]) { |
| 3185 | 3337 | '"' => .string_literal, |
| ... | ... | @@ -3195,17 +3347,11 @@ fn findIncludeFilenameToken( |
| 3195 | 3347 | const nl = tokenizer.nextNoWS(); |
| 3196 | 3348 | if ((nl.id != .nl and nl.id != .eof) or expanded_trailing) { |
| 3197 | 3349 | skipToNl(tokenizer); |
| 3198 | try pp.comp.diagnostics.addExtra(pp.comp.langopts, .{ | |
| 3199 | .tag = .extra_tokens_directive_end, | |
| 3200 | .loc = filename_tok.loc, | |
| 3201 | }, filename_tok.expansionSlice(), false); | |
| 3350 | try pp.err(filename_tok, .extra_tokens_directive_end, .{}); | |
| 3202 | 3351 | } |
| 3203 | 3352 | }, |
| 3204 | 3353 | .ignore_trailing_tokens => if (expanded_trailing) { |
| 3205 | try pp.comp.diagnostics.addExtra(pp.comp.langopts, .{ | |
| 3206 | .tag = .extra_tokens_directive_end, | |
| 3207 | .loc = filename_tok.loc, | |
| 3208 | }, filename_tok.expansionSlice(), false); | |
| 3354 | try pp.err(filename_tok, .extra_tokens_directive_end, .{}); | |
| 3209 | 3355 | }, |
| 3210 | 3356 | } |
| 3211 | 3357 | return filename_tok; |
| ... | ... | @@ -3213,12 +3359,12 @@ fn findIncludeFilenameToken( |
| 3213 | 3359 | |
| 3214 | 3360 | fn findIncludeSource(pp: *Preprocessor, tokenizer: *Tokenizer, first: RawToken, which: Compilation.WhichInclude) !Source { |
| 3215 | 3361 | const filename_tok = try pp.findIncludeFilenameToken(first, tokenizer, .expect_nl_eof); |
| 3216 | defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, pp.gpa); | |
| 3362 | defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, pp.comp.gpa); | |
| 3217 | 3363 | |
| 3218 | 3364 | // Check for empty filename. |
| 3219 | 3365 | const tok_slice = pp.expandedSliceExtra(filename_tok, .single_macro_ws); |
| 3220 | 3366 | if (tok_slice.len < 3) { |
| 3221 | try pp.err(first, .empty_filename); | |
| 3367 | try pp.err(first, .empty_filename, .{}); | |
| 3222 | 3368 | return error.InvalidInclude; |
| 3223 | 3369 | } |
| 3224 | 3370 | |
| ... | ... | @@ -3236,31 +3382,14 @@ fn findIncludeSource(pp: *Preprocessor, tokenizer: *Tokenizer, first: RawToken, |
| 3236 | 3382 | |
| 3237 | 3383 | fn printLinemarker( |
| 3238 | 3384 | pp: *Preprocessor, |
| 3239 | w: *Writer, | |
| 3385 | w: *std.Io.Writer, | |
| 3240 | 3386 | line_no: u32, |
| 3241 | 3387 | source: Source, |
| 3242 | 3388 | start_resume: enum(u8) { start, @"resume", none }, |
| 3243 | 3389 | ) !void { |
| 3244 | 3390 | try w.writeByte('#'); |
| 3245 | 3391 | if (pp.linemarkers == .line_directives) try w.writeAll("line"); |
| 3246 | try w.print(" {d} \"", .{line_no}); | |
| 3247 | for (source.path) |byte| switch (byte) { | |
| 3248 | '\n' => try w.writeAll("\\n"), | |
| 3249 | '\r' => try w.writeAll("\\r"), | |
| 3250 | '\t' => try w.writeAll("\\t"), | |
| 3251 | '\\' => try w.writeAll("\\\\"), | |
| 3252 | '"' => try w.writeAll("\\\""), | |
| 3253 | ' ', '!', '#'...'&', '('...'[', ']'...'~' => try w.writeByte(byte), | |
| 3254 | // Use hex escapes for any non-ASCII/unprintable characters. | |
| 3255 | // This ensures that the parsed version of this string will end up | |
| 3256 | // containing the same bytes as the input regardless of encoding. | |
| 3257 | else => { | |
| 3258 | try w.writeAll("\\x"); | |
| 3259 | // TODO try w.printInt(byte, 16, .lower, .{ .width = 2, .fill = '0' }); | |
| 3260 | try w.print("{x:0>2}", .{byte}); | |
| 3261 | }, | |
| 3262 | }; | |
| 3263 | try w.writeByte('"'); | |
| 3392 | try w.print(" {d} \"{f}\"", .{ line_no, fmtEscapes(source.path) }); | |
| 3264 | 3393 | if (pp.linemarkers == .numeric_directives) { |
| 3265 | 3394 | switch (start_resume) { |
| 3266 | 3395 | .none => {}, |
| ... | ... | @@ -3296,7 +3425,7 @@ pub const DumpMode = enum { |
| 3296 | 3425 | /// Pretty-print the macro define or undef at location `loc`. |
| 3297 | 3426 | /// We re-tokenize the directive because we are printing a macro that may have the same name as one in |
| 3298 | 3427 | /// `pp.defines` but a different definition (due to being #undef'ed and then redefined) |
| 3299 | fn prettyPrintMacro(pp: *Preprocessor, w: *Writer, loc: Source.Location, parts: enum { name_only, name_and_body }) !void { | |
| 3428 | fn prettyPrintMacro(pp: *Preprocessor, w: *std.Io.Writer, loc: Source.Location, parts: enum { name_only, name_and_body }) !void { | |
| 3300 | 3429 | const source = pp.comp.getSource(loc.id); |
| 3301 | 3430 | var tokenizer: Tokenizer = .{ |
| 3302 | 3431 | .buf = source.buf, |
| ... | ... | @@ -3334,9 +3463,8 @@ fn prettyPrintMacro(pp: *Preprocessor, w: *Writer, loc: Source.Location, parts: |
| 3334 | 3463 | } |
| 3335 | 3464 | } |
| 3336 | 3465 | |
| 3337 | fn prettyPrintMacrosOnly(pp: *Preprocessor, w: *Writer) !void { | |
| 3338 | var it = pp.defines.valueIterator(); | |
| 3339 | while (it.next()) |macro| { | |
| 3466 | fn prettyPrintMacrosOnly(pp: *Preprocessor, w: *std.Io.Writer) !void { | |
| 3467 | for (pp.defines.values()) |macro| { | |
| 3340 | 3468 | if (macro.is_builtin) continue; |
| 3341 | 3469 | |
| 3342 | 3470 | try w.writeAll("#define "); |
| ... | ... | @@ -3346,7 +3474,7 @@ fn prettyPrintMacrosOnly(pp: *Preprocessor, w: *Writer) !void { |
| 3346 | 3474 | } |
| 3347 | 3475 | |
| 3348 | 3476 | /// Pretty print tokens and try to preserve whitespace. |
| 3349 | pub fn prettyPrintTokens(pp: *Preprocessor, w: *Writer, macro_dump_mode: DumpMode) !void { | |
| 3477 | pub fn prettyPrintTokens(pp: *Preprocessor, w: *std.Io.Writer, macro_dump_mode: DumpMode) !void { | |
| 3350 | 3478 | if (macro_dump_mode == .macros_only) { |
| 3351 | 3479 | return pp.prettyPrintMacrosOnly(w); |
| 3352 | 3480 | } |
| ... | ... | @@ -3360,6 +3488,7 @@ pub fn prettyPrintTokens(pp: *Preprocessor, w: *Writer, macro_dump_mode: DumpMod |
| 3360 | 3488 | switch (cur.id) { |
| 3361 | 3489 | .eof => { |
| 3362 | 3490 | if (!last_nl) try w.writeByte('\n'); |
| 3491 | try w.flush(); | |
| 3363 | 3492 | return; |
| 3364 | 3493 | }, |
| 3365 | 3494 | .nl => { |
| ... | ... | @@ -3369,6 +3498,7 @@ pub fn prettyPrintTokens(pp: *Preprocessor, w: *Writer, macro_dump_mode: DumpMod |
| 3369 | 3498 | newlines += 1; |
| 3370 | 3499 | } else if (id == .eof) { |
| 3371 | 3500 | if (!last_nl) try w.writeByte('\n'); |
| 3501 | try w.flush(); | |
| 3372 | 3502 | return; |
| 3373 | 3503 | } else if (id != .whitespace) { |
| 3374 | 3504 | if (pp.linemarkers == .none) { |
| ... | ... | @@ -3462,19 +3592,44 @@ pub fn prettyPrintTokens(pp: *Preprocessor, w: *Writer, macro_dump_mode: DumpMod |
| 3462 | 3592 | } |
| 3463 | 3593 | } |
| 3464 | 3594 | |
| 3595 | /// Like `std.zig.fmtEscapes`, but for C strings. Hex escapes are used for any | |
| 3596 | /// non-ASCII/unprintable bytes to ensure that the string bytes do not change if | |
| 3597 | /// the encoding of the file is not UTF-8. | |
| 3598 | fn fmtEscapes(bytes: []const u8) FmtEscapes { | |
| 3599 | return .{ .bytes = bytes }; | |
| 3600 | } | |
| 3601 | const FmtEscapes = struct { | |
| 3602 | bytes: []const u8, | |
| 3603 | pub fn format(ctx: FmtEscapes, w: *std.Io.Writer) !void { | |
| 3604 | for (ctx.bytes) |byte| switch (byte) { | |
| 3605 | '\n' => try w.writeAll("\\n"), | |
| 3606 | '\r' => try w.writeAll("\\r"), | |
| 3607 | '\t' => try w.writeAll("\\t"), | |
| 3608 | '\\' => try w.writeAll("\\\\"), | |
| 3609 | '"' => try w.writeAll("\\\""), | |
| 3610 | ' ', '!', '#'...'&', '('...'[', ']'...'~' => try w.writeByte(byte), | |
| 3611 | // Use hex escapes for any non-ASCII/unprintable characters. | |
| 3612 | // This ensures that the parsed version of this string will end up | |
| 3613 | // containing the same bytes as the input regardless of encoding. | |
| 3614 | else => try w.print("\\x{x:0>2}", .{byte}), | |
| 3615 | }; | |
| 3616 | } | |
| 3617 | }; | |
| 3618 | ||
| 3465 | 3619 | test "Preserve pragma tokens sometimes" { |
| 3466 | const allocator = std.testing.allocator; | |
| 3620 | const gpa = std.testing.allocator; | |
| 3467 | 3621 | const Test = struct { |
| 3468 | 3622 | fn runPreprocessor(source_text: []const u8) ![]const u8 { |
| 3469 | var buf = std.array_list.Managed(u8).init(allocator); | |
| 3470 | defer buf.deinit(); | |
| 3623 | var arena: std.heap.ArenaAllocator = .init(gpa); | |
| 3624 | defer arena.deinit(); | |
| 3471 | 3625 | |
| 3472 | var comp = Compilation.init(allocator, std.fs.cwd()); | |
| 3626 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 3627 | var comp = Compilation.init(gpa, arena.allocator(), &diagnostics, std.fs.cwd()); | |
| 3473 | 3628 | defer comp.deinit(); |
| 3474 | 3629 | |
| 3475 | 3630 | try comp.addDefaultPragmaHandlers(); |
| 3476 | 3631 | |
| 3477 | var pp = Preprocessor.init(&comp); | |
| 3632 | var pp = Preprocessor.init(&comp, .default); | |
| 3478 | 3633 | defer pp.deinit(); |
| 3479 | 3634 | |
| 3480 | 3635 | pp.preserve_whitespace = true; |
| ... | ... | @@ -3483,13 +3638,17 @@ test "Preserve pragma tokens sometimes" { |
| 3483 | 3638 | const test_runner_macros = try comp.addSourceFromBuffer("<test_runner>", source_text); |
| 3484 | 3639 | const eof = try pp.preprocess(test_runner_macros); |
| 3485 | 3640 | try pp.addToken(eof); |
| 3486 | try pp.prettyPrintTokens(buf.writer(), .result_only); | |
| 3487 | return allocator.dupe(u8, buf.items); | |
| 3641 | ||
| 3642 | var allocating: std.Io.Writer.Allocating = .init(gpa); | |
| 3643 | defer allocating.deinit(); | |
| 3644 | ||
| 3645 | try pp.prettyPrintTokens(&allocating.writer, .result_only); | |
| 3646 | return allocating.toOwnedSlice(); | |
| 3488 | 3647 | } |
| 3489 | 3648 | |
| 3490 | 3649 | fn check(source_text: []const u8, expected: []const u8) !void { |
| 3491 | 3650 | const output = try runPreprocessor(source_text); |
| 3492 | defer allocator.free(output); | |
| 3651 | defer gpa.free(output); | |
| 3493 | 3652 | |
| 3494 | 3653 | try std.testing.expectEqualStrings(expected, output); |
| 3495 | 3654 | } |
| ... | ... | @@ -3520,18 +3679,21 @@ test "Preserve pragma tokens sometimes" { |
| 3520 | 3679 | } |
| 3521 | 3680 | |
| 3522 | 3681 | test "destringify" { |
| 3523 | const allocator = std.testing.allocator; | |
| 3682 | const gpa = std.testing.allocator; | |
| 3524 | 3683 | const Test = struct { |
| 3525 | 3684 | fn testDestringify(pp: *Preprocessor, stringified: []const u8, destringified: []const u8) !void { |
| 3526 | 3685 | pp.char_buf.clearRetainingCapacity(); |
| 3527 | try pp.char_buf.ensureUnusedCapacity(stringified.len); | |
| 3686 | try pp.char_buf.ensureUnusedCapacity(gpa, stringified.len); | |
| 3528 | 3687 | pp.destringify(stringified); |
| 3529 | 3688 | try std.testing.expectEqualStrings(destringified, pp.char_buf.items); |
| 3530 | 3689 | } |
| 3531 | 3690 | }; |
| 3532 | var comp = Compilation.init(allocator, std.fs.cwd()); | |
| 3691 | var arena: std.heap.ArenaAllocator = .init(gpa); | |
| 3692 | defer arena.deinit(); | |
| 3693 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 3694 | var comp = Compilation.init(gpa, arena.allocator(), &diagnostics, std.fs.cwd()); | |
| 3533 | 3695 | defer comp.deinit(); |
| 3534 | var pp = Preprocessor.init(&comp); | |
| 3696 | var pp = Preprocessor.init(&comp, .default); | |
| 3535 | 3697 | defer pp.deinit(); |
| 3536 | 3698 | |
| 3537 | 3699 | try Test.testDestringify(&pp, "hello\tworld\n", "hello\tworld\n"); |
| ... | ... | @@ -3586,30 +3748,33 @@ test "Include guards" { |
| 3586 | 3748 | }; |
| 3587 | 3749 | } |
| 3588 | 3750 | |
| 3589 | fn testIncludeGuard(allocator: std.mem.Allocator, comptime template: []const u8, tok_id: RawToken.Id, expected_guards: u32) !void { | |
| 3590 | var comp = Compilation.init(allocator, std.fs.cwd()); | |
| 3751 | fn testIncludeGuard(gpa: std.mem.Allocator, comptime template: []const u8, tok_id: RawToken.Id, expected_guards: u32) !void { | |
| 3752 | var arena_state: std.heap.ArenaAllocator = .init(gpa); | |
| 3753 | defer arena_state.deinit(); | |
| 3754 | const arena = arena_state.allocator(); | |
| 3755 | ||
| 3756 | var diagnostics: Diagnostics = .{ .output = .ignore }; | |
| 3757 | var comp = Compilation.init(gpa, arena, &diagnostics, std.fs.cwd()); | |
| 3591 | 3758 | defer comp.deinit(); |
| 3592 | var pp = Preprocessor.init(&comp); | |
| 3759 | var pp = Preprocessor.init(&comp, .default); | |
| 3593 | 3760 | defer pp.deinit(); |
| 3594 | 3761 | |
| 3595 | const path = try std.fs.path.join(allocator, &.{ ".", "bar.h" }); | |
| 3596 | defer allocator.free(path); | |
| 3762 | const path = try std.fs.path.join(arena, &.{ ".", "bar.h" }); | |
| 3597 | 3763 | |
| 3598 | 3764 | _ = try comp.addSourceFromBuffer(path, "int bar = 5;\n"); |
| 3599 | 3765 | |
| 3600 | var buf = std.array_list.Managed(u8).init(allocator); | |
| 3601 | defer buf.deinit(); | |
| 3766 | var buf: std.ArrayList(u8) = .empty; | |
| 3767 | defer buf.deinit(gpa); | |
| 3602 | 3768 | |
| 3603 | var writer = buf.writer(); | |
| 3604 | 3769 | switch (tok_id) { |
| 3605 | .keyword_include, .keyword_include_next => try writer.print(template, .{ tok_id.lexeme().?, " \"bar.h\"" }), | |
| 3606 | .keyword_define, .keyword_undef => try writer.print(template, .{ tok_id.lexeme().?, " BAR" }), | |
| 3770 | .keyword_include, .keyword_include_next => try buf.print(gpa, template, .{ tok_id.lexeme().?, " \"bar.h\"" }), | |
| 3771 | .keyword_define, .keyword_undef => try buf.print(gpa, template, .{ tok_id.lexeme().?, " BAR" }), | |
| 3607 | 3772 | .keyword_ifndef, |
| 3608 | 3773 | .keyword_ifdef, |
| 3609 | 3774 | .keyword_elifdef, |
| 3610 | 3775 | .keyword_elifndef, |
| 3611 | => try writer.print(template, .{ tok_id.lexeme().?, " BAR\n#endif" }), | |
| 3612 | else => try writer.print(template, .{ tok_id.lexeme().?, "" }), | |
| 3776 | => try buf.print(gpa, template, .{ tok_id.lexeme().?, " BAR\n#endif" }), | |
| 3777 | else => try buf.print(gpa, template, .{ tok_id.lexeme().?, "" }), | |
| 3613 | 3778 | } |
| 3614 | 3779 | const source = try comp.addSourceFromBuffer("test.h", buf.items); |
| 3615 | 3780 | _ = try pp.preprocess(source); |
lib/compiler/aro/aro/Preprocessor/Diagnostic.zig created+458| ... | ... | @@ -0,0 +1,458 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | const Diagnostics = @import("../Diagnostics.zig"); | |
| 4 | const LangOpts = @import("../LangOpts.zig"); | |
| 5 | const Compilation = @import("../Compilation.zig"); | |
| 6 | ||
| 7 | const Diagnostic = @This(); | |
| 8 | ||
| 9 | fmt: []const u8, | |
| 10 | kind: Diagnostics.Message.Kind, | |
| 11 | opt: ?Diagnostics.Option = null, | |
| 12 | extension: bool = false, | |
| 13 | show_in_system_headers: bool = false, | |
| 14 | ||
| 15 | pub const elif_without_if: Diagnostic = .{ | |
| 16 | .fmt = "#elif without #if", | |
| 17 | .kind = .@"error", | |
| 18 | }; | |
| 19 | ||
| 20 | pub const elif_after_else: Diagnostic = .{ | |
| 21 | .fmt = "#elif after #else", | |
| 22 | .kind = .@"error", | |
| 23 | }; | |
| 24 | ||
| 25 | pub const elifdef_without_if: Diagnostic = .{ | |
| 26 | .fmt = "#elifdef without #if", | |
| 27 | .kind = .@"error", | |
| 28 | }; | |
| 29 | ||
| 30 | pub const elifdef_after_else: Diagnostic = .{ | |
| 31 | .fmt = "#elifdef after #else", | |
| 32 | .kind = .@"error", | |
| 33 | }; | |
| 34 | ||
| 35 | pub const elifndef_without_if: Diagnostic = .{ | |
| 36 | .fmt = "#elifndef without #if", | |
| 37 | .kind = .@"error", | |
| 38 | }; | |
| 39 | ||
| 40 | pub const elifndef_after_else: Diagnostic = .{ | |
| 41 | .fmt = "#elifndef after #else", | |
| 42 | .kind = .@"error", | |
| 43 | }; | |
| 44 | ||
| 45 | pub const else_without_if: Diagnostic = .{ | |
| 46 | .fmt = "#else without #if", | |
| 47 | .kind = .@"error", | |
| 48 | }; | |
| 49 | ||
| 50 | pub const else_after_else: Diagnostic = .{ | |
| 51 | .fmt = "#else after #else", | |
| 52 | .kind = .@"error", | |
| 53 | }; | |
| 54 | ||
| 55 | pub const endif_without_if: Diagnostic = .{ | |
| 56 | .fmt = "#endif without #if", | |
| 57 | .kind = .@"error", | |
| 58 | }; | |
| 59 | ||
| 60 | pub const unknown_pragma: Diagnostic = .{ | |
| 61 | .fmt = "unknown pragma ignored", | |
| 62 | .opt = .@"unknown-pragmas", | |
| 63 | .kind = .off, | |
| 64 | }; | |
| 65 | ||
| 66 | pub const line_simple_digit: Diagnostic = .{ | |
| 67 | .fmt = "#line directive requires a simple digit sequence", | |
| 68 | .kind = .@"error", | |
| 69 | }; | |
| 70 | ||
| 71 | pub const line_invalid_filename: Diagnostic = .{ | |
| 72 | .fmt = "invalid filename for #line directive", | |
| 73 | .kind = .@"error", | |
| 74 | }; | |
| 75 | ||
| 76 | pub const unterminated_conditional_directive: Diagnostic = .{ | |
| 77 | .fmt = "unterminated conditional directive", | |
| 78 | .kind = .@"error", | |
| 79 | }; | |
| 80 | ||
| 81 | pub const invalid_preprocessing_directive: Diagnostic = .{ | |
| 82 | .fmt = "invalid preprocessing directive", | |
| 83 | .kind = .@"error", | |
| 84 | }; | |
| 85 | ||
| 86 | pub const error_directive: Diagnostic = .{ | |
| 87 | .fmt = "{s}", | |
| 88 | .kind = .@"error", | |
| 89 | }; | |
| 90 | ||
| 91 | pub const warning_directive: Diagnostic = .{ | |
| 92 | .fmt = "{s}", | |
| 93 | .opt = .@"#warnings", | |
| 94 | .kind = .warning, | |
| 95 | .show_in_system_headers = true, | |
| 96 | }; | |
| 97 | ||
| 98 | pub const macro_name_missing: Diagnostic = .{ | |
| 99 | .fmt = "macro name missing", | |
| 100 | .kind = .@"error", | |
| 101 | }; | |
| 102 | ||
| 103 | pub const extra_tokens_directive_end: Diagnostic = .{ | |
| 104 | .fmt = "extra tokens at end of macro directive", | |
| 105 | .kind = .@"error", | |
| 106 | }; | |
| 107 | ||
| 108 | pub const expected_value_in_expr: Diagnostic = .{ | |
| 109 | .fmt = "expected value in expression", | |
| 110 | .kind = .@"error", | |
| 111 | }; | |
| 112 | ||
| 113 | pub const defined_as_macro_name: Diagnostic = .{ | |
| 114 | .fmt = "'defined' cannot be used as a macro name", | |
| 115 | .kind = .@"error", | |
| 116 | }; | |
| 117 | ||
| 118 | pub const macro_name_must_be_identifier: Diagnostic = .{ | |
| 119 | .fmt = "macro name must be an identifier", | |
| 120 | .kind = .@"error", | |
| 121 | }; | |
| 122 | ||
| 123 | pub const whitespace_after_macro_name: Diagnostic = .{ | |
| 124 | .fmt = "ISO C99 requires whitespace after the macro name", | |
| 125 | .opt = .@"c99-extensions", | |
| 126 | .kind = .warning, | |
| 127 | .extension = true, | |
| 128 | }; | |
| 129 | ||
| 130 | pub const hash_hash_at_start: Diagnostic = .{ | |
| 131 | .fmt = "'##' cannot appear at the start of a macro expansion", | |
| 132 | .kind = .@"error", | |
| 133 | }; | |
| 134 | ||
| 135 | pub const hash_hash_at_end: Diagnostic = .{ | |
| 136 | .fmt = "'##' cannot appear at the end of a macro expansion", | |
| 137 | .kind = .@"error", | |
| 138 | }; | |
| 139 | ||
| 140 | pub const pasting_formed_invalid: Diagnostic = .{ | |
| 141 | .fmt = "pasting formed '{s}', an invalid preprocessing token", | |
| 142 | .kind = .@"error", | |
| 143 | }; | |
| 144 | ||
| 145 | pub const missing_paren_param_list: Diagnostic = .{ | |
| 146 | .fmt = "missing ')' in macro parameter list", | |
| 147 | .kind = .@"error", | |
| 148 | }; | |
| 149 | ||
| 150 | pub const unterminated_macro_param_list: Diagnostic = .{ | |
| 151 | .fmt = "unterminated macro param list", | |
| 152 | .kind = .@"error", | |
| 153 | }; | |
| 154 | ||
| 155 | pub const invalid_token_param_list: Diagnostic = .{ | |
| 156 | .fmt = "invalid token in macro parameter list", | |
| 157 | .kind = .@"error", | |
| 158 | }; | |
| 159 | ||
| 160 | pub const expected_comma_param_list: Diagnostic = .{ | |
| 161 | .fmt = "expected comma in macro parameter list", | |
| 162 | .kind = .@"error", | |
| 163 | }; | |
| 164 | ||
| 165 | pub const hash_not_followed_param: Diagnostic = .{ | |
| 166 | .fmt = "'#' is not followed by a macro parameter", | |
| 167 | .kind = .@"error", | |
| 168 | }; | |
| 169 | ||
| 170 | pub const expected_filename: Diagnostic = .{ | |
| 171 | .fmt = "expected \"FILENAME\" or <FILENAME>", | |
| 172 | .kind = .@"error", | |
| 173 | }; | |
| 174 | ||
| 175 | pub const empty_filename: Diagnostic = .{ | |
| 176 | .fmt = "empty filename", | |
| 177 | .kind = .@"error", | |
| 178 | }; | |
| 179 | ||
| 180 | pub const header_str_closing: Diagnostic = .{ | |
| 181 | .fmt = "expected closing '>'", | |
| 182 | .kind = .@"error", | |
| 183 | }; | |
| 184 | ||
| 185 | pub const header_str_match: Diagnostic = .{ | |
| 186 | .fmt = "to match this '<'", | |
| 187 | .kind = .note, | |
| 188 | }; | |
| 189 | ||
| 190 | pub const string_literal_in_pp_expr: Diagnostic = .{ | |
| 191 | .fmt = "string literal in preprocessor expression", | |
| 192 | .kind = .@"error", | |
| 193 | }; | |
| 194 | ||
| 195 | pub const empty_char_literal_warning: Diagnostic = .{ | |
| 196 | .fmt = "empty character constant", | |
| 197 | .kind = .warning, | |
| 198 | .opt = .@"invalid-pp-token", | |
| 199 | .extension = true, | |
| 200 | }; | |
| 201 | ||
| 202 | pub const unterminated_char_literal_warning: Diagnostic = .{ | |
| 203 | .fmt = "missing terminating ' character", | |
| 204 | .kind = .warning, | |
| 205 | .opt = .@"invalid-pp-token", | |
| 206 | .extension = true, | |
| 207 | }; | |
| 208 | ||
| 209 | pub const unterminated_string_literal_warning: Diagnostic = .{ | |
| 210 | .fmt = "missing terminating '\"' character", | |
| 211 | .kind = .warning, | |
| 212 | .opt = .@"invalid-pp-token", | |
| 213 | .extension = true, | |
| 214 | }; | |
| 215 | ||
| 216 | pub const unterminated_comment: Diagnostic = .{ | |
| 217 | .fmt = "unterminated comment", | |
| 218 | .kind = .@"error", | |
| 219 | }; | |
| 220 | ||
| 221 | pub const malformed_embed_param: Diagnostic = .{ | |
| 222 | .fmt = "unexpected token in embed parameter", | |
| 223 | .kind = .@"error", | |
| 224 | }; | |
| 225 | ||
| 226 | pub const malformed_embed_limit: Diagnostic = .{ | |
| 227 | .fmt = "the limit parameter expects one non-negative integer as a parameter", | |
| 228 | .kind = .@"error", | |
| 229 | }; | |
| 230 | ||
| 231 | pub const duplicate_embed_param: Diagnostic = .{ | |
| 232 | .fmt = "duplicate embed parameter '{s}'", | |
| 233 | .kind = .warning, | |
| 234 | .opt = .@"duplicate-embed-param", | |
| 235 | }; | |
| 236 | ||
| 237 | pub const unsupported_embed_param: Diagnostic = .{ | |
| 238 | .fmt = "unsupported embed parameter '{s}' embed parameter", | |
| 239 | .kind = .warning, | |
| 240 | .opt = .@"unsupported-embed-param", | |
| 241 | }; | |
| 242 | ||
| 243 | pub const va_opt_lparen: Diagnostic = .{ | |
| 244 | .fmt = "missing '(' following __VA_OPT__", | |
| 245 | .kind = .@"error", | |
| 246 | }; | |
| 247 | ||
| 248 | pub const va_opt_rparen: Diagnostic = .{ | |
| 249 | .fmt = "unterminated __VA_OPT__ argument list", | |
| 250 | .kind = .@"error", | |
| 251 | }; | |
| 252 | ||
| 253 | pub const keyword_macro: Diagnostic = .{ | |
| 254 | .fmt = "keyword is hidden by macro definition", | |
| 255 | .kind = .off, | |
| 256 | .opt = .@"keyword-macro", | |
| 257 | .extension = true, | |
| 258 | }; | |
| 259 | ||
| 260 | pub const undefined_macro: Diagnostic = .{ | |
| 261 | .fmt = "'{s}' is not defined, evaluates to 0", | |
| 262 | .kind = .off, | |
| 263 | .opt = .undef, | |
| 264 | }; | |
| 265 | ||
| 266 | pub const fn_macro_undefined: Diagnostic = .{ | |
| 267 | .fmt = "function-like macro '{s}' is not defined", | |
| 268 | .kind = .@"error", | |
| 269 | }; | |
| 270 | ||
| 271 | // pub const preprocessing_directive_only: Diagnostic = .{ | |
| 272 | // .fmt = "'{s}' must be used within a preprocessing directive", | |
| 273 | // .extra = .tok_id_expected, | |
| 274 | // .kind = .@"error", | |
| 275 | // }; | |
| 276 | ||
| 277 | pub const missing_lparen_after_builtin: Diagnostic = .{ | |
| 278 | .fmt = "Missing '(' after built-in macro '{s}'", | |
| 279 | .kind = .@"error", | |
| 280 | }; | |
| 281 | ||
| 282 | pub const too_many_includes: Diagnostic = .{ | |
| 283 | .fmt = "#include nested too deeply", | |
| 284 | .kind = .@"error", | |
| 285 | }; | |
| 286 | ||
| 287 | pub const include_next: Diagnostic = .{ | |
| 288 | .fmt = "#include_next is a language extension", | |
| 289 | .kind = .off, | |
| 290 | .opt = .@"gnu-include-next", | |
| 291 | .extension = true, | |
| 292 | }; | |
| 293 | ||
| 294 | pub const include_next_outside_header: Diagnostic = .{ | |
| 295 | .fmt = "#include_next in primary source file; will search from start of include path", | |
| 296 | .kind = .warning, | |
| 297 | .opt = .@"include-next-outside-header", | |
| 298 | }; | |
| 299 | ||
| 300 | pub const comma_deletion_va_args: Diagnostic = .{ | |
| 301 | .fmt = "token pasting of ',' and __VA_ARGS__ is a GNU extension", | |
| 302 | .kind = .off, | |
| 303 | .opt = .@"gnu-zero-variadic-macro-arguments", | |
| 304 | .extension = true, | |
| 305 | }; | |
| 306 | ||
| 307 | pub const expansion_to_defined_obj: Diagnostic = .{ | |
| 308 | .fmt = "macro expansion producing 'defined' has undefined behavior", | |
| 309 | .kind = .off, | |
| 310 | .opt = .@"expansion-to-defined", | |
| 311 | }; | |
| 312 | ||
| 313 | pub const expansion_to_defined_func: Diagnostic = .{ | |
| 314 | .fmt = expansion_to_defined_obj.fmt, | |
| 315 | .kind = .off, | |
| 316 | .opt = .@"expansion-to-defined", | |
| 317 | .extension = true, | |
| 318 | }; | |
| 319 | ||
| 320 | pub const invalid_pp_stringify_escape: Diagnostic = .{ | |
| 321 | .fmt = "invalid string literal, ignoring final '\\'", | |
| 322 | .kind = .warning, | |
| 323 | }; | |
| 324 | ||
| 325 | pub const gnu_va_macro: Diagnostic = .{ | |
| 326 | .fmt = "named variadic macros are a GNU extension", | |
| 327 | .opt = .@"variadic-macros", | |
| 328 | .kind = .off, | |
| 329 | .extension = true, | |
| 330 | }; | |
| 331 | ||
| 332 | pub const pragma_operator_string_literal: Diagnostic = .{ | |
| 333 | .fmt = "_Pragma requires exactly one string literal token", | |
| 334 | .kind = .@"error", | |
| 335 | }; | |
| 336 | ||
| 337 | pub const invalid_preproc_expr_start: Diagnostic = .{ | |
| 338 | .fmt = "invalid token at start of a preprocessor expression", | |
| 339 | .kind = .@"error", | |
| 340 | }; | |
| 341 | ||
| 342 | pub const newline_eof: Diagnostic = .{ | |
| 343 | .fmt = "no newline at end of file", | |
| 344 | .opt = .@"newline-eof", | |
| 345 | .kind = .off, | |
| 346 | .extension = true, | |
| 347 | }; | |
| 348 | ||
| 349 | pub const malformed_warning_check: Diagnostic = .{ | |
| 350 | .fmt = "{s} expected option name (e.g. \"-Wundef\")", | |
| 351 | .opt = .@"malformed-warning-check", | |
| 352 | .kind = .warning, | |
| 353 | .extension = true, | |
| 354 | }; | |
| 355 | ||
| 356 | pub const feature_check_requires_identifier: Diagnostic = .{ | |
| 357 | .fmt = "builtin feature check macro requires a parenthesized identifier", | |
| 358 | .kind = .@"error", | |
| 359 | }; | |
| 360 | ||
| 361 | pub const builtin_macro_redefined: Diagnostic = .{ | |
| 362 | .fmt = "redefining builtin macro", | |
| 363 | .opt = .@"builtin-macro-redefined", | |
| 364 | .kind = .warning, | |
| 365 | .extension = true, | |
| 366 | }; | |
| 367 | ||
| 368 | pub const macro_redefined: Diagnostic = .{ | |
| 369 | .fmt = "'{s}' macro redefined", | |
| 370 | .opt = .@"macro-redefined", | |
| 371 | .kind = .warning, | |
| 372 | .extension = true, | |
| 373 | }; | |
| 374 | ||
| 375 | pub const previous_definition: Diagnostic = .{ | |
| 376 | .fmt = "previous definition is here", | |
| 377 | .kind = .note, | |
| 378 | }; | |
| 379 | ||
| 380 | pub const unterminated_macro_arg_list: Diagnostic = .{ | |
| 381 | .fmt = "unterminated function macro argument list", | |
| 382 | .kind = .@"error", | |
| 383 | }; | |
| 384 | ||
| 385 | pub const to_match_paren: Diagnostic = .{ | |
| 386 | .fmt = "to match this '('", | |
| 387 | .kind = .note, | |
| 388 | }; | |
| 389 | ||
| 390 | pub const closing_paren: Diagnostic = .{ | |
| 391 | .fmt = "expected closing ')'", | |
| 392 | .kind = .@"error", | |
| 393 | }; | |
| 394 | ||
| 395 | pub const poisoned_identifier: Diagnostic = .{ | |
| 396 | .fmt = "attempt to use a poisoned identifier", | |
| 397 | .kind = .@"error", | |
| 398 | }; | |
| 399 | ||
| 400 | pub const expected_arguments: Diagnostic = .{ | |
| 401 | .fmt = "expected {d} argument(s) got {d}", | |
| 402 | .kind = .@"error", | |
| 403 | }; | |
| 404 | ||
| 405 | pub const expected_at_least_arguments: Diagnostic = .{ | |
| 406 | .fmt = "expected at least {d} argument(s) got {d}", | |
| 407 | .kind = .warning, | |
| 408 | }; | |
| 409 | ||
| 410 | pub const invalid_preproc_operator: Diagnostic = .{ | |
| 411 | .fmt = "token is not a valid binary operator in a preprocessor subexpression", | |
| 412 | .kind = .@"error", | |
| 413 | }; | |
| 414 | ||
| 415 | pub const expected_str_literal_in: Diagnostic = .{ | |
| 416 | .fmt = "expected string literal in '{s}'", | |
| 417 | .kind = .@"error", | |
| 418 | }; | |
| 419 | ||
| 420 | pub const builtin_missing_r_paren: Diagnostic = .{ | |
| 421 | .fmt = "missing ')', after {s}", | |
| 422 | .kind = .@"error", | |
| 423 | }; | |
| 424 | ||
| 425 | pub const cannot_convert_to_identifier: Diagnostic = .{ | |
| 426 | .fmt = "cannot convert {s} to an identifier", | |
| 427 | .kind = .@"error", | |
| 428 | }; | |
| 429 | ||
| 430 | pub const expected_identifier: Diagnostic = .{ | |
| 431 | .fmt = "expected identifier argument", | |
| 432 | .kind = .@"error", | |
| 433 | }; | |
| 434 | ||
| 435 | pub const incomplete_ucn: Diagnostic = .{ | |
| 436 | .fmt = "incomplete universal character name; treating as '\\' followed by identifier", | |
| 437 | .kind = .warning, | |
| 438 | .opt = .unicode, | |
| 439 | }; | |
| 440 | ||
| 441 | pub const invalid_source_epoch: Diagnostic = .{ | |
| 442 | .fmt = "environment variable SOURCE_DATE_EPOCH must expand to a non-negative integer less than or equal to 253402300799", | |
| 443 | .kind = .@"error", | |
| 444 | }; | |
| 445 | ||
| 446 | pub const date_time: Diagnostic = .{ | |
| 447 | .fmt = "expansion of date or time macro is not reproducible", | |
| 448 | .kind = .off, | |
| 449 | .opt = .@"date-time", | |
| 450 | .show_in_system_headers = true, | |
| 451 | }; | |
| 452 | ||
| 453 | pub const no_argument_variadic_macro: Diagnostic = .{ | |
| 454 | .fmt = "passing no argument for the '...' parameter of a variadic macro is incompatible with C standards before C23", | |
| 455 | .opt = .@"variadic-macro-arguments-omitted", | |
| 456 | .kind = .off, | |
| 457 | .extension = true, | |
| 458 | }; |
lib/compiler/aro/aro/Source.zig+18-3| ... | ... | @@ -24,6 +24,21 @@ pub const Location = struct { |
| 24 | 24 | pub fn eql(a: Location, b: Location) bool { |
| 25 | 25 | return a.id == b.id and a.byte_offset == b.byte_offset and a.line == b.line; |
| 26 | 26 | } |
| 27 | ||
| 28 | pub fn expand(loc: Location, comp: *const @import("Compilation.zig")) ExpandedLocation { | |
| 29 | const source = comp.getSource(loc.id); | |
| 30 | return source.lineCol(loc); | |
| 31 | } | |
| 32 | }; | |
| 33 | ||
| 34 | pub const ExpandedLocation = struct { | |
| 35 | path: []const u8, | |
| 36 | line: []const u8, | |
| 37 | line_no: u32, | |
| 38 | col: u32, | |
| 39 | width: u32, | |
| 40 | end_with_splice: bool, | |
| 41 | kind: Kind, | |
| 27 | 42 | }; |
| 28 | 43 | |
| 29 | 44 | const Source = @This(); |
| ... | ... | @@ -51,9 +66,7 @@ pub fn physicalLine(source: Source, loc: Location) u32 { |
| 51 | 66 | return loc.line + source.numSplicesBefore(loc.byte_offset); |
| 52 | 67 | } |
| 53 | 68 | |
| 54 | const LineCol = struct { line: []const u8, line_no: u32, col: u32, width: u32, end_with_splice: bool }; | |
| 55 | ||
| 56 | pub fn lineCol(source: Source, loc: Location) LineCol { | |
| 69 | pub fn lineCol(source: Source, loc: Location) ExpandedLocation { | |
| 57 | 70 | var start: usize = 0; |
| 58 | 71 | // find the start of the line which is either a newline or a splice |
| 59 | 72 | 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 { |
| 102 | 115 | nl = source.splice_locs[splice_index]; |
| 103 | 116 | } |
| 104 | 117 | return .{ |
| 118 | .path = source.path, | |
| 105 | 119 | .line = source.buf[start..nl], |
| 106 | 120 | .line_no = loc.line + splice_index, |
| 107 | 121 | .col = col, |
| 108 | 122 | .width = width, |
| 109 | 123 | .end_with_splice = end_with_splice, |
| 124 | .kind = source.kind, | |
| 110 | 125 | }; |
| 111 | 126 | } |
| 112 | 127 |
lib/compiler/aro/aro/StringInterner.zig+16-64| ... | ... | @@ -2,82 +2,34 @@ const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | 3 | const Compilation = @import("Compilation.zig"); |
| 4 | 4 | |
| 5 | const StringToIdMap = std.StringHashMapUnmanaged(StringId); | |
| 5 | const StringInterner = @This(); | |
| 6 | 6 | |
| 7 | 7 | pub const StringId = enum(u32) { |
| 8 | empty, | |
| 8 | empty = std.math.maxInt(u32), | |
| 9 | 9 | _, |
| 10 | }; | |
| 11 | ||
| 12 | pub const TypeMapper = struct { | |
| 13 | const LookupSpeed = enum { | |
| 14 | fast, | |
| 15 | slow, | |
| 16 | }; | |
| 17 | ||
| 18 | data: union(LookupSpeed) { | |
| 19 | fast: []const []const u8, | |
| 20 | slow: *const StringToIdMap, | |
| 21 | }, | |
| 22 | 10 | |
| 23 | pub fn lookup(self: TypeMapper, string_id: StringInterner.StringId) []const u8 { | |
| 24 | if (string_id == .empty) return ""; | |
| 25 | switch (self.data) { | |
| 26 | .fast => |arr| return arr[@intFromEnum(string_id)], | |
| 27 | .slow => |map| { | |
| 28 | var it = map.iterator(); | |
| 29 | while (it.next()) |entry| { | |
| 30 | if (entry.value_ptr.* == string_id) return entry.key_ptr.*; | |
| 31 | } | |
| 32 | unreachable; | |
| 33 | }, | |
| 34 | } | |
| 11 | pub fn lookup(id: StringId, comp: *const Compilation) []const u8 { | |
| 12 | if (id == .empty) return ""; | |
| 13 | return comp.string_interner.table.keys()[@intFromEnum(id)]; | |
| 35 | 14 | } |
| 36 | 15 | |
| 37 | pub fn deinit(self: TypeMapper, allocator: mem.Allocator) void { | |
| 38 | switch (self.data) { | |
| 39 | .slow => {}, | |
| 40 | .fast => |arr| allocator.free(arr), | |
| 41 | } | |
| 16 | pub fn lookupExtra(id: StringId, si: StringInterner) []const u8 { | |
| 17 | if (id == .empty) return ""; | |
| 18 | return si.table.keys()[@intFromEnum(id)]; | |
| 42 | 19 | } |
| 43 | 20 | }; |
| 44 | 21 | |
| 45 | const StringInterner = @This(); | |
| 46 | ||
| 47 | string_table: StringToIdMap = .{}, | |
| 48 | next_id: StringId = @enumFromInt(@intFromEnum(StringId.empty) + 1), | |
| 49 | ||
| 50 | pub fn deinit(self: *StringInterner, allocator: mem.Allocator) void { | |
| 51 | self.string_table.deinit(allocator); | |
| 52 | } | |
| 22 | table: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 53 | 23 | |
| 54 | pub fn intern(comp: *Compilation, str: []const u8) !StringId { | |
| 55 | return comp.string_interner.internExtra(comp.gpa, str); | |
| 24 | pub fn deinit(si: *StringInterner, allocator: mem.Allocator) void { | |
| 25 | si.table.deinit(allocator); | |
| 26 | si.* = undefined; | |
| 56 | 27 | } |
| 57 | 28 | |
| 58 | pub fn internExtra(self: *StringInterner, allocator: mem.Allocator, str: []const u8) !StringId { | |
| 29 | /// Intern externally owned string. | |
| 30 | pub fn intern(si: *StringInterner, allocator: mem.Allocator, str: []const u8) !StringId { | |
| 59 | 31 | if (str.len == 0) return .empty; |
| 60 | 32 | |
| 61 | const gop = try self.string_table.getOrPut(allocator, str); | |
| 62 | if (gop.found_existing) return gop.value_ptr.*; | |
| 63 | ||
| 64 | defer self.next_id = @enumFromInt(@intFromEnum(self.next_id) + 1); | |
| 65 | gop.value_ptr.* = self.next_id; | |
| 66 | return self.next_id; | |
| 67 | } | |
| 68 | ||
| 69 | /// deinit for the returned TypeMapper is a no-op and does not need to be called | |
| 70 | pub fn getSlowTypeMapper(self: *const StringInterner) TypeMapper { | |
| 71 | return TypeMapper{ .data = .{ .slow = &self.string_table } }; | |
| 72 | } | |
| 73 | ||
| 74 | /// Caller must call `deinit` on the returned TypeMapper | |
| 75 | pub fn getFastTypeMapper(self: *const StringInterner, allocator: mem.Allocator) !TypeMapper { | |
| 76 | var strings = try allocator.alloc([]const u8, @intFromEnum(self.next_id)); | |
| 77 | var it = self.string_table.iterator(); | |
| 78 | strings[0] = ""; | |
| 79 | while (it.next()) |entry| { | |
| 80 | strings[@intFromEnum(entry.value_ptr.*)] = entry.key_ptr.*; | |
| 81 | } | |
| 82 | return TypeMapper{ .data = .{ .fast = strings } }; | |
| 33 | const gop = try si.table.getOrPut(allocator, str); | |
| 34 | return @enumFromInt(gop.index); | |
| 83 | 35 | } |
lib/compiler/aro/aro/SymbolStack.zig+123-87| ... | ... | @@ -2,22 +2,24 @@ const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | 3 | const Allocator = mem.Allocator; |
| 4 | 4 | const assert = std.debug.assert; |
| 5 | ||
| 6 | const Parser = @import("Parser.zig"); | |
| 7 | const StringId = @import("StringInterner.zig").StringId; | |
| 5 | 8 | const Tree = @import("Tree.zig"); |
| 6 | 9 | const Token = Tree.Token; |
| 7 | 10 | const TokenIndex = Tree.TokenIndex; |
| 8 | const NodeIndex = Tree.NodeIndex; | |
| 9 | const Type = @import("Type.zig"); | |
| 10 | const Parser = @import("Parser.zig"); | |
| 11 | const Node = Tree.Node; | |
| 12 | const QualType = @import("TypeStore.zig").QualType; | |
| 11 | 13 | const Value = @import("Value.zig"); |
| 12 | const StringId = @import("StringInterner.zig").StringId; | |
| 13 | 14 | |
| 14 | 15 | const SymbolStack = @This(); |
| 15 | 16 | |
| 16 | 17 | pub const Symbol = struct { |
| 17 | 18 | name: StringId, |
| 18 | ty: Type, | |
| 19 | qt: QualType, | |
| 19 | 20 | tok: TokenIndex, |
| 20 | node: NodeIndex = .none, | |
| 21 | node: Node.OptIndex = .null, | |
| 22 | out_of_scope: bool = false, | |
| 21 | 23 | kind: Kind, |
| 22 | 24 | val: Value, |
| 23 | 25 | }; |
| ... | ... | @@ -33,7 +35,7 @@ pub const Kind = enum { |
| 33 | 35 | constexpr, |
| 34 | 36 | }; |
| 35 | 37 | |
| 36 | scopes: std.ArrayListUnmanaged(Scope) = .empty, | |
| 38 | scopes: std.ArrayList(Scope) = .empty, | |
| 37 | 39 | /// allocations from nested scopes are retained after popping; `active_len` is the number |
| 38 | 40 | /// of currently-active items in `scopes`. |
| 39 | 41 | active_len: usize = 0, |
| ... | ... | @@ -64,7 +66,7 @@ pub fn deinit(s: *SymbolStack, gpa: Allocator) void { |
| 64 | 66 | |
| 65 | 67 | pub fn pushScope(s: *SymbolStack, p: *Parser) !void { |
| 66 | 68 | if (s.active_len + 1 > s.scopes.items.len) { |
| 67 | try s.scopes.append(p.gpa, .{}); | |
| 69 | try s.scopes.append(p.comp.gpa, .{}); | |
| 68 | 70 | s.active_len = s.scopes.items.len; |
| 69 | 71 | } else { |
| 70 | 72 | s.scopes.items[s.active_len].clearRetainingCapacity(); |
| ... | ... | @@ -82,17 +84,17 @@ pub fn findTypedef(s: *SymbolStack, p: *Parser, name: StringId, name_tok: TokenI |
| 82 | 84 | .typedef => return prev, |
| 83 | 85 | .@"struct" => { |
| 84 | 86 | if (no_type_yet) return null; |
| 85 | try p.errStr(.must_use_struct, name_tok, p.tokSlice(name_tok)); | |
| 87 | try p.err(name_tok, .must_use_struct, .{p.tokSlice(name_tok)}); | |
| 86 | 88 | return prev; |
| 87 | 89 | }, |
| 88 | 90 | .@"union" => { |
| 89 | 91 | if (no_type_yet) return null; |
| 90 | try p.errStr(.must_use_union, name_tok, p.tokSlice(name_tok)); | |
| 92 | try p.err(name_tok, .must_use_union, .{p.tokSlice(name_tok)}); | |
| 91 | 93 | return prev; |
| 92 | 94 | }, |
| 93 | 95 | .@"enum" => { |
| 94 | 96 | if (no_type_yet) return null; |
| 95 | try p.errStr(.must_use_enum, name_tok, p.tokSlice(name_tok)); | |
| 97 | try p.err(name_tok, .must_use_enum, .{p.tokSlice(name_tok)}); | |
| 96 | 98 | return prev; |
| 97 | 99 | }, |
| 98 | 100 | else => return null, |
| ... | ... | @@ -120,8 +122,8 @@ pub fn findTag( |
| 120 | 122 | else => unreachable, |
| 121 | 123 | } |
| 122 | 124 | if (s.get(name, .tags) == null) return null; |
| 123 | try p.errStr(.wrong_tag, name_tok, p.tokSlice(name_tok)); | |
| 124 | try p.errTok(.previous_definition, prev.tok); | |
| 125 | try p.err(name_tok, .wrong_tag, .{p.tokSlice(name_tok)}); | |
| 126 | try p.err(prev.tok, .previous_definition, .{}); | |
| 125 | 127 | return null; |
| 126 | 128 | } |
| 127 | 129 | |
| ... | ... | @@ -171,38 +173,34 @@ pub fn defineTypedef( |
| 171 | 173 | s: *SymbolStack, |
| 172 | 174 | p: *Parser, |
| 173 | 175 | name: StringId, |
| 174 | ty: Type, | |
| 176 | qt: QualType, | |
| 175 | 177 | tok: TokenIndex, |
| 176 | node: NodeIndex, | |
| 178 | node: Node.Index, | |
| 177 | 179 | ) !void { |
| 178 | 180 | if (s.get(name, .vars)) |prev| { |
| 179 | 181 | switch (prev.kind) { |
| 180 | 182 | .typedef => { |
| 181 | if (!prev.ty.is(.invalid)) { | |
| 182 | if (!ty.eql(prev.ty, p.comp, true)) { | |
| 183 | try p.errStr(.redefinition_of_typedef, tok, try p.typePairStrExtra(ty, " vs ", prev.ty)); | |
| 184 | if (prev.tok != 0) try p.errTok(.previous_definition, prev.tok); | |
| 185 | } | |
| 183 | if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { | |
| 184 | if (qt.isInvalid()) return; | |
| 185 | const non_typedef_qt = qt.type(p.comp).typedef.base; | |
| 186 | const non_typedef_prev_qt = prev.qt.type(p.comp).typedef.base; | |
| 187 | try p.err(tok, .redefinition_of_typedef, .{ non_typedef_qt, non_typedef_prev_qt }); | |
| 188 | if (prev.tok != 0) try p.err(prev.tok, .previous_definition, .{}); | |
| 186 | 189 | } |
| 187 | 190 | }, |
| 188 | 191 | .enumeration, .decl, .def, .constexpr => { |
| 189 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 190 | try p.errTok(.previous_definition, prev.tok); | |
| 192 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 193 | try p.err(prev.tok, .previous_definition, .{}); | |
| 191 | 194 | }, |
| 192 | 195 | else => unreachable, |
| 193 | 196 | } |
| 194 | 197 | } |
| 195 | try s.define(p.gpa, .{ | |
| 198 | try s.define(p.comp.gpa, .{ | |
| 196 | 199 | .kind = .typedef, |
| 197 | 200 | .name = name, |
| 198 | 201 | .tok = tok, |
| 199 | .ty = .{ | |
| 200 | .name = name, | |
| 201 | .specifier = ty.specifier, | |
| 202 | .qual = ty.qual, | |
| 203 | .data = ty.data, | |
| 204 | }, | |
| 205 | .node = node, | |
| 202 | .qt = qt, | |
| 203 | .node = .pack(node), | |
| 206 | 204 | .val = .{}, |
| 207 | 205 | }); |
| 208 | 206 | } |
| ... | ... | @@ -211,42 +209,48 @@ pub fn defineSymbol( |
| 211 | 209 | s: *SymbolStack, |
| 212 | 210 | p: *Parser, |
| 213 | 211 | name: StringId, |
| 214 | ty: Type, | |
| 212 | qt: QualType, | |
| 215 | 213 | tok: TokenIndex, |
| 216 | node: NodeIndex, | |
| 214 | node: Node.Index, | |
| 217 | 215 | val: Value, |
| 218 | 216 | constexpr: bool, |
| 219 | 217 | ) !void { |
| 220 | 218 | if (s.get(name, .vars)) |prev| { |
| 221 | 219 | switch (prev.kind) { |
| 222 | 220 | .enumeration => { |
| 223 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 224 | try p.errTok(.previous_definition, prev.tok); | |
| 221 | if (qt.isInvalid()) return; | |
| 222 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 223 | try p.err(prev.tok, .previous_definition, .{}); | |
| 225 | 224 | }, |
| 226 | 225 | .decl => { |
| 227 | if (!ty.eql(prev.ty, p.comp, true)) { | |
| 228 | try p.errStr(.redefinition_incompatible, tok, p.tokSlice(tok)); | |
| 229 | try p.errTok(.previous_definition, prev.tok); | |
| 226 | if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { | |
| 227 | if (qt.isInvalid()) return; | |
| 228 | try p.err(tok, .redefinition_incompatible, .{p.tokSlice(tok)}); | |
| 229 | try p.err(prev.tok, .previous_definition, .{}); | |
| 230 | } else { | |
| 231 | if (prev.node.unpack()) |some| p.setTentativeDeclDefinition(some, node); | |
| 230 | 232 | } |
| 231 | 233 | }, |
| 232 | .def, .constexpr => { | |
| 233 | try p.errStr(.redefinition, tok, p.tokSlice(tok)); | |
| 234 | try p.errTok(.previous_definition, prev.tok); | |
| 234 | .def, .constexpr => if (!prev.qt.isInvalid()) { | |
| 235 | if (qt.isInvalid()) return; | |
| 236 | try p.err(tok, .redefinition, .{p.tokSlice(tok)}); | |
| 237 | try p.err(prev.tok, .previous_definition, .{}); | |
| 235 | 238 | }, |
| 236 | 239 | .typedef => { |
| 237 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 238 | try p.errTok(.previous_definition, prev.tok); | |
| 240 | if (qt.isInvalid()) return; | |
| 241 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 242 | try p.err(prev.tok, .previous_definition, .{}); | |
| 239 | 243 | }, |
| 240 | 244 | else => unreachable, |
| 241 | 245 | } |
| 242 | 246 | } |
| 243 | 247 | |
| 244 | try s.define(p.gpa, .{ | |
| 248 | try s.define(p.comp.gpa, .{ | |
| 245 | 249 | .kind = if (constexpr) .constexpr else .def, |
| 246 | 250 | .name = name, |
| 247 | 251 | .tok = tok, |
| 248 | .ty = ty, | |
| 249 | .node = node, | |
| 252 | .qt = qt, | |
| 253 | .node = .pack(node), | |
| 250 | 254 | .val = val, |
| 251 | 255 | }); |
| 252 | 256 | } |
| ... | ... | @@ -264,69 +268,96 @@ pub fn declareSymbol( |
| 264 | 268 | s: *SymbolStack, |
| 265 | 269 | p: *Parser, |
| 266 | 270 | name: StringId, |
| 267 | ty: Type, | |
| 271 | qt: QualType, | |
| 268 | 272 | tok: TokenIndex, |
| 269 | node: NodeIndex, | |
| 273 | node: Node.Index, | |
| 270 | 274 | ) !void { |
| 271 | 275 | if (s.get(name, .vars)) |prev| { |
| 272 | 276 | switch (prev.kind) { |
| 273 | 277 | .enumeration => { |
| 274 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 275 | try p.errTok(.previous_definition, prev.tok); | |
| 278 | if (qt.isInvalid()) return; | |
| 279 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 280 | try p.err(prev.tok, .previous_definition, .{}); | |
| 276 | 281 | }, |
| 277 | 282 | .decl => { |
| 278 | if (!ty.eql(prev.ty, p.comp, true)) { | |
| 279 | try p.errStr(.redefinition_incompatible, tok, p.tokSlice(tok)); | |
| 280 | try p.errTok(.previous_definition, prev.tok); | |
| 283 | if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { | |
| 284 | if (qt.isInvalid()) return; | |
| 285 | try p.err(tok, .redefinition_incompatible, .{p.tokSlice(tok)}); | |
| 286 | try p.err(prev.tok, .previous_definition, .{}); | |
| 287 | } else { | |
| 288 | if (prev.node.unpack()) |some| p.setTentativeDeclDefinition(node, some); | |
| 281 | 289 | } |
| 282 | 290 | }, |
| 283 | 291 | .def, .constexpr => { |
| 284 | if (!ty.eql(prev.ty, p.comp, true)) { | |
| 285 | try p.errStr(.redefinition_incompatible, tok, p.tokSlice(tok)); | |
| 286 | try p.errTok(.previous_definition, prev.tok); | |
| 292 | if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { | |
| 293 | if (qt.isInvalid()) return; | |
| 294 | try p.err(tok, .redefinition_incompatible, .{p.tokSlice(tok)}); | |
| 295 | try p.err(prev.tok, .previous_definition, .{}); | |
| 287 | 296 | } else { |
| 297 | if (prev.node.unpack()) |some| p.setTentativeDeclDefinition(node, some); | |
| 288 | 298 | return; |
| 289 | 299 | } |
| 290 | 300 | }, |
| 291 | 301 | .typedef => { |
| 292 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 293 | try p.errTok(.previous_definition, prev.tok); | |
| 302 | if (qt.isInvalid()) return; | |
| 303 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 304 | try p.err(prev.tok, .previous_definition, .{}); | |
| 294 | 305 | }, |
| 295 | 306 | else => unreachable, |
| 296 | 307 | } |
| 297 | 308 | } |
| 298 | try s.define(p.gpa, .{ | |
| 309 | try s.define(p.comp.gpa, .{ | |
| 299 | 310 | .kind = .decl, |
| 300 | 311 | .name = name, |
| 301 | 312 | .tok = tok, |
| 302 | .ty = ty, | |
| 303 | .node = node, | |
| 313 | .qt = qt, | |
| 314 | .node = .pack(node), | |
| 304 | 315 | .val = .{}, |
| 305 | 316 | }); |
| 317 | ||
| 318 | // Declare out of scope symbol for functions declared in functions. | |
| 319 | if (s.active_len > 1 and !p.comp.langopts.standard.atLeast(.c23) and qt.is(p.comp, .func)) { | |
| 320 | try s.scopes.items[0].vars.put(p.comp.gpa, name, .{ | |
| 321 | .kind = .decl, | |
| 322 | .name = name, | |
| 323 | .tok = tok, | |
| 324 | .qt = qt, | |
| 325 | .node = .pack(node), | |
| 326 | .val = .{}, | |
| 327 | .out_of_scope = true, | |
| 328 | }); | |
| 329 | } | |
| 306 | 330 | } |
| 307 | 331 | |
| 308 | pub fn defineParam(s: *SymbolStack, p: *Parser, name: StringId, ty: Type, tok: TokenIndex) !void { | |
| 332 | pub fn defineParam( | |
| 333 | s: *SymbolStack, | |
| 334 | p: *Parser, | |
| 335 | name: StringId, | |
| 336 | qt: QualType, | |
| 337 | tok: TokenIndex, | |
| 338 | node: ?Node.Index, | |
| 339 | ) !void { | |
| 309 | 340 | if (s.get(name, .vars)) |prev| { |
| 310 | 341 | switch (prev.kind) { |
| 311 | .enumeration, .decl, .def, .constexpr => { | |
| 312 | try p.errStr(.redefinition_of_parameter, tok, p.tokSlice(tok)); | |
| 313 | try p.errTok(.previous_definition, prev.tok); | |
| 342 | .enumeration, .decl, .def, .constexpr => if (!prev.qt.isInvalid()) { | |
| 343 | if (qt.isInvalid()) return; | |
| 344 | try p.err(tok, .redefinition_of_parameter, .{p.tokSlice(tok)}); | |
| 345 | try p.err(prev.tok, .previous_definition, .{}); | |
| 314 | 346 | }, |
| 315 | 347 | .typedef => { |
| 316 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 317 | try p.errTok(.previous_definition, prev.tok); | |
| 348 | if (qt.isInvalid()) return; | |
| 349 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 350 | try p.err(prev.tok, .previous_definition, .{}); | |
| 318 | 351 | }, |
| 319 | 352 | else => unreachable, |
| 320 | 353 | } |
| 321 | 354 | } |
| 322 | if (ty.is(.fp16) and !p.comp.hasHalfPrecisionFloatABI()) { | |
| 323 | try p.errStr(.suggest_pointer_for_invalid_fp16, tok, "parameters"); | |
| 324 | } | |
| 325 | try s.define(p.gpa, .{ | |
| 355 | try s.define(p.comp.gpa, .{ | |
| 326 | 356 | .kind = .def, |
| 327 | 357 | .name = name, |
| 328 | 358 | .tok = tok, |
| 329 | .ty = ty, | |
| 359 | .qt = qt, | |
| 360 | .node = .packOpt(node), | |
| 330 | 361 | .val = .{}, |
| 331 | 362 | }); |
| 332 | 363 | } |
| ... | ... | @@ -342,20 +373,20 @@ pub fn defineTag( |
| 342 | 373 | switch (prev.kind) { |
| 343 | 374 | .@"enum" => { |
| 344 | 375 | if (kind == .keyword_enum) return prev; |
| 345 | try p.errStr(.wrong_tag, tok, p.tokSlice(tok)); | |
| 346 | try p.errTok(.previous_definition, prev.tok); | |
| 376 | try p.err(tok, .wrong_tag, .{p.tokSlice(tok)}); | |
| 377 | try p.err(prev.tok, .previous_definition, .{}); | |
| 347 | 378 | return null; |
| 348 | 379 | }, |
| 349 | 380 | .@"struct" => { |
| 350 | 381 | if (kind == .keyword_struct) return prev; |
| 351 | try p.errStr(.wrong_tag, tok, p.tokSlice(tok)); | |
| 352 | try p.errTok(.previous_definition, prev.tok); | |
| 382 | try p.err(tok, .wrong_tag, .{p.tokSlice(tok)}); | |
| 383 | try p.err(prev.tok, .previous_definition, .{}); | |
| 353 | 384 | return null; |
| 354 | 385 | }, |
| 355 | 386 | .@"union" => { |
| 356 | 387 | if (kind == .keyword_union) return prev; |
| 357 | try p.errStr(.wrong_tag, tok, p.tokSlice(tok)); | |
| 358 | try p.errTok(.previous_definition, prev.tok); | |
| 388 | try p.err(tok, .wrong_tag, .{p.tokSlice(tok)}); | |
| 389 | try p.err(prev.tok, .previous_definition, .{}); | |
| 359 | 390 | return null; |
| 360 | 391 | }, |
| 361 | 392 | else => unreachable, |
| ... | ... | @@ -366,34 +397,39 @@ pub fn defineEnumeration( |
| 366 | 397 | s: *SymbolStack, |
| 367 | 398 | p: *Parser, |
| 368 | 399 | name: StringId, |
| 369 | ty: Type, | |
| 400 | qt: QualType, | |
| 370 | 401 | tok: TokenIndex, |
| 371 | 402 | val: Value, |
| 403 | node: Node.Index, | |
| 372 | 404 | ) !void { |
| 373 | 405 | if (s.get(name, .vars)) |prev| { |
| 374 | 406 | switch (prev.kind) { |
| 375 | .enumeration => { | |
| 376 | try p.errStr(.redefinition, tok, p.tokSlice(tok)); | |
| 377 | try p.errTok(.previous_definition, prev.tok); | |
| 407 | .enumeration => if (!prev.qt.isInvalid()) { | |
| 408 | if (qt.isInvalid()) return; | |
| 409 | try p.err(tok, .redefinition, .{p.tokSlice(tok)}); | |
| 410 | try p.err(prev.tok, .previous_definition, .{}); | |
| 378 | 411 | return; |
| 379 | 412 | }, |
| 380 | 413 | .decl, .def, .constexpr => { |
| 381 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 382 | try p.errTok(.previous_definition, prev.tok); | |
| 414 | if (qt.isInvalid()) return; | |
| 415 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 416 | try p.err(prev.tok, .previous_definition, .{}); | |
| 383 | 417 | return; |
| 384 | 418 | }, |
| 385 | 419 | .typedef => { |
| 386 | try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); | |
| 387 | try p.errTok(.previous_definition, prev.tok); | |
| 420 | if (qt.isInvalid()) return; | |
| 421 | try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); | |
| 422 | try p.err(prev.tok, .previous_definition, .{}); | |
| 388 | 423 | }, |
| 389 | 424 | else => unreachable, |
| 390 | 425 | } |
| 391 | 426 | } |
| 392 | try s.define(p.gpa, .{ | |
| 427 | try s.define(p.comp.gpa, .{ | |
| 393 | 428 | .kind = .enumeration, |
| 394 | 429 | .name = name, |
| 395 | 430 | .tok = tok, |
| 396 | .ty = ty, | |
| 431 | .qt = qt, | |
| 397 | 432 | .val = val, |
| 433 | .node = .pack(node), | |
| 398 | 434 | }); |
| 399 | 435 | } |
lib/compiler/aro/aro/Tokenizer.zig+238-56| ... | ... | @@ -1,8 +1,45 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const assert = std.debug.assert; |
| 3 | ||
| 3 | 4 | const Compilation = @import("Compilation.zig"); |
| 4 | const Source = @import("Source.zig"); | |
| 5 | 5 | const LangOpts = @import("LangOpts.zig"); |
| 6 | const Source = @import("Source.zig"); | |
| 7 | ||
| 8 | /// Value for valid escapes indicates how many characters to consume, not counting leading backslash | |
| 9 | const UCNKind = enum(u8) { | |
| 10 | /// Just `\` | |
| 11 | none, | |
| 12 | /// \u or \U followed by an insufficient number of hex digits | |
| 13 | incomplete, | |
| 14 | /// `\uxxxx` | |
| 15 | hex4 = 5, | |
| 16 | /// `\Uxxxxxxxx` | |
| 17 | hex8 = 9, | |
| 18 | ||
| 19 | /// In the classification phase we do not care if the escape represents a valid universal character name | |
| 20 | /// e.g. \UFFFFFFFF is acceptable. | |
| 21 | fn classify(buf: []const u8) UCNKind { | |
| 22 | assert(buf[0] == '\\'); | |
| 23 | if (buf.len == 1) return .none; | |
| 24 | switch (buf[1]) { | |
| 25 | 'u' => { | |
| 26 | if (buf.len < 6) return .incomplete; | |
| 27 | for (buf[2..6]) |c| { | |
| 28 | if (!std.ascii.isHex(c)) return .incomplete; | |
| 29 | } | |
| 30 | return .hex4; | |
| 31 | }, | |
| 32 | 'U' => { | |
| 33 | if (buf.len < 10) return .incomplete; | |
| 34 | for (buf[2..10]) |c| { | |
| 35 | if (!std.ascii.isHex(c)) return .incomplete; | |
| 36 | } | |
| 37 | return .hex8; | |
| 38 | }, | |
| 39 | else => return .none, | |
| 40 | } | |
| 41 | } | |
| 42 | }; | |
| 6 | 43 | |
| 7 | 44 | pub const Token = struct { |
| 8 | 45 | id: Id, |
| ... | ... | @@ -18,7 +55,7 @@ pub const Token = struct { |
| 18 | 55 | eof, |
| 19 | 56 | /// identifier containing solely basic character set characters |
| 20 | 57 | identifier, |
| 21 | /// identifier with at least one extended character | |
| 58 | /// identifier with at least one extended character or UCN escape sequence | |
| 22 | 59 | extended_identifier, |
| 23 | 60 | |
| 24 | 61 | // string literals with prefixes |
| ... | ... | @@ -147,6 +184,10 @@ pub const Token = struct { |
| 147 | 184 | macro_counter, |
| 148 | 185 | /// Special token for implementing _Pragma |
| 149 | 186 | macro_param_pragma_operator, |
| 187 | /// Special token for implementing __identifier (MS extension) | |
| 188 | macro_param_ms_identifier, | |
| 189 | /// Special token for implementing __pragma (MS extension) | |
| 190 | macro_param_ms_pragma, | |
| 150 | 191 | |
| 151 | 192 | /// Special identifier for implementing __func__ |
| 152 | 193 | macro_func, |
| ... | ... | @@ -154,6 +195,12 @@ pub const Token = struct { |
| 154 | 195 | macro_function, |
| 155 | 196 | /// Special identifier for implementing __PRETTY_FUNCTION__ |
| 156 | 197 | macro_pretty_func, |
| 198 | /// Special identifier for implementing __DATE__ | |
| 199 | macro_date, | |
| 200 | /// Special identifier for implementing __TIME__ | |
| 201 | macro_time, | |
| 202 | /// Special identifier for implementing __TIMESTAMP__ | |
| 203 | macro_timestamp, | |
| 157 | 204 | |
| 158 | 205 | keyword_auto, |
| 159 | 206 | keyword_auto_type, |
| ... | ... | @@ -290,13 +337,21 @@ pub const Token = struct { |
| 290 | 337 | keyword_thiscall2, |
| 291 | 338 | keyword_vectorcall, |
| 292 | 339 | keyword_vectorcall2, |
| 293 | ||
| 294 | // builtins that require special parsing | |
| 295 | builtin_choose_expr, | |
| 296 | builtin_va_arg, | |
| 297 | builtin_offsetof, | |
| 298 | builtin_bitoffsetof, | |
| 299 | builtin_types_compatible_p, | |
| 340 | keyword_fastcall, | |
| 341 | keyword_fastcall2, | |
| 342 | keyword_regcall, | |
| 343 | keyword_cdecl, | |
| 344 | keyword_cdecl2, | |
| 345 | keyword_forceinline, | |
| 346 | keyword_forceinline2, | |
| 347 | keyword_unaligned, | |
| 348 | keyword_unaligned2, | |
| 349 | ||
| 350 | // Type nullability | |
| 351 | keyword_nonnull, | |
| 352 | keyword_nullable, | |
| 353 | keyword_nullable_result, | |
| 354 | keyword_null_unspecified, | |
| 300 | 355 | |
| 301 | 356 | /// Generated by #embed directive |
| 302 | 357 | /// Decimal value with no prefix or suffix |
| ... | ... | @@ -323,6 +378,12 @@ pub const Token = struct { |
| 323 | 378 | /// A comment token if asked to preserve comments. |
| 324 | 379 | comment, |
| 325 | 380 | |
| 381 | /// Incomplete universal character name | |
| 382 | /// This happens if the source text contains `\u` or `\U` followed by an insufficient number of hex | |
| 383 | /// digits. This token id represents just the backslash; the subsequent `u` or `U` will be treated as the | |
| 384 | /// leading character of the following identifier token. | |
| 385 | incomplete_ucn, | |
| 386 | ||
| 326 | 387 | /// Return true if token is identifier or keyword. |
| 327 | 388 | pub fn isMacroIdentifier(id: Id) bool { |
| 328 | 389 | switch (id) { |
| ... | ... | @@ -347,6 +408,9 @@ pub const Token = struct { |
| 347 | 408 | .macro_func, |
| 348 | 409 | .macro_function, |
| 349 | 410 | .macro_pretty_func, |
| 411 | .macro_date, | |
| 412 | .macro_time, | |
| 413 | .macro_timestamp, | |
| 350 | 414 | .keyword_auto, |
| 351 | 415 | .keyword_auto_type, |
| 352 | 416 | .keyword_break, |
| ... | ... | @@ -409,11 +473,6 @@ pub const Token = struct { |
| 409 | 473 | .keyword_restrict2, |
| 410 | 474 | .keyword_alignof1, |
| 411 | 475 | .keyword_alignof2, |
| 412 | .builtin_choose_expr, | |
| 413 | .builtin_va_arg, | |
| 414 | .builtin_offsetof, | |
| 415 | .builtin_bitoffsetof, | |
| 416 | .builtin_types_compatible_p, | |
| 417 | 476 | .keyword_attribute1, |
| 418 | 477 | .keyword_attribute2, |
| 419 | 478 | .keyword_extension, |
| ... | ... | @@ -444,6 +503,19 @@ pub const Token = struct { |
| 444 | 503 | .keyword_thiscall2, |
| 445 | 504 | .keyword_vectorcall, |
| 446 | 505 | .keyword_vectorcall2, |
| 506 | .keyword_fastcall, | |
| 507 | .keyword_fastcall2, | |
| 508 | .keyword_regcall, | |
| 509 | .keyword_cdecl, | |
| 510 | .keyword_cdecl2, | |
| 511 | .keyword_forceinline, | |
| 512 | .keyword_forceinline2, | |
| 513 | .keyword_unaligned, | |
| 514 | .keyword_unaligned2, | |
| 515 | .keyword_nonnull, | |
| 516 | .keyword_nullable, | |
| 517 | .keyword_nullable_result, | |
| 518 | .keyword_null_unspecified, | |
| 447 | 519 | .keyword_bit_int, |
| 448 | 520 | .keyword_c23_alignas, |
| 449 | 521 | .keyword_c23_alignof, |
| ... | ... | @@ -547,11 +619,18 @@ pub const Token = struct { |
| 547 | 619 | .macro_file, |
| 548 | 620 | .macro_line, |
| 549 | 621 | .macro_counter, |
| 622 | .macro_time, | |
| 623 | .macro_date, | |
| 624 | .macro_timestamp, | |
| 550 | 625 | .macro_param_pragma_operator, |
| 626 | .macro_param_ms_identifier, | |
| 627 | .macro_param_ms_pragma, | |
| 551 | 628 | .placemarker, |
| 552 | 629 | => "", |
| 553 | 630 | .macro_ws => " ", |
| 554 | 631 | |
| 632 | .incomplete_ucn => "\\", | |
| 633 | ||
| 555 | 634 | .macro_func => "__func__", |
| 556 | 635 | .macro_function => "__FUNCTION__", |
| 557 | 636 | .macro_pretty_func => "__PRETTY_FUNCTION__", |
| ... | ... | @@ -695,11 +774,6 @@ pub const Token = struct { |
| 695 | 774 | .keyword_alignof2 => "__alignof__", |
| 696 | 775 | .keyword_typeof1 => "__typeof", |
| 697 | 776 | .keyword_typeof2 => "__typeof__", |
| 698 | .builtin_choose_expr => "__builtin_choose_expr", | |
| 699 | .builtin_va_arg => "__builtin_va_arg", | |
| 700 | .builtin_offsetof => "__builtin_offsetof", | |
| 701 | .builtin_bitoffsetof => "__builtin_bitoffsetof", | |
| 702 | .builtin_types_compatible_p => "__builtin_types_compatible_p", | |
| 703 | 777 | .keyword_attribute1 => "__attribute", |
| 704 | 778 | .keyword_attribute2 => "__attribute__", |
| 705 | 779 | .keyword_extension => "__extension__", |
| ... | ... | @@ -730,6 +804,19 @@ pub const Token = struct { |
| 730 | 804 | .keyword_thiscall2 => "_thiscall", |
| 731 | 805 | .keyword_vectorcall => "__vectorcall", |
| 732 | 806 | .keyword_vectorcall2 => "_vectorcall", |
| 807 | .keyword_fastcall => "__fastcall", | |
| 808 | .keyword_fastcall2 => "_fastcall", | |
| 809 | .keyword_regcall => "__regcall", | |
| 810 | .keyword_cdecl => "__cdecl", | |
| 811 | .keyword_cdecl2 => "_cdecl", | |
| 812 | .keyword_forceinline => "__forceinline", | |
| 813 | .keyword_forceinline2 => "_forceinline", | |
| 814 | .keyword_unaligned => "__unaligned", | |
| 815 | .keyword_unaligned2 => "_unaligned", | |
| 816 | .keyword_nonnull => "_Nonnull", | |
| 817 | .keyword_nullable => "_Nullable", | |
| 818 | .keyword_nullable_result => "_Nullable_result", | |
| 819 | .keyword_null_unspecified => "_Null_unspecified", | |
| 733 | 820 | }; |
| 734 | 821 | } |
| 735 | 822 | |
| ... | ... | @@ -742,11 +829,6 @@ pub const Token = struct { |
| 742 | 829 | .macro_func, |
| 743 | 830 | .macro_function, |
| 744 | 831 | .macro_pretty_func, |
| 745 | .builtin_choose_expr, | |
| 746 | .builtin_va_arg, | |
| 747 | .builtin_offsetof, | |
| 748 | .builtin_bitoffsetof, | |
| 749 | .builtin_types_compatible_p, | |
| 750 | 832 | => "an identifier", |
| 751 | 833 | .string_literal, |
| 752 | 834 | .string_literal_utf_16, |
| ... | ... | @@ -763,7 +845,7 @@ pub const Token = struct { |
| 763 | 845 | .unterminated_char_literal, |
| 764 | 846 | .empty_char_literal, |
| 765 | 847 | => "a character literal", |
| 766 | .pp_num, .embed_byte => "A number", | |
| 848 | .pp_num, .embed_byte => "a number", | |
| 767 | 849 | else => id.lexeme().?, |
| 768 | 850 | }; |
| 769 | 851 | } |
| ... | ... | @@ -871,6 +953,12 @@ pub const Token = struct { |
| 871 | 953 | .keyword_stdcall2, |
| 872 | 954 | .keyword_thiscall2, |
| 873 | 955 | .keyword_vectorcall2, |
| 956 | .keyword_fastcall2, | |
| 957 | .keyword_cdecl2, | |
| 958 | .keyword_forceinline, | |
| 959 | .keyword_forceinline2, | |
| 960 | .keyword_unaligned, | |
| 961 | .keyword_unaligned2, | |
| 874 | 962 | => if (langopts.ms_extensions) kw else .identifier, |
| 875 | 963 | else => kw, |
| 876 | 964 | }; |
| ... | ... | @@ -1013,13 +1101,21 @@ pub const Token = struct { |
| 1013 | 1101 | .{ "_thiscall", .keyword_thiscall2 }, |
| 1014 | 1102 | .{ "__vectorcall", .keyword_vectorcall }, |
| 1015 | 1103 | .{ "_vectorcall", .keyword_vectorcall2 }, |
| 1016 | ||
| 1017 | // builtins that require special parsing | |
| 1018 | .{ "__builtin_choose_expr", .builtin_choose_expr }, | |
| 1019 | .{ "__builtin_va_arg", .builtin_va_arg }, | |
| 1020 | .{ "__builtin_offsetof", .builtin_offsetof }, | |
| 1021 | .{ "__builtin_bitoffsetof", .builtin_bitoffsetof }, | |
| 1022 | .{ "__builtin_types_compatible_p", .builtin_types_compatible_p }, | |
| 1104 | .{ "__fastcall", .keyword_fastcall }, | |
| 1105 | .{ "_fastcall", .keyword_fastcall2 }, | |
| 1106 | .{ "_regcall", .keyword_regcall }, | |
| 1107 | .{ "__cdecl", .keyword_cdecl }, | |
| 1108 | .{ "_cdecl", .keyword_cdecl2 }, | |
| 1109 | .{ "__forceinline", .keyword_forceinline }, | |
| 1110 | .{ "_forceinline", .keyword_forceinline2 }, | |
| 1111 | .{ "__unaligned", .keyword_unaligned }, | |
| 1112 | .{ "_unaligned", .keyword_unaligned2 }, | |
| 1113 | ||
| 1114 | // Type nullability | |
| 1115 | .{ "_Nonnull", .keyword_nonnull }, | |
| 1116 | .{ "_Nullable", .keyword_nullable }, | |
| 1117 | .{ "_Nullable_result", .keyword_nullable_result }, | |
| 1118 | .{ "_Null_unspecified", .keyword_null_unspecified }, | |
| 1023 | 1119 | }); |
| 1024 | 1120 | }; |
| 1025 | 1121 | |
| ... | ... | @@ -1099,6 +1195,26 @@ pub fn next(self: *Tokenizer) Token { |
| 1099 | 1195 | 'u' => state = .u, |
| 1100 | 1196 | 'U' => state = .U, |
| 1101 | 1197 | 'L' => state = .L, |
| 1198 | '\\' => { | |
| 1199 | const ucn_kind = UCNKind.classify(self.buf[self.index..]); | |
| 1200 | switch (ucn_kind) { | |
| 1201 | .none => { | |
| 1202 | self.index += 1; | |
| 1203 | id = .invalid; | |
| 1204 | break; | |
| 1205 | }, | |
| 1206 | .incomplete => { | |
| 1207 | self.index += 1; | |
| 1208 | id = .incomplete_ucn; | |
| 1209 | break; | |
| 1210 | }, | |
| 1211 | .hex4, .hex8 => { | |
| 1212 | self.index += @intFromEnum(ucn_kind); | |
| 1213 | id = .extended_identifier; | |
| 1214 | state = .extended_identifier; | |
| 1215 | }, | |
| 1216 | } | |
| 1217 | }, | |
| 1102 | 1218 | 'a'...'t', 'v'...'z', 'A'...'K', 'M'...'T', 'V'...'Z', '_' => state = .identifier, |
| 1103 | 1219 | '=' => state = .equal, |
| 1104 | 1220 | '!' => state = .bang, |
| ... | ... | @@ -1324,6 +1440,20 @@ pub fn next(self: *Tokenizer) Token { |
| 1324 | 1440 | break; |
| 1325 | 1441 | }, |
| 1326 | 1442 | 0x80...0xFF => state = .extended_identifier, |
| 1443 | '\\' => { | |
| 1444 | const ucn_kind = UCNKind.classify(self.buf[self.index..]); | |
| 1445 | switch (ucn_kind) { | |
| 1446 | .none, .incomplete => { | |
| 1447 | id = if (state == .identifier) Token.getTokenId(self.langopts, self.buf[start..self.index]) else .extended_identifier; | |
| 1448 | break; | |
| 1449 | }, | |
| 1450 | .hex4, .hex8 => { | |
| 1451 | state = .extended_identifier; | |
| 1452 | self.index += @intFromEnum(ucn_kind); | |
| 1453 | }, | |
| 1454 | } | |
| 1455 | }, | |
| 1456 | ||
| 1327 | 1457 | else => { |
| 1328 | 1458 | id = if (state == .identifier) Token.getTokenId(self.langopts, self.buf[start..self.index]) else .extended_identifier; |
| 1329 | 1459 | break; |
| ... | ... | @@ -1731,7 +1861,10 @@ pub fn next(self: *Tokenizer) Token { |
| 1731 | 1861 | } |
| 1732 | 1862 | } else if (self.index == self.buf.len) { |
| 1733 | 1863 | switch (state) { |
| 1734 | .start, .line_comment => {}, | |
| 1864 | .start => {}, | |
| 1865 | .line_comment => if (self.langopts.preserve_comments) { | |
| 1866 | id = .comment; | |
| 1867 | }, | |
| 1735 | 1868 | .u, .u8, .U, .L, .identifier => id = Token.getTokenId(self.langopts, self.buf[start..self.index]), |
| 1736 | 1869 | .extended_identifier => id = .extended_identifier, |
| 1737 | 1870 | |
| ... | ... | @@ -2105,6 +2238,15 @@ test "comments" { |
| 2105 | 2238 | .hash, |
| 2106 | 2239 | .identifier, |
| 2107 | 2240 | }); |
| 2241 | try expectTokensExtra( | |
| 2242 | \\//foo | |
| 2243 | \\void | |
| 2244 | \\//bar | |
| 2245 | , &.{ | |
| 2246 | .comment, .nl, | |
| 2247 | .keyword_void, .nl, | |
| 2248 | .comment, | |
| 2249 | }, .{ .preserve_comments = true }); | |
| 2108 | 2250 | } |
| 2109 | 2251 | |
| 2110 | 2252 | test "extended identifiers" { |
| ... | ... | @@ -2147,36 +2289,76 @@ test "C23 keywords" { |
| 2147 | 2289 | .keyword_c23_thread_local, |
| 2148 | 2290 | .keyword_nullptr, |
| 2149 | 2291 | .keyword_typeof_unqual, |
| 2150 | }, .c23); | |
| 2292 | }, .{ .standard = .c23 }); | |
| 2151 | 2293 | } |
| 2152 | 2294 | |
| 2153 | test "Tokenizer fuzz test" { | |
| 2154 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 2155 | defer comp.deinit(); | |
| 2156 | ||
| 2157 | const input_bytes = std.testing.fuzzInput(.{}); | |
| 2158 | if (input_bytes.len == 0) return; | |
| 2159 | ||
| 2160 | const source = try comp.addSourceFromBuffer("fuzz.c", input_bytes); | |
| 2295 | test "Universal character names" { | |
| 2296 | try expectTokens("\\", &.{.invalid}); | |
| 2297 | try expectTokens("\\g", &.{ .invalid, .identifier }); | |
| 2298 | try expectTokens("\\u", &.{ .incomplete_ucn, .identifier }); | |
| 2299 | try expectTokens("\\ua", &.{ .incomplete_ucn, .identifier }); | |
| 2300 | try expectTokens("\\U9", &.{ .incomplete_ucn, .identifier }); | |
| 2301 | try expectTokens("\\ug", &.{ .incomplete_ucn, .identifier }); | |
| 2302 | try expectTokens("\\uag", &.{ .incomplete_ucn, .identifier }); | |
| 2303 | ||
| 2304 | try expectTokens("\\ ", &.{ .invalid, .eof }); | |
| 2305 | try expectTokens("\\g ", &.{ .invalid, .identifier, .eof }); | |
| 2306 | try expectTokens("\\u ", &.{ .incomplete_ucn, .identifier, .eof }); | |
| 2307 | try expectTokens("\\ua ", &.{ .incomplete_ucn, .identifier, .eof }); | |
| 2308 | try expectTokens("\\U9 ", &.{ .incomplete_ucn, .identifier, .eof }); | |
| 2309 | try expectTokens("\\ug ", &.{ .incomplete_ucn, .identifier, .eof }); | |
| 2310 | try expectTokens("\\uag ", &.{ .incomplete_ucn, .identifier, .eof }); | |
| 2311 | ||
| 2312 | try expectTokens("a\\", &.{ .identifier, .invalid }); | |
| 2313 | try expectTokens("a\\g", &.{ .identifier, .invalid, .identifier }); | |
| 2314 | try expectTokens("a\\u", &.{ .identifier, .incomplete_ucn, .identifier }); | |
| 2315 | try expectTokens("a\\ua", &.{ .identifier, .incomplete_ucn, .identifier }); | |
| 2316 | try expectTokens("a\\U9", &.{ .identifier, .incomplete_ucn, .identifier }); | |
| 2317 | try expectTokens("a\\ug", &.{ .identifier, .incomplete_ucn, .identifier }); | |
| 2318 | try expectTokens("a\\uag", &.{ .identifier, .incomplete_ucn, .identifier }); | |
| 2319 | ||
| 2320 | try expectTokens("a\\ ", &.{ .identifier, .invalid, .eof }); | |
| 2321 | try expectTokens("a\\g ", &.{ .identifier, .invalid, .identifier, .eof }); | |
| 2322 | try expectTokens("a\\u ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); | |
| 2323 | try expectTokens("a\\ua ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); | |
| 2324 | try expectTokens("a\\U9 ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); | |
| 2325 | try expectTokens("a\\ug ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); | |
| 2326 | try expectTokens("a\\uag ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); | |
| 2327 | } | |
| 2161 | 2328 | |
| 2162 | var tokenizer: Tokenizer = .{ | |
| 2163 | .buf = source.buf, | |
| 2164 | .source = source.id, | |
| 2165 | .langopts = comp.langopts, | |
| 2329 | test "Tokenizer fuzz test" { | |
| 2330 | const Context = struct { | |
| 2331 | fn testOne(_: @This(), input_bytes: []const u8) anyerror!void { | |
| 2332 | var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 2333 | defer arena.deinit(); | |
| 2334 | var comp = Compilation.init(std.testing.allocator, arena.allocator(), undefined, std.fs.cwd()); | |
| 2335 | defer comp.deinit(); | |
| 2336 | ||
| 2337 | const source = try comp.addSourceFromBuffer("fuzz.c", input_bytes); | |
| 2338 | ||
| 2339 | var tokenizer: Tokenizer = .{ | |
| 2340 | .buf = source.buf, | |
| 2341 | .source = source.id, | |
| 2342 | .langopts = comp.langopts, | |
| 2343 | }; | |
| 2344 | while (true) { | |
| 2345 | const prev_index = tokenizer.index; | |
| 2346 | const tok = tokenizer.next(); | |
| 2347 | if (tok.id == .eof) break; | |
| 2348 | try std.testing.expect(prev_index < tokenizer.index); // ensure that the tokenizer always makes progress | |
| 2349 | } | |
| 2350 | } | |
| 2166 | 2351 | }; |
| 2167 | while (true) { | |
| 2168 | const prev_index = tokenizer.index; | |
| 2169 | const tok = tokenizer.next(); | |
| 2170 | if (tok.id == .eof) break; | |
| 2171 | try std.testing.expect(prev_index < tokenizer.index); // ensure that the tokenizer always makes progress | |
| 2172 | } | |
| 2352 | return std.testing.fuzz(Context{}, Context.testOne, .{}); | |
| 2173 | 2353 | } |
| 2174 | 2354 | |
| 2175 | fn expectTokensExtra(contents: []const u8, expected_tokens: []const Token.Id, standard: ?LangOpts.Standard) !void { | |
| 2176 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 2355 | fn expectTokensExtra(contents: []const u8, expected_tokens: []const Token.Id, langopts: ?LangOpts) !void { | |
| 2356 | var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 2357 | defer arena.deinit(); | |
| 2358 | var comp = Compilation.init(std.testing.allocator, arena.allocator(), undefined, std.fs.cwd()); | |
| 2177 | 2359 | defer comp.deinit(); |
| 2178 | if (standard) |provided| { | |
| 2179 | comp.langopts.standard = provided; | |
| 2360 | if (langopts) |provided| { | |
| 2361 | comp.langopts = provided; | |
| 2180 | 2362 | } |
| 2181 | 2363 | const source = try comp.addSourceFromBuffer("path", contents); |
| 2182 | 2364 | var tokenizer = Tokenizer{ |
lib/compiler/aro/aro/Toolchain.zig+70-81| ... | ... | @@ -1,14 +1,15 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const Driver = @import("Driver.zig"); | |
| 3 | const Compilation = @import("Compilation.zig"); | |
| 4 | 2 | const mem = std.mem; |
| 3 | ||
| 5 | 4 | const system_defaults = @import("system_defaults"); |
| 6 | const target_util = @import("target.zig"); | |
| 7 | const Linux = @import("toolchains/Linux.zig"); | |
| 8 | const Multilib = @import("Driver/Multilib.zig"); | |
| 5 | ||
| 6 | const Compilation = @import("Compilation.zig"); | |
| 7 | const Driver = @import("Driver.zig"); | |
| 9 | 8 | const Filesystem = @import("Driver/Filesystem.zig").Filesystem; |
| 9 | const Multilib = @import("Driver/Multilib.zig"); | |
| 10 | const target_util = @import("target.zig"); | |
| 10 | 11 | |
| 11 | pub const PathList = std.ArrayListUnmanaged([]const u8); | |
| 12 | pub const PathList = std.ArrayList([]const u8); | |
| 12 | 13 | |
| 13 | 14 | pub const RuntimeLibKind = enum { |
| 14 | 15 | compiler_rt, |
| ... | ... | @@ -35,22 +36,13 @@ pub const UnwindLibKind = enum { |
| 35 | 36 | |
| 36 | 37 | const Inner = union(enum) { |
| 37 | 38 | uninitialized, |
| 38 | linux: Linux, | |
| 39 | 39 | unknown: void, |
| 40 | ||
| 41 | fn deinit(self: *Inner, allocator: mem.Allocator) void { | |
| 42 | switch (self.*) { | |
| 43 | .linux => |*linux| linux.deinit(allocator), | |
| 44 | .uninitialized, .unknown => {}, | |
| 45 | } | |
| 46 | } | |
| 47 | 40 | }; |
| 48 | 41 | |
| 49 | 42 | const Toolchain = @This(); |
| 50 | 43 | |
| 51 | filesystem: Filesystem = .{ .real = {} }, | |
| 44 | filesystem: Filesystem, | |
| 52 | 45 | driver: *Driver, |
| 53 | arena: mem.Allocator, | |
| 54 | 46 | |
| 55 | 47 | /// The list of toolchain specific path prefixes to search for libraries. |
| 56 | 48 | library_paths: PathList = .{}, |
| ... | ... | @@ -72,7 +64,6 @@ pub fn getTarget(tc: *const Toolchain) std.Target { |
| 72 | 64 | fn getDefaultLinker(tc: *const Toolchain) []const u8 { |
| 73 | 65 | return switch (tc.inner) { |
| 74 | 66 | .uninitialized => unreachable, |
| 75 | .linux => |linux| linux.getDefaultLinker(tc.getTarget()), | |
| 76 | 67 | .unknown => "ld", |
| 77 | 68 | }; |
| 78 | 69 | } |
| ... | ... | @@ -81,36 +72,26 @@ fn getDefaultLinker(tc: *const Toolchain) []const u8 { |
| 81 | 72 | pub fn discover(tc: *Toolchain) !void { |
| 82 | 73 | if (tc.inner != .uninitialized) return; |
| 83 | 74 | |
| 84 | const target = tc.getTarget(); | |
| 85 | tc.inner = switch (target.os.tag) { | |
| 86 | .linux => if (target.cpu.arch == .hexagon) | |
| 87 | .{ .unknown = {} } // TODO | |
| 88 | else if (target.cpu.arch.isMIPS()) | |
| 89 | .{ .unknown = {} } // TODO | |
| 90 | else if (target.cpu.arch.isPowerPC()) | |
| 91 | .{ .unknown = {} } // TODO | |
| 92 | else if (target.cpu.arch == .ve) | |
| 93 | .{ .unknown = {} } // TODO | |
| 94 | else | |
| 95 | .{ .linux = .{} }, | |
| 96 | else => .{ .unknown = {} }, // TODO | |
| 97 | }; | |
| 75 | tc.inner = .unknown; | |
| 98 | 76 | return switch (tc.inner) { |
| 99 | 77 | .uninitialized => unreachable, |
| 100 | .linux => |*linux| linux.discover(tc), | |
| 101 | 78 | .unknown => {}, |
| 102 | 79 | }; |
| 103 | 80 | } |
| 104 | 81 | |
| 105 | 82 | pub fn deinit(tc: *Toolchain) void { |
| 106 | 83 | const gpa = tc.driver.comp.gpa; |
| 107 | tc.inner.deinit(gpa); | |
| 108 | 84 | |
| 109 | 85 | tc.library_paths.deinit(gpa); |
| 110 | 86 | tc.file_paths.deinit(gpa); |
| 111 | 87 | tc.program_paths.deinit(gpa); |
| 112 | 88 | } |
| 113 | 89 | |
| 90 | /// Write assembler path to `buf` and return a slice of it | |
| 91 | pub fn getAssemblerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { | |
| 92 | return tc.getProgramPath("as", buf); | |
| 93 | } | |
| 94 | ||
| 114 | 95 | /// Write linker path to `buf` and return a slice of it |
| 115 | 96 | pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { |
| 116 | 97 | // --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 { |
| 149 | 130 | // to a relative path is surprising. This is more complex due to priorities |
| 150 | 131 | // among -B, COMPILER_PATH and PATH. --ld-path= should be used instead. |
| 151 | 132 | if (mem.indexOfScalar(u8, use_linker, '/') != null) { |
| 152 | try tc.driver.comp.addDiagnostic(.{ .tag = .fuse_ld_path }, &.{}); | |
| 133 | try tc.driver.comp.diagnostics.add(.{ | |
| 134 | .text = "'-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead", | |
| 135 | .kind = .off, | |
| 136 | .opt = .@"fuse-ld-path", | |
| 137 | .location = null, | |
| 138 | }); | |
| 153 | 139 | } |
| 154 | 140 | |
| 155 | 141 | if (std.fs.path.isAbsolute(use_linker)) { |
| ... | ... | @@ -157,8 +143,11 @@ pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { |
| 157 | 143 | return use_linker; |
| 158 | 144 | } |
| 159 | 145 | } else { |
| 160 | var linker_name = try std.array_list.Managed(u8).initCapacity(tc.driver.comp.gpa, 5 + use_linker.len); // "ld64." ++ use_linker | |
| 161 | defer linker_name.deinit(); | |
| 146 | const gpa = tc.driver.comp.gpa; | |
| 147 | var linker_name: std.ArrayList(u8) = .empty; | |
| 148 | defer linker_name.deinit(gpa); | |
| 149 | try linker_name.ensureUnusedCapacity(tc.driver.comp.gpa, 5 + use_linker.len); // "ld64." ++ use_linker | |
| 150 | ||
| 162 | 151 | if (tc.getTarget().os.tag.isDarwin()) { |
| 163 | 152 | linker_name.appendSliceAssumeCapacity("ld64."); |
| 164 | 153 | } else { |
| ... | ... | @@ -185,27 +174,33 @@ pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { |
| 185 | 174 | /// TODO: this isn't exactly right since our target names don't necessarily match up |
| 186 | 175 | /// with GCC's. |
| 187 | 176 | /// For example the Zig target `arm-freestanding-eabi` would need the `arm-none-eabi` tools |
| 188 | fn possibleProgramNames(raw_triple: ?[]const u8, name: []const u8, buf: *[64]u8) std.BoundedArray([]const u8, 2) { | |
| 189 | var possible_names: std.BoundedArray([]const u8, 2) = .{}; | |
| 177 | fn possibleProgramNames( | |
| 178 | raw_triple: ?[]const u8, | |
| 179 | name: []const u8, | |
| 180 | buf: *[64]u8, | |
| 181 | possible_name_buf: *[2][]const u8, | |
| 182 | ) []const []const u8 { | |
| 183 | var i: u32 = 0; | |
| 190 | 184 | if (raw_triple) |triple| { |
| 191 | 185 | if (std.fmt.bufPrint(buf, "{s}-{s}", .{ triple, name })) |res| { |
| 192 | possible_names.appendAssumeCapacity(res); | |
| 186 | possible_name_buf[i] = res; | |
| 187 | i += 1; | |
| 193 | 188 | } else |_| {} |
| 194 | 189 | } |
| 195 | possible_names.appendAssumeCapacity(name); | |
| 190 | possible_name_buf[i] = name; | |
| 196 | 191 | |
| 197 | return possible_names; | |
| 192 | return possible_name_buf[0..i]; | |
| 198 | 193 | } |
| 199 | 194 | |
| 200 | 195 | /// Add toolchain `file_paths` to argv as `-L` arguments |
| 201 | pub fn addFilePathLibArgs(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { | |
| 202 | try argv.ensureUnusedCapacity(tc.file_paths.items.len); | |
| 196 | pub fn addFilePathLibArgs(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { | |
| 197 | try argv.ensureUnusedCapacity(tc.driver.comp.gpa, tc.file_paths.items.len); | |
| 203 | 198 | |
| 204 | 199 | var bytes_needed: usize = 0; |
| 205 | 200 | for (tc.file_paths.items) |path| { |
| 206 | 201 | bytes_needed += path.len + 2; // +2 for `-L` |
| 207 | 202 | } |
| 208 | var bytes = try tc.arena.alloc(u8, bytes_needed); | |
| 203 | var bytes = try tc.driver.comp.arena.alloc(u8, bytes_needed); | |
| 209 | 204 | var index: usize = 0; |
| 210 | 205 | for (tc.file_paths.items) |path| { |
| 211 | 206 | @memcpy(bytes[index..][0..2], "-L"); |
| ... | ... | @@ -223,9 +218,10 @@ fn getProgramPath(tc: *const Toolchain, name: []const u8, buf: []u8) []const u8 |
| 223 | 218 | var fib = std.heap.FixedBufferAllocator.init(&path_buf); |
| 224 | 219 | |
| 225 | 220 | var tool_specific_buf: [64]u8 = undefined; |
| 226 | const possible_names = possibleProgramNames(tc.driver.raw_target_triple, name, &tool_specific_buf); | |
| 221 | var possible_name_buf: [2][]const u8 = undefined; | |
| 222 | const possible_names = possibleProgramNames(tc.driver.raw_target_triple, name, &tool_specific_buf, &possible_name_buf); | |
| 227 | 223 | |
| 228 | for (possible_names.constSlice()) |tool_name| { | |
| 224 | for (possible_names) |tool_name| { | |
| 229 | 225 | for (tc.program_paths.items) |program_path| { |
| 230 | 226 | defer fib.reset(); |
| 231 | 227 | |
| ... | ... | @@ -252,6 +248,7 @@ pub fn getFilePath(tc: *const Toolchain, name: []const u8) ![]const u8 { |
| 252 | 248 | var path_buf: [std.fs.max_path_bytes]u8 = undefined; |
| 253 | 249 | var fib = std.heap.FixedBufferAllocator.init(&path_buf); |
| 254 | 250 | const allocator = fib.allocator(); |
| 251 | const arena = tc.driver.comp.arena; | |
| 255 | 252 | |
| 256 | 253 | const sysroot = tc.getSysroot(); |
| 257 | 254 | |
| ... | ... | @@ -260,15 +257,15 @@ pub fn getFilePath(tc: *const Toolchain, name: []const u8) ![]const u8 { |
| 260 | 257 | const aro_dir = std.fs.path.dirname(tc.driver.aro_name) orelse ""; |
| 261 | 258 | const candidate = try std.fs.path.join(allocator, &.{ aro_dir, "..", name }); |
| 262 | 259 | if (tc.filesystem.exists(candidate)) { |
| 263 | return tc.arena.dupe(u8, candidate); | |
| 260 | return arena.dupe(u8, candidate); | |
| 264 | 261 | } |
| 265 | 262 | |
| 266 | 263 | if (tc.searchPaths(&fib, sysroot, tc.library_paths.items, name)) |path| { |
| 267 | return tc.arena.dupe(u8, path); | |
| 264 | return arena.dupe(u8, path); | |
| 268 | 265 | } |
| 269 | 266 | |
| 270 | 267 | if (tc.searchPaths(&fib, sysroot, tc.file_paths.items, name)) |path| { |
| 271 | return try tc.arena.dupe(u8, path); | |
| 268 | return try arena.dupe(u8, path); | |
| 272 | 269 | } |
| 273 | 270 | |
| 274 | 271 | return name; |
| ... | ... | @@ -299,7 +296,7 @@ const PathKind = enum { |
| 299 | 296 | program, |
| 300 | 297 | }; |
| 301 | 298 | |
| 302 | /// Join `components` into a path. If the path exists, dupe it into the toolchain arena and | |
| 299 | /// Join `components` into a path. If the path exists, dupe it into the Compilation arena and | |
| 303 | 300 | /// add it to the specified path list. |
| 304 | 301 | pub fn addPathIfExists(tc: *Toolchain, components: []const []const u8, dest_kind: PathKind) !void { |
| 305 | 302 | 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 |
| 308 | 305 | const candidate = try std.fs.path.join(fib.allocator(), components); |
| 309 | 306 | |
| 310 | 307 | if (tc.filesystem.exists(candidate)) { |
| 311 | const duped = try tc.arena.dupe(u8, candidate); | |
| 308 | const duped = try tc.driver.comp.arena.dupe(u8, candidate); | |
| 312 | 309 | const dest = switch (dest_kind) { |
| 313 | 310 | .library => &tc.library_paths, |
| 314 | 311 | .file => &tc.file_paths, |
| ... | ... | @@ -318,10 +315,10 @@ pub fn addPathIfExists(tc: *Toolchain, components: []const []const u8, dest_kind |
| 318 | 315 | } |
| 319 | 316 | } |
| 320 | 317 | |
| 321 | /// Join `components` using the toolchain arena and add the resulting path to `dest_kind`. Does not check | |
| 318 | /// Join `components` using the Compilation arena and add the resulting path to `dest_kind`. Does not check | |
| 322 | 319 | /// whether the path actually exists |
| 323 | 320 | pub fn addPathFromComponents(tc: *Toolchain, components: []const []const u8, dest_kind: PathKind) !void { |
| 324 | const full_path = try std.fs.path.join(tc.arena, components); | |
| 321 | const full_path = try std.fs.path.join(tc.driver.comp.arena, components); | |
| 325 | 322 | const dest = switch (dest_kind) { |
| 326 | 323 | .library => &tc.library_paths, |
| 327 | 324 | .file => &tc.file_paths, |
| ... | ... | @@ -330,16 +327,6 @@ pub fn addPathFromComponents(tc: *Toolchain, components: []const []const u8, des |
| 330 | 327 | try dest.append(tc.driver.comp.gpa, full_path); |
| 331 | 328 | } |
| 332 | 329 | |
| 333 | /// Add linker args to `argv`. Does not add path to linker executable as first item; that must be handled separately | |
| 334 | /// Items added to `argv` will be string literals or owned by `tc.arena` so they must not be individually freed | |
| 335 | pub fn buildLinkerArgs(tc: *Toolchain, argv: *std.array_list.Managed([]const u8)) !void { | |
| 336 | return switch (tc.inner) { | |
| 337 | .uninitialized => unreachable, | |
| 338 | .linux => |*linux| linux.buildLinkerArgs(tc, argv), | |
| 339 | .unknown => @panic("This toolchain does not support linking yet"), | |
| 340 | }; | |
| 341 | } | |
| 342 | ||
| 343 | 330 | fn getDefaultRuntimeLibKind(tc: *const Toolchain) RuntimeLibKind { |
| 344 | 331 | if (tc.getTarget().abi.isAndroid()) { |
| 345 | 332 | return .compiler_rt; |
| ... | ... | @@ -396,7 +383,7 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind { |
| 396 | 383 | return .libgcc; |
| 397 | 384 | } else if (mem.eql(u8, libname, "libunwind")) { |
| 398 | 385 | if (tc.getRuntimeLibKind() == .libgcc) { |
| 399 | try tc.driver.comp.addDiagnostic(.{ .tag = .incompatible_unwindlib }, &.{}); | |
| 386 | try tc.driver.err("--rtlib=libgcc requires --unwindlib=libgcc", .{}); | |
| 400 | 387 | } |
| 401 | 388 | return .compiler_rt; |
| 402 | 389 | } else { |
| ... | ... | @@ -412,7 +399,7 @@ fn getAsNeededOption(is_solaris: bool, needed: bool) []const u8 { |
| 412 | 399 | } |
| 413 | 400 | } |
| 414 | 401 | |
| 415 | fn addUnwindLibrary(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { | |
| 402 | fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { | |
| 416 | 403 | const unw = try tc.getUnwindLibKind(); |
| 417 | 404 | const target = tc.getTarget(); |
| 418 | 405 | if ((target.abi.isAndroid() and unw == .libgcc) or |
| ... | ... | @@ -422,46 +409,49 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.array_list.Managed([]const |
| 422 | 409 | |
| 423 | 410 | const lgk = tc.getLibGCCKind(); |
| 424 | 411 | const as_needed = lgk == .unspecified and !target.abi.isAndroid() and !target_util.isCygwinMinGW(target) and target.os.tag != .aix; |
| 412 | ||
| 413 | try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3); | |
| 425 | 414 | if (as_needed) { |
| 426 | try argv.append(getAsNeededOption(target.os.tag == .solaris, true)); | |
| 415 | argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, true)); | |
| 427 | 416 | } |
| 428 | 417 | switch (unw) { |
| 429 | 418 | .none => return, |
| 430 | .libgcc => if (lgk == .static) try argv.append("-lgcc_eh") else try argv.append("-lgcc_s"), | |
| 419 | .libgcc => argv.appendAssumeCapacity(if (lgk == .static) "-lgcc_eh" else "-lgcc_s"), | |
| 431 | 420 | .compiler_rt => if (target.os.tag == .aix) { |
| 432 | 421 | if (lgk != .static) { |
| 433 | try argv.append("-lunwind"); | |
| 422 | argv.appendAssumeCapacity("-lunwind"); | |
| 434 | 423 | } |
| 435 | 424 | } else if (lgk == .static) { |
| 436 | try argv.append("-l:libunwind.a"); | |
| 425 | argv.appendAssumeCapacity("-l:libunwind.a"); | |
| 437 | 426 | } else if (lgk == .shared) { |
| 438 | 427 | if (target_util.isCygwinMinGW(target)) { |
| 439 | try argv.append("-l:libunwind.dll.a"); | |
| 428 | argv.appendAssumeCapacity("-l:libunwind.dll.a"); | |
| 440 | 429 | } else { |
| 441 | try argv.append("-l:libunwind.so"); | |
| 430 | argv.appendAssumeCapacity("-l:libunwind.so"); | |
| 442 | 431 | } |
| 443 | 432 | } else { |
| 444 | try argv.append("-lunwind"); | |
| 433 | argv.appendAssumeCapacity("-lunwind"); | |
| 445 | 434 | }, |
| 446 | 435 | } |
| 447 | 436 | |
| 448 | 437 | if (as_needed) { |
| 449 | try argv.append(getAsNeededOption(target.os.tag == .solaris, false)); | |
| 438 | argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, false)); | |
| 450 | 439 | } |
| 451 | 440 | } |
| 452 | 441 | |
| 453 | fn addLibGCC(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { | |
| 442 | fn addLibGCC(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { | |
| 443 | const gpa = tc.driver.comp.gpa; | |
| 454 | 444 | const libgcc_kind = tc.getLibGCCKind(); |
| 455 | 445 | if (libgcc_kind == .static or libgcc_kind == .unspecified) { |
| 456 | try argv.append("-lgcc"); | |
| 446 | try argv.append(gpa, "-lgcc"); | |
| 457 | 447 | } |
| 458 | 448 | try tc.addUnwindLibrary(argv); |
| 459 | 449 | if (libgcc_kind == .shared) { |
| 460 | try argv.append("-lgcc"); | |
| 450 | try argv.append(gpa, "-lgcc"); | |
| 461 | 451 | } |
| 462 | 452 | } |
| 463 | 453 | |
| 464 | pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { | |
| 454 | pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { | |
| 465 | 455 | const target = tc.getTarget(); |
| 466 | 456 | const rlt = tc.getRuntimeLibKind(); |
| 467 | 457 | switch (rlt) { |
| ... | ... | @@ -472,7 +462,7 @@ pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.array_list.Managed([]cons |
| 472 | 462 | if (target_util.isKnownWindowsMSVCEnvironment(target)) { |
| 473 | 463 | const rtlib_str = tc.driver.rtlib orelse system_defaults.rtlib; |
| 474 | 464 | if (!mem.eql(u8, rtlib_str, "platform")) { |
| 475 | try tc.driver.comp.addDiagnostic(.{ .tag = .unsupported_rtlib_gcc, .extra = .{ .str = "MSVC" } }, &.{}); | |
| 465 | try tc.driver.err("unsupported runtime library 'libgcc' for platform 'MSVC'", .{}); | |
| 476 | 466 | } |
| 477 | 467 | } else { |
| 478 | 468 | try tc.addLibGCC(argv); |
| ... | ... | @@ -481,20 +471,19 @@ pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.array_list.Managed([]cons |
| 481 | 471 | } |
| 482 | 472 | |
| 483 | 473 | if (target.abi.isAndroid() and !tc.driver.static and !tc.driver.static_pie) { |
| 484 | try argv.append("-ldl"); | |
| 474 | try argv.append(tc.driver.comp.gpa, "-ldl"); | |
| 485 | 475 | } |
| 486 | 476 | } |
| 487 | 477 | |
| 488 | 478 | pub fn defineSystemIncludes(tc: *Toolchain) !void { |
| 489 | 479 | return switch (tc.inner) { |
| 490 | 480 | .uninitialized => unreachable, |
| 491 | .linux => |*linux| linux.defineSystemIncludes(tc), | |
| 492 | 481 | .unknown => { |
| 493 | 482 | if (tc.driver.nostdinc) return; |
| 494 | 483 | |
| 495 | 484 | const comp = tc.driver.comp; |
| 496 | 485 | if (!tc.driver.nobuiltininc) { |
| 497 | try comp.addBuiltinIncludeDir(tc.driver.aro_name); | |
| 486 | try comp.addBuiltinIncludeDir(tc.driver.aro_name, tc.driver.resource_dir); | |
| 498 | 487 | } |
| 499 | 488 | |
| 500 | 489 | if (!tc.driver.nostdlibinc) { |
lib/compiler/aro/aro/Tree.zig+3184-1004| ... | ... | @@ -1,14 +1,15 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | ||
| 2 | 3 | const Interner = @import("../backend.zig").Interner; |
| 4 | ||
| 3 | 5 | const Attribute = @import("Attribute.zig"); |
| 4 | 6 | const CodeGen = @import("CodeGen.zig"); |
| 5 | 7 | const Compilation = @import("Compilation.zig"); |
| 6 | 8 | const number_affixes = @import("Tree/number_affixes.zig"); |
| 7 | 9 | const Source = @import("Source.zig"); |
| 8 | 10 | const Tokenizer = @import("Tokenizer.zig"); |
| 9 | const Type = @import("Type.zig"); | |
| 11 | const QualType = @import("TypeStore.zig").QualType; | |
| 10 | 12 | const Value = @import("Value.zig"); |
| 11 | const StringInterner = @import("StringInterner.zig"); | |
| 12 | 13 | |
| 13 | 14 | pub const Token = struct { |
| 14 | 15 | id: Id, |
| ... | ... | @@ -41,7 +42,7 @@ pub const TokenWithExpansionLocs = struct { |
| 41 | 42 | |
| 42 | 43 | pub fn addExpansionLocation(tok: *TokenWithExpansionLocs, gpa: std.mem.Allocator, new: []const Source.Location) !void { |
| 43 | 44 | if (new.len == 0 or tok.id == .whitespace or tok.id == .macro_ws or tok.id == .placemarker) return; |
| 44 | var list = std.array_list.Managed(Source.Location).init(gpa); | |
| 45 | var list: std.ArrayList(Source.Location) = .empty; | |
| 45 | 46 | defer { |
| 46 | 47 | @memset(list.items.ptr[list.items.len..list.capacity], .{}); |
| 47 | 48 | // Add a sentinel to indicate the end of the list since |
| ... | ... | @@ -64,7 +65,7 @@ pub const TokenWithExpansionLocs = struct { |
| 64 | 65 | const min_len = @max(list.items.len + new.len + 1, 4); |
| 65 | 66 | const wanted_len = std.math.ceilPowerOfTwo(usize, min_len) catch |
| 66 | 67 | return error.OutOfMemory; |
| 67 | try list.ensureTotalCapacity(wanted_len); | |
| 68 | try list.ensureTotalCapacity(gpa, wanted_len); | |
| 68 | 69 | |
| 69 | 70 | for (new) |new_loc| { |
| 70 | 71 | if (new_loc.id == .generated) continue; |
| ... | ... | @@ -90,532 +91,2702 @@ pub const TokenWithExpansionLocs = struct { |
| 90 | 91 | pub fn checkMsEof(tok: TokenWithExpansionLocs, source: Source, comp: *Compilation) !void { |
| 91 | 92 | std.debug.assert(tok.id == .eof); |
| 92 | 93 | if (source.buf.len > tok.loc.byte_offset and source.buf[tok.loc.byte_offset] == 0x1A) { |
| 93 | try comp.addDiagnostic(.{ | |
| 94 | .tag = .ctrl_z_eof, | |
| 95 | .loc = .{ | |
| 94 | const diagnostic: Compilation.Diagnostic = .ctrl_z_eof; | |
| 95 | try comp.diagnostics.add(.{ | |
| 96 | .text = diagnostic.fmt, | |
| 97 | .kind = diagnostic.kind, | |
| 98 | .opt = diagnostic.opt, | |
| 99 | .extension = diagnostic.extension, | |
| 100 | .location = source.lineCol(.{ | |
| 96 | 101 | .id = source.id, |
| 97 | 102 | .byte_offset = tok.loc.byte_offset, |
| 98 | 103 | .line = tok.loc.line, |
| 99 | }, | |
| 100 | }, &.{}); | |
| 104 | }), | |
| 105 | }); | |
| 106 | } | |
| 107 | } | |
| 108 | }; | |
| 109 | ||
| 110 | pub const TokenIndex = u32; | |
| 111 | pub const ValueMap = std.AutoHashMapUnmanaged(Node.Index, Value); | |
| 112 | ||
| 113 | const Tree = @This(); | |
| 114 | ||
| 115 | comp: *Compilation, | |
| 116 | ||
| 117 | // Values from Preprocessor. | |
| 118 | tokens: Token.List.Slice, | |
| 119 | ||
| 120 | // Values owned by this Tree | |
| 121 | nodes: std.MultiArrayList(Node.Repr) = .empty, | |
| 122 | extra: std.ArrayList(u32) = .empty, | |
| 123 | root_decls: std.ArrayList(Node.Index) = .empty, | |
| 124 | value_map: ValueMap = .empty, | |
| 125 | ||
| 126 | pub const genIr = CodeGen.genIr; | |
| 127 | ||
| 128 | pub fn deinit(tree: *Tree) void { | |
| 129 | tree.nodes.deinit(tree.comp.gpa); | |
| 130 | tree.extra.deinit(tree.comp.gpa); | |
| 131 | tree.root_decls.deinit(tree.comp.gpa); | |
| 132 | tree.value_map.deinit(tree.comp.gpa); | |
| 133 | tree.* = undefined; | |
| 134 | } | |
| 135 | ||
| 136 | pub const GNUAssemblyQualifiers = struct { | |
| 137 | @"volatile": bool = false, | |
| 138 | @"inline": bool = false, | |
| 139 | goto: bool = false, | |
| 140 | }; | |
| 141 | ||
| 142 | pub const Node = union(enum) { | |
| 143 | empty_decl: EmptyDecl, | |
| 144 | static_assert: StaticAssert, | |
| 145 | function: Function, | |
| 146 | param: Param, | |
| 147 | variable: Variable, | |
| 148 | typedef: Typedef, | |
| 149 | global_asm: SimpleAsm, | |
| 150 | ||
| 151 | struct_decl: ContainerDecl, | |
| 152 | union_decl: ContainerDecl, | |
| 153 | enum_decl: ContainerDecl, | |
| 154 | struct_forward_decl: ContainerForwardDecl, | |
| 155 | union_forward_decl: ContainerForwardDecl, | |
| 156 | enum_forward_decl: ContainerForwardDecl, | |
| 157 | ||
| 158 | enum_field: EnumField, | |
| 159 | record_field: RecordField, | |
| 160 | ||
| 161 | labeled_stmt: LabeledStmt, | |
| 162 | compound_stmt: CompoundStmt, | |
| 163 | if_stmt: IfStmt, | |
| 164 | switch_stmt: SwitchStmt, | |
| 165 | case_stmt: CaseStmt, | |
| 166 | default_stmt: DefaultStmt, | |
| 167 | while_stmt: WhileStmt, | |
| 168 | do_while_stmt: DoWhileStmt, | |
| 169 | for_stmt: ForStmt, | |
| 170 | goto_stmt: GotoStmt, | |
| 171 | computed_goto_stmt: ComputedGotoStmt, | |
| 172 | continue_stmt: ContinueStmt, | |
| 173 | break_stmt: BreakStmt, | |
| 174 | null_stmt: NullStmt, | |
| 175 | return_stmt: ReturnStmt, | |
| 176 | gnu_asm_simple: SimpleAsm, | |
| 177 | ||
| 178 | assign_expr: Binary, | |
| 179 | mul_assign_expr: Binary, | |
| 180 | div_assign_expr: Binary, | |
| 181 | mod_assign_expr: Binary, | |
| 182 | add_assign_expr: Binary, | |
| 183 | sub_assign_expr: Binary, | |
| 184 | shl_assign_expr: Binary, | |
| 185 | shr_assign_expr: Binary, | |
| 186 | bit_and_assign_expr: Binary, | |
| 187 | bit_xor_assign_expr: Binary, | |
| 188 | bit_or_assign_expr: Binary, | |
| 189 | compound_assign_dummy_expr: Unary, | |
| 190 | ||
| 191 | comma_expr: Binary, | |
| 192 | bool_or_expr: Binary, | |
| 193 | bool_and_expr: Binary, | |
| 194 | bit_or_expr: Binary, | |
| 195 | bit_xor_expr: Binary, | |
| 196 | bit_and_expr: Binary, | |
| 197 | equal_expr: Binary, | |
| 198 | not_equal_expr: Binary, | |
| 199 | less_than_expr: Binary, | |
| 200 | less_than_equal_expr: Binary, | |
| 201 | greater_than_expr: Binary, | |
| 202 | greater_than_equal_expr: Binary, | |
| 203 | shl_expr: Binary, | |
| 204 | shr_expr: Binary, | |
| 205 | add_expr: Binary, | |
| 206 | sub_expr: Binary, | |
| 207 | mul_expr: Binary, | |
| 208 | div_expr: Binary, | |
| 209 | mod_expr: Binary, | |
| 210 | ||
| 211 | cast: Cast, | |
| 212 | ||
| 213 | addr_of_expr: Unary, | |
| 214 | deref_expr: Unary, | |
| 215 | plus_expr: Unary, | |
| 216 | negate_expr: Unary, | |
| 217 | bit_not_expr: Unary, | |
| 218 | bool_not_expr: Unary, | |
| 219 | pre_inc_expr: Unary, | |
| 220 | pre_dec_expr: Unary, | |
| 221 | imag_expr: Unary, | |
| 222 | real_expr: Unary, | |
| 223 | post_inc_expr: Unary, | |
| 224 | post_dec_expr: Unary, | |
| 225 | paren_expr: Unary, | |
| 226 | stmt_expr: Unary, | |
| 227 | ||
| 228 | addr_of_label: AddrOfLabel, | |
| 229 | ||
| 230 | array_access_expr: ArrayAccess, | |
| 231 | member_access_expr: MemberAccess, | |
| 232 | member_access_ptr_expr: MemberAccess, | |
| 233 | ||
| 234 | call_expr: Call, | |
| 235 | ||
| 236 | decl_ref_expr: DeclRef, | |
| 237 | enumeration_ref: DeclRef, | |
| 238 | ||
| 239 | builtin_call_expr: BuiltinCall, | |
| 240 | builtin_ref: BuiltinRef, | |
| 241 | builtin_types_compatible_p: TypesCompatible, | |
| 242 | builtin_choose_expr: Conditional, | |
| 243 | builtin_convertvector: Convertvector, | |
| 244 | builtin_shufflevector: Shufflevector, | |
| 245 | ||
| 246 | /// C23 bool literal `true` / `false` | |
| 247 | bool_literal: Literal, | |
| 248 | /// C23 nullptr literal | |
| 249 | nullptr_literal: Literal, | |
| 250 | /// integer literal, always unsigned | |
| 251 | int_literal: Literal, | |
| 252 | /// Same as int_literal, but originates from a char literal | |
| 253 | char_literal: CharLiteral, | |
| 254 | /// a floating point literal | |
| 255 | float_literal: Literal, | |
| 256 | string_literal_expr: CharLiteral, | |
| 257 | /// wraps a float or double literal | |
| 258 | imaginary_literal: Unary, | |
| 259 | /// A compound literal (type){ init } | |
| 260 | compound_literal_expr: CompoundLiteral, | |
| 261 | ||
| 262 | sizeof_expr: TypeInfo, | |
| 263 | alignof_expr: TypeInfo, | |
| 264 | ||
| 265 | generic_expr: Generic, | |
| 266 | generic_association_expr: Generic.Association, | |
| 267 | generic_default_expr: Generic.Default, | |
| 268 | ||
| 269 | binary_cond_expr: Conditional, | |
| 270 | /// Used as the base for casts of the lhs in `binary_cond_expr`. | |
| 271 | cond_dummy_expr: Unary, | |
| 272 | cond_expr: Conditional, | |
| 273 | ||
| 274 | array_init_expr: ContainerInit, | |
| 275 | struct_init_expr: ContainerInit, | |
| 276 | union_init_expr: UnionInit, | |
| 277 | /// Inserted in array_init_expr to represent unspecified elements. | |
| 278 | /// data.int contains the amount of elements. | |
| 279 | array_filler_expr: ArrayFiller, | |
| 280 | /// Inserted in record and scalar initializers for unspecified elements. | |
| 281 | default_init_expr: DefaultInit, | |
| 282 | ||
| 283 | pub const EmptyDecl = struct { | |
| 284 | semicolon: TokenIndex, | |
| 285 | }; | |
| 286 | ||
| 287 | pub const StaticAssert = struct { | |
| 288 | assert_tok: TokenIndex, | |
| 289 | cond: Node.Index, | |
| 290 | message: ?Node.Index, | |
| 291 | }; | |
| 292 | ||
| 293 | pub const Function = struct { | |
| 294 | name_tok: TokenIndex, | |
| 295 | qt: QualType, | |
| 296 | static: bool, | |
| 297 | @"inline": bool, | |
| 298 | body: ?Node.Index, | |
| 299 | /// Actual, non-tentative definition of this function. | |
| 300 | definition: ?Node.Index, | |
| 301 | }; | |
| 302 | ||
| 303 | pub const Param = struct { | |
| 304 | name_tok: TokenIndex, | |
| 305 | qt: QualType, | |
| 306 | storage_class: enum { | |
| 307 | auto, | |
| 308 | register, | |
| 309 | }, | |
| 310 | }; | |
| 311 | ||
| 312 | pub const Variable = struct { | |
| 313 | name_tok: TokenIndex, | |
| 314 | qt: QualType, | |
| 315 | storage_class: enum { | |
| 316 | auto, | |
| 317 | static, | |
| 318 | @"extern", | |
| 319 | register, | |
| 320 | }, | |
| 321 | thread_local: bool, | |
| 322 | /// From predefined macro __func__, __FUNCTION__ or __PRETTY_FUNCTION__. | |
| 323 | /// Implies `static == true`. | |
| 324 | implicit: bool, | |
| 325 | initializer: ?Node.Index, | |
| 326 | /// Actual, non-tentative definition of this variable. | |
| 327 | definition: ?Node.Index, | |
| 328 | }; | |
| 329 | ||
| 330 | pub const Typedef = struct { | |
| 331 | name_tok: TokenIndex, | |
| 332 | qt: QualType, | |
| 333 | implicit: bool, | |
| 334 | }; | |
| 335 | ||
| 336 | pub const SimpleAsm = struct { | |
| 337 | asm_tok: TokenIndex, | |
| 338 | asm_str: Node.Index, | |
| 339 | }; | |
| 340 | ||
| 341 | pub const ContainerDecl = struct { | |
| 342 | name_or_kind_tok: TokenIndex, | |
| 343 | container_qt: QualType, | |
| 344 | fields: []const Node.Index, | |
| 345 | }; | |
| 346 | ||
| 347 | pub const ContainerForwardDecl = struct { | |
| 348 | name_or_kind_tok: TokenIndex, | |
| 349 | container_qt: QualType, | |
| 350 | /// The definition for this forward declaration if one exists. | |
| 351 | definition: ?Node.Index, | |
| 352 | }; | |
| 353 | ||
| 354 | pub const EnumField = struct { | |
| 355 | name_tok: TokenIndex, | |
| 356 | qt: QualType, | |
| 357 | init: ?Node.Index, | |
| 358 | }; | |
| 359 | ||
| 360 | pub const RecordField = struct { | |
| 361 | name_or_first_tok: TokenIndex, | |
| 362 | qt: QualType, | |
| 363 | bit_width: ?Node.Index, | |
| 364 | }; | |
| 365 | ||
| 366 | pub const LabeledStmt = struct { | |
| 367 | label_tok: TokenIndex, | |
| 368 | body: Node.Index, | |
| 369 | qt: QualType, | |
| 370 | }; | |
| 371 | ||
| 372 | pub const CompoundStmt = struct { | |
| 373 | l_brace_tok: TokenIndex, | |
| 374 | body: []const Node.Index, | |
| 375 | }; | |
| 376 | ||
| 377 | pub const IfStmt = struct { | |
| 378 | if_tok: TokenIndex, | |
| 379 | cond: Node.Index, | |
| 380 | then_body: Node.Index, | |
| 381 | else_body: ?Node.Index, | |
| 382 | }; | |
| 383 | ||
| 384 | pub const SwitchStmt = struct { | |
| 385 | switch_tok: TokenIndex, | |
| 386 | cond: Node.Index, | |
| 387 | body: Node.Index, | |
| 388 | }; | |
| 389 | ||
| 390 | pub const CaseStmt = struct { | |
| 391 | case_tok: TokenIndex, | |
| 392 | start: Node.Index, | |
| 393 | end: ?Node.Index, | |
| 394 | body: Node.Index, | |
| 395 | }; | |
| 396 | ||
| 397 | pub const DefaultStmt = struct { | |
| 398 | default_tok: TokenIndex, | |
| 399 | body: Node.Index, | |
| 400 | }; | |
| 401 | ||
| 402 | pub const WhileStmt = struct { | |
| 403 | while_tok: TokenIndex, | |
| 404 | cond: Node.Index, | |
| 405 | body: Node.Index, | |
| 406 | }; | |
| 407 | ||
| 408 | pub const DoWhileStmt = struct { | |
| 409 | do_tok: TokenIndex, | |
| 410 | cond: Node.Index, | |
| 411 | body: Node.Index, | |
| 412 | }; | |
| 413 | ||
| 414 | pub const ForStmt = struct { | |
| 415 | for_tok: TokenIndex, | |
| 416 | init: union(enum) { | |
| 417 | decls: []const Node.Index, | |
| 418 | expr: ?Node.Index, | |
| 419 | }, | |
| 420 | cond: ?Node.Index, | |
| 421 | incr: ?Node.Index, | |
| 422 | body: Node.Index, | |
| 423 | }; | |
| 424 | ||
| 425 | pub const GotoStmt = struct { | |
| 426 | label_tok: TokenIndex, | |
| 427 | }; | |
| 428 | ||
| 429 | pub const ComputedGotoStmt = struct { | |
| 430 | goto_tok: TokenIndex, | |
| 431 | expr: Node.Index, | |
| 432 | }; | |
| 433 | ||
| 434 | pub const ContinueStmt = struct { | |
| 435 | continue_tok: TokenIndex, | |
| 436 | }; | |
| 437 | ||
| 438 | pub const BreakStmt = struct { | |
| 439 | break_tok: TokenIndex, | |
| 440 | }; | |
| 441 | ||
| 442 | pub const NullStmt = struct { | |
| 443 | semicolon_or_r_brace_tok: TokenIndex, | |
| 444 | qt: QualType, | |
| 445 | }; | |
| 446 | ||
| 447 | pub const ReturnStmt = struct { | |
| 448 | return_tok: TokenIndex, | |
| 449 | return_qt: QualType, | |
| 450 | operand: union(enum) { | |
| 451 | expr: Node.Index, | |
| 452 | /// True if the function is called "main" and return_qt is compatible with int | |
| 453 | implicit: bool, | |
| 454 | none, | |
| 455 | }, | |
| 456 | }; | |
| 457 | ||
| 458 | pub const Binary = struct { | |
| 459 | qt: QualType, | |
| 460 | lhs: Node.Index, | |
| 461 | op_tok: TokenIndex, | |
| 462 | rhs: Node.Index, | |
| 463 | }; | |
| 464 | ||
| 465 | pub const Cast = struct { | |
| 466 | qt: QualType, | |
| 467 | l_paren: TokenIndex, | |
| 468 | kind: Kind, | |
| 469 | operand: Node.Index, | |
| 470 | implicit: bool, | |
| 471 | ||
| 472 | pub const Kind = enum { | |
| 473 | /// Does nothing except possibly add qualifiers | |
| 474 | no_op, | |
| 475 | /// Interpret one bit pattern as another. Used for operands which have the same | |
| 476 | /// size and unrelated types, e.g. casting one pointer type to another | |
| 477 | bitcast, | |
| 478 | /// Convert T[] to T * | |
| 479 | array_to_pointer, | |
| 480 | /// Converts an lvalue to an rvalue | |
| 481 | lval_to_rval, | |
| 482 | /// Convert a function type to a pointer to a function | |
| 483 | function_to_pointer, | |
| 484 | /// Convert a pointer type to a _Bool | |
| 485 | pointer_to_bool, | |
| 486 | /// Convert a pointer type to an integer type | |
| 487 | pointer_to_int, | |
| 488 | /// Convert _Bool to an integer type | |
| 489 | bool_to_int, | |
| 490 | /// Convert _Bool to a floating type | |
| 491 | bool_to_float, | |
| 492 | /// Convert a _Bool to a pointer; will cause a warning | |
| 493 | bool_to_pointer, | |
| 494 | /// Convert an integer type to _Bool | |
| 495 | int_to_bool, | |
| 496 | /// Convert an integer to a floating type | |
| 497 | int_to_float, | |
| 498 | /// Convert a complex integer to a complex floating type | |
| 499 | complex_int_to_complex_float, | |
| 500 | /// Convert an integer type to a pointer type | |
| 501 | int_to_pointer, | |
| 502 | /// Convert a floating type to a _Bool | |
| 503 | float_to_bool, | |
| 504 | /// Convert a floating type to an integer | |
| 505 | float_to_int, | |
| 506 | /// Convert a complex floating type to a complex integer | |
| 507 | complex_float_to_complex_int, | |
| 508 | /// Convert one integer type to another | |
| 509 | int_cast, | |
| 510 | /// Convert one complex integer type to another | |
| 511 | complex_int_cast, | |
| 512 | /// Convert real part of complex integer to a integer | |
| 513 | complex_int_to_real, | |
| 514 | /// Create a complex integer type using operand as the real part | |
| 515 | real_to_complex_int, | |
| 516 | /// Convert one floating type to another | |
| 517 | float_cast, | |
| 518 | /// Convert one complex floating type to another | |
| 519 | complex_float_cast, | |
| 520 | /// Convert real part of complex float to a float | |
| 521 | complex_float_to_real, | |
| 522 | /// Create a complex floating type using operand as the real part | |
| 523 | real_to_complex_float, | |
| 524 | /// Convert type to void | |
| 525 | to_void, | |
| 526 | /// Convert a literal 0 to a null pointer | |
| 527 | null_to_pointer, | |
| 528 | /// GNU cast-to-union extension | |
| 529 | union_cast, | |
| 530 | /// Create vector where each value is same as the input scalar. | |
| 531 | vector_splat, | |
| 532 | /// Convert an atomic type to its non atomic base type. | |
| 533 | atomic_to_non_atomic, | |
| 534 | /// Convert a non atomic type to an atomic type. | |
| 535 | non_atomic_to_atomic, | |
| 536 | }; | |
| 537 | }; | |
| 538 | ||
| 539 | pub const Unary = struct { | |
| 540 | qt: QualType, | |
| 541 | op_tok: TokenIndex, | |
| 542 | operand: Node.Index, | |
| 543 | }; | |
| 544 | ||
| 545 | pub const AddrOfLabel = struct { | |
| 546 | label_tok: TokenIndex, | |
| 547 | qt: QualType, | |
| 548 | }; | |
| 549 | ||
| 550 | pub const ArrayAccess = struct { | |
| 551 | l_bracket_tok: TokenIndex, | |
| 552 | qt: QualType, | |
| 553 | base: Node.Index, | |
| 554 | index: Node.Index, | |
| 555 | }; | |
| 556 | ||
| 557 | pub const MemberAccess = struct { | |
| 558 | qt: QualType, | |
| 559 | base: Node.Index, | |
| 560 | access_tok: TokenIndex, | |
| 561 | member_index: u32, | |
| 562 | ||
| 563 | pub fn isBitFieldWidth(access: MemberAccess, tree: *const Tree) ?u32 { | |
| 564 | var qt = access.base.qt(tree); | |
| 565 | if (qt.isInvalid()) return null; | |
| 566 | if (qt.get(tree.comp, .pointer)) |pointer| qt = pointer.child; | |
| 567 | const record_ty = switch (qt.base(tree.comp).type) { | |
| 568 | .@"struct", .@"union" => |record| record, | |
| 569 | else => return null, | |
| 570 | }; | |
| 571 | return record_ty.fields[access.member_index].bit_width.unpack(); | |
| 101 | 572 | } |
| 573 | }; | |
| 574 | ||
| 575 | pub const Call = struct { | |
| 576 | l_paren_tok: TokenIndex, | |
| 577 | qt: QualType, | |
| 578 | callee: Node.Index, | |
| 579 | args: []const Node.Index, | |
| 580 | }; | |
| 581 | ||
| 582 | pub const DeclRef = struct { | |
| 583 | name_tok: TokenIndex, | |
| 584 | qt: QualType, | |
| 585 | decl: Node.Index, | |
| 586 | }; | |
| 587 | ||
| 588 | pub const BuiltinCall = struct { | |
| 589 | builtin_tok: TokenIndex, | |
| 590 | qt: QualType, | |
| 591 | args: []const Node.Index, | |
| 592 | }; | |
| 593 | ||
| 594 | pub const BuiltinRef = struct { | |
| 595 | name_tok: TokenIndex, | |
| 596 | qt: QualType, | |
| 597 | }; | |
| 598 | ||
| 599 | pub const TypesCompatible = struct { | |
| 600 | builtin_tok: TokenIndex, | |
| 601 | lhs: QualType, | |
| 602 | rhs: QualType, | |
| 603 | }; | |
| 604 | ||
| 605 | pub const Convertvector = struct { | |
| 606 | builtin_tok: TokenIndex, | |
| 607 | dest_qt: QualType, | |
| 608 | operand: Node.Index, | |
| 609 | }; | |
| 610 | ||
| 611 | pub const Shufflevector = struct { | |
| 612 | builtin_tok: TokenIndex, | |
| 613 | qt: QualType, | |
| 614 | lhs: Node.Index, | |
| 615 | rhs: Node.Index, | |
| 616 | indexes: []const Node.Index, | |
| 617 | }; | |
| 618 | ||
| 619 | pub const Literal = struct { | |
| 620 | literal_tok: TokenIndex, | |
| 621 | qt: QualType, | |
| 622 | }; | |
| 623 | ||
| 624 | pub const CharLiteral = struct { | |
| 625 | literal_tok: TokenIndex, | |
| 626 | qt: QualType, | |
| 627 | kind: enum { | |
| 628 | ascii, | |
| 629 | wide, | |
| 630 | utf8, | |
| 631 | utf16, | |
| 632 | utf32, | |
| 633 | }, | |
| 634 | }; | |
| 635 | ||
| 636 | pub const CompoundLiteral = struct { | |
| 637 | l_paren_tok: TokenIndex, | |
| 638 | qt: QualType, | |
| 639 | thread_local: bool, | |
| 640 | storage_class: enum { | |
| 641 | auto, | |
| 642 | static, | |
| 643 | register, | |
| 644 | }, | |
| 645 | initializer: Node.Index, | |
| 646 | }; | |
| 647 | ||
| 648 | pub const TypeInfo = struct { | |
| 649 | qt: QualType, | |
| 650 | op_tok: TokenIndex, | |
| 651 | expr: ?Node.Index, | |
| 652 | operand_qt: QualType, | |
| 653 | }; | |
| 654 | ||
| 655 | pub const Generic = struct { | |
| 656 | generic_tok: TokenIndex, | |
| 657 | qt: QualType, | |
| 658 | ||
| 659 | // `Generic` child nodes are either an `Association` a `Default` | |
| 660 | controlling: Node.Index, | |
| 661 | chosen: Node.Index, | |
| 662 | rest: []const Node.Index, | |
| 663 | ||
| 664 | pub const Association = struct { | |
| 665 | colon_tok: TokenIndex, | |
| 666 | association_qt: QualType, | |
| 667 | expr: Node.Index, | |
| 668 | }; | |
| 669 | ||
| 670 | pub const Default = struct { | |
| 671 | default_tok: TokenIndex, | |
| 672 | expr: Node.Index, | |
| 673 | }; | |
| 674 | }; | |
| 675 | ||
| 676 | pub const Conditional = struct { | |
| 677 | cond_tok: TokenIndex, | |
| 678 | qt: QualType, | |
| 679 | cond: Node.Index, | |
| 680 | then_expr: Node.Index, | |
| 681 | else_expr: Node.Index, | |
| 682 | }; | |
| 683 | ||
| 684 | pub const ContainerInit = struct { | |
| 685 | l_brace_tok: TokenIndex, | |
| 686 | container_qt: QualType, | |
| 687 | items: []const Node.Index, | |
| 688 | }; | |
| 689 | ||
| 690 | pub const UnionInit = struct { | |
| 691 | l_brace_tok: TokenIndex, | |
| 692 | union_qt: QualType, | |
| 693 | field_index: u32, | |
| 694 | initializer: ?Node.Index, | |
| 695 | }; | |
| 696 | ||
| 697 | pub const ArrayFiller = struct { | |
| 698 | last_tok: TokenIndex, | |
| 699 | qt: QualType, | |
| 700 | count: u64, | |
| 701 | }; | |
| 702 | ||
| 703 | pub const DefaultInit = struct { | |
| 704 | last_tok: TokenIndex, | |
| 705 | qt: QualType, | |
| 706 | }; | |
| 707 | ||
| 708 | pub const Index = enum(u32) { | |
| 709 | _, | |
| 710 | ||
| 711 | pub fn get(index: Index, tree: *const Tree) Node { | |
| 712 | const node_tok = tree.nodes.items(.tok)[@intFromEnum(index)]; | |
| 713 | const node_data = &tree.nodes.items(.data)[@intFromEnum(index)]; | |
| 714 | return switch (tree.nodes.items(.tag)[@intFromEnum(index)]) { | |
| 715 | .empty_decl => .{ | |
| 716 | .empty_decl = .{ | |
| 717 | .semicolon = node_tok, | |
| 718 | }, | |
| 719 | }, | |
| 720 | .static_assert => .{ | |
| 721 | .static_assert = .{ | |
| 722 | .assert_tok = node_tok, | |
| 723 | .cond = @enumFromInt(node_data[0]), | |
| 724 | .message = unpackOptIndex(node_data[1]), | |
| 725 | }, | |
| 726 | }, | |
| 727 | .fn_proto => { | |
| 728 | const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); | |
| 729 | return .{ | |
| 730 | .function = .{ | |
| 731 | .name_tok = node_tok, | |
| 732 | .qt = @bitCast(node_data[0]), | |
| 733 | .static = attr.static, | |
| 734 | .@"inline" = attr.@"inline", | |
| 735 | .body = null, | |
| 736 | .definition = unpackOptIndex(node_data[2]), | |
| 737 | }, | |
| 738 | }; | |
| 739 | }, | |
| 740 | .fn_def => { | |
| 741 | const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); | |
| 742 | return .{ | |
| 743 | .function = .{ | |
| 744 | .name_tok = node_tok, | |
| 745 | .qt = @bitCast(node_data[0]), | |
| 746 | .static = attr.static, | |
| 747 | .@"inline" = attr.@"inline", | |
| 748 | .body = @enumFromInt(node_data[2]), | |
| 749 | .definition = null, | |
| 750 | }, | |
| 751 | }; | |
| 752 | }, | |
| 753 | .param => { | |
| 754 | const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); | |
| 755 | return .{ | |
| 756 | .param = .{ | |
| 757 | .name_tok = node_tok, | |
| 758 | .qt = @bitCast(node_data[0]), | |
| 759 | .storage_class = if (attr.register) | |
| 760 | .register | |
| 761 | else | |
| 762 | .auto, | |
| 763 | }, | |
| 764 | }; | |
| 765 | }, | |
| 766 | .variable => { | |
| 767 | const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); | |
| 768 | return .{ | |
| 769 | .variable = .{ | |
| 770 | .name_tok = node_tok, | |
| 771 | .qt = @bitCast(node_data[0]), | |
| 772 | .storage_class = if (attr.static) | |
| 773 | .static | |
| 774 | else if (attr.@"extern") | |
| 775 | .@"extern" | |
| 776 | else if (attr.register) | |
| 777 | .register | |
| 778 | else | |
| 779 | .auto, | |
| 780 | .thread_local = attr.thread_local, | |
| 781 | .implicit = attr.implicit, | |
| 782 | .initializer = null, | |
| 783 | .definition = unpackOptIndex(node_data[2]), | |
| 784 | }, | |
| 785 | }; | |
| 786 | }, | |
| 787 | .variable_def => { | |
| 788 | const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); | |
| 789 | return .{ | |
| 790 | .variable = .{ | |
| 791 | .name_tok = node_tok, | |
| 792 | .qt = @bitCast(node_data[0]), | |
| 793 | .storage_class = if (attr.static) | |
| 794 | .static | |
| 795 | else if (attr.@"extern") | |
| 796 | .@"extern" | |
| 797 | else if (attr.register) | |
| 798 | .register | |
| 799 | else | |
| 800 | .auto, | |
| 801 | .thread_local = attr.thread_local, | |
| 802 | .implicit = attr.implicit, | |
| 803 | .initializer = unpackOptIndex(node_data[2]), | |
| 804 | .definition = null, | |
| 805 | }, | |
| 806 | }; | |
| 807 | }, | |
| 808 | .typedef => .{ | |
| 809 | .typedef = .{ | |
| 810 | .name_tok = node_tok, | |
| 811 | .qt = @bitCast(node_data[0]), | |
| 812 | .implicit = node_data[1] != 0, | |
| 813 | }, | |
| 814 | }, | |
| 815 | .global_asm => .{ | |
| 816 | .global_asm = .{ | |
| 817 | .asm_tok = node_tok, | |
| 818 | .asm_str = @enumFromInt(node_data[0]), | |
| 819 | }, | |
| 820 | }, | |
| 821 | .struct_decl => .{ | |
| 822 | .struct_decl = .{ | |
| 823 | .name_or_kind_tok = node_tok, | |
| 824 | .container_qt = @bitCast(node_data[0]), | |
| 825 | .fields = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), | |
| 826 | }, | |
| 827 | }, | |
| 828 | .struct_decl_two => .{ | |
| 829 | .struct_decl = .{ | |
| 830 | .name_or_kind_tok = node_tok, | |
| 831 | .container_qt = @bitCast(node_data[0]), | |
| 832 | .fields = unPackElems(node_data[1..]), | |
| 833 | }, | |
| 834 | }, | |
| 835 | .union_decl => .{ | |
| 836 | .union_decl = .{ | |
| 837 | .name_or_kind_tok = node_tok, | |
| 838 | .container_qt = @bitCast(node_data[0]), | |
| 839 | .fields = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), | |
| 840 | }, | |
| 841 | }, | |
| 842 | .union_decl_two => .{ | |
| 843 | .union_decl = .{ | |
| 844 | .name_or_kind_tok = node_tok, | |
| 845 | .container_qt = @bitCast(node_data[0]), | |
| 846 | .fields = unPackElems(node_data[1..]), | |
| 847 | }, | |
| 848 | }, | |
| 849 | .enum_decl => .{ | |
| 850 | .enum_decl = .{ | |
| 851 | .name_or_kind_tok = node_tok, | |
| 852 | .container_qt = @bitCast(node_data[0]), | |
| 853 | .fields = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), | |
| 854 | }, | |
| 855 | }, | |
| 856 | .enum_decl_two => .{ | |
| 857 | .enum_decl = .{ | |
| 858 | .name_or_kind_tok = node_tok, | |
| 859 | .container_qt = @bitCast(node_data[0]), | |
| 860 | .fields = unPackElems(node_data[1..]), | |
| 861 | }, | |
| 862 | }, | |
| 863 | .struct_forward_decl => .{ | |
| 864 | .struct_forward_decl = .{ | |
| 865 | .name_or_kind_tok = node_tok, | |
| 866 | .container_qt = @bitCast(node_data[0]), | |
| 867 | .definition = null, | |
| 868 | }, | |
| 869 | }, | |
| 870 | .union_forward_decl => .{ | |
| 871 | .union_forward_decl = .{ | |
| 872 | .name_or_kind_tok = node_tok, | |
| 873 | .container_qt = @bitCast(node_data[0]), | |
| 874 | .definition = null, | |
| 875 | }, | |
| 876 | }, | |
| 877 | .enum_forward_decl => .{ | |
| 878 | .enum_forward_decl = .{ | |
| 879 | .name_or_kind_tok = node_tok, | |
| 880 | .container_qt = @bitCast(node_data[0]), | |
| 881 | .definition = null, | |
| 882 | }, | |
| 883 | }, | |
| 884 | .enum_field => .{ | |
| 885 | .enum_field = .{ | |
| 886 | .name_tok = node_tok, | |
| 887 | .qt = @bitCast(node_data[0]), | |
| 888 | .init = unpackOptIndex(node_data[1]), | |
| 889 | }, | |
| 890 | }, | |
| 891 | .record_field => .{ | |
| 892 | .record_field = .{ | |
| 893 | .name_or_first_tok = node_tok, | |
| 894 | .qt = @bitCast(node_data[0]), | |
| 895 | .bit_width = unpackOptIndex(node_data[1]), | |
| 896 | }, | |
| 897 | }, | |
| 898 | .labeled_stmt => .{ | |
| 899 | .labeled_stmt = .{ | |
| 900 | .label_tok = node_tok, | |
| 901 | .qt = @bitCast(node_data[0]), | |
| 902 | .body = @enumFromInt(node_data[1]), | |
| 903 | }, | |
| 904 | }, | |
| 905 | .compound_stmt => .{ | |
| 906 | .compound_stmt = .{ | |
| 907 | .l_brace_tok = node_tok, | |
| 908 | .body = @ptrCast(tree.extra.items[node_data[0]..][0..node_data[1]]), | |
| 909 | }, | |
| 910 | }, | |
| 911 | .compound_stmt_three => .{ | |
| 912 | .compound_stmt = .{ | |
| 913 | .l_brace_tok = node_tok, | |
| 914 | .body = unPackElems(node_data), | |
| 915 | }, | |
| 916 | }, | |
| 917 | .if_stmt => .{ | |
| 918 | .if_stmt = .{ | |
| 919 | .if_tok = node_tok, | |
| 920 | .cond = @enumFromInt(node_data[0]), | |
| 921 | .then_body = @enumFromInt(node_data[1]), | |
| 922 | .else_body = unpackOptIndex(node_data[2]), | |
| 923 | }, | |
| 924 | }, | |
| 925 | .switch_stmt => .{ | |
| 926 | .switch_stmt = .{ | |
| 927 | .switch_tok = node_tok, | |
| 928 | .cond = @enumFromInt(node_data[0]), | |
| 929 | .body = @enumFromInt(node_data[1]), | |
| 930 | }, | |
| 931 | }, | |
| 932 | .case_stmt => .{ | |
| 933 | .case_stmt = .{ | |
| 934 | .case_tok = node_tok, | |
| 935 | .start = @enumFromInt(node_data[0]), | |
| 936 | .end = unpackOptIndex(node_data[1]), | |
| 937 | .body = @enumFromInt(node_data[2]), | |
| 938 | }, | |
| 939 | }, | |
| 940 | .default_stmt => .{ | |
| 941 | .default_stmt = .{ | |
| 942 | .default_tok = node_tok, | |
| 943 | .body = @enumFromInt(node_data[0]), | |
| 944 | }, | |
| 945 | }, | |
| 946 | .while_stmt => .{ | |
| 947 | .while_stmt = .{ | |
| 948 | .while_tok = node_tok, | |
| 949 | .cond = @enumFromInt(node_data[0]), | |
| 950 | .body = @enumFromInt(node_data[1]), | |
| 951 | }, | |
| 952 | }, | |
| 953 | .do_while_stmt => .{ | |
| 954 | .do_while_stmt = .{ | |
| 955 | .do_tok = node_tok, | |
| 956 | .cond = @enumFromInt(node_data[0]), | |
| 957 | .body = @enumFromInt(node_data[1]), | |
| 958 | }, | |
| 959 | }, | |
| 960 | .for_decl => .{ | |
| 961 | .for_stmt = .{ | |
| 962 | .for_tok = node_tok, | |
| 963 | .init = .{ .decls = @ptrCast(tree.extra.items[node_data[0]..][0 .. node_data[1] - 2]) }, | |
| 964 | .cond = unpackOptIndex(tree.extra.items[node_data[0] + node_data[1] - 2]), | |
| 965 | .incr = unpackOptIndex(tree.extra.items[node_data[0] + node_data[1] - 1]), | |
| 966 | .body = @enumFromInt(node_data[2]), | |
| 967 | }, | |
| 968 | }, | |
| 969 | .for_expr => .{ | |
| 970 | .for_stmt = .{ | |
| 971 | .for_tok = node_tok, | |
| 972 | .init = .{ .expr = unpackOptIndex(node_data[0]) }, | |
| 973 | .cond = unpackOptIndex(tree.extra.items[node_data[1]]), | |
| 974 | .incr = unpackOptIndex(tree.extra.items[node_data[1] + 1]), | |
| 975 | .body = @enumFromInt(node_data[2]), | |
| 976 | }, | |
| 977 | }, | |
| 978 | .goto_stmt => .{ | |
| 979 | .goto_stmt = .{ | |
| 980 | .label_tok = node_tok, | |
| 981 | }, | |
| 982 | }, | |
| 983 | .computed_goto_stmt => .{ | |
| 984 | .computed_goto_stmt = .{ | |
| 985 | .goto_tok = node_tok, | |
| 986 | .expr = @enumFromInt(node_data[0]), | |
| 987 | }, | |
| 988 | }, | |
| 989 | .continue_stmt => .{ | |
| 990 | .continue_stmt = .{ | |
| 991 | .continue_tok = node_tok, | |
| 992 | }, | |
| 993 | }, | |
| 994 | .break_stmt => .{ | |
| 995 | .break_stmt = .{ | |
| 996 | .break_tok = node_tok, | |
| 997 | }, | |
| 998 | }, | |
| 999 | .null_stmt => .{ | |
| 1000 | .null_stmt = .{ | |
| 1001 | .semicolon_or_r_brace_tok = node_tok, | |
| 1002 | .qt = @bitCast(node_data[0]), | |
| 1003 | }, | |
| 1004 | }, | |
| 1005 | .return_stmt => .{ | |
| 1006 | .return_stmt = .{ | |
| 1007 | .return_tok = node_tok, | |
| 1008 | .return_qt = @bitCast(node_data[0]), | |
| 1009 | .operand = .{ | |
| 1010 | .expr = @enumFromInt(node_data[1]), | |
| 1011 | }, | |
| 1012 | }, | |
| 1013 | }, | |
| 1014 | .return_none_stmt => .{ | |
| 1015 | .return_stmt = .{ | |
| 1016 | .return_tok = node_tok, | |
| 1017 | .return_qt = @bitCast(node_data[0]), | |
| 1018 | .operand = .none, | |
| 1019 | }, | |
| 1020 | }, | |
| 1021 | .implicit_return => .{ | |
| 1022 | .return_stmt = .{ | |
| 1023 | .return_tok = node_tok, | |
| 1024 | .return_qt = @bitCast(node_data[0]), | |
| 1025 | .operand = .{ | |
| 1026 | .implicit = node_data[1] != 0, | |
| 1027 | }, | |
| 1028 | }, | |
| 1029 | }, | |
| 1030 | .gnu_asm_simple => .{ | |
| 1031 | .gnu_asm_simple = .{ | |
| 1032 | .asm_tok = node_tok, | |
| 1033 | .asm_str = @enumFromInt(node_data[0]), | |
| 1034 | }, | |
| 1035 | }, | |
| 1036 | .assign_expr => .{ | |
| 1037 | .assign_expr = .{ | |
| 1038 | .op_tok = node_tok, | |
| 1039 | .qt = @bitCast(node_data[0]), | |
| 1040 | .lhs = @enumFromInt(node_data[1]), | |
| 1041 | .rhs = @enumFromInt(node_data[2]), | |
| 1042 | }, | |
| 1043 | }, | |
| 1044 | .mul_assign_expr => .{ | |
| 1045 | .mul_assign_expr = .{ | |
| 1046 | .op_tok = node_tok, | |
| 1047 | .qt = @bitCast(node_data[0]), | |
| 1048 | .lhs = @enumFromInt(node_data[1]), | |
| 1049 | .rhs = @enumFromInt(node_data[2]), | |
| 1050 | }, | |
| 1051 | }, | |
| 1052 | .div_assign_expr => .{ | |
| 1053 | .div_assign_expr = .{ | |
| 1054 | .op_tok = node_tok, | |
| 1055 | .qt = @bitCast(node_data[0]), | |
| 1056 | .lhs = @enumFromInt(node_data[1]), | |
| 1057 | .rhs = @enumFromInt(node_data[2]), | |
| 1058 | }, | |
| 1059 | }, | |
| 1060 | .mod_assign_expr => .{ | |
| 1061 | .mod_assign_expr = .{ | |
| 1062 | .op_tok = node_tok, | |
| 1063 | .qt = @bitCast(node_data[0]), | |
| 1064 | .lhs = @enumFromInt(node_data[1]), | |
| 1065 | .rhs = @enumFromInt(node_data[2]), | |
| 1066 | }, | |
| 1067 | }, | |
| 1068 | .add_assign_expr => .{ | |
| 1069 | .add_assign_expr = .{ | |
| 1070 | .op_tok = node_tok, | |
| 1071 | .qt = @bitCast(node_data[0]), | |
| 1072 | .lhs = @enumFromInt(node_data[1]), | |
| 1073 | .rhs = @enumFromInt(node_data[2]), | |
| 1074 | }, | |
| 1075 | }, | |
| 1076 | .sub_assign_expr => .{ | |
| 1077 | .sub_assign_expr = .{ | |
| 1078 | .op_tok = node_tok, | |
| 1079 | .qt = @bitCast(node_data[0]), | |
| 1080 | .lhs = @enumFromInt(node_data[1]), | |
| 1081 | .rhs = @enumFromInt(node_data[2]), | |
| 1082 | }, | |
| 1083 | }, | |
| 1084 | .shl_assign_expr => .{ | |
| 1085 | .shl_assign_expr = .{ | |
| 1086 | .op_tok = node_tok, | |
| 1087 | .qt = @bitCast(node_data[0]), | |
| 1088 | .lhs = @enumFromInt(node_data[1]), | |
| 1089 | .rhs = @enumFromInt(node_data[2]), | |
| 1090 | }, | |
| 1091 | }, | |
| 1092 | .shr_assign_expr => .{ | |
| 1093 | .shr_assign_expr = .{ | |
| 1094 | .op_tok = node_tok, | |
| 1095 | .qt = @bitCast(node_data[0]), | |
| 1096 | .lhs = @enumFromInt(node_data[1]), | |
| 1097 | .rhs = @enumFromInt(node_data[2]), | |
| 1098 | }, | |
| 1099 | }, | |
| 1100 | .bit_and_assign_expr => .{ | |
| 1101 | .bit_and_assign_expr = .{ | |
| 1102 | .op_tok = node_tok, | |
| 1103 | .qt = @bitCast(node_data[0]), | |
| 1104 | .lhs = @enumFromInt(node_data[1]), | |
| 1105 | .rhs = @enumFromInt(node_data[2]), | |
| 1106 | }, | |
| 1107 | }, | |
| 1108 | .bit_xor_assign_expr => .{ | |
| 1109 | .bit_xor_assign_expr = .{ | |
| 1110 | .op_tok = node_tok, | |
| 1111 | .qt = @bitCast(node_data[0]), | |
| 1112 | .lhs = @enumFromInt(node_data[1]), | |
| 1113 | .rhs = @enumFromInt(node_data[2]), | |
| 1114 | }, | |
| 1115 | }, | |
| 1116 | .bit_or_assign_expr => .{ | |
| 1117 | .bit_or_assign_expr = .{ | |
| 1118 | .op_tok = node_tok, | |
| 1119 | .qt = @bitCast(node_data[0]), | |
| 1120 | .lhs = @enumFromInt(node_data[1]), | |
| 1121 | .rhs = @enumFromInt(node_data[2]), | |
| 1122 | }, | |
| 1123 | }, | |
| 1124 | .compound_assign_dummy_expr => .{ | |
| 1125 | .compound_assign_dummy_expr = .{ | |
| 1126 | .op_tok = node_tok, | |
| 1127 | .qt = @bitCast(node_data[0]), | |
| 1128 | .operand = @enumFromInt(node_data[1]), | |
| 1129 | }, | |
| 1130 | }, | |
| 1131 | .comma_expr => .{ | |
| 1132 | .comma_expr = .{ | |
| 1133 | .op_tok = node_tok, | |
| 1134 | .qt = @bitCast(node_data[0]), | |
| 1135 | .lhs = @enumFromInt(node_data[1]), | |
| 1136 | .rhs = @enumFromInt(node_data[2]), | |
| 1137 | }, | |
| 1138 | }, | |
| 1139 | .bool_or_expr => .{ | |
| 1140 | .bool_or_expr = .{ | |
| 1141 | .op_tok = node_tok, | |
| 1142 | .qt = @bitCast(node_data[0]), | |
| 1143 | .lhs = @enumFromInt(node_data[1]), | |
| 1144 | .rhs = @enumFromInt(node_data[2]), | |
| 1145 | }, | |
| 1146 | }, | |
| 1147 | .bool_and_expr => .{ | |
| 1148 | .bool_and_expr = .{ | |
| 1149 | .op_tok = node_tok, | |
| 1150 | .qt = @bitCast(node_data[0]), | |
| 1151 | .lhs = @enumFromInt(node_data[1]), | |
| 1152 | .rhs = @enumFromInt(node_data[2]), | |
| 1153 | }, | |
| 1154 | }, | |
| 1155 | .bit_or_expr => .{ | |
| 1156 | .bit_or_expr = .{ | |
| 1157 | .op_tok = node_tok, | |
| 1158 | .qt = @bitCast(node_data[0]), | |
| 1159 | .lhs = @enumFromInt(node_data[1]), | |
| 1160 | .rhs = @enumFromInt(node_data[2]), | |
| 1161 | }, | |
| 1162 | }, | |
| 1163 | .bit_xor_expr => .{ | |
| 1164 | .bit_xor_expr = .{ | |
| 1165 | .op_tok = node_tok, | |
| 1166 | .qt = @bitCast(node_data[0]), | |
| 1167 | .lhs = @enumFromInt(node_data[1]), | |
| 1168 | .rhs = @enumFromInt(node_data[2]), | |
| 1169 | }, | |
| 1170 | }, | |
| 1171 | .bit_and_expr => .{ | |
| 1172 | .bit_and_expr = .{ | |
| 1173 | .op_tok = node_tok, | |
| 1174 | .qt = @bitCast(node_data[0]), | |
| 1175 | .lhs = @enumFromInt(node_data[1]), | |
| 1176 | .rhs = @enumFromInt(node_data[2]), | |
| 1177 | }, | |
| 1178 | }, | |
| 1179 | .equal_expr => .{ | |
| 1180 | .equal_expr = .{ | |
| 1181 | .op_tok = node_tok, | |
| 1182 | .qt = @bitCast(node_data[0]), | |
| 1183 | .lhs = @enumFromInt(node_data[1]), | |
| 1184 | .rhs = @enumFromInt(node_data[2]), | |
| 1185 | }, | |
| 1186 | }, | |
| 1187 | .not_equal_expr => .{ | |
| 1188 | .not_equal_expr = .{ | |
| 1189 | .op_tok = node_tok, | |
| 1190 | .qt = @bitCast(node_data[0]), | |
| 1191 | .lhs = @enumFromInt(node_data[1]), | |
| 1192 | .rhs = @enumFromInt(node_data[2]), | |
| 1193 | }, | |
| 1194 | }, | |
| 1195 | .less_than_expr => .{ | |
| 1196 | .less_than_expr = .{ | |
| 1197 | .op_tok = node_tok, | |
| 1198 | .qt = @bitCast(node_data[0]), | |
| 1199 | .lhs = @enumFromInt(node_data[1]), | |
| 1200 | .rhs = @enumFromInt(node_data[2]), | |
| 1201 | }, | |
| 1202 | }, | |
| 1203 | .less_than_equal_expr => .{ | |
| 1204 | .less_than_equal_expr = .{ | |
| 1205 | .op_tok = node_tok, | |
| 1206 | .qt = @bitCast(node_data[0]), | |
| 1207 | .lhs = @enumFromInt(node_data[1]), | |
| 1208 | .rhs = @enumFromInt(node_data[2]), | |
| 1209 | }, | |
| 1210 | }, | |
| 1211 | .greater_than_expr => .{ | |
| 1212 | .greater_than_expr = .{ | |
| 1213 | .op_tok = node_tok, | |
| 1214 | .qt = @bitCast(node_data[0]), | |
| 1215 | .lhs = @enumFromInt(node_data[1]), | |
| 1216 | .rhs = @enumFromInt(node_data[2]), | |
| 1217 | }, | |
| 1218 | }, | |
| 1219 | .greater_than_equal_expr => .{ | |
| 1220 | .greater_than_equal_expr = .{ | |
| 1221 | .op_tok = node_tok, | |
| 1222 | .qt = @bitCast(node_data[0]), | |
| 1223 | .lhs = @enumFromInt(node_data[1]), | |
| 1224 | .rhs = @enumFromInt(node_data[2]), | |
| 1225 | }, | |
| 1226 | }, | |
| 1227 | .shl_expr => .{ | |
| 1228 | .shl_expr = .{ | |
| 1229 | .op_tok = node_tok, | |
| 1230 | .qt = @bitCast(node_data[0]), | |
| 1231 | .lhs = @enumFromInt(node_data[1]), | |
| 1232 | .rhs = @enumFromInt(node_data[2]), | |
| 1233 | }, | |
| 1234 | }, | |
| 1235 | .shr_expr => .{ | |
| 1236 | .shr_expr = .{ | |
| 1237 | .op_tok = node_tok, | |
| 1238 | .qt = @bitCast(node_data[0]), | |
| 1239 | .lhs = @enumFromInt(node_data[1]), | |
| 1240 | .rhs = @enumFromInt(node_data[2]), | |
| 1241 | }, | |
| 1242 | }, | |
| 1243 | .add_expr => .{ | |
| 1244 | .add_expr = .{ | |
| 1245 | .op_tok = node_tok, | |
| 1246 | .qt = @bitCast(node_data[0]), | |
| 1247 | .lhs = @enumFromInt(node_data[1]), | |
| 1248 | .rhs = @enumFromInt(node_data[2]), | |
| 1249 | }, | |
| 1250 | }, | |
| 1251 | .sub_expr => .{ | |
| 1252 | .sub_expr = .{ | |
| 1253 | .op_tok = node_tok, | |
| 1254 | .qt = @bitCast(node_data[0]), | |
| 1255 | .lhs = @enumFromInt(node_data[1]), | |
| 1256 | .rhs = @enumFromInt(node_data[2]), | |
| 1257 | }, | |
| 1258 | }, | |
| 1259 | .mul_expr => .{ | |
| 1260 | .mul_expr = .{ | |
| 1261 | .op_tok = node_tok, | |
| 1262 | .qt = @bitCast(node_data[0]), | |
| 1263 | .lhs = @enumFromInt(node_data[1]), | |
| 1264 | .rhs = @enumFromInt(node_data[2]), | |
| 1265 | }, | |
| 1266 | }, | |
| 1267 | .div_expr => .{ | |
| 1268 | .div_expr = .{ | |
| 1269 | .op_tok = node_tok, | |
| 1270 | .qt = @bitCast(node_data[0]), | |
| 1271 | .lhs = @enumFromInt(node_data[1]), | |
| 1272 | .rhs = @enumFromInt(node_data[2]), | |
| 1273 | }, | |
| 1274 | }, | |
| 1275 | .mod_expr => .{ | |
| 1276 | .mod_expr = .{ | |
| 1277 | .op_tok = node_tok, | |
| 1278 | .qt = @bitCast(node_data[0]), | |
| 1279 | .lhs = @enumFromInt(node_data[1]), | |
| 1280 | .rhs = @enumFromInt(node_data[2]), | |
| 1281 | }, | |
| 1282 | }, | |
| 1283 | .explicit_cast => .{ | |
| 1284 | .cast = .{ | |
| 1285 | .l_paren = node_tok, | |
| 1286 | .qt = @bitCast(node_data[0]), | |
| 1287 | .kind = @enumFromInt(node_data[1]), | |
| 1288 | .operand = @enumFromInt(node_data[2]), | |
| 1289 | .implicit = false, | |
| 1290 | }, | |
| 1291 | }, | |
| 1292 | .implicit_cast => .{ | |
| 1293 | .cast = .{ | |
| 1294 | .l_paren = node_tok, | |
| 1295 | .qt = @bitCast(node_data[0]), | |
| 1296 | .kind = @enumFromInt(node_data[1]), | |
| 1297 | .operand = @enumFromInt(node_data[2]), | |
| 1298 | .implicit = true, | |
| 1299 | }, | |
| 1300 | }, | |
| 1301 | .addr_of_expr => .{ | |
| 1302 | .addr_of_expr = .{ | |
| 1303 | .op_tok = node_tok, | |
| 1304 | .qt = @bitCast(node_data[0]), | |
| 1305 | .operand = @enumFromInt(node_data[1]), | |
| 1306 | }, | |
| 1307 | }, | |
| 1308 | .deref_expr => .{ | |
| 1309 | .deref_expr = .{ | |
| 1310 | .op_tok = node_tok, | |
| 1311 | .qt = @bitCast(node_data[0]), | |
| 1312 | .operand = @enumFromInt(node_data[1]), | |
| 1313 | }, | |
| 1314 | }, | |
| 1315 | .plus_expr => .{ | |
| 1316 | .plus_expr = .{ | |
| 1317 | .op_tok = node_tok, | |
| 1318 | .qt = @bitCast(node_data[0]), | |
| 1319 | .operand = @enumFromInt(node_data[1]), | |
| 1320 | }, | |
| 1321 | }, | |
| 1322 | .negate_expr => .{ | |
| 1323 | .negate_expr = .{ | |
| 1324 | .op_tok = node_tok, | |
| 1325 | .qt = @bitCast(node_data[0]), | |
| 1326 | .operand = @enumFromInt(node_data[1]), | |
| 1327 | }, | |
| 1328 | }, | |
| 1329 | .bit_not_expr => .{ | |
| 1330 | .bit_not_expr = .{ | |
| 1331 | .op_tok = node_tok, | |
| 1332 | .qt = @bitCast(node_data[0]), | |
| 1333 | .operand = @enumFromInt(node_data[1]), | |
| 1334 | }, | |
| 1335 | }, | |
| 1336 | .bool_not_expr => .{ | |
| 1337 | .bool_not_expr = .{ | |
| 1338 | .op_tok = node_tok, | |
| 1339 | .qt = @bitCast(node_data[0]), | |
| 1340 | .operand = @enumFromInt(node_data[1]), | |
| 1341 | }, | |
| 1342 | }, | |
| 1343 | .pre_inc_expr => .{ | |
| 1344 | .pre_inc_expr = .{ | |
| 1345 | .op_tok = node_tok, | |
| 1346 | .qt = @bitCast(node_data[0]), | |
| 1347 | .operand = @enumFromInt(node_data[1]), | |
| 1348 | }, | |
| 1349 | }, | |
| 1350 | .pre_dec_expr => .{ | |
| 1351 | .pre_dec_expr = .{ | |
| 1352 | .op_tok = node_tok, | |
| 1353 | .qt = @bitCast(node_data[0]), | |
| 1354 | .operand = @enumFromInt(node_data[1]), | |
| 1355 | }, | |
| 1356 | }, | |
| 1357 | .imag_expr => .{ | |
| 1358 | .imag_expr = .{ | |
| 1359 | .op_tok = node_tok, | |
| 1360 | .qt = @bitCast(node_data[0]), | |
| 1361 | .operand = @enumFromInt(node_data[1]), | |
| 1362 | }, | |
| 1363 | }, | |
| 1364 | .real_expr => .{ | |
| 1365 | .real_expr = .{ | |
| 1366 | .op_tok = node_tok, | |
| 1367 | .qt = @bitCast(node_data[0]), | |
| 1368 | .operand = @enumFromInt(node_data[1]), | |
| 1369 | }, | |
| 1370 | }, | |
| 1371 | .post_inc_expr => .{ | |
| 1372 | .post_inc_expr = .{ | |
| 1373 | .op_tok = node_tok, | |
| 1374 | .qt = @bitCast(node_data[0]), | |
| 1375 | .operand = @enumFromInt(node_data[1]), | |
| 1376 | }, | |
| 1377 | }, | |
| 1378 | .post_dec_expr => .{ | |
| 1379 | .post_dec_expr = .{ | |
| 1380 | .op_tok = node_tok, | |
| 1381 | .qt = @bitCast(node_data[0]), | |
| 1382 | .operand = @enumFromInt(node_data[1]), | |
| 1383 | }, | |
| 1384 | }, | |
| 1385 | .paren_expr => .{ | |
| 1386 | .paren_expr = .{ | |
| 1387 | .op_tok = node_tok, | |
| 1388 | .qt = @bitCast(node_data[0]), | |
| 1389 | .operand = @enumFromInt(node_data[1]), | |
| 1390 | }, | |
| 1391 | }, | |
| 1392 | .stmt_expr => .{ | |
| 1393 | .stmt_expr = .{ | |
| 1394 | .op_tok = node_tok, | |
| 1395 | .qt = @bitCast(node_data[0]), | |
| 1396 | .operand = @enumFromInt(node_data[1]), | |
| 1397 | }, | |
| 1398 | }, | |
| 1399 | .cond_dummy_expr => .{ | |
| 1400 | .cond_dummy_expr = .{ | |
| 1401 | .op_tok = node_tok, | |
| 1402 | .qt = @bitCast(node_data[0]), | |
| 1403 | .operand = @enumFromInt(node_data[1]), | |
| 1404 | }, | |
| 1405 | }, | |
| 1406 | .addr_of_label => .{ | |
| 1407 | .addr_of_label = .{ | |
| 1408 | .label_tok = node_tok, | |
| 1409 | .qt = @bitCast(node_data[0]), | |
| 1410 | }, | |
| 1411 | }, | |
| 1412 | .array_access_expr => .{ | |
| 1413 | .array_access_expr = .{ | |
| 1414 | .l_bracket_tok = node_tok, | |
| 1415 | .qt = @bitCast(node_data[0]), | |
| 1416 | .base = @enumFromInt(node_data[1]), | |
| 1417 | .index = @enumFromInt(node_data[2]), | |
| 1418 | }, | |
| 1419 | }, | |
| 1420 | .call_expr => .{ | |
| 1421 | .call_expr = .{ | |
| 1422 | .l_paren_tok = node_tok, | |
| 1423 | .qt = @bitCast(node_data[0]), | |
| 1424 | .callee = @enumFromInt(tree.extra.items[node_data[1]]), | |
| 1425 | .args = @ptrCast(tree.extra.items[node_data[1] + 1 ..][0 .. node_data[2] - 1]), | |
| 1426 | }, | |
| 1427 | }, | |
| 1428 | .call_expr_one => .{ | |
| 1429 | .call_expr = .{ | |
| 1430 | .l_paren_tok = node_tok, | |
| 1431 | .qt = @bitCast(node_data[0]), | |
| 1432 | .callee = @enumFromInt(node_data[1]), | |
| 1433 | .args = unPackElems(node_data[2..]), | |
| 1434 | }, | |
| 1435 | }, | |
| 1436 | .builtin_call_expr => .{ | |
| 1437 | .builtin_call_expr = .{ | |
| 1438 | .builtin_tok = node_tok, | |
| 1439 | .qt = @bitCast(node_data[0]), | |
| 1440 | .args = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), | |
| 1441 | }, | |
| 1442 | }, | |
| 1443 | .builtin_call_expr_two => .{ | |
| 1444 | .builtin_call_expr = .{ | |
| 1445 | .builtin_tok = node_tok, | |
| 1446 | .qt = @bitCast(node_data[0]), | |
| 1447 | .args = unPackElems(node_data[1..]), | |
| 1448 | }, | |
| 1449 | }, | |
| 1450 | .member_access_expr => .{ | |
| 1451 | .member_access_expr = .{ | |
| 1452 | .access_tok = node_tok, | |
| 1453 | .qt = @bitCast(node_data[0]), | |
| 1454 | .base = @enumFromInt(node_data[1]), | |
| 1455 | .member_index = node_data[2], | |
| 1456 | }, | |
| 1457 | }, | |
| 1458 | .member_access_ptr_expr => .{ | |
| 1459 | .member_access_ptr_expr = .{ | |
| 1460 | .access_tok = node_tok, | |
| 1461 | .qt = @bitCast(node_data[0]), | |
| 1462 | .base = @enumFromInt(node_data[1]), | |
| 1463 | .member_index = node_data[2], | |
| 1464 | }, | |
| 1465 | }, | |
| 1466 | .decl_ref_expr => .{ | |
| 1467 | .decl_ref_expr = .{ | |
| 1468 | .name_tok = node_tok, | |
| 1469 | .qt = @bitCast(node_data[0]), | |
| 1470 | .decl = @enumFromInt(node_data[1]), | |
| 1471 | }, | |
| 1472 | }, | |
| 1473 | .enumeration_ref => .{ | |
| 1474 | .enumeration_ref = .{ | |
| 1475 | .name_tok = node_tok, | |
| 1476 | .qt = @bitCast(node_data[0]), | |
| 1477 | .decl = @enumFromInt(node_data[1]), | |
| 1478 | }, | |
| 1479 | }, | |
| 1480 | .builtin_ref => .{ | |
| 1481 | .builtin_ref = .{ | |
| 1482 | .name_tok = node_tok, | |
| 1483 | .qt = @bitCast(node_data[0]), | |
| 1484 | }, | |
| 1485 | }, | |
| 1486 | .bool_literal => .{ | |
| 1487 | .bool_literal = .{ | |
| 1488 | .literal_tok = node_tok, | |
| 1489 | .qt = @bitCast(node_data[0]), | |
| 1490 | }, | |
| 1491 | }, | |
| 1492 | .nullptr_literal => .{ | |
| 1493 | .nullptr_literal = .{ | |
| 1494 | .literal_tok = node_tok, | |
| 1495 | .qt = @bitCast(node_data[0]), | |
| 1496 | }, | |
| 1497 | }, | |
| 1498 | .int_literal => .{ | |
| 1499 | .int_literal = .{ | |
| 1500 | .literal_tok = node_tok, | |
| 1501 | .qt = @bitCast(node_data[0]), | |
| 1502 | }, | |
| 1503 | }, | |
| 1504 | .char_literal => .{ | |
| 1505 | .char_literal = .{ | |
| 1506 | .literal_tok = node_tok, | |
| 1507 | .qt = @bitCast(node_data[0]), | |
| 1508 | .kind = @enumFromInt(node_data[1]), | |
| 1509 | }, | |
| 1510 | }, | |
| 1511 | .float_literal => .{ | |
| 1512 | .float_literal = .{ | |
| 1513 | .literal_tok = node_tok, | |
| 1514 | .qt = @bitCast(node_data[0]), | |
| 1515 | }, | |
| 1516 | }, | |
| 1517 | .string_literal_expr => .{ | |
| 1518 | .string_literal_expr = .{ | |
| 1519 | .literal_tok = node_tok, | |
| 1520 | .qt = @bitCast(node_data[0]), | |
| 1521 | .kind = @enumFromInt(node_data[1]), | |
| 1522 | }, | |
| 1523 | }, | |
| 1524 | .imaginary_literal => .{ | |
| 1525 | .imaginary_literal = .{ | |
| 1526 | .op_tok = node_tok, | |
| 1527 | .qt = @bitCast(node_data[0]), | |
| 1528 | .operand = @enumFromInt(node_data[1]), | |
| 1529 | }, | |
| 1530 | }, | |
| 1531 | .sizeof_expr => .{ | |
| 1532 | .sizeof_expr = .{ | |
| 1533 | .op_tok = node_tok, | |
| 1534 | .qt = @bitCast(node_data[0]), | |
| 1535 | .expr = unpackOptIndex(node_data[1]), | |
| 1536 | .operand_qt = @bitCast(node_data[2]), | |
| 1537 | }, | |
| 1538 | }, | |
| 1539 | .alignof_expr => .{ | |
| 1540 | .alignof_expr = .{ | |
| 1541 | .op_tok = node_tok, | |
| 1542 | .qt = @bitCast(node_data[0]), | |
| 1543 | .expr = unpackOptIndex(node_data[1]), | |
| 1544 | .operand_qt = @bitCast(node_data[2]), | |
| 1545 | }, | |
| 1546 | }, | |
| 1547 | ||
| 1548 | .generic_expr_zero => .{ | |
| 1549 | .generic_expr = .{ | |
| 1550 | .generic_tok = node_tok, | |
| 1551 | .qt = @bitCast(node_data[0]), | |
| 1552 | .controlling = @enumFromInt(node_data[1]), | |
| 1553 | .chosen = @enumFromInt(node_data[2]), | |
| 1554 | .rest = &.{}, | |
| 1555 | }, | |
| 1556 | }, | |
| 1557 | .generic_expr => .{ | |
| 1558 | .generic_expr = .{ | |
| 1559 | .generic_tok = node_tok, | |
| 1560 | .qt = @bitCast(node_data[0]), | |
| 1561 | .controlling = @enumFromInt(tree.extra.items[node_data[1]]), | |
| 1562 | .chosen = @enumFromInt(tree.extra.items[node_data[1] + 1]), | |
| 1563 | .rest = @ptrCast(tree.extra.items[node_data[1] + 2 ..][0 .. node_data[2] - 2]), | |
| 1564 | }, | |
| 1565 | }, | |
| 1566 | .generic_association_expr => .{ | |
| 1567 | .generic_association_expr = .{ | |
| 1568 | .colon_tok = node_tok, | |
| 1569 | .association_qt = @bitCast(node_data[0]), | |
| 1570 | .expr = @enumFromInt(node_data[1]), | |
| 1571 | }, | |
| 1572 | }, | |
| 1573 | .generic_default_expr => .{ | |
| 1574 | .generic_default_expr = .{ | |
| 1575 | .default_tok = node_tok, | |
| 1576 | .expr = @enumFromInt(node_data[0]), | |
| 1577 | }, | |
| 1578 | }, | |
| 1579 | .binary_cond_expr => .{ | |
| 1580 | .binary_cond_expr = .{ | |
| 1581 | .cond_tok = node_tok, | |
| 1582 | .qt = @bitCast(node_data[0]), | |
| 1583 | .cond = @enumFromInt(node_data[1]), | |
| 1584 | .then_expr = @enumFromInt(tree.extra.items[node_data[2]]), | |
| 1585 | .else_expr = @enumFromInt(tree.extra.items[node_data[2] + 1]), | |
| 1586 | }, | |
| 1587 | }, | |
| 1588 | .cond_expr => .{ | |
| 1589 | .cond_expr = .{ | |
| 1590 | .cond_tok = node_tok, | |
| 1591 | .qt = @bitCast(node_data[0]), | |
| 1592 | .cond = @enumFromInt(node_data[1]), | |
| 1593 | .then_expr = @enumFromInt(tree.extra.items[node_data[2]]), | |
| 1594 | .else_expr = @enumFromInt(tree.extra.items[node_data[2] + 1]), | |
| 1595 | }, | |
| 1596 | }, | |
| 1597 | .builtin_choose_expr => .{ | |
| 1598 | .builtin_choose_expr = .{ | |
| 1599 | .cond_tok = node_tok, | |
| 1600 | .qt = @bitCast(node_data[0]), | |
| 1601 | .cond = @enumFromInt(node_data[1]), | |
| 1602 | .then_expr = @enumFromInt(tree.extra.items[node_data[2]]), | |
| 1603 | .else_expr = @enumFromInt(tree.extra.items[node_data[2] + 1]), | |
| 1604 | }, | |
| 1605 | }, | |
| 1606 | .builtin_types_compatible_p => .{ | |
| 1607 | .builtin_types_compatible_p = .{ | |
| 1608 | .builtin_tok = node_tok, | |
| 1609 | .lhs = @bitCast(node_data[0]), | |
| 1610 | .rhs = @bitCast(node_data[1]), | |
| 1611 | }, | |
| 1612 | }, | |
| 1613 | .builtin_convertvector => .{ | |
| 1614 | .builtin_convertvector = .{ | |
| 1615 | .builtin_tok = node_tok, | |
| 1616 | .dest_qt = @bitCast(node_data[0]), | |
| 1617 | .operand = @enumFromInt(node_data[1]), | |
| 1618 | }, | |
| 1619 | }, | |
| 1620 | .builtin_shufflevector => .{ | |
| 1621 | .builtin_shufflevector = .{ | |
| 1622 | .builtin_tok = node_tok, | |
| 1623 | .qt = @bitCast(node_data[0]), | |
| 1624 | .lhs = @enumFromInt(tree.extra.items[node_data[1]]), | |
| 1625 | .rhs = @enumFromInt(tree.extra.items[node_data[1] + 1]), | |
| 1626 | .indexes = @ptrCast(tree.extra.items[node_data[1] + 2 ..][0..node_data[2]]), | |
| 1627 | }, | |
| 1628 | }, | |
| 1629 | .array_init_expr_two => .{ | |
| 1630 | .array_init_expr = .{ | |
| 1631 | .l_brace_tok = node_tok, | |
| 1632 | .container_qt = @bitCast(node_data[0]), | |
| 1633 | .items = unPackElems(node_data[1..]), | |
| 1634 | }, | |
| 1635 | }, | |
| 1636 | .array_init_expr => .{ | |
| 1637 | .array_init_expr = .{ | |
| 1638 | .l_brace_tok = node_tok, | |
| 1639 | .container_qt = @bitCast(node_data[0]), | |
| 1640 | .items = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), | |
| 1641 | }, | |
| 1642 | }, | |
| 1643 | .struct_init_expr_two => .{ | |
| 1644 | .struct_init_expr = .{ | |
| 1645 | .l_brace_tok = node_tok, | |
| 1646 | .container_qt = @bitCast(node_data[0]), | |
| 1647 | .items = unPackElems(node_data[1..]), | |
| 1648 | }, | |
| 1649 | }, | |
| 1650 | .struct_init_expr => .{ | |
| 1651 | .struct_init_expr = .{ | |
| 1652 | .l_brace_tok = node_tok, | |
| 1653 | .container_qt = @bitCast(node_data[0]), | |
| 1654 | .items = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), | |
| 1655 | }, | |
| 1656 | }, | |
| 1657 | .union_init_expr => .{ | |
| 1658 | .union_init_expr = .{ | |
| 1659 | .l_brace_tok = node_tok, | |
| 1660 | .union_qt = @bitCast(node_data[0]), | |
| 1661 | .field_index = node_data[1], | |
| 1662 | .initializer = unpackOptIndex(node_data[2]), | |
| 1663 | }, | |
| 1664 | }, | |
| 1665 | .array_filler_expr => .{ | |
| 1666 | .array_filler_expr = .{ | |
| 1667 | .last_tok = node_tok, | |
| 1668 | .qt = @bitCast(node_data[0]), | |
| 1669 | .count = @bitCast(node_data[1..].*), | |
| 1670 | }, | |
| 1671 | }, | |
| 1672 | .default_init_expr => .{ | |
| 1673 | .default_init_expr = .{ | |
| 1674 | .last_tok = node_tok, | |
| 1675 | .qt = @bitCast(node_data[0]), | |
| 1676 | }, | |
| 1677 | }, | |
| 1678 | .compound_literal_expr => { | |
| 1679 | const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); | |
| 1680 | return .{ | |
| 1681 | .compound_literal_expr = .{ | |
| 1682 | .l_paren_tok = node_tok, | |
| 1683 | .qt = @bitCast(node_data[0]), | |
| 1684 | .storage_class = if (attr.static) | |
| 1685 | .static | |
| 1686 | else if (attr.register) | |
| 1687 | .register | |
| 1688 | else | |
| 1689 | .auto, | |
| 1690 | .thread_local = attr.thread_local, | |
| 1691 | .initializer = @enumFromInt(node_data[2]), | |
| 1692 | }, | |
| 1693 | }; | |
| 1694 | }, | |
| 1695 | }; | |
| 1696 | } | |
| 1697 | ||
| 1698 | pub fn tok(index: Index, tree: *const Tree) TokenIndex { | |
| 1699 | return tree.nodes.items(.tok)[@intFromEnum(index)]; | |
| 1700 | } | |
| 1701 | ||
| 1702 | pub fn loc(index: Index, tree: *const Tree) Source.Location { | |
| 1703 | const tok_i = index.tok(tree); | |
| 1704 | return tree.tokens.items(.loc)[tok_i]; | |
| 1705 | } | |
| 1706 | ||
| 1707 | pub fn qt(index: Index, tree: *const Tree) QualType { | |
| 1708 | return index.qtOrNull(tree) orelse .void; | |
| 1709 | } | |
| 1710 | ||
| 1711 | pub fn qtOrNull(index: Index, tree: *const Tree) ?QualType { | |
| 1712 | return switch (tree.nodes.items(.tag)[@intFromEnum(index)]) { | |
| 1713 | .empty_decl, | |
| 1714 | .static_assert, | |
| 1715 | .compound_stmt, | |
| 1716 | .compound_stmt_three, | |
| 1717 | .if_stmt, | |
| 1718 | .switch_stmt, | |
| 1719 | .case_stmt, | |
| 1720 | .default_stmt, | |
| 1721 | .while_stmt, | |
| 1722 | .do_while_stmt, | |
| 1723 | .for_decl, | |
| 1724 | .for_expr, | |
| 1725 | .goto_stmt, | |
| 1726 | .computed_goto_stmt, | |
| 1727 | .continue_stmt, | |
| 1728 | .break_stmt, | |
| 1729 | .gnu_asm_simple, | |
| 1730 | .global_asm, | |
| 1731 | .generic_association_expr, | |
| 1732 | .generic_default_expr, | |
| 1733 | => null, | |
| 1734 | .builtin_types_compatible_p => .int, | |
| 1735 | else => { | |
| 1736 | // If a node is typed the type is stored in data[0]. | |
| 1737 | return @bitCast(tree.nodes.items(.data)[@intFromEnum(index)][0]); | |
| 1738 | }, | |
| 1739 | }; | |
| 1740 | } | |
| 1741 | }; | |
| 1742 | ||
| 1743 | pub const OptIndex = enum(u32) { | |
| 1744 | null = std.math.maxInt(u32), | |
| 1745 | _, | |
| 1746 | ||
| 1747 | pub fn unpack(opt: OptIndex) ?Index { | |
| 1748 | return if (opt == .null) null else @enumFromInt(@intFromEnum(opt)); | |
| 1749 | } | |
| 1750 | ||
| 1751 | pub fn pack(index: Index) OptIndex { | |
| 1752 | return @enumFromInt(@intFromEnum(index)); | |
| 1753 | } | |
| 1754 | ||
| 1755 | pub fn packOpt(optional: ?Index) OptIndex { | |
| 1756 | return if (optional) |some| @enumFromInt(@intFromEnum(some)) else .null; | |
| 1757 | } | |
| 1758 | }; | |
| 1759 | ||
| 1760 | pub const Repr = struct { | |
| 1761 | tag: Tag, | |
| 1762 | /// If a node is typed the type is stored in data[0] | |
| 1763 | data: [3]u32, | |
| 1764 | tok: TokenIndex, | |
| 1765 | ||
| 1766 | pub const DeclAttr = packed struct(u32) { | |
| 1767 | @"extern": bool = false, | |
| 1768 | static: bool = false, | |
| 1769 | @"inline": bool = false, | |
| 1770 | thread_local: bool = false, | |
| 1771 | implicit: bool = false, | |
| 1772 | register: bool = false, | |
| 1773 | _: u26 = 0, | |
| 1774 | }; | |
| 1775 | ||
| 1776 | pub const Tag = enum(u8) { | |
| 1777 | empty_decl, | |
| 1778 | static_assert, | |
| 1779 | fn_proto, | |
| 1780 | fn_def, | |
| 1781 | param, | |
| 1782 | variable, | |
| 1783 | variable_def, | |
| 1784 | typedef, | |
| 1785 | global_asm, | |
| 1786 | struct_decl, | |
| 1787 | union_decl, | |
| 1788 | enum_decl, | |
| 1789 | struct_decl_two, | |
| 1790 | union_decl_two, | |
| 1791 | enum_decl_two, | |
| 1792 | struct_forward_decl, | |
| 1793 | union_forward_decl, | |
| 1794 | enum_forward_decl, | |
| 1795 | enum_field, | |
| 1796 | record_field, | |
| 1797 | labeled_stmt, | |
| 1798 | compound_stmt, | |
| 1799 | compound_stmt_three, | |
| 1800 | if_stmt, | |
| 1801 | switch_stmt, | |
| 1802 | case_stmt, | |
| 1803 | default_stmt, | |
| 1804 | while_stmt, | |
| 1805 | do_while_stmt, | |
| 1806 | for_expr, | |
| 1807 | for_decl, | |
| 1808 | goto_stmt, | |
| 1809 | computed_goto_stmt, | |
| 1810 | continue_stmt, | |
| 1811 | break_stmt, | |
| 1812 | null_stmt, | |
| 1813 | return_stmt, | |
| 1814 | return_none_stmt, | |
| 1815 | implicit_return, | |
| 1816 | gnu_asm_simple, | |
| 1817 | comma_expr, | |
| 1818 | assign_expr, | |
| 1819 | mul_assign_expr, | |
| 1820 | div_assign_expr, | |
| 1821 | mod_assign_expr, | |
| 1822 | add_assign_expr, | |
| 1823 | sub_assign_expr, | |
| 1824 | shl_assign_expr, | |
| 1825 | shr_assign_expr, | |
| 1826 | bit_and_assign_expr, | |
| 1827 | bit_xor_assign_expr, | |
| 1828 | bit_or_assign_expr, | |
| 1829 | compound_assign_dummy_expr, | |
| 1830 | bool_or_expr, | |
| 1831 | bool_and_expr, | |
| 1832 | bit_or_expr, | |
| 1833 | bit_xor_expr, | |
| 1834 | bit_and_expr, | |
| 1835 | equal_expr, | |
| 1836 | not_equal_expr, | |
| 1837 | less_than_expr, | |
| 1838 | less_than_equal_expr, | |
| 1839 | greater_than_expr, | |
| 1840 | greater_than_equal_expr, | |
| 1841 | shl_expr, | |
| 1842 | shr_expr, | |
| 1843 | add_expr, | |
| 1844 | sub_expr, | |
| 1845 | mul_expr, | |
| 1846 | div_expr, | |
| 1847 | mod_expr, | |
| 1848 | explicit_cast, | |
| 1849 | implicit_cast, | |
| 1850 | addr_of_expr, | |
| 1851 | deref_expr, | |
| 1852 | plus_expr, | |
| 1853 | negate_expr, | |
| 1854 | bit_not_expr, | |
| 1855 | bool_not_expr, | |
| 1856 | pre_inc_expr, | |
| 1857 | pre_dec_expr, | |
| 1858 | imag_expr, | |
| 1859 | real_expr, | |
| 1860 | post_inc_expr, | |
| 1861 | post_dec_expr, | |
| 1862 | paren_expr, | |
| 1863 | stmt_expr, | |
| 1864 | addr_of_label, | |
| 1865 | array_access_expr, | |
| 1866 | call_expr_one, | |
| 1867 | call_expr, | |
| 1868 | builtin_call_expr, | |
| 1869 | builtin_call_expr_two, | |
| 1870 | member_access_expr, | |
| 1871 | member_access_ptr_expr, | |
| 1872 | decl_ref_expr, | |
| 1873 | enumeration_ref, | |
| 1874 | builtin_ref, | |
| 1875 | bool_literal, | |
| 1876 | nullptr_literal, | |
| 1877 | int_literal, | |
| 1878 | char_literal, | |
| 1879 | float_literal, | |
| 1880 | string_literal_expr, | |
| 1881 | imaginary_literal, | |
| 1882 | sizeof_expr, | |
| 1883 | alignof_expr, | |
| 1884 | generic_expr, | |
| 1885 | generic_expr_zero, | |
| 1886 | generic_association_expr, | |
| 1887 | generic_default_expr, | |
| 1888 | binary_cond_expr, | |
| 1889 | cond_dummy_expr, | |
| 1890 | cond_expr, | |
| 1891 | builtin_choose_expr, | |
| 1892 | builtin_types_compatible_p, | |
| 1893 | builtin_convertvector, | |
| 1894 | builtin_shufflevector, | |
| 1895 | array_init_expr, | |
| 1896 | array_init_expr_two, | |
| 1897 | struct_init_expr, | |
| 1898 | struct_init_expr_two, | |
| 1899 | union_init_expr, | |
| 1900 | array_filler_expr, | |
| 1901 | default_init_expr, | |
| 1902 | compound_literal_expr, | |
| 1903 | }; | |
| 1904 | }; | |
| 1905 | ||
| 1906 | pub fn isImplicit(node: Node) bool { | |
| 1907 | return switch (node) { | |
| 1908 | .array_filler_expr, | |
| 1909 | .default_init_expr, | |
| 1910 | .cond_dummy_expr, | |
| 1911 | .compound_assign_dummy_expr, | |
| 1912 | => true, | |
| 1913 | .return_stmt => |ret| ret.operand == .implicit, | |
| 1914 | .cast => |cast| cast.implicit, | |
| 1915 | .variable => |info| info.implicit, | |
| 1916 | .typedef => |info| info.implicit, | |
| 1917 | else => false, | |
| 1918 | }; | |
| 1919 | } | |
| 1920 | }; | |
| 1921 | ||
| 1922 | pub fn addNode(tree: *Tree, node: Node) !Node.Index { | |
| 1923 | const index = try tree.nodes.addOne(tree.comp.gpa); | |
| 1924 | try tree.setNode(node, index); | |
| 1925 | return @enumFromInt(index); | |
| 1926 | } | |
| 1927 | ||
| 1928 | pub fn setNode(tree: *Tree, node: Node, index: usize) !void { | |
| 1929 | var repr: Node.Repr = undefined; | |
| 1930 | switch (node) { | |
| 1931 | .empty_decl => |empty| { | |
| 1932 | repr.tag = .empty_decl; | |
| 1933 | repr.tok = empty.semicolon; | |
| 1934 | }, | |
| 1935 | .static_assert => |assert| { | |
| 1936 | repr.tag = .static_assert; | |
| 1937 | repr.data[0] = @intFromEnum(assert.cond); | |
| 1938 | repr.data[1] = packOptIndex(assert.message); | |
| 1939 | repr.tok = assert.assert_tok; | |
| 1940 | }, | |
| 1941 | .function => |function| { | |
| 1942 | repr.tag = if (function.body != null) .fn_def else .fn_proto; | |
| 1943 | repr.data[0] = @bitCast(function.qt); | |
| 1944 | repr.data[1] = @bitCast(Node.Repr.DeclAttr{ | |
| 1945 | .static = function.static, | |
| 1946 | .@"inline" = function.@"inline", | |
| 1947 | }); | |
| 1948 | if (function.body) |some| { | |
| 1949 | repr.data[2] = @intFromEnum(some); | |
| 1950 | } else { | |
| 1951 | repr.data[2] = packOptIndex(function.definition); | |
| 1952 | } | |
| 1953 | repr.tok = function.name_tok; | |
| 1954 | }, | |
| 1955 | .param => |param| { | |
| 1956 | repr.tag = .param; | |
| 1957 | repr.data[0] = @bitCast(param.qt); | |
| 1958 | repr.data[1] = @bitCast(Node.Repr.DeclAttr{ | |
| 1959 | .register = param.storage_class == .register, | |
| 1960 | }); | |
| 1961 | repr.tok = param.name_tok; | |
| 1962 | }, | |
| 1963 | .variable => |variable| { | |
| 1964 | repr.tag = if (variable.initializer != null) .variable_def else .variable; | |
| 1965 | repr.data[0] = @bitCast(variable.qt); | |
| 1966 | repr.data[1] = @bitCast(Node.Repr.DeclAttr{ | |
| 1967 | .@"extern" = variable.storage_class == .@"extern", | |
| 1968 | .static = variable.storage_class == .static, | |
| 1969 | .thread_local = variable.thread_local, | |
| 1970 | .implicit = variable.implicit, | |
| 1971 | .register = variable.storage_class == .register, | |
| 1972 | }); | |
| 1973 | if (variable.initializer) |some| { | |
| 1974 | repr.data[2] = @intFromEnum(some); | |
| 1975 | } else { | |
| 1976 | repr.data[2] = packOptIndex(variable.definition); | |
| 1977 | } | |
| 1978 | repr.tok = variable.name_tok; | |
| 1979 | }, | |
| 1980 | .typedef => |typedef| { | |
| 1981 | repr.tag = .typedef; | |
| 1982 | repr.data[0] = @bitCast(typedef.qt); | |
| 1983 | repr.data[1] = @intFromBool(typedef.implicit); | |
| 1984 | repr.tok = typedef.name_tok; | |
| 1985 | }, | |
| 1986 | .global_asm => |global_asm| { | |
| 1987 | repr.tag = .global_asm; | |
| 1988 | repr.data[0] = @intFromEnum(global_asm.asm_str); | |
| 1989 | repr.tok = global_asm.asm_tok; | |
| 1990 | }, | |
| 1991 | .struct_decl => |decl| { | |
| 1992 | repr.data[0] = @bitCast(decl.container_qt); | |
| 1993 | if (decl.fields.len > 2) { | |
| 1994 | repr.tag = .struct_decl; | |
| 1995 | repr.data[1], repr.data[2] = try tree.addExtra(decl.fields); | |
| 1996 | } else { | |
| 1997 | repr.tag = .struct_decl_two; | |
| 1998 | repr.data[1] = packElem(decl.fields, 0); | |
| 1999 | repr.data[2] = packElem(decl.fields, 1); | |
| 2000 | } | |
| 2001 | repr.tok = decl.name_or_kind_tok; | |
| 2002 | }, | |
| 2003 | .union_decl => |decl| { | |
| 2004 | repr.data[0] = @bitCast(decl.container_qt); | |
| 2005 | if (decl.fields.len > 2) { | |
| 2006 | repr.tag = .union_decl; | |
| 2007 | repr.data[1], repr.data[2] = try tree.addExtra(decl.fields); | |
| 2008 | } else { | |
| 2009 | repr.tag = .union_decl_two; | |
| 2010 | repr.data[1] = packElem(decl.fields, 0); | |
| 2011 | repr.data[2] = packElem(decl.fields, 1); | |
| 2012 | } | |
| 2013 | repr.tok = decl.name_or_kind_tok; | |
| 2014 | }, | |
| 2015 | .enum_decl => |decl| { | |
| 2016 | repr.data[0] = @bitCast(decl.container_qt); | |
| 2017 | if (decl.fields.len > 2) { | |
| 2018 | repr.tag = .enum_decl; | |
| 2019 | repr.data[1], repr.data[2] = try tree.addExtra(decl.fields); | |
| 2020 | } else { | |
| 2021 | repr.tag = .enum_decl_two; | |
| 2022 | repr.data[1] = packElem(decl.fields, 0); | |
| 2023 | repr.data[2] = packElem(decl.fields, 1); | |
| 2024 | } | |
| 2025 | repr.tok = decl.name_or_kind_tok; | |
| 2026 | }, | |
| 2027 | .struct_forward_decl => |decl| { | |
| 2028 | repr.tag = .struct_forward_decl; | |
| 2029 | repr.data[0] = @bitCast(decl.container_qt); | |
| 2030 | // TODO decide how to handle definition | |
| 2031 | // repr.data[1] = decl.definition; | |
| 2032 | repr.tok = decl.name_or_kind_tok; | |
| 2033 | }, | |
| 2034 | .union_forward_decl => |decl| { | |
| 2035 | repr.tag = .union_forward_decl; | |
| 2036 | repr.data[0] = @bitCast(decl.container_qt); | |
| 2037 | // TODO decide how to handle definition | |
| 2038 | // repr.data[1] = decl.definition; | |
| 2039 | repr.tok = decl.name_or_kind_tok; | |
| 2040 | }, | |
| 2041 | .enum_forward_decl => |decl| { | |
| 2042 | repr.tag = .enum_forward_decl; | |
| 2043 | repr.data[0] = @bitCast(decl.container_qt); | |
| 2044 | // TODO decide how to handle definition | |
| 2045 | // repr.data[1] = decl.definition; | |
| 2046 | repr.tok = decl.name_or_kind_tok; | |
| 2047 | }, | |
| 2048 | .enum_field => |field| { | |
| 2049 | repr.tag = .enum_field; | |
| 2050 | repr.data[0] = @bitCast(field.qt); | |
| 2051 | repr.data[1] = packOptIndex(field.init); | |
| 2052 | repr.tok = field.name_tok; | |
| 2053 | }, | |
| 2054 | .record_field => |field| { | |
| 2055 | repr.tag = .record_field; | |
| 2056 | repr.data[0] = @bitCast(field.qt); | |
| 2057 | repr.data[1] = packOptIndex(field.bit_width); | |
| 2058 | repr.tok = field.name_or_first_tok; | |
| 2059 | }, | |
| 2060 | .labeled_stmt => |labeled| { | |
| 2061 | repr.tag = .labeled_stmt; | |
| 2062 | repr.data[0] = @bitCast(labeled.qt); | |
| 2063 | repr.data[1] = @intFromEnum(labeled.body); | |
| 2064 | repr.tok = labeled.label_tok; | |
| 2065 | }, | |
| 2066 | .compound_stmt => |compound| { | |
| 2067 | if (compound.body.len > 3) { | |
| 2068 | repr.tag = .compound_stmt; | |
| 2069 | repr.data[0], repr.data[1] = try tree.addExtra(compound.body); | |
| 2070 | } else { | |
| 2071 | repr.tag = .compound_stmt_three; | |
| 2072 | for (&repr.data, 0..) |*data, idx| | |
| 2073 | data.* = packElem(compound.body, idx); | |
| 2074 | } | |
| 2075 | repr.tok = compound.l_brace_tok; | |
| 2076 | }, | |
| 2077 | .if_stmt => |@"if"| { | |
| 2078 | repr.tag = .if_stmt; | |
| 2079 | repr.data[0] = @intFromEnum(@"if".cond); | |
| 2080 | repr.data[1] = @intFromEnum(@"if".then_body); | |
| 2081 | repr.data[2] = packOptIndex(@"if".else_body); | |
| 2082 | repr.tok = @"if".if_tok; | |
| 2083 | }, | |
| 2084 | .switch_stmt => |@"switch"| { | |
| 2085 | repr.tag = .switch_stmt; | |
| 2086 | repr.data[0] = @intFromEnum(@"switch".cond); | |
| 2087 | repr.data[1] = @intFromEnum(@"switch".body); | |
| 2088 | repr.tok = @"switch".switch_tok; | |
| 2089 | }, | |
| 2090 | .case_stmt => |case| { | |
| 2091 | repr.tag = .case_stmt; | |
| 2092 | repr.data[0] = @intFromEnum(case.start); | |
| 2093 | repr.data[1] = packOptIndex(case.end); | |
| 2094 | repr.data[2] = packOptIndex(case.body); | |
| 2095 | repr.tok = case.case_tok; | |
| 2096 | }, | |
| 2097 | .default_stmt => |default| { | |
| 2098 | repr.tag = .default_stmt; | |
| 2099 | repr.data[0] = @intFromEnum(default.body); | |
| 2100 | repr.tok = default.default_tok; | |
| 2101 | }, | |
| 2102 | .while_stmt => |@"while"| { | |
| 2103 | repr.tag = .while_stmt; | |
| 2104 | repr.data[0] = @intFromEnum(@"while".cond); | |
| 2105 | repr.data[1] = @intFromEnum(@"while".body); | |
| 2106 | repr.tok = @"while".while_tok; | |
| 2107 | }, | |
| 2108 | .do_while_stmt => |do_while| { | |
| 2109 | repr.tag = .do_while_stmt; | |
| 2110 | repr.data[0] = @intFromEnum(do_while.cond); | |
| 2111 | repr.data[1] = @intFromEnum(do_while.body); | |
| 2112 | repr.tok = do_while.do_tok; | |
| 2113 | }, | |
| 2114 | .for_stmt => |@"for"| { | |
| 2115 | switch (@"for".init) { | |
| 2116 | .decls => |decls| { | |
| 2117 | repr.tag = .for_decl; | |
| 2118 | repr.data[0] = @intCast(tree.extra.items.len); | |
| 2119 | const len: u32 = @intCast(decls.len + 2); | |
| 2120 | try tree.extra.ensureUnusedCapacity(tree.comp.gpa, len); | |
| 2121 | repr.data[1] = len; | |
| 2122 | tree.extra.appendSliceAssumeCapacity(@ptrCast(decls)); | |
| 2123 | tree.extra.appendAssumeCapacity(packOptIndex(@"for".cond)); | |
| 2124 | tree.extra.appendAssumeCapacity(packOptIndex(@"for".incr)); | |
| 2125 | }, | |
| 2126 | .expr => |expr| { | |
| 2127 | repr.tag = .for_expr; | |
| 2128 | repr.data[0] = packOptIndex(expr); | |
| 2129 | repr.data[1] = @intCast(tree.extra.items.len); | |
| 2130 | try tree.extra.ensureUnusedCapacity(tree.comp.gpa, 2); | |
| 2131 | tree.extra.appendAssumeCapacity(packOptIndex(@"for".cond)); | |
| 2132 | tree.extra.appendAssumeCapacity(packOptIndex(@"for".incr)); | |
| 2133 | }, | |
| 2134 | } | |
| 2135 | repr.data[2] = @intFromEnum(@"for".body); | |
| 2136 | repr.tok = @"for".for_tok; | |
| 2137 | }, | |
| 2138 | .goto_stmt => |goto| { | |
| 2139 | repr.tag = .goto_stmt; | |
| 2140 | repr.tok = goto.label_tok; | |
| 2141 | }, | |
| 2142 | .computed_goto_stmt => |computed_goto| { | |
| 2143 | repr.tag = .computed_goto_stmt; | |
| 2144 | repr.data[0] = @intFromEnum(computed_goto.expr); | |
| 2145 | repr.tok = computed_goto.goto_tok; | |
| 2146 | }, | |
| 2147 | .continue_stmt => |@"continue"| { | |
| 2148 | repr.tag = .continue_stmt; | |
| 2149 | repr.tok = @"continue".continue_tok; | |
| 2150 | }, | |
| 2151 | .break_stmt => |@"break"| { | |
| 2152 | repr.tag = .break_stmt; | |
| 2153 | repr.tok = @"break".break_tok; | |
| 2154 | }, | |
| 2155 | .null_stmt => |@"null"| { | |
| 2156 | repr.tag = .null_stmt; | |
| 2157 | repr.data[0] = @bitCast(@"null".qt); | |
| 2158 | repr.tok = @"null".semicolon_or_r_brace_tok; | |
| 2159 | }, | |
| 2160 | .return_stmt => |@"return"| { | |
| 2161 | repr.data[0] = @bitCast(@"return".return_qt); | |
| 2162 | switch (@"return".operand) { | |
| 2163 | .expr => |expr| { | |
| 2164 | repr.tag = .return_stmt; | |
| 2165 | repr.data[1] = @intFromEnum(expr); | |
| 2166 | }, | |
| 2167 | .none => { | |
| 2168 | repr.tag = .return_none_stmt; | |
| 2169 | }, | |
| 2170 | .implicit => |zeroes| { | |
| 2171 | repr.tag = .implicit_return; | |
| 2172 | repr.data[1] = @intFromBool(zeroes); | |
| 2173 | }, | |
| 2174 | } | |
| 2175 | repr.tok = @"return".return_tok; | |
| 2176 | }, | |
| 2177 | .gnu_asm_simple => |gnu_asm_simple| { | |
| 2178 | repr.tag = .gnu_asm_simple; | |
| 2179 | repr.data[0] = @intFromEnum(gnu_asm_simple.asm_str); | |
| 2180 | repr.tok = gnu_asm_simple.asm_tok; | |
| 2181 | }, | |
| 2182 | .assign_expr => |bin| { | |
| 2183 | repr.tag = .assign_expr; | |
| 2184 | repr.data[0] = @bitCast(bin.qt); | |
| 2185 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2186 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2187 | repr.tok = bin.op_tok; | |
| 2188 | }, | |
| 2189 | .mul_assign_expr => |bin| { | |
| 2190 | repr.tag = .mul_assign_expr; | |
| 2191 | repr.data[0] = @bitCast(bin.qt); | |
| 2192 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2193 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2194 | repr.tok = bin.op_tok; | |
| 2195 | }, | |
| 2196 | .div_assign_expr => |bin| { | |
| 2197 | repr.tag = .div_assign_expr; | |
| 2198 | repr.data[0] = @bitCast(bin.qt); | |
| 2199 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2200 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2201 | repr.tok = bin.op_tok; | |
| 2202 | }, | |
| 2203 | .mod_assign_expr => |bin| { | |
| 2204 | repr.tag = .mod_assign_expr; | |
| 2205 | repr.data[0] = @bitCast(bin.qt); | |
| 2206 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2207 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2208 | repr.tok = bin.op_tok; | |
| 2209 | }, | |
| 2210 | .add_assign_expr => |bin| { | |
| 2211 | repr.tag = .add_assign_expr; | |
| 2212 | repr.data[0] = @bitCast(bin.qt); | |
| 2213 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2214 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2215 | repr.tok = bin.op_tok; | |
| 2216 | }, | |
| 2217 | .sub_assign_expr => |bin| { | |
| 2218 | repr.tag = .sub_assign_expr; | |
| 2219 | repr.data[0] = @bitCast(bin.qt); | |
| 2220 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2221 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2222 | repr.tok = bin.op_tok; | |
| 2223 | }, | |
| 2224 | .shl_assign_expr => |bin| { | |
| 2225 | repr.tag = .shl_assign_expr; | |
| 2226 | repr.data[0] = @bitCast(bin.qt); | |
| 2227 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2228 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2229 | repr.tok = bin.op_tok; | |
| 2230 | }, | |
| 2231 | .shr_assign_expr => |bin| { | |
| 2232 | repr.tag = .shr_assign_expr; | |
| 2233 | repr.data[0] = @bitCast(bin.qt); | |
| 2234 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2235 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2236 | repr.tok = bin.op_tok; | |
| 2237 | }, | |
| 2238 | .bit_and_assign_expr => |bin| { | |
| 2239 | repr.tag = .bit_and_assign_expr; | |
| 2240 | repr.data[0] = @bitCast(bin.qt); | |
| 2241 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2242 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2243 | repr.tok = bin.op_tok; | |
| 2244 | }, | |
| 2245 | .bit_xor_assign_expr => |bin| { | |
| 2246 | repr.tag = .bit_xor_assign_expr; | |
| 2247 | repr.data[0] = @bitCast(bin.qt); | |
| 2248 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2249 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2250 | repr.tok = bin.op_tok; | |
| 2251 | }, | |
| 2252 | .bit_or_assign_expr => |bin| { | |
| 2253 | repr.tag = .bit_or_assign_expr; | |
| 2254 | repr.data[0] = @bitCast(bin.qt); | |
| 2255 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2256 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2257 | repr.tok = bin.op_tok; | |
| 2258 | }, | |
| 2259 | .compound_assign_dummy_expr => |un| { | |
| 2260 | repr.tag = .compound_assign_dummy_expr; | |
| 2261 | repr.data[0] = @bitCast(un.qt); | |
| 2262 | repr.data[1] = @intFromEnum(un.operand); | |
| 2263 | repr.tok = un.op_tok; | |
| 2264 | }, | |
| 2265 | .comma_expr => |bin| { | |
| 2266 | repr.tag = .comma_expr; | |
| 2267 | repr.data[0] = @bitCast(bin.qt); | |
| 2268 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2269 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2270 | repr.tok = bin.op_tok; | |
| 2271 | }, | |
| 2272 | .bool_or_expr => |bin| { | |
| 2273 | repr.tag = .bool_or_expr; | |
| 2274 | repr.data[0] = @bitCast(bin.qt); | |
| 2275 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2276 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2277 | repr.tok = bin.op_tok; | |
| 2278 | }, | |
| 2279 | .bool_and_expr => |bin| { | |
| 2280 | repr.tag = .bool_and_expr; | |
| 2281 | repr.data[0] = @bitCast(bin.qt); | |
| 2282 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2283 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2284 | repr.tok = bin.op_tok; | |
| 2285 | }, | |
| 2286 | .bit_or_expr => |bin| { | |
| 2287 | repr.tag = .bit_or_expr; | |
| 2288 | repr.data[0] = @bitCast(bin.qt); | |
| 2289 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2290 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2291 | repr.tok = bin.op_tok; | |
| 2292 | }, | |
| 2293 | .bit_xor_expr => |bin| { | |
| 2294 | repr.tag = .bit_xor_expr; | |
| 2295 | repr.data[0] = @bitCast(bin.qt); | |
| 2296 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2297 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2298 | repr.tok = bin.op_tok; | |
| 2299 | }, | |
| 2300 | .bit_and_expr => |bin| { | |
| 2301 | repr.tag = .bit_and_expr; | |
| 2302 | repr.data[0] = @bitCast(bin.qt); | |
| 2303 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2304 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2305 | repr.tok = bin.op_tok; | |
| 2306 | }, | |
| 2307 | .equal_expr => |bin| { | |
| 2308 | repr.tag = .equal_expr; | |
| 2309 | repr.data[0] = @bitCast(bin.qt); | |
| 2310 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2311 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2312 | repr.tok = bin.op_tok; | |
| 2313 | }, | |
| 2314 | .not_equal_expr => |bin| { | |
| 2315 | repr.tag = .not_equal_expr; | |
| 2316 | repr.data[0] = @bitCast(bin.qt); | |
| 2317 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2318 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2319 | repr.tok = bin.op_tok; | |
| 2320 | }, | |
| 2321 | .less_than_expr => |bin| { | |
| 2322 | repr.tag = .less_than_expr; | |
| 2323 | repr.data[0] = @bitCast(bin.qt); | |
| 2324 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2325 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2326 | repr.tok = bin.op_tok; | |
| 2327 | }, | |
| 2328 | .less_than_equal_expr => |bin| { | |
| 2329 | repr.tag = .less_than_equal_expr; | |
| 2330 | repr.data[0] = @bitCast(bin.qt); | |
| 2331 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2332 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2333 | repr.tok = bin.op_tok; | |
| 2334 | }, | |
| 2335 | .greater_than_expr => |bin| { | |
| 2336 | repr.tag = .greater_than_expr; | |
| 2337 | repr.data[0] = @bitCast(bin.qt); | |
| 2338 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2339 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2340 | repr.tok = bin.op_tok; | |
| 2341 | }, | |
| 2342 | .greater_than_equal_expr => |bin| { | |
| 2343 | repr.tag = .greater_than_equal_expr; | |
| 2344 | repr.data[0] = @bitCast(bin.qt); | |
| 2345 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2346 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2347 | repr.tok = bin.op_tok; | |
| 2348 | }, | |
| 2349 | .shl_expr => |bin| { | |
| 2350 | repr.tag = .shl_expr; | |
| 2351 | repr.data[0] = @bitCast(bin.qt); | |
| 2352 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2353 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2354 | repr.tok = bin.op_tok; | |
| 2355 | }, | |
| 2356 | .shr_expr => |bin| { | |
| 2357 | repr.tag = .shr_expr; | |
| 2358 | repr.data[0] = @bitCast(bin.qt); | |
| 2359 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2360 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2361 | repr.tok = bin.op_tok; | |
| 2362 | }, | |
| 2363 | .add_expr => |bin| { | |
| 2364 | repr.tag = .add_expr; | |
| 2365 | repr.data[0] = @bitCast(bin.qt); | |
| 2366 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2367 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2368 | repr.tok = bin.op_tok; | |
| 2369 | }, | |
| 2370 | .sub_expr => |bin| { | |
| 2371 | repr.tag = .sub_expr; | |
| 2372 | repr.data[0] = @bitCast(bin.qt); | |
| 2373 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2374 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2375 | repr.tok = bin.op_tok; | |
| 2376 | }, | |
| 2377 | .mul_expr => |bin| { | |
| 2378 | repr.tag = .mul_expr; | |
| 2379 | repr.data[0] = @bitCast(bin.qt); | |
| 2380 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2381 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2382 | repr.tok = bin.op_tok; | |
| 2383 | }, | |
| 2384 | .div_expr => |bin| { | |
| 2385 | repr.tag = .div_expr; | |
| 2386 | repr.data[0] = @bitCast(bin.qt); | |
| 2387 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2388 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2389 | repr.tok = bin.op_tok; | |
| 2390 | }, | |
| 2391 | .mod_expr => |bin| { | |
| 2392 | repr.tag = .mod_expr; | |
| 2393 | repr.data[0] = @bitCast(bin.qt); | |
| 2394 | repr.data[1] = @intFromEnum(bin.lhs); | |
| 2395 | repr.data[2] = @intFromEnum(bin.rhs); | |
| 2396 | repr.tok = bin.op_tok; | |
| 2397 | }, | |
| 2398 | .cast => |cast| { | |
| 2399 | repr.tag = if (cast.implicit) .implicit_cast else .explicit_cast; | |
| 2400 | repr.data[0] = @bitCast(cast.qt); | |
| 2401 | repr.data[1] = @intFromEnum(cast.kind); | |
| 2402 | repr.data[2] = @intFromEnum(cast.operand); | |
| 2403 | repr.tok = cast.l_paren; | |
| 2404 | }, | |
| 2405 | .addr_of_expr => |un| { | |
| 2406 | repr.tag = .addr_of_expr; | |
| 2407 | repr.data[0] = @bitCast(un.qt); | |
| 2408 | repr.data[1] = @intFromEnum(un.operand); | |
| 2409 | repr.tok = un.op_tok; | |
| 2410 | }, | |
| 2411 | .deref_expr => |un| { | |
| 2412 | repr.tag = .deref_expr; | |
| 2413 | repr.data[0] = @bitCast(un.qt); | |
| 2414 | repr.data[1] = @intFromEnum(un.operand); | |
| 2415 | repr.tok = un.op_tok; | |
| 2416 | }, | |
| 2417 | .plus_expr => |un| { | |
| 2418 | repr.tag = .plus_expr; | |
| 2419 | repr.data[0] = @bitCast(un.qt); | |
| 2420 | repr.data[1] = @intFromEnum(un.operand); | |
| 2421 | repr.tok = un.op_tok; | |
| 2422 | }, | |
| 2423 | .negate_expr => |un| { | |
| 2424 | repr.tag = .negate_expr; | |
| 2425 | repr.data[0] = @bitCast(un.qt); | |
| 2426 | repr.data[1] = @intFromEnum(un.operand); | |
| 2427 | repr.tok = un.op_tok; | |
| 2428 | }, | |
| 2429 | .bit_not_expr => |un| { | |
| 2430 | repr.tag = .bit_not_expr; | |
| 2431 | repr.data[0] = @bitCast(un.qt); | |
| 2432 | repr.data[1] = @intFromEnum(un.operand); | |
| 2433 | repr.tok = un.op_tok; | |
| 2434 | }, | |
| 2435 | .bool_not_expr => |un| { | |
| 2436 | repr.tag = .bool_not_expr; | |
| 2437 | repr.data[0] = @bitCast(un.qt); | |
| 2438 | repr.data[1] = @intFromEnum(un.operand); | |
| 2439 | repr.tok = un.op_tok; | |
| 2440 | }, | |
| 2441 | .pre_inc_expr => |un| { | |
| 2442 | repr.tag = .pre_inc_expr; | |
| 2443 | repr.data[0] = @bitCast(un.qt); | |
| 2444 | repr.data[1] = @intFromEnum(un.operand); | |
| 2445 | repr.tok = un.op_tok; | |
| 2446 | }, | |
| 2447 | .pre_dec_expr => |un| { | |
| 2448 | repr.tag = .pre_dec_expr; | |
| 2449 | repr.data[0] = @bitCast(un.qt); | |
| 2450 | repr.data[1] = @intFromEnum(un.operand); | |
| 2451 | repr.tok = un.op_tok; | |
| 2452 | }, | |
| 2453 | .imag_expr => |un| { | |
| 2454 | repr.tag = .imag_expr; | |
| 2455 | repr.data[0] = @bitCast(un.qt); | |
| 2456 | repr.data[1] = @intFromEnum(un.operand); | |
| 2457 | repr.tok = un.op_tok; | |
| 2458 | }, | |
| 2459 | .real_expr => |un| { | |
| 2460 | repr.tag = .real_expr; | |
| 2461 | repr.data[0] = @bitCast(un.qt); | |
| 2462 | repr.data[1] = @intFromEnum(un.operand); | |
| 2463 | repr.tok = un.op_tok; | |
| 2464 | }, | |
| 2465 | .post_inc_expr => |un| { | |
| 2466 | repr.tag = .post_inc_expr; | |
| 2467 | repr.data[0] = @bitCast(un.qt); | |
| 2468 | repr.data[1] = @intFromEnum(un.operand); | |
| 2469 | repr.tok = un.op_tok; | |
| 2470 | }, | |
| 2471 | .post_dec_expr => |un| { | |
| 2472 | repr.tag = .post_dec_expr; | |
| 2473 | repr.data[0] = @bitCast(un.qt); | |
| 2474 | repr.data[1] = @intFromEnum(un.operand); | |
| 2475 | repr.tok = un.op_tok; | |
| 2476 | }, | |
| 2477 | .paren_expr => |un| { | |
| 2478 | repr.tag = .paren_expr; | |
| 2479 | repr.data[0] = @bitCast(un.qt); | |
| 2480 | repr.data[1] = @intFromEnum(un.operand); | |
| 2481 | repr.tok = un.op_tok; | |
| 2482 | }, | |
| 2483 | .stmt_expr => |un| { | |
| 2484 | repr.tag = .stmt_expr; | |
| 2485 | repr.data[0] = @bitCast(un.qt); | |
| 2486 | repr.data[1] = @intFromEnum(un.operand); | |
| 2487 | repr.tok = un.op_tok; | |
| 2488 | }, | |
| 2489 | .cond_dummy_expr => |un| { | |
| 2490 | repr.tag = .cond_dummy_expr; | |
| 2491 | repr.data[0] = @bitCast(un.qt); | |
| 2492 | repr.data[1] = @intFromEnum(un.operand); | |
| 2493 | repr.tok = un.op_tok; | |
| 2494 | }, | |
| 2495 | .addr_of_label => |addr_of| { | |
| 2496 | repr.tag = .addr_of_label; | |
| 2497 | repr.data[0] = @bitCast(addr_of.qt); | |
| 2498 | repr.tok = addr_of.label_tok; | |
| 2499 | }, | |
| 2500 | .array_access_expr => |access| { | |
| 2501 | repr.tag = .array_access_expr; | |
| 2502 | repr.data[0] = @bitCast(access.qt); | |
| 2503 | repr.data[1] = @intFromEnum(access.base); | |
| 2504 | repr.data[2] = @intFromEnum(access.index); | |
| 2505 | repr.tok = access.l_bracket_tok; | |
| 2506 | }, | |
| 2507 | .call_expr => |call| { | |
| 2508 | repr.data[0] = @bitCast(call.qt); | |
| 2509 | if (call.args.len > 1) { | |
| 2510 | repr.tag = .call_expr; | |
| 2511 | repr.data[1] = @intCast(tree.extra.items.len); | |
| 2512 | const len: u32 = @intCast(call.args.len + 1); | |
| 2513 | repr.data[2] = len; | |
| 2514 | try tree.extra.ensureUnusedCapacity(tree.comp.gpa, len); | |
| 2515 | tree.extra.appendAssumeCapacity(@intFromEnum(call.callee)); | |
| 2516 | tree.extra.appendSliceAssumeCapacity(@ptrCast(call.args)); | |
| 2517 | } else { | |
| 2518 | repr.tag = .call_expr_one; | |
| 2519 | repr.data[1] = @intFromEnum(call.callee); | |
| 2520 | repr.data[2] = packElem(call.args, 0); | |
| 2521 | } | |
| 2522 | repr.tok = call.l_paren_tok; | |
| 2523 | }, | |
| 2524 | .builtin_call_expr => |call| { | |
| 2525 | repr.data[0] = @bitCast(call.qt); | |
| 2526 | if (call.args.len > 2) { | |
| 2527 | repr.tag = .builtin_call_expr; | |
| 2528 | repr.data[1], repr.data[2] = try tree.addExtra(call.args); | |
| 2529 | } else { | |
| 2530 | repr.tag = .builtin_call_expr_two; | |
| 2531 | repr.data[1] = packElem(call.args, 0); | |
| 2532 | repr.data[2] = packElem(call.args, 1); | |
| 2533 | } | |
| 2534 | repr.tok = call.builtin_tok; | |
| 2535 | }, | |
| 2536 | .member_access_expr => |access| { | |
| 2537 | repr.tag = .member_access_expr; | |
| 2538 | repr.data[0] = @bitCast(access.qt); | |
| 2539 | repr.data[1] = @intFromEnum(access.base); | |
| 2540 | repr.data[2] = access.member_index; | |
| 2541 | repr.tok = access.access_tok; | |
| 2542 | }, | |
| 2543 | .member_access_ptr_expr => |access| { | |
| 2544 | repr.tag = .member_access_ptr_expr; | |
| 2545 | repr.data[0] = @bitCast(access.qt); | |
| 2546 | repr.data[1] = @intFromEnum(access.base); | |
| 2547 | repr.data[2] = access.member_index; | |
| 2548 | repr.tok = access.access_tok; | |
| 2549 | }, | |
| 2550 | .decl_ref_expr => |decl_ref| { | |
| 2551 | repr.tag = .decl_ref_expr; | |
| 2552 | repr.data[0] = @bitCast(decl_ref.qt); | |
| 2553 | repr.data[1] = @intFromEnum(decl_ref.decl); | |
| 2554 | repr.tok = decl_ref.name_tok; | |
| 2555 | }, | |
| 2556 | .enumeration_ref => |enumeration_ref| { | |
| 2557 | repr.tag = .enumeration_ref; | |
| 2558 | repr.data[0] = @bitCast(enumeration_ref.qt); | |
| 2559 | repr.data[1] = @intFromEnum(enumeration_ref.decl); | |
| 2560 | repr.tok = enumeration_ref.name_tok; | |
| 2561 | }, | |
| 2562 | .builtin_ref => |builtin_ref| { | |
| 2563 | repr.tag = .builtin_ref; | |
| 2564 | repr.data[0] = @bitCast(builtin_ref.qt); | |
| 2565 | repr.tok = builtin_ref.name_tok; | |
| 2566 | }, | |
| 2567 | .bool_literal => |literal| { | |
| 2568 | repr.tag = .bool_literal; | |
| 2569 | repr.data[0] = @bitCast(literal.qt); | |
| 2570 | repr.tok = literal.literal_tok; | |
| 2571 | }, | |
| 2572 | .nullptr_literal => |literal| { | |
| 2573 | repr.tag = .nullptr_literal; | |
| 2574 | repr.data[0] = @bitCast(literal.qt); | |
| 2575 | repr.tok = literal.literal_tok; | |
| 2576 | }, | |
| 2577 | .int_literal => |literal| { | |
| 2578 | repr.tag = .int_literal; | |
| 2579 | repr.data[0] = @bitCast(literal.qt); | |
| 2580 | repr.tok = literal.literal_tok; | |
| 2581 | }, | |
| 2582 | .char_literal => |literal| { | |
| 2583 | repr.tag = .char_literal; | |
| 2584 | repr.data[0] = @bitCast(literal.qt); | |
| 2585 | repr.data[1] = @intFromEnum(literal.kind); | |
| 2586 | repr.tok = literal.literal_tok; | |
| 2587 | }, | |
| 2588 | .float_literal => |literal| { | |
| 2589 | repr.tag = .float_literal; | |
| 2590 | repr.data[0] = @bitCast(literal.qt); | |
| 2591 | repr.tok = literal.literal_tok; | |
| 2592 | }, | |
| 2593 | .string_literal_expr => |literal| { | |
| 2594 | repr.tag = .string_literal_expr; | |
| 2595 | repr.data[0] = @bitCast(literal.qt); | |
| 2596 | repr.data[1] = @intFromEnum(literal.kind); | |
| 2597 | repr.tok = literal.literal_tok; | |
| 2598 | }, | |
| 2599 | .imaginary_literal => |un| { | |
| 2600 | repr.tag = .imaginary_literal; | |
| 2601 | repr.data[0] = @bitCast(un.qt); | |
| 2602 | repr.data[1] = @intFromEnum(un.operand); | |
| 2603 | repr.tok = un.op_tok; | |
| 2604 | }, | |
| 2605 | .sizeof_expr => |type_info| { | |
| 2606 | repr.tag = .sizeof_expr; | |
| 2607 | repr.data[0] = @bitCast(type_info.qt); | |
| 2608 | repr.data[1] = packOptIndex(type_info.expr); | |
| 2609 | repr.data[2] = @bitCast(type_info.operand_qt); | |
| 2610 | repr.tok = type_info.op_tok; | |
| 2611 | }, | |
| 2612 | .alignof_expr => |type_info| { | |
| 2613 | repr.tag = .alignof_expr; | |
| 2614 | repr.data[0] = @bitCast(type_info.qt); | |
| 2615 | repr.data[1] = packOptIndex(type_info.expr); | |
| 2616 | repr.data[2] = @bitCast(type_info.operand_qt); | |
| 2617 | repr.tok = type_info.op_tok; | |
| 2618 | }, | |
| 2619 | .generic_expr => |generic| { | |
| 2620 | repr.data[0] = @bitCast(generic.qt); | |
| 2621 | if (generic.rest.len > 0) { | |
| 2622 | repr.tag = .generic_expr; | |
| 2623 | repr.data[1] = @intCast(tree.extra.items.len); | |
| 2624 | const len: u32 = @intCast(generic.rest.len + 2); | |
| 2625 | repr.data[2] = len; | |
| 2626 | try tree.extra.ensureUnusedCapacity(tree.comp.gpa, len); | |
| 2627 | tree.extra.appendAssumeCapacity(@intFromEnum(generic.controlling)); | |
| 2628 | tree.extra.appendAssumeCapacity(@intFromEnum(generic.chosen)); | |
| 2629 | tree.extra.appendSliceAssumeCapacity(@ptrCast(generic.rest)); | |
| 2630 | } else { | |
| 2631 | repr.tag = .generic_expr_zero; | |
| 2632 | repr.data[1] = @intFromEnum(generic.controlling); | |
| 2633 | repr.data[2] = @intFromEnum(generic.chosen); | |
| 2634 | } | |
| 2635 | repr.tok = generic.generic_tok; | |
| 2636 | }, | |
| 2637 | .generic_association_expr => |association| { | |
| 2638 | repr.tag = .generic_association_expr; | |
| 2639 | repr.data[0] = @bitCast(association.association_qt); | |
| 2640 | repr.data[1] = @intFromEnum(association.expr); | |
| 2641 | repr.tok = association.colon_tok; | |
| 2642 | }, | |
| 2643 | .generic_default_expr => |default| { | |
| 2644 | repr.tag = .generic_default_expr; | |
| 2645 | repr.data[0] = @intFromEnum(default.expr); | |
| 2646 | repr.tok = default.default_tok; | |
| 2647 | }, | |
| 2648 | .binary_cond_expr => |cond| { | |
| 2649 | repr.tag = .binary_cond_expr; | |
| 2650 | repr.data[0] = @bitCast(cond.qt); | |
| 2651 | repr.data[1] = @intFromEnum(cond.cond); | |
| 2652 | repr.data[2], _ = try tree.addExtra(&.{ cond.then_expr, cond.else_expr }); | |
| 2653 | repr.tok = cond.cond_tok; | |
| 2654 | }, | |
| 2655 | .cond_expr => |cond| { | |
| 2656 | repr.tag = .cond_expr; | |
| 2657 | repr.data[0] = @bitCast(cond.qt); | |
| 2658 | repr.data[1] = @intFromEnum(cond.cond); | |
| 2659 | repr.data[2], _ = try tree.addExtra(&.{ cond.then_expr, cond.else_expr }); | |
| 2660 | repr.tok = cond.cond_tok; | |
| 2661 | }, | |
| 2662 | .builtin_choose_expr => |cond| { | |
| 2663 | repr.tag = .builtin_choose_expr; | |
| 2664 | repr.data[0] = @bitCast(cond.qt); | |
| 2665 | repr.data[1] = @intFromEnum(cond.cond); | |
| 2666 | repr.data[2], _ = try tree.addExtra(&.{ cond.then_expr, cond.else_expr }); | |
| 2667 | repr.tok = cond.cond_tok; | |
| 2668 | }, | |
| 2669 | .builtin_types_compatible_p => |builtin| { | |
| 2670 | repr.tag = .builtin_types_compatible_p; | |
| 2671 | repr.data[0] = @bitCast(builtin.lhs); | |
| 2672 | repr.data[1] = @bitCast(builtin.rhs); | |
| 2673 | repr.tok = builtin.builtin_tok; | |
| 2674 | }, | |
| 2675 | .builtin_convertvector => |builtin| { | |
| 2676 | repr.tag = .builtin_convertvector; | |
| 2677 | repr.data[0] = @bitCast(builtin.dest_qt); | |
| 2678 | repr.data[1] = @intFromEnum(builtin.operand); | |
| 2679 | repr.tok = builtin.builtin_tok; | |
| 2680 | }, | |
| 2681 | .builtin_shufflevector => |builtin| { | |
| 2682 | repr.tag = .builtin_shufflevector; | |
| 2683 | repr.data[0] = @bitCast(builtin.qt); | |
| 2684 | repr.data[1] = @intCast(tree.extra.items.len); | |
| 2685 | repr.data[2] = @intCast(builtin.indexes.len); | |
| 2686 | repr.tok = builtin.builtin_tok; | |
| 2687 | try tree.extra.ensureUnusedCapacity(tree.comp.gpa, builtin.indexes.len + 2); | |
| 2688 | tree.extra.appendAssumeCapacity(@intFromEnum(builtin.lhs)); | |
| 2689 | tree.extra.appendAssumeCapacity(@intFromEnum(builtin.rhs)); | |
| 2690 | tree.extra.appendSliceAssumeCapacity(@ptrCast(builtin.indexes)); | |
| 2691 | }, | |
| 2692 | .array_init_expr => |init| { | |
| 2693 | repr.data[0] = @bitCast(init.container_qt); | |
| 2694 | if (init.items.len > 2) { | |
| 2695 | repr.tag = .array_init_expr; | |
| 2696 | repr.data[1], repr.data[2] = try tree.addExtra(init.items); | |
| 2697 | } else { | |
| 2698 | repr.tag = .array_init_expr_two; | |
| 2699 | repr.data[1] = packElem(init.items, 0); | |
| 2700 | repr.data[2] = packElem(init.items, 1); | |
| 2701 | } | |
| 2702 | repr.tok = init.l_brace_tok; | |
| 2703 | }, | |
| 2704 | .struct_init_expr => |init| { | |
| 2705 | repr.data[0] = @bitCast(init.container_qt); | |
| 2706 | if (init.items.len > 2) { | |
| 2707 | repr.tag = .struct_init_expr; | |
| 2708 | repr.data[1], repr.data[2] = try tree.addExtra(init.items); | |
| 2709 | } else { | |
| 2710 | repr.tag = .struct_init_expr_two; | |
| 2711 | repr.data[1] = packElem(init.items, 0); | |
| 2712 | repr.data[2] = packElem(init.items, 1); | |
| 2713 | } | |
| 2714 | repr.tok = init.l_brace_tok; | |
| 2715 | }, | |
| 2716 | .union_init_expr => |init| { | |
| 2717 | repr.tag = .union_init_expr; | |
| 2718 | repr.data[0] = @bitCast(init.union_qt); | |
| 2719 | repr.data[1] = init.field_index; | |
| 2720 | repr.data[2] = packOptIndex(init.initializer); | |
| 2721 | repr.tok = init.l_brace_tok; | |
| 2722 | }, | |
| 2723 | .array_filler_expr => |filler| { | |
| 2724 | repr.tag = .array_filler_expr; | |
| 2725 | repr.data[0] = @bitCast(filler.qt); | |
| 2726 | repr.data[1], repr.data[2] = @as([2]u32, @bitCast(filler.count)); | |
| 2727 | repr.tok = filler.last_tok; | |
| 2728 | }, | |
| 2729 | .default_init_expr => |default| { | |
| 2730 | repr.tag = .default_init_expr; | |
| 2731 | repr.data[0] = @bitCast(default.qt); | |
| 2732 | repr.tok = default.last_tok; | |
| 2733 | }, | |
| 2734 | .compound_literal_expr => |literal| { | |
| 2735 | repr.tag = .compound_literal_expr; | |
| 2736 | repr.data[0] = @bitCast(literal.qt); | |
| 2737 | repr.data[1] = @bitCast(Node.Repr.DeclAttr{ | |
| 2738 | .static = literal.storage_class == .static, | |
| 2739 | .register = literal.storage_class == .register, | |
| 2740 | .thread_local = literal.thread_local, | |
| 2741 | }); | |
| 2742 | repr.data[2] = @intFromEnum(literal.initializer); | |
| 2743 | repr.tok = literal.l_paren_tok; | |
| 2744 | }, | |
| 102 | 2745 | } |
| 103 | }; | |
| 104 | ||
| 105 | pub const TokenIndex = u32; | |
| 106 | pub const NodeIndex = enum(u32) { none, _ }; | |
| 107 | pub const ValueMap = std.AutoHashMap(NodeIndex, Value); | |
| 108 | ||
| 109 | const Tree = @This(); | |
| 110 | ||
| 111 | comp: *Compilation, | |
| 112 | arena: std.heap.ArenaAllocator, | |
| 113 | generated: []const u8, | |
| 114 | tokens: Token.List.Slice, | |
| 115 | nodes: Node.List.Slice, | |
| 116 | data: []const NodeIndex, | |
| 117 | root_decls: []const NodeIndex, | |
| 118 | value_map: ValueMap, | |
| 119 | ||
| 120 | pub const genIr = CodeGen.genIr; | |
| 121 | ||
| 122 | pub fn deinit(tree: *Tree) void { | |
| 123 | tree.comp.gpa.free(tree.root_decls); | |
| 124 | tree.comp.gpa.free(tree.data); | |
| 125 | tree.nodes.deinit(tree.comp.gpa); | |
| 126 | tree.arena.deinit(); | |
| 127 | tree.value_map.deinit(); | |
| 2746 | tree.nodes.set(index, repr); | |
| 128 | 2747 | } |
| 129 | 2748 | |
| 130 | pub const GNUAssemblyQualifiers = struct { | |
| 131 | @"volatile": bool = false, | |
| 132 | @"inline": bool = false, | |
| 133 | goto: bool = false, | |
| 134 | }; | |
| 135 | ||
| 136 | pub const Node = struct { | |
| 137 | tag: Tag, | |
| 138 | ty: Type = .{ .specifier = .void }, | |
| 139 | data: Data, | |
| 140 | loc: Loc = .none, | |
| 141 | ||
| 142 | pub const Range = struct { start: u32, end: u32 }; | |
| 143 | ||
| 144 | pub const Loc = enum(u32) { | |
| 145 | none = std.math.maxInt(u32), | |
| 146 | _, | |
| 147 | }; | |
| 148 | ||
| 149 | pub const Data = union { | |
| 150 | decl: struct { | |
| 151 | name: TokenIndex, | |
| 152 | node: NodeIndex = .none, | |
| 153 | }, | |
| 154 | decl_ref: TokenIndex, | |
| 155 | two: [2]NodeIndex, | |
| 156 | range: Range, | |
| 157 | if3: struct { | |
| 158 | cond: NodeIndex, | |
| 159 | body: u32, | |
| 160 | }, | |
| 161 | un: NodeIndex, | |
| 162 | bin: struct { | |
| 163 | lhs: NodeIndex, | |
| 164 | rhs: NodeIndex, | |
| 165 | }, | |
| 166 | member: struct { | |
| 167 | lhs: NodeIndex, | |
| 168 | index: u32, | |
| 169 | }, | |
| 170 | union_init: struct { | |
| 171 | field_index: u32, | |
| 172 | node: NodeIndex, | |
| 173 | }, | |
| 174 | cast: struct { | |
| 175 | operand: NodeIndex, | |
| 176 | kind: CastKind, | |
| 177 | }, | |
| 178 | int: u64, | |
| 179 | return_zero: bool, | |
| 180 | ||
| 181 | pub fn forDecl(data: Data, tree: *const Tree) struct { | |
| 182 | decls: []const NodeIndex, | |
| 183 | cond: NodeIndex, | |
| 184 | incr: NodeIndex, | |
| 185 | body: NodeIndex, | |
| 186 | } { | |
| 187 | const items = tree.data[data.range.start..data.range.end]; | |
| 188 | const decls = items[0 .. items.len - 3]; | |
| 189 | ||
| 190 | return .{ | |
| 191 | .decls = decls, | |
| 192 | .cond = items[items.len - 3], | |
| 193 | .incr = items[items.len - 2], | |
| 194 | .body = items[items.len - 1], | |
| 195 | }; | |
| 196 | } | |
| 197 | ||
| 198 | pub fn forStmt(data: Data, tree: *const Tree) struct { | |
| 199 | init: NodeIndex, | |
| 200 | cond: NodeIndex, | |
| 201 | incr: NodeIndex, | |
| 202 | body: NodeIndex, | |
| 203 | } { | |
| 204 | const items = tree.data[data.if3.body..]; | |
| 205 | ||
| 206 | return .{ | |
| 207 | .init = items[0], | |
| 208 | .cond = items[1], | |
| 209 | .incr = items[2], | |
| 210 | .body = data.if3.cond, | |
| 211 | }; | |
| 212 | } | |
| 213 | }; | |
| 214 | ||
| 215 | pub const List = std.MultiArrayList(Node); | |
| 216 | }; | |
| 217 | ||
| 218 | pub const CastKind = enum(u8) { | |
| 219 | /// Does nothing except possibly add qualifiers | |
| 220 | no_op, | |
| 221 | /// Interpret one bit pattern as another. Used for operands which have the same | |
| 222 | /// size and unrelated types, e.g. casting one pointer type to another | |
| 223 | bitcast, | |
| 224 | /// Convert T[] to T * | |
| 225 | array_to_pointer, | |
| 226 | /// Converts an lvalue to an rvalue | |
| 227 | lval_to_rval, | |
| 228 | /// Convert a function type to a pointer to a function | |
| 229 | function_to_pointer, | |
| 230 | /// Convert a pointer type to a _Bool | |
| 231 | pointer_to_bool, | |
| 232 | /// Convert a pointer type to an integer type | |
| 233 | pointer_to_int, | |
| 234 | /// Convert _Bool to an integer type | |
| 235 | bool_to_int, | |
| 236 | /// Convert _Bool to a floating type | |
| 237 | bool_to_float, | |
| 238 | /// Convert a _Bool to a pointer; will cause a warning | |
| 239 | bool_to_pointer, | |
| 240 | /// Convert an integer type to _Bool | |
| 241 | int_to_bool, | |
| 242 | /// Convert an integer to a floating type | |
| 243 | int_to_float, | |
| 244 | /// Convert a complex integer to a complex floating type | |
| 245 | complex_int_to_complex_float, | |
| 246 | /// Convert an integer type to a pointer type | |
| 247 | int_to_pointer, | |
| 248 | /// Convert a floating type to a _Bool | |
| 249 | float_to_bool, | |
| 250 | /// Convert a floating type to an integer | |
| 251 | float_to_int, | |
| 252 | /// Convert a complex floating type to a complex integer | |
| 253 | complex_float_to_complex_int, | |
| 254 | /// Convert one integer type to another | |
| 255 | int_cast, | |
| 256 | /// Convert one complex integer type to another | |
| 257 | complex_int_cast, | |
| 258 | /// Convert real part of complex integer to a integer | |
| 259 | complex_int_to_real, | |
| 260 | /// Create a complex integer type using operand as the real part | |
| 261 | real_to_complex_int, | |
| 262 | /// Convert one floating type to another | |
| 263 | float_cast, | |
| 264 | /// Convert one complex floating type to another | |
| 265 | complex_float_cast, | |
| 266 | /// Convert real part of complex float to a float | |
| 267 | complex_float_to_real, | |
| 268 | /// Create a complex floating type using operand as the real part | |
| 269 | real_to_complex_float, | |
| 270 | /// Convert type to void | |
| 271 | to_void, | |
| 272 | /// Convert a literal 0 to a null pointer | |
| 273 | null_to_pointer, | |
| 274 | /// GNU cast-to-union extension | |
| 275 | union_cast, | |
| 276 | /// Create vector where each value is same as the input scalar. | |
| 277 | vector_splat, | |
| 278 | }; | |
| 2749 | fn packOptIndex(opt: ?Node.Index) u32 { | |
| 2750 | return @intFromEnum(Node.OptIndex.packOpt(opt)); | |
| 2751 | } | |
| 279 | 2752 | |
| 280 | pub const Tag = enum(u8) { | |
| 281 | /// Must appear at index 0. Also used as the tag for __builtin_types_compatible_p arguments, since the arguments are types | |
| 282 | /// Reaching it is always the result of a bug. | |
| 283 | invalid, | |
| 284 | ||
| 285 | // ====== Decl ====== | |
| 286 | ||
| 287 | /// _Static_assert | |
| 288 | /// loc is token index of _Static_assert | |
| 289 | static_assert, | |
| 290 | ||
| 291 | // function prototype | |
| 292 | fn_proto, | |
| 293 | static_fn_proto, | |
| 294 | inline_fn_proto, | |
| 295 | inline_static_fn_proto, | |
| 296 | ||
| 297 | // function definition | |
| 298 | fn_def, | |
| 299 | static_fn_def, | |
| 300 | inline_fn_def, | |
| 301 | inline_static_fn_def, | |
| 302 | ||
| 303 | // variable declaration | |
| 304 | @"var", | |
| 305 | extern_var, | |
| 306 | static_var, | |
| 307 | // same as static_var, used for __func__, __FUNCTION__ and __PRETTY_FUNCTION__ | |
| 308 | implicit_static_var, | |
| 309 | threadlocal_var, | |
| 310 | threadlocal_extern_var, | |
| 311 | threadlocal_static_var, | |
| 312 | ||
| 313 | /// __asm__("...") at file scope | |
| 314 | /// loc is token index of __asm__ keyword | |
| 315 | file_scope_asm, | |
| 316 | ||
| 317 | // typedef declaration | |
| 318 | typedef, | |
| 319 | ||
| 320 | // container declarations | |
| 321 | /// { two[0]; two[1]; } | |
| 322 | struct_decl_two, | |
| 323 | /// { two[0]; two[1]; } | |
| 324 | union_decl_two, | |
| 325 | /// { two[0], two[1], } | |
| 326 | enum_decl_two, | |
| 327 | /// { range } | |
| 328 | struct_decl, | |
| 329 | /// { range } | |
| 330 | union_decl, | |
| 331 | /// { range } | |
| 332 | enum_decl, | |
| 333 | /// struct decl_ref; | |
| 334 | struct_forward_decl, | |
| 335 | /// union decl_ref; | |
| 336 | union_forward_decl, | |
| 337 | /// enum decl_ref; | |
| 338 | enum_forward_decl, | |
| 339 | ||
| 340 | /// name = node | |
| 341 | enum_field_decl, | |
| 342 | /// ty name : node | |
| 343 | /// name == 0 means unnamed | |
| 344 | record_field_decl, | |
| 345 | /// Used when a record has an unnamed record as a field | |
| 346 | indirect_record_field_decl, | |
| 347 | ||
| 348 | // ====== Stmt ====== | |
| 349 | ||
| 350 | labeled_stmt, | |
| 351 | /// { two[0]; two[1]; } first and second may be null | |
| 352 | compound_stmt_two, | |
| 353 | /// { data } | |
| 354 | compound_stmt, | |
| 355 | /// if (first) data[second] else data[second+1]; | |
| 356 | if_then_else_stmt, | |
| 357 | /// if (first) second; second may be null | |
| 358 | if_then_stmt, | |
| 359 | /// switch (first) second | |
| 360 | switch_stmt, | |
| 361 | /// case first: second | |
| 362 | case_stmt, | |
| 363 | /// case data[body]...data[body+1]: cond | |
| 364 | case_range_stmt, | |
| 365 | /// default: first | |
| 366 | default_stmt, | |
| 367 | /// while (first) second | |
| 368 | while_stmt, | |
| 369 | /// do second while(first); | |
| 370 | do_while_stmt, | |
| 371 | /// for (data[..]; data[len-3]; data[len-2]) data[len-1] | |
| 372 | for_decl_stmt, | |
| 373 | /// for (;;;) first | |
| 374 | forever_stmt, | |
| 375 | /// for (data[first]; data[first+1]; data[first+2]) second | |
| 376 | for_stmt, | |
| 377 | /// goto first; | |
| 378 | goto_stmt, | |
| 379 | /// goto *un; | |
| 380 | computed_goto_stmt, | |
| 381 | // continue; first and second unused | |
| 382 | continue_stmt, | |
| 383 | // break; first and second unused | |
| 384 | break_stmt, | |
| 385 | // null statement (just a semicolon); first and second unused | |
| 386 | null_stmt, | |
| 387 | /// return first; first may be null | |
| 388 | return_stmt, | |
| 389 | /// Assembly statement of the form __asm__("string literal") | |
| 390 | gnu_asm_simple, | |
| 391 | ||
| 392 | // ====== Expr ====== | |
| 393 | ||
| 394 | /// lhs , rhs | |
| 395 | comma_expr, | |
| 396 | /// lhs ? data[0] : data[1] | |
| 397 | binary_cond_expr, | |
| 398 | /// Used as the base for casts of the lhs in `binary_cond_expr`. | |
| 399 | cond_dummy_expr, | |
| 400 | /// lhs ? data[0] : data[1] | |
| 401 | cond_expr, | |
| 402 | /// lhs = rhs | |
| 403 | assign_expr, | |
| 404 | /// lhs *= rhs | |
| 405 | mul_assign_expr, | |
| 406 | /// lhs /= rhs | |
| 407 | div_assign_expr, | |
| 408 | /// lhs %= rhs | |
| 409 | mod_assign_expr, | |
| 410 | /// lhs += rhs | |
| 411 | add_assign_expr, | |
| 412 | /// lhs -= rhs | |
| 413 | sub_assign_expr, | |
| 414 | /// lhs <<= rhs | |
| 415 | shl_assign_expr, | |
| 416 | /// lhs >>= rhs | |
| 417 | shr_assign_expr, | |
| 418 | /// lhs &= rhs | |
| 419 | bit_and_assign_expr, | |
| 420 | /// lhs ^= rhs | |
| 421 | bit_xor_assign_expr, | |
| 422 | /// lhs |= rhs | |
| 423 | bit_or_assign_expr, | |
| 424 | /// lhs || rhs | |
| 425 | bool_or_expr, | |
| 426 | /// lhs && rhs | |
| 427 | bool_and_expr, | |
| 428 | /// lhs | rhs | |
| 429 | bit_or_expr, | |
| 430 | /// lhs ^ rhs | |
| 431 | bit_xor_expr, | |
| 432 | /// lhs & rhs | |
| 433 | bit_and_expr, | |
| 434 | /// lhs == rhs | |
| 435 | equal_expr, | |
| 436 | /// lhs != rhs | |
| 437 | not_equal_expr, | |
| 438 | /// lhs < rhs | |
| 439 | less_than_expr, | |
| 440 | /// lhs <= rhs | |
| 441 | less_than_equal_expr, | |
| 442 | /// lhs > rhs | |
| 443 | greater_than_expr, | |
| 444 | /// lhs >= rhs | |
| 445 | greater_than_equal_expr, | |
| 446 | /// lhs << rhs | |
| 447 | shl_expr, | |
| 448 | /// lhs >> rhs | |
| 449 | shr_expr, | |
| 450 | /// lhs + rhs | |
| 451 | add_expr, | |
| 452 | /// lhs - rhs | |
| 453 | sub_expr, | |
| 454 | /// lhs * rhs | |
| 455 | mul_expr, | |
| 456 | /// lhs / rhs | |
| 457 | div_expr, | |
| 458 | /// lhs % rhs | |
| 459 | mod_expr, | |
| 460 | /// Explicit: (type) cast | |
| 461 | explicit_cast, | |
| 462 | /// Implicit: cast | |
| 463 | implicit_cast, | |
| 464 | /// &un | |
| 465 | addr_of_expr, | |
| 466 | /// &&decl_ref | |
| 467 | addr_of_label, | |
| 468 | /// *un | |
| 469 | deref_expr, | |
| 470 | /// +un | |
| 471 | plus_expr, | |
| 472 | /// -un | |
| 473 | negate_expr, | |
| 474 | /// ~un | |
| 475 | bit_not_expr, | |
| 476 | /// !un | |
| 477 | bool_not_expr, | |
| 478 | /// ++un | |
| 479 | pre_inc_expr, | |
| 480 | /// --un | |
| 481 | pre_dec_expr, | |
| 482 | /// __imag un | |
| 483 | imag_expr, | |
| 484 | /// __real un | |
| 485 | real_expr, | |
| 486 | /// lhs[rhs] lhs is pointer/array type, rhs is integer type | |
| 487 | array_access_expr, | |
| 488 | /// two[0](two[1]) two[1] may be 0 | |
| 489 | call_expr_one, | |
| 490 | /// data[0](data[1..]) | |
| 491 | call_expr, | |
| 492 | /// decl | |
| 493 | builtin_call_expr_one, | |
| 494 | builtin_call_expr, | |
| 495 | /// lhs.member | |
| 496 | member_access_expr, | |
| 497 | /// lhs->member | |
| 498 | member_access_ptr_expr, | |
| 499 | /// un++ | |
| 500 | post_inc_expr, | |
| 501 | /// un-- | |
| 502 | post_dec_expr, | |
| 503 | /// (un) | |
| 504 | paren_expr, | |
| 505 | /// decl_ref | |
| 506 | decl_ref_expr, | |
| 507 | /// decl_ref | |
| 508 | enumeration_ref, | |
| 509 | /// C23 bool literal `true` / `false` | |
| 510 | bool_literal, | |
| 511 | /// C23 nullptr literal | |
| 512 | nullptr_literal, | |
| 513 | /// integer literal, always unsigned | |
| 514 | int_literal, | |
| 515 | /// Same as int_literal, but originates from a char literal | |
| 516 | char_literal, | |
| 517 | /// a floating point literal | |
| 518 | float_literal, | |
| 519 | /// wraps a float or double literal: un | |
| 520 | imaginary_literal, | |
| 521 | /// tree.str[index..][0..len] | |
| 522 | string_literal_expr, | |
| 523 | /// sizeof(un?) | |
| 524 | sizeof_expr, | |
| 525 | /// _Alignof(un?) | |
| 526 | alignof_expr, | |
| 527 | /// _Generic(controlling two[0], chosen two[1]) | |
| 528 | generic_expr_one, | |
| 529 | /// _Generic(controlling range[0], chosen range[1], rest range[2..]) | |
| 530 | generic_expr, | |
| 531 | /// ty: un | |
| 532 | generic_association_expr, | |
| 533 | // default: un | |
| 534 | generic_default_expr, | |
| 535 | /// __builtin_choose_expr(lhs, data[0], data[1]) | |
| 536 | builtin_choose_expr, | |
| 537 | /// __builtin_types_compatible_p(lhs, rhs) | |
| 538 | builtin_types_compatible_p, | |
| 539 | /// decl - special builtins require custom parsing | |
| 540 | special_builtin_call_one, | |
| 541 | /// ({ un }) | |
| 542 | stmt_expr, | |
| 543 | ||
| 544 | // ====== Initializer expressions ====== | |
| 545 | ||
| 546 | /// { two[0], two[1] } | |
| 547 | array_init_expr_two, | |
| 548 | /// { range } | |
| 549 | array_init_expr, | |
| 550 | /// { two[0], two[1] } | |
| 551 | struct_init_expr_two, | |
| 552 | /// { range } | |
| 553 | struct_init_expr, | |
| 554 | /// { union_init } | |
| 555 | union_init_expr, | |
| 556 | ||
| 557 | /// (ty){ un } | |
| 558 | /// loc is token index of l_paren | |
| 559 | compound_literal_expr, | |
| 560 | /// (static ty){ un } | |
| 561 | /// loc is token index of l_paren | |
| 562 | static_compound_literal_expr, | |
| 563 | /// (thread_local ty){ un } | |
| 564 | /// loc is token index of l_paren | |
| 565 | thread_local_compound_literal_expr, | |
| 566 | /// (static thread_local ty){ un } | |
| 567 | /// loc is token index of l_paren | |
| 568 | static_thread_local_compound_literal_expr, | |
| 569 | ||
| 570 | /// Inserted at the end of a function body if no return stmt is found. | |
| 571 | /// ty is the functions return type | |
| 572 | /// data is return_zero which is true if the function is called "main" and ty is compatible with int | |
| 573 | /// loc is token index of closing r_brace of function | |
| 574 | implicit_return, | |
| 2753 | fn unpackOptIndex(idx: u32) ?Node.Index { | |
| 2754 | return @as(Node.OptIndex, @enumFromInt(idx)).unpack(); | |
| 2755 | } | |
| 575 | 2756 | |
| 576 | /// Inserted in array_init_expr to represent unspecified elements. | |
| 577 | /// data.int contains the amount of elements. | |
| 578 | array_filler_expr, | |
| 579 | /// Inserted in record and scalar initializers for unspecified elements. | |
| 580 | default_init_expr, | |
| 2757 | fn packElem(nodes: []const Node.Index, index: usize) u32 { | |
| 2758 | return if (nodes.len > index) @intFromEnum(nodes[index]) else @intFromEnum(Node.OptIndex.null); | |
| 2759 | } | |
| 581 | 2760 | |
| 582 | pub fn isImplicit(tag: Tag) bool { | |
| 583 | return switch (tag) { | |
| 584 | .implicit_cast, | |
| 585 | .implicit_return, | |
| 586 | .array_filler_expr, | |
| 587 | .default_init_expr, | |
| 588 | .implicit_static_var, | |
| 589 | .cond_dummy_expr, | |
| 590 | => true, | |
| 591 | else => false, | |
| 592 | }; | |
| 2761 | fn unPackElems(data: []const u32) []const Node.Index { | |
| 2762 | const sentinel = @intFromEnum(Node.OptIndex.null); | |
| 2763 | for (data, 0..) |item, i| { | |
| 2764 | if (item == sentinel) return @ptrCast(data[0..i]); | |
| 593 | 2765 | } |
| 594 | }; | |
| 2766 | return @ptrCast(data); | |
| 2767 | } | |
| 2768 | ||
| 2769 | /// Returns index to `tree.extra` and length of data | |
| 2770 | fn addExtra(tree: *Tree, data: []const Node.Index) !struct { u32, u32 } { | |
| 2771 | const index: u32 = @intCast(tree.extra.items.len); | |
| 2772 | try tree.extra.appendSlice(tree.comp.gpa, @ptrCast(data)); | |
| 2773 | return .{ index, @intCast(data.len) }; | |
| 2774 | } | |
| 595 | 2775 | |
| 596 | pub fn isBitfield(tree: *const Tree, node: NodeIndex) bool { | |
| 2776 | pub fn isBitfield(tree: *const Tree, node: Node.Index) bool { | |
| 597 | 2777 | return tree.bitfieldWidth(node, false) != null; |
| 598 | 2778 | } |
| 599 | 2779 | |
| 600 | 2780 | /// Returns null if node is not a bitfield. If inspect_lval is true, this function will |
| 601 | 2781 | /// recurse into implicit lval_to_rval casts (useful for arithmetic conversions) |
| 602 | pub fn bitfieldWidth(tree: *const Tree, node: NodeIndex, inspect_lval: bool) ?u32 { | |
| 603 | if (node == .none) return null; | |
| 604 | switch (tree.nodes.items(.tag)[@intFromEnum(node)]) { | |
| 605 | .member_access_expr, .member_access_ptr_expr => { | |
| 606 | const member = tree.nodes.items(.data)[@intFromEnum(node)].member; | |
| 607 | var ty = tree.nodes.items(.ty)[@intFromEnum(member.lhs)]; | |
| 608 | if (ty.isPtr()) ty = ty.elemType(); | |
| 609 | const record_ty = ty.get(.@"struct") orelse ty.get(.@"union") orelse return null; | |
| 610 | const field = record_ty.data.record.fields[member.index]; | |
| 611 | return field.bit_width; | |
| 612 | }, | |
| 613 | .implicit_cast => { | |
| 2782 | pub fn bitfieldWidth(tree: *const Tree, node: Node.Index, inspect_lval: bool) ?u32 { | |
| 2783 | switch (node.get(tree)) { | |
| 2784 | .member_access_expr, .member_access_ptr_expr => |access| return access.isBitFieldWidth(tree), | |
| 2785 | .cast => |cast| { | |
| 614 | 2786 | if (!inspect_lval) return null; |
| 615 | 2787 | |
| 616 | const data = tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 617 | return switch (data.cast.kind) { | |
| 618 | .lval_to_rval => tree.bitfieldWidth(data.cast.operand, false), | |
| 2788 | return switch (cast.kind) { | |
| 2789 | .lval_to_rval => tree.bitfieldWidth(cast.operand, false), | |
| 619 | 2790 | else => null, |
| 620 | 2791 | }; |
| 621 | 2792 | }, |
| ... | ... | @@ -632,34 +2803,29 @@ const CallableResultUsage = struct { |
| 632 | 2803 | warn_unused_result: bool, |
| 633 | 2804 | }; |
| 634 | 2805 | |
| 635 | pub fn callableResultUsage(tree: *const Tree, node: NodeIndex) ?CallableResultUsage { | |
| 636 | const data = tree.nodes.items(.data); | |
| 637 | ||
| 2806 | pub fn callableResultUsage(tree: *const Tree, node: Node.Index) ?CallableResultUsage { | |
| 638 | 2807 | var cur_node = node; |
| 639 | while (true) switch (tree.nodes.items(.tag)[@intFromEnum(cur_node)]) { | |
| 640 | .decl_ref_expr => { | |
| 641 | const tok = data[@intFromEnum(cur_node)].decl_ref; | |
| 642 | const fn_ty = tree.nodes.items(.ty)[@intFromEnum(node)].elemType(); | |
| 643 | return .{ | |
| 644 | .tok = tok, | |
| 645 | .nodiscard = fn_ty.hasAttribute(.nodiscard), | |
| 646 | .warn_unused_result = fn_ty.hasAttribute(.warn_unused_result), | |
| 647 | }; | |
| 2808 | while (true) switch (cur_node.get(tree)) { | |
| 2809 | .decl_ref_expr => |decl_ref| return .{ | |
| 2810 | .tok = decl_ref.name_tok, | |
| 2811 | .nodiscard = decl_ref.qt.hasAttribute(tree.comp, .nodiscard), | |
| 2812 | .warn_unused_result = decl_ref.qt.hasAttribute(tree.comp, .warn_unused_result), | |
| 648 | 2813 | }, |
| 649 | .paren_expr => cur_node = data[@intFromEnum(cur_node)].un, | |
| 650 | .comma_expr => cur_node = data[@intFromEnum(cur_node)].bin.rhs, | |
| 651 | ||
| 652 | .explicit_cast, .implicit_cast => cur_node = data[@intFromEnum(cur_node)].cast.operand, | |
| 653 | .addr_of_expr, .deref_expr => cur_node = data[@intFromEnum(cur_node)].un, | |
| 654 | .call_expr_one => cur_node = data[@intFromEnum(cur_node)].two[0], | |
| 655 | .call_expr => cur_node = tree.data[data[@intFromEnum(cur_node)].range.start], | |
| 656 | .member_access_expr, .member_access_ptr_expr => { | |
| 657 | const member = data[@intFromEnum(cur_node)].member; | |
| 658 | var ty = tree.nodes.items(.ty)[@intFromEnum(member.lhs)]; | |
| 659 | if (ty.isPtr()) ty = ty.elemType(); | |
| 660 | const record = ty.getRecord().?; | |
| 661 | const field = record.fields[member.index]; | |
| 662 | const attributes = if (record.field_attributes) |attrs| attrs[member.index] else &.{}; | |
| 2814 | ||
| 2815 | .paren_expr, .addr_of_expr, .deref_expr => |un| cur_node = un.operand, | |
| 2816 | .comma_expr => |bin| cur_node = bin.rhs, | |
| 2817 | .cast => |cast| cur_node = cast.operand, | |
| 2818 | .call_expr => |call| cur_node = call.callee, | |
| 2819 | .member_access_expr, .member_access_ptr_expr => |access| { | |
| 2820 | var qt = access.base.qt(tree); | |
| 2821 | if (qt.get(tree.comp, .pointer)) |pointer| qt = pointer.child; | |
| 2822 | const record_ty = switch (qt.base(tree.comp).type) { | |
| 2823 | .@"struct", .@"union" => |record| record, | |
| 2824 | else => return null, | |
| 2825 | }; | |
| 2826 | ||
| 2827 | const field = record_ty.fields[access.member_index]; | |
| 2828 | const attributes = field.attributes(tree.comp); | |
| 663 | 2829 | return .{ |
| 664 | 2830 | .tok = field.name_tok, |
| 665 | 2831 | .nodiscard = for (attributes) |attr| { |
| ... | ... | @@ -674,177 +2840,115 @@ pub fn callableResultUsage(tree: *const Tree, node: NodeIndex) ?CallableResultUs |
| 674 | 2840 | }; |
| 675 | 2841 | } |
| 676 | 2842 | |
| 677 | pub fn isLval(tree: *const Tree, node: NodeIndex) bool { | |
| 2843 | pub fn isLval(tree: *const Tree, node: Node.Index) bool { | |
| 678 | 2844 | var is_const: bool = undefined; |
| 679 | 2845 | return tree.isLvalExtra(node, &is_const); |
| 680 | 2846 | } |
| 681 | 2847 | |
| 682 | pub fn isLvalExtra(tree: *const Tree, node: NodeIndex, is_const: *bool) bool { | |
| 2848 | pub fn isLvalExtra(tree: *const Tree, node: Node.Index, is_const: *bool) bool { | |
| 683 | 2849 | is_const.* = false; |
| 684 | switch (tree.nodes.items(.tag)[@intFromEnum(node)]) { | |
| 685 | .compound_literal_expr, | |
| 686 | .static_compound_literal_expr, | |
| 687 | .thread_local_compound_literal_expr, | |
| 688 | .static_thread_local_compound_literal_expr, | |
| 689 | => { | |
| 690 | is_const.* = tree.nodes.items(.ty)[@intFromEnum(node)].isConst(); | |
| 2850 | var cur_node = node; | |
| 2851 | switch (cur_node.get(tree)) { | |
| 2852 | .compound_literal_expr => |literal| { | |
| 2853 | is_const.* = literal.qt.@"const"; | |
| 691 | 2854 | return true; |
| 692 | 2855 | }, |
| 693 | 2856 | .string_literal_expr => return true, |
| 694 | .member_access_ptr_expr => { | |
| 695 | const lhs_expr = tree.nodes.items(.data)[@intFromEnum(node)].member.lhs; | |
| 696 | const ptr_ty = tree.nodes.items(.ty)[@intFromEnum(lhs_expr)]; | |
| 697 | if (ptr_ty.isPtr()) is_const.* = ptr_ty.elemType().isConst(); | |
| 2857 | .member_access_ptr_expr => |access| { | |
| 2858 | const ptr_qt = access.base.qt(tree); | |
| 2859 | if (ptr_qt.get(tree.comp, .pointer)) |pointer| is_const.* = pointer.child.@"const"; | |
| 698 | 2860 | return true; |
| 699 | 2861 | }, |
| 700 | .array_access_expr => { | |
| 701 | const lhs_expr = tree.nodes.items(.data)[@intFromEnum(node)].bin.lhs; | |
| 702 | if (lhs_expr != .none) { | |
| 703 | const array_ty = tree.nodes.items(.ty)[@intFromEnum(lhs_expr)]; | |
| 704 | if (array_ty.isPtr() or array_ty.isArray()) is_const.* = array_ty.elemType().isConst(); | |
| 705 | } | |
| 706 | return true; | |
| 2862 | .member_access_expr => |access| { | |
| 2863 | return tree.isLvalExtra(access.base, is_const); | |
| 707 | 2864 | }, |
| 708 | .decl_ref_expr => { | |
| 709 | const decl_ty = tree.nodes.items(.ty)[@intFromEnum(node)]; | |
| 710 | is_const.* = decl_ty.isConst(); | |
| 2865 | .array_access_expr => |access| { | |
| 2866 | const base_qt = access.base.qt(tree); | |
| 2867 | // Array access operand undergoes lval conversions so the base can never | |
| 2868 | // be a pure array type. | |
| 2869 | if (base_qt.get(tree.comp, .pointer)) |pointer| is_const.* = pointer.child.@"const"; | |
| 711 | 2870 | return true; |
| 712 | 2871 | }, |
| 713 | .deref_expr => { | |
| 714 | const data = tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 715 | const operand_ty = tree.nodes.items(.ty)[@intFromEnum(data.un)]; | |
| 716 | if (operand_ty.isFunc()) return false; | |
| 717 | if (operand_ty.isPtr() or operand_ty.isArray()) is_const.* = operand_ty.elemType().isConst(); | |
| 2872 | .decl_ref_expr => |decl_ref| { | |
| 2873 | is_const.* = decl_ref.qt.@"const"; | |
| 718 | 2874 | return true; |
| 719 | 2875 | }, |
| 720 | .member_access_expr => { | |
| 721 | const data = tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 722 | return tree.isLvalExtra(data.member.lhs, is_const); | |
| 2876 | .deref_expr => |un| { | |
| 2877 | const operand_qt = un.operand.qt(tree); | |
| 2878 | switch (operand_qt.base(tree.comp).type) { | |
| 2879 | .func => return false, | |
| 2880 | .pointer => |pointer| is_const.* = pointer.child.@"const", | |
| 2881 | else => {}, | |
| 2882 | } | |
| 2883 | return true; | |
| 723 | 2884 | }, |
| 724 | .paren_expr => { | |
| 725 | const data = tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 726 | return tree.isLvalExtra(data.un, is_const); | |
| 2885 | .paren_expr => |un| { | |
| 2886 | return tree.isLvalExtra(un.operand, is_const); | |
| 727 | 2887 | }, |
| 728 | .builtin_choose_expr => { | |
| 729 | const data = tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 730 | ||
| 731 | if (tree.value_map.get(data.if3.cond)) |val| { | |
| 732 | const offset = @intFromBool(val.isZero(tree.comp)); | |
| 733 | return tree.isLvalExtra(tree.data[data.if3.body + offset], is_const); | |
| 2888 | .builtin_choose_expr => |conditional| { | |
| 2889 | if (tree.value_map.get(conditional.cond)) |val| { | |
| 2890 | if (!val.isZero(tree.comp)) { | |
| 2891 | return tree.isLvalExtra(conditional.then_expr, is_const); | |
| 2892 | } else { | |
| 2893 | return tree.isLvalExtra(conditional.else_expr, is_const); | |
| 2894 | } | |
| 734 | 2895 | } |
| 735 | 2896 | return false; |
| 736 | 2897 | }, |
| 2898 | .compound_assign_dummy_expr => return true, | |
| 737 | 2899 | else => return false, |
| 738 | 2900 | } |
| 739 | 2901 | } |
| 740 | 2902 | |
| 741 | /// This should only be used for node tags that represent AST nodes which have an arbitrary number of children | |
| 742 | /// It particular it should *not* be used for nodes with .un or .bin data types | |
| 743 | /// | |
| 744 | /// For call expressions, child_nodes[0] is the function pointer being called and child_nodes[1..] | |
| 745 | /// are the arguments | |
| 746 | /// | |
| 747 | /// For generic selection expressions, child_nodes[0] is the controlling expression, | |
| 748 | /// child_nodes[1] is the chosen expression (it is a syntax error for there to be no chosen expression), | |
| 749 | /// and child_nodes[2..] are the remaining expressions. | |
| 750 | pub fn childNodes(tree: *const Tree, node: NodeIndex) []const NodeIndex { | |
| 751 | const tags = tree.nodes.items(.tag); | |
| 752 | const data = tree.nodes.items(.data); | |
| 753 | switch (tags[@intFromEnum(node)]) { | |
| 754 | .compound_stmt_two, | |
| 755 | .array_init_expr_two, | |
| 756 | .struct_init_expr_two, | |
| 757 | .enum_decl_two, | |
| 758 | .struct_decl_two, | |
| 759 | .union_decl_two, | |
| 760 | .call_expr_one, | |
| 761 | .generic_expr_one, | |
| 762 | => { | |
| 763 | const index: u32 = @intFromEnum(node); | |
| 764 | const end = std.mem.indexOfScalar(NodeIndex, &data[index].two, .none) orelse 2; | |
| 765 | return data[index].two[0..end]; | |
| 766 | }, | |
| 767 | .compound_stmt, | |
| 768 | .array_init_expr, | |
| 769 | .struct_init_expr, | |
| 770 | .enum_decl, | |
| 771 | .struct_decl, | |
| 772 | .union_decl, | |
| 773 | .call_expr, | |
| 774 | .generic_expr, | |
| 775 | => { | |
| 776 | const range = data[@intFromEnum(node)].range; | |
| 777 | return tree.data[range.start..range.end]; | |
| 778 | }, | |
| 779 | else => unreachable, | |
| 780 | } | |
| 781 | } | |
| 782 | ||
| 783 | 2903 | pub fn tokSlice(tree: *const Tree, tok_i: TokenIndex) []const u8 { |
| 784 | 2904 | if (tree.tokens.items(.id)[tok_i].lexeme()) |some| return some; |
| 785 | 2905 | const loc = tree.tokens.items(.loc)[tok_i]; |
| 786 | 2906 | return tree.comp.locSlice(loc); |
| 787 | 2907 | } |
| 788 | 2908 | |
| 789 | pub fn nodeTok(tree: *const Tree, node: NodeIndex) ?TokenIndex { | |
| 790 | std.debug.assert(node != .none); | |
| 791 | const loc = tree.nodes.items(.loc)[@intFromEnum(node)]; | |
| 792 | return switch (loc) { | |
| 793 | .none => null, | |
| 794 | else => |tok_i| @intFromEnum(tok_i), | |
| 795 | }; | |
| 796 | } | |
| 797 | ||
| 798 | pub fn nodeLoc(tree: *const Tree, node: NodeIndex) ?Source.Location { | |
| 799 | const tok_i = tree.nodeTok(node) orelse return null; | |
| 800 | return tree.tokens.items(.loc)[@intFromEnum(tok_i)]; | |
| 801 | } | |
| 802 | ||
| 803 | pub fn dump(tree: *const Tree, config: std.Io.tty.Config, writer: anytype) !void { | |
| 804 | const mapper = tree.comp.string_interner.getFastTypeMapper(tree.comp.gpa) catch tree.comp.string_interner.getSlowTypeMapper(); | |
| 805 | defer mapper.deinit(tree.comp.gpa); | |
| 806 | ||
| 807 | for (tree.root_decls) |i| { | |
| 808 | try tree.dumpNode(i, 0, mapper, config, writer); | |
| 809 | try writer.writeByte('\n'); | |
| 2909 | pub fn dump(tree: *const Tree, config: std.Io.tty.Config, w: *std.Io.Writer) std.Io.tty.Config.SetColorError!void { | |
| 2910 | for (tree.root_decls.items) |i| { | |
| 2911 | try tree.dumpNode(i, 0, config, w); | |
| 2912 | try w.writeByte('\n'); | |
| 810 | 2913 | } |
| 2914 | try w.flush(); | |
| 811 | 2915 | } |
| 812 | 2916 | |
| 813 | fn dumpFieldAttributes(tree: *const Tree, attributes: []const Attribute, level: u32, writer: anytype) !void { | |
| 2917 | fn dumpFieldAttributes(tree: *const Tree, attributes: []const Attribute, level: u32, w: *std.Io.Writer) !void { | |
| 814 | 2918 | for (attributes) |attr| { |
| 815 | try writer.writeByteNTimes(' ', level); | |
| 816 | try writer.print("field attr: {s}", .{@tagName(attr.tag)}); | |
| 817 | try tree.dumpAttribute(attr, writer); | |
| 2919 | try w.splatByteAll(' ', level); | |
| 2920 | try w.print("field attr: {s}", .{@tagName(attr.tag)}); | |
| 2921 | try tree.dumpAttribute(attr, w); | |
| 818 | 2922 | } |
| 819 | 2923 | } |
| 820 | 2924 | |
| 821 | fn dumpAttribute(tree: *const Tree, attr: Attribute, writer: anytype) !void { | |
| 2925 | fn dumpAttribute(tree: *const Tree, attr: Attribute, w: *std.Io.Writer) !void { | |
| 822 | 2926 | switch (attr.tag) { |
| 823 | 2927 | inline else => |tag| { |
| 824 | 2928 | const args = @field(attr.args, @tagName(tag)); |
| 825 | 2929 | const fields = @typeInfo(@TypeOf(args)).@"struct".fields; |
| 826 | 2930 | if (fields.len == 0) { |
| 827 | try writer.writeByte('\n'); | |
| 2931 | try w.writeByte('\n'); | |
| 828 | 2932 | return; |
| 829 | 2933 | } |
| 830 | try writer.writeByte(' '); | |
| 2934 | try w.writeByte(' '); | |
| 831 | 2935 | inline for (fields, 0..) |f, i| { |
| 832 | 2936 | if (comptime std.mem.eql(u8, f.name, "__name_tok")) continue; |
| 833 | 2937 | if (i != 0) { |
| 834 | try writer.writeAll(", "); | |
| 2938 | try w.writeAll(", "); | |
| 835 | 2939 | } |
| 836 | try writer.writeAll(f.name); | |
| 837 | try writer.writeAll(": "); | |
| 2940 | try w.writeAll(f.name); | |
| 2941 | try w.writeAll(": "); | |
| 838 | 2942 | switch (f.type) { |
| 839 | Interner.Ref => try writer.print("\"{s}\"", .{tree.interner.get(@field(args, f.name)).bytes}), | |
| 840 | ?Interner.Ref => try writer.print("\"{?s}\"", .{if (@field(args, f.name)) |str| tree.interner.get(str).bytes else null}), | |
| 2943 | Interner.Ref => try w.print("\"{s}\"", .{tree.interner.get(@field(args, f.name)).bytes}), | |
| 2944 | ?Interner.Ref => try w.print("\"{?s}\"", .{if (@field(args, f.name)) |str| tree.interner.get(str).bytes else null}), | |
| 841 | 2945 | else => switch (@typeInfo(f.type)) { |
| 842 | .@"enum" => try writer.writeAll(@tagName(@field(args, f.name))), | |
| 843 | else => try writer.print("{any}", .{@field(args, f.name)}), | |
| 2946 | .@"enum" => try w.writeAll(@tagName(@field(args, f.name))), | |
| 2947 | else => try w.print("{any}", .{@field(args, f.name)}), | |
| 844 | 2948 | }, |
| 845 | 2949 | } |
| 846 | 2950 | } |
| 847 | try writer.writeByte('\n'); | |
| 2951 | try w.writeByte('\n'); | |
| 848 | 2952 | return; |
| 849 | 2953 | }, |
| 850 | 2954 | } |
| ... | ... | @@ -852,11 +2956,10 @@ fn dumpAttribute(tree: *const Tree, attr: Attribute, writer: anytype) !void { |
| 852 | 2956 | |
| 853 | 2957 | fn dumpNode( |
| 854 | 2958 | tree: *const Tree, |
| 855 | node: NodeIndex, | |
| 2959 | node_index: Node.Index, | |
| 856 | 2960 | level: u32, |
| 857 | mapper: StringInterner.TypeMapper, | |
| 858 | 2961 | config: std.Io.tty.Config, |
| 859 | w: anytype, | |
| 2962 | w: *std.Io.Writer, | |
| 860 | 2963 | ) !void { |
| 861 | 2964 | const delta = 2; |
| 862 | 2965 | const half = delta / 2; |
| ... | ... | @@ -866,43 +2969,63 @@ fn dumpNode( |
| 866 | 2969 | const NAME = std.Io.tty.Color.bright_red; |
| 867 | 2970 | const LITERAL = std.Io.tty.Color.bright_green; |
| 868 | 2971 | const ATTRIBUTE = std.Io.tty.Color.bright_yellow; |
| 869 | std.debug.assert(node != .none); | |
| 870 | ||
| 871 | const tag = tree.nodes.items(.tag)[@intFromEnum(node)]; | |
| 872 | const data = tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 873 | const ty = tree.nodes.items(.ty)[@intFromEnum(node)]; | |
| 874 | try w.writeByteNTimes(' ', level); | |
| 875 | ||
| 876 | try config.setColor(w, if (tag.isImplicit()) IMPLICIT else TAG); | |
| 877 | try w.print("{s}: ", .{@tagName(tag)}); | |
| 878 | if (tag == .implicit_cast or tag == .explicit_cast) { | |
| 879 | try config.setColor(w, .white); | |
| 880 | try w.print("({s}) ", .{@tagName(data.cast.kind)}); | |
| 2972 | ||
| 2973 | const node = node_index.get(tree); | |
| 2974 | try w.splatByteAll(' ', level); | |
| 2975 | ||
| 2976 | if (config == .no_color) { | |
| 2977 | if (node.isImplicit()) try w.writeAll("implicit "); | |
| 2978 | } else { | |
| 2979 | try config.setColor(w, if (node.isImplicit()) IMPLICIT else TAG); | |
| 881 | 2980 | } |
| 882 | try config.setColor(w, TYPE); | |
| 883 | try w.writeByte('\''); | |
| 884 | const name = ty.getName(); | |
| 885 | if (name != .empty) { | |
| 886 | try w.print("{s}': '", .{mapper.lookup(name)}); | |
| 2981 | try w.print("{s}", .{@tagName(node)}); | |
| 2982 | ||
| 2983 | if (node_index.qtOrNull(tree)) |qt| { | |
| 2984 | try w.writeAll(": "); | |
| 2985 | switch (node) { | |
| 2986 | .cast => |cast| { | |
| 2987 | try config.setColor(w, .white); | |
| 2988 | try w.print("({s}) ", .{@tagName(cast.kind)}); | |
| 2989 | }, | |
| 2990 | else => {}, | |
| 2991 | } | |
| 2992 | ||
| 2993 | try config.setColor(w, TYPE); | |
| 2994 | try w.writeByte('\''); | |
| 2995 | try qt.dump(tree.comp, w); | |
| 2996 | try w.writeByte('\''); | |
| 887 | 2997 | } |
| 888 | try ty.dump(mapper, tree.comp.langopts, w); | |
| 889 | try w.writeByte('\''); | |
| 890 | 2998 | |
| 891 | if (tree.isLval(node)) { | |
| 2999 | if (tree.isLval(node_index)) { | |
| 892 | 3000 | try config.setColor(w, ATTRIBUTE); |
| 893 | 3001 | try w.writeAll(" lvalue"); |
| 894 | 3002 | } |
| 895 | if (tree.isBitfield(node)) { | |
| 3003 | if (tree.isBitfield(node_index)) { | |
| 896 | 3004 | try config.setColor(w, ATTRIBUTE); |
| 897 | 3005 | try w.writeAll(" bitfield"); |
| 898 | 3006 | } |
| 899 | if (tree.value_map.get(node)) |val| { | |
| 3007 | ||
| 3008 | if (tree.value_map.get(node_index)) |val| { | |
| 900 | 3009 | try config.setColor(w, LITERAL); |
| 901 | 3010 | try w.writeAll(" (value: "); |
| 902 | try val.print(ty, tree.comp, w); | |
| 3011 | if (try val.print(node_index.qt(tree), tree.comp, w)) |nested| switch (nested) { | |
| 3012 | .pointer => |ptr| { | |
| 3013 | switch (tree.nodes.items(.tag)[ptr.node]) { | |
| 3014 | .compound_literal_expr => { | |
| 3015 | try w.writeAll("(compound literal) "); | |
| 3016 | _ = try ptr.offset.print(tree.comp.type_store.ptrdiff, tree.comp, w); | |
| 3017 | }, | |
| 3018 | else => { | |
| 3019 | const ptr_node: Node.Index = @enumFromInt(ptr.node); | |
| 3020 | const decl_name = tree.tokSlice(ptr_node.tok(tree)); | |
| 3021 | try ptr.offset.printPointer(decl_name, tree.comp, w); | |
| 3022 | }, | |
| 3023 | } | |
| 3024 | }, | |
| 3025 | }; | |
| 903 | 3026 | try w.writeByte(')'); |
| 904 | 3027 | } |
| 905 | if (tag == .implicit_return and data.return_zero) { | |
| 3028 | if (node == .return_stmt and node.return_stmt.operand == .implicit and node.return_stmt.operand.implicit) { | |
| 906 | 3029 | try config.setColor(w, IMPLICIT); |
| 907 | 3030 | try w.writeAll(" (value: 0)"); |
| 908 | 3031 | try config.setColor(w, .reset); |
| ... | ... | @@ -911,379 +3034,428 @@ fn dumpNode( |
| 911 | 3034 | try w.writeAll("\n"); |
| 912 | 3035 | try config.setColor(w, .reset); |
| 913 | 3036 | |
| 914 | if (ty.specifier == .attributed) { | |
| 3037 | if (node_index.qtOrNull(tree)) |qt| { | |
| 915 | 3038 | try config.setColor(w, ATTRIBUTE); |
| 916 | var it = Attribute.Iterator.initType(ty); | |
| 3039 | var it = Attribute.Iterator.initType(qt, tree.comp); | |
| 917 | 3040 | while (it.next()) |item| { |
| 918 | 3041 | const attr, _ = item; |
| 919 | try w.writeByteNTimes(' ', level + half); | |
| 3042 | try w.splatByteAll(' ', level + half); | |
| 920 | 3043 | try w.print("attr: {s}", .{@tagName(attr.tag)}); |
| 921 | 3044 | try tree.dumpAttribute(attr, w); |
| 922 | 3045 | } |
| 923 | 3046 | try config.setColor(w, .reset); |
| 924 | 3047 | } |
| 925 | 3048 | |
| 926 | switch (tag) { | |
| 927 | .invalid => unreachable, | |
| 928 | .file_scope_asm => { | |
| 929 | try w.writeByteNTimes(' ', level + 1); | |
| 930 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 3049 | switch (node) { | |
| 3050 | .empty_decl => {}, | |
| 3051 | .global_asm, .gnu_asm_simple => |@"asm"| { | |
| 3052 | try w.splatByteAll(' ', level + 1); | |
| 3053 | try tree.dumpNode(@"asm".asm_str, level + delta, config, w); | |
| 931 | 3054 | }, |
| 932 | .gnu_asm_simple => { | |
| 933 | try w.writeByteNTimes(' ', level); | |
| 934 | try tree.dumpNode(data.un, level, mapper, config, w); | |
| 935 | }, | |
| 936 | .static_assert => { | |
| 937 | try w.writeByteNTimes(' ', level + 1); | |
| 3055 | .static_assert => |assert| { | |
| 3056 | try w.splatByteAll(' ', level + 1); | |
| 938 | 3057 | try w.writeAll("condition:\n"); |
| 939 | try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); | |
| 940 | if (data.bin.rhs != .none) { | |
| 941 | try w.writeByteNTimes(' ', level + 1); | |
| 3058 | try tree.dumpNode(assert.cond, level + delta, config, w); | |
| 3059 | if (assert.message) |some| { | |
| 3060 | try w.splatByteAll(' ', level + 1); | |
| 942 | 3061 | try w.writeAll("diagnostic:\n"); |
| 943 | try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); | |
| 3062 | try tree.dumpNode(some, level + delta, config, w); | |
| 3063 | } | |
| 3064 | }, | |
| 3065 | .function => |function| { | |
| 3066 | try w.splatByteAll(' ', level + half); | |
| 3067 | ||
| 3068 | try config.setColor(w, ATTRIBUTE); | |
| 3069 | if (function.static) try w.writeAll("static "); | |
| 3070 | if (function.@"inline") try w.writeAll("inline "); | |
| 3071 | ||
| 3072 | try config.setColor(w, .reset); | |
| 3073 | try w.writeAll("name: "); | |
| 3074 | try config.setColor(w, NAME); | |
| 3075 | try w.print("{s}\n", .{tree.tokSlice(function.name_tok)}); | |
| 3076 | try config.setColor(w, .reset); | |
| 3077 | ||
| 3078 | if (function.body) |body| { | |
| 3079 | try w.splatByteAll(' ', level + half); | |
| 3080 | try w.writeAll("body:\n"); | |
| 3081 | try tree.dumpNode(body, level + delta, config, w); | |
| 3082 | } | |
| 3083 | if (function.definition) |definition| { | |
| 3084 | try w.splatByteAll(' ', level + half); | |
| 3085 | try w.writeAll("definition: "); | |
| 3086 | try config.setColor(w, NAME); | |
| 3087 | try w.print("0x{X}\n", .{@intFromEnum(definition)}); | |
| 3088 | try config.setColor(w, .reset); | |
| 944 | 3089 | } |
| 945 | 3090 | }, |
| 946 | .fn_proto, | |
| 947 | .static_fn_proto, | |
| 948 | .inline_fn_proto, | |
| 949 | .inline_static_fn_proto, | |
| 950 | => { | |
| 951 | try w.writeByteNTimes(' ', level + half); | |
| 3091 | .typedef => |typedef| { | |
| 3092 | try w.splatByteAll(' ', level + half); | |
| 952 | 3093 | try w.writeAll("name: "); |
| 953 | 3094 | try config.setColor(w, NAME); |
| 954 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 3095 | try w.print("{s}\n", .{tree.tokSlice(typedef.name_tok)}); | |
| 955 | 3096 | try config.setColor(w, .reset); |
| 956 | 3097 | }, |
| 957 | .fn_def, | |
| 958 | .static_fn_def, | |
| 959 | .inline_fn_def, | |
| 960 | .inline_static_fn_def, | |
| 961 | => { | |
| 962 | try w.writeByteNTimes(' ', level + half); | |
| 3098 | .param => |param| { | |
| 3099 | try w.splatByteAll(' ', level + half); | |
| 3100 | ||
| 3101 | switch (param.storage_class) { | |
| 3102 | .auto => {}, | |
| 3103 | .register => { | |
| 3104 | try config.setColor(w, ATTRIBUTE); | |
| 3105 | try w.writeAll("register "); | |
| 3106 | try config.setColor(w, .reset); | |
| 3107 | }, | |
| 3108 | } | |
| 3109 | ||
| 963 | 3110 | try w.writeAll("name: "); |
| 964 | 3111 | try config.setColor(w, NAME); |
| 965 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 3112 | try w.print("{s}\n", .{tree.tokSlice(param.name_tok)}); | |
| 966 | 3113 | try config.setColor(w, .reset); |
| 967 | try w.writeByteNTimes(' ', level + half); | |
| 968 | try w.writeAll("body:\n"); | |
| 969 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 970 | }, | |
| 971 | .typedef, | |
| 972 | .@"var", | |
| 973 | .extern_var, | |
| 974 | .static_var, | |
| 975 | .implicit_static_var, | |
| 976 | .threadlocal_var, | |
| 977 | .threadlocal_extern_var, | |
| 978 | .threadlocal_static_var, | |
| 979 | => { | |
| 980 | try w.writeByteNTimes(' ', level + half); | |
| 3114 | }, | |
| 3115 | .variable => |variable| { | |
| 3116 | try w.splatByteAll(' ', level + half); | |
| 3117 | ||
| 3118 | try config.setColor(w, ATTRIBUTE); | |
| 3119 | switch (variable.storage_class) { | |
| 3120 | .auto => {}, | |
| 3121 | .static => try w.writeAll("static "), | |
| 3122 | .@"extern" => try w.writeAll("extern "), | |
| 3123 | .register => try w.writeAll("register "), | |
| 3124 | } | |
| 3125 | if (variable.thread_local) try w.writeAll("thread_local "); | |
| 3126 | try config.setColor(w, .reset); | |
| 3127 | ||
| 981 | 3128 | try w.writeAll("name: "); |
| 982 | 3129 | try config.setColor(w, NAME); |
| 983 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 3130 | try w.print("{s}\n", .{tree.tokSlice(variable.name_tok)}); | |
| 984 | 3131 | try config.setColor(w, .reset); |
| 985 | if (data.decl.node != .none) { | |
| 986 | try w.writeByteNTimes(' ', level + half); | |
| 3132 | ||
| 3133 | if (variable.initializer) |some| { | |
| 3134 | try config.setColor(w, .reset); | |
| 3135 | try w.splatByteAll(' ', level + half); | |
| 987 | 3136 | try w.writeAll("init:\n"); |
| 988 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 3137 | try tree.dumpNode(some, level + delta, config, w); | |
| 3138 | } | |
| 3139 | if (variable.definition) |definition| { | |
| 3140 | try w.splatByteAll(' ', level + half); | |
| 3141 | try w.writeAll("definition: "); | |
| 3142 | try config.setColor(w, NAME); | |
| 3143 | try w.print("0x{X}\n", .{@intFromEnum(definition)}); | |
| 3144 | try config.setColor(w, .reset); | |
| 989 | 3145 | } |
| 990 | 3146 | }, |
| 991 | .enum_field_decl => { | |
| 992 | try w.writeByteNTimes(' ', level + half); | |
| 3147 | .enum_field => |field| { | |
| 3148 | try w.splatByteAll(' ', level + half); | |
| 993 | 3149 | try w.writeAll("name: "); |
| 994 | 3150 | try config.setColor(w, NAME); |
| 995 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 3151 | try w.print("{s}\n", .{tree.tokSlice(field.name_tok)}); | |
| 996 | 3152 | try config.setColor(w, .reset); |
| 997 | if (data.decl.node != .none) { | |
| 998 | try w.writeByteNTimes(' ', level + half); | |
| 999 | try w.writeAll("value:\n"); | |
| 1000 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 3153 | if (field.init) |some| { | |
| 3154 | try w.splatByteAll(' ', level + half); | |
| 3155 | try w.writeAll("init:\n"); | |
| 3156 | try tree.dumpNode(some, level + delta, config, w); | |
| 1001 | 3157 | } |
| 1002 | 3158 | }, |
| 1003 | .record_field_decl => { | |
| 1004 | if (data.decl.name != 0) { | |
| 1005 | try w.writeByteNTimes(' ', level + half); | |
| 3159 | .record_field => |field| { | |
| 3160 | const name_tok_id = tree.tokens.items(.id)[field.name_or_first_tok]; | |
| 3161 | if (name_tok_id == .identifier or name_tok_id == .extended_identifier) { | |
| 3162 | try w.splatByteAll(' ', level + half); | |
| 1006 | 3163 | try w.writeAll("name: "); |
| 1007 | 3164 | try config.setColor(w, NAME); |
| 1008 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 3165 | try w.print("{s}\n", .{tree.tokSlice(field.name_or_first_tok)}); | |
| 1009 | 3166 | try config.setColor(w, .reset); |
| 1010 | 3167 | } |
| 1011 | if (data.decl.node != .none) { | |
| 1012 | try w.writeByteNTimes(' ', level + half); | |
| 3168 | if (field.bit_width) |some| { | |
| 3169 | try w.splatByteAll(' ', level + half); | |
| 1013 | 3170 | try w.writeAll("bits:\n"); |
| 1014 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 3171 | try tree.dumpNode(some, level + delta, config, w); | |
| 3172 | } | |
| 3173 | }, | |
| 3174 | .compound_stmt => |compound| { | |
| 3175 | for (compound.body, 0..) |stmt, i| { | |
| 3176 | if (i != 0) try w.writeByte('\n'); | |
| 3177 | try tree.dumpNode(stmt, level + delta, config, w); | |
| 3178 | } | |
| 3179 | }, | |
| 3180 | .enum_decl => |decl| { | |
| 3181 | for (decl.fields, 0..) |field, i| { | |
| 3182 | if (i != 0) try w.writeByte('\n'); | |
| 3183 | try tree.dumpNode(field, level + delta, config, w); | |
| 1015 | 3184 | } |
| 1016 | 3185 | }, |
| 1017 | .indirect_record_field_decl => {}, | |
| 1018 | .compound_stmt, | |
| 1019 | .array_init_expr, | |
| 1020 | .struct_init_expr, | |
| 1021 | .enum_decl, | |
| 1022 | .struct_decl, | |
| 1023 | .union_decl, | |
| 1024 | .compound_stmt_two, | |
| 1025 | .array_init_expr_two, | |
| 1026 | .struct_init_expr_two, | |
| 1027 | .enum_decl_two, | |
| 1028 | .struct_decl_two, | |
| 1029 | .union_decl_two, | |
| 1030 | => { | |
| 1031 | const child_nodes = tree.childNodes(node); | |
| 1032 | const maybe_field_attributes = if (ty.getRecord()) |record| record.field_attributes else null; | |
| 1033 | for (child_nodes, 0..) |stmt, i| { | |
| 3186 | .struct_decl, .union_decl => |decl| { | |
| 3187 | const fields = switch (node_index.qt(tree).base(tree.comp).type) { | |
| 3188 | .@"struct", .@"union" => |record| record.fields, | |
| 3189 | else => unreachable, | |
| 3190 | }; | |
| 3191 | ||
| 3192 | var field_i: u32 = 0; | |
| 3193 | for (decl.fields, 0..) |field_node, i| { | |
| 1034 | 3194 | if (i != 0) try w.writeByte('\n'); |
| 1035 | try tree.dumpNode(stmt, level + delta, mapper, config, w); | |
| 1036 | if (maybe_field_attributes) |field_attributes| { | |
| 1037 | if (field_attributes[i].len == 0) continue; | |
| 3195 | try tree.dumpNode(field_node, level + delta, config, w); | |
| 1038 | 3196 | |
| 1039 | try config.setColor(w, ATTRIBUTE); | |
| 1040 | try tree.dumpFieldAttributes(field_attributes[i], level + delta + half, w); | |
| 1041 | try config.setColor(w, .reset); | |
| 1042 | } | |
| 3197 | if (field_node.get(tree) != .record_field) continue; | |
| 3198 | if (fields.len == 0) continue; | |
| 3199 | ||
| 3200 | const field_attributes = fields[field_i].attributes(tree.comp); | |
| 3201 | field_i += 1; | |
| 3202 | ||
| 3203 | if (field_attributes.len == 0) continue; | |
| 3204 | ||
| 3205 | try config.setColor(w, ATTRIBUTE); | |
| 3206 | try tree.dumpFieldAttributes(field_attributes, level + delta + half, w); | |
| 3207 | try config.setColor(w, .reset); | |
| 3208 | } | |
| 3209 | }, | |
| 3210 | .array_init_expr, .struct_init_expr => |init| { | |
| 3211 | for (init.items, 0..) |item, i| { | |
| 3212 | if (i != 0) try w.writeByte('\n'); | |
| 3213 | try tree.dumpNode(item, level + delta, config, w); | |
| 1043 | 3214 | } |
| 1044 | 3215 | }, |
| 1045 | .union_init_expr => { | |
| 1046 | try w.writeByteNTimes(' ', level + half); | |
| 3216 | .union_init_expr => |init| { | |
| 3217 | try w.splatByteAll(' ', level + half); | |
| 1047 | 3218 | try w.writeAll("field index: "); |
| 1048 | 3219 | try config.setColor(w, LITERAL); |
| 1049 | try w.print("{d}\n", .{data.union_init.field_index}); | |
| 3220 | try w.print("{d}\n", .{init.field_index}); | |
| 1050 | 3221 | try config.setColor(w, .reset); |
| 1051 | if (data.union_init.node != .none) { | |
| 1052 | try tree.dumpNode(data.union_init.node, level + delta, mapper, config, w); | |
| 3222 | if (init.initializer) |some| { | |
| 3223 | try tree.dumpNode(some, level + delta, config, w); | |
| 1053 | 3224 | } |
| 1054 | 3225 | }, |
| 1055 | .compound_literal_expr, | |
| 1056 | .static_compound_literal_expr, | |
| 1057 | .thread_local_compound_literal_expr, | |
| 1058 | .static_thread_local_compound_literal_expr, | |
| 1059 | => { | |
| 1060 | try tree.dumpNode(data.un, level + half, mapper, config, w); | |
| 3226 | .compound_literal_expr => |literal| { | |
| 3227 | if (literal.storage_class != .auto or literal.thread_local) { | |
| 3228 | try w.splatByteAll(' ', level + half - 1); | |
| 3229 | ||
| 3230 | try config.setColor(w, ATTRIBUTE); | |
| 3231 | switch (literal.storage_class) { | |
| 3232 | .auto => {}, | |
| 3233 | .static => try w.writeAll(" static"), | |
| 3234 | .register => try w.writeAll(" register"), | |
| 3235 | } | |
| 3236 | if (literal.thread_local) try w.writeAll(" thread_local"); | |
| 3237 | try w.writeByte('\n'); | |
| 3238 | try config.setColor(w, .reset); | |
| 3239 | } | |
| 3240 | ||
| 3241 | try tree.dumpNode(literal.initializer, level + half, config, w); | |
| 1061 | 3242 | }, |
| 1062 | .labeled_stmt => { | |
| 1063 | try w.writeByteNTimes(' ', level + half); | |
| 3243 | .labeled_stmt => |labeled| { | |
| 3244 | try w.splatByteAll(' ', level + half); | |
| 1064 | 3245 | try w.writeAll("label: "); |
| 1065 | 3246 | try config.setColor(w, LITERAL); |
| 1066 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 3247 | try w.print("{s}\n", .{tree.tokSlice(labeled.label_tok)}); | |
| 3248 | ||
| 1067 | 3249 | try config.setColor(w, .reset); |
| 1068 | if (data.decl.node != .none) { | |
| 1069 | try w.writeByteNTimes(' ', level + half); | |
| 1070 | try w.writeAll("stmt:\n"); | |
| 1071 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 1072 | } | |
| 1073 | }, | |
| 1074 | .case_stmt => { | |
| 1075 | try w.writeByteNTimes(' ', level + half); | |
| 1076 | try w.writeAll("value:\n"); | |
| 1077 | try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); | |
| 1078 | if (data.bin.rhs != .none) { | |
| 1079 | try w.writeByteNTimes(' ', level + half); | |
| 1080 | try w.writeAll("stmt:\n"); | |
| 1081 | try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); | |
| 1082 | } | |
| 3250 | try w.splatByteAll(' ', level + half); | |
| 3251 | try w.writeAll("stmt:\n"); | |
| 3252 | try tree.dumpNode(labeled.body, level + delta, config, w); | |
| 1083 | 3253 | }, |
| 1084 | .case_range_stmt => { | |
| 1085 | try w.writeByteNTimes(' ', level + half); | |
| 1086 | try w.writeAll("range start:\n"); | |
| 1087 | try tree.dumpNode(tree.data[data.if3.body], level + delta, mapper, config, w); | |
| 3254 | .case_stmt => |case| { | |
| 3255 | try w.splatByteAll(' ', level + half); | |
| 1088 | 3256 | |
| 1089 | try w.writeByteNTimes(' ', level + half); | |
| 1090 | try w.writeAll("range end:\n"); | |
| 1091 | try tree.dumpNode(tree.data[data.if3.body + 1], level + delta, mapper, config, w); | |
| 3257 | if (case.end) |some| { | |
| 3258 | try w.writeAll("range start:\n"); | |
| 3259 | try tree.dumpNode(case.start, level + delta, config, w); | |
| 1092 | 3260 | |
| 1093 | if (data.if3.cond != .none) { | |
| 1094 | try w.writeByteNTimes(' ', level + half); | |
| 1095 | try w.writeAll("stmt:\n"); | |
| 1096 | try tree.dumpNode(data.if3.cond, level + delta, mapper, config, w); | |
| 3261 | try w.splatByteAll(' ', level + half); | |
| 3262 | try w.writeAll("range end:\n"); | |
| 3263 | try tree.dumpNode(some, level + delta, config, w); | |
| 3264 | } else { | |
| 3265 | try w.writeAll("value:\n"); | |
| 3266 | try tree.dumpNode(case.start, level + delta, config, w); | |
| 1097 | 3267 | } |
| 3268 | ||
| 3269 | try w.splatByteAll(' ', level + half); | |
| 3270 | try w.writeAll("stmt:\n"); | |
| 3271 | try tree.dumpNode(case.body, level + delta, config, w); | |
| 1098 | 3272 | }, |
| 1099 | .default_stmt => { | |
| 1100 | if (data.un != .none) { | |
| 1101 | try w.writeByteNTimes(' ', level + half); | |
| 1102 | try w.writeAll("stmt:\n"); | |
| 1103 | try tree.dumpNode(data.un, level + delta, mapper, config, w); | |
| 1104 | } | |
| 3273 | .default_stmt => |default| { | |
| 3274 | try w.splatByteAll(' ', level + half); | |
| 3275 | try w.writeAll("stmt:\n"); | |
| 3276 | try tree.dumpNode(default.body, level + delta, config, w); | |
| 1105 | 3277 | }, |
| 1106 | .binary_cond_expr, .cond_expr, .if_then_else_stmt, .builtin_choose_expr => { | |
| 1107 | try w.writeByteNTimes(' ', level + half); | |
| 3278 | .binary_cond_expr, .cond_expr, .builtin_choose_expr => |conditional| { | |
| 3279 | try w.splatByteAll(' ', level + half); | |
| 1108 | 3280 | try w.writeAll("cond:\n"); |
| 1109 | try tree.dumpNode(data.if3.cond, level + delta, mapper, config, w); | |
| 3281 | try tree.dumpNode(conditional.cond, level + delta, config, w); | |
| 1110 | 3282 | |
| 1111 | try w.writeByteNTimes(' ', level + half); | |
| 3283 | try w.splatByteAll(' ', level + half); | |
| 1112 | 3284 | try w.writeAll("then:\n"); |
| 1113 | try tree.dumpNode(tree.data[data.if3.body], level + delta, mapper, config, w); | |
| 3285 | try tree.dumpNode(conditional.then_expr, level + delta, config, w); | |
| 1114 | 3286 | |
| 1115 | try w.writeByteNTimes(' ', level + half); | |
| 3287 | try w.splatByteAll(' ', level + half); | |
| 1116 | 3288 | try w.writeAll("else:\n"); |
| 1117 | try tree.dumpNode(tree.data[data.if3.body + 1], level + delta, mapper, config, w); | |
| 3289 | try tree.dumpNode(conditional.else_expr, level + delta, config, w); | |
| 1118 | 3290 | }, |
| 1119 | .builtin_types_compatible_p => { | |
| 1120 | std.debug.assert(tree.nodes.items(.tag)[@intFromEnum(data.bin.lhs)] == .invalid); | |
| 1121 | std.debug.assert(tree.nodes.items(.tag)[@intFromEnum(data.bin.rhs)] == .invalid); | |
| 1122 | ||
| 1123 | try w.writeByteNTimes(' ', level + half); | |
| 3291 | .builtin_types_compatible_p => |call| { | |
| 3292 | try w.splatByteAll(' ', level + half); | |
| 1124 | 3293 | try w.writeAll("lhs: "); |
| 1125 | ||
| 1126 | const lhs_ty = tree.nodes.items(.ty)[@intFromEnum(data.bin.lhs)]; | |
| 1127 | 3294 | try config.setColor(w, TYPE); |
| 1128 | try lhs_ty.dump(mapper, tree.comp.langopts, w); | |
| 1129 | try config.setColor(w, .reset); | |
| 3295 | try call.lhs.dump(tree.comp, w); | |
| 1130 | 3296 | try w.writeByte('\n'); |
| 3297 | try config.setColor(w, .reset); | |
| 1131 | 3298 | |
| 1132 | try w.writeByteNTimes(' ', level + half); | |
| 3299 | try w.splatByteAll(' ', level + half); | |
| 1133 | 3300 | try w.writeAll("rhs: "); |
| 1134 | ||
| 1135 | const rhs_ty = tree.nodes.items(.ty)[@intFromEnum(data.bin.rhs)]; | |
| 1136 | 3301 | try config.setColor(w, TYPE); |
| 1137 | try rhs_ty.dump(mapper, tree.comp.langopts, w); | |
| 1138 | try config.setColor(w, .reset); | |
| 3302 | try call.rhs.dump(tree.comp, w); | |
| 1139 | 3303 | try w.writeByte('\n'); |
| 3304 | try config.setColor(w, .reset); | |
| 1140 | 3305 | }, |
| 1141 | .if_then_stmt => { | |
| 1142 | try w.writeByteNTimes(' ', level + half); | |
| 1143 | try w.writeAll("cond:\n"); | |
| 1144 | try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); | |
| 3306 | .builtin_convertvector => |convert| { | |
| 3307 | try w.splatByteAll(' ', level + half); | |
| 3308 | try w.writeAll("operand:\n"); | |
| 3309 | try tree.dumpNode(convert.operand, level + delta, config, w); | |
| 3310 | }, | |
| 3311 | .builtin_shufflevector => |shuffle| { | |
| 3312 | try w.splatByteAll(' ', level + half); | |
| 3313 | try w.writeAll("lhs:\n"); | |
| 3314 | try tree.dumpNode(shuffle.lhs, level + delta, config, w); | |
| 3315 | ||
| 3316 | try w.splatByteAll(' ', level + half); | |
| 3317 | try w.writeAll("rhs:\n"); | |
| 3318 | try tree.dumpNode(shuffle.rhs, level + delta, config, w); | |
| 1145 | 3319 | |
| 1146 | if (data.bin.rhs != .none) { | |
| 1147 | try w.writeByteNTimes(' ', level + half); | |
| 1148 | try w.writeAll("then:\n"); | |
| 1149 | try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); | |
| 3320 | if (shuffle.indexes.len > 0) { | |
| 3321 | try w.splatByteAll(' ', level + half); | |
| 3322 | try w.writeAll("indexes:\n"); | |
| 3323 | for (shuffle.indexes) |index| { | |
| 3324 | try tree.dumpNode(index, level + delta, config, w); | |
| 3325 | } | |
| 1150 | 3326 | } |
| 1151 | 3327 | }, |
| 1152 | .switch_stmt, .while_stmt, .do_while_stmt => { | |
| 1153 | try w.writeByteNTimes(' ', level + half); | |
| 3328 | .if_stmt => |@"if"| { | |
| 3329 | try w.splatByteAll(' ', level + half); | |
| 1154 | 3330 | try w.writeAll("cond:\n"); |
| 1155 | try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); | |
| 3331 | try tree.dumpNode(@"if".cond, level + delta, config, w); | |
| 1156 | 3332 | |
| 1157 | if (data.bin.rhs != .none) { | |
| 1158 | try w.writeByteNTimes(' ', level + half); | |
| 1159 | try w.writeAll("body:\n"); | |
| 1160 | try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); | |
| 3333 | try w.splatByteAll(' ', level + half); | |
| 3334 | try w.writeAll("then:\n"); | |
| 3335 | try tree.dumpNode(@"if".then_body, level + delta, config, w); | |
| 3336 | ||
| 3337 | if (@"if".else_body) |some| { | |
| 3338 | try w.splatByteAll(' ', level + half); | |
| 3339 | try w.writeAll("else:\n"); | |
| 3340 | try tree.dumpNode(some, level + delta, config, w); | |
| 1161 | 3341 | } |
| 1162 | 3342 | }, |
| 1163 | .for_decl_stmt => { | |
| 1164 | const for_decl = data.forDecl(tree); | |
| 3343 | .switch_stmt => |@"switch"| { | |
| 3344 | try w.splatByteAll(' ', level + half); | |
| 3345 | try w.writeAll("cond:\n"); | |
| 3346 | try tree.dumpNode(@"switch".cond, level + delta, config, w); | |
| 1165 | 3347 | |
| 1166 | try w.writeByteNTimes(' ', level + half); | |
| 1167 | try w.writeAll("decl:\n"); | |
| 1168 | for (for_decl.decls) |decl| { | |
| 1169 | try tree.dumpNode(decl, level + delta, mapper, config, w); | |
| 1170 | try w.writeByte('\n'); | |
| 1171 | } | |
| 1172 | if (for_decl.cond != .none) { | |
| 1173 | try w.writeByteNTimes(' ', level + half); | |
| 1174 | try w.writeAll("cond:\n"); | |
| 1175 | try tree.dumpNode(for_decl.cond, level + delta, mapper, config, w); | |
| 1176 | } | |
| 1177 | if (for_decl.incr != .none) { | |
| 1178 | try w.writeByteNTimes(' ', level + half); | |
| 1179 | try w.writeAll("incr:\n"); | |
| 1180 | try tree.dumpNode(for_decl.incr, level + delta, mapper, config, w); | |
| 1181 | } | |
| 1182 | if (for_decl.body != .none) { | |
| 1183 | try w.writeByteNTimes(' ', level + half); | |
| 1184 | try w.writeAll("body:\n"); | |
| 1185 | try tree.dumpNode(for_decl.body, level + delta, mapper, config, w); | |
| 1186 | } | |
| 3348 | try w.splatByteAll(' ', level + half); | |
| 3349 | try w.writeAll("body:\n"); | |
| 3350 | try tree.dumpNode(@"switch".body, level + delta, config, w); | |
| 1187 | 3351 | }, |
| 1188 | .forever_stmt => { | |
| 1189 | if (data.un != .none) { | |
| 1190 | try w.writeByteNTimes(' ', level + half); | |
| 1191 | try w.writeAll("body:\n"); | |
| 1192 | try tree.dumpNode(data.un, level + delta, mapper, config, w); | |
| 1193 | } | |
| 3352 | .while_stmt => |@"while"| { | |
| 3353 | try w.splatByteAll(' ', level + half); | |
| 3354 | try w.writeAll("cond:\n"); | |
| 3355 | try tree.dumpNode(@"while".cond, level + delta, config, w); | |
| 3356 | ||
| 3357 | try w.splatByteAll(' ', level + half); | |
| 3358 | try w.writeAll("body:\n"); | |
| 3359 | try tree.dumpNode(@"while".body, level + delta, config, w); | |
| 1194 | 3360 | }, |
| 1195 | .for_stmt => { | |
| 1196 | const for_stmt = data.forStmt(tree); | |
| 3361 | .do_while_stmt => |do| { | |
| 3362 | try w.splatByteAll(' ', level + half); | |
| 3363 | try w.writeAll("cond:\n"); | |
| 3364 | try tree.dumpNode(do.cond, level + delta, config, w); | |
| 1197 | 3365 | |
| 1198 | if (for_stmt.init != .none) { | |
| 1199 | try w.writeByteNTimes(' ', level + half); | |
| 1200 | try w.writeAll("init:\n"); | |
| 1201 | try tree.dumpNode(for_stmt.init, level + delta, mapper, config, w); | |
| 3366 | try w.splatByteAll(' ', level + half); | |
| 3367 | try w.writeAll("body:\n"); | |
| 3368 | try tree.dumpNode(do.body, level + delta, config, w); | |
| 3369 | }, | |
| 3370 | .for_stmt => |@"for"| { | |
| 3371 | switch (@"for".init) { | |
| 3372 | .decls => |decls| { | |
| 3373 | try w.splatByteAll(' ', level + half); | |
| 3374 | try w.writeAll("decl:\n"); | |
| 3375 | for (decls) |decl| { | |
| 3376 | try tree.dumpNode(decl, level + delta, config, w); | |
| 3377 | try w.writeByte('\n'); | |
| 3378 | } | |
| 3379 | }, | |
| 3380 | .expr => |expr| if (expr) |some| { | |
| 3381 | try w.splatByteAll(' ', level + half); | |
| 3382 | try w.writeAll("init:\n"); | |
| 3383 | try tree.dumpNode(some, level + delta, config, w); | |
| 3384 | }, | |
| 1202 | 3385 | } |
| 1203 | if (for_stmt.cond != .none) { | |
| 1204 | try w.writeByteNTimes(' ', level + half); | |
| 3386 | if (@"for".cond) |some| { | |
| 3387 | try w.splatByteAll(' ', level + half); | |
| 1205 | 3388 | try w.writeAll("cond:\n"); |
| 1206 | try tree.dumpNode(for_stmt.cond, level + delta, mapper, config, w); | |
| 3389 | try tree.dumpNode(some, level + delta, config, w); | |
| 1207 | 3390 | } |
| 1208 | if (for_stmt.incr != .none) { | |
| 1209 | try w.writeByteNTimes(' ', level + half); | |
| 3391 | if (@"for".incr) |some| { | |
| 3392 | try w.splatByteAll(' ', level + half); | |
| 1210 | 3393 | try w.writeAll("incr:\n"); |
| 1211 | try tree.dumpNode(for_stmt.incr, level + delta, mapper, config, w); | |
| 1212 | } | |
| 1213 | if (for_stmt.body != .none) { | |
| 1214 | try w.writeByteNTimes(' ', level + half); | |
| 1215 | try w.writeAll("body:\n"); | |
| 1216 | try tree.dumpNode(for_stmt.body, level + delta, mapper, config, w); | |
| 3394 | try tree.dumpNode(some, level + delta, config, w); | |
| 1217 | 3395 | } |
| 3396 | try w.splatByteAll(' ', level + half); | |
| 3397 | try w.writeAll("body:\n"); | |
| 3398 | try tree.dumpNode(@"for".body, level + delta, config, w); | |
| 1218 | 3399 | }, |
| 1219 | .goto_stmt, .addr_of_label => { | |
| 1220 | try w.writeByteNTimes(' ', level + half); | |
| 3400 | .addr_of_label => |addr| { | |
| 3401 | try w.splatByteAll(' ', level + half); | |
| 1221 | 3402 | try w.writeAll("label: "); |
| 1222 | 3403 | try config.setColor(w, LITERAL); |
| 1223 | try w.print("{s}\n", .{tree.tokSlice(data.decl_ref)}); | |
| 3404 | try w.print("{s}\n", .{tree.tokSlice(addr.label_tok)}); | |
| 1224 | 3405 | try config.setColor(w, .reset); |
| 1225 | 3406 | }, |
| 1226 | .continue_stmt, .break_stmt, .implicit_return, .null_stmt => {}, | |
| 1227 | .return_stmt => { | |
| 1228 | if (data.un != .none) { | |
| 1229 | try w.writeByteNTimes(' ', level + half); | |
| 1230 | try w.writeAll("expr:\n"); | |
| 1231 | try tree.dumpNode(data.un, level + delta, mapper, config, w); | |
| 3407 | .goto_stmt => |goto| { | |
| 3408 | try w.splatByteAll(' ', level + half); | |
| 3409 | try w.writeAll("label: "); | |
| 3410 | try config.setColor(w, LITERAL); | |
| 3411 | try w.print("{s}\n", .{tree.tokSlice(goto.label_tok)}); | |
| 3412 | try config.setColor(w, .reset); | |
| 3413 | }, | |
| 3414 | .computed_goto_stmt => |goto| { | |
| 3415 | try w.splatByteAll(' ', level + half); | |
| 3416 | try w.writeAll("expr:\n"); | |
| 3417 | try tree.dumpNode(goto.expr, level + delta, config, w); | |
| 3418 | }, | |
| 3419 | .continue_stmt, .break_stmt, .null_stmt => {}, | |
| 3420 | .return_stmt => |ret| { | |
| 3421 | switch (ret.operand) { | |
| 3422 | .expr => |expr| { | |
| 3423 | try w.splatByteAll(' ', level + half); | |
| 3424 | try w.writeAll("expr:\n"); | |
| 3425 | try tree.dumpNode(expr, level + delta, config, w); | |
| 3426 | }, | |
| 3427 | .implicit => {}, | |
| 3428 | .none => {}, | |
| 1232 | 3429 | } |
| 1233 | 3430 | }, |
| 1234 | .call_expr, .call_expr_one => { | |
| 1235 | const child_nodes = tree.childNodes(node); | |
| 1236 | const fn_ptr = child_nodes[0]; | |
| 1237 | const args = child_nodes[1..]; | |
| 1238 | ||
| 1239 | try w.writeByteNTimes(' ', level + half); | |
| 1240 | try w.writeAll("lhs:\n"); | |
| 1241 | try tree.dumpNode(fn_ptr, level + delta, mapper, config, w); | |
| 3431 | .call_expr => |call| { | |
| 3432 | try w.splatByteAll(' ', level + half); | |
| 3433 | try w.writeAll("callee:\n"); | |
| 3434 | try tree.dumpNode(call.callee, level + delta, config, w); | |
| 1242 | 3435 | |
| 1243 | if (args.len > 0) { | |
| 1244 | try w.writeByteNTimes(' ', level + half); | |
| 3436 | if (call.args.len > 0) { | |
| 3437 | try w.splatByteAll(' ', level + half); | |
| 1245 | 3438 | try w.writeAll("args:\n"); |
| 1246 | for (args) |arg| { | |
| 1247 | try tree.dumpNode(arg, level + delta, mapper, config, w); | |
| 3439 | for (call.args) |arg| { | |
| 3440 | try tree.dumpNode(arg, level + delta, config, w); | |
| 1248 | 3441 | } |
| 1249 | 3442 | } |
| 1250 | 3443 | }, |
| 1251 | .builtin_call_expr => { | |
| 1252 | try w.writeByteNTimes(' ', level + half); | |
| 3444 | .builtin_call_expr => |call| { | |
| 3445 | try w.splatByteAll(' ', level + half); | |
| 1253 | 3446 | try w.writeAll("name: "); |
| 1254 | 3447 | try config.setColor(w, NAME); |
| 1255 | try w.print("{s}\n", .{tree.tokSlice(@intFromEnum(tree.data[data.range.start]))}); | |
| 3448 | try w.print("{s}\n", .{tree.tokSlice(call.builtin_tok)}); | |
| 1256 | 3449 | try config.setColor(w, .reset); |
| 1257 | 3450 | |
| 1258 | try w.writeByteNTimes(' ', level + half); | |
| 1259 | try w.writeAll("args:\n"); | |
| 1260 | for (tree.data[data.range.start + 1 .. data.range.end]) |arg| try tree.dumpNode(arg, level + delta, mapper, config, w); | |
| 1261 | }, | |
| 1262 | .builtin_call_expr_one => { | |
| 1263 | try w.writeByteNTimes(' ', level + half); | |
| 1264 | try w.writeAll("name: "); | |
| 1265 | try config.setColor(w, NAME); | |
| 1266 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 1267 | try config.setColor(w, .reset); | |
| 1268 | if (data.decl.node != .none) { | |
| 1269 | try w.writeByteNTimes(' ', level + half); | |
| 1270 | try w.writeAll("arg:\n"); | |
| 1271 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 1272 | } | |
| 1273 | }, | |
| 1274 | .special_builtin_call_one => { | |
| 1275 | try w.writeByteNTimes(' ', level + half); | |
| 1276 | try w.writeAll("name: "); | |
| 1277 | try config.setColor(w, NAME); | |
| 1278 | try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); | |
| 1279 | try config.setColor(w, .reset); | |
| 1280 | if (data.decl.node != .none) { | |
| 1281 | try w.writeByteNTimes(' ', level + half); | |
| 1282 | try w.writeAll("arg:\n"); | |
| 1283 | try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); | |
| 3451 | if (call.args.len > 0) { | |
| 3452 | try w.splatByteAll(' ', level + half); | |
| 3453 | try w.writeAll("args:\n"); | |
| 3454 | for (call.args) |arg| { | |
| 3455 | try tree.dumpNode(arg, level + delta, config, w); | |
| 3456 | } | |
| 1284 | 3457 | } |
| 1285 | 3458 | }, |
| 1286 | .comma_expr, | |
| 1287 | 3459 | .assign_expr, |
| 1288 | 3460 | .mul_assign_expr, |
| 1289 | 3461 | .div_assign_expr, |
| ... | ... | @@ -1295,6 +3467,7 @@ fn dumpNode( |
| 1295 | 3467 | .bit_and_assign_expr, |
| 1296 | 3468 | .bit_xor_assign_expr, |
| 1297 | 3469 | .bit_or_assign_expr, |
| 3470 | .comma_expr, | |
| 1298 | 3471 | .bool_or_expr, |
| 1299 | 3472 | .bool_and_expr, |
| 1300 | 3473 | .bit_or_expr, |
| ... | ... | @@ -1313,17 +3486,17 @@ fn dumpNode( |
| 1313 | 3486 | .mul_expr, |
| 1314 | 3487 | .div_expr, |
| 1315 | 3488 | .mod_expr, |
| 1316 | => { | |
| 1317 | try w.writeByteNTimes(' ', level + 1); | |
| 3489 | => |bin| { | |
| 3490 | try w.splatByteAll(' ', level + 1); | |
| 1318 | 3491 | try w.writeAll("lhs:\n"); |
| 1319 | try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); | |
| 1320 | try w.writeByteNTimes(' ', level + 1); | |
| 3492 | try tree.dumpNode(bin.lhs, level + delta, config, w); | |
| 3493 | ||
| 3494 | try w.splatByteAll(' ', level + 1); | |
| 1321 | 3495 | try w.writeAll("rhs:\n"); |
| 1322 | try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); | |
| 3496 | try tree.dumpNode(bin.rhs, level + delta, config, w); | |
| 1323 | 3497 | }, |
| 1324 | .explicit_cast, .implicit_cast => try tree.dumpNode(data.cast.operand, level + delta, mapper, config, w), | |
| 3498 | .cast => |cast| try tree.dumpNode(cast.operand, level + delta, config, w), | |
| 1325 | 3499 | .addr_of_expr, |
| 1326 | .computed_goto_stmt, | |
| 1327 | 3500 | .deref_expr, |
| 1328 | 3501 | .plus_expr, |
| 1329 | 3502 | .negate_expr, |
| ... | ... | @@ -1336,23 +3509,25 @@ fn dumpNode( |
| 1336 | 3509 | .post_inc_expr, |
| 1337 | 3510 | .post_dec_expr, |
| 1338 | 3511 | .paren_expr, |
| 1339 | => { | |
| 1340 | try w.writeByteNTimes(' ', level + 1); | |
| 3512 | .stmt_expr, | |
| 3513 | .imaginary_literal, | |
| 3514 | => |un| { | |
| 3515 | try w.splatByteAll(' ', level + 1); | |
| 1341 | 3516 | try w.writeAll("operand:\n"); |
| 1342 | try tree.dumpNode(data.un, level + delta, mapper, config, w); | |
| 3517 | try tree.dumpNode(un.operand, level + delta, config, w); | |
| 1343 | 3518 | }, |
| 1344 | .decl_ref_expr => { | |
| 1345 | try w.writeByteNTimes(' ', level + 1); | |
| 3519 | .decl_ref_expr, .enumeration_ref => |dr| { | |
| 3520 | try w.splatByteAll(' ', level + 1); | |
| 1346 | 3521 | try w.writeAll("name: "); |
| 1347 | 3522 | try config.setColor(w, NAME); |
| 1348 | try w.print("{s}\n", .{tree.tokSlice(data.decl_ref)}); | |
| 3523 | try w.print("{s}\n", .{tree.tokSlice(dr.name_tok)}); | |
| 1349 | 3524 | try config.setColor(w, .reset); |
| 1350 | 3525 | }, |
| 1351 | .enumeration_ref => { | |
| 1352 | try w.writeByteNTimes(' ', level + 1); | |
| 3526 | .builtin_ref => |dr| { | |
| 3527 | try w.splatByteAll(' ', level + 1); | |
| 1353 | 3528 | try w.writeAll("name: "); |
| 1354 | 3529 | try config.setColor(w, NAME); |
| 1355 | try w.print("{s}\n", .{tree.tokSlice(data.decl_ref)}); | |
| 3530 | try w.print("{s}\n", .{tree.tokSlice(dr.name_tok)}); | |
| 1356 | 3531 | try config.setColor(w, .reset); |
| 1357 | 3532 | }, |
| 1358 | 3533 | .bool_literal, |
| ... | ... | @@ -1362,67 +3537,71 @@ fn dumpNode( |
| 1362 | 3537 | .float_literal, |
| 1363 | 3538 | .string_literal_expr, |
| 1364 | 3539 | => {}, |
| 1365 | .member_access_expr, .member_access_ptr_expr => { | |
| 1366 | try w.writeByteNTimes(' ', level + 1); | |
| 3540 | .member_access_expr, .member_access_ptr_expr => |access| { | |
| 3541 | try w.splatByteAll(' ', level + 1); | |
| 1367 | 3542 | try w.writeAll("lhs:\n"); |
| 1368 | try tree.dumpNode(data.member.lhs, level + delta, mapper, config, w); | |
| 3543 | try tree.dumpNode(access.base, level + delta, config, w); | |
| 1369 | 3544 | |
| 1370 | var lhs_ty = tree.nodes.items(.ty)[@intFromEnum(data.member.lhs)]; | |
| 1371 | if (lhs_ty.isPtr()) lhs_ty = lhs_ty.elemType(); | |
| 1372 | lhs_ty = lhs_ty.canonicalize(.standard); | |
| 3545 | var base_qt = access.base.qt(tree); | |
| 3546 | if (base_qt.get(tree.comp, .pointer)) |some| base_qt = some.child; | |
| 3547 | const fields = (base_qt.getRecord(tree.comp) orelse return).fields; | |
| 1373 | 3548 | |
| 1374 | try w.writeByteNTimes(' ', level + 1); | |
| 3549 | try w.splatByteAll(' ', level + 1); | |
| 1375 | 3550 | try w.writeAll("name: "); |
| 1376 | 3551 | try config.setColor(w, NAME); |
| 1377 | try w.print("{s}\n", .{mapper.lookup(lhs_ty.data.record.fields[data.member.index].name)}); | |
| 3552 | try w.print("{s}\n", .{fields[access.member_index].name.lookup(tree.comp)}); | |
| 1378 | 3553 | try config.setColor(w, .reset); |
| 1379 | 3554 | }, |
| 1380 | .array_access_expr => { | |
| 1381 | if (data.bin.lhs != .none) { | |
| 1382 | try w.writeByteNTimes(' ', level + 1); | |
| 1383 | try w.writeAll("lhs:\n"); | |
| 1384 | try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); | |
| 1385 | } | |
| 1386 | try w.writeByteNTimes(' ', level + 1); | |
| 3555 | .array_access_expr => |access| { | |
| 3556 | try w.splatByteAll(' ', level + 1); | |
| 3557 | try w.writeAll("base:\n"); | |
| 3558 | try tree.dumpNode(access.base, level + delta, config, w); | |
| 3559 | ||
| 3560 | try w.splatByteAll(' ', level + 1); | |
| 1387 | 3561 | try w.writeAll("index:\n"); |
| 1388 | try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); | |
| 3562 | try tree.dumpNode(access.index, level + delta, config, w); | |
| 1389 | 3563 | }, |
| 1390 | .sizeof_expr, .alignof_expr => { | |
| 1391 | if (data.un != .none) { | |
| 1392 | try w.writeByteNTimes(' ', level + 1); | |
| 3564 | .sizeof_expr, .alignof_expr => |type_info| { | |
| 3565 | if (type_info.expr) |some| { | |
| 3566 | try w.splatByteAll(' ', level + 1); | |
| 1393 | 3567 | try w.writeAll("expr:\n"); |
| 1394 | try tree.dumpNode(data.un, level + delta, mapper, config, w); | |
| 3568 | try tree.dumpNode(some, level + delta, config, w); | |
| 3569 | } else { | |
| 3570 | try w.splatByteAll(' ', level + half); | |
| 3571 | try w.writeAll("operand type: "); | |
| 3572 | try config.setColor(w, TYPE); | |
| 3573 | try type_info.operand_qt.dump(tree.comp, w); | |
| 3574 | try w.writeByte('\n'); | |
| 3575 | try config.setColor(w, .reset); | |
| 1395 | 3576 | } |
| 1396 | 3577 | }, |
| 1397 | .generic_expr, .generic_expr_one => { | |
| 1398 | const child_nodes = tree.childNodes(node); | |
| 1399 | const controlling = child_nodes[0]; | |
| 1400 | const chosen = child_nodes[1]; | |
| 1401 | const rest = child_nodes[2..]; | |
| 1402 | ||
| 1403 | try w.writeByteNTimes(' ', level + 1); | |
| 3578 | .generic_expr => |generic| { | |
| 3579 | try w.splatByteAll(' ', level + 1); | |
| 1404 | 3580 | try w.writeAll("controlling:\n"); |
| 1405 | try tree.dumpNode(controlling, level + delta, mapper, config, w); | |
| 1406 | try w.writeByteNTimes(' ', level + 1); | |
| 3581 | try tree.dumpNode(generic.controlling, level + delta, config, w); | |
| 3582 | try w.splatByteAll(' ', level + 1); | |
| 1407 | 3583 | try w.writeAll("chosen:\n"); |
| 1408 | try tree.dumpNode(chosen, level + delta, mapper, config, w); | |
| 3584 | try tree.dumpNode(generic.chosen, level + delta, config, w); | |
| 1409 | 3585 | |
| 1410 | if (rest.len > 0) { | |
| 1411 | try w.writeByteNTimes(' ', level + 1); | |
| 3586 | if (generic.rest.len > 0) { | |
| 3587 | try w.splatByteAll(' ', level + 1); | |
| 1412 | 3588 | try w.writeAll("rest:\n"); |
| 1413 | for (rest) |expr| { | |
| 1414 | try tree.dumpNode(expr, level + delta, mapper, config, w); | |
| 3589 | for (generic.rest) |expr| { | |
| 3590 | try tree.dumpNode(expr, level + delta, config, w); | |
| 1415 | 3591 | } |
| 1416 | 3592 | } |
| 1417 | 3593 | }, |
| 1418 | .generic_association_expr, .generic_default_expr, .stmt_expr, .imaginary_literal => { | |
| 1419 | try tree.dumpNode(data.un, level + delta, mapper, config, w); | |
| 3594 | .generic_association_expr => |assoc| { | |
| 3595 | try tree.dumpNode(assoc.expr, level + delta, config, w); | |
| 3596 | }, | |
| 3597 | .generic_default_expr => |default| { | |
| 3598 | try tree.dumpNode(default.expr, level + delta, config, w); | |
| 1420 | 3599 | }, |
| 1421 | .array_filler_expr => { | |
| 1422 | try w.writeByteNTimes(' ', level + 1); | |
| 3600 | .array_filler_expr => |filler| { | |
| 3601 | try w.splatByteAll(' ', level + 1); | |
| 1423 | 3602 | try w.writeAll("count: "); |
| 1424 | 3603 | try config.setColor(w, LITERAL); |
| 1425 | try w.print("{d}\n", .{data.int}); | |
| 3604 | try w.print("{d}\n", .{filler.count}); | |
| 1426 | 3605 | try config.setColor(w, .reset); |
| 1427 | 3606 | }, |
| 1428 | 3607 | .struct_forward_decl, |
| ... | ... | @@ -1430,6 +3609,7 @@ fn dumpNode( |
| 1430 | 3609 | .enum_forward_decl, |
| 1431 | 3610 | .default_init_expr, |
| 1432 | 3611 | .cond_dummy_expr, |
| 3612 | .compound_assign_dummy_expr, | |
| 1433 | 3613 | => {}, |
| 1434 | 3614 | } |
| 1435 | 3615 | } |
lib/compiler/aro/aro/Type.zig deleted-2676| ... | ... | @@ -1,2676 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Tree = @import("Tree.zig"); | |
| 3 | const TokenIndex = Tree.TokenIndex; | |
| 4 | const NodeIndex = Tree.NodeIndex; | |
| 5 | const Parser = @import("Parser.zig"); | |
| 6 | const Compilation = @import("Compilation.zig"); | |
| 7 | const Attribute = @import("Attribute.zig"); | |
| 8 | const StringInterner = @import("StringInterner.zig"); | |
| 9 | const StringId = StringInterner.StringId; | |
| 10 | const target_util = @import("target.zig"); | |
| 11 | const LangOpts = @import("LangOpts.zig"); | |
| 12 | const Writer = std.Io.Writer; | |
| 13 | ||
| 14 | pub const Qualifiers = packed struct { | |
| 15 | @"const": bool = false, | |
| 16 | atomic: bool = false, | |
| 17 | @"volatile": bool = false, | |
| 18 | restrict: bool = false, | |
| 19 | ||
| 20 | // for function parameters only, stored here since it fits in the padding | |
| 21 | register: bool = false, | |
| 22 | ||
| 23 | pub fn any(quals: Qualifiers) bool { | |
| 24 | return quals.@"const" or quals.restrict or quals.@"volatile" or quals.atomic; | |
| 25 | } | |
| 26 | ||
| 27 | pub fn dump(quals: Qualifiers, w: *Writer) !void { | |
| 28 | if (quals.@"const") try w.writeAll("const "); | |
| 29 | if (quals.atomic) try w.writeAll("_Atomic "); | |
| 30 | if (quals.@"volatile") try w.writeAll("volatile "); | |
| 31 | if (quals.restrict) try w.writeAll("restrict "); | |
| 32 | if (quals.register) try w.writeAll("register "); | |
| 33 | } | |
| 34 | ||
| 35 | /// Merge the const/volatile qualifiers, used by type resolution | |
| 36 | /// of the conditional operator | |
| 37 | pub fn mergeCV(a: Qualifiers, b: Qualifiers) Qualifiers { | |
| 38 | return .{ | |
| 39 | .@"const" = a.@"const" or b.@"const", | |
| 40 | .@"volatile" = a.@"volatile" or b.@"volatile", | |
| 41 | }; | |
| 42 | } | |
| 43 | ||
| 44 | /// Merge all qualifiers, used by typeof() | |
| 45 | fn mergeAll(a: Qualifiers, b: Qualifiers) Qualifiers { | |
| 46 | return .{ | |
| 47 | .@"const" = a.@"const" or b.@"const", | |
| 48 | .atomic = a.atomic or b.atomic, | |
| 49 | .@"volatile" = a.@"volatile" or b.@"volatile", | |
| 50 | .restrict = a.restrict or b.restrict, | |
| 51 | .register = a.register or b.register, | |
| 52 | }; | |
| 53 | } | |
| 54 | ||
| 55 | /// Checks if a has all the qualifiers of b | |
| 56 | pub fn hasQuals(a: Qualifiers, b: Qualifiers) bool { | |
| 57 | if (b.@"const" and !a.@"const") return false; | |
| 58 | if (b.@"volatile" and !a.@"volatile") return false; | |
| 59 | if (b.atomic and !a.atomic) return false; | |
| 60 | return true; | |
| 61 | } | |
| 62 | ||
| 63 | /// register is a storage class and not actually a qualifier | |
| 64 | /// so it is not preserved by typeof() | |
| 65 | pub fn inheritFromTypeof(quals: Qualifiers) Qualifiers { | |
| 66 | var res = quals; | |
| 67 | res.register = false; | |
| 68 | return res; | |
| 69 | } | |
| 70 | ||
| 71 | pub const Builder = struct { | |
| 72 | @"const": ?TokenIndex = null, | |
| 73 | atomic: ?TokenIndex = null, | |
| 74 | @"volatile": ?TokenIndex = null, | |
| 75 | restrict: ?TokenIndex = null, | |
| 76 | ||
| 77 | pub fn finish(b: Qualifiers.Builder, p: *Parser, ty: *Type) !void { | |
| 78 | if (ty.specifier != .pointer and b.restrict != null) { | |
| 79 | try p.errStr(.restrict_non_pointer, b.restrict.?, try p.typeStr(ty.*)); | |
| 80 | } | |
| 81 | if (b.atomic) |some| { | |
| 82 | if (ty.isArray()) try p.errStr(.atomic_array, some, try p.typeStr(ty.*)); | |
| 83 | if (ty.isFunc()) try p.errStr(.atomic_func, some, try p.typeStr(ty.*)); | |
| 84 | if (ty.hasIncompleteSize()) try p.errStr(.atomic_incomplete, some, try p.typeStr(ty.*)); | |
| 85 | } | |
| 86 | ||
| 87 | if (b.@"const" != null) ty.qual.@"const" = true; | |
| 88 | if (b.atomic != null) ty.qual.atomic = true; | |
| 89 | if (b.@"volatile" != null) ty.qual.@"volatile" = true; | |
| 90 | if (b.restrict != null) ty.qual.restrict = true; | |
| 91 | } | |
| 92 | }; | |
| 93 | }; | |
| 94 | ||
| 95 | // TODO improve memory usage | |
| 96 | pub const Func = struct { | |
| 97 | return_type: Type, | |
| 98 | params: []Param, | |
| 99 | ||
| 100 | pub const Param = struct { | |
| 101 | ty: Type, | |
| 102 | name: StringId, | |
| 103 | name_tok: TokenIndex, | |
| 104 | }; | |
| 105 | ||
| 106 | fn eql(a: *const Func, b: *const Func, a_spec: Specifier, b_spec: Specifier, comp: *const Compilation) bool { | |
| 107 | // return type cannot have qualifiers | |
| 108 | if (!a.return_type.eql(b.return_type, comp, false)) return false; | |
| 109 | if (a.params.len == 0 and b.params.len == 0) return true; | |
| 110 | ||
| 111 | if (a.params.len != b.params.len) { | |
| 112 | if (a_spec == .old_style_func or b_spec == .old_style_func) { | |
| 113 | const maybe_has_params = if (a_spec == .old_style_func) b else a; | |
| 114 | for (maybe_has_params.params) |param| { | |
| 115 | if (param.ty.undergoesDefaultArgPromotion(comp)) return false; | |
| 116 | } | |
| 117 | return true; | |
| 118 | } | |
| 119 | return false; | |
| 120 | } | |
| 121 | if ((a_spec == .func) != (b_spec == .func)) return false; | |
| 122 | // TODO validate this | |
| 123 | for (a.params, b.params) |param, b_qual| { | |
| 124 | var a_unqual = param.ty; | |
| 125 | a_unqual.qual.@"const" = false; | |
| 126 | a_unqual.qual.@"volatile" = false; | |
| 127 | var b_unqual = b_qual.ty; | |
| 128 | b_unqual.qual.@"const" = false; | |
| 129 | b_unqual.qual.@"volatile" = false; | |
| 130 | if (!a_unqual.eql(b_unqual, comp, true)) return false; | |
| 131 | } | |
| 132 | return true; | |
| 133 | } | |
| 134 | }; | |
| 135 | ||
| 136 | pub const Array = struct { | |
| 137 | len: u64, | |
| 138 | elem: Type, | |
| 139 | }; | |
| 140 | ||
| 141 | pub const Expr = struct { | |
| 142 | node: NodeIndex, | |
| 143 | ty: Type, | |
| 144 | }; | |
| 145 | ||
| 146 | pub const Attributed = struct { | |
| 147 | attributes: []Attribute, | |
| 148 | base: Type, | |
| 149 | ||
| 150 | pub fn create(allocator: std.mem.Allocator, base_ty: Type, attributes: []const Attribute) !*Attributed { | |
| 151 | const attributed_type = try allocator.create(Attributed); | |
| 152 | errdefer allocator.destroy(attributed_type); | |
| 153 | const duped = try allocator.dupe(Attribute, attributes); | |
| 154 | ||
| 155 | attributed_type.* = .{ | |
| 156 | .attributes = duped, | |
| 157 | .base = base_ty, | |
| 158 | }; | |
| 159 | return attributed_type; | |
| 160 | } | |
| 161 | }; | |
| 162 | ||
| 163 | // TODO improve memory usage | |
| 164 | pub const Enum = struct { | |
| 165 | fields: []Field, | |
| 166 | tag_ty: Type, | |
| 167 | name: StringId, | |
| 168 | fixed: bool, | |
| 169 | ||
| 170 | pub const Field = struct { | |
| 171 | ty: Type, | |
| 172 | name: StringId, | |
| 173 | name_tok: TokenIndex, | |
| 174 | node: NodeIndex, | |
| 175 | }; | |
| 176 | ||
| 177 | pub fn isIncomplete(e: Enum) bool { | |
| 178 | return e.fields.len == std.math.maxInt(usize); | |
| 179 | } | |
| 180 | ||
| 181 | pub fn create(allocator: std.mem.Allocator, name: StringId, fixed_ty: ?Type) !*Enum { | |
| 182 | var e = try allocator.create(Enum); | |
| 183 | e.name = name; | |
| 184 | e.fields.len = std.math.maxInt(usize); | |
| 185 | if (fixed_ty) |some| e.tag_ty = some; | |
| 186 | e.fixed = fixed_ty != null; | |
| 187 | return e; | |
| 188 | } | |
| 189 | }; | |
| 190 | ||
| 191 | pub const TypeLayout = struct { | |
| 192 | /// The size of the type in bits. | |
| 193 | /// | |
| 194 | /// This is the value returned by `sizeof` in C | |
| 195 | /// (but in bits instead of bytes). This is a multiple of `pointer_alignment_bits`. | |
| 196 | size_bits: u64, | |
| 197 | /// The alignment of the type, in bits, when used as a field in a record. | |
| 198 | /// | |
| 199 | /// This is usually the value returned by `_Alignof` in C, but there are some edge | |
| 200 | /// cases in GCC where `_Alignof` returns a smaller value. | |
| 201 | field_alignment_bits: u32, | |
| 202 | /// The alignment, in bits, of valid pointers to this type. | |
| 203 | /// `size_bits` is a multiple of this value. | |
| 204 | pointer_alignment_bits: u32, | |
| 205 | /// The required alignment of the type in bits. | |
| 206 | /// | |
| 207 | /// This value is only used by MSVC targets. It is 8 on all other | |
| 208 | /// targets. On MSVC targets, this value restricts the effects of `#pragma pack` except | |
| 209 | /// in some cases involving bit-fields. | |
| 210 | required_alignment_bits: u32, | |
| 211 | }; | |
| 212 | ||
| 213 | pub const FieldLayout = struct { | |
| 214 | /// `offset_bits` and `size_bits` should both be INVALID if and only if the field | |
| 215 | /// is an unnamed bitfield. There is no way to reference an unnamed bitfield in C, so | |
| 216 | /// there should be no way to observe these values. If it is used, this value will | |
| 217 | /// maximize the chance that a safety-checked overflow will occur. | |
| 218 | const INVALID = std.math.maxInt(u64); | |
| 219 | ||
| 220 | /// The offset of the field, in bits, from the start of the struct. | |
| 221 | offset_bits: u64 = INVALID, | |
| 222 | /// The size, in bits, of the field. | |
| 223 | /// | |
| 224 | /// For bit-fields, this is the width of the field. | |
| 225 | size_bits: u64 = INVALID, | |
| 226 | ||
| 227 | pub fn isUnnamed(self: FieldLayout) bool { | |
| 228 | return self.offset_bits == INVALID and self.size_bits == INVALID; | |
| 229 | } | |
| 230 | }; | |
| 231 | ||
| 232 | // TODO improve memory usage | |
| 233 | pub const Record = struct { | |
| 234 | fields: []Field, | |
| 235 | type_layout: TypeLayout, | |
| 236 | /// If this is null, none of the fields have attributes | |
| 237 | /// Otherwise, it's a pointer to N items (where N == number of fields) | |
| 238 | /// and the item at index i is the attributes for the field at index i | |
| 239 | field_attributes: ?[*][]const Attribute, | |
| 240 | name: StringId, | |
| 241 | ||
| 242 | pub const Field = struct { | |
| 243 | ty: Type, | |
| 244 | name: StringId, | |
| 245 | /// zero for anonymous fields | |
| 246 | name_tok: TokenIndex = 0, | |
| 247 | bit_width: ?u32 = null, | |
| 248 | layout: FieldLayout = .{ | |
| 249 | .offset_bits = 0, | |
| 250 | .size_bits = 0, | |
| 251 | }, | |
| 252 | ||
| 253 | pub fn isNamed(f: *const Field) bool { | |
| 254 | return f.name_tok != 0; | |
| 255 | } | |
| 256 | ||
| 257 | pub fn isAnonymousRecord(f: Field) bool { | |
| 258 | return !f.isNamed() and f.ty.isRecord(); | |
| 259 | } | |
| 260 | ||
| 261 | /// false for bitfields | |
| 262 | pub fn isRegularField(f: *const Field) bool { | |
| 263 | return f.bit_width == null; | |
| 264 | } | |
| 265 | ||
| 266 | /// bit width as specified in the C source. Asserts that `f` is a bitfield. | |
| 267 | pub fn specifiedBitWidth(f: *const Field) u32 { | |
| 268 | return f.bit_width.?; | |
| 269 | } | |
| 270 | }; | |
| 271 | ||
| 272 | pub fn isIncomplete(r: Record) bool { | |
| 273 | return r.fields.len == std.math.maxInt(usize); | |
| 274 | } | |
| 275 | ||
| 276 | pub fn create(allocator: std.mem.Allocator, name: StringId) !*Record { | |
| 277 | var r = try allocator.create(Record); | |
| 278 | r.name = name; | |
| 279 | r.fields.len = std.math.maxInt(usize); | |
| 280 | r.field_attributes = null; | |
| 281 | r.type_layout = .{ | |
| 282 | .size_bits = 8, | |
| 283 | .field_alignment_bits = 8, | |
| 284 | .pointer_alignment_bits = 8, | |
| 285 | .required_alignment_bits = 8, | |
| 286 | }; | |
| 287 | return r; | |
| 288 | } | |
| 289 | ||
| 290 | pub fn hasFieldOfType(self: *const Record, ty: Type, comp: *const Compilation) bool { | |
| 291 | if (self.isIncomplete()) return false; | |
| 292 | for (self.fields) |f| { | |
| 293 | if (ty.eql(f.ty, comp, false)) return true; | |
| 294 | } | |
| 295 | return false; | |
| 296 | } | |
| 297 | ||
| 298 | pub fn hasField(self: *const Record, name: StringId) bool { | |
| 299 | std.debug.assert(!self.isIncomplete()); | |
| 300 | for (self.fields) |f| { | |
| 301 | if (f.isAnonymousRecord() and f.ty.getRecord().?.hasField(name)) return true; | |
| 302 | if (name == f.name) return true; | |
| 303 | } | |
| 304 | return false; | |
| 305 | } | |
| 306 | }; | |
| 307 | ||
| 308 | pub const Specifier = enum { | |
| 309 | /// A NaN-like poison value | |
| 310 | invalid, | |
| 311 | ||
| 312 | /// GNU auto type | |
| 313 | /// This is a placeholder specifier - it must be replaced by the actual type specifier (determined by the initializer) | |
| 314 | auto_type, | |
| 315 | /// C23 auto, behaves like auto_type | |
| 316 | c23_auto, | |
| 317 | ||
| 318 | void, | |
| 319 | bool, | |
| 320 | ||
| 321 | // integers | |
| 322 | char, | |
| 323 | schar, | |
| 324 | uchar, | |
| 325 | short, | |
| 326 | ushort, | |
| 327 | int, | |
| 328 | uint, | |
| 329 | long, | |
| 330 | ulong, | |
| 331 | long_long, | |
| 332 | ulong_long, | |
| 333 | int128, | |
| 334 | uint128, | |
| 335 | complex_char, | |
| 336 | complex_schar, | |
| 337 | complex_uchar, | |
| 338 | complex_short, | |
| 339 | complex_ushort, | |
| 340 | complex_int, | |
| 341 | complex_uint, | |
| 342 | complex_long, | |
| 343 | complex_ulong, | |
| 344 | complex_long_long, | |
| 345 | complex_ulong_long, | |
| 346 | complex_int128, | |
| 347 | complex_uint128, | |
| 348 | ||
| 349 | // data.int | |
| 350 | bit_int, | |
| 351 | complex_bit_int, | |
| 352 | ||
| 353 | // floating point numbers | |
| 354 | fp16, | |
| 355 | float16, | |
| 356 | float, | |
| 357 | double, | |
| 358 | long_double, | |
| 359 | float128, | |
| 360 | complex_float16, | |
| 361 | complex_float, | |
| 362 | complex_double, | |
| 363 | complex_long_double, | |
| 364 | complex_float128, | |
| 365 | ||
| 366 | // data.sub_type | |
| 367 | pointer, | |
| 368 | unspecified_variable_len_array, | |
| 369 | // data.func | |
| 370 | /// int foo(int bar, char baz) and int (void) | |
| 371 | func, | |
| 372 | /// int foo(int bar, char baz, ...) | |
| 373 | var_args_func, | |
| 374 | /// int foo(bar, baz) and int foo() | |
| 375 | /// is also var args, but we can give warnings about incorrect amounts of parameters | |
| 376 | old_style_func, | |
| 377 | ||
| 378 | // data.array | |
| 379 | array, | |
| 380 | static_array, | |
| 381 | incomplete_array, | |
| 382 | vector, | |
| 383 | // data.expr | |
| 384 | variable_len_array, | |
| 385 | ||
| 386 | // data.record | |
| 387 | @"struct", | |
| 388 | @"union", | |
| 389 | ||
| 390 | // data.enum | |
| 391 | @"enum", | |
| 392 | ||
| 393 | /// typeof(type-name) | |
| 394 | typeof_type, | |
| 395 | ||
| 396 | /// typeof(expression) | |
| 397 | typeof_expr, | |
| 398 | ||
| 399 | /// data.attributed | |
| 400 | attributed, | |
| 401 | ||
| 402 | /// C23 nullptr_t | |
| 403 | nullptr_t, | |
| 404 | }; | |
| 405 | ||
| 406 | const Type = @This(); | |
| 407 | ||
| 408 | /// All fields of Type except data may be mutated | |
| 409 | data: union { | |
| 410 | sub_type: *Type, | |
| 411 | func: *Func, | |
| 412 | array: *Array, | |
| 413 | expr: *Expr, | |
| 414 | @"enum": *Enum, | |
| 415 | record: *Record, | |
| 416 | attributed: *Attributed, | |
| 417 | none: void, | |
| 418 | int: struct { | |
| 419 | bits: u16, | |
| 420 | signedness: std.builtin.Signedness, | |
| 421 | }, | |
| 422 | } = .{ .none = {} }, | |
| 423 | specifier: Specifier, | |
| 424 | qual: Qualifiers = .{}, | |
| 425 | decayed: bool = false, | |
| 426 | /// typedef name, if any | |
| 427 | name: StringId = .empty, | |
| 428 | ||
| 429 | pub const int = Type{ .specifier = .int }; | |
| 430 | pub const invalid = Type{ .specifier = .invalid }; | |
| 431 | ||
| 432 | /// Determine if type matches the given specifier, recursing into typeof | |
| 433 | /// types if necessary. | |
| 434 | pub fn is(ty: Type, specifier: Specifier) bool { | |
| 435 | std.debug.assert(specifier != .typeof_type and specifier != .typeof_expr); | |
| 436 | return ty.get(specifier) != null; | |
| 437 | } | |
| 438 | ||
| 439 | pub fn withAttributes(self: Type, allocator: std.mem.Allocator, attributes: []const Attribute) !Type { | |
| 440 | if (attributes.len == 0) return self; | |
| 441 | const attributed_type = try Type.Attributed.create(allocator, self, attributes); | |
| 442 | return .{ .specifier = .attributed, .data = .{ .attributed = attributed_type }, .decayed = self.decayed }; | |
| 443 | } | |
| 444 | ||
| 445 | pub fn isCallable(ty: Type) ?Type { | |
| 446 | return switch (ty.specifier) { | |
| 447 | .func, .var_args_func, .old_style_func => ty, | |
| 448 | .pointer => if (ty.data.sub_type.isFunc()) ty.data.sub_type.* else null, | |
| 449 | .typeof_type => ty.data.sub_type.isCallable(), | |
| 450 | .typeof_expr => ty.data.expr.ty.isCallable(), | |
| 451 | .attributed => ty.data.attributed.base.isCallable(), | |
| 452 | else => null, | |
| 453 | }; | |
| 454 | } | |
| 455 | ||
| 456 | pub fn isFunc(ty: Type) bool { | |
| 457 | return switch (ty.specifier) { | |
| 458 | .func, .var_args_func, .old_style_func => true, | |
| 459 | .typeof_type => ty.data.sub_type.isFunc(), | |
| 460 | .typeof_expr => ty.data.expr.ty.isFunc(), | |
| 461 | .attributed => ty.data.attributed.base.isFunc(), | |
| 462 | else => false, | |
| 463 | }; | |
| 464 | } | |
| 465 | ||
| 466 | pub fn isArray(ty: Type) bool { | |
| 467 | return switch (ty.specifier) { | |
| 468 | .array, .static_array, .incomplete_array, .variable_len_array, .unspecified_variable_len_array => !ty.isDecayed(), | |
| 469 | .typeof_type => !ty.isDecayed() and ty.data.sub_type.isArray(), | |
| 470 | .typeof_expr => !ty.isDecayed() and ty.data.expr.ty.isArray(), | |
| 471 | .attributed => !ty.isDecayed() and ty.data.attributed.base.isArray(), | |
| 472 | else => false, | |
| 473 | }; | |
| 474 | } | |
| 475 | ||
| 476 | /// Must only be used to set the length of an incomplete array as determined by its initializer | |
| 477 | pub fn setIncompleteArrayLen(ty: *Type, len: u64) void { | |
| 478 | switch (ty.specifier) { | |
| 479 | .incomplete_array => { | |
| 480 | // Modifying .data is exceptionally allowed for .incomplete_array. | |
| 481 | ty.data.array.len = len; | |
| 482 | ty.specifier = .array; | |
| 483 | }, | |
| 484 | ||
| 485 | .typeof_type => ty.data.sub_type.setIncompleteArrayLen(len), | |
| 486 | .typeof_expr => ty.data.expr.ty.setIncompleteArrayLen(len), | |
| 487 | .attributed => ty.data.attributed.base.setIncompleteArrayLen(len), | |
| 488 | ||
| 489 | else => unreachable, | |
| 490 | } | |
| 491 | } | |
| 492 | ||
| 493 | /// Whether the type is promoted if used as a variadic argument or as an argument to a function with no prototype | |
| 494 | fn undergoesDefaultArgPromotion(ty: Type, comp: *const Compilation) bool { | |
| 495 | return switch (ty.specifier) { | |
| 496 | .bool => true, | |
| 497 | .char, .uchar, .schar => true, | |
| 498 | .short, .ushort => true, | |
| 499 | .@"enum" => if (comp.langopts.emulate == .clang) ty.data.@"enum".isIncomplete() else false, | |
| 500 | .float => true, | |
| 501 | ||
| 502 | .typeof_type => ty.data.sub_type.undergoesDefaultArgPromotion(comp), | |
| 503 | .typeof_expr => ty.data.expr.ty.undergoesDefaultArgPromotion(comp), | |
| 504 | .attributed => ty.data.attributed.base.undergoesDefaultArgPromotion(comp), | |
| 505 | else => false, | |
| 506 | }; | |
| 507 | } | |
| 508 | ||
| 509 | pub fn isScalar(ty: Type) bool { | |
| 510 | return ty.isInt() or ty.isScalarNonInt(); | |
| 511 | } | |
| 512 | ||
| 513 | /// To avoid calling isInt() twice for allowable loop/if controlling expressions | |
| 514 | pub fn isScalarNonInt(ty: Type) bool { | |
| 515 | return ty.isFloat() or ty.isPtr() or ty.is(.nullptr_t); | |
| 516 | } | |
| 517 | ||
| 518 | pub fn isDecayed(ty: Type) bool { | |
| 519 | return ty.decayed; | |
| 520 | } | |
| 521 | ||
| 522 | pub fn isPtr(ty: Type) bool { | |
| 523 | return switch (ty.specifier) { | |
| 524 | .pointer => true, | |
| 525 | ||
| 526 | .array, | |
| 527 | .static_array, | |
| 528 | .incomplete_array, | |
| 529 | .variable_len_array, | |
| 530 | .unspecified_variable_len_array, | |
| 531 | => ty.isDecayed(), | |
| 532 | .typeof_type => ty.isDecayed() or ty.data.sub_type.isPtr(), | |
| 533 | .typeof_expr => ty.isDecayed() or ty.data.expr.ty.isPtr(), | |
| 534 | .attributed => ty.isDecayed() or ty.data.attributed.base.isPtr(), | |
| 535 | else => false, | |
| 536 | }; | |
| 537 | } | |
| 538 | ||
| 539 | pub fn isInt(ty: Type) bool { | |
| 540 | return switch (ty.specifier) { | |
| 541 | // zig fmt: off | |
| 542 | .@"enum", .bool, .char, .schar, .uchar, .short, .ushort, .int, .uint, .long, .ulong, | |
| 543 | .long_long, .ulong_long, .int128, .uint128, .complex_char, .complex_schar, .complex_uchar, | |
| 544 | .complex_short, .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, | |
| 545 | .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, | |
| 546 | .bit_int, .complex_bit_int => true, | |
| 547 | // zig fmt: on | |
| 548 | .typeof_type => ty.data.sub_type.isInt(), | |
| 549 | .typeof_expr => ty.data.expr.ty.isInt(), | |
| 550 | .attributed => ty.data.attributed.base.isInt(), | |
| 551 | else => false, | |
| 552 | }; | |
| 553 | } | |
| 554 | ||
| 555 | pub fn isFloat(ty: Type) bool { | |
| 556 | return switch (ty.specifier) { | |
| 557 | // zig fmt: off | |
| 558 | .float, .double, .long_double, .complex_float, .complex_double, .complex_long_double, | |
| 559 | .fp16, .float16, .float128, .complex_float128, .complex_float16 => true, | |
| 560 | // zig fmt: on | |
| 561 | .typeof_type => ty.data.sub_type.isFloat(), | |
| 562 | .typeof_expr => ty.data.expr.ty.isFloat(), | |
| 563 | .attributed => ty.data.attributed.base.isFloat(), | |
| 564 | else => false, | |
| 565 | }; | |
| 566 | } | |
| 567 | ||
| 568 | pub fn isReal(ty: Type) bool { | |
| 569 | return switch (ty.specifier) { | |
| 570 | // zig fmt: off | |
| 571 | .complex_float, .complex_double, .complex_long_double, | |
| 572 | .complex_float128, .complex_char, .complex_schar, .complex_uchar, .complex_short, | |
| 573 | .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, | |
| 574 | .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, | |
| 575 | .complex_bit_int, .complex_float16 => false, | |
| 576 | // zig fmt: on | |
| 577 | .typeof_type => ty.data.sub_type.isReal(), | |
| 578 | .typeof_expr => ty.data.expr.ty.isReal(), | |
| 579 | .attributed => ty.data.attributed.base.isReal(), | |
| 580 | else => true, | |
| 581 | }; | |
| 582 | } | |
| 583 | ||
| 584 | pub fn isComplex(ty: Type) bool { | |
| 585 | return switch (ty.specifier) { | |
| 586 | // zig fmt: off | |
| 587 | .complex_float, .complex_double, .complex_long_double, | |
| 588 | .complex_float128, .complex_char, .complex_schar, .complex_uchar, .complex_short, | |
| 589 | .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, | |
| 590 | .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, | |
| 591 | .complex_bit_int, .complex_float16 => true, | |
| 592 | // zig fmt: on | |
| 593 | .typeof_type => ty.data.sub_type.isComplex(), | |
| 594 | .typeof_expr => ty.data.expr.ty.isComplex(), | |
| 595 | .attributed => ty.data.attributed.base.isComplex(), | |
| 596 | else => false, | |
| 597 | }; | |
| 598 | } | |
| 599 | ||
| 600 | pub fn isVoidStar(ty: Type) bool { | |
| 601 | return switch (ty.specifier) { | |
| 602 | .pointer => ty.data.sub_type.specifier == .void, | |
| 603 | .typeof_type => ty.data.sub_type.isVoidStar(), | |
| 604 | .typeof_expr => ty.data.expr.ty.isVoidStar(), | |
| 605 | .attributed => ty.data.attributed.base.isVoidStar(), | |
| 606 | else => false, | |
| 607 | }; | |
| 608 | } | |
| 609 | ||
| 610 | pub fn isTypeof(ty: Type) bool { | |
| 611 | return switch (ty.specifier) { | |
| 612 | .typeof_type, .typeof_expr => true, | |
| 613 | else => false, | |
| 614 | }; | |
| 615 | } | |
| 616 | ||
| 617 | pub fn isConst(ty: Type) bool { | |
| 618 | return switch (ty.specifier) { | |
| 619 | .typeof_type => ty.qual.@"const" or ty.data.sub_type.isConst(), | |
| 620 | .typeof_expr => ty.qual.@"const" or ty.data.expr.ty.isConst(), | |
| 621 | .attributed => ty.data.attributed.base.isConst(), | |
| 622 | else => ty.qual.@"const", | |
| 623 | }; | |
| 624 | } | |
| 625 | ||
| 626 | pub fn isUnsignedInt(ty: Type, comp: *const Compilation) bool { | |
| 627 | return ty.signedness(comp) == .unsigned; | |
| 628 | } | |
| 629 | ||
| 630 | pub fn signedness(ty: Type, comp: *const Compilation) std.builtin.Signedness { | |
| 631 | return switch (ty.specifier) { | |
| 632 | // zig fmt: off | |
| 633 | .char, .complex_char => return comp.getCharSignedness(), | |
| 634 | .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128, .bool, .complex_uchar, .complex_ushort, | |
| 635 | .complex_uint, .complex_ulong, .complex_ulong_long, .complex_uint128 => .unsigned, | |
| 636 | // zig fmt: on | |
| 637 | .bit_int, .complex_bit_int => ty.data.int.signedness, | |
| 638 | .typeof_type => ty.data.sub_type.signedness(comp), | |
| 639 | .typeof_expr => ty.data.expr.ty.signedness(comp), | |
| 640 | .attributed => ty.data.attributed.base.signedness(comp), | |
| 641 | else => .signed, | |
| 642 | }; | |
| 643 | } | |
| 644 | ||
| 645 | pub fn isEnumOrRecord(ty: Type) bool { | |
| 646 | return switch (ty.specifier) { | |
| 647 | .@"enum", .@"struct", .@"union" => true, | |
| 648 | .typeof_type => ty.data.sub_type.isEnumOrRecord(), | |
| 649 | .typeof_expr => ty.data.expr.ty.isEnumOrRecord(), | |
| 650 | .attributed => ty.data.attributed.base.isEnumOrRecord(), | |
| 651 | else => false, | |
| 652 | }; | |
| 653 | } | |
| 654 | ||
| 655 | pub fn isRecord(ty: Type) bool { | |
| 656 | return switch (ty.specifier) { | |
| 657 | .@"struct", .@"union" => true, | |
| 658 | .typeof_type => ty.data.sub_type.isRecord(), | |
| 659 | .typeof_expr => ty.data.expr.ty.isRecord(), | |
| 660 | .attributed => ty.data.attributed.base.isRecord(), | |
| 661 | else => false, | |
| 662 | }; | |
| 663 | } | |
| 664 | ||
| 665 | pub fn isAnonymousRecord(ty: Type, comp: *const Compilation) bool { | |
| 666 | return switch (ty.specifier) { | |
| 667 | // anonymous records can be recognized by their names which are in | |
| 668 | // the format "(anonymous TAG at path:line:col)". | |
| 669 | .@"struct", .@"union" => { | |
| 670 | const mapper = comp.string_interner.getSlowTypeMapper(); | |
| 671 | return mapper.lookup(ty.data.record.name)[0] == '('; | |
| 672 | }, | |
| 673 | .typeof_type => ty.data.sub_type.isAnonymousRecord(comp), | |
| 674 | .typeof_expr => ty.data.expr.ty.isAnonymousRecord(comp), | |
| 675 | .attributed => ty.data.attributed.base.isAnonymousRecord(comp), | |
| 676 | else => false, | |
| 677 | }; | |
| 678 | } | |
| 679 | ||
| 680 | pub fn elemType(ty: Type) Type { | |
| 681 | return switch (ty.specifier) { | |
| 682 | .pointer, .unspecified_variable_len_array => ty.data.sub_type.*, | |
| 683 | .array, .static_array, .incomplete_array, .vector => ty.data.array.elem, | |
| 684 | .variable_len_array => ty.data.expr.ty, | |
| 685 | .typeof_type, .typeof_expr => { | |
| 686 | const unwrapped = ty.canonicalize(.preserve_quals); | |
| 687 | var elem = unwrapped.elemType(); | |
| 688 | elem.qual = elem.qual.mergeAll(unwrapped.qual); | |
| 689 | return elem; | |
| 690 | }, | |
| 691 | .attributed => ty.data.attributed.base.elemType(), | |
| 692 | .invalid => Type.invalid, | |
| 693 | // zig fmt: off | |
| 694 | .complex_float, .complex_double, .complex_long_double, | |
| 695 | .complex_float128, .complex_char, .complex_schar, .complex_uchar, .complex_short, | |
| 696 | .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, | |
| 697 | .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, | |
| 698 | .complex_bit_int, .complex_float16 => ty.makeReal(), | |
| 699 | // zig fmt: on | |
| 700 | else => unreachable, | |
| 701 | }; | |
| 702 | } | |
| 703 | ||
| 704 | pub fn returnType(ty: Type) Type { | |
| 705 | return switch (ty.specifier) { | |
| 706 | .func, .var_args_func, .old_style_func => ty.data.func.return_type, | |
| 707 | .typeof_type => ty.data.sub_type.returnType(), | |
| 708 | .typeof_expr => ty.data.expr.ty.returnType(), | |
| 709 | .attributed => ty.data.attributed.base.returnType(), | |
| 710 | .invalid => Type.invalid, | |
| 711 | else => unreachable, | |
| 712 | }; | |
| 713 | } | |
| 714 | ||
| 715 | pub fn params(ty: Type) []Func.Param { | |
| 716 | return switch (ty.specifier) { | |
| 717 | .func, .var_args_func, .old_style_func => ty.data.func.params, | |
| 718 | .typeof_type => ty.data.sub_type.params(), | |
| 719 | .typeof_expr => ty.data.expr.ty.params(), | |
| 720 | .attributed => ty.data.attributed.base.params(), | |
| 721 | .invalid => &.{}, | |
| 722 | else => unreachable, | |
| 723 | }; | |
| 724 | } | |
| 725 | ||
| 726 | /// Returns true if the return value or any param of `ty` is `.invalid` | |
| 727 | /// Asserts that ty is a function type | |
| 728 | pub fn isInvalidFunc(ty: Type) bool { | |
| 729 | if (ty.returnType().is(.invalid)) return true; | |
| 730 | for (ty.params()) |param| { | |
| 731 | if (param.ty.is(.invalid)) return true; | |
| 732 | } | |
| 733 | return false; | |
| 734 | } | |
| 735 | ||
| 736 | pub fn arrayLen(ty: Type) ?u64 { | |
| 737 | return switch (ty.specifier) { | |
| 738 | .array, .static_array => ty.data.array.len, | |
| 739 | .typeof_type => ty.data.sub_type.arrayLen(), | |
| 740 | .typeof_expr => ty.data.expr.ty.arrayLen(), | |
| 741 | .attributed => ty.data.attributed.base.arrayLen(), | |
| 742 | else => null, | |
| 743 | }; | |
| 744 | } | |
| 745 | ||
| 746 | /// Complex numbers are scalars but they can be initialized with a 2-element initList | |
| 747 | pub fn expectedInitListSize(ty: Type) ?u64 { | |
| 748 | return if (ty.isComplex()) 2 else ty.arrayLen(); | |
| 749 | } | |
| 750 | ||
| 751 | pub fn anyQual(ty: Type) bool { | |
| 752 | return switch (ty.specifier) { | |
| 753 | .typeof_type => ty.qual.any() or ty.data.sub_type.anyQual(), | |
| 754 | .typeof_expr => ty.qual.any() or ty.data.expr.ty.anyQual(), | |
| 755 | else => ty.qual.any(), | |
| 756 | }; | |
| 757 | } | |
| 758 | ||
| 759 | pub fn getRecord(ty: Type) ?*const Type.Record { | |
| 760 | return switch (ty.specifier) { | |
| 761 | .attributed => ty.data.attributed.base.getRecord(), | |
| 762 | .typeof_type => ty.data.sub_type.getRecord(), | |
| 763 | .typeof_expr => ty.data.expr.ty.getRecord(), | |
| 764 | .@"struct", .@"union" => ty.data.record, | |
| 765 | else => null, | |
| 766 | }; | |
| 767 | } | |
| 768 | ||
| 769 | pub fn compareIntegerRanks(a: Type, b: Type, comp: *const Compilation) std.math.Order { | |
| 770 | std.debug.assert(a.isInt() and b.isInt()); | |
| 771 | if (a.eql(b, comp, false)) return .eq; | |
| 772 | ||
| 773 | const a_unsigned = a.isUnsignedInt(comp); | |
| 774 | const b_unsigned = b.isUnsignedInt(comp); | |
| 775 | ||
| 776 | const a_rank = a.integerRank(comp); | |
| 777 | const b_rank = b.integerRank(comp); | |
| 778 | if (a_unsigned == b_unsigned) { | |
| 779 | return std.math.order(a_rank, b_rank); | |
| 780 | } | |
| 781 | if (a_unsigned) { | |
| 782 | if (a_rank >= b_rank) return .gt; | |
| 783 | return .lt; | |
| 784 | } | |
| 785 | std.debug.assert(b_unsigned); | |
| 786 | if (b_rank >= a_rank) return .lt; | |
| 787 | return .gt; | |
| 788 | } | |
| 789 | ||
| 790 | fn realIntegerConversion(a: Type, b: Type, comp: *const Compilation) Type { | |
| 791 | std.debug.assert(a.isReal() and b.isReal()); | |
| 792 | const type_order = a.compareIntegerRanks(b, comp); | |
| 793 | const a_signed = !a.isUnsignedInt(comp); | |
| 794 | const b_signed = !b.isUnsignedInt(comp); | |
| 795 | if (a_signed == b_signed) { | |
| 796 | // If both have the same sign, use higher-rank type. | |
| 797 | return switch (type_order) { | |
| 798 | .lt => b, | |
| 799 | .eq, .gt => a, | |
| 800 | }; | |
| 801 | } else if (type_order != if (a_signed) std.math.Order.gt else std.math.Order.lt) { | |
| 802 | // Only one is signed; and the unsigned type has rank >= the signed type | |
| 803 | // Use the unsigned type | |
| 804 | return if (b_signed) a else b; | |
| 805 | } else if (a.bitSizeof(comp).? != b.bitSizeof(comp).?) { | |
| 806 | // Signed type is higher rank and sizes are not equal | |
| 807 | // Use the signed type | |
| 808 | return if (a_signed) a else b; | |
| 809 | } else { | |
| 810 | // Signed type is higher rank but same size as unsigned type | |
| 811 | // e.g. `long` and `unsigned` on x86-linux-gnu | |
| 812 | // Use unsigned version of the signed type | |
| 813 | return if (a_signed) a.makeIntegerUnsigned() else b.makeIntegerUnsigned(); | |
| 814 | } | |
| 815 | } | |
| 816 | ||
| 817 | pub fn makeIntegerUnsigned(ty: Type) Type { | |
| 818 | // TODO discards attributed/typeof | |
| 819 | var base_ty = ty.canonicalize(.standard); | |
| 820 | switch (base_ty.specifier) { | |
| 821 | // zig fmt: off | |
| 822 | .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128, | |
| 823 | .complex_uchar, .complex_ushort, .complex_uint, .complex_ulong, .complex_ulong_long, .complex_uint128, | |
| 824 | => return ty, | |
| 825 | // zig fmt: on | |
| 826 | ||
| 827 | .char, .complex_char => { | |
| 828 | base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 2); | |
| 829 | return base_ty; | |
| 830 | }, | |
| 831 | ||
| 832 | // zig fmt: off | |
| 833 | .schar, .short, .int, .long, .long_long, .int128, | |
| 834 | .complex_schar, .complex_short, .complex_int, .complex_long, .complex_long_long, .complex_int128 => { | |
| 835 | base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 1); | |
| 836 | return base_ty; | |
| 837 | }, | |
| 838 | // zig fmt: on | |
| 839 | ||
| 840 | .bit_int, .complex_bit_int => { | |
| 841 | base_ty.data.int.signedness = .unsigned; | |
| 842 | return base_ty; | |
| 843 | }, | |
| 844 | else => unreachable, | |
| 845 | } | |
| 846 | } | |
| 847 | ||
| 848 | /// Find the common type of a and b for binary operations | |
| 849 | pub fn integerConversion(a: Type, b: Type, comp: *const Compilation) Type { | |
| 850 | const a_real = a.isReal(); | |
| 851 | const b_real = b.isReal(); | |
| 852 | const target_ty = a.makeReal().realIntegerConversion(b.makeReal(), comp); | |
| 853 | return if (a_real and b_real) target_ty else target_ty.makeComplex(); | |
| 854 | } | |
| 855 | ||
| 856 | pub fn integerPromotion(ty: Type, comp: *Compilation) Type { | |
| 857 | var specifier = ty.specifier; | |
| 858 | switch (specifier) { | |
| 859 | .@"enum" => { | |
| 860 | if (ty.hasIncompleteSize()) return .{ .specifier = .int }; | |
| 861 | if (ty.data.@"enum".fixed) return ty.data.@"enum".tag_ty.integerPromotion(comp); | |
| 862 | ||
| 863 | specifier = ty.data.@"enum".tag_ty.specifier; | |
| 864 | }, | |
| 865 | .bit_int, .complex_bit_int => return .{ .specifier = specifier, .data = ty.data }, | |
| 866 | else => {}, | |
| 867 | } | |
| 868 | return switch (specifier) { | |
| 869 | else => .{ | |
| 870 | .specifier = switch (specifier) { | |
| 871 | // zig fmt: off | |
| 872 | .bool, .char, .schar, .uchar, .short => .int, | |
| 873 | .ushort => if (ty.sizeof(comp).? == sizeof(.{ .specifier = .int }, comp)) Specifier.uint else .int, | |
| 874 | .int, .uint, .long, .ulong, .long_long, .ulong_long, .int128, .uint128, .complex_char, | |
| 875 | .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, | |
| 876 | .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, | |
| 877 | .complex_int128, .complex_uint128 => specifier, | |
| 878 | // zig fmt: on | |
| 879 | .typeof_type => return ty.data.sub_type.integerPromotion(comp), | |
| 880 | .typeof_expr => return ty.data.expr.ty.integerPromotion(comp), | |
| 881 | .attributed => return ty.data.attributed.base.integerPromotion(comp), | |
| 882 | .invalid => .invalid, | |
| 883 | else => unreachable, // _BitInt, or not an integer type | |
| 884 | }, | |
| 885 | }, | |
| 886 | }; | |
| 887 | } | |
| 888 | ||
| 889 | /// Promote a bitfield. If `int` can hold all the values of the underlying field, | |
| 890 | /// promote to int. Otherwise, promote to unsigned int | |
| 891 | /// Returns null if no promotion is necessary | |
| 892 | pub fn bitfieldPromotion(ty: Type, comp: *Compilation, width: u32) ?Type { | |
| 893 | const type_size_bits = ty.bitSizeof(comp).?; | |
| 894 | ||
| 895 | // Note: GCC and clang will promote `long: 3` to int even though the C standard does not allow this | |
| 896 | if (width < type_size_bits) { | |
| 897 | return int; | |
| 898 | } | |
| 899 | ||
| 900 | if (width == type_size_bits) { | |
| 901 | return if (ty.isUnsignedInt(comp)) .{ .specifier = .uint } else int; | |
| 902 | } | |
| 903 | ||
| 904 | return null; | |
| 905 | } | |
| 906 | ||
| 907 | pub fn hasIncompleteSize(ty: Type) bool { | |
| 908 | if (ty.isDecayed()) return false; | |
| 909 | return switch (ty.specifier) { | |
| 910 | .void, .incomplete_array => true, | |
| 911 | .@"enum" => ty.data.@"enum".isIncomplete() and !ty.data.@"enum".fixed, | |
| 912 | .@"struct", .@"union" => ty.data.record.isIncomplete(), | |
| 913 | .array, .static_array => ty.data.array.elem.hasIncompleteSize(), | |
| 914 | .typeof_type => ty.data.sub_type.hasIncompleteSize(), | |
| 915 | .typeof_expr, .variable_len_array => ty.data.expr.ty.hasIncompleteSize(), | |
| 916 | .unspecified_variable_len_array => ty.data.sub_type.hasIncompleteSize(), | |
| 917 | .attributed => ty.data.attributed.base.hasIncompleteSize(), | |
| 918 | else => false, | |
| 919 | }; | |
| 920 | } | |
| 921 | ||
| 922 | pub fn hasUnboundVLA(ty: Type) bool { | |
| 923 | var cur = ty; | |
| 924 | while (true) { | |
| 925 | switch (cur.specifier) { | |
| 926 | .unspecified_variable_len_array => return true, | |
| 927 | .array, | |
| 928 | .static_array, | |
| 929 | .incomplete_array, | |
| 930 | .variable_len_array, | |
| 931 | => cur = cur.elemType(), | |
| 932 | .typeof_type => cur = cur.data.sub_type.*, | |
| 933 | .typeof_expr => cur = cur.data.expr.ty, | |
| 934 | .attributed => cur = cur.data.attributed.base, | |
| 935 | else => return false, | |
| 936 | } | |
| 937 | } | |
| 938 | } | |
| 939 | ||
| 940 | pub fn hasField(ty: Type, name: StringId) bool { | |
| 941 | return ty.getRecord().?.hasField(name); | |
| 942 | } | |
| 943 | ||
| 944 | const TypeSizeOrder = enum { | |
| 945 | lt, | |
| 946 | gt, | |
| 947 | eq, | |
| 948 | indeterminate, | |
| 949 | }; | |
| 950 | ||
| 951 | pub fn sizeCompare(a: Type, b: Type, comp: *Compilation) TypeSizeOrder { | |
| 952 | const a_size = a.sizeof(comp) orelse return .indeterminate; | |
| 953 | const b_size = b.sizeof(comp) orelse return .indeterminate; | |
| 954 | return switch (std.math.order(a_size, b_size)) { | |
| 955 | .lt => .lt, | |
| 956 | .gt => .gt, | |
| 957 | .eq => .eq, | |
| 958 | }; | |
| 959 | } | |
| 960 | ||
| 961 | /// Size of type as reported by sizeof | |
| 962 | pub fn sizeof(ty: Type, comp: *const Compilation) ?u64 { | |
| 963 | if (ty.isPtr()) return comp.target.ptrBitWidth() / 8; | |
| 964 | ||
| 965 | return switch (ty.specifier) { | |
| 966 | .auto_type, .c23_auto => unreachable, | |
| 967 | .variable_len_array, .unspecified_variable_len_array => null, | |
| 968 | .incomplete_array => return if (comp.langopts.emulate == .msvc) @as(?u64, 0) else null, | |
| 969 | .func, .var_args_func, .old_style_func, .void, .bool => 1, | |
| 970 | .char, .schar, .uchar => 1, | |
| 971 | .short => comp.target.cTypeByteSize(.short), | |
| 972 | .ushort => comp.target.cTypeByteSize(.ushort), | |
| 973 | .int => comp.target.cTypeByteSize(.int), | |
| 974 | .uint => comp.target.cTypeByteSize(.uint), | |
| 975 | .long => comp.target.cTypeByteSize(.long), | |
| 976 | .ulong => comp.target.cTypeByteSize(.ulong), | |
| 977 | .long_long => comp.target.cTypeByteSize(.longlong), | |
| 978 | .ulong_long => comp.target.cTypeByteSize(.ulonglong), | |
| 979 | .long_double => comp.target.cTypeByteSize(.longdouble), | |
| 980 | .int128, .uint128 => 16, | |
| 981 | .fp16, .float16 => 2, | |
| 982 | .float => comp.target.cTypeByteSize(.float), | |
| 983 | .double => comp.target.cTypeByteSize(.double), | |
| 984 | .float128 => 16, | |
| 985 | .bit_int => { | |
| 986 | return std.mem.alignForward(u64, (@as(u32, ty.data.int.bits) + 7) / 8, ty.alignof(comp)); | |
| 987 | }, | |
| 988 | // zig fmt: off | |
| 989 | .complex_char, .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, | |
| 990 | .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, | |
| 991 | .complex_int128, .complex_uint128, .complex_float, .complex_double, | |
| 992 | .complex_long_double, .complex_float128, .complex_bit_int, .complex_float16, | |
| 993 | => return 2 * ty.makeReal().sizeof(comp).?, | |
| 994 | // zig fmt: on | |
| 995 | .pointer => unreachable, | |
| 996 | .static_array, | |
| 997 | .nullptr_t, | |
| 998 | => comp.target.ptrBitWidth() / 8, | |
| 999 | .array, .vector => { | |
| 1000 | const size = ty.data.array.elem.sizeof(comp) orelse return null; | |
| 1001 | const arr_size = size * ty.data.array.len; | |
| 1002 | if (comp.langopts.emulate == .msvc) { | |
| 1003 | // msvc ignores array type alignment. | |
| 1004 | // Since the size might not be a multiple of the field | |
| 1005 | // alignment, the address of the second element might not be properly aligned | |
| 1006 | // for the field alignment. A flexible array has size 0. See test case 0018. | |
| 1007 | return arr_size; | |
| 1008 | } else { | |
| 1009 | return std.mem.alignForward(u64, arr_size, ty.alignof(comp)); | |
| 1010 | } | |
| 1011 | }, | |
| 1012 | .@"struct", .@"union" => if (ty.data.record.isIncomplete()) null else @as(u64, ty.data.record.type_layout.size_bits / 8), | |
| 1013 | .@"enum" => if (ty.data.@"enum".isIncomplete() and !ty.data.@"enum".fixed) null else ty.data.@"enum".tag_ty.sizeof(comp), | |
| 1014 | .typeof_type => ty.data.sub_type.sizeof(comp), | |
| 1015 | .typeof_expr => ty.data.expr.ty.sizeof(comp), | |
| 1016 | .attributed => ty.data.attributed.base.sizeof(comp), | |
| 1017 | .invalid => return null, | |
| 1018 | }; | |
| 1019 | } | |
| 1020 | ||
| 1021 | pub fn bitSizeof(ty: Type, comp: *const Compilation) ?u64 { | |
| 1022 | return switch (ty.specifier) { | |
| 1023 | .bool => if (comp.langopts.emulate == .msvc) @as(u64, 8) else 1, | |
| 1024 | .typeof_type => ty.data.sub_type.bitSizeof(comp), | |
| 1025 | .typeof_expr => ty.data.expr.ty.bitSizeof(comp), | |
| 1026 | .attributed => ty.data.attributed.base.bitSizeof(comp), | |
| 1027 | .bit_int => return ty.data.int.bits, | |
| 1028 | .long_double => comp.target.cTypeBitSize(.longdouble), | |
| 1029 | else => 8 * (ty.sizeof(comp) orelse return null), | |
| 1030 | }; | |
| 1031 | } | |
| 1032 | ||
| 1033 | pub fn alignable(ty: Type) bool { | |
| 1034 | return (ty.isArray() or !ty.hasIncompleteSize() or ty.is(.void)) and !ty.is(.invalid); | |
| 1035 | } | |
| 1036 | ||
| 1037 | /// Get the alignment of a type | |
| 1038 | pub fn alignof(ty: Type, comp: *const Compilation) u29 { | |
| 1039 | // don't return the attribute for records | |
| 1040 | // layout has already accounted for requested alignment | |
| 1041 | if (ty.requestedAlignment(comp)) |requested| { | |
| 1042 | // gcc does not respect alignment on enums | |
| 1043 | if (ty.get(.@"enum")) |ty_enum| { | |
| 1044 | if (comp.langopts.emulate == .gcc) { | |
| 1045 | return ty_enum.alignof(comp); | |
| 1046 | } | |
| 1047 | } else if (ty.getRecord()) |rec| { | |
| 1048 | if (ty.hasIncompleteSize()) return 0; | |
| 1049 | const computed: u29 = @intCast(@divExact(rec.type_layout.field_alignment_bits, 8)); | |
| 1050 | return @max(requested, computed); | |
| 1051 | } else if (comp.langopts.emulate == .msvc) { | |
| 1052 | const type_align = ty.data.attributed.base.alignof(comp); | |
| 1053 | return @max(requested, type_align); | |
| 1054 | } | |
| 1055 | return requested; | |
| 1056 | } | |
| 1057 | ||
| 1058 | return switch (ty.specifier) { | |
| 1059 | .invalid => unreachable, | |
| 1060 | .auto_type, .c23_auto => unreachable, | |
| 1061 | ||
| 1062 | .variable_len_array, | |
| 1063 | .incomplete_array, | |
| 1064 | .unspecified_variable_len_array, | |
| 1065 | .array, | |
| 1066 | .vector, | |
| 1067 | => if (ty.isPtr()) switch (comp.target.cpu.arch) { | |
| 1068 | .avr => 1, | |
| 1069 | else => comp.target.ptrBitWidth() / 8, | |
| 1070 | } else ty.elemType().alignof(comp), | |
| 1071 | .func, .var_args_func, .old_style_func => target_util.defaultFunctionAlignment(comp.target), | |
| 1072 | .char, .schar, .uchar, .void, .bool => 1, | |
| 1073 | ||
| 1074 | // zig fmt: off | |
| 1075 | .complex_char, .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, | |
| 1076 | .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, | |
| 1077 | .complex_int128, .complex_uint128, .complex_float, .complex_double, | |
| 1078 | .complex_long_double, .complex_float128, .complex_bit_int, .complex_float16, | |
| 1079 | => return ty.makeReal().alignof(comp), | |
| 1080 | // zig fmt: on | |
| 1081 | ||
| 1082 | .short => comp.target.cTypeAlignment(.short), | |
| 1083 | .ushort => comp.target.cTypeAlignment(.ushort), | |
| 1084 | .int => comp.target.cTypeAlignment(.int), | |
| 1085 | .uint => comp.target.cTypeAlignment(.uint), | |
| 1086 | ||
| 1087 | .long => comp.target.cTypeAlignment(.long), | |
| 1088 | .ulong => comp.target.cTypeAlignment(.ulong), | |
| 1089 | .long_long => comp.target.cTypeAlignment(.longlong), | |
| 1090 | .ulong_long => comp.target.cTypeAlignment(.ulonglong), | |
| 1091 | ||
| 1092 | .bit_int => { | |
| 1093 | // https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2709.pdf | |
| 1094 | // _BitInt(N) types align with existing calling conventions. They have the same size and alignment as the | |
| 1095 | // smallest basic type that can contain them. Types that are larger than __int64_t are conceptually treated | |
| 1096 | // as struct of register size chunks. The number of chunks is the smallest number that can contain the type. | |
| 1097 | if (ty.data.int.bits > 64) return 8; | |
| 1098 | const basic_type = comp.intLeastN(ty.data.int.bits, ty.data.int.signedness); | |
| 1099 | return basic_type.alignof(comp); | |
| 1100 | }, | |
| 1101 | ||
| 1102 | .float => comp.target.cTypeAlignment(.float), | |
| 1103 | .double => comp.target.cTypeAlignment(.double), | |
| 1104 | .long_double => comp.target.cTypeAlignment(.longdouble), | |
| 1105 | ||
| 1106 | .int128, .uint128 => if (comp.target.cpu.arch == .s390x and comp.target.os.tag == .linux and comp.target.abi.isGnu()) 8 else 16, | |
| 1107 | .fp16, .float16 => 2, | |
| 1108 | ||
| 1109 | .float128 => 16, | |
| 1110 | .pointer, | |
| 1111 | .static_array, | |
| 1112 | .nullptr_t, | |
| 1113 | => switch (comp.target.cpu.arch) { | |
| 1114 | .avr => 1, | |
| 1115 | else => comp.target.ptrBitWidth() / 8, | |
| 1116 | }, | |
| 1117 | .@"struct", .@"union" => if (ty.data.record.isIncomplete()) 0 else @intCast(ty.data.record.type_layout.field_alignment_bits / 8), | |
| 1118 | .@"enum" => if (ty.data.@"enum".isIncomplete() and !ty.data.@"enum".fixed) 0 else ty.data.@"enum".tag_ty.alignof(comp), | |
| 1119 | .typeof_type => ty.data.sub_type.alignof(comp), | |
| 1120 | .typeof_expr => ty.data.expr.ty.alignof(comp), | |
| 1121 | .attributed => ty.data.attributed.base.alignof(comp), | |
| 1122 | }; | |
| 1123 | } | |
| 1124 | ||
| 1125 | // This enum should be kept public because it is used by the downstream zig translate-c | |
| 1126 | pub const QualHandling = enum { | |
| 1127 | standard, | |
| 1128 | preserve_quals, | |
| 1129 | }; | |
| 1130 | ||
| 1131 | /// Canonicalize a possibly-typeof() type. If the type is not a typeof() type, simply | |
| 1132 | /// return it. Otherwise, determine the actual qualified type. | |
| 1133 | /// The `qual_handling` parameter can be used to return the full set of qualifiers | |
| 1134 | /// added by typeof() operations, which is useful when determining the elemType of | |
| 1135 | /// arrays and pointers. | |
| 1136 | pub fn canonicalize(ty: Type, qual_handling: QualHandling) Type { | |
| 1137 | var cur = ty; | |
| 1138 | var qual = cur.qual; | |
| 1139 | while (true) { | |
| 1140 | switch (cur.specifier) { | |
| 1141 | .typeof_type => cur = cur.data.sub_type.*, | |
| 1142 | .typeof_expr => cur = cur.data.expr.ty, | |
| 1143 | .attributed => cur = cur.data.attributed.base, | |
| 1144 | else => break, | |
| 1145 | } | |
| 1146 | qual = qual.mergeAll(cur.qual); | |
| 1147 | } | |
| 1148 | if ((cur.isArray() or cur.isPtr()) and qual_handling == .standard) { | |
| 1149 | cur.qual = .{}; | |
| 1150 | } else { | |
| 1151 | cur.qual = qual; | |
| 1152 | } | |
| 1153 | cur.decayed = ty.decayed; | |
| 1154 | return cur; | |
| 1155 | } | |
| 1156 | ||
| 1157 | pub fn get(ty: *const Type, specifier: Specifier) ?*const Type { | |
| 1158 | std.debug.assert(specifier != .typeof_type and specifier != .typeof_expr); | |
| 1159 | return switch (ty.specifier) { | |
| 1160 | .typeof_type => ty.data.sub_type.get(specifier), | |
| 1161 | .typeof_expr => ty.data.expr.ty.get(specifier), | |
| 1162 | .attributed => ty.data.attributed.base.get(specifier), | |
| 1163 | else => if (ty.specifier == specifier) ty else null, | |
| 1164 | }; | |
| 1165 | } | |
| 1166 | ||
| 1167 | pub fn requestedAlignment(ty: Type, comp: *const Compilation) ?u29 { | |
| 1168 | return switch (ty.specifier) { | |
| 1169 | .typeof_type => ty.data.sub_type.requestedAlignment(comp), | |
| 1170 | .typeof_expr => ty.data.expr.ty.requestedAlignment(comp), | |
| 1171 | .attributed => annotationAlignment(comp, Attribute.Iterator.initType(ty)), | |
| 1172 | else => null, | |
| 1173 | }; | |
| 1174 | } | |
| 1175 | ||
| 1176 | pub fn enumIsPacked(ty: Type, comp: *const Compilation) bool { | |
| 1177 | std.debug.assert(ty.is(.@"enum")); | |
| 1178 | return comp.langopts.short_enums or target_util.packAllEnums(comp.target) or ty.hasAttribute(.@"packed"); | |
| 1179 | } | |
| 1180 | ||
| 1181 | pub fn getName(ty: Type) StringId { | |
| 1182 | return switch (ty.specifier) { | |
| 1183 | .typeof_type => if (ty.name == .empty) ty.data.sub_type.getName() else ty.name, | |
| 1184 | .typeof_expr => if (ty.name == .empty) ty.data.expr.ty.getName() else ty.name, | |
| 1185 | .attributed => if (ty.name == .empty) ty.data.attributed.base.getName() else ty.name, | |
| 1186 | else => ty.name, | |
| 1187 | }; | |
| 1188 | } | |
| 1189 | ||
| 1190 | pub fn annotationAlignment(comp: *const Compilation, attrs: Attribute.Iterator) ?u29 { | |
| 1191 | var it = attrs; | |
| 1192 | var max_requested: ?u29 = null; | |
| 1193 | var last_aligned_index: ?usize = null; | |
| 1194 | while (it.next()) |item| { | |
| 1195 | const attribute, const index = item; | |
| 1196 | if (attribute.tag != .aligned) continue; | |
| 1197 | if (last_aligned_index) |aligned_index| { | |
| 1198 | // once we recurse into a new type, after an `aligned` attribute was found, we're done | |
| 1199 | if (index <= aligned_index) break; | |
| 1200 | } | |
| 1201 | last_aligned_index = index; | |
| 1202 | const requested = if (attribute.args.aligned.alignment) |alignment| alignment.requested else target_util.defaultAlignment(comp.target); | |
| 1203 | if (max_requested == null or max_requested.? < requested) { | |
| 1204 | max_requested = requested; | |
| 1205 | } | |
| 1206 | } | |
| 1207 | return max_requested; | |
| 1208 | } | |
| 1209 | ||
| 1210 | pub fn eql(a_param: Type, b_param: Type, comp: *const Compilation, check_qualifiers: bool) bool { | |
| 1211 | const a = a_param.canonicalize(.standard); | |
| 1212 | const b = b_param.canonicalize(.standard); | |
| 1213 | ||
| 1214 | if (a.specifier == .invalid or b.specifier == .invalid) return false; | |
| 1215 | if (a.alignof(comp) != b.alignof(comp)) return false; | |
| 1216 | if (a.isPtr()) { | |
| 1217 | if (!b.isPtr()) return false; | |
| 1218 | } else if (a.isFunc()) { | |
| 1219 | if (!b.isFunc()) return false; | |
| 1220 | } else if (a.isArray()) { | |
| 1221 | if (!b.isArray()) return false; | |
| 1222 | } else if (a.specifier == .@"enum" and b.specifier != .@"enum") { | |
| 1223 | return a.data.@"enum".tag_ty.eql(b, comp, check_qualifiers); | |
| 1224 | } else if (b.specifier == .@"enum" and a.specifier != .@"enum") { | |
| 1225 | return a.eql(b.data.@"enum".tag_ty, comp, check_qualifiers); | |
| 1226 | } else if (a.specifier != b.specifier) return false; | |
| 1227 | ||
| 1228 | if (a.qual.atomic != b.qual.atomic) return false; | |
| 1229 | if (check_qualifiers) { | |
| 1230 | if (a.qual.@"const" != b.qual.@"const") return false; | |
| 1231 | if (a.qual.@"volatile" != b.qual.@"volatile") return false; | |
| 1232 | } | |
| 1233 | ||
| 1234 | if (a.isPtr()) { | |
| 1235 | return a_param.elemType().eql(b_param.elemType(), comp, check_qualifiers); | |
| 1236 | } | |
| 1237 | switch (a.specifier) { | |
| 1238 | .pointer => unreachable, | |
| 1239 | ||
| 1240 | .func, | |
| 1241 | .var_args_func, | |
| 1242 | .old_style_func, | |
| 1243 | => if (!a.data.func.eql(b.data.func, a.specifier, b.specifier, comp)) return false, | |
| 1244 | ||
| 1245 | .array, | |
| 1246 | .static_array, | |
| 1247 | .incomplete_array, | |
| 1248 | .vector, | |
| 1249 | => { | |
| 1250 | const a_len = a.arrayLen(); | |
| 1251 | const b_len = b.arrayLen(); | |
| 1252 | if (a_len == null or b_len == null) { | |
| 1253 | // At least one array is incomplete; only check child type for equality | |
| 1254 | } else if (a_len.? != b_len.?) { | |
| 1255 | return false; | |
| 1256 | } | |
| 1257 | if (!a.elemType().eql(b.elemType(), comp, false)) return false; | |
| 1258 | }, | |
| 1259 | .variable_len_array => { | |
| 1260 | if (!a.elemType().eql(b.elemType(), comp, check_qualifiers)) return false; | |
| 1261 | }, | |
| 1262 | .@"struct", .@"union" => if (a.data.record != b.data.record) return false, | |
| 1263 | .@"enum" => if (a.data.@"enum" != b.data.@"enum") return false, | |
| 1264 | .bit_int, .complex_bit_int => return a.data.int.bits == b.data.int.bits and a.data.int.signedness == b.data.int.signedness, | |
| 1265 | ||
| 1266 | else => {}, | |
| 1267 | } | |
| 1268 | return true; | |
| 1269 | } | |
| 1270 | ||
| 1271 | /// Decays an array to a pointer | |
| 1272 | pub fn decayArray(ty: *Type) void { | |
| 1273 | std.debug.assert(ty.isArray()); | |
| 1274 | ty.decayed = true; | |
| 1275 | } | |
| 1276 | ||
| 1277 | pub fn originalTypeOfDecayedArray(ty: Type) Type { | |
| 1278 | std.debug.assert(ty.isDecayed()); | |
| 1279 | var copy = ty; | |
| 1280 | copy.decayed = false; | |
| 1281 | return copy; | |
| 1282 | } | |
| 1283 | ||
| 1284 | /// Rank for floating point conversions, ignoring domain (complex vs real) | |
| 1285 | /// Asserts that ty is a floating point type | |
| 1286 | pub fn floatRank(ty: Type) usize { | |
| 1287 | const real = ty.makeReal(); | |
| 1288 | return switch (real.specifier) { | |
| 1289 | // TODO: bfloat16 => 0 | |
| 1290 | .float16 => 1, | |
| 1291 | .fp16 => 2, | |
| 1292 | .float => 3, | |
| 1293 | .double => 4, | |
| 1294 | .long_double => 5, | |
| 1295 | .float128 => 6, | |
| 1296 | // TODO: ibm128 => 7 | |
| 1297 | else => unreachable, | |
| 1298 | }; | |
| 1299 | } | |
| 1300 | ||
| 1301 | /// Rank for integer conversions, ignoring domain (complex vs real) | |
| 1302 | /// Asserts that ty is an integer type | |
| 1303 | pub fn integerRank(ty: Type, comp: *const Compilation) usize { | |
| 1304 | const real = ty.makeReal(); | |
| 1305 | return @intCast(switch (real.specifier) { | |
| 1306 | .bit_int => @as(u64, real.data.int.bits) << 3, | |
| 1307 | ||
| 1308 | .bool => 1 + (ty.bitSizeof(comp).? << 3), | |
| 1309 | .char, .schar, .uchar => 2 + (ty.bitSizeof(comp).? << 3), | |
| 1310 | .short, .ushort => 3 + (ty.bitSizeof(comp).? << 3), | |
| 1311 | .int, .uint => 4 + (ty.bitSizeof(comp).? << 3), | |
| 1312 | .long, .ulong => 5 + (ty.bitSizeof(comp).? << 3), | |
| 1313 | .long_long, .ulong_long => 6 + (ty.bitSizeof(comp).? << 3), | |
| 1314 | .int128, .uint128 => 7 + (ty.bitSizeof(comp).? << 3), | |
| 1315 | ||
| 1316 | .typeof_type => ty.data.sub_type.integerRank(comp), | |
| 1317 | .typeof_expr => ty.data.expr.ty.integerRank(comp), | |
| 1318 | .attributed => ty.data.attributed.base.integerRank(comp), | |
| 1319 | ||
| 1320 | .@"enum" => real.data.@"enum".tag_ty.integerRank(comp), | |
| 1321 | ||
| 1322 | else => unreachable, | |
| 1323 | }); | |
| 1324 | } | |
| 1325 | ||
| 1326 | /// Returns true if `a` and `b` are integer types that differ only in sign | |
| 1327 | pub fn sameRankDifferentSign(a: Type, b: Type, comp: *const Compilation) bool { | |
| 1328 | if (!a.isInt() or !b.isInt()) return false; | |
| 1329 | if (a.hasIncompleteSize() or b.hasIncompleteSize()) return false; | |
| 1330 | if (a.integerRank(comp) != b.integerRank(comp)) return false; | |
| 1331 | return a.isUnsignedInt(comp) != b.isUnsignedInt(comp); | |
| 1332 | } | |
| 1333 | ||
| 1334 | pub fn makeReal(ty: Type) Type { | |
| 1335 | // TODO discards attributed/typeof | |
| 1336 | var base_ty = ty.canonicalize(.standard); | |
| 1337 | switch (base_ty.specifier) { | |
| 1338 | .complex_float16, .complex_float, .complex_double, .complex_long_double, .complex_float128 => { | |
| 1339 | base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) - 5); | |
| 1340 | return base_ty; | |
| 1341 | }, | |
| 1342 | .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 => { | |
| 1343 | base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) - 13); | |
| 1344 | return base_ty; | |
| 1345 | }, | |
| 1346 | .complex_bit_int => { | |
| 1347 | base_ty.specifier = .bit_int; | |
| 1348 | return base_ty; | |
| 1349 | }, | |
| 1350 | else => return ty, | |
| 1351 | } | |
| 1352 | } | |
| 1353 | ||
| 1354 | pub fn makeComplex(ty: Type) Type { | |
| 1355 | // TODO discards attributed/typeof | |
| 1356 | var base_ty = ty.canonicalize(.standard); | |
| 1357 | switch (base_ty.specifier) { | |
| 1358 | .float, .double, .long_double, .float128 => { | |
| 1359 | base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 5); | |
| 1360 | return base_ty; | |
| 1361 | }, | |
| 1362 | .char, .schar, .uchar, .short, .ushort, .int, .uint, .long, .ulong, .long_long, .ulong_long, .int128, .uint128 => { | |
| 1363 | base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 13); | |
| 1364 | return base_ty; | |
| 1365 | }, | |
| 1366 | .bit_int => { | |
| 1367 | base_ty.specifier = .complex_bit_int; | |
| 1368 | return base_ty; | |
| 1369 | }, | |
| 1370 | else => return ty, | |
| 1371 | } | |
| 1372 | } | |
| 1373 | ||
| 1374 | /// Combines types recursively in the order they were parsed, uses `.void` specifier as a sentinel value. | |
| 1375 | pub fn combine(inner: *Type, outer: Type) Parser.Error!void { | |
| 1376 | switch (inner.specifier) { | |
| 1377 | .pointer => return inner.data.sub_type.combine(outer), | |
| 1378 | .unspecified_variable_len_array => { | |
| 1379 | std.debug.assert(!inner.isDecayed()); | |
| 1380 | try inner.data.sub_type.combine(outer); | |
| 1381 | }, | |
| 1382 | .variable_len_array => { | |
| 1383 | std.debug.assert(!inner.isDecayed()); | |
| 1384 | try inner.data.expr.ty.combine(outer); | |
| 1385 | }, | |
| 1386 | .array, .static_array, .incomplete_array => { | |
| 1387 | std.debug.assert(!inner.isDecayed()); | |
| 1388 | try inner.data.array.elem.combine(outer); | |
| 1389 | }, | |
| 1390 | .func, .var_args_func, .old_style_func => { | |
| 1391 | try inner.data.func.return_type.combine(outer); | |
| 1392 | }, | |
| 1393 | .typeof_type, | |
| 1394 | .typeof_expr, | |
| 1395 | => std.debug.assert(!inner.isDecayed()), | |
| 1396 | .void, .invalid => inner.* = outer, | |
| 1397 | else => unreachable, | |
| 1398 | } | |
| 1399 | } | |
| 1400 | ||
| 1401 | pub fn validateCombinedType(ty: Type, p: *Parser, source_tok: TokenIndex) Parser.Error!void { | |
| 1402 | switch (ty.specifier) { | |
| 1403 | .pointer => return ty.data.sub_type.validateCombinedType(p, source_tok), | |
| 1404 | .unspecified_variable_len_array, | |
| 1405 | .variable_len_array, | |
| 1406 | .array, | |
| 1407 | .static_array, | |
| 1408 | .incomplete_array, | |
| 1409 | => { | |
| 1410 | const elem_ty = ty.elemType(); | |
| 1411 | if (elem_ty.hasIncompleteSize()) { | |
| 1412 | try p.errStr(.array_incomplete_elem, source_tok, try p.typeStr(elem_ty)); | |
| 1413 | return error.ParsingFailed; | |
| 1414 | } | |
| 1415 | if (elem_ty.isFunc()) { | |
| 1416 | try p.errTok(.array_func_elem, source_tok); | |
| 1417 | return error.ParsingFailed; | |
| 1418 | } | |
| 1419 | if (elem_ty.specifier == .static_array and elem_ty.isArray()) { | |
| 1420 | try p.errTok(.static_non_outermost_array, source_tok); | |
| 1421 | } | |
| 1422 | if (elem_ty.anyQual() and elem_ty.isArray()) { | |
| 1423 | try p.errTok(.qualifier_non_outermost_array, source_tok); | |
| 1424 | } | |
| 1425 | }, | |
| 1426 | .func, .var_args_func, .old_style_func => { | |
| 1427 | const ret_ty = &ty.data.func.return_type; | |
| 1428 | if (ret_ty.isArray()) try p.errTok(.func_cannot_return_array, source_tok); | |
| 1429 | if (ret_ty.isFunc()) try p.errTok(.func_cannot_return_func, source_tok); | |
| 1430 | if (ret_ty.qual.@"const") { | |
| 1431 | try p.errStr(.qual_on_ret_type, source_tok, "const"); | |
| 1432 | ret_ty.qual.@"const" = false; | |
| 1433 | } | |
| 1434 | if (ret_ty.qual.@"volatile") { | |
| 1435 | try p.errStr(.qual_on_ret_type, source_tok, "volatile"); | |
| 1436 | ret_ty.qual.@"volatile" = false; | |
| 1437 | } | |
| 1438 | if (ret_ty.qual.atomic) { | |
| 1439 | try p.errStr(.qual_on_ret_type, source_tok, "atomic"); | |
| 1440 | ret_ty.qual.atomic = false; | |
| 1441 | } | |
| 1442 | if (ret_ty.is(.fp16) and !p.comp.hasHalfPrecisionFloatABI()) { | |
| 1443 | try p.errStr(.suggest_pointer_for_invalid_fp16, source_tok, "function return value"); | |
| 1444 | } | |
| 1445 | }, | |
| 1446 | .typeof_type => return ty.data.sub_type.validateCombinedType(p, source_tok), | |
| 1447 | .typeof_expr => return ty.data.expr.ty.validateCombinedType(p, source_tok), | |
| 1448 | .attributed => return ty.data.attributed.base.validateCombinedType(p, source_tok), | |
| 1449 | else => {}, | |
| 1450 | } | |
| 1451 | } | |
| 1452 | ||
| 1453 | /// An unfinished Type | |
| 1454 | pub const Builder = struct { | |
| 1455 | complex_tok: ?TokenIndex = null, | |
| 1456 | bit_int_tok: ?TokenIndex = null, | |
| 1457 | auto_type_tok: ?TokenIndex = null, | |
| 1458 | typedef: ?struct { | |
| 1459 | tok: TokenIndex, | |
| 1460 | ty: Type, | |
| 1461 | } = null, | |
| 1462 | specifier: Builder.Specifier = .none, | |
| 1463 | qual: Qualifiers.Builder = .{}, | |
| 1464 | typeof: ?Type = null, | |
| 1465 | /// When true an error is returned instead of adding a diagnostic message. | |
| 1466 | /// Used for trying to combine typedef types. | |
| 1467 | error_on_invalid: bool = false, | |
| 1468 | ||
| 1469 | pub const Specifier = union(enum) { | |
| 1470 | none, | |
| 1471 | void, | |
| 1472 | /// GNU __auto_type extension | |
| 1473 | auto_type, | |
| 1474 | /// C23 auto | |
| 1475 | c23_auto, | |
| 1476 | nullptr_t, | |
| 1477 | bool, | |
| 1478 | char, | |
| 1479 | schar, | |
| 1480 | uchar, | |
| 1481 | complex_char, | |
| 1482 | complex_schar, | |
| 1483 | complex_uchar, | |
| 1484 | ||
| 1485 | unsigned, | |
| 1486 | signed, | |
| 1487 | short, | |
| 1488 | sshort, | |
| 1489 | ushort, | |
| 1490 | short_int, | |
| 1491 | sshort_int, | |
| 1492 | ushort_int, | |
| 1493 | int, | |
| 1494 | sint, | |
| 1495 | uint, | |
| 1496 | long, | |
| 1497 | slong, | |
| 1498 | ulong, | |
| 1499 | long_int, | |
| 1500 | slong_int, | |
| 1501 | ulong_int, | |
| 1502 | long_long, | |
| 1503 | slong_long, | |
| 1504 | ulong_long, | |
| 1505 | long_long_int, | |
| 1506 | slong_long_int, | |
| 1507 | ulong_long_int, | |
| 1508 | int128, | |
| 1509 | sint128, | |
| 1510 | uint128, | |
| 1511 | complex_unsigned, | |
| 1512 | complex_signed, | |
| 1513 | complex_short, | |
| 1514 | complex_sshort, | |
| 1515 | complex_ushort, | |
| 1516 | complex_short_int, | |
| 1517 | complex_sshort_int, | |
| 1518 | complex_ushort_int, | |
| 1519 | complex_int, | |
| 1520 | complex_sint, | |
| 1521 | complex_uint, | |
| 1522 | complex_long, | |
| 1523 | complex_slong, | |
| 1524 | complex_ulong, | |
| 1525 | complex_long_int, | |
| 1526 | complex_slong_int, | |
| 1527 | complex_ulong_int, | |
| 1528 | complex_long_long, | |
| 1529 | complex_slong_long, | |
| 1530 | complex_ulong_long, | |
| 1531 | complex_long_long_int, | |
| 1532 | complex_slong_long_int, | |
| 1533 | complex_ulong_long_int, | |
| 1534 | complex_int128, | |
| 1535 | complex_sint128, | |
| 1536 | complex_uint128, | |
| 1537 | bit_int: u64, | |
| 1538 | sbit_int: u64, | |
| 1539 | ubit_int: u64, | |
| 1540 | complex_bit_int: u64, | |
| 1541 | complex_sbit_int: u64, | |
| 1542 | complex_ubit_int: u64, | |
| 1543 | ||
| 1544 | fp16, | |
| 1545 | float16, | |
| 1546 | float, | |
| 1547 | double, | |
| 1548 | long_double, | |
| 1549 | float128, | |
| 1550 | complex, | |
| 1551 | complex_float16, | |
| 1552 | complex_float, | |
| 1553 | complex_double, | |
| 1554 | complex_long_double, | |
| 1555 | complex_float128, | |
| 1556 | ||
| 1557 | pointer: *Type, | |
| 1558 | unspecified_variable_len_array: *Type, | |
| 1559 | decayed_unspecified_variable_len_array: *Type, | |
| 1560 | func: *Func, | |
| 1561 | var_args_func: *Func, | |
| 1562 | old_style_func: *Func, | |
| 1563 | array: *Array, | |
| 1564 | decayed_array: *Array, | |
| 1565 | static_array: *Array, | |
| 1566 | decayed_static_array: *Array, | |
| 1567 | incomplete_array: *Array, | |
| 1568 | decayed_incomplete_array: *Array, | |
| 1569 | vector: *Array, | |
| 1570 | variable_len_array: *Expr, | |
| 1571 | decayed_variable_len_array: *Expr, | |
| 1572 | @"struct": *Record, | |
| 1573 | @"union": *Record, | |
| 1574 | @"enum": *Enum, | |
| 1575 | typeof_type: *Type, | |
| 1576 | decayed_typeof_type: *Type, | |
| 1577 | typeof_expr: *Expr, | |
| 1578 | decayed_typeof_expr: *Expr, | |
| 1579 | ||
| 1580 | attributed: *Attributed, | |
| 1581 | decayed_attributed: *Attributed, | |
| 1582 | ||
| 1583 | pub fn str(spec: Builder.Specifier, langopts: LangOpts) ?[]const u8 { | |
| 1584 | return switch (spec) { | |
| 1585 | .none => unreachable, | |
| 1586 | .void => "void", | |
| 1587 | .auto_type => "__auto_type", | |
| 1588 | .c23_auto => "auto", | |
| 1589 | .nullptr_t => "nullptr_t", | |
| 1590 | .bool => if (langopts.standard.atLeast(.c23)) "bool" else "_Bool", | |
| 1591 | .char => "char", | |
| 1592 | .schar => "signed char", | |
| 1593 | .uchar => "unsigned char", | |
| 1594 | .unsigned => "unsigned", | |
| 1595 | .signed => "signed", | |
| 1596 | .short => "short", | |
| 1597 | .ushort => "unsigned short", | |
| 1598 | .sshort => "signed short", | |
| 1599 | .short_int => "short int", | |
| 1600 | .sshort_int => "signed short int", | |
| 1601 | .ushort_int => "unsigned short int", | |
| 1602 | .int => "int", | |
| 1603 | .sint => "signed int", | |
| 1604 | .uint => "unsigned int", | |
| 1605 | .long => "long", | |
| 1606 | .slong => "signed long", | |
| 1607 | .ulong => "unsigned long", | |
| 1608 | .long_int => "long int", | |
| 1609 | .slong_int => "signed long int", | |
| 1610 | .ulong_int => "unsigned long int", | |
| 1611 | .long_long => "long long", | |
| 1612 | .slong_long => "signed long long", | |
| 1613 | .ulong_long => "unsigned long long", | |
| 1614 | .long_long_int => "long long int", | |
| 1615 | .slong_long_int => "signed long long int", | |
| 1616 | .ulong_long_int => "unsigned long long int", | |
| 1617 | .int128 => "__int128", | |
| 1618 | .sint128 => "signed __int128", | |
| 1619 | .uint128 => "unsigned __int128", | |
| 1620 | .complex_char => "_Complex char", | |
| 1621 | .complex_schar => "_Complex signed char", | |
| 1622 | .complex_uchar => "_Complex unsigned char", | |
| 1623 | .complex_unsigned => "_Complex unsigned", | |
| 1624 | .complex_signed => "_Complex signed", | |
| 1625 | .complex_short => "_Complex short", | |
| 1626 | .complex_ushort => "_Complex unsigned short", | |
| 1627 | .complex_sshort => "_Complex signed short", | |
| 1628 | .complex_short_int => "_Complex short int", | |
| 1629 | .complex_sshort_int => "_Complex signed short int", | |
| 1630 | .complex_ushort_int => "_Complex unsigned short int", | |
| 1631 | .complex_int => "_Complex int", | |
| 1632 | .complex_sint => "_Complex signed int", | |
| 1633 | .complex_uint => "_Complex unsigned int", | |
| 1634 | .complex_long => "_Complex long", | |
| 1635 | .complex_slong => "_Complex signed long", | |
| 1636 | .complex_ulong => "_Complex unsigned long", | |
| 1637 | .complex_long_int => "_Complex long int", | |
| 1638 | .complex_slong_int => "_Complex signed long int", | |
| 1639 | .complex_ulong_int => "_Complex unsigned long int", | |
| 1640 | .complex_long_long => "_Complex long long", | |
| 1641 | .complex_slong_long => "_Complex signed long long", | |
| 1642 | .complex_ulong_long => "_Complex unsigned long long", | |
| 1643 | .complex_long_long_int => "_Complex long long int", | |
| 1644 | .complex_slong_long_int => "_Complex signed long long int", | |
| 1645 | .complex_ulong_long_int => "_Complex unsigned long long int", | |
| 1646 | .complex_int128 => "_Complex __int128", | |
| 1647 | .complex_sint128 => "_Complex signed __int128", | |
| 1648 | .complex_uint128 => "_Complex unsigned __int128", | |
| 1649 | ||
| 1650 | .fp16 => "__fp16", | |
| 1651 | .float16 => "_Float16", | |
| 1652 | .float => "float", | |
| 1653 | .double => "double", | |
| 1654 | .long_double => "long double", | |
| 1655 | .float128 => "__float128", | |
| 1656 | .complex => "_Complex", | |
| 1657 | .complex_float16 => "_Complex _Float16", | |
| 1658 | .complex_float => "_Complex float", | |
| 1659 | .complex_double => "_Complex double", | |
| 1660 | .complex_long_double => "_Complex long double", | |
| 1661 | .complex_float128 => "_Complex __float128", | |
| 1662 | ||
| 1663 | .attributed => |attributed| Builder.fromType(attributed.base).str(langopts), | |
| 1664 | ||
| 1665 | else => null, | |
| 1666 | }; | |
| 1667 | } | |
| 1668 | }; | |
| 1669 | ||
| 1670 | pub fn finish(b: Builder, p: *Parser) Parser.Error!Type { | |
| 1671 | var ty: Type = .{ .specifier = undefined }; | |
| 1672 | if (b.typedef) |typedef| { | |
| 1673 | ty = typedef.ty; | |
| 1674 | if (ty.isArray()) { | |
| 1675 | var elem = ty.elemType(); | |
| 1676 | try b.qual.finish(p, &elem); | |
| 1677 | // TODO this really should be easier | |
| 1678 | switch (ty.specifier) { | |
| 1679 | .array, .static_array, .incomplete_array => { | |
| 1680 | const old = ty.data.array; | |
| 1681 | ty.data.array = try p.arena.create(Array); | |
| 1682 | ty.data.array.* = .{ | |
| 1683 | .len = old.len, | |
| 1684 | .elem = elem, | |
| 1685 | }; | |
| 1686 | }, | |
| 1687 | .variable_len_array, .unspecified_variable_len_array => { | |
| 1688 | const old = ty.data.expr; | |
| 1689 | ty.data.expr = try p.arena.create(Expr); | |
| 1690 | ty.data.expr.* = .{ | |
| 1691 | .node = old.node, | |
| 1692 | .ty = elem, | |
| 1693 | }; | |
| 1694 | }, | |
| 1695 | .typeof_type => {}, // TODO handle | |
| 1696 | .typeof_expr => {}, // TODO handle | |
| 1697 | .attributed => {}, // TODO handle | |
| 1698 | else => unreachable, | |
| 1699 | } | |
| 1700 | ||
| 1701 | return ty; | |
| 1702 | } | |
| 1703 | try b.qual.finish(p, &ty); | |
| 1704 | return ty; | |
| 1705 | } | |
| 1706 | switch (b.specifier) { | |
| 1707 | .none => { | |
| 1708 | if (b.typeof) |typeof| { | |
| 1709 | ty = typeof; | |
| 1710 | } else { | |
| 1711 | ty.specifier = .int; | |
| 1712 | if (p.comp.langopts.standard.atLeast(.c23)) { | |
| 1713 | try p.err(.missing_type_specifier_c23); | |
| 1714 | } else { | |
| 1715 | try p.err(.missing_type_specifier); | |
| 1716 | } | |
| 1717 | } | |
| 1718 | }, | |
| 1719 | .void => ty.specifier = .void, | |
| 1720 | .auto_type => ty.specifier = .auto_type, | |
| 1721 | .c23_auto => ty.specifier = .c23_auto, | |
| 1722 | .nullptr_t => unreachable, // nullptr_t can only be accessed via typeof(nullptr) | |
| 1723 | .bool => ty.specifier = .bool, | |
| 1724 | .char => ty.specifier = .char, | |
| 1725 | .schar => ty.specifier = .schar, | |
| 1726 | .uchar => ty.specifier = .uchar, | |
| 1727 | .complex_char => ty.specifier = .complex_char, | |
| 1728 | .complex_schar => ty.specifier = .complex_schar, | |
| 1729 | .complex_uchar => ty.specifier = .complex_uchar, | |
| 1730 | ||
| 1731 | .unsigned => ty.specifier = .uint, | |
| 1732 | .signed => ty.specifier = .int, | |
| 1733 | .short_int, .sshort_int, .short, .sshort => ty.specifier = .short, | |
| 1734 | .ushort, .ushort_int => ty.specifier = .ushort, | |
| 1735 | .int, .sint => ty.specifier = .int, | |
| 1736 | .uint => ty.specifier = .uint, | |
| 1737 | .long, .slong, .long_int, .slong_int => ty.specifier = .long, | |
| 1738 | .ulong, .ulong_int => ty.specifier = .ulong, | |
| 1739 | .long_long, .slong_long, .long_long_int, .slong_long_int => ty.specifier = .long_long, | |
| 1740 | .ulong_long, .ulong_long_int => ty.specifier = .ulong_long, | |
| 1741 | .int128, .sint128 => ty.specifier = .int128, | |
| 1742 | .uint128 => ty.specifier = .uint128, | |
| 1743 | .complex_unsigned => ty.specifier = .complex_uint, | |
| 1744 | .complex_signed => ty.specifier = .complex_int, | |
| 1745 | .complex_short_int, .complex_sshort_int, .complex_short, .complex_sshort => ty.specifier = .complex_short, | |
| 1746 | .complex_ushort, .complex_ushort_int => ty.specifier = .complex_ushort, | |
| 1747 | .complex_int, .complex_sint => ty.specifier = .complex_int, | |
| 1748 | .complex_uint => ty.specifier = .complex_uint, | |
| 1749 | .complex_long, .complex_slong, .complex_long_int, .complex_slong_int => ty.specifier = .complex_long, | |
| 1750 | .complex_ulong, .complex_ulong_int => ty.specifier = .complex_ulong, | |
| 1751 | .complex_long_long, .complex_slong_long, .complex_long_long_int, .complex_slong_long_int => ty.specifier = .complex_long_long, | |
| 1752 | .complex_ulong_long, .complex_ulong_long_int => ty.specifier = .complex_ulong_long, | |
| 1753 | .complex_int128, .complex_sint128 => ty.specifier = .complex_int128, | |
| 1754 | .complex_uint128 => ty.specifier = .complex_uint128, | |
| 1755 | .bit_int, .sbit_int, .ubit_int, .complex_bit_int, .complex_ubit_int, .complex_sbit_int => |bits| { | |
| 1756 | const unsigned = b.specifier == .ubit_int or b.specifier == .complex_ubit_int; | |
| 1757 | const complex_str = if (b.complex_tok != null) "_Complex " else ""; | |
| 1758 | if (unsigned) { | |
| 1759 | if (bits < 1) { | |
| 1760 | try p.errStr(.unsigned_bit_int_too_small, b.bit_int_tok.?, complex_str); | |
| 1761 | return Type.invalid; | |
| 1762 | } | |
| 1763 | } else { | |
| 1764 | if (bits < 2) { | |
| 1765 | try p.errStr(.signed_bit_int_too_small, b.bit_int_tok.?, complex_str); | |
| 1766 | return Type.invalid; | |
| 1767 | } | |
| 1768 | } | |
| 1769 | if (bits > Compilation.bit_int_max_bits) { | |
| 1770 | try p.errStr(if (unsigned) .unsigned_bit_int_too_big else .signed_bit_int_too_big, b.bit_int_tok.?, complex_str); | |
| 1771 | return Type.invalid; | |
| 1772 | } | |
| 1773 | ty.specifier = if (b.complex_tok != null) .complex_bit_int else .bit_int; | |
| 1774 | ty.data = .{ .int = .{ | |
| 1775 | .signedness = if (unsigned) .unsigned else .signed, | |
| 1776 | .bits = @intCast(bits), | |
| 1777 | } }; | |
| 1778 | }, | |
| 1779 | ||
| 1780 | .fp16 => ty.specifier = .fp16, | |
| 1781 | .float16 => ty.specifier = .float16, | |
| 1782 | .float => ty.specifier = .float, | |
| 1783 | .double => ty.specifier = .double, | |
| 1784 | .long_double => ty.specifier = .long_double, | |
| 1785 | .float128 => ty.specifier = .float128, | |
| 1786 | .complex_float16 => ty.specifier = .complex_float16, | |
| 1787 | .complex_float => ty.specifier = .complex_float, | |
| 1788 | .complex_double => ty.specifier = .complex_double, | |
| 1789 | .complex_long_double => ty.specifier = .complex_long_double, | |
| 1790 | .complex_float128 => ty.specifier = .complex_float128, | |
| 1791 | .complex => { | |
| 1792 | try p.errTok(.plain_complex, p.tok_i - 1); | |
| 1793 | ty.specifier = .complex_double; | |
| 1794 | }, | |
| 1795 | ||
| 1796 | .pointer => |data| { | |
| 1797 | ty.specifier = .pointer; | |
| 1798 | ty.data = .{ .sub_type = data }; | |
| 1799 | }, | |
| 1800 | .unspecified_variable_len_array, .decayed_unspecified_variable_len_array => |data| { | |
| 1801 | ty.specifier = .unspecified_variable_len_array; | |
| 1802 | ty.data = .{ .sub_type = data }; | |
| 1803 | ty.decayed = b.specifier == .decayed_unspecified_variable_len_array; | |
| 1804 | }, | |
| 1805 | .func => |data| { | |
| 1806 | ty.specifier = .func; | |
| 1807 | ty.data = .{ .func = data }; | |
| 1808 | }, | |
| 1809 | .var_args_func => |data| { | |
| 1810 | ty.specifier = .var_args_func; | |
| 1811 | ty.data = .{ .func = data }; | |
| 1812 | }, | |
| 1813 | .old_style_func => |data| { | |
| 1814 | ty.specifier = .old_style_func; | |
| 1815 | ty.data = .{ .func = data }; | |
| 1816 | }, | |
| 1817 | .array, .decayed_array => |data| { | |
| 1818 | ty.specifier = .array; | |
| 1819 | ty.data = .{ .array = data }; | |
| 1820 | ty.decayed = b.specifier == .decayed_array; | |
| 1821 | }, | |
| 1822 | .static_array, .decayed_static_array => |data| { | |
| 1823 | ty.specifier = .static_array; | |
| 1824 | ty.data = .{ .array = data }; | |
| 1825 | ty.decayed = b.specifier == .decayed_static_array; | |
| 1826 | }, | |
| 1827 | .incomplete_array, .decayed_incomplete_array => |data| { | |
| 1828 | ty.specifier = .incomplete_array; | |
| 1829 | ty.data = .{ .array = data }; | |
| 1830 | ty.decayed = b.specifier == .decayed_incomplete_array; | |
| 1831 | }, | |
| 1832 | .vector => |data| { | |
| 1833 | ty.specifier = .vector; | |
| 1834 | ty.data = .{ .array = data }; | |
| 1835 | }, | |
| 1836 | .variable_len_array, .decayed_variable_len_array => |data| { | |
| 1837 | ty.specifier = .variable_len_array; | |
| 1838 | ty.data = .{ .expr = data }; | |
| 1839 | ty.decayed = b.specifier == .decayed_variable_len_array; | |
| 1840 | }, | |
| 1841 | .@"struct" => |data| { | |
| 1842 | ty.specifier = .@"struct"; | |
| 1843 | ty.data = .{ .record = data }; | |
| 1844 | }, | |
| 1845 | .@"union" => |data| { | |
| 1846 | ty.specifier = .@"union"; | |
| 1847 | ty.data = .{ .record = data }; | |
| 1848 | }, | |
| 1849 | .@"enum" => |data| { | |
| 1850 | ty.specifier = .@"enum"; | |
| 1851 | ty.data = .{ .@"enum" = data }; | |
| 1852 | }, | |
| 1853 | .typeof_type, .decayed_typeof_type => |data| { | |
| 1854 | ty.specifier = .typeof_type; | |
| 1855 | ty.data = .{ .sub_type = data }; | |
| 1856 | ty.decayed = b.specifier == .decayed_typeof_type; | |
| 1857 | }, | |
| 1858 | .typeof_expr, .decayed_typeof_expr => |data| { | |
| 1859 | ty.specifier = .typeof_expr; | |
| 1860 | ty.data = .{ .expr = data }; | |
| 1861 | ty.decayed = b.specifier == .decayed_typeof_expr; | |
| 1862 | }, | |
| 1863 | .attributed, .decayed_attributed => |data| { | |
| 1864 | ty.specifier = .attributed; | |
| 1865 | ty.data = .{ .attributed = data }; | |
| 1866 | ty.decayed = b.specifier == .decayed_attributed; | |
| 1867 | }, | |
| 1868 | } | |
| 1869 | if (!ty.isReal() and ty.isInt()) { | |
| 1870 | if (b.complex_tok) |tok| try p.errTok(.complex_int, tok); | |
| 1871 | } | |
| 1872 | try b.qual.finish(p, &ty); | |
| 1873 | return ty; | |
| 1874 | } | |
| 1875 | ||
| 1876 | fn cannotCombine(b: Builder, p: *Parser, source_tok: TokenIndex) !void { | |
| 1877 | if (b.error_on_invalid) return error.CannotCombine; | |
| 1878 | const ty_str = b.specifier.str(p.comp.langopts) orelse try p.typeStr(try b.finish(p)); | |
| 1879 | try p.errExtra(.cannot_combine_spec, source_tok, .{ .str = ty_str }); | |
| 1880 | if (b.typedef) |some| try p.errStr(.spec_from_typedef, some.tok, try p.typeStr(some.ty)); | |
| 1881 | } | |
| 1882 | ||
| 1883 | fn duplicateSpec(b: *Builder, p: *Parser, source_tok: TokenIndex, spec: []const u8) !void { | |
| 1884 | if (b.error_on_invalid) return error.CannotCombine; | |
| 1885 | if (p.comp.langopts.emulate != .clang) return b.cannotCombine(p, source_tok); | |
| 1886 | try p.errStr(.duplicate_decl_spec, p.tok_i, spec); | |
| 1887 | } | |
| 1888 | ||
| 1889 | pub fn combineFromTypeof(b: *Builder, p: *Parser, new: Type, source_tok: TokenIndex) Compilation.Error!void { | |
| 1890 | if (b.typeof != null) return p.errStr(.cannot_combine_spec, source_tok, "typeof"); | |
| 1891 | if (b.specifier != .none) return p.errStr(.invalid_typeof, source_tok, @tagName(b.specifier)); | |
| 1892 | const inner = switch (new.specifier) { | |
| 1893 | .typeof_type => new.data.sub_type.*, | |
| 1894 | .typeof_expr => new.data.expr.ty, | |
| 1895 | .nullptr_t => new, // typeof(nullptr) is special-cased to be an unwrapped typeof-expr | |
| 1896 | else => unreachable, | |
| 1897 | }; | |
| 1898 | ||
| 1899 | b.typeof = switch (inner.specifier) { | |
| 1900 | .attributed => inner.data.attributed.base, | |
| 1901 | else => new, | |
| 1902 | }; | |
| 1903 | } | |
| 1904 | ||
| 1905 | /// Try to combine type from typedef, returns true if successful. | |
| 1906 | pub fn combineTypedef(b: *Builder, p: *Parser, typedef_ty: Type, name_tok: TokenIndex) bool { | |
| 1907 | if (typedef_ty.is(.invalid)) return false; | |
| 1908 | b.error_on_invalid = true; | |
| 1909 | defer b.error_on_invalid = false; | |
| 1910 | ||
| 1911 | const new_spec = fromType(typedef_ty); | |
| 1912 | b.combineExtra(p, new_spec, 0) catch |err| switch (err) { | |
| 1913 | error.FatalError => unreachable, // we do not add any diagnostics | |
| 1914 | error.OutOfMemory => unreachable, // we do not add any diagnostics | |
| 1915 | error.ParsingFailed => unreachable, // we do not add any diagnostics | |
| 1916 | error.CannotCombine => return false, | |
| 1917 | }; | |
| 1918 | b.typedef = .{ .tok = name_tok, .ty = typedef_ty }; | |
| 1919 | return true; | |
| 1920 | } | |
| 1921 | ||
| 1922 | pub fn combine(b: *Builder, p: *Parser, new: Builder.Specifier, source_tok: TokenIndex) !void { | |
| 1923 | b.combineExtra(p, new, source_tok) catch |err| switch (err) { | |
| 1924 | error.CannotCombine => unreachable, | |
| 1925 | else => |e| return e, | |
| 1926 | }; | |
| 1927 | } | |
| 1928 | ||
| 1929 | fn combineExtra(b: *Builder, p: *Parser, new: Builder.Specifier, source_tok: TokenIndex) !void { | |
| 1930 | if (b.typeof != null) { | |
| 1931 | if (b.error_on_invalid) return error.CannotCombine; | |
| 1932 | try p.errStr(.invalid_typeof, source_tok, @tagName(new)); | |
| 1933 | } | |
| 1934 | ||
| 1935 | switch (new) { | |
| 1936 | .complex => b.complex_tok = source_tok, | |
| 1937 | .bit_int => b.bit_int_tok = source_tok, | |
| 1938 | .auto_type => b.auto_type_tok = source_tok, | |
| 1939 | else => {}, | |
| 1940 | } | |
| 1941 | ||
| 1942 | if (new == .int128 and !target_util.hasInt128(p.comp.target)) { | |
| 1943 | try p.errStr(.type_not_supported_on_target, source_tok, "__int128"); | |
| 1944 | } | |
| 1945 | ||
| 1946 | switch (new) { | |
| 1947 | else => switch (b.specifier) { | |
| 1948 | .none => b.specifier = new, | |
| 1949 | else => return b.cannotCombine(p, source_tok), | |
| 1950 | }, | |
| 1951 | .signed => b.specifier = switch (b.specifier) { | |
| 1952 | .none => .signed, | |
| 1953 | .char => .schar, | |
| 1954 | .short => .sshort, | |
| 1955 | .short_int => .sshort_int, | |
| 1956 | .int => .sint, | |
| 1957 | .long => .slong, | |
| 1958 | .long_int => .slong_int, | |
| 1959 | .long_long => .slong_long, | |
| 1960 | .long_long_int => .slong_long_int, | |
| 1961 | .int128 => .sint128, | |
| 1962 | .bit_int => |bits| .{ .sbit_int = bits }, | |
| 1963 | .complex => .complex_signed, | |
| 1964 | .complex_char => .complex_schar, | |
| 1965 | .complex_short => .complex_sshort, | |
| 1966 | .complex_short_int => .complex_sshort_int, | |
| 1967 | .complex_int => .complex_sint, | |
| 1968 | .complex_long => .complex_slong, | |
| 1969 | .complex_long_int => .complex_slong_int, | |
| 1970 | .complex_long_long => .complex_slong_long, | |
| 1971 | .complex_long_long_int => .complex_slong_long_int, | |
| 1972 | .complex_int128 => .complex_sint128, | |
| 1973 | .complex_bit_int => |bits| .{ .complex_sbit_int = bits }, | |
| 1974 | .signed, | |
| 1975 | .sshort, | |
| 1976 | .sshort_int, | |
| 1977 | .sint, | |
| 1978 | .slong, | |
| 1979 | .slong_int, | |
| 1980 | .slong_long, | |
| 1981 | .slong_long_int, | |
| 1982 | .sint128, | |
| 1983 | .sbit_int, | |
| 1984 | .complex_schar, | |
| 1985 | .complex_signed, | |
| 1986 | .complex_sshort, | |
| 1987 | .complex_sshort_int, | |
| 1988 | .complex_sint, | |
| 1989 | .complex_slong, | |
| 1990 | .complex_slong_int, | |
| 1991 | .complex_slong_long, | |
| 1992 | .complex_slong_long_int, | |
| 1993 | .complex_sint128, | |
| 1994 | .complex_sbit_int, | |
| 1995 | => return b.duplicateSpec(p, source_tok, "signed"), | |
| 1996 | else => return b.cannotCombine(p, source_tok), | |
| 1997 | }, | |
| 1998 | .unsigned => b.specifier = switch (b.specifier) { | |
| 1999 | .none => .unsigned, | |
| 2000 | .char => .uchar, | |
| 2001 | .short => .ushort, | |
| 2002 | .short_int => .ushort_int, | |
| 2003 | .int => .uint, | |
| 2004 | .long => .ulong, | |
| 2005 | .long_int => .ulong_int, | |
| 2006 | .long_long => .ulong_long, | |
| 2007 | .long_long_int => .ulong_long_int, | |
| 2008 | .int128 => .uint128, | |
| 2009 | .bit_int => |bits| .{ .ubit_int = bits }, | |
| 2010 | .complex => .complex_unsigned, | |
| 2011 | .complex_char => .complex_uchar, | |
| 2012 | .complex_short => .complex_ushort, | |
| 2013 | .complex_short_int => .complex_ushort_int, | |
| 2014 | .complex_int => .complex_uint, | |
| 2015 | .complex_long => .complex_ulong, | |
| 2016 | .complex_long_int => .complex_ulong_int, | |
| 2017 | .complex_long_long => .complex_ulong_long, | |
| 2018 | .complex_long_long_int => .complex_ulong_long_int, | |
| 2019 | .complex_int128 => .complex_uint128, | |
| 2020 | .complex_bit_int => |bits| .{ .complex_ubit_int = bits }, | |
| 2021 | .unsigned, | |
| 2022 | .ushort, | |
| 2023 | .ushort_int, | |
| 2024 | .uint, | |
| 2025 | .ulong, | |
| 2026 | .ulong_int, | |
| 2027 | .ulong_long, | |
| 2028 | .ulong_long_int, | |
| 2029 | .uint128, | |
| 2030 | .ubit_int, | |
| 2031 | .complex_uchar, | |
| 2032 | .complex_unsigned, | |
| 2033 | .complex_ushort, | |
| 2034 | .complex_ushort_int, | |
| 2035 | .complex_uint, | |
| 2036 | .complex_ulong, | |
| 2037 | .complex_ulong_int, | |
| 2038 | .complex_ulong_long, | |
| 2039 | .complex_ulong_long_int, | |
| 2040 | .complex_uint128, | |
| 2041 | .complex_ubit_int, | |
| 2042 | => return b.duplicateSpec(p, source_tok, "unsigned"), | |
| 2043 | else => return b.cannotCombine(p, source_tok), | |
| 2044 | }, | |
| 2045 | .char => b.specifier = switch (b.specifier) { | |
| 2046 | .none => .char, | |
| 2047 | .unsigned => .uchar, | |
| 2048 | .signed => .schar, | |
| 2049 | .complex => .complex_char, | |
| 2050 | .complex_signed => .complex_schar, | |
| 2051 | .complex_unsigned => .complex_uchar, | |
| 2052 | else => return b.cannotCombine(p, source_tok), | |
| 2053 | }, | |
| 2054 | .short => b.specifier = switch (b.specifier) { | |
| 2055 | .none => .short, | |
| 2056 | .unsigned => .ushort, | |
| 2057 | .signed => .sshort, | |
| 2058 | .int => .short_int, | |
| 2059 | .sint => .sshort_int, | |
| 2060 | .uint => .ushort_int, | |
| 2061 | .complex => .complex_short, | |
| 2062 | .complex_signed => .complex_sshort, | |
| 2063 | .complex_unsigned => .complex_ushort, | |
| 2064 | else => return b.cannotCombine(p, source_tok), | |
| 2065 | }, | |
| 2066 | .int => b.specifier = switch (b.specifier) { | |
| 2067 | .none => .int, | |
| 2068 | .signed => .sint, | |
| 2069 | .unsigned => .uint, | |
| 2070 | .short => .short_int, | |
| 2071 | .sshort => .sshort_int, | |
| 2072 | .ushort => .ushort_int, | |
| 2073 | .long => .long_int, | |
| 2074 | .slong => .slong_int, | |
| 2075 | .ulong => .ulong_int, | |
| 2076 | .long_long => .long_long_int, | |
| 2077 | .slong_long => .slong_long_int, | |
| 2078 | .ulong_long => .ulong_long_int, | |
| 2079 | .complex => .complex_int, | |
| 2080 | .complex_signed => .complex_sint, | |
| 2081 | .complex_unsigned => .complex_uint, | |
| 2082 | .complex_short => .complex_short_int, | |
| 2083 | .complex_sshort => .complex_sshort_int, | |
| 2084 | .complex_ushort => .complex_ushort_int, | |
| 2085 | .complex_long => .complex_long_int, | |
| 2086 | .complex_slong => .complex_slong_int, | |
| 2087 | .complex_ulong => .complex_ulong_int, | |
| 2088 | .complex_long_long => .complex_long_long_int, | |
| 2089 | .complex_slong_long => .complex_slong_long_int, | |
| 2090 | .complex_ulong_long => .complex_ulong_long_int, | |
| 2091 | else => return b.cannotCombine(p, source_tok), | |
| 2092 | }, | |
| 2093 | .long => b.specifier = switch (b.specifier) { | |
| 2094 | .none => .long, | |
| 2095 | .double => .long_double, | |
| 2096 | .long => .long_long, | |
| 2097 | .unsigned => .ulong, | |
| 2098 | .signed => .long, | |
| 2099 | .int => .long_int, | |
| 2100 | .sint => .slong_int, | |
| 2101 | .ulong => .ulong_long, | |
| 2102 | .complex => .complex_long, | |
| 2103 | .complex_signed => .complex_slong, | |
| 2104 | .complex_unsigned => .complex_ulong, | |
| 2105 | .complex_long => .complex_long_long, | |
| 2106 | .complex_slong => .complex_slong_long, | |
| 2107 | .complex_ulong => .complex_ulong_long, | |
| 2108 | .complex_double => .complex_long_double, | |
| 2109 | else => return b.cannotCombine(p, source_tok), | |
| 2110 | }, | |
| 2111 | .int128 => b.specifier = switch (b.specifier) { | |
| 2112 | .none => .int128, | |
| 2113 | .unsigned => .uint128, | |
| 2114 | .signed => .sint128, | |
| 2115 | .complex => .complex_int128, | |
| 2116 | .complex_signed => .complex_sint128, | |
| 2117 | .complex_unsigned => .complex_uint128, | |
| 2118 | else => return b.cannotCombine(p, source_tok), | |
| 2119 | }, | |
| 2120 | .bit_int => b.specifier = switch (b.specifier) { | |
| 2121 | .none => .{ .bit_int = new.bit_int }, | |
| 2122 | .unsigned => .{ .ubit_int = new.bit_int }, | |
| 2123 | .signed => .{ .sbit_int = new.bit_int }, | |
| 2124 | .complex => .{ .complex_bit_int = new.bit_int }, | |
| 2125 | .complex_signed => .{ .complex_sbit_int = new.bit_int }, | |
| 2126 | .complex_unsigned => .{ .complex_ubit_int = new.bit_int }, | |
| 2127 | else => return b.cannotCombine(p, source_tok), | |
| 2128 | }, | |
| 2129 | .auto_type => b.specifier = switch (b.specifier) { | |
| 2130 | .none => .auto_type, | |
| 2131 | else => return b.cannotCombine(p, source_tok), | |
| 2132 | }, | |
| 2133 | .c23_auto => b.specifier = switch (b.specifier) { | |
| 2134 | .none => .c23_auto, | |
| 2135 | else => return b.cannotCombine(p, source_tok), | |
| 2136 | }, | |
| 2137 | .fp16 => b.specifier = switch (b.specifier) { | |
| 2138 | .none => .fp16, | |
| 2139 | else => return b.cannotCombine(p, source_tok), | |
| 2140 | }, | |
| 2141 | .float16 => b.specifier = switch (b.specifier) { | |
| 2142 | .none => .float16, | |
| 2143 | .complex => .complex_float16, | |
| 2144 | else => return b.cannotCombine(p, source_tok), | |
| 2145 | }, | |
| 2146 | .float => b.specifier = switch (b.specifier) { | |
| 2147 | .none => .float, | |
| 2148 | .complex => .complex_float, | |
| 2149 | else => return b.cannotCombine(p, source_tok), | |
| 2150 | }, | |
| 2151 | .double => b.specifier = switch (b.specifier) { | |
| 2152 | .none => .double, | |
| 2153 | .long => .long_double, | |
| 2154 | .complex_long => .complex_long_double, | |
| 2155 | .complex => .complex_double, | |
| 2156 | else => return b.cannotCombine(p, source_tok), | |
| 2157 | }, | |
| 2158 | .float128 => b.specifier = switch (b.specifier) { | |
| 2159 | .none => .float128, | |
| 2160 | .complex => .complex_float128, | |
| 2161 | else => return b.cannotCombine(p, source_tok), | |
| 2162 | }, | |
| 2163 | .complex => b.specifier = switch (b.specifier) { | |
| 2164 | .none => .complex, | |
| 2165 | .float16 => .complex_float16, | |
| 2166 | .float => .complex_float, | |
| 2167 | .double => .complex_double, | |
| 2168 | .long_double => .complex_long_double, | |
| 2169 | .float128 => .complex_float128, | |
| 2170 | .char => .complex_char, | |
| 2171 | .schar => .complex_schar, | |
| 2172 | .uchar => .complex_uchar, | |
| 2173 | .unsigned => .complex_unsigned, | |
| 2174 | .signed => .complex_signed, | |
| 2175 | .short => .complex_short, | |
| 2176 | .sshort => .complex_sshort, | |
| 2177 | .ushort => .complex_ushort, | |
| 2178 | .short_int => .complex_short_int, | |
| 2179 | .sshort_int => .complex_sshort_int, | |
| 2180 | .ushort_int => .complex_ushort_int, | |
| 2181 | .int => .complex_int, | |
| 2182 | .sint => .complex_sint, | |
| 2183 | .uint => .complex_uint, | |
| 2184 | .long => .complex_long, | |
| 2185 | .slong => .complex_slong, | |
| 2186 | .ulong => .complex_ulong, | |
| 2187 | .long_int => .complex_long_int, | |
| 2188 | .slong_int => .complex_slong_int, | |
| 2189 | .ulong_int => .complex_ulong_int, | |
| 2190 | .long_long => .complex_long_long, | |
| 2191 | .slong_long => .complex_slong_long, | |
| 2192 | .ulong_long => .complex_ulong_long, | |
| 2193 | .long_long_int => .complex_long_long_int, | |
| 2194 | .slong_long_int => .complex_slong_long_int, | |
| 2195 | .ulong_long_int => .complex_ulong_long_int, | |
| 2196 | .int128 => .complex_int128, | |
| 2197 | .sint128 => .complex_sint128, | |
| 2198 | .uint128 => .complex_uint128, | |
| 2199 | .bit_int => |bits| .{ .complex_bit_int = bits }, | |
| 2200 | .sbit_int => |bits| .{ .complex_sbit_int = bits }, | |
| 2201 | .ubit_int => |bits| .{ .complex_ubit_int = bits }, | |
| 2202 | .complex, | |
| 2203 | .complex_float, | |
| 2204 | .complex_double, | |
| 2205 | .complex_long_double, | |
| 2206 | .complex_float128, | |
| 2207 | .complex_char, | |
| 2208 | .complex_schar, | |
| 2209 | .complex_uchar, | |
| 2210 | .complex_unsigned, | |
| 2211 | .complex_signed, | |
| 2212 | .complex_short, | |
| 2213 | .complex_sshort, | |
| 2214 | .complex_ushort, | |
| 2215 | .complex_short_int, | |
| 2216 | .complex_sshort_int, | |
| 2217 | .complex_ushort_int, | |
| 2218 | .complex_int, | |
| 2219 | .complex_sint, | |
| 2220 | .complex_uint, | |
| 2221 | .complex_long, | |
| 2222 | .complex_slong, | |
| 2223 | .complex_ulong, | |
| 2224 | .complex_long_int, | |
| 2225 | .complex_slong_int, | |
| 2226 | .complex_ulong_int, | |
| 2227 | .complex_long_long, | |
| 2228 | .complex_slong_long, | |
| 2229 | .complex_ulong_long, | |
| 2230 | .complex_long_long_int, | |
| 2231 | .complex_slong_long_int, | |
| 2232 | .complex_ulong_long_int, | |
| 2233 | .complex_int128, | |
| 2234 | .complex_sint128, | |
| 2235 | .complex_uint128, | |
| 2236 | .complex_bit_int, | |
| 2237 | .complex_sbit_int, | |
| 2238 | .complex_ubit_int, | |
| 2239 | => return b.duplicateSpec(p, source_tok, "_Complex"), | |
| 2240 | else => return b.cannotCombine(p, source_tok), | |
| 2241 | }, | |
| 2242 | } | |
| 2243 | } | |
| 2244 | ||
| 2245 | pub fn fromType(ty: Type) Builder.Specifier { | |
| 2246 | return switch (ty.specifier) { | |
| 2247 | .void => .void, | |
| 2248 | .auto_type => .auto_type, | |
| 2249 | .c23_auto => .c23_auto, | |
| 2250 | .nullptr_t => .nullptr_t, | |
| 2251 | .bool => .bool, | |
| 2252 | .char => .char, | |
| 2253 | .schar => .schar, | |
| 2254 | .uchar => .uchar, | |
| 2255 | .short => .short, | |
| 2256 | .ushort => .ushort, | |
| 2257 | .int => .int, | |
| 2258 | .uint => .uint, | |
| 2259 | .long => .long, | |
| 2260 | .ulong => .ulong, | |
| 2261 | .long_long => .long_long, | |
| 2262 | .ulong_long => .ulong_long, | |
| 2263 | .int128 => .int128, | |
| 2264 | .uint128 => .uint128, | |
| 2265 | .bit_int => if (ty.data.int.signedness == .unsigned) { | |
| 2266 | return .{ .ubit_int = ty.data.int.bits }; | |
| 2267 | } else { | |
| 2268 | return .{ .bit_int = ty.data.int.bits }; | |
| 2269 | }, | |
| 2270 | .complex_char => .complex_char, | |
| 2271 | .complex_schar => .complex_schar, | |
| 2272 | .complex_uchar => .complex_uchar, | |
| 2273 | .complex_short => .complex_short, | |
| 2274 | .complex_ushort => .complex_ushort, | |
| 2275 | .complex_int => .complex_int, | |
| 2276 | .complex_uint => .complex_uint, | |
| 2277 | .complex_long => .complex_long, | |
| 2278 | .complex_ulong => .complex_ulong, | |
| 2279 | .complex_long_long => .complex_long_long, | |
| 2280 | .complex_ulong_long => .complex_ulong_long, | |
| 2281 | .complex_int128 => .complex_int128, | |
| 2282 | .complex_uint128 => .complex_uint128, | |
| 2283 | .complex_bit_int => if (ty.data.int.signedness == .unsigned) { | |
| 2284 | return .{ .complex_ubit_int = ty.data.int.bits }; | |
| 2285 | } else { | |
| 2286 | return .{ .complex_bit_int = ty.data.int.bits }; | |
| 2287 | }, | |
| 2288 | .fp16 => .fp16, | |
| 2289 | .float16 => .float16, | |
| 2290 | .float => .float, | |
| 2291 | .double => .double, | |
| 2292 | .float128 => .float128, | |
| 2293 | .long_double => .long_double, | |
| 2294 | .complex_float16 => .complex_float16, | |
| 2295 | .complex_float => .complex_float, | |
| 2296 | .complex_double => .complex_double, | |
| 2297 | .complex_long_double => .complex_long_double, | |
| 2298 | .complex_float128 => .complex_float128, | |
| 2299 | ||
| 2300 | .pointer => .{ .pointer = ty.data.sub_type }, | |
| 2301 | .unspecified_variable_len_array => if (ty.isDecayed()) | |
| 2302 | .{ .decayed_unspecified_variable_len_array = ty.data.sub_type } | |
| 2303 | else | |
| 2304 | .{ .unspecified_variable_len_array = ty.data.sub_type }, | |
| 2305 | .func => .{ .func = ty.data.func }, | |
| 2306 | .var_args_func => .{ .var_args_func = ty.data.func }, | |
| 2307 | .old_style_func => .{ .old_style_func = ty.data.func }, | |
| 2308 | .array => if (ty.isDecayed()) | |
| 2309 | .{ .decayed_array = ty.data.array } | |
| 2310 | else | |
| 2311 | .{ .array = ty.data.array }, | |
| 2312 | .static_array => if (ty.isDecayed()) | |
| 2313 | .{ .decayed_static_array = ty.data.array } | |
| 2314 | else | |
| 2315 | .{ .static_array = ty.data.array }, | |
| 2316 | .incomplete_array => if (ty.isDecayed()) | |
| 2317 | .{ .decayed_incomplete_array = ty.data.array } | |
| 2318 | else | |
| 2319 | .{ .incomplete_array = ty.data.array }, | |
| 2320 | .vector => .{ .vector = ty.data.array }, | |
| 2321 | .variable_len_array => if (ty.isDecayed()) | |
| 2322 | .{ .decayed_variable_len_array = ty.data.expr } | |
| 2323 | else | |
| 2324 | .{ .variable_len_array = ty.data.expr }, | |
| 2325 | .@"struct" => .{ .@"struct" = ty.data.record }, | |
| 2326 | .@"union" => .{ .@"union" = ty.data.record }, | |
| 2327 | .@"enum" => .{ .@"enum" = ty.data.@"enum" }, | |
| 2328 | ||
| 2329 | .typeof_type => if (ty.isDecayed()) | |
| 2330 | .{ .decayed_typeof_type = ty.data.sub_type } | |
| 2331 | else | |
| 2332 | .{ .typeof_type = ty.data.sub_type }, | |
| 2333 | .typeof_expr => if (ty.isDecayed()) | |
| 2334 | .{ .decayed_typeof_expr = ty.data.expr } | |
| 2335 | else | |
| 2336 | .{ .typeof_expr = ty.data.expr }, | |
| 2337 | ||
| 2338 | .attributed => if (ty.isDecayed()) | |
| 2339 | .{ .decayed_attributed = ty.data.attributed } | |
| 2340 | else | |
| 2341 | .{ .attributed = ty.data.attributed }, | |
| 2342 | else => unreachable, | |
| 2343 | }; | |
| 2344 | } | |
| 2345 | }; | |
| 2346 | ||
| 2347 | /// Use with caution | |
| 2348 | pub fn base(ty: *Type) *Type { | |
| 2349 | return switch (ty.specifier) { | |
| 2350 | .typeof_type => ty.data.sub_type.base(), | |
| 2351 | .typeof_expr => ty.data.expr.ty.base(), | |
| 2352 | .attributed => ty.data.attributed.base.base(), | |
| 2353 | else => ty, | |
| 2354 | }; | |
| 2355 | } | |
| 2356 | ||
| 2357 | pub fn getAttribute(ty: Type, comptime tag: Attribute.Tag) ?Attribute.ArgumentsForTag(tag) { | |
| 2358 | if (tag == .aligned) @compileError("use requestedAlignment"); | |
| 2359 | var it = Attribute.Iterator.initType(ty); | |
| 2360 | while (it.next()) |item| { | |
| 2361 | const attribute, _ = item; | |
| 2362 | if (attribute.tag == tag) return @field(attribute.args, @tagName(tag)); | |
| 2363 | } | |
| 2364 | return null; | |
| 2365 | } | |
| 2366 | ||
| 2367 | pub fn hasAttribute(ty: Type, tag: Attribute.Tag) bool { | |
| 2368 | var it = Attribute.Iterator.initType(ty); | |
| 2369 | while (it.next()) |item| { | |
| 2370 | const attr, _ = item; | |
| 2371 | if (attr.tag == tag) return true; | |
| 2372 | } | |
| 2373 | return false; | |
| 2374 | } | |
| 2375 | ||
| 2376 | /// printf format modifier | |
| 2377 | pub fn formatModifier(ty: Type) []const u8 { | |
| 2378 | return switch (ty.specifier) { | |
| 2379 | .schar, .uchar => "hh", | |
| 2380 | .short, .ushort => "h", | |
| 2381 | .int, .uint => "", | |
| 2382 | .long, .ulong => "l", | |
| 2383 | .long_long, .ulong_long => "ll", | |
| 2384 | else => unreachable, | |
| 2385 | }; | |
| 2386 | } | |
| 2387 | ||
| 2388 | /// Suffix for integer values of this type | |
| 2389 | pub fn intValueSuffix(ty: Type, comp: *const Compilation) []const u8 { | |
| 2390 | return switch (ty.specifier) { | |
| 2391 | .schar, .short, .int => "", | |
| 2392 | .long => "L", | |
| 2393 | .long_long => "LL", | |
| 2394 | .uchar, .char => { | |
| 2395 | if (ty.specifier == .char and comp.getCharSignedness() == .signed) return ""; | |
| 2396 | // Only 8-bit char supported currently; | |
| 2397 | // TODO: handle platforms with 16-bit int + 16-bit char | |
| 2398 | std.debug.assert(ty.sizeof(comp).? == 1); | |
| 2399 | return ""; | |
| 2400 | }, | |
| 2401 | .ushort => { | |
| 2402 | if (ty.sizeof(comp).? < int.sizeof(comp).?) { | |
| 2403 | return ""; | |
| 2404 | } | |
| 2405 | return "U"; | |
| 2406 | }, | |
| 2407 | .uint => "U", | |
| 2408 | .ulong => "UL", | |
| 2409 | .ulong_long => "ULL", | |
| 2410 | else => unreachable, // not integer | |
| 2411 | }; | |
| 2412 | } | |
| 2413 | ||
| 2414 | /// Print type in C style | |
| 2415 | pub fn print(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: *Writer) Writer.Error!void { | |
| 2416 | _ = try ty.printPrologue(mapper, langopts, w); | |
| 2417 | try ty.printEpilogue(mapper, langopts, w); | |
| 2418 | } | |
| 2419 | ||
| 2420 | pub fn printNamed(ty: Type, name: []const u8, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: *Writer) Writer.Error!void { | |
| 2421 | const simple = try ty.printPrologue(mapper, langopts, w); | |
| 2422 | if (simple) try w.writeByte(' '); | |
| 2423 | try w.writeAll(name); | |
| 2424 | try ty.printEpilogue(mapper, langopts, w); | |
| 2425 | } | |
| 2426 | ||
| 2427 | const StringGetter = fn (TokenIndex) []const u8; | |
| 2428 | ||
| 2429 | /// return true if `ty` is simple | |
| 2430 | fn printPrologue(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: *Writer) Writer.Error!bool { | |
| 2431 | if (ty.qual.atomic) { | |
| 2432 | var non_atomic_ty = ty; | |
| 2433 | non_atomic_ty.qual.atomic = false; | |
| 2434 | try w.writeAll("_Atomic("); | |
| 2435 | try non_atomic_ty.print(mapper, langopts, w); | |
| 2436 | try w.writeAll(")"); | |
| 2437 | return true; | |
| 2438 | } | |
| 2439 | if (ty.isPtr()) { | |
| 2440 | const elem_ty = ty.elemType(); | |
| 2441 | const simple = try elem_ty.printPrologue(mapper, langopts, w); | |
| 2442 | if (simple) try w.writeByte(' '); | |
| 2443 | if (elem_ty.isFunc() or elem_ty.isArray()) try w.writeByte('('); | |
| 2444 | try w.writeByte('*'); | |
| 2445 | try ty.qual.dump(w); | |
| 2446 | return false; | |
| 2447 | } | |
| 2448 | switch (ty.specifier) { | |
| 2449 | .pointer => unreachable, | |
| 2450 | .func, .var_args_func, .old_style_func => { | |
| 2451 | const ret_ty = ty.data.func.return_type; | |
| 2452 | const simple = try ret_ty.printPrologue(mapper, langopts, w); | |
| 2453 | if (simple) try w.writeByte(' '); | |
| 2454 | return false; | |
| 2455 | }, | |
| 2456 | .array, .static_array, .incomplete_array, .unspecified_variable_len_array, .variable_len_array => { | |
| 2457 | const elem_ty = ty.elemType(); | |
| 2458 | const simple = try elem_ty.printPrologue(mapper, langopts, w); | |
| 2459 | if (simple) try w.writeByte(' '); | |
| 2460 | return false; | |
| 2461 | }, | |
| 2462 | .typeof_type, .typeof_expr => { | |
| 2463 | const actual = ty.canonicalize(.standard); | |
| 2464 | return actual.printPrologue(mapper, langopts, w); | |
| 2465 | }, | |
| 2466 | .attributed => { | |
| 2467 | const actual = ty.canonicalize(.standard); | |
| 2468 | return actual.printPrologue(mapper, langopts, w); | |
| 2469 | }, | |
| 2470 | else => {}, | |
| 2471 | } | |
| 2472 | try ty.qual.dump(w); | |
| 2473 | ||
| 2474 | switch (ty.specifier) { | |
| 2475 | .@"enum" => if (ty.data.@"enum".fixed) { | |
| 2476 | try w.print("enum {s}: ", .{mapper.lookup(ty.data.@"enum".name)}); | |
| 2477 | try ty.data.@"enum".tag_ty.dump(mapper, langopts, w); | |
| 2478 | } else { | |
| 2479 | try w.print("enum {s}", .{mapper.lookup(ty.data.@"enum".name)}); | |
| 2480 | }, | |
| 2481 | .@"struct" => try w.print("struct {s}", .{mapper.lookup(ty.data.record.name)}), | |
| 2482 | .@"union" => try w.print("union {s}", .{mapper.lookup(ty.data.record.name)}), | |
| 2483 | .vector => { | |
| 2484 | const len = ty.data.array.len; | |
| 2485 | const elem_ty = ty.data.array.elem; | |
| 2486 | try w.print("__attribute__((__vector_size__({d} * sizeof(", .{len}); | |
| 2487 | _ = try elem_ty.printPrologue(mapper, langopts, w); | |
| 2488 | try w.writeAll(")))) "); | |
| 2489 | _ = try elem_ty.printPrologue(mapper, langopts, w); | |
| 2490 | try w.print(" (vector of {d} '", .{len}); | |
| 2491 | _ = try elem_ty.printPrologue(mapper, langopts, w); | |
| 2492 | try w.writeAll("' values)"); | |
| 2493 | }, | |
| 2494 | .bit_int => try w.print("{s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), | |
| 2495 | .complex_bit_int => try w.print("_Complex {s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), | |
| 2496 | else => try w.writeAll(Builder.fromType(ty).str(langopts).?), | |
| 2497 | } | |
| 2498 | return true; | |
| 2499 | } | |
| 2500 | ||
| 2501 | fn printEpilogue(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: *Writer) Writer.Error!void { | |
| 2502 | if (ty.qual.atomic) return; | |
| 2503 | if (ty.isPtr()) { | |
| 2504 | const elem_ty = ty.elemType(); | |
| 2505 | if (elem_ty.isFunc() or elem_ty.isArray()) try w.writeByte(')'); | |
| 2506 | try elem_ty.printEpilogue(mapper, langopts, w); | |
| 2507 | return; | |
| 2508 | } | |
| 2509 | switch (ty.specifier) { | |
| 2510 | .pointer => unreachable, // handled above | |
| 2511 | .func, .var_args_func, .old_style_func => { | |
| 2512 | try w.writeByte('('); | |
| 2513 | for (ty.data.func.params, 0..) |param, i| { | |
| 2514 | if (i != 0) try w.writeAll(", "); | |
| 2515 | _ = try param.ty.printPrologue(mapper, langopts, w); | |
| 2516 | try param.ty.printEpilogue(mapper, langopts, w); | |
| 2517 | } | |
| 2518 | if (ty.specifier != .func) { | |
| 2519 | if (ty.data.func.params.len != 0) try w.writeAll(", "); | |
| 2520 | try w.writeAll("..."); | |
| 2521 | } else if (ty.data.func.params.len == 0) { | |
| 2522 | try w.writeAll("void"); | |
| 2523 | } | |
| 2524 | try w.writeByte(')'); | |
| 2525 | try ty.data.func.return_type.printEpilogue(mapper, langopts, w); | |
| 2526 | }, | |
| 2527 | .array, .static_array => { | |
| 2528 | try w.writeByte('['); | |
| 2529 | if (ty.specifier == .static_array) try w.writeAll("static "); | |
| 2530 | try ty.qual.dump(w); | |
| 2531 | try w.print("{d}]", .{ty.data.array.len}); | |
| 2532 | try ty.data.array.elem.printEpilogue(mapper, langopts, w); | |
| 2533 | }, | |
| 2534 | .incomplete_array => { | |
| 2535 | try w.writeByte('['); | |
| 2536 | try ty.qual.dump(w); | |
| 2537 | try w.writeByte(']'); | |
| 2538 | try ty.data.array.elem.printEpilogue(mapper, langopts, w); | |
| 2539 | }, | |
| 2540 | .unspecified_variable_len_array => { | |
| 2541 | try w.writeByte('['); | |
| 2542 | try ty.qual.dump(w); | |
| 2543 | try w.writeAll("*]"); | |
| 2544 | try ty.data.sub_type.printEpilogue(mapper, langopts, w); | |
| 2545 | }, | |
| 2546 | .variable_len_array => { | |
| 2547 | try w.writeByte('['); | |
| 2548 | try ty.qual.dump(w); | |
| 2549 | try w.writeAll("<expr>]"); | |
| 2550 | try ty.data.expr.ty.printEpilogue(mapper, langopts, w); | |
| 2551 | }, | |
| 2552 | .typeof_type, .typeof_expr => { | |
| 2553 | const actual = ty.canonicalize(.standard); | |
| 2554 | try actual.printEpilogue(mapper, langopts, w); | |
| 2555 | }, | |
| 2556 | .attributed => { | |
| 2557 | const actual = ty.canonicalize(.standard); | |
| 2558 | try actual.printEpilogue(mapper, langopts, w); | |
| 2559 | }, | |
| 2560 | else => {}, | |
| 2561 | } | |
| 2562 | } | |
| 2563 | ||
| 2564 | /// Useful for debugging, too noisy to be enabled by default. | |
| 2565 | const dump_detailed_containers = false; | |
| 2566 | ||
| 2567 | // Print as Zig types since those are actually readable | |
| 2568 | pub fn dump(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: *Writer) Writer.Error!void { | |
| 2569 | try ty.qual.dump(w); | |
| 2570 | switch (ty.specifier) { | |
| 2571 | .invalid => try w.writeAll("invalid"), | |
| 2572 | .pointer => { | |
| 2573 | try w.writeAll("*"); | |
| 2574 | try ty.data.sub_type.dump(mapper, langopts, w); | |
| 2575 | }, | |
| 2576 | .func, .var_args_func, .old_style_func => { | |
| 2577 | if (ty.specifier == .old_style_func) | |
| 2578 | try w.writeAll("kr (") | |
| 2579 | else | |
| 2580 | try w.writeAll("fn ("); | |
| 2581 | for (ty.data.func.params, 0..) |param, i| { | |
| 2582 | if (i != 0) try w.writeAll(", "); | |
| 2583 | if (param.name != .empty) try w.print("{s}: ", .{mapper.lookup(param.name)}); | |
| 2584 | try param.ty.dump(mapper, langopts, w); | |
| 2585 | } | |
| 2586 | if (ty.specifier != .func) { | |
| 2587 | if (ty.data.func.params.len != 0) try w.writeAll(", "); | |
| 2588 | try w.writeAll("..."); | |
| 2589 | } | |
| 2590 | try w.writeAll(") "); | |
| 2591 | try ty.data.func.return_type.dump(mapper, langopts, w); | |
| 2592 | }, | |
| 2593 | .array, .static_array => { | |
| 2594 | if (ty.isDecayed()) try w.writeAll("*d"); | |
| 2595 | try w.writeByte('['); | |
| 2596 | if (ty.specifier == .static_array) try w.writeAll("static "); | |
| 2597 | try w.print("{d}]", .{ty.data.array.len}); | |
| 2598 | try ty.data.array.elem.dump(mapper, langopts, w); | |
| 2599 | }, | |
| 2600 | .vector => { | |
| 2601 | try w.print("vector({d}, ", .{ty.data.array.len}); | |
| 2602 | try ty.data.array.elem.dump(mapper, langopts, w); | |
| 2603 | try w.writeAll(")"); | |
| 2604 | }, | |
| 2605 | .incomplete_array => { | |
| 2606 | if (ty.isDecayed()) try w.writeAll("*d"); | |
| 2607 | try w.writeAll("[]"); | |
| 2608 | try ty.data.array.elem.dump(mapper, langopts, w); | |
| 2609 | }, | |
| 2610 | .@"enum" => { | |
| 2611 | const enum_ty = ty.data.@"enum"; | |
| 2612 | if (enum_ty.isIncomplete() and !enum_ty.fixed) { | |
| 2613 | try w.print("enum {s}", .{mapper.lookup(enum_ty.name)}); | |
| 2614 | } else { | |
| 2615 | try w.print("enum {s}: ", .{mapper.lookup(enum_ty.name)}); | |
| 2616 | try enum_ty.tag_ty.dump(mapper, langopts, w); | |
| 2617 | } | |
| 2618 | if (dump_detailed_containers) try dumpEnum(enum_ty, mapper, w); | |
| 2619 | }, | |
| 2620 | .@"struct" => { | |
| 2621 | try w.print("struct {s}", .{mapper.lookup(ty.data.record.name)}); | |
| 2622 | if (dump_detailed_containers) try dumpRecord(ty.data.record, mapper, langopts, w); | |
| 2623 | }, | |
| 2624 | .@"union" => { | |
| 2625 | try w.print("union {s}", .{mapper.lookup(ty.data.record.name)}); | |
| 2626 | if (dump_detailed_containers) try dumpRecord(ty.data.record, mapper, langopts, w); | |
| 2627 | }, | |
| 2628 | .unspecified_variable_len_array => { | |
| 2629 | if (ty.isDecayed()) try w.writeAll("*d"); | |
| 2630 | try w.writeAll("[*]"); | |
| 2631 | try ty.data.sub_type.dump(mapper, langopts, w); | |
| 2632 | }, | |
| 2633 | .variable_len_array => { | |
| 2634 | if (ty.isDecayed()) try w.writeAll("*d"); | |
| 2635 | try w.writeAll("[<expr>]"); | |
| 2636 | try ty.data.expr.ty.dump(mapper, langopts, w); | |
| 2637 | }, | |
| 2638 | .typeof_type => { | |
| 2639 | try w.writeAll("typeof("); | |
| 2640 | try ty.data.sub_type.dump(mapper, langopts, w); | |
| 2641 | try w.writeAll(")"); | |
| 2642 | }, | |
| 2643 | .typeof_expr => { | |
| 2644 | try w.writeAll("typeof(<expr>: "); | |
| 2645 | try ty.data.expr.ty.dump(mapper, langopts, w); | |
| 2646 | try w.writeAll(")"); | |
| 2647 | }, | |
| 2648 | .attributed => { | |
| 2649 | if (ty.isDecayed()) try w.writeAll("*d:"); | |
| 2650 | try w.writeAll("attributed("); | |
| 2651 | try ty.data.attributed.base.canonicalize(.standard).dump(mapper, langopts, w); | |
| 2652 | try w.writeAll(")"); | |
| 2653 | }, | |
| 2654 | .bit_int => try w.print("{s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), | |
| 2655 | .complex_bit_int => try w.print("_Complex {s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), | |
| 2656 | else => try w.writeAll(Builder.fromType(ty).str(langopts).?), | |
| 2657 | } | |
| 2658 | } | |
| 2659 | ||
| 2660 | fn dumpEnum(@"enum": *Enum, mapper: StringInterner.TypeMapper, w: *Writer) Writer.Error!void { | |
| 2661 | try w.writeAll(" {"); | |
| 2662 | for (@"enum".fields) |field| { | |
| 2663 | try w.print(" {s} = {d},", .{ mapper.lookup(field.name), field.value }); | |
| 2664 | } | |
| 2665 | try w.writeAll(" }"); | |
| 2666 | } | |
| 2667 | ||
| 2668 | fn dumpRecord(record: *Record, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: *Writer) Writer.Error!void { | |
| 2669 | try w.writeAll(" {"); | |
| 2670 | for (record.fields) |field| { | |
| 2671 | try w.writeByte(' '); | |
| 2672 | try field.ty.dump(mapper, langopts, w); | |
| 2673 | try w.print(" {s}: {d};", .{ mapper.lookup(field.name), field.bit_width }); | |
| 2674 | } | |
| 2675 | try w.writeAll(" }"); | |
| 2676 | } |
lib/compiler/aro/aro/TypeStore.zig created+3008| ... | ... | @@ -0,0 +1,3008 @@ |
| 1 | pub const std = @import("std"); | |
| 2 | ||
| 3 | const Attribute = @import("Attribute.zig"); | |
| 4 | const Compilation = @import("Compilation.zig"); | |
| 5 | const LangOpts = @import("LangOpts.zig"); | |
| 6 | const record_layout = @import("record_layout.zig"); | |
| 7 | const Parser = @import("Parser.zig"); | |
| 8 | const StringInterner = @import("StringInterner.zig"); | |
| 9 | const StringId = StringInterner.StringId; | |
| 10 | const target_util = @import("target.zig"); | |
| 11 | const Tree = @import("Tree.zig"); | |
| 12 | const Node = Tree.Node; | |
| 13 | const TokenIndex = Tree.TokenIndex; | |
| 14 | ||
| 15 | const Repr = struct { | |
| 16 | tag: Tag, | |
| 17 | /// If a Type has a child type it is stored in data[0]. | |
| 18 | data: [2]u32, | |
| 19 | ||
| 20 | pub const Tag = enum(u8) { | |
| 21 | complex, | |
| 22 | bit_int, | |
| 23 | atomic, | |
| 24 | func, | |
| 25 | func_variadic, | |
| 26 | func_old_style, | |
| 27 | func_zero, | |
| 28 | func_variadic_zero, | |
| 29 | func_old_style_zero, | |
| 30 | func_one, | |
| 31 | func_variadic_one, | |
| 32 | func_old_style_one, | |
| 33 | pointer, | |
| 34 | pointer_decayed, | |
| 35 | array_incomplete, | |
| 36 | array_fixed, | |
| 37 | array_static, | |
| 38 | array_variable, | |
| 39 | array_unspecified_variable, | |
| 40 | vector, | |
| 41 | @"struct", | |
| 42 | struct_incomplete, | |
| 43 | @"union", | |
| 44 | union_incomplete, | |
| 45 | @"enum", | |
| 46 | enum_fixed, | |
| 47 | enum_incomplete, | |
| 48 | enum_incomplete_fixed, | |
| 49 | typeof, | |
| 50 | typeof_expr, | |
| 51 | typedef, | |
| 52 | attributed, | |
| 53 | attributed_one, | |
| 54 | }; | |
| 55 | }; | |
| 56 | ||
| 57 | const Index = enum(u29) { | |
| 58 | /// A NaN-like poison value | |
| 59 | /// Can only be nested in function types. | |
| 60 | invalid = std.math.maxInt(u29) - 0, | |
| 61 | /// GNU auto type | |
| 62 | /// This is a placeholder specifier - it must be replaced by the actual type specifier (determined by the initializer) | |
| 63 | /// Must *NOT* be nested. | |
| 64 | auto_type = std.math.maxInt(u29) - 1, | |
| 65 | /// C23 auto, behaves like auto_type | |
| 66 | /// Must *NOT* be nested. | |
| 67 | c23_auto = std.math.maxInt(u29) - 2, | |
| 68 | void = std.math.maxInt(u29) - 3, | |
| 69 | bool = std.math.maxInt(u29) - 4, | |
| 70 | nullptr_t = std.math.maxInt(u29) - 5, | |
| 71 | int_char = std.math.maxInt(u29) - 6, | |
| 72 | int_schar = std.math.maxInt(u29) - 7, | |
| 73 | int_uchar = std.math.maxInt(u29) - 8, | |
| 74 | int_short = std.math.maxInt(u29) - 9, | |
| 75 | int_ushort = std.math.maxInt(u29) - 10, | |
| 76 | int_int = std.math.maxInt(u29) - 11, | |
| 77 | int_uint = std.math.maxInt(u29) - 12, | |
| 78 | int_long = std.math.maxInt(u29) - 13, | |
| 79 | int_ulong = std.math.maxInt(u29) - 14, | |
| 80 | int_long_long = std.math.maxInt(u29) - 15, | |
| 81 | int_ulong_long = std.math.maxInt(u29) - 16, | |
| 82 | int_int128 = std.math.maxInt(u29) - 17, | |
| 83 | int_uint128 = std.math.maxInt(u29) - 18, | |
| 84 | float_fp16 = std.math.maxInt(u29) - 19, | |
| 85 | float_float16 = std.math.maxInt(u29) - 20, | |
| 86 | float_float = std.math.maxInt(u29) - 21, | |
| 87 | float_double = std.math.maxInt(u29) - 22, | |
| 88 | float_long_double = std.math.maxInt(u29) - 23, | |
| 89 | float_float128 = std.math.maxInt(u29) - 24, | |
| 90 | void_pointer = std.math.maxInt(u29) - 25, | |
| 91 | char_pointer = std.math.maxInt(u29) - 26, | |
| 92 | int_pointer = std.math.maxInt(u29) - 27, | |
| 93 | /// Special type used when combining declarators. | |
| 94 | declarator_combine = std.math.maxInt(u29) - 28, | |
| 95 | _, | |
| 96 | }; | |
| 97 | ||
| 98 | const TypeStore = @This(); | |
| 99 | ||
| 100 | pub const QualType = packed struct(u32) { | |
| 101 | @"const": bool = false, | |
| 102 | @"volatile": bool = false, | |
| 103 | restrict: bool = false, | |
| 104 | ||
| 105 | _index: Index, | |
| 106 | ||
| 107 | pub const invalid: QualType = .{ ._index = .invalid }; | |
| 108 | pub const auto_type: QualType = .{ ._index = .auto_type }; | |
| 109 | pub const c23_auto: QualType = .{ ._index = .c23_auto }; | |
| 110 | pub const @"void": QualType = .{ ._index = .void }; | |
| 111 | pub const @"bool": QualType = .{ ._index = .bool }; | |
| 112 | pub const nullptr_t: QualType = .{ ._index = .nullptr_t }; | |
| 113 | pub const char: QualType = .{ ._index = .int_char }; | |
| 114 | pub const schar: QualType = .{ ._index = .int_schar }; | |
| 115 | pub const uchar: QualType = .{ ._index = .int_uchar }; | |
| 116 | pub const short: QualType = .{ ._index = .int_short }; | |
| 117 | pub const ushort: QualType = .{ ._index = .int_ushort }; | |
| 118 | pub const int: QualType = .{ ._index = .int_int }; | |
| 119 | pub const uint: QualType = .{ ._index = .int_uint }; | |
| 120 | pub const long: QualType = .{ ._index = .int_long }; | |
| 121 | pub const ulong: QualType = .{ ._index = .int_ulong }; | |
| 122 | pub const long_long: QualType = .{ ._index = .int_long_long }; | |
| 123 | pub const ulong_long: QualType = .{ ._index = .int_ulong_long }; | |
| 124 | pub const int128: QualType = .{ ._index = .int_int128 }; | |
| 125 | pub const uint128: QualType = .{ ._index = .int_uint128 }; | |
| 126 | pub const fp16: QualType = .{ ._index = .float_fp16 }; | |
| 127 | pub const float16: QualType = .{ ._index = .float_float16 }; | |
| 128 | pub const float: QualType = .{ ._index = .float_float }; | |
| 129 | pub const double: QualType = .{ ._index = .float_double }; | |
| 130 | pub const long_double: QualType = .{ ._index = .float_long_double }; | |
| 131 | pub const float128: QualType = .{ ._index = .float_float128 }; | |
| 132 | pub const void_pointer: QualType = .{ ._index = .void_pointer }; | |
| 133 | pub const char_pointer: QualType = .{ ._index = .char_pointer }; | |
| 134 | pub const int_pointer: QualType = .{ ._index = .int_pointer }; | |
| 135 | ||
| 136 | pub fn isInvalid(qt: QualType) bool { | |
| 137 | return qt._index == .invalid; | |
| 138 | } | |
| 139 | ||
| 140 | pub fn isAutoType(qt: QualType) bool { | |
| 141 | return qt._index == .auto_type; | |
| 142 | } | |
| 143 | ||
| 144 | pub fn isC23Auto(qt: QualType) bool { | |
| 145 | return qt._index == .c23_auto; | |
| 146 | } | |
| 147 | ||
| 148 | pub fn isQualified(qt: QualType) bool { | |
| 149 | return qt.@"const" or qt.@"volatile" or qt.restrict; | |
| 150 | } | |
| 151 | ||
| 152 | pub fn unqualified(qt: QualType) QualType { | |
| 153 | return .{ ._index = qt._index }; | |
| 154 | } | |
| 155 | ||
| 156 | pub fn withQualifiers(target: QualType, quals_from: QualType) QualType { | |
| 157 | return .{ | |
| 158 | ._index = target._index, | |
| 159 | .@"const" = quals_from.@"const", | |
| 160 | .@"volatile" = quals_from.@"volatile", | |
| 161 | .restrict = quals_from.restrict, | |
| 162 | }; | |
| 163 | } | |
| 164 | ||
| 165 | pub fn @"type"(qt: QualType, comp: *const Compilation) Type { | |
| 166 | switch (qt._index) { | |
| 167 | .invalid => unreachable, | |
| 168 | .auto_type => unreachable, | |
| 169 | .c23_auto => unreachable, | |
| 170 | .declarator_combine => unreachable, | |
| 171 | .void => return .void, | |
| 172 | .bool => return .bool, | |
| 173 | .nullptr_t => return .nullptr_t, | |
| 174 | .int_char => return .{ .int = .char }, | |
| 175 | .int_schar => return .{ .int = .schar }, | |
| 176 | .int_uchar => return .{ .int = .uchar }, | |
| 177 | .int_short => return .{ .int = .short }, | |
| 178 | .int_ushort => return .{ .int = .ushort }, | |
| 179 | .int_int => return .{ .int = .int }, | |
| 180 | .int_uint => return .{ .int = .uint }, | |
| 181 | .int_long => return .{ .int = .long }, | |
| 182 | .int_ulong => return .{ .int = .ulong }, | |
| 183 | .int_long_long => return .{ .int = .long_long }, | |
| 184 | .int_ulong_long => return .{ .int = .ulong_long }, | |
| 185 | .int_int128 => return .{ .int = .int128 }, | |
| 186 | .int_uint128 => return .{ .int = .uint128 }, | |
| 187 | .float_fp16 => return .{ .float = .fp16 }, | |
| 188 | .float_float16 => return .{ .float = .float16 }, | |
| 189 | .float_float => return .{ .float = .float }, | |
| 190 | .float_double => return .{ .float = .double }, | |
| 191 | .float_long_double => return .{ .float = .long_double }, | |
| 192 | .float_float128 => return .{ .float = .float128 }, | |
| 193 | .void_pointer => return .{ .pointer = .{ .child = .void, .decayed = null } }, | |
| 194 | .char_pointer => return .{ .pointer = .{ .child = .char, .decayed = null } }, | |
| 195 | .int_pointer => return .{ .pointer = .{ .child = .int, .decayed = null } }, | |
| 196 | ||
| 197 | else => {}, | |
| 198 | } | |
| 199 | ||
| 200 | const repr = comp.type_store.types.get(@intFromEnum(qt._index)); | |
| 201 | return switch (repr.tag) { | |
| 202 | .complex => .{ .complex = @bitCast(repr.data[0]) }, | |
| 203 | .atomic => .{ .atomic = @bitCast(repr.data[0]) }, | |
| 204 | .bit_int => .{ .bit_int = .{ | |
| 205 | .bits = @intCast(repr.data[0]), | |
| 206 | .signedness = @enumFromInt(repr.data[1]), | |
| 207 | } }, | |
| 208 | .func_zero => .{ .func = .{ | |
| 209 | .return_type = @bitCast(repr.data[0]), | |
| 210 | .kind = .normal, | |
| 211 | .params = &.{}, | |
| 212 | } }, | |
| 213 | .func_variadic_zero => .{ .func = .{ | |
| 214 | .return_type = @bitCast(repr.data[0]), | |
| 215 | .kind = .variadic, | |
| 216 | .params = &.{}, | |
| 217 | } }, | |
| 218 | .func_old_style_zero => .{ .func = .{ | |
| 219 | .return_type = @bitCast(repr.data[0]), | |
| 220 | .kind = .old_style, | |
| 221 | .params = &.{}, | |
| 222 | } }, | |
| 223 | .func_one, | |
| 224 | .func_variadic_one, | |
| 225 | .func_old_style_one, | |
| 226 | .func, | |
| 227 | .func_variadic, | |
| 228 | .func_old_style, | |
| 229 | => { | |
| 230 | const param_size = 4; | |
| 231 | comptime std.debug.assert(@sizeOf(Type.Func.Param) == @sizeOf(u32) * param_size); | |
| 232 | ||
| 233 | const extra = comp.type_store.extra.items; | |
| 234 | const params_len = switch (repr.tag) { | |
| 235 | .func_one, .func_variadic_one, .func_old_style_one => 1, | |
| 236 | .func, .func_variadic, .func_old_style => extra[repr.data[1]], | |
| 237 | else => unreachable, | |
| 238 | }; | |
| 239 | const extra_params = extra[repr.data[1] + @intFromBool(params_len > 1) ..][0 .. params_len * param_size]; | |
| 240 | ||
| 241 | return .{ .func = .{ | |
| 242 | .return_type = @bitCast(repr.data[0]), | |
| 243 | .kind = switch (repr.tag) { | |
| 244 | .func_one, .func => .normal, | |
| 245 | .func_variadic_one, .func_variadic => .variadic, | |
| 246 | .func_old_style_one, .func_old_style => .old_style, | |
| 247 | else => unreachable, | |
| 248 | }, | |
| 249 | .params = std.mem.bytesAsSlice(Type.Func.Param, std.mem.sliceAsBytes(extra_params)), | |
| 250 | } }; | |
| 251 | }, | |
| 252 | .pointer => .{ .pointer = .{ | |
| 253 | .child = @bitCast(repr.data[0]), | |
| 254 | .decayed = null, | |
| 255 | } }, | |
| 256 | .pointer_decayed => .{ .pointer = .{ | |
| 257 | .child = @bitCast(repr.data[0]), | |
| 258 | .decayed = @bitCast(repr.data[1]), | |
| 259 | } }, | |
| 260 | .array_incomplete => .{ .array = .{ | |
| 261 | .elem = @bitCast(repr.data[0]), | |
| 262 | .len = .incomplete, | |
| 263 | } }, | |
| 264 | .array_fixed => .{ .array = .{ | |
| 265 | .elem = @bitCast(repr.data[0]), | |
| 266 | .len = .{ .fixed = @bitCast(comp.type_store.extra.items[repr.data[1]..][0..2].*) }, | |
| 267 | } }, | |
| 268 | .array_static => .{ .array = .{ | |
| 269 | .elem = @bitCast(repr.data[0]), | |
| 270 | .len = .{ .static = @bitCast(comp.type_store.extra.items[repr.data[1]..][0..2].*) }, | |
| 271 | } }, | |
| 272 | .array_variable => .{ .array = .{ | |
| 273 | .elem = @bitCast(repr.data[0]), | |
| 274 | .len = .{ .variable = @enumFromInt(repr.data[1]) }, | |
| 275 | } }, | |
| 276 | .array_unspecified_variable => .{ .array = .{ | |
| 277 | .elem = @bitCast(repr.data[0]), | |
| 278 | .len = .unspecified_variable, | |
| 279 | } }, | |
| 280 | .vector => .{ .vector = .{ | |
| 281 | .elem = @bitCast(repr.data[0]), | |
| 282 | .len = repr.data[1], | |
| 283 | } }, | |
| 284 | .@"struct", .@"union" => { | |
| 285 | const layout_size = 5; | |
| 286 | comptime std.debug.assert(@sizeOf(Type.Record.Layout) == @sizeOf(u32) * layout_size); | |
| 287 | const field_size = 10; | |
| 288 | comptime std.debug.assert(@sizeOf(Type.Record.Field) == @sizeOf(u32) * field_size); | |
| 289 | ||
| 290 | const extra = comp.type_store.extra.items; | |
| 291 | const layout = @as(*Type.Record.Layout, @ptrCast(extra[repr.data[1] + 1 ..][0..layout_size])).*; | |
| 292 | const fields_len = extra[repr.data[1] + layout_size + 1]; | |
| 293 | const extra_fields = extra[repr.data[1] + layout_size + 2 ..][0 .. fields_len * field_size]; | |
| 294 | ||
| 295 | const record: Type.Record = .{ | |
| 296 | .name = @enumFromInt(repr.data[0]), | |
| 297 | .decl_node = @enumFromInt(extra[repr.data[1]]), | |
| 298 | .layout = layout, | |
| 299 | .fields = std.mem.bytesAsSlice(Type.Record.Field, std.mem.sliceAsBytes(extra_fields)), | |
| 300 | }; | |
| 301 | return switch (repr.tag) { | |
| 302 | .@"struct" => .{ .@"struct" = record }, | |
| 303 | .@"union" => .{ .@"union" = record }, | |
| 304 | else => unreachable, | |
| 305 | }; | |
| 306 | }, | |
| 307 | .struct_incomplete => .{ .@"struct" = .{ | |
| 308 | .name = @enumFromInt(repr.data[0]), | |
| 309 | .decl_node = @enumFromInt(repr.data[1]), | |
| 310 | .layout = null, | |
| 311 | .fields = &.{}, | |
| 312 | } }, | |
| 313 | .union_incomplete => .{ .@"union" = .{ | |
| 314 | .name = @enumFromInt(repr.data[0]), | |
| 315 | .decl_node = @enumFromInt(repr.data[1]), | |
| 316 | .layout = null, | |
| 317 | .fields = &.{}, | |
| 318 | } }, | |
| 319 | .@"enum", .enum_fixed => { | |
| 320 | const extra = comp.type_store.extra.items; | |
| 321 | const field_size = 3; | |
| 322 | comptime std.debug.assert(@sizeOf(Type.Enum.Field) == @sizeOf(u32) * field_size); | |
| 323 | ||
| 324 | const fields_len = extra[repr.data[1] + 2]; | |
| 325 | const extra_fields = extra[repr.data[1] + 3 ..][0 .. fields_len * field_size]; | |
| 326 | ||
| 327 | return .{ .@"enum" = .{ | |
| 328 | .name = @enumFromInt(extra[repr.data[1]]), | |
| 329 | .decl_node = @enumFromInt(extra[repr.data[1] + 1]), | |
| 330 | .tag = @bitCast(repr.data[0]), | |
| 331 | .incomplete = false, | |
| 332 | .fixed = repr.tag == .enum_fixed, | |
| 333 | .fields = std.mem.bytesAsSlice(Type.Enum.Field, std.mem.sliceAsBytes(extra_fields)), | |
| 334 | } }; | |
| 335 | }, | |
| 336 | .enum_incomplete => .{ | |
| 337 | .@"enum" = .{ | |
| 338 | .tag = null, | |
| 339 | .name = @enumFromInt(repr.data[0]), | |
| 340 | .decl_node = @enumFromInt(repr.data[1]), | |
| 341 | .incomplete = true, | |
| 342 | .fixed = false, | |
| 343 | .fields = &.{}, | |
| 344 | }, | |
| 345 | }, | |
| 346 | .enum_incomplete_fixed => .{ | |
| 347 | .@"enum" = .{ | |
| 348 | .tag = @bitCast(repr.data[0]), | |
| 349 | .name = @enumFromInt(comp.type_store.extra.items[repr.data[1]]), | |
| 350 | .decl_node = @enumFromInt(comp.type_store.extra.items[repr.data[1] + 1]), | |
| 351 | .incomplete = true, | |
| 352 | .fixed = true, | |
| 353 | .fields = &.{}, | |
| 354 | }, | |
| 355 | }, | |
| 356 | .typeof => .{ .typeof = .{ | |
| 357 | .base = @bitCast(repr.data[0]), | |
| 358 | .expr = null, | |
| 359 | } }, | |
| 360 | .typeof_expr => .{ .typeof = .{ | |
| 361 | .base = @bitCast(repr.data[0]), | |
| 362 | .expr = @enumFromInt(repr.data[1]), | |
| 363 | } }, | |
| 364 | .typedef => .{ .typedef = .{ | |
| 365 | .base = @bitCast(repr.data[0]), | |
| 366 | .name = @enumFromInt(comp.type_store.extra.items[repr.data[1]]), | |
| 367 | .decl_node = @enumFromInt(comp.type_store.extra.items[repr.data[1] + 1]), | |
| 368 | } }, | |
| 369 | .attributed => { | |
| 370 | const extra = comp.type_store.extra.items; | |
| 371 | return .{ .attributed = .{ | |
| 372 | .base = @bitCast(repr.data[0]), | |
| 373 | .attributes = comp.type_store.attributes.items[extra[repr.data[1]]..][0..extra[repr.data[1] + 1]], | |
| 374 | } }; | |
| 375 | }, | |
| 376 | .attributed_one => .{ .attributed = .{ | |
| 377 | .base = @bitCast(repr.data[0]), | |
| 378 | .attributes = comp.type_store.attributes.items[repr.data[1]..][0..1], | |
| 379 | } }, | |
| 380 | }; | |
| 381 | } | |
| 382 | ||
| 383 | pub fn base(qt: QualType, comp: *const Compilation) struct { type: Type, qt: QualType } { | |
| 384 | var cur = qt; | |
| 385 | while (true) switch (cur.type(comp)) { | |
| 386 | .typeof => |typeof| cur = typeof.base, | |
| 387 | .typedef => |typedef| cur = typedef.base, | |
| 388 | .attributed => |attributed| cur = attributed.base, | |
| 389 | else => |ty| return .{ .type = ty, .qt = cur }, | |
| 390 | }; | |
| 391 | } | |
| 392 | ||
| 393 | pub fn getRecord(qt: QualType, comp: *const Compilation) ?Type.Record { | |
| 394 | return switch (qt.base(comp).type) { | |
| 395 | .@"struct", .@"union" => |record| record, | |
| 396 | else => null, | |
| 397 | }; | |
| 398 | } | |
| 399 | ||
| 400 | pub fn get(qt: QualType, comp: *const Compilation, comptime tag: std.meta.Tag(Type)) ?@FieldType(Type, @tagName(tag)) { | |
| 401 | comptime std.debug.assert(tag != .typeof and tag != .attributed and tag != .typedef); | |
| 402 | switch (qt._index) { | |
| 403 | .invalid, .auto_type, .c23_auto => return null, | |
| 404 | else => {}, | |
| 405 | } | |
| 406 | ||
| 407 | const base_type = qt.base(comp).type; | |
| 408 | if (base_type == tag) return @field(base_type, @tagName(tag)); | |
| 409 | return null; | |
| 410 | } | |
| 411 | ||
| 412 | pub fn is(qt: QualType, comp: *const Compilation, comptime tag: std.meta.Tag(Type)) bool { | |
| 413 | return qt.get(comp, tag) != null; | |
| 414 | } | |
| 415 | ||
| 416 | pub fn childType(qt: QualType, comp: *const Compilation) QualType { | |
| 417 | if (qt.isInvalid()) return .invalid; | |
| 418 | return switch (qt.base(comp).type) { | |
| 419 | .complex => |complex| complex, | |
| 420 | .pointer => |pointer| pointer.child, | |
| 421 | .array => |array| array.elem, | |
| 422 | .vector => |vector| vector.elem, | |
| 423 | else => unreachable, | |
| 424 | }; | |
| 425 | } | |
| 426 | ||
| 427 | pub fn arrayLen(qt: QualType, comp: *Compilation) ?u64 { | |
| 428 | const array_type = switch (qt.base(comp).type) { | |
| 429 | .array => |array| array, | |
| 430 | .pointer => |pointer| blk: { | |
| 431 | const decayed = pointer.decayed orelse return null; | |
| 432 | break :blk decayed.get(comp, .array) orelse return null; | |
| 433 | }, | |
| 434 | else => return null, | |
| 435 | }; | |
| 436 | switch (array_type.len) { | |
| 437 | .fixed, .static => |len| return len, | |
| 438 | else => return null, | |
| 439 | } | |
| 440 | } | |
| 441 | ||
| 442 | pub const TypeSizeOrder = enum { lt, gt, eq, indeterminate }; | |
| 443 | ||
| 444 | pub fn sizeCompare(a: QualType, b: QualType, comp: *const Compilation) TypeSizeOrder { | |
| 445 | const a_size = a.sizeofOrNull(comp) orelse return .indeterminate; | |
| 446 | const b_size = b.sizeofOrNull(comp) orelse return .indeterminate; | |
| 447 | return switch (std.math.order(a_size, b_size)) { | |
| 448 | .lt => .lt, | |
| 449 | .gt => .gt, | |
| 450 | .eq => .eq, | |
| 451 | }; | |
| 452 | } | |
| 453 | ||
| 454 | /// Size of a type as reported by the sizeof operator. | |
| 455 | pub fn sizeof(qt: QualType, comp: *const Compilation) u64 { | |
| 456 | return qt.sizeofOrNull(comp).?; | |
| 457 | } | |
| 458 | ||
| 459 | /// Size of a type as reported by the sizeof operator. | |
| 460 | /// Returns null for incomplete types. | |
| 461 | pub fn sizeofOrNull(qt: QualType, comp: *const Compilation) ?u64 { | |
| 462 | if (qt.isInvalid()) return null; | |
| 463 | return loop: switch (qt.base(comp).type) { | |
| 464 | .void => 1, | |
| 465 | .bool => 1, | |
| 466 | .func => 1, | |
| 467 | .nullptr_t, .pointer => comp.target.ptrBitWidth() / 8, | |
| 468 | .int => |int_ty| int_ty.bits(comp) / 8, | |
| 469 | .float => |float_ty| float_ty.bits(comp) / 8, | |
| 470 | .complex => |complex| complex.sizeofOrNull(comp), | |
| 471 | .bit_int => |bit_int| { | |
| 472 | return std.mem.alignForward(u64, (@as(u32, bit_int.bits) + 7) / 8, qt.alignof(comp)); | |
| 473 | }, | |
| 474 | .atomic => |atomic| atomic.sizeofOrNull(comp), | |
| 475 | .vector => |vector| { | |
| 476 | const elem_size = vector.elem.sizeofOrNull(comp) orelse return null; | |
| 477 | return elem_size * vector.len; | |
| 478 | }, | |
| 479 | .array => |array| { | |
| 480 | const len = switch (array.len) { | |
| 481 | .variable, .unspecified_variable => return null, | |
| 482 | .incomplete => { | |
| 483 | return if (comp.langopts.emulate == .msvc) 0 else null; | |
| 484 | }, | |
| 485 | .fixed, .static => |len| len, | |
| 486 | }; | |
| 487 | const elem_size = array.elem.sizeofOrNull(comp) orelse return null; | |
| 488 | const arr_size = elem_size * len; | |
| 489 | if (comp.langopts.emulate == .msvc) { | |
| 490 | // msvc ignores array type alignment. | |
| 491 | // Since the size might not be a multiple of the field | |
| 492 | // alignment, the address of the second element might not be properly aligned | |
| 493 | // for the field alignment. A flexible array has size 0. See test case 0018. | |
| 494 | return arr_size; | |
| 495 | } else { | |
| 496 | return std.mem.alignForward(u64, arr_size, qt.alignof(comp)); | |
| 497 | } | |
| 498 | }, | |
| 499 | .@"struct", .@"union" => |record| { | |
| 500 | const layout = record.layout orelse return null; | |
| 501 | return layout.size_bits / 8; | |
| 502 | }, | |
| 503 | .@"enum" => |enum_ty| { | |
| 504 | const tag = enum_ty.tag orelse return null; | |
| 505 | continue :loop tag.base(comp).type; | |
| 506 | }, | |
| 507 | .typeof => unreachable, | |
| 508 | .typedef => unreachable, | |
| 509 | .attributed => unreachable, | |
| 510 | }; | |
| 511 | } | |
| 512 | ||
| 513 | /// Size of type in bits as it would have in a bitfield. | |
| 514 | pub fn bitSizeof(qt: QualType, comp: *const Compilation) u64 { | |
| 515 | return qt.bitSizeofOrNull(comp).?; | |
| 516 | } | |
| 517 | ||
| 518 | /// Size of type in bits as it would have in a bitfield. | |
| 519 | /// Returns null for incomplete types. | |
| 520 | pub fn bitSizeofOrNull(qt: QualType, comp: *const Compilation) ?u64 { | |
| 521 | if (qt.isInvalid()) return null; | |
| 522 | return loop: switch (qt.base(comp).type) { | |
| 523 | .bool => if (comp.langopts.emulate == .msvc) 8 else 1, | |
| 524 | .bit_int => |bit_int| bit_int.bits, | |
| 525 | .float => |float_ty| float_ty.bits(comp), | |
| 526 | .int => |int_ty| int_ty.bits(comp), | |
| 527 | .nullptr_t, .pointer => comp.target.ptrBitWidth(), | |
| 528 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 529 | .complex => |complex| { | |
| 530 | const child_size = complex.bitSizeofOrNull(comp) orelse return null; | |
| 531 | return child_size * 2; | |
| 532 | }, | |
| 533 | else => 8 * (qt.sizeofOrNull(comp) orelse return null), | |
| 534 | }; | |
| 535 | } | |
| 536 | ||
| 537 | pub fn hasIncompleteSize(qt: QualType, comp: *const Compilation) bool { | |
| 538 | if (qt.isInvalid()) return false; | |
| 539 | return switch (qt.base(comp).type) { | |
| 540 | .void => true, | |
| 541 | .array => |array| array.len == .incomplete, | |
| 542 | .@"enum" => |enum_ty| enum_ty.incomplete and !enum_ty.fixed, | |
| 543 | .@"struct", .@"union" => |record| record.layout == null, | |
| 544 | else => false, | |
| 545 | }; | |
| 546 | } | |
| 547 | ||
| 548 | pub fn signedness(qt: QualType, comp: *const Compilation) std.builtin.Signedness { | |
| 549 | return loop: switch (qt.base(comp).type) { | |
| 550 | .complex => |complex| continue :loop complex.base(comp).type, | |
| 551 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 552 | .bool => .unsigned, | |
| 553 | .bit_int => |bit_int| bit_int.signedness, | |
| 554 | .int => |int_ty| switch (int_ty) { | |
| 555 | .char => comp.getCharSignedness(), | |
| 556 | .schar, .short, .int, .long, .long_long, .int128 => .signed, | |
| 557 | .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128 => .unsigned, | |
| 558 | }, | |
| 559 | // Pointer values are signed. | |
| 560 | .pointer, .nullptr_t => .signed, | |
| 561 | .@"enum" => .signed, | |
| 562 | else => unreachable, | |
| 563 | }; | |
| 564 | } | |
| 565 | ||
| 566 | /// Size of a type as reported by the alignof operator. | |
| 567 | pub fn alignof(qt: QualType, comp: *const Compilation) u32 { | |
| 568 | if (qt.requestedAlignment(comp)) |requested| request: { | |
| 569 | if (qt.is(comp, .@"enum")) { | |
| 570 | if (comp.langopts.emulate == .gcc) { | |
| 571 | // gcc does not respect alignment on enums | |
| 572 | break :request; | |
| 573 | } | |
| 574 | } else if (qt.getRecord(comp)) |record_ty| { | |
| 575 | const layout = record_ty.layout orelse return 0; | |
| 576 | ||
| 577 | // don't return the attribute for records | |
| 578 | // layout has already accounted for requested alignment | |
| 579 | const computed = @divExact(layout.field_alignment_bits, 8); | |
| 580 | return @max(requested, computed); | |
| 581 | } else if (comp.langopts.emulate == .msvc) { | |
| 582 | const type_align = qt.base(comp).qt.alignof(comp); | |
| 583 | return @max(requested, type_align); | |
| 584 | } | |
| 585 | return requested; | |
| 586 | } | |
| 587 | ||
| 588 | return loop: switch (qt.base(comp).type) { | |
| 589 | .void => 1, | |
| 590 | .bool => 1, | |
| 591 | .int => |int_ty| switch (int_ty) { | |
| 592 | .char, | |
| 593 | .schar, | |
| 594 | .uchar, | |
| 595 | => 1, | |
| 596 | .short => comp.target.cTypeAlignment(.short), | |
| 597 | .ushort => comp.target.cTypeAlignment(.ushort), | |
| 598 | .int => comp.target.cTypeAlignment(.int), | |
| 599 | .uint => comp.target.cTypeAlignment(.uint), | |
| 600 | ||
| 601 | .long => comp.target.cTypeAlignment(.long), | |
| 602 | .ulong => comp.target.cTypeAlignment(.ulong), | |
| 603 | .long_long => comp.target.cTypeAlignment(.longlong), | |
| 604 | .ulong_long => comp.target.cTypeAlignment(.ulonglong), | |
| 605 | .int128, .uint128 => if (comp.target.cpu.arch == .s390x and comp.target.os.tag == .linux and comp.target.abi.isGnu()) 8 else 16, | |
| 606 | }, | |
| 607 | .float => |float_ty| switch (float_ty) { | |
| 608 | .float => comp.target.cTypeAlignment(.float), | |
| 609 | .double => comp.target.cTypeAlignment(.double), | |
| 610 | .long_double => comp.target.cTypeAlignment(.longdouble), | |
| 611 | .fp16, .float16 => 2, | |
| 612 | .float128 => 16, | |
| 613 | }, | |
| 614 | .bit_int => |bit_int| { | |
| 615 | // https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2709.pdf | |
| 616 | // _BitInt(N) types align with existing calling conventions. They have the same size and alignment as the | |
| 617 | // smallest basic type that can contain them. Types that are larger than __int64_t are conceptually treated | |
| 618 | // as struct of register size chunks. The number of chunks is the smallest number that can contain the type. | |
| 619 | if (bit_int.bits > 64) return 8; | |
| 620 | const basic_type = comp.intLeastN(bit_int.bits, bit_int.signedness); | |
| 621 | return basic_type.alignof(comp); | |
| 622 | }, | |
| 623 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 624 | .complex => |complex| continue :loop complex.base(comp).type, | |
| 625 | ||
| 626 | .pointer, .nullptr_t => switch (comp.target.cpu.arch) { | |
| 627 | .avr => 1, | |
| 628 | else => comp.target.ptrBitWidth() / 8, | |
| 629 | }, | |
| 630 | ||
| 631 | .func => target_util.defaultFunctionAlignment(comp.target), | |
| 632 | ||
| 633 | .array => |array| continue :loop array.elem.base(comp).type, | |
| 634 | .vector => |vector| continue :loop vector.elem.base(comp).type, | |
| 635 | ||
| 636 | .@"struct", .@"union" => |record| { | |
| 637 | const layout = record.layout orelse return 0; | |
| 638 | return layout.field_alignment_bits / 8; | |
| 639 | }, | |
| 640 | .@"enum" => |enum_ty| { | |
| 641 | const tag = enum_ty.tag orelse return 0; | |
| 642 | continue :loop tag.base(comp).type; | |
| 643 | }, | |
| 644 | .typeof => unreachable, | |
| 645 | .typedef => unreachable, | |
| 646 | .attributed => unreachable, | |
| 647 | }; | |
| 648 | } | |
| 649 | ||
| 650 | /// Suffix for integer values of this type | |
| 651 | pub fn intValueSuffix(qt: QualType, comp: *const Compilation) []const u8 { | |
| 652 | return switch (qt.get(comp, .int).?) { | |
| 653 | .short, .int => "", | |
| 654 | .long => "L", | |
| 655 | .long_long => "LL", | |
| 656 | .schar, .uchar, .char => { | |
| 657 | // Only 8-bit char supported currently; | |
| 658 | // TODO: handle platforms with 16-bit int + 16-bit char | |
| 659 | std.debug.assert(qt.sizeof(comp) == 1); | |
| 660 | return ""; | |
| 661 | }, | |
| 662 | .ushort => { | |
| 663 | if (qt.sizeof(comp) < int.sizeof(comp)) { | |
| 664 | return ""; | |
| 665 | } | |
| 666 | return "U"; | |
| 667 | }, | |
| 668 | .uint => "U", | |
| 669 | .ulong => "UL", | |
| 670 | .ulong_long => "ULL", | |
| 671 | else => unreachable, // TODO | |
| 672 | }; | |
| 673 | } | |
| 674 | ||
| 675 | /// printf format modifier | |
| 676 | pub fn formatModifier(qt: QualType, comp: *const Compilation) []const u8 { | |
| 677 | return switch (qt.get(comp, .int).?) { | |
| 678 | .schar, .uchar => "hh", | |
| 679 | .short, .ushort => "h", | |
| 680 | .int, .uint => "", | |
| 681 | .long, .ulong => "l", | |
| 682 | .long_long, .ulong_long => "ll", | |
| 683 | else => unreachable, // TODO | |
| 684 | }; | |
| 685 | } | |
| 686 | ||
| 687 | /// Make real int type unsigned. | |
| 688 | /// Discards attributes. | |
| 689 | pub fn makeIntUnsigned(qt: QualType, comp: *Compilation) !QualType { | |
| 690 | switch (qt.base(comp).type) { | |
| 691 | .int => |kind| switch (kind) { | |
| 692 | .char => return .uchar, | |
| 693 | .schar => return .uchar, | |
| 694 | .uchar => return .uchar, | |
| 695 | .short => return .ushort, | |
| 696 | .ushort => return .ushort, | |
| 697 | .int => return .uint, | |
| 698 | .uint => return .uint, | |
| 699 | .long => return .ulong, | |
| 700 | .ulong => return .ulong, | |
| 701 | .long_long => return .ulong_long, | |
| 702 | .ulong_long => return .ulong_long, | |
| 703 | .int128 => return .uint128, | |
| 704 | .uint128 => return .uint128, | |
| 705 | }, | |
| 706 | .bit_int => |bit_int| { | |
| 707 | return try comp.type_store.put(comp.gpa, .{ .bit_int = .{ | |
| 708 | .signedness = .unsigned, | |
| 709 | .bits = bit_int.bits, | |
| 710 | } }); | |
| 711 | }, | |
| 712 | else => unreachable, | |
| 713 | } | |
| 714 | } | |
| 715 | ||
| 716 | pub fn toReal(qt: QualType, comp: *const Compilation) QualType { | |
| 717 | return switch (qt.base(comp).type) { | |
| 718 | .complex => |complex| complex, | |
| 719 | else => qt, | |
| 720 | }; | |
| 721 | } | |
| 722 | ||
| 723 | pub fn toComplex(qt: QualType, comp: *Compilation) !QualType { | |
| 724 | if (std.debug.runtime_safety) { | |
| 725 | switch (qt.base(comp).type) { | |
| 726 | .complex => unreachable, | |
| 727 | .float => |float_ty| if (float_ty == .fp16) unreachable, | |
| 728 | .int, .bit_int => {}, | |
| 729 | else => unreachable, | |
| 730 | } | |
| 731 | } | |
| 732 | return comp.type_store.put(comp.gpa, .{ .complex = qt }); | |
| 733 | } | |
| 734 | ||
| 735 | pub fn decay(qt: QualType, comp: *Compilation) !QualType { | |
| 736 | if (qt.isInvalid()) return .invalid; | |
| 737 | switch (qt.base(comp).type) { | |
| 738 | .array => |array_ty| { | |
| 739 | // Copy const and volatile to the element | |
| 740 | var elem_qt = array_ty.elem; | |
| 741 | elem_qt.@"const" = qt.@"const" or elem_qt.@"const"; | |
| 742 | elem_qt.@"volatile" = qt.@"volatile" or elem_qt.@"volatile"; | |
| 743 | ||
| 744 | var pointer_qt = try comp.type_store.put(comp.gpa, .{ .pointer = .{ | |
| 745 | .child = elem_qt, | |
| 746 | .decayed = qt, | |
| 747 | } }); | |
| 748 | ||
| 749 | // .. and restrict to the pointer. | |
| 750 | pointer_qt.restrict = qt.restrict or array_ty.elem.restrict; | |
| 751 | return pointer_qt; | |
| 752 | }, | |
| 753 | .func => |func_ty| { | |
| 754 | if (func_ty.return_type.isInvalid()) { | |
| 755 | return .invalid; | |
| 756 | } | |
| 757 | for (func_ty.params) |param| { | |
| 758 | if (param.qt.isInvalid()) { | |
| 759 | return .invalid; | |
| 760 | } | |
| 761 | } | |
| 762 | ||
| 763 | return comp.type_store.put(comp.gpa, .{ .pointer = .{ | |
| 764 | .child = qt, | |
| 765 | .decayed = null, | |
| 766 | } }); | |
| 767 | }, | |
| 768 | else => return qt, | |
| 769 | } | |
| 770 | } | |
| 771 | ||
| 772 | /// Rank for floating point conversions, ignoring domain (complex vs real) | |
| 773 | /// Asserts that ty is a floating point type | |
| 774 | pub fn floatRank(qt: QualType, comp: *const Compilation) usize { | |
| 775 | return loop: switch (qt.base(comp).type) { | |
| 776 | .float => |float_ty| switch (float_ty) { | |
| 777 | // TODO: bfloat16 => 0 | |
| 778 | .float16 => 1, | |
| 779 | .fp16 => 2, | |
| 780 | .float => 3, | |
| 781 | .double => 4, | |
| 782 | .long_double => 5, | |
| 783 | .float128 => 6, | |
| 784 | // TODO: ibm128 => 7 | |
| 785 | }, | |
| 786 | .complex => |complex| continue :loop complex.base(comp).type, | |
| 787 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 788 | else => unreachable, | |
| 789 | }; | |
| 790 | } | |
| 791 | ||
| 792 | /// Rank for integer conversions, ignoring domain (complex vs real) | |
| 793 | /// Asserts that ty is an integer type | |
| 794 | pub fn intRank(qt: QualType, comp: *const Compilation) usize { | |
| 795 | return loop: switch (qt.base(comp).type) { | |
| 796 | .bit_int => |bit_int| @as(usize, bit_int.bits) * 8, | |
| 797 | .bool => 1 + @as(usize, @intCast((QualType.bool.bitSizeof(comp) * 8))), | |
| 798 | .int => |int_ty| switch (int_ty) { | |
| 799 | .char, .schar, .uchar => 2 + (int_ty.bits(comp) * 8), | |
| 800 | .short, .ushort => 3 + (int_ty.bits(comp) * 8), | |
| 801 | .int, .uint => 4 + (int_ty.bits(comp) * 8), | |
| 802 | .long, .ulong => 5 + (int_ty.bits(comp) * 8), | |
| 803 | .long_long, .ulong_long => 6 + (int_ty.bits(comp) * 8), | |
| 804 | .int128, .uint128 => 7 + (int_ty.bits(comp) * 8), | |
| 805 | }, | |
| 806 | .complex => |complex| continue :loop complex.base(comp).type, | |
| 807 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 808 | .@"enum" => |enum_ty| continue :loop enum_ty.tag.?.base(comp).type, | |
| 809 | else => unreachable, | |
| 810 | }; | |
| 811 | } | |
| 812 | ||
| 813 | pub fn intRankOrder(a: QualType, b: QualType, comp: *const Compilation) std.math.Order { | |
| 814 | std.debug.assert(a.isInt(comp) and b.isInt(comp)); | |
| 815 | ||
| 816 | const a_unsigned = a.signedness(comp) == .unsigned; | |
| 817 | const b_unsigned = b.signedness(comp) == .unsigned; | |
| 818 | ||
| 819 | const a_rank = a.intRank(comp); | |
| 820 | const b_rank = b.intRank(comp); | |
| 821 | if (a_unsigned == b_unsigned) { | |
| 822 | return std.math.order(a_rank, b_rank); | |
| 823 | } | |
| 824 | if (a_unsigned) { | |
| 825 | if (a_rank >= b_rank) return .gt; | |
| 826 | return .lt; | |
| 827 | } | |
| 828 | std.debug.assert(b_unsigned); | |
| 829 | if (b_rank >= a_rank) return .lt; | |
| 830 | return .gt; | |
| 831 | } | |
| 832 | ||
| 833 | /// Returns true if `a` and `b` are integer types that differ only in sign | |
| 834 | pub fn sameRankDifferentSign(a: QualType, b: QualType, comp: *const Compilation) bool { | |
| 835 | if (!a.isInt(comp) or !b.isInt(comp)) return false; | |
| 836 | if (a.hasIncompleteSize(comp) or b.hasIncompleteSize(comp)) return false; | |
| 837 | if (a.intRank(comp) != b.intRank(comp)) return false; | |
| 838 | return a.signedness(comp) != b.signedness(comp); | |
| 839 | } | |
| 840 | ||
| 841 | pub fn promoteInt(qt: QualType, comp: *const Compilation) QualType { | |
| 842 | return loop: switch (qt.base(comp).type) { | |
| 843 | .bool => return .int, | |
| 844 | .@"enum" => |enum_ty| if (enum_ty.tag) |tag| { | |
| 845 | continue :loop tag.base(comp).type; | |
| 846 | } else return .int, | |
| 847 | .bit_int => return qt, | |
| 848 | .complex => return qt, // Assume complex integer type | |
| 849 | .int => |int_ty| switch (int_ty) { | |
| 850 | .char, .schar, .uchar, .short => .int, | |
| 851 | .ushort => if (Type.Int.uchar.bits(comp) == Type.Int.int.bits(comp)) .uint else .int, | |
| 852 | else => return qt, | |
| 853 | }, | |
| 854 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 855 | else => unreachable, // Not an integer type | |
| 856 | }; | |
| 857 | } | |
| 858 | ||
| 859 | /// Promote a bitfield. If `int` can hold all the values of the underlying field, | |
| 860 | /// promote to int. Otherwise, promote to unsigned int | |
| 861 | /// Returns null if no promotion is necessary | |
| 862 | pub fn promoteBitfield(qt: QualType, comp: *const Compilation, width: u32) ?QualType { | |
| 863 | const type_size_bits = qt.bitSizeof(comp); | |
| 864 | ||
| 865 | // Note: GCC and clang will promote `long: 3` to int even though the C standard does not allow this | |
| 866 | if (width < type_size_bits) { | |
| 867 | return .int; | |
| 868 | } | |
| 869 | ||
| 870 | if (width == type_size_bits) { | |
| 871 | return if (qt.signedness(comp) == .unsigned) .uint else .int; | |
| 872 | } | |
| 873 | ||
| 874 | return null; | |
| 875 | } | |
| 876 | ||
| 877 | pub const ScalarKind = enum { | |
| 878 | @"enum", | |
| 879 | bool, | |
| 880 | int, | |
| 881 | float, | |
| 882 | pointer, | |
| 883 | nullptr_t, | |
| 884 | void_pointer, | |
| 885 | complex_int, | |
| 886 | complex_float, | |
| 887 | none, | |
| 888 | ||
| 889 | pub fn isInt(sk: ScalarKind) bool { | |
| 890 | return switch (sk) { | |
| 891 | .bool, .@"enum", .int, .complex_int => true, | |
| 892 | else => false, | |
| 893 | }; | |
| 894 | } | |
| 895 | ||
| 896 | pub fn isFloat(sk: ScalarKind) bool { | |
| 897 | return switch (sk) { | |
| 898 | .float, .complex_float => true, | |
| 899 | else => false, | |
| 900 | }; | |
| 901 | } | |
| 902 | ||
| 903 | pub fn isReal(sk: ScalarKind) bool { | |
| 904 | return switch (sk) { | |
| 905 | .complex_int, .complex_float => false, | |
| 906 | else => true, | |
| 907 | }; | |
| 908 | } | |
| 909 | ||
| 910 | pub fn isPointer(sk: ScalarKind) bool { | |
| 911 | return switch (sk) { | |
| 912 | .pointer, .void_pointer => true, | |
| 913 | else => false, | |
| 914 | }; | |
| 915 | } | |
| 916 | ||
| 917 | /// Equivalent to isInt() or isFloat() | |
| 918 | pub fn isArithmetic(sk: ScalarKind) bool { | |
| 919 | return switch (sk) { | |
| 920 | .bool, .@"enum", .int, .complex_int, .float, .complex_float => true, | |
| 921 | else => false, | |
| 922 | }; | |
| 923 | } | |
| 924 | }; | |
| 925 | ||
| 926 | pub fn scalarKind(qt: QualType, comp: *const Compilation) ScalarKind { | |
| 927 | loop: switch (qt.base(comp).type) { | |
| 928 | .bool => return .bool, | |
| 929 | .int, .bit_int => return .int, | |
| 930 | .float => return .float, | |
| 931 | .nullptr_t => return .nullptr_t, | |
| 932 | .pointer => |pointer| switch (pointer.child.base(comp).type) { | |
| 933 | .void => return .void_pointer, | |
| 934 | else => return .pointer, | |
| 935 | }, | |
| 936 | .@"enum" => return .@"enum", | |
| 937 | .complex => |complex| switch (complex.base(comp).type) { | |
| 938 | .int, .bit_int => return .complex_int, | |
| 939 | .float => return .complex_float, | |
| 940 | else => unreachable, | |
| 941 | }, | |
| 942 | .atomic => |atomic| continue :loop atomic.base(comp).type, | |
| 943 | else => return .none, | |
| 944 | } | |
| 945 | } | |
| 946 | ||
| 947 | // Prefer calling scalarKind directly if checking multiple kinds. | |
| 948 | pub fn isInt(qt: QualType, comp: *const Compilation) bool { | |
| 949 | return qt.scalarKind(comp).isInt(); | |
| 950 | } | |
| 951 | ||
| 952 | pub fn isRealInt(qt: QualType, comp: *const Compilation) bool { | |
| 953 | const sk = qt.scalarKind(comp); | |
| 954 | return sk.isInt() and sk.isReal(); | |
| 955 | } | |
| 956 | ||
| 957 | // Prefer calling scalarKind directly if checking multiple kinds. | |
| 958 | pub fn isFloat(qt: QualType, comp: *const Compilation) bool { | |
| 959 | return qt.scalarKind(comp).isFloat(); | |
| 960 | } | |
| 961 | ||
| 962 | // Prefer calling scalarKind directly if checking multiple kinds. | |
| 963 | pub fn isPointer(qt: QualType, comp: *const Compilation) bool { | |
| 964 | return qt.scalarKind(comp).isPointer(); | |
| 965 | } | |
| 966 | ||
| 967 | pub fn eqlQualified(a_qt: QualType, b_qt: QualType, comp: *const Compilation) bool { | |
| 968 | if (a_qt.@"const" != b_qt.@"const") return false; | |
| 969 | if (a_qt.@"volatile" != b_qt.@"volatile") return false; | |
| 970 | if (a_qt.restrict != b_qt.restrict) return false; | |
| 971 | ||
| 972 | return a_qt.eql(b_qt, comp); | |
| 973 | } | |
| 974 | ||
| 975 | pub fn eql(a_qt: QualType, b_qt: QualType, comp: *const Compilation) bool { | |
| 976 | if (a_qt.isInvalid() or b_qt.isInvalid()) return false; | |
| 977 | if (a_qt._index == b_qt._index) return true; | |
| 978 | ||
| 979 | const a_type_qt = a_qt.base(comp); | |
| 980 | const a_type = a_type_qt.type; | |
| 981 | const b_type_qt = b_qt.base(comp); | |
| 982 | const b_type = b_type_qt.type; | |
| 983 | ||
| 984 | // Alignment check also guards against comparing incomplete enums to ints. | |
| 985 | if (a_type_qt.qt.alignof(comp) != b_type_qt.qt.alignof(comp)) return false; | |
| 986 | if (a_type == .@"enum" and b_type != .@"enum") { | |
| 987 | return a_type.@"enum".tag.?.eql(b_qt, comp); | |
| 988 | } else if (a_type != .@"enum" and b_type == .@"enum") { | |
| 989 | return b_type.@"enum".tag.?.eql(a_qt, comp); | |
| 990 | } | |
| 991 | ||
| 992 | if (std.meta.activeTag(a_type) != b_type) return false; | |
| 993 | switch (a_type) { | |
| 994 | .void => return true, | |
| 995 | .bool => return true, | |
| 996 | .nullptr_t => return true, | |
| 997 | .int => |a_int| return a_int == b_type.int, | |
| 998 | .float => |a_float| return a_float == b_type.float, | |
| 999 | .complex => |a_complex| { | |
| 1000 | const b_complex = b_type.complex; | |
| 1001 | // Complex child type cannot be qualified. | |
| 1002 | return a_complex.eql(b_complex, comp); | |
| 1003 | }, | |
| 1004 | .bit_int => |a_bit_int| { | |
| 1005 | const b_bit_int = b_type.bit_int; | |
| 1006 | if (a_bit_int.bits != b_bit_int.bits) return false; | |
| 1007 | if (a_bit_int.signedness != b_bit_int.signedness) return false; | |
| 1008 | return true; | |
| 1009 | }, | |
| 1010 | .atomic => |a_atomic| { | |
| 1011 | const b_atomic = b_type.atomic; | |
| 1012 | // Atomic child type cannot be qualified. | |
| 1013 | return a_atomic.eql(b_atomic, comp); | |
| 1014 | }, | |
| 1015 | .func => |a_func| { | |
| 1016 | const b_func = b_type.func; | |
| 1017 | ||
| 1018 | // Function return type cannot be qualified. | |
| 1019 | if (!a_func.return_type.eql(b_func.return_type, comp)) return false; | |
| 1020 | ||
| 1021 | if (a_func.params.len == 0 and b_func.params.len == 0) { | |
| 1022 | return (a_func.kind == .variadic) == (b_func.kind == .variadic); | |
| 1023 | } | |
| 1024 | ||
| 1025 | if (a_func.params.len != b_func.params.len) { | |
| 1026 | if (a_func.kind == .old_style and b_func.kind == .old_style) return true; | |
| 1027 | if (a_func.kind == .old_style or b_func.kind == .old_style) { | |
| 1028 | const maybe_has_params = if (a_func.kind == .old_style) b_func else a_func; | |
| 1029 | ||
| 1030 | // Check if any args undergo default argument promotion. | |
| 1031 | for (maybe_has_params.params) |param| { | |
| 1032 | switch (param.qt.base(comp).type) { | |
| 1033 | .bool => return false, | |
| 1034 | .int => |int_ty| switch (int_ty) { | |
| 1035 | .char, .uchar, .schar => return false, | |
| 1036 | else => {}, | |
| 1037 | }, | |
| 1038 | .float => |float_ty| if (float_ty != .double) return false, | |
| 1039 | .@"enum" => |enum_ty| { | |
| 1040 | if (comp.langopts.emulate == .clang and enum_ty.incomplete) return false; | |
| 1041 | }, | |
| 1042 | else => {}, | |
| 1043 | } | |
| 1044 | } | |
| 1045 | return true; | |
| 1046 | } | |
| 1047 | return false; | |
| 1048 | } | |
| 1049 | ||
| 1050 | if ((a_func.kind == .normal) != (b_func.kind == .normal)) return false; | |
| 1051 | ||
| 1052 | for (a_func.params, b_func.params) |a_param, b_param| { | |
| 1053 | // Function parameters cannot be qualified. | |
| 1054 | if (!a_param.qt.eql(b_param.qt, comp)) return false; | |
| 1055 | } | |
| 1056 | return true; | |
| 1057 | }, | |
| 1058 | .pointer => |a_pointer| { | |
| 1059 | const b_pointer = b_type.pointer; | |
| 1060 | return a_pointer.child.eqlQualified(b_pointer.child, comp); | |
| 1061 | }, | |
| 1062 | .array => |a_array| { | |
| 1063 | const b_array = b_type.array; | |
| 1064 | const a_len = switch (a_array.len) { | |
| 1065 | .fixed, .static => |len| len, | |
| 1066 | else => null, | |
| 1067 | }; | |
| 1068 | const b_len = switch (b_array.len) { | |
| 1069 | .fixed, .static => |len| len, | |
| 1070 | else => null, | |
| 1071 | }; | |
| 1072 | if (a_len != null and b_len != null) { | |
| 1073 | return a_len.? == b_len.?; | |
| 1074 | } | |
| 1075 | ||
| 1076 | // Array element qualifiers are ignored. | |
| 1077 | return a_array.elem.eql(b_array.elem, comp); | |
| 1078 | }, | |
| 1079 | .vector => |a_vector| { | |
| 1080 | const b_vector = b_type.vector; | |
| 1081 | if (a_vector.len != b_vector.len) return false; | |
| 1082 | ||
| 1083 | // Vector elemnent qualifiers are checked. | |
| 1084 | return a_vector.elem.eqlQualified(b_vector.elem, comp); | |
| 1085 | }, | |
| 1086 | .@"struct", .@"union", .@"enum" => return a_type_qt.qt._index == b_type_qt.qt._index, | |
| 1087 | ||
| 1088 | .typeof => unreachable, // Never returned from base() | |
| 1089 | .typedef => unreachable, // Never returned from base() | |
| 1090 | .attributed => unreachable, // Never returned from base() | |
| 1091 | } | |
| 1092 | } | |
| 1093 | ||
| 1094 | pub fn getAttribute(qt: QualType, comp: *const Compilation, comptime tag: Attribute.Tag) ?Attribute.ArgumentsForTag(tag) { | |
| 1095 | if (tag == .aligned) @compileError("use requestedAlignment"); | |
| 1096 | var it = Attribute.Iterator.initType(qt, comp); | |
| 1097 | while (it.next()) |item| { | |
| 1098 | const attribute, _ = item; | |
| 1099 | if (attribute.tag == tag) return @field(attribute.args, @tagName(tag)); | |
| 1100 | } | |
| 1101 | return null; | |
| 1102 | } | |
| 1103 | ||
| 1104 | pub fn hasAttribute(qt: QualType, comp: *const Compilation, tag: Attribute.Tag) bool { | |
| 1105 | var it = Attribute.Iterator.initType(qt, comp); | |
| 1106 | while (it.next()) |item| { | |
| 1107 | const attr, _ = item; | |
| 1108 | if (attr.tag == tag) return true; | |
| 1109 | } | |
| 1110 | return false; | |
| 1111 | } | |
| 1112 | ||
| 1113 | pub fn alignable(qt: QualType, comp: *const Compilation) bool { | |
| 1114 | if (qt.isInvalid()) return true; // Avoid redundant error. | |
| 1115 | const base_type = qt.base(comp); | |
| 1116 | return switch (base_type.type) { | |
| 1117 | .array, .void => false, | |
| 1118 | else => !base_type.qt.hasIncompleteSize(comp), | |
| 1119 | }; | |
| 1120 | } | |
| 1121 | ||
| 1122 | pub fn requestedAlignment(qt: QualType, comp: *const Compilation) ?u32 { | |
| 1123 | return annotationAlignment(comp, Attribute.Iterator.initType(qt, comp)); | |
| 1124 | } | |
| 1125 | ||
| 1126 | pub fn annotationAlignment(comp: *const Compilation, attrs: Attribute.Iterator) ?u32 { | |
| 1127 | var it = attrs; | |
| 1128 | var max_requested: ?u32 = null; | |
| 1129 | var last_aligned_index: ?usize = null; | |
| 1130 | while (it.next()) |item| { | |
| 1131 | const attribute, const index = item; | |
| 1132 | if (attribute.tag != .aligned) continue; | |
| 1133 | if (last_aligned_index) |aligned_index| { | |
| 1134 | // once we recurse into a new type, after an `aligned` attribute was found, we're done | |
| 1135 | if (index <= aligned_index) break; | |
| 1136 | } | |
| 1137 | last_aligned_index = index; | |
| 1138 | const requested = if (attribute.args.aligned.alignment) |alignment| alignment.requested else target_util.defaultAlignment(comp.target); | |
| 1139 | if (max_requested == null or max_requested.? < requested) { | |
| 1140 | max_requested = requested; | |
| 1141 | } | |
| 1142 | } | |
| 1143 | return max_requested; | |
| 1144 | } | |
| 1145 | ||
| 1146 | pub fn enumIsPacked(qt: QualType, comp: *const Compilation) bool { | |
| 1147 | std.debug.assert(qt.is(comp, .@"enum")); | |
| 1148 | return comp.langopts.short_enums or target_util.packAllEnums(comp.target) or qt.hasAttribute(comp, .@"packed"); | |
| 1149 | } | |
| 1150 | ||
| 1151 | pub fn shouldDesugar(qt: QualType, comp: *const Compilation) bool { | |
| 1152 | loop: switch (qt.type(comp)) { | |
| 1153 | .attributed => |attributed| continue :loop attributed.base.type(comp), | |
| 1154 | .pointer => |pointer| continue :loop pointer.child.type(comp), | |
| 1155 | .func => |func| { | |
| 1156 | for (func.params) |param| { | |
| 1157 | if (param.qt.shouldDesugar(comp)) return true; | |
| 1158 | } | |
| 1159 | continue :loop func.return_type.type(comp); | |
| 1160 | }, | |
| 1161 | .typeof => return true, | |
| 1162 | .typedef => |typedef| return !typedef.base.is(comp, .nullptr_t), | |
| 1163 | else => return false, | |
| 1164 | } | |
| 1165 | } | |
| 1166 | ||
| 1167 | pub fn print(qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1168 | if (qt.isC23Auto()) { | |
| 1169 | try w.writeAll("auto"); | |
| 1170 | return; | |
| 1171 | } | |
| 1172 | _ = try qt.printPrologue(comp, false, w); | |
| 1173 | try qt.printEpilogue(comp, false, w); | |
| 1174 | } | |
| 1175 | ||
| 1176 | pub fn printNamed(qt: QualType, name: []const u8, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1177 | if (qt.isC23Auto()) { | |
| 1178 | try w.print("auto {s}", .{name}); | |
| 1179 | return; | |
| 1180 | } | |
| 1181 | const simple = try qt.printPrologue(comp, false, w); | |
| 1182 | if (simple) try w.writeByte(' '); | |
| 1183 | try w.writeAll(name); | |
| 1184 | try qt.printEpilogue(comp, false, w); | |
| 1185 | } | |
| 1186 | ||
| 1187 | pub fn printDesugared(qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1188 | _ = try qt.printPrologue(comp, true, w); | |
| 1189 | try qt.printEpilogue(comp, true, w); | |
| 1190 | } | |
| 1191 | ||
| 1192 | fn printPrologue(qt: QualType, comp: *const Compilation, desugar: bool, w: *std.Io.Writer) std.Io.Writer.Error!bool { | |
| 1193 | loop: switch (qt.type(comp)) { | |
| 1194 | .pointer => |pointer| { | |
| 1195 | const simple = try pointer.child.printPrologue(comp, desugar, w); | |
| 1196 | if (simple) try w.writeByte(' '); | |
| 1197 | switch (pointer.child.base(comp).type) { | |
| 1198 | .func, .array => try w.writeByte('('), | |
| 1199 | else => {}, | |
| 1200 | } | |
| 1201 | try w.writeByte('*'); | |
| 1202 | if (qt.@"const") try w.writeAll("const"); | |
| 1203 | if (qt.@"volatile") { | |
| 1204 | if (qt.@"const") try w.writeByte(' '); | |
| 1205 | try w.writeAll("volatile"); | |
| 1206 | } | |
| 1207 | if (qt.restrict) { | |
| 1208 | if (qt.@"const" or qt.@"volatile") try w.writeByte(' '); | |
| 1209 | try w.writeAll("restrict"); | |
| 1210 | } | |
| 1211 | return false; | |
| 1212 | }, | |
| 1213 | .func => |func| { | |
| 1214 | const simple = try func.return_type.printPrologue(comp, desugar, w); | |
| 1215 | if (simple) try w.writeByte(' '); | |
| 1216 | return false; | |
| 1217 | }, | |
| 1218 | .array => |array| { | |
| 1219 | if (qt.@"const") { | |
| 1220 | try w.writeAll("const "); | |
| 1221 | } | |
| 1222 | if (qt.@"volatile") { | |
| 1223 | try w.writeAll("volatile"); | |
| 1224 | } | |
| 1225 | ||
| 1226 | const simple = try array.elem.printPrologue(comp, desugar, w); | |
| 1227 | if (simple) try w.writeByte(' '); | |
| 1228 | return false; | |
| 1229 | }, | |
| 1230 | .typeof => |typeof| if (desugar) { | |
| 1231 | continue :loop typeof.base.type(comp); | |
| 1232 | } else { | |
| 1233 | try w.writeAll("typeof("); | |
| 1234 | try typeof.base.print(comp, w); | |
| 1235 | try w.writeAll(")"); | |
| 1236 | return true; | |
| 1237 | }, | |
| 1238 | .typedef => |typedef| if (desugar) { | |
| 1239 | continue :loop typedef.base.type(comp); | |
| 1240 | } else { | |
| 1241 | try w.writeAll(typedef.name.lookup(comp)); | |
| 1242 | return true; | |
| 1243 | }, | |
| 1244 | .attributed => |attributed| continue :loop attributed.base.type(comp), | |
| 1245 | else => {}, | |
| 1246 | } | |
| 1247 | if (qt.@"const") try w.writeAll("const "); | |
| 1248 | if (qt.@"volatile") try w.writeAll("volatile "); | |
| 1249 | ||
| 1250 | switch (qt.base(comp).type) { | |
| 1251 | .pointer => unreachable, | |
| 1252 | .func => unreachable, | |
| 1253 | .array => unreachable, | |
| 1254 | .typeof => unreachable, | |
| 1255 | .typedef => unreachable, | |
| 1256 | .attributed => unreachable, | |
| 1257 | ||
| 1258 | .void => try w.writeAll("void"), | |
| 1259 | .bool => try w.writeAll(if (comp.langopts.standard.atLeast(.c23)) "bool" else "_Bool"), | |
| 1260 | .nullptr_t => try w.writeAll("nullptr_t"), | |
| 1261 | .int => |int_ty| switch (int_ty) { | |
| 1262 | .char => try w.writeAll("char"), | |
| 1263 | .schar => try w.writeAll("signed char"), | |
| 1264 | .uchar => try w.writeAll("unsigned char"), | |
| 1265 | .short => try w.writeAll("short"), | |
| 1266 | .ushort => try w.writeAll("unsigned short"), | |
| 1267 | .int => try w.writeAll("int"), | |
| 1268 | .uint => try w.writeAll("unsigned int"), | |
| 1269 | .long => try w.writeAll("long"), | |
| 1270 | .ulong => try w.writeAll("unsigned long"), | |
| 1271 | .long_long => try w.writeAll("long long"), | |
| 1272 | .ulong_long => try w.writeAll("unsigned long long"), | |
| 1273 | .int128 => try w.writeAll("__int128"), | |
| 1274 | .uint128 => try w.writeAll("unsigned __int128"), | |
| 1275 | }, | |
| 1276 | .bit_int => |bit_int| try w.print("{s} _BitInt({d})", .{ @tagName(bit_int.signedness), bit_int.bits }), | |
| 1277 | .float => |float_ty| switch (float_ty) { | |
| 1278 | .fp16 => try w.writeAll("__fp16"), | |
| 1279 | .float16 => try w.writeAll("_Float16"), | |
| 1280 | .float => try w.writeAll("float"), | |
| 1281 | .double => try w.writeAll("double"), | |
| 1282 | .long_double => try w.writeAll("long double"), | |
| 1283 | .float128 => try w.writeAll("__float128"), | |
| 1284 | }, | |
| 1285 | .complex => |complex| { | |
| 1286 | try w.writeAll("_Complex "); | |
| 1287 | _ = try complex.printPrologue(comp, desugar, w); | |
| 1288 | }, | |
| 1289 | .atomic => |atomic| { | |
| 1290 | try w.writeAll("_Atomic("); | |
| 1291 | _ = try atomic.printPrologue(comp, desugar, w); | |
| 1292 | try atomic.printEpilogue(comp, desugar, w); | |
| 1293 | try w.writeAll(")"); | |
| 1294 | }, | |
| 1295 | ||
| 1296 | .vector => |vector| { | |
| 1297 | try w.print("__attribute__((__vector_size__({d} * sizeof(", .{vector.len}); | |
| 1298 | _ = try vector.elem.printPrologue(comp, desugar, w); | |
| 1299 | try w.writeAll(")))) "); | |
| 1300 | _ = try vector.elem.printPrologue(comp, desugar, w); | |
| 1301 | }, | |
| 1302 | ||
| 1303 | .@"struct" => |struct_ty| try w.print("struct {s}", .{struct_ty.name.lookup(comp)}), | |
| 1304 | .@"union" => |union_ty| try w.print("union {s}", .{union_ty.name.lookup(comp)}), | |
| 1305 | .@"enum" => |enum_ty| if (enum_ty.fixed) { | |
| 1306 | try w.print("enum {s}: ", .{enum_ty.name.lookup(comp)}); | |
| 1307 | _ = try enum_ty.tag.?.printPrologue(comp, desugar, w); | |
| 1308 | } else { | |
| 1309 | try w.print("enum {s}", .{enum_ty.name.lookup(comp)}); | |
| 1310 | }, | |
| 1311 | } | |
| 1312 | return true; | |
| 1313 | } | |
| 1314 | ||
| 1315 | fn printEpilogue(qt: QualType, comp: *const Compilation, desugar: bool, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1316 | loop: switch (qt.type(comp)) { | |
| 1317 | .pointer => |pointer| { | |
| 1318 | switch (pointer.child.base(comp).type) { | |
| 1319 | .func, .array => try w.writeByte(')'), | |
| 1320 | else => {}, | |
| 1321 | } | |
| 1322 | continue :loop pointer.child.type(comp); | |
| 1323 | }, | |
| 1324 | .func => |func| { | |
| 1325 | try w.writeByte('('); | |
| 1326 | for (func.params, 0..) |param, i| { | |
| 1327 | if (i != 0) try w.writeAll(", "); | |
| 1328 | _ = try param.qt.printPrologue(comp, desugar, w); | |
| 1329 | try param.qt.printEpilogue(comp, desugar, w); | |
| 1330 | } | |
| 1331 | if (func.kind != .normal) { | |
| 1332 | if (func.params.len != 0) try w.writeAll(", "); | |
| 1333 | try w.writeAll("..."); | |
| 1334 | } else if (func.params.len == 0 and !comp.langopts.standard.atLeast(.c23)) { | |
| 1335 | try w.writeAll("void"); | |
| 1336 | } | |
| 1337 | try w.writeByte(')'); | |
| 1338 | continue :loop func.return_type.type(comp); | |
| 1339 | }, | |
| 1340 | .array => |array| { | |
| 1341 | try w.writeByte('['); | |
| 1342 | switch (array.len) { | |
| 1343 | .fixed, .static => |len| try w.print("{d}", .{len}), | |
| 1344 | .incomplete => {}, | |
| 1345 | .unspecified_variable => try w.writeByte('*'), | |
| 1346 | .variable => try w.writeAll("<expr>"), | |
| 1347 | } | |
| 1348 | ||
| 1349 | const static = array.len == .static; | |
| 1350 | if (static) try w.writeAll("static"); | |
| 1351 | if (qt.restrict) { | |
| 1352 | if (static or qt.@"const" or qt.@"volatile") try w.writeByte(' '); | |
| 1353 | try w.writeAll("restrict"); | |
| 1354 | } | |
| 1355 | try w.writeByte(']'); | |
| 1356 | ||
| 1357 | continue :loop array.elem.type(comp); | |
| 1358 | }, | |
| 1359 | .attributed => |attributed| continue :loop attributed.base.type(comp), | |
| 1360 | else => {}, | |
| 1361 | } | |
| 1362 | } | |
| 1363 | ||
| 1364 | pub fn dump(qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1365 | if (qt.@"const") try w.writeAll("const "); | |
| 1366 | if (qt.@"volatile") try w.writeAll("volatile "); | |
| 1367 | if (qt.restrict) try w.writeAll("restrict "); | |
| 1368 | if (qt.isInvalid()) return w.writeAll("invalid"); | |
| 1369 | switch (qt.type(comp)) { | |
| 1370 | .pointer => |pointer| { | |
| 1371 | if (pointer.decayed) |decayed| { | |
| 1372 | try w.writeAll("decayed *"); | |
| 1373 | try decayed.dump(comp, w); | |
| 1374 | } else { | |
| 1375 | try w.writeAll("*"); | |
| 1376 | try pointer.child.dump(comp, w); | |
| 1377 | } | |
| 1378 | }, | |
| 1379 | .func => |func| { | |
| 1380 | if (func.kind == .old_style) | |
| 1381 | try w.writeAll("kr (") | |
| 1382 | else | |
| 1383 | try w.writeAll("fn ("); | |
| 1384 | ||
| 1385 | for (func.params, 0..) |param, i| { | |
| 1386 | if (i != 0) try w.writeAll(", "); | |
| 1387 | if (param.name != .empty) try w.print("{s}: ", .{param.name.lookup(comp)}); | |
| 1388 | try param.qt.dump(comp, w); | |
| 1389 | } | |
| 1390 | if (func.kind != .normal) { | |
| 1391 | if (func.params.len != 0) try w.writeAll(", "); | |
| 1392 | try w.writeAll("..."); | |
| 1393 | } | |
| 1394 | try w.writeAll(") "); | |
| 1395 | try func.return_type.dump(comp, w); | |
| 1396 | }, | |
| 1397 | .array => |array| { | |
| 1398 | switch (array.len) { | |
| 1399 | .fixed => |len| try w.print("[{d}]", .{len}), | |
| 1400 | .static => |len| try w.print("[static {d}]", .{len}), | |
| 1401 | .incomplete => try w.writeAll("[]"), | |
| 1402 | .unspecified_variable => try w.writeAll("[*]"), | |
| 1403 | .variable => try w.writeAll("[<expr>]"), | |
| 1404 | } | |
| 1405 | try array.elem.dump(comp, w); | |
| 1406 | }, | |
| 1407 | .vector => |vector| { | |
| 1408 | try w.print("vector({d}, ", .{vector.len}); | |
| 1409 | try vector.elem.dump(comp, w); | |
| 1410 | try w.writeAll(")"); | |
| 1411 | }, | |
| 1412 | .typeof => |typeof| { | |
| 1413 | try w.writeAll("typeof("); | |
| 1414 | if (typeof.expr != null) try w.writeAll("<expr>: "); | |
| 1415 | try typeof.base.dump(comp, w); | |
| 1416 | try w.writeAll(")"); | |
| 1417 | }, | |
| 1418 | .attributed => |attributed| { | |
| 1419 | try w.writeAll("attributed("); | |
| 1420 | try attributed.base.dump(comp, w); | |
| 1421 | try w.writeAll(")"); | |
| 1422 | }, | |
| 1423 | .typedef => |typedef| { | |
| 1424 | try w.writeAll(typedef.name.lookup(comp)); | |
| 1425 | try w.writeAll(": "); | |
| 1426 | try typedef.base.dump(comp, w); | |
| 1427 | }, | |
| 1428 | .@"enum" => |enum_ty| { | |
| 1429 | try w.print("enum {s}: ", .{enum_ty.name.lookup(comp)}); | |
| 1430 | if (enum_ty.tag) |some| { | |
| 1431 | try some.dump(comp, w); | |
| 1432 | } else { | |
| 1433 | try w.writeAll("<incomplete>"); | |
| 1434 | } | |
| 1435 | }, | |
| 1436 | else => try qt.unqualified().print(comp, w), | |
| 1437 | } | |
| 1438 | } | |
| 1439 | }; | |
| 1440 | ||
| 1441 | pub const Type = union(enum) { | |
| 1442 | void, | |
| 1443 | bool, | |
| 1444 | /// C23 nullptr_t | |
| 1445 | nullptr_t, | |
| 1446 | ||
| 1447 | int: Int, | |
| 1448 | float: Float, | |
| 1449 | complex: QualType, | |
| 1450 | bit_int: BitInt, | |
| 1451 | atomic: QualType, | |
| 1452 | ||
| 1453 | func: Func, | |
| 1454 | pointer: Pointer, | |
| 1455 | array: Array, | |
| 1456 | vector: Vector, | |
| 1457 | ||
| 1458 | @"struct": Record, | |
| 1459 | @"union": Record, | |
| 1460 | @"enum": Enum, | |
| 1461 | ||
| 1462 | typeof: TypeOf, | |
| 1463 | typedef: TypeDef, | |
| 1464 | attributed: Attributed, | |
| 1465 | ||
| 1466 | pub const Int = enum { | |
| 1467 | char, | |
| 1468 | schar, | |
| 1469 | uchar, | |
| 1470 | short, | |
| 1471 | ushort, | |
| 1472 | int, | |
| 1473 | uint, | |
| 1474 | long, | |
| 1475 | ulong, | |
| 1476 | long_long, | |
| 1477 | ulong_long, | |
| 1478 | int128, | |
| 1479 | uint128, | |
| 1480 | ||
| 1481 | pub fn bits(int: Int, comp: *const Compilation) u16 { | |
| 1482 | return switch (int) { | |
| 1483 | .char => comp.target.cTypeBitSize(.char), | |
| 1484 | .schar => comp.target.cTypeBitSize(.char), | |
| 1485 | .uchar => comp.target.cTypeBitSize(.char), | |
| 1486 | .short => comp.target.cTypeBitSize(.short), | |
| 1487 | .ushort => comp.target.cTypeBitSize(.ushort), | |
| 1488 | .int => comp.target.cTypeBitSize(.int), | |
| 1489 | .uint => comp.target.cTypeBitSize(.uint), | |
| 1490 | .long => comp.target.cTypeBitSize(.long), | |
| 1491 | .ulong => comp.target.cTypeBitSize(.ulong), | |
| 1492 | .long_long => comp.target.cTypeBitSize(.longlong), | |
| 1493 | .ulong_long => comp.target.cTypeBitSize(.ulonglong), | |
| 1494 | .int128 => 128, | |
| 1495 | .uint128 => 128, | |
| 1496 | }; | |
| 1497 | } | |
| 1498 | }; | |
| 1499 | ||
| 1500 | pub const Float = enum { | |
| 1501 | fp16, | |
| 1502 | float16, | |
| 1503 | float, | |
| 1504 | double, | |
| 1505 | long_double, | |
| 1506 | float128, | |
| 1507 | ||
| 1508 | pub fn bits(float: Float, comp: *const Compilation) u16 { | |
| 1509 | return switch (float) { | |
| 1510 | .fp16 => 16, | |
| 1511 | .float16 => 16, | |
| 1512 | .float => comp.target.cTypeBitSize(.float), | |
| 1513 | .double => comp.target.cTypeBitSize(.double), | |
| 1514 | .long_double => comp.target.cTypeBitSize(.longdouble), | |
| 1515 | .float128 => 128, | |
| 1516 | }; | |
| 1517 | } | |
| 1518 | }; | |
| 1519 | ||
| 1520 | pub const BitInt = struct { | |
| 1521 | /// Must be >= 1 if unsigned and >= 2 if signed | |
| 1522 | bits: u16, | |
| 1523 | signedness: std.builtin.Signedness, | |
| 1524 | }; | |
| 1525 | ||
| 1526 | pub const Func = struct { | |
| 1527 | return_type: QualType, | |
| 1528 | kind: enum { | |
| 1529 | /// int foo(int bar, char baz) and int (void) | |
| 1530 | normal, | |
| 1531 | /// int foo(int bar, char baz, ...) | |
| 1532 | variadic, | |
| 1533 | /// int foo(bar, baz) and int foo() | |
| 1534 | /// is also var args, but we can give warnings about incorrect amounts of parameters | |
| 1535 | old_style, | |
| 1536 | }, | |
| 1537 | params: []const Param, | |
| 1538 | ||
| 1539 | pub const Param = extern struct { | |
| 1540 | qt: QualType, | |
| 1541 | name: StringId, | |
| 1542 | name_tok: TokenIndex, | |
| 1543 | node: Node.OptIndex, | |
| 1544 | }; | |
| 1545 | }; | |
| 1546 | ||
| 1547 | pub const Pointer = struct { | |
| 1548 | child: QualType, | |
| 1549 | decayed: ?QualType, | |
| 1550 | }; | |
| 1551 | ||
| 1552 | pub const Array = struct { | |
| 1553 | elem: QualType, | |
| 1554 | len: union(enum) { | |
| 1555 | incomplete, | |
| 1556 | fixed: u64, | |
| 1557 | static: u64, | |
| 1558 | variable: Node.Index, | |
| 1559 | unspecified_variable, | |
| 1560 | }, | |
| 1561 | }; | |
| 1562 | ||
| 1563 | pub const Vector = struct { | |
| 1564 | elem: QualType, | |
| 1565 | len: u32, | |
| 1566 | }; | |
| 1567 | ||
| 1568 | pub const Record = struct { | |
| 1569 | name: StringId, | |
| 1570 | decl_node: Node.Index, | |
| 1571 | layout: ?Layout = null, | |
| 1572 | fields: []const Field, | |
| 1573 | ||
| 1574 | pub const Field = extern struct { | |
| 1575 | qt: QualType, | |
| 1576 | name: StringId, | |
| 1577 | /// zero for anonymous fields | |
| 1578 | name_tok: TokenIndex = 0, | |
| 1579 | bit_width: enum(u32) { | |
| 1580 | null = std.math.maxInt(u32), | |
| 1581 | _, | |
| 1582 | ||
| 1583 | pub fn unpack(width: @This()) ?u32 { | |
| 1584 | if (width == .null) return null; | |
| 1585 | return @intFromEnum(width); | |
| 1586 | } | |
| 1587 | } = .null, | |
| 1588 | layout: Field.Layout = .{ | |
| 1589 | .offset_bits = 0, | |
| 1590 | .size_bits = 0, | |
| 1591 | }, | |
| 1592 | _attr_index: u32 = 0, | |
| 1593 | _attr_len: u32 = 0, | |
| 1594 | ||
| 1595 | pub fn attributes(field: Field, comp: *const Compilation) []const Attribute { | |
| 1596 | return comp.type_store.attributes.items[field._attr_index..][0..field._attr_len]; | |
| 1597 | } | |
| 1598 | ||
| 1599 | pub const Layout = extern struct { | |
| 1600 | /// `offset_bits` and `size_bits` should both be INVALID if and only if the field | |
| 1601 | /// is an unnamed bitfield. There is no way to reference an unnamed bitfield in C, so | |
| 1602 | /// there should be no way to observe these values. If it is used, this value will | |
| 1603 | /// maximize the chance that a safety-checked overflow will occur. | |
| 1604 | const INVALID = std.math.maxInt(u64); | |
| 1605 | ||
| 1606 | /// The offset of the field, in bits, from the start of the struct. | |
| 1607 | offset_bits: u64 align(4) = INVALID, | |
| 1608 | /// The size, in bits, of the field. | |
| 1609 | /// | |
| 1610 | /// For bit-fields, this is the width of the field. | |
| 1611 | size_bits: u64 align(4) = INVALID, | |
| 1612 | }; | |
| 1613 | }; | |
| 1614 | ||
| 1615 | pub const Layout = extern struct { | |
| 1616 | /// The size of the type in bits. | |
| 1617 | /// | |
| 1618 | /// This is the value returned by `sizeof` in C | |
| 1619 | /// (but in bits instead of bytes). This is a multiple of `pointer_alignment_bits`. | |
| 1620 | size_bits: u64 align(4), | |
| 1621 | /// The alignment of the type, in bits, when used as a field in a record. | |
| 1622 | /// | |
| 1623 | /// This is usually the value returned by `_Alignof` in C, but there are some edge | |
| 1624 | /// cases in GCC where `_Alignof` returns a smaller value. | |
| 1625 | field_alignment_bits: u32, | |
| 1626 | /// The alignment, in bits, of valid pointers to this type. | |
| 1627 | /// `size_bits` is a multiple of this value. | |
| 1628 | pointer_alignment_bits: u32, | |
| 1629 | /// The required alignment of the type in bits. | |
| 1630 | /// | |
| 1631 | /// This value is only used by MSVC targets. It is 8 on all other | |
| 1632 | /// targets. On MSVC targets, this value restricts the effects of `#pragma pack` except | |
| 1633 | /// in some cases involving bit-fields. | |
| 1634 | required_alignment_bits: u32, | |
| 1635 | }; | |
| 1636 | ||
| 1637 | pub fn isAnonymous(record: Record, comp: *const Compilation) bool { | |
| 1638 | // anonymous records can be recognized by their names which are in | |
| 1639 | // the format "(anonymous TAG at path:line:col)". | |
| 1640 | return record.name.lookup(comp)[0] == '('; | |
| 1641 | } | |
| 1642 | ||
| 1643 | pub fn hasField(record: Record, comp: *const Compilation, name: StringId) bool { | |
| 1644 | std.debug.assert(record.layout != null); | |
| 1645 | std.debug.assert(name != .empty); | |
| 1646 | for (record.fields) |field| { | |
| 1647 | if (name == field.name) return true; | |
| 1648 | if (field.name_tok == 0) if (field.qt.getRecord(comp)) |field_record_ty| { | |
| 1649 | if (field_record_ty.hasField(comp, name)) return true; | |
| 1650 | }; | |
| 1651 | } | |
| 1652 | return false; | |
| 1653 | } | |
| 1654 | }; | |
| 1655 | ||
| 1656 | pub const Enum = struct { | |
| 1657 | /// Null if the enum is incomplete and not fixed. | |
| 1658 | tag: ?QualType, | |
| 1659 | fixed: bool, | |
| 1660 | incomplete: bool, | |
| 1661 | name: StringId, | |
| 1662 | decl_node: Node.Index, | |
| 1663 | fields: []const Field, | |
| 1664 | ||
| 1665 | pub const Field = extern struct { | |
| 1666 | qt: QualType, | |
| 1667 | name: StringId, | |
| 1668 | name_tok: TokenIndex, | |
| 1669 | }; | |
| 1670 | ||
| 1671 | pub fn isAnonymous(@"enum": Enum, comp: *const Compilation) bool { | |
| 1672 | // anonymous enums can be recognized by their names which are in | |
| 1673 | // the format "(anonymous TAG at path:line:col)". | |
| 1674 | return @"enum".name.lookup(comp)[0] == '('; | |
| 1675 | } | |
| 1676 | }; | |
| 1677 | ||
| 1678 | pub const TypeOf = struct { | |
| 1679 | base: QualType, | |
| 1680 | expr: ?Node.Index, | |
| 1681 | }; | |
| 1682 | ||
| 1683 | pub const TypeDef = struct { | |
| 1684 | base: QualType, | |
| 1685 | name: StringId, | |
| 1686 | decl_node: Node.Index, | |
| 1687 | }; | |
| 1688 | ||
| 1689 | pub const Attributed = struct { | |
| 1690 | base: QualType, | |
| 1691 | attributes: []const Attribute, | |
| 1692 | }; | |
| 1693 | }; | |
| 1694 | ||
| 1695 | types: std.MultiArrayList(Repr) = .empty, | |
| 1696 | extra: std.ArrayList(u32) = .empty, | |
| 1697 | attributes: std.ArrayList(Attribute) = .empty, | |
| 1698 | anon_name_arena: std.heap.ArenaAllocator.State = .{}, | |
| 1699 | ||
| 1700 | wchar: QualType = .invalid, | |
| 1701 | uint_least16_t: QualType = .invalid, | |
| 1702 | uint_least32_t: QualType = .invalid, | |
| 1703 | ptrdiff: QualType = .invalid, | |
| 1704 | size: QualType = .invalid, | |
| 1705 | va_list: QualType = .invalid, | |
| 1706 | pid_t: QualType = .invalid, | |
| 1707 | ns_constant_string: QualType = .invalid, | |
| 1708 | file: QualType = .invalid, | |
| 1709 | jmp_buf: QualType = .invalid, | |
| 1710 | sigjmp_buf: QualType = .invalid, | |
| 1711 | ucontext_t: QualType = .invalid, | |
| 1712 | intmax: QualType = .invalid, | |
| 1713 | intptr: QualType = .invalid, | |
| 1714 | int16: QualType = .invalid, | |
| 1715 | int64: QualType = .invalid, | |
| 1716 | ||
| 1717 | pub fn deinit(ts: *TypeStore, gpa: std.mem.Allocator) void { | |
| 1718 | ts.types.deinit(gpa); | |
| 1719 | ts.extra.deinit(gpa); | |
| 1720 | ts.attributes.deinit(gpa); | |
| 1721 | ts.anon_name_arena.promote(gpa).deinit(); | |
| 1722 | ts.* = undefined; | |
| 1723 | } | |
| 1724 | ||
| 1725 | pub fn put(ts: *TypeStore, gpa: std.mem.Allocator, ty: Type) !QualType { | |
| 1726 | return .{ ._index = try ts.putExtra(gpa, ty) }; | |
| 1727 | } | |
| 1728 | ||
| 1729 | pub fn putExtra(ts: *TypeStore, gpa: std.mem.Allocator, ty: Type) !Index { | |
| 1730 | switch (ty) { | |
| 1731 | .void => return .void, | |
| 1732 | .bool => return .bool, | |
| 1733 | .nullptr_t => return .nullptr_t, | |
| 1734 | .int => |int| switch (int) { | |
| 1735 | .char => return .int_char, | |
| 1736 | .schar => return .int_schar, | |
| 1737 | .uchar => return .int_uchar, | |
| 1738 | .short => return .int_short, | |
| 1739 | .ushort => return .int_ushort, | |
| 1740 | .int => return .int_int, | |
| 1741 | .uint => return .int_uint, | |
| 1742 | .long => return .int_long, | |
| 1743 | .ulong => return .int_ulong, | |
| 1744 | .long_long => return .int_long_long, | |
| 1745 | .ulong_long => return .int_ulong_long, | |
| 1746 | .int128 => return .int_int128, | |
| 1747 | .uint128 => return .int_uint128, | |
| 1748 | }, | |
| 1749 | .float => |float| switch (float) { | |
| 1750 | .fp16 => return .float_fp16, | |
| 1751 | .float16 => return .float_float16, | |
| 1752 | .float => return .float_float, | |
| 1753 | .double => return .float_double, | |
| 1754 | .long_double => return .float_long_double, | |
| 1755 | .float128 => return .float_float128, | |
| 1756 | }, | |
| 1757 | else => {}, | |
| 1758 | } | |
| 1759 | const index = try ts.types.addOne(gpa); | |
| 1760 | try ts.set(gpa, ty, index); | |
| 1761 | return @enumFromInt(index); | |
| 1762 | } | |
| 1763 | ||
| 1764 | pub fn set(ts: *TypeStore, gpa: std.mem.Allocator, ty: Type, index: usize) !void { | |
| 1765 | var repr: Repr = undefined; | |
| 1766 | switch (ty) { | |
| 1767 | .void => unreachable, | |
| 1768 | .bool => unreachable, | |
| 1769 | .nullptr_t => unreachable, | |
| 1770 | .int => unreachable, | |
| 1771 | .float => unreachable, | |
| 1772 | .complex => |complex| { | |
| 1773 | repr.tag = .complex; | |
| 1774 | repr.data[0] = @bitCast(complex); | |
| 1775 | }, | |
| 1776 | .bit_int => |bit_int| { | |
| 1777 | repr.tag = .bit_int; | |
| 1778 | repr.data[0] = bit_int.bits; | |
| 1779 | repr.data[1] = @intFromEnum(bit_int.signedness); | |
| 1780 | }, | |
| 1781 | .atomic => |atomic| { | |
| 1782 | repr.tag = .atomic; | |
| 1783 | std.debug.assert(!atomic.@"const" and !atomic.@"volatile"); | |
| 1784 | repr.data[0] = @bitCast(atomic); | |
| 1785 | }, | |
| 1786 | .func => |func| { | |
| 1787 | repr.data[0] = @bitCast(func.return_type); | |
| 1788 | ||
| 1789 | const extra_index: u32 = @intCast(ts.extra.items.len); | |
| 1790 | repr.data[1] = extra_index; | |
| 1791 | if (func.params.len > 1) { | |
| 1792 | try ts.extra.append(gpa, @intCast(func.params.len)); | |
| 1793 | } | |
| 1794 | ||
| 1795 | const param_size = 4; | |
| 1796 | comptime std.debug.assert(@sizeOf(Type.Func.Param) == @sizeOf(u32) * param_size); | |
| 1797 | ||
| 1798 | try ts.extra.ensureUnusedCapacity(gpa, func.params.len * param_size); | |
| 1799 | for (func.params) |*param| { | |
| 1800 | const casted: *const [param_size]u32 = @ptrCast(param); | |
| 1801 | ts.extra.appendSliceAssumeCapacity(casted); | |
| 1802 | } | |
| 1803 | ||
| 1804 | repr.tag = switch (func.kind) { | |
| 1805 | .normal => switch (func.params.len) { | |
| 1806 | 0 => .func_zero, | |
| 1807 | 1 => .func_one, | |
| 1808 | else => .func, | |
| 1809 | }, | |
| 1810 | .variadic => switch (func.params.len) { | |
| 1811 | 0 => .func_variadic_zero, | |
| 1812 | 1 => .func_variadic_one, | |
| 1813 | else => .func_variadic, | |
| 1814 | }, | |
| 1815 | .old_style => switch (func.params.len) { | |
| 1816 | 0 => .func_old_style_zero, | |
| 1817 | 1 => .func_old_style_one, | |
| 1818 | else => .func_old_style, | |
| 1819 | }, | |
| 1820 | }; | |
| 1821 | }, | |
| 1822 | .pointer => |pointer| { | |
| 1823 | repr.data[0] = @bitCast(pointer.child); | |
| 1824 | if (pointer.decayed) |array| { | |
| 1825 | repr.tag = .pointer_decayed; | |
| 1826 | repr.data[1] = @bitCast(array); | |
| 1827 | } else { | |
| 1828 | repr.tag = .pointer; | |
| 1829 | } | |
| 1830 | }, | |
| 1831 | .array => |array| { | |
| 1832 | repr.data[0] = @bitCast(array.elem); | |
| 1833 | ||
| 1834 | const extra_index: u32 = @intCast(ts.extra.items.len); | |
| 1835 | switch (array.len) { | |
| 1836 | .incomplete => { | |
| 1837 | repr.tag = .array_incomplete; | |
| 1838 | }, | |
| 1839 | .fixed => |len| { | |
| 1840 | repr.tag = .array_fixed; | |
| 1841 | repr.data[1] = extra_index; | |
| 1842 | try ts.extra.appendSlice(gpa, &@as([2]u32, @bitCast(len))); | |
| 1843 | }, | |
| 1844 | .static => |len| { | |
| 1845 | repr.tag = .array_static; | |
| 1846 | repr.data[1] = extra_index; | |
| 1847 | try ts.extra.appendSlice(gpa, &@as([2]u32, @bitCast(len))); | |
| 1848 | }, | |
| 1849 | .variable => |expr| { | |
| 1850 | repr.tag = .array_variable; | |
| 1851 | repr.data[1] = @intFromEnum(expr); | |
| 1852 | }, | |
| 1853 | .unspecified_variable => { | |
| 1854 | repr.tag = .array_unspecified_variable; | |
| 1855 | }, | |
| 1856 | } | |
| 1857 | }, | |
| 1858 | .vector => |vector| { | |
| 1859 | repr.tag = .vector; | |
| 1860 | repr.data[0] = @bitCast(vector.elem); | |
| 1861 | repr.data[1] = vector.len; | |
| 1862 | }, | |
| 1863 | .@"struct", .@"union" => |record| record: { | |
| 1864 | repr.data[0] = @intFromEnum(record.name); | |
| 1865 | const layout = record.layout orelse { | |
| 1866 | std.debug.assert(record.fields.len == 0); | |
| 1867 | repr.tag = switch (ty) { | |
| 1868 | .@"struct" => .struct_incomplete, | |
| 1869 | .@"union" => .union_incomplete, | |
| 1870 | else => unreachable, | |
| 1871 | }; | |
| 1872 | repr.data[1] = @intFromEnum(record.decl_node); | |
| 1873 | break :record; | |
| 1874 | }; | |
| 1875 | repr.tag = switch (ty) { | |
| 1876 | .@"struct" => .@"struct", | |
| 1877 | .@"union" => .@"union", | |
| 1878 | else => unreachable, | |
| 1879 | }; | |
| 1880 | ||
| 1881 | const extra_index: u32 = @intCast(ts.extra.items.len); | |
| 1882 | repr.data[1] = extra_index; | |
| 1883 | ||
| 1884 | const layout_size = 5; | |
| 1885 | comptime std.debug.assert(@sizeOf(Type.Record.Layout) == @sizeOf(u32) * layout_size); | |
| 1886 | const field_size = 10; | |
| 1887 | comptime std.debug.assert(@sizeOf(Type.Record.Field) == @sizeOf(u32) * field_size); | |
| 1888 | try ts.extra.ensureUnusedCapacity(gpa, record.fields.len * field_size + layout_size + 2); | |
| 1889 | ||
| 1890 | ts.extra.appendAssumeCapacity(@intFromEnum(record.decl_node)); | |
| 1891 | const casted_layout: *const [layout_size]u32 = @ptrCast(&layout); | |
| 1892 | ts.extra.appendSliceAssumeCapacity(casted_layout); | |
| 1893 | ts.extra.appendAssumeCapacity(@intCast(record.fields.len)); | |
| 1894 | ||
| 1895 | for (record.fields) |*field| { | |
| 1896 | const casted: *const [field_size]u32 = @ptrCast(field); | |
| 1897 | ts.extra.appendSliceAssumeCapacity(casted); | |
| 1898 | } | |
| 1899 | }, | |
| 1900 | .@"enum" => |@"enum"| @"enum": { | |
| 1901 | if (@"enum".incomplete) { | |
| 1902 | std.debug.assert(@"enum".fields.len == 0); | |
| 1903 | if (@"enum".fixed) { | |
| 1904 | repr.tag = .enum_incomplete_fixed; | |
| 1905 | repr.data[0] = @bitCast(@"enum".tag.?); | |
| 1906 | repr.data[1] = @intCast(ts.extra.items.len); | |
| 1907 | try ts.extra.appendSlice(gpa, &.{ | |
| 1908 | @intFromEnum(@"enum".name), | |
| 1909 | @intFromEnum(@"enum".decl_node), | |
| 1910 | }); | |
| 1911 | } else { | |
| 1912 | repr.tag = .enum_incomplete; | |
| 1913 | repr.data[0] = @intFromEnum(@"enum".name); | |
| 1914 | repr.data[1] = @intFromEnum(@"enum".decl_node); | |
| 1915 | } | |
| 1916 | break :@"enum"; | |
| 1917 | } | |
| 1918 | repr.tag = if (@"enum".fixed) .enum_fixed else .@"enum"; | |
| 1919 | repr.data[0] = @bitCast(@"enum".tag.?); | |
| 1920 | ||
| 1921 | const extra_index: u32 = @intCast(ts.extra.items.len); | |
| 1922 | repr.data[1] = extra_index; | |
| 1923 | ||
| 1924 | const field_size = 3; | |
| 1925 | comptime std.debug.assert(@sizeOf(Type.Enum.Field) == @sizeOf(u32) * field_size); | |
| 1926 | try ts.extra.ensureUnusedCapacity(gpa, @"enum".fields.len * field_size + 3); | |
| 1927 | ||
| 1928 | ts.extra.appendAssumeCapacity(@intFromEnum(@"enum".name)); | |
| 1929 | ts.extra.appendAssumeCapacity(@intFromEnum(@"enum".decl_node)); | |
| 1930 | ts.extra.appendAssumeCapacity(@intCast(@"enum".fields.len)); | |
| 1931 | ||
| 1932 | for (@"enum".fields) |*field| { | |
| 1933 | const casted: *const [field_size]u32 = @ptrCast(field); | |
| 1934 | ts.extra.appendSliceAssumeCapacity(casted); | |
| 1935 | } | |
| 1936 | }, | |
| 1937 | .typeof => |typeof| { | |
| 1938 | repr.data[0] = @bitCast(typeof.base); | |
| 1939 | if (typeof.expr) |some| { | |
| 1940 | repr.tag = .typeof_expr; | |
| 1941 | repr.data[1] = @intFromEnum(some); | |
| 1942 | } else { | |
| 1943 | repr.tag = .typeof; | |
| 1944 | } | |
| 1945 | }, | |
| 1946 | .typedef => |typedef| { | |
| 1947 | repr.tag = .typedef; | |
| 1948 | repr.data[0] = @bitCast(typedef.base); | |
| 1949 | repr.data[1] = @intCast(ts.extra.items.len); | |
| 1950 | try ts.extra.appendSlice(gpa, &.{ | |
| 1951 | @intFromEnum(typedef.name), | |
| 1952 | @intFromEnum(typedef.decl_node), | |
| 1953 | }); | |
| 1954 | }, | |
| 1955 | .attributed => |attributed| { | |
| 1956 | repr.data[0] = @bitCast(attributed.base); | |
| 1957 | ||
| 1958 | const attr_index: u32 = @intCast(ts.attributes.items.len); | |
| 1959 | const attr_count: u32 = @intCast(attributed.attributes.len); | |
| 1960 | try ts.attributes.appendSlice(gpa, attributed.attributes); | |
| 1961 | if (attr_count > 1) { | |
| 1962 | repr.tag = .attributed; | |
| 1963 | const extra_index: u32 = @intCast(ts.extra.items.len); | |
| 1964 | repr.data[1] = extra_index; | |
| 1965 | try ts.extra.appendSlice(gpa, &.{ attr_index, attr_count }); | |
| 1966 | } else { | |
| 1967 | repr.tag = .attributed_one; | |
| 1968 | repr.data[1] = attr_index; | |
| 1969 | } | |
| 1970 | }, | |
| 1971 | } | |
| 1972 | ts.types.set(index, repr); | |
| 1973 | } | |
| 1974 | ||
| 1975 | pub fn initNamedTypes(ts: *TypeStore, comp: *Compilation) !void { | |
| 1976 | const os = comp.target.os.tag; | |
| 1977 | ts.wchar = switch (comp.target.cpu.arch) { | |
| 1978 | .xcore => .uchar, | |
| 1979 | .ve, .msp430 => .uint, | |
| 1980 | .arm, .armeb, .thumb, .thumbeb => if (os != .windows and os != .netbsd and os != .openbsd) .uint else .int, | |
| 1981 | .aarch64, .aarch64_be => if (!os.isDarwin() and os != .netbsd) .uint else .int, | |
| 1982 | .x86_64, .x86 => if (os == .windows) .ushort else .int, | |
| 1983 | else => .int, | |
| 1984 | }; | |
| 1985 | ||
| 1986 | const ptr_width = comp.target.ptrBitWidth(); | |
| 1987 | ts.ptrdiff = if (os == .windows and ptr_width == 64) | |
| 1988 | .long_long | |
| 1989 | else switch (ptr_width) { | |
| 1990 | 16 => .int, | |
| 1991 | 32 => .int, | |
| 1992 | 64 => .long, | |
| 1993 | else => unreachable, | |
| 1994 | }; | |
| 1995 | ||
| 1996 | ts.size = if (os == .windows and ptr_width == 64) | |
| 1997 | .ulong_long | |
| 1998 | else switch (ptr_width) { | |
| 1999 | 16 => .uint, | |
| 2000 | 32 => .uint, | |
| 2001 | 64 => .ulong, | |
| 2002 | else => unreachable, | |
| 2003 | }; | |
| 2004 | ||
| 2005 | ts.pid_t = switch (os) { | |
| 2006 | .haiku => .long, | |
| 2007 | // Todo: pid_t is required to "a signed integer type"; are there any systems | |
| 2008 | // on which it is `short int`? | |
| 2009 | else => .int, | |
| 2010 | }; | |
| 2011 | ||
| 2012 | ts.intmax = target_util.intMaxType(comp.target); | |
| 2013 | ts.intptr = target_util.intPtrType(comp.target); | |
| 2014 | ts.int16 = target_util.int16Type(comp.target); | |
| 2015 | ts.int64 = target_util.int64Type(comp.target); | |
| 2016 | ts.uint_least16_t = comp.intLeastN(16, .unsigned); | |
| 2017 | ts.uint_least32_t = comp.intLeastN(32, .unsigned); | |
| 2018 | ||
| 2019 | ts.ns_constant_string = try ts.generateNsConstantStringType(comp); | |
| 2020 | ts.va_list = try ts.generateVaListType(comp); | |
| 2021 | } | |
| 2022 | ||
| 2023 | fn generateNsConstantStringType(ts: *TypeStore, comp: *Compilation) !QualType { | |
| 2024 | const const_int_ptr: QualType = .{ .@"const" = true, ._index = .int_pointer }; | |
| 2025 | const const_char_ptr: QualType = .{ .@"const" = true, ._index = .char_pointer }; | |
| 2026 | ||
| 2027 | var record: Type.Record = .{ | |
| 2028 | .name = try comp.internString("__NSConstantString_tag"), | |
| 2029 | .layout = null, | |
| 2030 | .decl_node = undefined, // TODO | |
| 2031 | .fields = &.{}, | |
| 2032 | }; | |
| 2033 | const qt = try ts.put(comp.gpa, .{ .@"struct" = record }); | |
| 2034 | ||
| 2035 | var fields: [4]Type.Record.Field = .{ | |
| 2036 | .{ .name = try comp.internString("isa"), .qt = const_int_ptr }, | |
| 2037 | .{ .name = try comp.internString("flags"), .qt = .int }, | |
| 2038 | .{ .name = try comp.internString("str"), .qt = const_char_ptr }, | |
| 2039 | .{ .name = try comp.internString("length"), .qt = .long }, | |
| 2040 | }; | |
| 2041 | record.fields = &fields; | |
| 2042 | record.layout = record_layout.compute(&fields, qt, comp, null) catch unreachable; | |
| 2043 | try ts.set(comp.gpa, .{ .@"struct" = record }, @intFromEnum(qt._index)); | |
| 2044 | ||
| 2045 | return qt; | |
| 2046 | } | |
| 2047 | ||
| 2048 | fn generateVaListType(ts: *TypeStore, comp: *Compilation) !QualType { | |
| 2049 | const Kind = enum { aarch64_va_list, x86_64_va_list }; | |
| 2050 | const kind: Kind = switch (comp.target.cpu.arch) { | |
| 2051 | .aarch64, .aarch64_be => switch (comp.target.os.tag) { | |
| 2052 | .windows => return .char_pointer, | |
| 2053 | .ios, .macos, .tvos, .watchos => return .char_pointer, | |
| 2054 | else => .aarch64_va_list, | |
| 2055 | }, | |
| 2056 | .arm, .armeb, .thumb, .thumbeb => switch (comp.target.os.tag) { | |
| 2057 | .ios, .macos, .tvos, .watchos, .visionos => return .char_pointer, | |
| 2058 | else => return .void_pointer, | |
| 2059 | }, | |
| 2060 | .sparc, .wasm32, .wasm64, .bpfel, .bpfeb, .riscv32, .riscv64, .avr, .spirv32, .spirv64 => return .void_pointer, | |
| 2061 | .powerpc => switch (comp.target.os.tag) { | |
| 2062 | .ios, .macos, .tvos, .watchos, .aix => return .char_pointer, | |
| 2063 | else => return .void, // unknown | |
| 2064 | }, | |
| 2065 | .x86, .msp430 => return .char_pointer, | |
| 2066 | .x86_64 => switch (comp.target.os.tag) { | |
| 2067 | .windows => return .char_pointer, | |
| 2068 | else => .x86_64_va_list, | |
| 2069 | }, | |
| 2070 | else => return .void, // unknown | |
| 2071 | }; | |
| 2072 | ||
| 2073 | const struct_qt = switch (kind) { | |
| 2074 | .aarch64_va_list => blk: { | |
| 2075 | var record: Type.Record = .{ | |
| 2076 | .name = try comp.internString("__va_list_tag"), | |
| 2077 | .decl_node = undefined, // TODO | |
| 2078 | .layout = null, | |
| 2079 | .fields = &.{}, | |
| 2080 | }; | |
| 2081 | const qt = try ts.put(comp.gpa, .{ .@"struct" = record }); | |
| 2082 | ||
| 2083 | var fields: [5]Type.Record.Field = .{ | |
| 2084 | .{ .name = try comp.internString("__stack"), .qt = .void_pointer }, | |
| 2085 | .{ .name = try comp.internString("__gr_top"), .qt = .void_pointer }, | |
| 2086 | .{ .name = try comp.internString("__vr_top"), .qt = .void_pointer }, | |
| 2087 | .{ .name = try comp.internString("__gr_offs"), .qt = .int }, | |
| 2088 | .{ .name = try comp.internString("__vr_offs"), .qt = .int }, | |
| 2089 | }; | |
| 2090 | record.fields = &fields; | |
| 2091 | record.layout = record_layout.compute(&fields, qt, comp, null) catch unreachable; | |
| 2092 | try ts.set(comp.gpa, .{ .@"struct" = record }, @intFromEnum(qt._index)); | |
| 2093 | ||
| 2094 | break :blk qt; | |
| 2095 | }, | |
| 2096 | .x86_64_va_list => blk: { | |
| 2097 | var record: Type.Record = .{ | |
| 2098 | .name = try comp.internString("__va_list_tag"), | |
| 2099 | .decl_node = undefined, // TODO | |
| 2100 | .layout = null, | |
| 2101 | .fields = &.{}, | |
| 2102 | }; | |
| 2103 | const qt = try ts.put(comp.gpa, .{ .@"struct" = record }); | |
| 2104 | ||
| 2105 | var fields: [4]Type.Record.Field = .{ | |
| 2106 | .{ .name = try comp.internString("gp_offset"), .qt = .uint }, | |
| 2107 | .{ .name = try comp.internString("fp_offset"), .qt = .uint }, | |
| 2108 | .{ .name = try comp.internString("overflow_arg_area"), .qt = .void_pointer }, | |
| 2109 | .{ .name = try comp.internString("reg_save_area"), .qt = .void_pointer }, | |
| 2110 | }; | |
| 2111 | record.fields = &fields; | |
| 2112 | record.layout = record_layout.compute(&fields, qt, comp, null) catch unreachable; | |
| 2113 | try ts.set(comp.gpa, .{ .@"struct" = record }, @intFromEnum(qt._index)); | |
| 2114 | ||
| 2115 | break :blk qt; | |
| 2116 | }, | |
| 2117 | }; | |
| 2118 | ||
| 2119 | return ts.put(comp.gpa, .{ .array = .{ | |
| 2120 | .elem = struct_qt, | |
| 2121 | .len = .{ .fixed = 1 }, | |
| 2122 | } }); | |
| 2123 | } | |
| 2124 | ||
| 2125 | /// An unfinished Type | |
| 2126 | pub const Builder = struct { | |
| 2127 | parser: *Parser, | |
| 2128 | ||
| 2129 | @"const": ?TokenIndex = null, | |
| 2130 | /// _Atomic | |
| 2131 | atomic: ?TokenIndex = null, | |
| 2132 | @"volatile": ?TokenIndex = null, | |
| 2133 | restrict: ?TokenIndex = null, | |
| 2134 | unaligned: ?TokenIndex = null, | |
| 2135 | nullability: union(enum) { | |
| 2136 | none, | |
| 2137 | nonnull: TokenIndex, | |
| 2138 | nullable: TokenIndex, | |
| 2139 | nullable_result: TokenIndex, | |
| 2140 | null_unspecified: TokenIndex, | |
| 2141 | } = .none, | |
| 2142 | ||
| 2143 | complex_tok: ?TokenIndex = null, | |
| 2144 | bit_int_tok: ?TokenIndex = null, | |
| 2145 | typedef: bool = false, | |
| 2146 | typeof: bool = false, | |
| 2147 | /// _Atomic(type) | |
| 2148 | atomic_type: ?TokenIndex = null, | |
| 2149 | ||
| 2150 | type: Specifier = .none, | |
| 2151 | /// When true an error is returned instead of adding a diagnostic message. | |
| 2152 | /// Used for trying to combine typedef types. | |
| 2153 | error_on_invalid: bool = false, | |
| 2154 | ||
| 2155 | pub const Specifier = union(enum) { | |
| 2156 | none, | |
| 2157 | void, | |
| 2158 | /// GNU __auto_type extension | |
| 2159 | auto_type, | |
| 2160 | /// C23 auto | |
| 2161 | c23_auto, | |
| 2162 | nullptr_t, | |
| 2163 | bool, | |
| 2164 | char, | |
| 2165 | schar, | |
| 2166 | uchar, | |
| 2167 | complex_char, | |
| 2168 | complex_schar, | |
| 2169 | complex_uchar, | |
| 2170 | ||
| 2171 | unsigned, | |
| 2172 | signed, | |
| 2173 | short, | |
| 2174 | sshort, | |
| 2175 | ushort, | |
| 2176 | short_int, | |
| 2177 | sshort_int, | |
| 2178 | ushort_int, | |
| 2179 | int, | |
| 2180 | sint, | |
| 2181 | uint, | |
| 2182 | long, | |
| 2183 | slong, | |
| 2184 | ulong, | |
| 2185 | long_int, | |
| 2186 | slong_int, | |
| 2187 | ulong_int, | |
| 2188 | long_long, | |
| 2189 | slong_long, | |
| 2190 | ulong_long, | |
| 2191 | long_long_int, | |
| 2192 | slong_long_int, | |
| 2193 | ulong_long_int, | |
| 2194 | int128, | |
| 2195 | sint128, | |
| 2196 | uint128, | |
| 2197 | complex_unsigned, | |
| 2198 | complex_signed, | |
| 2199 | complex_short, | |
| 2200 | complex_sshort, | |
| 2201 | complex_ushort, | |
| 2202 | complex_short_int, | |
| 2203 | complex_sshort_int, | |
| 2204 | complex_ushort_int, | |
| 2205 | complex_int, | |
| 2206 | complex_sint, | |
| 2207 | complex_uint, | |
| 2208 | complex_long, | |
| 2209 | complex_slong, | |
| 2210 | complex_ulong, | |
| 2211 | complex_long_int, | |
| 2212 | complex_slong_int, | |
| 2213 | complex_ulong_int, | |
| 2214 | complex_long_long, | |
| 2215 | complex_slong_long, | |
| 2216 | complex_ulong_long, | |
| 2217 | complex_long_long_int, | |
| 2218 | complex_slong_long_int, | |
| 2219 | complex_ulong_long_int, | |
| 2220 | complex_int128, | |
| 2221 | complex_sint128, | |
| 2222 | complex_uint128, | |
| 2223 | bit_int: u64, | |
| 2224 | sbit_int: u64, | |
| 2225 | ubit_int: u64, | |
| 2226 | complex_bit_int: u64, | |
| 2227 | complex_sbit_int: u64, | |
| 2228 | complex_ubit_int: u64, | |
| 2229 | ||
| 2230 | fp16, | |
| 2231 | float16, | |
| 2232 | float, | |
| 2233 | double, | |
| 2234 | long_double, | |
| 2235 | float128, | |
| 2236 | complex, | |
| 2237 | complex_float16, | |
| 2238 | complex_float, | |
| 2239 | complex_double, | |
| 2240 | complex_long_double, | |
| 2241 | complex_float128, | |
| 2242 | ||
| 2243 | // Any not simply constructed from specifier keywords. | |
| 2244 | other: QualType, | |
| 2245 | ||
| 2246 | pub fn str(spec: Builder.Specifier, langopts: LangOpts) ?[]const u8 { | |
| 2247 | return switch (spec) { | |
| 2248 | .none => unreachable, | |
| 2249 | .void => "void", | |
| 2250 | .auto_type => "__auto_type", | |
| 2251 | .c23_auto => "auto", | |
| 2252 | .nullptr_t => "nullptr_t", | |
| 2253 | .bool => if (langopts.standard.atLeast(.c23)) "bool" else "_Bool", | |
| 2254 | .char => "char", | |
| 2255 | .schar => "signed char", | |
| 2256 | .uchar => "unsigned char", | |
| 2257 | .unsigned => "unsigned", | |
| 2258 | .signed => "signed", | |
| 2259 | .short => "short", | |
| 2260 | .ushort => "unsigned short", | |
| 2261 | .sshort => "signed short", | |
| 2262 | .short_int => "short int", | |
| 2263 | .sshort_int => "signed short int", | |
| 2264 | .ushort_int => "unsigned short int", | |
| 2265 | .int => "int", | |
| 2266 | .sint => "signed int", | |
| 2267 | .uint => "unsigned int", | |
| 2268 | .long => "long", | |
| 2269 | .slong => "signed long", | |
| 2270 | .ulong => "unsigned long", | |
| 2271 | .long_int => "long int", | |
| 2272 | .slong_int => "signed long int", | |
| 2273 | .ulong_int => "unsigned long int", | |
| 2274 | .long_long => "long long", | |
| 2275 | .slong_long => "signed long long", | |
| 2276 | .ulong_long => "unsigned long long", | |
| 2277 | .long_long_int => "long long int", | |
| 2278 | .slong_long_int => "signed long long int", | |
| 2279 | .ulong_long_int => "unsigned long long int", | |
| 2280 | .int128 => "__int128", | |
| 2281 | .sint128 => "signed __int128", | |
| 2282 | .uint128 => "unsigned __int128", | |
| 2283 | .complex_char => "_Complex char", | |
| 2284 | .complex_schar => "_Complex signed char", | |
| 2285 | .complex_uchar => "_Complex unsigned char", | |
| 2286 | .complex_unsigned => "_Complex unsigned", | |
| 2287 | .complex_signed => "_Complex signed", | |
| 2288 | .complex_short => "_Complex short", | |
| 2289 | .complex_ushort => "_Complex unsigned short", | |
| 2290 | .complex_sshort => "_Complex signed short", | |
| 2291 | .complex_short_int => "_Complex short int", | |
| 2292 | .complex_sshort_int => "_Complex signed short int", | |
| 2293 | .complex_ushort_int => "_Complex unsigned short int", | |
| 2294 | .complex_int => "_Complex int", | |
| 2295 | .complex_sint => "_Complex signed int", | |
| 2296 | .complex_uint => "_Complex unsigned int", | |
| 2297 | .complex_long => "_Complex long", | |
| 2298 | .complex_slong => "_Complex signed long", | |
| 2299 | .complex_ulong => "_Complex unsigned long", | |
| 2300 | .complex_long_int => "_Complex long int", | |
| 2301 | .complex_slong_int => "_Complex signed long int", | |
| 2302 | .complex_ulong_int => "_Complex unsigned long int", | |
| 2303 | .complex_long_long => "_Complex long long", | |
| 2304 | .complex_slong_long => "_Complex signed long long", | |
| 2305 | .complex_ulong_long => "_Complex unsigned long long", | |
| 2306 | .complex_long_long_int => "_Complex long long int", | |
| 2307 | .complex_slong_long_int => "_Complex signed long long int", | |
| 2308 | .complex_ulong_long_int => "_Complex unsigned long long int", | |
| 2309 | .complex_int128 => "_Complex __int128", | |
| 2310 | .complex_sint128 => "_Complex signed __int128", | |
| 2311 | .complex_uint128 => "_Complex unsigned __int128", | |
| 2312 | ||
| 2313 | .fp16 => "__fp16", | |
| 2314 | .float16 => "_Float16", | |
| 2315 | .float => "float", | |
| 2316 | .double => "double", | |
| 2317 | .long_double => "long double", | |
| 2318 | .float128 => "__float128", | |
| 2319 | .complex => "_Complex", | |
| 2320 | .complex_float16 => "_Complex _Float16", | |
| 2321 | .complex_float => "_Complex float", | |
| 2322 | .complex_double => "_Complex double", | |
| 2323 | .complex_long_double => "_Complex long double", | |
| 2324 | .complex_float128 => "_Complex __float128", | |
| 2325 | ||
| 2326 | else => null, | |
| 2327 | }; | |
| 2328 | } | |
| 2329 | }; | |
| 2330 | ||
| 2331 | pub fn finish(b: Builder) Parser.Error!QualType { | |
| 2332 | const qt: QualType = switch (b.type) { | |
| 2333 | .none => blk: { | |
| 2334 | if (b.parser.comp.langopts.standard.atLeast(.c23)) { | |
| 2335 | try b.parser.err(b.parser.tok_i, .missing_type_specifier_c23, .{}); | |
| 2336 | } else { | |
| 2337 | try b.parser.err(b.parser.tok_i, .missing_type_specifier, .{}); | |
| 2338 | } | |
| 2339 | break :blk .int; | |
| 2340 | }, | |
| 2341 | .void => .void, | |
| 2342 | .auto_type => .auto_type, | |
| 2343 | .c23_auto => .c23_auto, | |
| 2344 | .nullptr_t => unreachable, // nullptr_t can only be accessed via typeof(nullptr) | |
| 2345 | .bool => .bool, | |
| 2346 | .char => .char, | |
| 2347 | .schar => .schar, | |
| 2348 | .uchar => .uchar, | |
| 2349 | ||
| 2350 | .unsigned => .uint, | |
| 2351 | .signed => .int, | |
| 2352 | .short_int, .sshort_int, .short, .sshort => .short, | |
| 2353 | .ushort, .ushort_int => .ushort, | |
| 2354 | .int, .sint => .int, | |
| 2355 | .uint => .uint, | |
| 2356 | .long, .slong, .long_int, .slong_int => .long, | |
| 2357 | .ulong, .ulong_int => .ulong, | |
| 2358 | .long_long, .slong_long, .long_long_int, .slong_long_int => .long_long, | |
| 2359 | .ulong_long, .ulong_long_int => .ulong_long, | |
| 2360 | .int128, .sint128 => .int128, | |
| 2361 | .uint128 => .uint128, | |
| 2362 | ||
| 2363 | .complex_char, | |
| 2364 | .complex_schar, | |
| 2365 | .complex_uchar, | |
| 2366 | .complex_unsigned, | |
| 2367 | .complex_signed, | |
| 2368 | .complex_short_int, | |
| 2369 | .complex_sshort_int, | |
| 2370 | .complex_short, | |
| 2371 | .complex_sshort, | |
| 2372 | .complex_ushort, | |
| 2373 | .complex_ushort_int, | |
| 2374 | .complex_int, | |
| 2375 | .complex_sint, | |
| 2376 | .complex_uint, | |
| 2377 | .complex_long, | |
| 2378 | .complex_slong, | |
| 2379 | .complex_long_int, | |
| 2380 | .complex_slong_int, | |
| 2381 | .complex_ulong, | |
| 2382 | .complex_ulong_int, | |
| 2383 | .complex_long_long, | |
| 2384 | .complex_slong_long, | |
| 2385 | .complex_long_long_int, | |
| 2386 | .complex_slong_long_int, | |
| 2387 | .complex_ulong_long, | |
| 2388 | .complex_ulong_long_int, | |
| 2389 | .complex_int128, | |
| 2390 | .complex_sint128, | |
| 2391 | .complex_uint128, | |
| 2392 | => blk: { | |
| 2393 | const base_qt: QualType = switch (b.type) { | |
| 2394 | .complex_char => .char, | |
| 2395 | .complex_schar => .schar, | |
| 2396 | .complex_uchar => .uchar, | |
| 2397 | .complex_unsigned => .uint, | |
| 2398 | .complex_signed => .int, | |
| 2399 | .complex_short_int, .complex_sshort_int, .complex_short, .complex_sshort => .short, | |
| 2400 | .complex_ushort, .complex_ushort_int => .ushort, | |
| 2401 | .complex_int, .complex_sint => .int, | |
| 2402 | .complex_uint => .uint, | |
| 2403 | .complex_long, .complex_slong, .complex_long_int, .complex_slong_int => .long, | |
| 2404 | .complex_ulong, .complex_ulong_int => .ulong, | |
| 2405 | .complex_long_long, .complex_slong_long, .complex_long_long_int, .complex_slong_long_int => .long_long, | |
| 2406 | .complex_ulong_long, .complex_ulong_long_int => .ulong_long, | |
| 2407 | .complex_int128, .complex_sint128 => .int128, | |
| 2408 | .complex_uint128 => .uint128, | |
| 2409 | else => unreachable, | |
| 2410 | }; | |
| 2411 | if (b.complex_tok) |tok| try b.parser.err(tok, .complex_int, .{}); | |
| 2412 | break :blk try base_qt.toComplex(b.parser.comp); | |
| 2413 | }, | |
| 2414 | ||
| 2415 | .bit_int, .sbit_int, .ubit_int, .complex_bit_int, .complex_ubit_int, .complex_sbit_int => |bits| blk: { | |
| 2416 | const unsigned = b.type == .ubit_int or b.type == .complex_ubit_int; | |
| 2417 | const complex = b.type == .complex_bit_int or b.type == .complex_ubit_int or b.type == .complex_sbit_int; | |
| 2418 | const complex_str = if (complex) "_Complex " else ""; | |
| 2419 | ||
| 2420 | if (unsigned) { | |
| 2421 | if (bits < 1) { | |
| 2422 | try b.parser.err(b.bit_int_tok.?, .unsigned_bit_int_too_small, .{complex_str}); | |
| 2423 | return .invalid; | |
| 2424 | } | |
| 2425 | } else { | |
| 2426 | if (bits < 2) { | |
| 2427 | try b.parser.err(b.bit_int_tok.?, .signed_bit_int_too_small, .{complex_str}); | |
| 2428 | return .invalid; | |
| 2429 | } | |
| 2430 | } | |
| 2431 | if (bits > Compilation.bit_int_max_bits) { | |
| 2432 | try b.parser.err(b.bit_int_tok.?, if (unsigned) .unsigned_bit_int_too_big else .signed_bit_int_too_big, .{complex_str}); | |
| 2433 | return .invalid; | |
| 2434 | } | |
| 2435 | if (b.complex_tok) |tok| try b.parser.err(tok, .complex_int, .{}); | |
| 2436 | ||
| 2437 | const qt = try b.parser.comp.type_store.put(b.parser.comp.gpa, .{ .bit_int = .{ | |
| 2438 | .signedness = if (unsigned) .unsigned else .signed, | |
| 2439 | .bits = @intCast(bits), | |
| 2440 | } }); | |
| 2441 | break :blk if (complex) try qt.toComplex(b.parser.comp) else qt; | |
| 2442 | }, | |
| 2443 | ||
| 2444 | .fp16 => .fp16, | |
| 2445 | .float16 => .float16, | |
| 2446 | .float => .float, | |
| 2447 | .double => .double, | |
| 2448 | .long_double => .long_double, | |
| 2449 | .float128 => .float128, | |
| 2450 | ||
| 2451 | .complex_float16, | |
| 2452 | .complex_float, | |
| 2453 | .complex_double, | |
| 2454 | .complex_long_double, | |
| 2455 | .complex_float128, | |
| 2456 | .complex, | |
| 2457 | => blk: { | |
| 2458 | const base_qt: QualType = switch (b.type) { | |
| 2459 | .complex_float16 => .float16, | |
| 2460 | .complex_float => .float, | |
| 2461 | .complex_double => .double, | |
| 2462 | .complex_long_double => .long_double, | |
| 2463 | .complex_float128 => .float128, | |
| 2464 | .complex => .double, | |
| 2465 | else => unreachable, | |
| 2466 | }; | |
| 2467 | if (b.type == .complex) try b.parser.err(b.parser.tok_i - 1, .plain_complex, .{}); | |
| 2468 | break :blk try base_qt.toComplex(b.parser.comp); | |
| 2469 | }, | |
| 2470 | ||
| 2471 | .other => |qt| qt, | |
| 2472 | }; | |
| 2473 | return b.finishQuals(qt); | |
| 2474 | } | |
| 2475 | ||
| 2476 | pub fn finishQuals(b: Builder, qt: QualType) !QualType { | |
| 2477 | if (qt.isInvalid()) return .invalid; | |
| 2478 | const gpa = b.parser.comp.gpa; | |
| 2479 | var result_qt = qt; | |
| 2480 | if (b.atomic_type orelse b.atomic) |atomic_tok| { | |
| 2481 | if (result_qt.isAutoType()) return b.parser.todo("_Atomic __auto_type"); | |
| 2482 | if (result_qt.isC23Auto()) { | |
| 2483 | try b.parser.err(atomic_tok, .atomic_auto, .{}); | |
| 2484 | return .invalid; | |
| 2485 | } | |
| 2486 | if (result_qt.hasIncompleteSize(b.parser.comp)) { | |
| 2487 | try b.parser.err(atomic_tok, .atomic_incomplete, .{qt}); | |
| 2488 | return .invalid; | |
| 2489 | } | |
| 2490 | switch (result_qt.base(b.parser.comp).type) { | |
| 2491 | .array => { | |
| 2492 | try b.parser.err(atomic_tok, .atomic_array, .{qt}); | |
| 2493 | return .invalid; | |
| 2494 | }, | |
| 2495 | .func => { | |
| 2496 | try b.parser.err(atomic_tok, .atomic_func, .{qt}); | |
| 2497 | return .invalid; | |
| 2498 | }, | |
| 2499 | .atomic => { | |
| 2500 | try b.parser.err(atomic_tok, .atomic_atomic, .{qt}); | |
| 2501 | return .invalid; | |
| 2502 | }, | |
| 2503 | .complex => { | |
| 2504 | try b.parser.err(atomic_tok, .atomic_complex, .{qt}); | |
| 2505 | return .invalid; | |
| 2506 | }, | |
| 2507 | else => { | |
| 2508 | result_qt = try b.parser.comp.type_store.put(gpa, .{ .atomic = result_qt }); | |
| 2509 | }, | |
| 2510 | } | |
| 2511 | } | |
| 2512 | ||
| 2513 | // We can't use `qt.isPointer()` because `qt` might contain a `.declarator_combine`. | |
| 2514 | const is_pointer = qt.isAutoType() or qt.isC23Auto() or qt.base(b.parser.comp).type == .pointer; | |
| 2515 | ||
| 2516 | if (b.unaligned != null and !is_pointer) { | |
| 2517 | result_qt = (try b.parser.comp.type_store.put(gpa, .{ .attributed = .{ | |
| 2518 | .base = result_qt, | |
| 2519 | .attributes = &.{.{ .tag = .unaligned, .args = .{ .unaligned = .{} }, .syntax = .keyword }}, | |
| 2520 | } })).withQualifiers(result_qt); | |
| 2521 | } | |
| 2522 | switch (b.nullability) { | |
| 2523 | .none => {}, | |
| 2524 | .nonnull, | |
| 2525 | .nullable, | |
| 2526 | .nullable_result, | |
| 2527 | .null_unspecified, | |
| 2528 | => |tok| if (!is_pointer) { | |
| 2529 | // TODO this should be checked later so that auto types can be properly validated. | |
| 2530 | try b.parser.err(tok, .invalid_nullability, .{qt}); | |
| 2531 | }, | |
| 2532 | } | |
| 2533 | ||
| 2534 | if (b.@"const" != null) result_qt.@"const" = true; | |
| 2535 | if (b.@"volatile" != null) result_qt.@"volatile" = true; | |
| 2536 | ||
| 2537 | if (b.restrict) |restrict_tok| { | |
| 2538 | if (result_qt.isAutoType()) return b.parser.todo("restrict __auto_type"); | |
| 2539 | if (result_qt.isC23Auto()) { | |
| 2540 | try b.parser.err(restrict_tok, .restrict_non_pointer, .{qt}); | |
| 2541 | return result_qt; | |
| 2542 | } | |
| 2543 | switch (qt.base(b.parser.comp).type) { | |
| 2544 | .array, .pointer => result_qt.restrict = true, | |
| 2545 | else => { | |
| 2546 | try b.parser.err(restrict_tok, .restrict_non_pointer, .{qt}); | |
| 2547 | }, | |
| 2548 | } | |
| 2549 | } | |
| 2550 | return result_qt; | |
| 2551 | } | |
| 2552 | ||
| 2553 | fn cannotCombine(b: Builder, source_tok: TokenIndex) !void { | |
| 2554 | if (b.type.str(b.parser.comp.langopts)) |some| { | |
| 2555 | return b.parser.err(source_tok, .cannot_combine_spec, .{some}); | |
| 2556 | } | |
| 2557 | try b.parser.err(source_tok, .cannot_combine_spec_qt, .{try b.finish()}); | |
| 2558 | } | |
| 2559 | ||
| 2560 | fn duplicateSpec(b: *Builder, source_tok: TokenIndex, spec: []const u8) !void { | |
| 2561 | if (b.parser.comp.langopts.emulate != .clang) return b.cannotCombine(source_tok); | |
| 2562 | try b.parser.err(b.parser.tok_i, .duplicate_decl_spec, .{spec}); | |
| 2563 | } | |
| 2564 | ||
| 2565 | pub fn combineFromTypeof(b: *Builder, new: QualType, source_tok: TokenIndex) Compilation.Error!void { | |
| 2566 | if (b.atomic_type != null) return b.parser.err(source_tok, .cannot_combine_spec, .{"_Atomic"}); | |
| 2567 | if (b.typedef) return b.parser.err(source_tok, .cannot_combine_spec, .{"type-name"}); | |
| 2568 | if (b.typeof) return b.parser.err(source_tok, .cannot_combine_spec, .{"typeof"}); | |
| 2569 | if (b.type != .none) return b.parser.err(source_tok, .cannot_combine_with_typeof, .{@tagName(b.type)}); | |
| 2570 | b.typeof = true; | |
| 2571 | b.type = .{ .other = new }; | |
| 2572 | } | |
| 2573 | ||
| 2574 | pub fn combineAtomic(b: *Builder, base_qt: QualType, source_tok: TokenIndex) !void { | |
| 2575 | if (b.atomic_type != null) return b.parser.err(source_tok, .cannot_combine_spec, .{"_Atomic"}); | |
| 2576 | if (b.typedef) return b.parser.err(source_tok, .cannot_combine_spec, .{"type-name"}); | |
| 2577 | if (b.typeof) return b.parser.err(source_tok, .cannot_combine_spec, .{"typeof"}); | |
| 2578 | ||
| 2579 | const new_spec = TypeStore.Builder.fromType(b.parser.comp, base_qt); | |
| 2580 | try b.combine(new_spec, source_tok); | |
| 2581 | ||
| 2582 | b.atomic_type = source_tok; | |
| 2583 | } | |
| 2584 | ||
| 2585 | /// Try to combine type from typedef, returns true if successful. | |
| 2586 | pub fn combineTypedef(b: *Builder, typedef_qt: QualType) bool { | |
| 2587 | if (b.type != .none) return false; | |
| 2588 | ||
| 2589 | b.typedef = true; | |
| 2590 | b.type = .{ .other = typedef_qt }; | |
| 2591 | return true; | |
| 2592 | } | |
| 2593 | ||
| 2594 | pub fn combine(b: *Builder, new: Builder.Specifier, source_tok: TokenIndex) !void { | |
| 2595 | if (b.typeof) { | |
| 2596 | return b.parser.err(source_tok, .cannot_combine_with_typeof, .{@tagName(new)}); | |
| 2597 | } | |
| 2598 | if (b.atomic_type != null) { | |
| 2599 | return b.parser.err(source_tok, .cannot_combine_spec, .{"_Atomic"}); | |
| 2600 | } | |
| 2601 | if (b.typedef) { | |
| 2602 | return b.parser.err(source_tok, .cannot_combine_spec, .{"type-name"}); | |
| 2603 | } | |
| 2604 | if (b.type == .other and b.type.other.isInvalid()) return; | |
| 2605 | ||
| 2606 | switch (new) { | |
| 2607 | .complex => b.complex_tok = source_tok, | |
| 2608 | .bit_int => b.bit_int_tok = source_tok, | |
| 2609 | else => {}, | |
| 2610 | } | |
| 2611 | ||
| 2612 | if (new == .int128 and !target_util.hasInt128(b.parser.comp.target)) { | |
| 2613 | try b.parser.err(source_tok, .type_not_supported_on_target, .{"__int128"}); | |
| 2614 | } | |
| 2615 | ||
| 2616 | b.type = switch (new) { | |
| 2617 | else => switch (b.type) { | |
| 2618 | .none => new, | |
| 2619 | else => return b.cannotCombine(source_tok), | |
| 2620 | }, | |
| 2621 | .signed => switch (b.type) { | |
| 2622 | .none => .signed, | |
| 2623 | .char => .schar, | |
| 2624 | .short => .sshort, | |
| 2625 | .short_int => .sshort_int, | |
| 2626 | .int => .sint, | |
| 2627 | .long => .slong, | |
| 2628 | .long_int => .slong_int, | |
| 2629 | .long_long => .slong_long, | |
| 2630 | .long_long_int => .slong_long_int, | |
| 2631 | .int128 => .sint128, | |
| 2632 | .bit_int => |bits| .{ .sbit_int = bits }, | |
| 2633 | .complex => .complex_signed, | |
| 2634 | .complex_char => .complex_schar, | |
| 2635 | .complex_short => .complex_sshort, | |
| 2636 | .complex_short_int => .complex_sshort_int, | |
| 2637 | .complex_int => .complex_sint, | |
| 2638 | .complex_long => .complex_slong, | |
| 2639 | .complex_long_int => .complex_slong_int, | |
| 2640 | .complex_long_long => .complex_slong_long, | |
| 2641 | .complex_long_long_int => .complex_slong_long_int, | |
| 2642 | .complex_int128 => .sint128, | |
| 2643 | .complex_bit_int => |bits| .{ .complex_sbit_int = bits }, | |
| 2644 | .signed, | |
| 2645 | .sshort, | |
| 2646 | .sshort_int, | |
| 2647 | .sint, | |
| 2648 | .slong, | |
| 2649 | .slong_int, | |
| 2650 | .slong_long, | |
| 2651 | .slong_long_int, | |
| 2652 | .sint128, | |
| 2653 | .sbit_int, | |
| 2654 | .complex_schar, | |
| 2655 | .complex_signed, | |
| 2656 | .complex_sshort, | |
| 2657 | .complex_sshort_int, | |
| 2658 | .complex_sint, | |
| 2659 | .complex_slong, | |
| 2660 | .complex_slong_int, | |
| 2661 | .complex_slong_long, | |
| 2662 | .complex_slong_long_int, | |
| 2663 | .complex_sint128, | |
| 2664 | .complex_sbit_int, | |
| 2665 | => return b.duplicateSpec(source_tok, "signed"), | |
| 2666 | else => return b.cannotCombine(source_tok), | |
| 2667 | }, | |
| 2668 | .unsigned => switch (b.type) { | |
| 2669 | .none => .unsigned, | |
| 2670 | .char => .uchar, | |
| 2671 | .short => .ushort, | |
| 2672 | .short_int => .ushort_int, | |
| 2673 | .int => .uint, | |
| 2674 | .long => .ulong, | |
| 2675 | .long_int => .ulong_int, | |
| 2676 | .long_long => .ulong_long, | |
| 2677 | .long_long_int => .ulong_long_int, | |
| 2678 | .int128 => .uint128, | |
| 2679 | .bit_int => |bits| .{ .ubit_int = bits }, | |
| 2680 | .complex => .complex_unsigned, | |
| 2681 | .complex_char => .complex_uchar, | |
| 2682 | .complex_short => .complex_ushort, | |
| 2683 | .complex_short_int => .complex_ushort_int, | |
| 2684 | .complex_int => .complex_uint, | |
| 2685 | .complex_long => .complex_ulong, | |
| 2686 | .complex_long_int => .complex_ulong_int, | |
| 2687 | .complex_long_long => .complex_ulong_long, | |
| 2688 | .complex_long_long_int => .complex_ulong_long_int, | |
| 2689 | .complex_int128 => .complex_uint128, | |
| 2690 | .complex_bit_int => |bits| .{ .complex_ubit_int = bits }, | |
| 2691 | .unsigned, | |
| 2692 | .ushort, | |
| 2693 | .ushort_int, | |
| 2694 | .uint, | |
| 2695 | .ulong, | |
| 2696 | .ulong_int, | |
| 2697 | .ulong_long, | |
| 2698 | .ulong_long_int, | |
| 2699 | .uint128, | |
| 2700 | .ubit_int, | |
| 2701 | .complex_uchar, | |
| 2702 | .complex_unsigned, | |
| 2703 | .complex_ushort, | |
| 2704 | .complex_ushort_int, | |
| 2705 | .complex_uint, | |
| 2706 | .complex_ulong, | |
| 2707 | .complex_ulong_int, | |
| 2708 | .complex_ulong_long, | |
| 2709 | .complex_ulong_long_int, | |
| 2710 | .complex_uint128, | |
| 2711 | .complex_ubit_int, | |
| 2712 | => return b.duplicateSpec(source_tok, "unsigned"), | |
| 2713 | else => return b.cannotCombine(source_tok), | |
| 2714 | }, | |
| 2715 | .char => switch (b.type) { | |
| 2716 | .none => .char, | |
| 2717 | .unsigned => .uchar, | |
| 2718 | .signed => .schar, | |
| 2719 | .complex => .complex_char, | |
| 2720 | .complex_signed => .schar, | |
| 2721 | .complex_unsigned => .uchar, | |
| 2722 | else => return b.cannotCombine(source_tok), | |
| 2723 | }, | |
| 2724 | .short => switch (b.type) { | |
| 2725 | .none => .short, | |
| 2726 | .unsigned => .ushort, | |
| 2727 | .signed => .sshort, | |
| 2728 | .int => .short_int, | |
| 2729 | .sint => .sshort_int, | |
| 2730 | .uint => .ushort_int, | |
| 2731 | .complex => .complex_short, | |
| 2732 | .complex_signed => .sshort, | |
| 2733 | .complex_unsigned => .ushort, | |
| 2734 | else => return b.cannotCombine(source_tok), | |
| 2735 | }, | |
| 2736 | .int => switch (b.type) { | |
| 2737 | .none => .int, | |
| 2738 | .signed => .sint, | |
| 2739 | .unsigned => .uint, | |
| 2740 | .short => .short_int, | |
| 2741 | .sshort => .sshort_int, | |
| 2742 | .ushort => .ushort_int, | |
| 2743 | .long => .long_int, | |
| 2744 | .slong => .slong_int, | |
| 2745 | .ulong => .ulong_int, | |
| 2746 | .long_long => .long_long_int, | |
| 2747 | .slong_long => .slong_long_int, | |
| 2748 | .ulong_long => .ulong_long_int, | |
| 2749 | .complex => .complex_int, | |
| 2750 | .complex_signed => .complex_sint, | |
| 2751 | .complex_unsigned => .complex_uint, | |
| 2752 | .complex_short => .complex_short_int, | |
| 2753 | .complex_sshort => .complex_sshort_int, | |
| 2754 | .complex_ushort => .complex_ushort_int, | |
| 2755 | .complex_long => .complex_long_int, | |
| 2756 | .complex_slong => .complex_slong_int, | |
| 2757 | .complex_ulong => .complex_ulong_int, | |
| 2758 | .complex_long_long => .complex_long_long_int, | |
| 2759 | .complex_slong_long => .complex_slong_long_int, | |
| 2760 | .complex_ulong_long => .complex_ulong_long_int, | |
| 2761 | else => return b.cannotCombine(source_tok), | |
| 2762 | }, | |
| 2763 | .long => switch (b.type) { | |
| 2764 | .none => .long, | |
| 2765 | .double => .long_double, | |
| 2766 | .unsigned => .ulong, | |
| 2767 | .signed => .slong, | |
| 2768 | .int => .long_int, | |
| 2769 | .uint => .ulong_int, | |
| 2770 | .sint => .slong_int, | |
| 2771 | .long => .long_long, | |
| 2772 | .slong => .slong_long, | |
| 2773 | .ulong => .ulong_long, | |
| 2774 | .complex => .complex_long, | |
| 2775 | .complex_signed => .complex_slong, | |
| 2776 | .complex_unsigned => .complex_ulong, | |
| 2777 | .complex_long => .complex_long_long, | |
| 2778 | .complex_slong => .complex_slong_long, | |
| 2779 | .complex_ulong => .complex_ulong_long, | |
| 2780 | .complex_double => .complex_long_double, | |
| 2781 | else => return b.cannotCombine(source_tok), | |
| 2782 | }, | |
| 2783 | .long_long => switch (b.type) { | |
| 2784 | .none => .long_long, | |
| 2785 | .unsigned => .ulong_long, | |
| 2786 | .signed => .slong_long, | |
| 2787 | .int => .long_long_int, | |
| 2788 | .sint => .slong_long_int, | |
| 2789 | .long => .long_long, | |
| 2790 | .slong => .slong_long, | |
| 2791 | .ulong => .ulong_long, | |
| 2792 | .complex => .complex_long, | |
| 2793 | .complex_signed => .complex_slong_long, | |
| 2794 | .complex_unsigned => .complex_ulong_long, | |
| 2795 | .complex_long => .complex_long_long, | |
| 2796 | .complex_slong => .complex_slong_long, | |
| 2797 | .complex_ulong => .complex_ulong_long, | |
| 2798 | .long_long, | |
| 2799 | .ulong_long, | |
| 2800 | .ulong_long_int, | |
| 2801 | .complex_long_long, | |
| 2802 | .complex_ulong_long, | |
| 2803 | .complex_ulong_long_int, | |
| 2804 | => return b.duplicateSpec(source_tok, "long"), | |
| 2805 | else => return b.cannotCombine(source_tok), | |
| 2806 | }, | |
| 2807 | .int128 => switch (b.type) { | |
| 2808 | .none => .int128, | |
| 2809 | .unsigned => .uint128, | |
| 2810 | .signed => .sint128, | |
| 2811 | .complex => .complex_int128, | |
| 2812 | .complex_signed => .complex_sint128, | |
| 2813 | .complex_unsigned => .complex_uint128, | |
| 2814 | else => return b.cannotCombine(source_tok), | |
| 2815 | }, | |
| 2816 | .bit_int => switch (b.type) { | |
| 2817 | .none => .{ .bit_int = new.bit_int }, | |
| 2818 | .unsigned => .{ .ubit_int = new.bit_int }, | |
| 2819 | .signed => .{ .sbit_int = new.bit_int }, | |
| 2820 | .complex => .{ .complex_bit_int = new.bit_int }, | |
| 2821 | .complex_signed => .{ .complex_sbit_int = new.bit_int }, | |
| 2822 | .complex_unsigned => .{ .complex_ubit_int = new.bit_int }, | |
| 2823 | else => return b.cannotCombine(source_tok), | |
| 2824 | }, | |
| 2825 | .auto_type => switch (b.type) { | |
| 2826 | .none => .auto_type, | |
| 2827 | else => return b.cannotCombine(source_tok), | |
| 2828 | }, | |
| 2829 | .c23_auto => switch (b.type) { | |
| 2830 | .none => .c23_auto, | |
| 2831 | else => return b.cannotCombine(source_tok), | |
| 2832 | }, | |
| 2833 | .fp16 => switch (b.type) { | |
| 2834 | .none => .fp16, | |
| 2835 | else => return b.cannotCombine(source_tok), | |
| 2836 | }, | |
| 2837 | .float16 => switch (b.type) { | |
| 2838 | .none => .float16, | |
| 2839 | .complex => .complex_float16, | |
| 2840 | else => return b.cannotCombine(source_tok), | |
| 2841 | }, | |
| 2842 | .float => switch (b.type) { | |
| 2843 | .none => .float, | |
| 2844 | .complex => .complex_float, | |
| 2845 | else => return b.cannotCombine(source_tok), | |
| 2846 | }, | |
| 2847 | .double => switch (b.type) { | |
| 2848 | .none => .double, | |
| 2849 | .long => .long_double, | |
| 2850 | .complex_long => .complex_long_double, | |
| 2851 | .complex => .complex_double, | |
| 2852 | else => return b.cannotCombine(source_tok), | |
| 2853 | }, | |
| 2854 | .float128 => switch (b.type) { | |
| 2855 | .none => .float128, | |
| 2856 | .complex => .complex_float128, | |
| 2857 | else => return b.cannotCombine(source_tok), | |
| 2858 | }, | |
| 2859 | .complex => switch (b.type) { | |
| 2860 | .none => .complex, | |
| 2861 | .float16 => .complex_float16, | |
| 2862 | .float => .complex_float, | |
| 2863 | .double => .complex_double, | |
| 2864 | .long_double => .complex_long_double, | |
| 2865 | .float128 => .complex_float128, | |
| 2866 | .char => .complex_char, | |
| 2867 | .schar => .complex_schar, | |
| 2868 | .uchar => .complex_uchar, | |
| 2869 | .unsigned => .complex_unsigned, | |
| 2870 | .signed => .complex_signed, | |
| 2871 | .short => .complex_short, | |
| 2872 | .sshort => .complex_sshort, | |
| 2873 | .ushort => .complex_ushort, | |
| 2874 | .short_int => .complex_short_int, | |
| 2875 | .sshort_int => .complex_sshort_int, | |
| 2876 | .ushort_int => .complex_ushort_int, | |
| 2877 | .int => .complex_int, | |
| 2878 | .sint => .complex_sint, | |
| 2879 | .uint => .complex_uint, | |
| 2880 | .long => .complex_long, | |
| 2881 | .slong => .complex_slong, | |
| 2882 | .ulong => .complex_ulong, | |
| 2883 | .long_int => .complex_long_int, | |
| 2884 | .slong_int => .complex_slong_int, | |
| 2885 | .ulong_int => .complex_ulong_int, | |
| 2886 | .long_long => .complex_long_long, | |
| 2887 | .slong_long => .complex_slong_long, | |
| 2888 | .ulong_long => .complex_ulong_long, | |
| 2889 | .long_long_int => .complex_long_long_int, | |
| 2890 | .slong_long_int => .complex_slong_long_int, | |
| 2891 | .ulong_long_int => .complex_ulong_long_int, | |
| 2892 | .int128 => .complex_int128, | |
| 2893 | .sint128 => .complex_sint128, | |
| 2894 | .uint128 => .complex_uint128, | |
| 2895 | .bit_int => |bits| .{ .complex_bit_int = bits }, | |
| 2896 | .sbit_int => |bits| .{ .complex_sbit_int = bits }, | |
| 2897 | .ubit_int => |bits| .{ .complex_ubit_int = bits }, | |
| 2898 | .complex, | |
| 2899 | .complex_float, | |
| 2900 | .complex_double, | |
| 2901 | .complex_long_double, | |
| 2902 | .complex_float128, | |
| 2903 | .complex_char, | |
| 2904 | .complex_schar, | |
| 2905 | .complex_uchar, | |
| 2906 | .complex_unsigned, | |
| 2907 | .complex_signed, | |
| 2908 | .complex_short, | |
| 2909 | .complex_sshort, | |
| 2910 | .complex_ushort, | |
| 2911 | .complex_short_int, | |
| 2912 | .complex_sshort_int, | |
| 2913 | .complex_ushort_int, | |
| 2914 | .complex_int, | |
| 2915 | .complex_sint, | |
| 2916 | .complex_uint, | |
| 2917 | .complex_long, | |
| 2918 | .complex_slong, | |
| 2919 | .complex_ulong, | |
| 2920 | .complex_long_int, | |
| 2921 | .complex_slong_int, | |
| 2922 | .complex_ulong_int, | |
| 2923 | .complex_long_long, | |
| 2924 | .complex_slong_long, | |
| 2925 | .complex_ulong_long, | |
| 2926 | .complex_long_long_int, | |
| 2927 | .complex_slong_long_int, | |
| 2928 | .complex_ulong_long_int, | |
| 2929 | .complex_int128, | |
| 2930 | .complex_sint128, | |
| 2931 | .complex_uint128, | |
| 2932 | .complex_bit_int, | |
| 2933 | .complex_sbit_int, | |
| 2934 | .complex_ubit_int, | |
| 2935 | => return b.duplicateSpec(source_tok, "_Complex"), | |
| 2936 | else => return b.cannotCombine(source_tok), | |
| 2937 | }, | |
| 2938 | }; | |
| 2939 | } | |
| 2940 | ||
| 2941 | pub fn fromType(comp: *const Compilation, qt: QualType) Builder.Specifier { | |
| 2942 | return switch (qt.base(comp).type) { | |
| 2943 | .void => .void, | |
| 2944 | .nullptr_t => .nullptr_t, | |
| 2945 | .bool => .bool, | |
| 2946 | .int => |int| switch (int) { | |
| 2947 | .char => .char, | |
| 2948 | .schar => .schar, | |
| 2949 | .uchar => .uchar, | |
| 2950 | .short => .short, | |
| 2951 | .ushort => .ushort, | |
| 2952 | .int => .int, | |
| 2953 | .uint => .uint, | |
| 2954 | .long => .long, | |
| 2955 | .ulong => .ulong, | |
| 2956 | .long_long => .long_long, | |
| 2957 | .ulong_long => .ulong_long, | |
| 2958 | .int128 => .int128, | |
| 2959 | .uint128 => .uint128, | |
| 2960 | }, | |
| 2961 | .bit_int => |bit_int| if (bit_int.signedness == .unsigned) { | |
| 2962 | return .{ .ubit_int = bit_int.bits }; | |
| 2963 | } else { | |
| 2964 | return .{ .bit_int = bit_int.bits }; | |
| 2965 | }, | |
| 2966 | .float => |float| switch (float) { | |
| 2967 | .fp16 => .fp16, | |
| 2968 | .float16 => .float16, | |
| 2969 | .float => .float, | |
| 2970 | .double => .double, | |
| 2971 | .long_double => .long_double, | |
| 2972 | .float128 => .float128, | |
| 2973 | }, | |
| 2974 | .complex => |complex| switch (complex.base(comp).type) { | |
| 2975 | .int => |int| switch (int) { | |
| 2976 | .char => .complex_char, | |
| 2977 | .schar => .complex_schar, | |
| 2978 | .uchar => .complex_uchar, | |
| 2979 | .short => .complex_short, | |
| 2980 | .ushort => .complex_ushort, | |
| 2981 | .int => .complex_int, | |
| 2982 | .uint => .complex_uint, | |
| 2983 | .long => .complex_long, | |
| 2984 | .ulong => .complex_ulong, | |
| 2985 | .long_long => .complex_long_long, | |
| 2986 | .ulong_long => .complex_ulong_long, | |
| 2987 | .int128 => .complex_int128, | |
| 2988 | .uint128 => .complex_uint128, | |
| 2989 | }, | |
| 2990 | .bit_int => |bit_int| if (bit_int.signedness == .unsigned) { | |
| 2991 | return .{ .complex_ubit_int = bit_int.bits }; | |
| 2992 | } else { | |
| 2993 | return .{ .complex_bit_int = bit_int.bits }; | |
| 2994 | }, | |
| 2995 | .float => |float| switch (float) { | |
| 2996 | .fp16 => unreachable, | |
| 2997 | .float16 => .complex_float16, | |
| 2998 | .float => .complex_float, | |
| 2999 | .double => .complex_double, | |
| 3000 | .long_double => .complex_long_double, | |
| 3001 | .float128 => .complex_float128, | |
| 3002 | }, | |
| 3003 | else => unreachable, | |
| 3004 | }, | |
| 3005 | else => .{ .other = qt }, | |
| 3006 | }; | |
| 3007 | } | |
| 3008 | }; |
lib/compiler/aro/aro/Value.zig+255-117| ... | ... | @@ -2,14 +2,14 @@ const std = @import("std"); |
| 2 | 2 | const assert = std.debug.assert; |
| 3 | 3 | const BigIntConst = std.math.big.int.Const; |
| 4 | 4 | const BigIntMutable = std.math.big.int.Mutable; |
| 5 | const backend = @import("../backend.zig"); | |
| 6 | const Interner = backend.Interner; | |
| 5 | ||
| 6 | const Interner = @import("../backend.zig").Interner; | |
| 7 | 7 | const BigIntSpace = Interner.Tag.Int.BigIntSpace; |
| 8 | ||
| 9 | const annex_g = @import("annex_g.zig"); | |
| 8 | 10 | const Compilation = @import("Compilation.zig"); |
| 9 | const Type = @import("Type.zig"); | |
| 10 | 11 | const target_util = @import("target.zig"); |
| 11 | const annex_g = @import("annex_g.zig"); | |
| 12 | const Writer = std.Io.Writer; | |
| 12 | const QualType = @import("TypeStore.zig").QualType; | |
| 13 | 13 | |
| 14 | 14 | const Value = @This(); |
| 15 | 15 | |
| ... | ... | @@ -33,11 +33,19 @@ pub fn int(i: anytype, comp: *Compilation) !Value { |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | pub fn pointer(r: Interner.Key.Pointer, comp: *Compilation) !Value { | |
| 37 | return intern(comp, .{ .pointer = r }); | |
| 38 | } | |
| 39 | ||
| 36 | 40 | pub fn ref(v: Value) Interner.Ref { |
| 37 | 41 | std.debug.assert(v.opt_ref != .none); |
| 38 | 42 | return @enumFromInt(@intFromEnum(v.opt_ref)); |
| 39 | 43 | } |
| 40 | 44 | |
| 45 | pub fn fromRef(r: Interner.Ref) Value { | |
| 46 | return .{ .opt_ref = @enumFromInt(@intFromEnum(r)) }; | |
| 47 | } | |
| 48 | ||
| 41 | 49 | pub fn is(v: Value, tag: std.meta.Tag(Interner.Key), comp: *const Compilation) bool { |
| 42 | 50 | if (v.opt_ref == .none) return false; |
| 43 | 51 | return comp.interner.get(v.ref()) == tag; |
| ... | ... | @@ -68,7 +76,11 @@ test "minUnsignedBits" { |
| 68 | 76 | } |
| 69 | 77 | }; |
| 70 | 78 | |
| 71 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 79 | var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 80 | defer arena_state.deinit(); | |
| 81 | const arena = arena_state.allocator(); | |
| 82 | ||
| 83 | var comp = Compilation.init(std.testing.allocator, arena, undefined, std.fs.cwd()); | |
| 72 | 84 | defer comp.deinit(); |
| 73 | 85 | const target_query = try std.Target.Query.parse(.{ .arch_os_abi = "x86_64-linux-gnu" }); |
| 74 | 86 | comp.target = try std.zig.system.resolveTargetQuery(target_query); |
| ... | ... | @@ -103,7 +115,11 @@ test "minSignedBits" { |
| 103 | 115 | } |
| 104 | 116 | }; |
| 105 | 117 | |
| 106 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 118 | var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); | |
| 119 | defer arena_state.deinit(); | |
| 120 | const arena = arena_state.allocator(); | |
| 121 | ||
| 122 | var comp = Compilation.init(std.testing.allocator, arena, undefined, std.fs.cwd()); | |
| 107 | 123 | defer comp.deinit(); |
| 108 | 124 | const target_query = try std.Target.Query.parse(.{ .arch_os_abi = "x86_64-linux-gnu" }); |
| 109 | 125 | comp.target = try std.zig.system.resolveTargetQuery(target_query); |
| ... | ... | @@ -133,24 +149,27 @@ pub const FloatToIntChangeKind = enum { |
| 133 | 149 | |
| 134 | 150 | /// Converts the stored value from a float to an integer. |
| 135 | 151 | /// `.none` value remains unchanged. |
| 136 | pub fn floatToInt(v: *Value, dest_ty: Type, comp: *Compilation) !FloatToIntChangeKind { | |
| 152 | pub fn floatToInt(v: *Value, dest_ty: QualType, comp: *Compilation) !FloatToIntChangeKind { | |
| 137 | 153 | if (v.opt_ref == .none) return .none; |
| 138 | 154 | |
| 139 | 155 | const float_val = v.toFloat(f128, comp); |
| 140 | 156 | const was_zero = float_val == 0; |
| 141 | 157 | |
| 142 | if (dest_ty.is(.bool)) { | |
| 158 | if (dest_ty.is(comp, .bool)) { | |
| 143 | 159 | const was_one = float_val == 1.0; |
| 144 | 160 | v.* = fromBool(!was_zero); |
| 145 | 161 | if (was_zero or was_one) return .none; |
| 146 | 162 | return .value_changed; |
| 147 | } else if (dest_ty.isUnsignedInt(comp) and float_val < 0) { | |
| 163 | } else if (dest_ty.signedness(comp) == .unsigned and float_val < 0) { | |
| 148 | 164 | v.* = zero; |
| 149 | 165 | return .out_of_range; |
| 166 | } else if (!std.math.isFinite(float_val)) { | |
| 167 | v.* = .{}; | |
| 168 | return .overflow; | |
| 150 | 169 | } |
| 151 | 170 | |
| 152 | 171 | const signedness = dest_ty.signedness(comp); |
| 153 | const bits: usize = @intCast(dest_ty.bitSizeof(comp).?); | |
| 172 | const bits: usize = @intCast(dest_ty.bitSizeof(comp)); | |
| 154 | 173 | |
| 155 | 174 | var big_int: std.math.big.int.Mutable = .{ |
| 156 | 175 | .limbs = try comp.gpa.alloc(std.math.big.Limb, @max( |
| ... | ... | @@ -160,6 +179,7 @@ pub fn floatToInt(v: *Value, dest_ty: Type, comp: *Compilation) !FloatToIntChang |
| 160 | 179 | .len = undefined, |
| 161 | 180 | .positive = undefined, |
| 162 | 181 | }; |
| 182 | defer comp.gpa.free(big_int.limbs); | |
| 163 | 183 | const had_fraction = switch (big_int.setFloat(float_val, .trunc)) { |
| 164 | 184 | .inexact => true, |
| 165 | 185 | .exact => false, |
| ... | ... | @@ -177,11 +197,11 @@ pub fn floatToInt(v: *Value, dest_ty: Type, comp: *Compilation) !FloatToIntChang |
| 177 | 197 | |
| 178 | 198 | /// Converts the stored value from an integer to a float. |
| 179 | 199 | /// `.none` value remains unchanged. |
| 180 | pub fn intToFloat(v: *Value, dest_ty: Type, comp: *Compilation) !void { | |
| 200 | pub fn intToFloat(v: *Value, dest_ty: QualType, comp: *Compilation) !void { | |
| 181 | 201 | if (v.opt_ref == .none) return; |
| 182 | 202 | |
| 183 | if (dest_ty.isComplex()) { | |
| 184 | const bits = dest_ty.bitSizeof(comp).?; | |
| 203 | if (dest_ty.is(comp, .complex)) { | |
| 204 | const bits = dest_ty.bitSizeof(comp); | |
| 185 | 205 | const cf: Interner.Key.Complex = switch (bits) { |
| 186 | 206 | 32 => .{ .cf16 = .{ v.toFloat(f16, comp), 0 } }, |
| 187 | 207 | 64 => .{ .cf32 = .{ v.toFloat(f32, comp), 0 } }, |
| ... | ... | @@ -193,7 +213,7 @@ pub fn intToFloat(v: *Value, dest_ty: Type, comp: *Compilation) !void { |
| 193 | 213 | v.* = try intern(comp, .{ .complex = cf }); |
| 194 | 214 | return; |
| 195 | 215 | } |
| 196 | const bits = dest_ty.bitSizeof(comp).?; | |
| 216 | const bits = dest_ty.bitSizeof(comp); | |
| 197 | 217 | return switch (comp.interner.get(v.ref()).int) { |
| 198 | 218 | inline .u64, .i64 => |data| { |
| 199 | 219 | const f: Interner.Key.Float = switch (bits) { |
| ... | ... | @@ -232,14 +252,16 @@ pub const IntCastChangeKind = enum { |
| 232 | 252 | |
| 233 | 253 | /// Truncates or extends bits based on type. |
| 234 | 254 | /// `.none` value remains unchanged. |
| 235 | pub fn intCast(v: *Value, dest_ty: Type, comp: *Compilation) !IntCastChangeKind { | |
| 255 | pub fn intCast(v: *Value, dest_ty: QualType, comp: *Compilation) !IntCastChangeKind { | |
| 236 | 256 | if (v.opt_ref == .none) return .none; |
| 257 | const key = comp.interner.get(v.ref()); | |
| 258 | if (key == .pointer or key == .bytes) return .none; | |
| 237 | 259 | |
| 238 | const dest_bits: usize = @intCast(dest_ty.bitSizeof(comp).?); | |
| 260 | const dest_bits: usize = @intCast(dest_ty.bitSizeof(comp)); | |
| 239 | 261 | const dest_signed = dest_ty.signedness(comp) == .signed; |
| 240 | 262 | |
| 241 | 263 | var space: BigIntSpace = undefined; |
| 242 | const big = v.toBigInt(&space, comp); | |
| 264 | const big = key.toBigInt(&space); | |
| 243 | 265 | const value_bits = big.bitCountTwosComp(); |
| 244 | 266 | |
| 245 | 267 | // if big is negative, then is signed. |
| ... | ... | @@ -269,10 +291,10 @@ pub fn intCast(v: *Value, dest_ty: Type, comp: *Compilation) !IntCastChangeKind |
| 269 | 291 | |
| 270 | 292 | /// Converts the stored value to a float of the specified type |
| 271 | 293 | /// `.none` value remains unchanged. |
| 272 | pub fn floatCast(v: *Value, dest_ty: Type, comp: *Compilation) !void { | |
| 294 | pub fn floatCast(v: *Value, dest_ty: QualType, comp: *Compilation) !void { | |
| 273 | 295 | if (v.opt_ref == .none) return; |
| 274 | const bits = dest_ty.bitSizeof(comp).?; | |
| 275 | if (dest_ty.isComplex()) { | |
| 296 | const bits = dest_ty.bitSizeof(comp); | |
| 297 | if (dest_ty.is(comp, .complex)) { | |
| 276 | 298 | const cf: Interner.Key.Complex = switch (bits) { |
| 277 | 299 | 32 => .{ .cf16 = .{ v.toFloat(f16, comp), v.imag(f16, comp) } }, |
| 278 | 300 | 64 => .{ .cf32 = .{ v.toFloat(f32, comp), v.imag(f32, comp) } }, |
| ... | ... | @@ -370,11 +392,8 @@ fn bigIntToFloat(limbs: []const std.math.big.Limb, positive: bool) f128 { |
| 370 | 392 | } |
| 371 | 393 | } |
| 372 | 394 | |
| 373 | pub fn toBigInt(val: Value, space: *BigIntSpace, comp: *const Compilation) BigIntConst { | |
| 374 | return switch (comp.interner.get(val.ref()).int) { | |
| 375 | inline .u64, .i64 => |x| BigIntMutable.init(&space.limbs, x).toConst(), | |
| 376 | .big_int => |b| b, | |
| 377 | }; | |
| 395 | fn toBigInt(val: Value, space: *BigIntSpace, comp: *const Compilation) BigIntConst { | |
| 396 | return comp.interner.get(val.ref()).toBigInt(space); | |
| 378 | 397 | } |
| 379 | 398 | |
| 380 | 399 | pub fn isZero(v: Value, comp: *const Compilation) bool { |
| ... | ... | @@ -398,6 +417,7 @@ pub fn isZero(v: Value, comp: *const Compilation) bool { |
| 398 | 417 | inline else => |data| return data[0] == 0.0 and data[1] == 0.0, |
| 399 | 418 | }, |
| 400 | 419 | .bytes => return false, |
| 420 | .pointer => return false, | |
| 401 | 421 | else => unreachable, |
| 402 | 422 | } |
| 403 | 423 | } |
| ... | ... | @@ -461,12 +481,19 @@ pub fn toBool(v: Value, comp: *const Compilation) bool { |
| 461 | 481 | |
| 462 | 482 | pub fn toInt(v: Value, comptime T: type, comp: *const Compilation) ?T { |
| 463 | 483 | if (v.opt_ref == .none) return null; |
| 464 | if (comp.interner.get(v.ref()) != .int) return null; | |
| 484 | const key = comp.interner.get(v.ref()); | |
| 485 | if (key != .int) return null; | |
| 465 | 486 | var space: BigIntSpace = undefined; |
| 466 | const big_int = v.toBigInt(&space, comp); | |
| 487 | const big_int = key.toBigInt(&space); | |
| 467 | 488 | return big_int.toInt(T) catch null; |
| 468 | 489 | } |
| 469 | 490 | |
| 491 | pub fn toBytes(v: Value, comp: *const Compilation) []const u8 { | |
| 492 | assert(v.opt_ref != .none); | |
| 493 | const key = comp.interner.get(v.ref()); | |
| 494 | return key.bytes; | |
| 495 | } | |
| 496 | ||
| 470 | 497 | const ComplexOp = enum { |
| 471 | 498 | add, |
| 472 | 499 | sub, |
| ... | ... | @@ -492,10 +519,11 @@ fn complexAddSub(lhs: Value, rhs: Value, comptime T: type, op: ComplexOp, comp: |
| 492 | 519 | }; |
| 493 | 520 | } |
| 494 | 521 | |
| 495 | pub fn add(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { | |
| 496 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 497 | if (ty.isFloat()) { | |
| 498 | if (ty.isComplex()) { | |
| 522 | pub fn add(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { | |
| 523 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 524 | const scalar_kind = qt.scalarKind(comp); | |
| 525 | if (scalar_kind.isFloat()) { | |
| 526 | if (scalar_kind == .complex_float) { | |
| 499 | 527 | res.* = switch (bits) { |
| 500 | 528 | 32 => try complexAddSub(lhs, rhs, f16, .add, comp), |
| 501 | 529 | 64 => try complexAddSub(lhs, rhs, f32, .add, comp), |
| ... | ... | @@ -516,29 +544,60 @@ pub fn add(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 516 | 544 | }; |
| 517 | 545 | res.* = try intern(comp, .{ .float = f }); |
| 518 | 546 | return false; |
| 519 | } else { | |
| 520 | var lhs_space: BigIntSpace = undefined; | |
| 521 | var rhs_space: BigIntSpace = undefined; | |
| 522 | const lhs_bigint = lhs.toBigInt(&lhs_space, comp); | |
| 523 | const rhs_bigint = rhs.toBigInt(&rhs_space, comp); | |
| 547 | } | |
| 548 | const lhs_key = comp.interner.get(lhs.ref()); | |
| 549 | const rhs_key = comp.interner.get(rhs.ref()); | |
| 550 | if (lhs_key == .bytes or rhs_key == .bytes) { | |
| 551 | res.* = .{}; | |
| 552 | return false; | |
| 553 | } | |
| 554 | if (lhs_key == .pointer or rhs_key == .pointer) { | |
| 555 | const rel, const index = if (lhs_key == .pointer) | |
| 556 | .{ lhs_key.pointer, rhs } | |
| 557 | else | |
| 558 | .{ rhs_key.pointer, lhs }; | |
| 559 | ||
| 560 | const elem_size = try int(qt.childType(comp).sizeofOrNull(comp) orelse 1, comp); | |
| 561 | var total_offset: Value = undefined; | |
| 562 | const mul_overflow = try total_offset.mul(elem_size, index, comp.type_store.ptrdiff, comp); | |
| 563 | const old_offset = fromRef(rel.offset); | |
| 564 | const add_overflow = try total_offset.add(total_offset, old_offset, comp.type_store.ptrdiff, comp); | |
| 565 | _ = try total_offset.intCast(comp.type_store.ptrdiff, comp); | |
| 566 | res.* = try pointer(.{ .node = rel.node, .offset = total_offset.ref() }, comp); | |
| 567 | return mul_overflow or add_overflow; | |
| 568 | } | |
| 524 | 569 | |
| 525 | const limbs = try comp.gpa.alloc( | |
| 526 | std.math.big.Limb, | |
| 527 | std.math.big.int.calcTwosCompLimbCount(bits), | |
| 528 | ); | |
| 529 | defer comp.gpa.free(limbs); | |
| 530 | var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; | |
| 570 | var lhs_space: BigIntSpace = undefined; | |
| 571 | var rhs_space: BigIntSpace = undefined; | |
| 572 | const lhs_bigint = lhs_key.toBigInt(&lhs_space); | |
| 573 | const rhs_bigint = rhs_key.toBigInt(&rhs_space); | |
| 531 | 574 | |
| 532 | const overflowed = result_bigint.addWrap(lhs_bigint, rhs_bigint, ty.signedness(comp), bits); | |
| 533 | res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); | |
| 534 | return overflowed; | |
| 535 | } | |
| 575 | const limbs = try comp.gpa.alloc( | |
| 576 | std.math.big.Limb, | |
| 577 | std.math.big.int.calcTwosCompLimbCount(bits), | |
| 578 | ); | |
| 579 | defer comp.gpa.free(limbs); | |
| 580 | var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; | |
| 581 | ||
| 582 | const overflowed = result_bigint.addWrap(lhs_bigint, rhs_bigint, qt.signedness(comp), bits); | |
| 583 | res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); | |
| 584 | return overflowed; | |
| 585 | } | |
| 586 | ||
| 587 | pub fn negate(res: *Value, val: Value, qt: QualType, comp: *Compilation) !bool { | |
| 588 | return res.sub(zero, val, qt, undefined, comp); | |
| 589 | } | |
| 590 | ||
| 591 | pub fn decrement(res: *Value, val: Value, qt: QualType, comp: *Compilation) !bool { | |
| 592 | return res.sub(val, one, qt, undefined, comp); | |
| 536 | 593 | } |
| 537 | 594 | |
| 538 | pub fn sub(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { | |
| 539 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 540 | if (ty.isFloat()) { | |
| 541 | if (ty.isComplex()) { | |
| 595 | /// elem_size is only used when subtracting two pointers, so we can scale the result by the size of the element type | |
| 596 | pub fn sub(res: *Value, lhs: Value, rhs: Value, qt: QualType, elem_size: u64, comp: *Compilation) !bool { | |
| 597 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 598 | const scalar_kind = qt.scalarKind(comp); | |
| 599 | if (scalar_kind.isFloat()) { | |
| 600 | if (scalar_kind == .complex_float) { | |
| 542 | 601 | res.* = switch (bits) { |
| 543 | 602 | 32 => try complexAddSub(lhs, rhs, f16, .sub, comp), |
| 544 | 603 | 64 => try complexAddSub(lhs, rhs, f32, .sub, comp), |
| ... | ... | @@ -559,29 +618,61 @@ pub fn sub(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 559 | 618 | }; |
| 560 | 619 | res.* = try intern(comp, .{ .float = f }); |
| 561 | 620 | return false; |
| 562 | } else { | |
| 563 | var lhs_space: BigIntSpace = undefined; | |
| 564 | var rhs_space: BigIntSpace = undefined; | |
| 565 | const lhs_bigint = lhs.toBigInt(&lhs_space, comp); | |
| 566 | const rhs_bigint = rhs.toBigInt(&rhs_space, comp); | |
| 567 | ||
| 568 | const limbs = try comp.gpa.alloc( | |
| 569 | std.math.big.Limb, | |
| 570 | std.math.big.int.calcTwosCompLimbCount(bits), | |
| 571 | ); | |
| 572 | defer comp.gpa.free(limbs); | |
| 573 | var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; | |
| 574 | ||
| 575 | const overflowed = result_bigint.subWrap(lhs_bigint, rhs_bigint, ty.signedness(comp), bits); | |
| 576 | res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); | |
| 621 | } | |
| 622 | const lhs_key = comp.interner.get(lhs.ref()); | |
| 623 | const rhs_key = comp.interner.get(rhs.ref()); | |
| 624 | if (lhs_key == .bytes or rhs_key == .bytes) { | |
| 625 | res.* = .{}; | |
| 626 | return false; | |
| 627 | } | |
| 628 | if (lhs_key == .pointer and rhs_key == .pointer) { | |
| 629 | const lhs_pointer = lhs_key.pointer; | |
| 630 | const rhs_pointer = rhs_key.pointer; | |
| 631 | if (lhs_pointer.node != rhs_pointer.node) { | |
| 632 | res.* = .{}; | |
| 633 | return false; | |
| 634 | } | |
| 635 | const lhs_offset = fromRef(lhs_pointer.offset); | |
| 636 | const rhs_offset = fromRef(rhs_pointer.offset); | |
| 637 | const overflowed = try res.sub(lhs_offset, rhs_offset, comp.type_store.ptrdiff, undefined, comp); | |
| 638 | const rhs_size = try int(elem_size, comp); | |
| 639 | _ = try res.div(res.*, rhs_size, comp.type_store.ptrdiff, comp); | |
| 577 | 640 | return overflowed; |
| 641 | } else if (lhs_key == .pointer) { | |
| 642 | const rel = lhs_key.pointer; | |
| 643 | ||
| 644 | const lhs_size = try int(elem_size, comp); | |
| 645 | var total_offset: Value = undefined; | |
| 646 | const mul_overflow = try total_offset.mul(lhs_size, rhs, comp.type_store.ptrdiff, comp); | |
| 647 | const old_offset = fromRef(rel.offset); | |
| 648 | const add_overflow = try total_offset.sub(old_offset, total_offset, comp.type_store.ptrdiff, undefined, comp); | |
| 649 | _ = try total_offset.intCast(comp.type_store.ptrdiff, comp); | |
| 650 | res.* = try pointer(.{ .node = rel.node, .offset = total_offset.ref() }, comp); | |
| 651 | return mul_overflow or add_overflow; | |
| 578 | 652 | } |
| 653 | ||
| 654 | var lhs_space: BigIntSpace = undefined; | |
| 655 | var rhs_space: BigIntSpace = undefined; | |
| 656 | const lhs_bigint = lhs_key.toBigInt(&lhs_space); | |
| 657 | const rhs_bigint = rhs_key.toBigInt(&rhs_space); | |
| 658 | ||
| 659 | const limbs = try comp.gpa.alloc( | |
| 660 | std.math.big.Limb, | |
| 661 | std.math.big.int.calcTwosCompLimbCount(bits), | |
| 662 | ); | |
| 663 | defer comp.gpa.free(limbs); | |
| 664 | var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; | |
| 665 | ||
| 666 | const overflowed = result_bigint.subWrap(lhs_bigint, rhs_bigint, qt.signedness(comp), bits); | |
| 667 | res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); | |
| 668 | return overflowed; | |
| 579 | 669 | } |
| 580 | 670 | |
| 581 | pub fn mul(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { | |
| 582 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 583 | if (ty.isFloat()) { | |
| 584 | if (ty.isComplex()) { | |
| 671 | pub fn mul(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { | |
| 672 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 673 | const scalar_kind = qt.scalarKind(comp); | |
| 674 | if (scalar_kind.isFloat()) { | |
| 675 | if (scalar_kind == .complex_float) { | |
| 585 | 676 | const cf: Interner.Key.Complex = switch (bits) { |
| 586 | 677 | 32 => .{ .cf16 = annex_g.complexFloatMul(f16, lhs.toFloat(f16, comp), lhs.imag(f16, comp), rhs.toFloat(f16, comp), rhs.imag(f16, comp)) }, |
| 587 | 678 | 64 => .{ .cf32 = annex_g.complexFloatMul(f32, lhs.toFloat(f32, comp), lhs.imag(f32, comp), rhs.toFloat(f32, comp), rhs.imag(f32, comp)) }, |
| ... | ... | @@ -624,7 +715,7 @@ pub fn mul(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 624 | 715 | |
| 625 | 716 | result_bigint.mul(lhs_bigint, rhs_bigint, limbs_buffer, comp.gpa); |
| 626 | 717 | |
| 627 | const signedness = ty.signedness(comp); | |
| 718 | const signedness = qt.signedness(comp); | |
| 628 | 719 | const overflowed = !result_bigint.toConst().fitsInTwosComp(signedness, bits); |
| 629 | 720 | if (overflowed) { |
| 630 | 721 | result_bigint.truncate(result_bigint.toConst(), signedness, bits); |
| ... | ... | @@ -635,10 +726,11 @@ pub fn mul(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 635 | 726 | } |
| 636 | 727 | |
| 637 | 728 | /// caller guarantees rhs != 0 |
| 638 | pub fn div(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { | |
| 639 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 640 | if (ty.isFloat()) { | |
| 641 | if (ty.isComplex()) { | |
| 729 | pub fn div(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { | |
| 730 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 731 | const scalar_kind = qt.scalarKind(comp); | |
| 732 | if (scalar_kind.isFloat()) { | |
| 733 | if (scalar_kind == .complex_float) { | |
| 642 | 734 | const cf: Interner.Key.Complex = switch (bits) { |
| 643 | 735 | 32 => .{ .cf16 = annex_g.complexFloatDiv(f16, lhs.toFloat(f16, comp), lhs.imag(f16, comp), rhs.toFloat(f16, comp), rhs.imag(f16, comp)) }, |
| 644 | 736 | 64 => .{ .cf32 = annex_g.complexFloatDiv(f32, lhs.toFloat(f32, comp), lhs.imag(f32, comp), rhs.toFloat(f32, comp), rhs.imag(f32, comp)) }, |
| ... | ... | @@ -689,22 +781,21 @@ pub fn div(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 689 | 781 | result_q.divTrunc(&result_r, lhs_bigint, rhs_bigint, limbs_buffer); |
| 690 | 782 | |
| 691 | 783 | res.* = try intern(comp, .{ .int = .{ .big_int = result_q.toConst() } }); |
| 692 | return !result_q.toConst().fitsInTwosComp(ty.signedness(comp), bits); | |
| 784 | return !result_q.toConst().fitsInTwosComp(qt.signedness(comp), bits); | |
| 693 | 785 | } |
| 694 | 786 | } |
| 695 | 787 | |
| 696 | 788 | /// caller guarantees rhs != 0 |
| 697 | 789 | /// caller guarantees lhs != std.math.minInt(T) OR rhs != -1 |
| 698 | pub fn rem(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { | |
| 790 | pub fn rem(lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !Value { | |
| 699 | 791 | var lhs_space: BigIntSpace = undefined; |
| 700 | 792 | var rhs_space: BigIntSpace = undefined; |
| 701 | 793 | const lhs_bigint = lhs.toBigInt(&lhs_space, comp); |
| 702 | 794 | const rhs_bigint = rhs.toBigInt(&rhs_space, comp); |
| 703 | 795 | |
| 704 | const signedness = ty.signedness(comp); | |
| 705 | if (signedness == .signed) { | |
| 796 | if (qt.signedness(comp) == .signed) { | |
| 706 | 797 | var spaces: [2]BigIntSpace = undefined; |
| 707 | const min_val = try Value.minInt(ty, comp); | |
| 798 | const min_val = try Value.minInt(qt, comp); | |
| 708 | 799 | const negative = BigIntMutable.init(&spaces[0].limbs, -1).toConst(); |
| 709 | 800 | const big_one = BigIntMutable.init(&spaces[1].limbs, 1).toConst(); |
| 710 | 801 | if (lhs.compare(.eq, min_val, comp) and rhs_bigint.eql(negative)) { |
| ... | ... | @@ -712,9 +803,9 @@ pub fn rem(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { |
| 712 | 803 | } else if (rhs_bigint.order(big_one).compare(.lt)) { |
| 713 | 804 | // lhs - @divTrunc(lhs, rhs) * rhs |
| 714 | 805 | var tmp: Value = undefined; |
| 715 | _ = try tmp.div(lhs, rhs, ty, comp); | |
| 716 | _ = try tmp.mul(tmp, rhs, ty, comp); | |
| 717 | _ = try tmp.sub(lhs, tmp, ty, comp); | |
| 806 | _ = try tmp.div(lhs, rhs, qt, comp); | |
| 807 | _ = try tmp.mul(tmp, rhs, qt, comp); | |
| 808 | _ = try tmp.sub(lhs, tmp, qt, undefined, comp); | |
| 718 | 809 | return tmp; |
| 719 | 810 | } |
| 720 | 811 | } |
| ... | ... | @@ -801,8 +892,8 @@ pub fn bitAnd(lhs: Value, rhs: Value, comp: *Compilation) !Value { |
| 801 | 892 | return intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); |
| 802 | 893 | } |
| 803 | 894 | |
| 804 | pub fn bitNot(val: Value, ty: Type, comp: *Compilation) !Value { | |
| 805 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 895 | pub fn bitNot(val: Value, qt: QualType, comp: *Compilation) !Value { | |
| 896 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 806 | 897 | var val_space: Value.BigIntSpace = undefined; |
| 807 | 898 | const val_bigint = val.toBigInt(&val_space, comp); |
| 808 | 899 | |
| ... | ... | @@ -813,21 +904,21 @@ pub fn bitNot(val: Value, ty: Type, comp: *Compilation) !Value { |
| 813 | 904 | defer comp.gpa.free(limbs); |
| 814 | 905 | var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; |
| 815 | 906 | |
| 816 | result_bigint.bitNotWrap(val_bigint, ty.signedness(comp), bits); | |
| 907 | result_bigint.bitNotWrap(val_bigint, qt.signedness(comp), bits); | |
| 817 | 908 | return intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); |
| 818 | 909 | } |
| 819 | 910 | |
| 820 | pub fn shl(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { | |
| 911 | pub fn shl(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { | |
| 821 | 912 | var lhs_space: Value.BigIntSpace = undefined; |
| 822 | 913 | const lhs_bigint = lhs.toBigInt(&lhs_space, comp); |
| 823 | 914 | const shift = rhs.toInt(usize, comp) orelse std.math.maxInt(usize); |
| 824 | 915 | |
| 825 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 916 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 826 | 917 | if (shift > bits) { |
| 827 | 918 | if (lhs_bigint.positive) { |
| 828 | res.* = try Value.maxInt(ty, comp); | |
| 919 | res.* = try Value.maxInt(qt, comp); | |
| 829 | 920 | } else { |
| 830 | res.* = try Value.minInt(ty, comp); | |
| 921 | res.* = try Value.minInt(qt, comp); | |
| 831 | 922 | } |
| 832 | 923 | return true; |
| 833 | 924 | } |
| ... | ... | @@ -840,7 +931,7 @@ pub fn shl(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 840 | 931 | var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; |
| 841 | 932 | |
| 842 | 933 | result_bigint.shiftLeft(lhs_bigint, shift); |
| 843 | const signedness = ty.signedness(comp); | |
| 934 | const signedness = qt.signedness(comp); | |
| 844 | 935 | const overflowed = !result_bigint.toConst().fitsInTwosComp(signedness, bits); |
| 845 | 936 | if (overflowed) { |
| 846 | 937 | result_bigint.truncate(result_bigint.toConst(), signedness, bits); |
| ... | ... | @@ -849,7 +940,7 @@ pub fn shl(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b |
| 849 | 940 | return overflowed; |
| 850 | 941 | } |
| 851 | 942 | |
| 852 | pub fn shr(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { | |
| 943 | pub fn shr(lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !Value { | |
| 853 | 944 | var lhs_space: Value.BigIntSpace = undefined; |
| 854 | 945 | const lhs_bigint = lhs.toBigInt(&lhs_space, comp); |
| 855 | 946 | const shift = rhs.toInt(usize, comp) orelse return zero; |
| ... | ... | @@ -865,7 +956,7 @@ pub fn shr(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { |
| 865 | 956 | } |
| 866 | 957 | } |
| 867 | 958 | |
| 868 | const bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 959 | const bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 869 | 960 | const limbs = try comp.gpa.alloc( |
| 870 | 961 | std.math.big.Limb, |
| 871 | 962 | std.math.big.int.calcTwosCompLimbCount(bits), |
| ... | ... | @@ -877,8 +968,8 @@ pub fn shr(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { |
| 877 | 968 | return intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); |
| 878 | 969 | } |
| 879 | 970 | |
| 880 | pub fn complexConj(val: Value, ty: Type, comp: *Compilation) !Value { | |
| 881 | const bits = ty.bitSizeof(comp).?; | |
| 971 | pub fn complexConj(val: Value, qt: QualType, comp: *Compilation) !Value { | |
| 972 | const bits = qt.bitSizeof(comp); | |
| 882 | 973 | const cf: Interner.Key.Complex = switch (bits) { |
| 883 | 974 | 32 => .{ .cf16 = .{ val.toFloat(f16, comp), -val.imag(f16, comp) } }, |
| 884 | 975 | 64 => .{ .cf32 = .{ val.toFloat(f32, comp), -val.imag(f32, comp) } }, |
| ... | ... | @@ -890,12 +981,17 @@ pub fn complexConj(val: Value, ty: Type, comp: *Compilation) !Value { |
| 890 | 981 | return intern(comp, .{ .complex = cf }); |
| 891 | 982 | } |
| 892 | 983 | |
| 893 | pub fn compare(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *const Compilation) bool { | |
| 984 | fn shallowCompare(lhs: Value, op: std.math.CompareOperator, rhs: Value) ?bool { | |
| 894 | 985 | if (op == .eq) { |
| 895 | 986 | return lhs.opt_ref == rhs.opt_ref; |
| 896 | 987 | } else if (lhs.opt_ref == rhs.opt_ref) { |
| 897 | 988 | return std.math.Order.eq.compare(op); |
| 898 | 989 | } |
| 990 | return null; | |
| 991 | } | |
| 992 | ||
| 993 | pub fn compare(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *const Compilation) bool { | |
| 994 | if (lhs.shallowCompare(op, rhs)) |val| return val; | |
| 899 | 995 | |
| 900 | 996 | const lhs_key = comp.interner.get(lhs.ref()); |
| 901 | 997 | const rhs_key = comp.interner.get(rhs.ref()); |
| ... | ... | @@ -918,10 +1014,33 @@ pub fn compare(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *cons |
| 918 | 1014 | return lhs_bigint.order(rhs_bigint).compare(op); |
| 919 | 1015 | } |
| 920 | 1016 | |
| 921 | fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, ty: Type, comp: *Compilation) !Value { | |
| 922 | const signedness = ty.signedness(comp); | |
| 1017 | /// Returns null for values that cannot be compared at compile time (e.g. `&x < &y`) for globals `x` and `y`. | |
| 1018 | pub fn comparePointers(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *const Compilation) ?bool { | |
| 1019 | if (lhs.shallowCompare(op, rhs)) |val| return val; | |
| 1020 | ||
| 1021 | const lhs_key = comp.interner.get(lhs.ref()); | |
| 1022 | const rhs_key = comp.interner.get(rhs.ref()); | |
| 1023 | ||
| 1024 | if (lhs_key == .pointer and rhs_key == .pointer) { | |
| 1025 | const lhs_pointer = lhs_key.pointer; | |
| 1026 | const rhs_pointer = rhs_key.pointer; | |
| 1027 | switch (op) { | |
| 1028 | .eq => if (lhs_pointer.node != rhs_pointer.node) return false, | |
| 1029 | .neq => if (lhs_pointer.node != rhs_pointer.node) return true, | |
| 1030 | else => if (lhs_pointer.node != rhs_pointer.node) return null, | |
| 1031 | } | |
| 1032 | ||
| 1033 | const lhs_offset = fromRef(lhs_pointer.offset); | |
| 1034 | const rhs_offset = fromRef(rhs_pointer.offset); | |
| 1035 | return lhs_offset.compare(op, rhs_offset, comp); | |
| 1036 | } | |
| 1037 | return null; | |
| 1038 | } | |
| 1039 | ||
| 1040 | fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, qt: QualType, comp: *Compilation) !Value { | |
| 1041 | const signedness = qt.signedness(comp); | |
| 923 | 1042 | if (limit == .min and signedness == .unsigned) return Value.zero; |
| 924 | const mag_bits: usize = @intCast(ty.bitSizeof(comp).?); | |
| 1043 | const mag_bits: usize = @intCast(qt.bitSizeof(comp)); | |
| 925 | 1044 | switch (mag_bits) { |
| 926 | 1045 | inline 8, 16, 32, 64 => |bits| { |
| 927 | 1046 | if (limit == .min) return Value.int(@as(i64, std.math.minInt(std.meta.Int(.signed, bits))), comp); |
| ... | ... | @@ -946,44 +1065,63 @@ fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, ty: Type, comp: *C |
| 946 | 1065 | return Value.intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); |
| 947 | 1066 | } |
| 948 | 1067 | |
| 949 | pub fn minInt(ty: Type, comp: *Compilation) !Value { | |
| 950 | return twosCompIntLimit(.min, ty, comp); | |
| 1068 | pub fn minInt(qt: QualType, comp: *Compilation) !Value { | |
| 1069 | return twosCompIntLimit(.min, qt, comp); | |
| 1070 | } | |
| 1071 | ||
| 1072 | pub fn maxInt(qt: QualType, comp: *Compilation) !Value { | |
| 1073 | return twosCompIntLimit(.max, qt, comp); | |
| 951 | 1074 | } |
| 952 | 1075 | |
| 953 | pub fn maxInt(ty: Type, comp: *Compilation) !Value { | |
| 954 | return twosCompIntLimit(.max, ty, comp); | |
| 1076 | const NestedPrint = union(enum) { | |
| 1077 | pointer: struct { | |
| 1078 | node: u32, | |
| 1079 | offset: Value, | |
| 1080 | }, | |
| 1081 | }; | |
| 1082 | ||
| 1083 | pub fn printPointer(offset: Value, base: []const u8, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1084 | try w.writeByte('&'); | |
| 1085 | try w.writeAll(base); | |
| 1086 | if (!offset.isZero(comp)) { | |
| 1087 | const maybe_nested = try offset.print(comp.type_store.ptrdiff, comp, w); | |
| 1088 | std.debug.assert(maybe_nested == null); | |
| 1089 | } | |
| 955 | 1090 | } |
| 956 | 1091 | |
| 957 | pub fn print(v: Value, ty: Type, comp: *const Compilation, w: *Writer) Writer.Error!void { | |
| 958 | if (ty.is(.bool)) { | |
| 959 | return w.writeAll(if (v.isZero(comp)) "false" else "true"); | |
| 1092 | pub fn print(v: Value, qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!?NestedPrint { | |
| 1093 | if (qt.is(comp, .bool)) { | |
| 1094 | try w.writeAll(if (v.isZero(comp)) "false" else "true"); | |
| 1095 | return null; | |
| 960 | 1096 | } |
| 961 | 1097 | const key = comp.interner.get(v.ref()); |
| 962 | 1098 | switch (key) { |
| 963 | .null => return w.writeAll("nullptr_t"), | |
| 1099 | .null => try w.writeAll("nullptr_t"), | |
| 964 | 1100 | .int => |repr| switch (repr) { |
| 965 | inline .u64, .i64, .big_int => |x| return w.print("{d}", .{x}), | |
| 1101 | inline else => |x| try w.print("{d}", .{x}), | |
| 966 | 1102 | }, |
| 967 | 1103 | .float => |repr| switch (repr) { |
| 968 | .f16 => |x| return w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000) / 1000}), | |
| 969 | .f32 => |x| return w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000000) / 1000000}), | |
| 970 | inline else => |x| return w.print("{d}", .{@as(f64, @floatCast(x))}), | |
| 1104 | .f16 => |x| try w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000) / 1000}), | |
| 1105 | .f32 => |x| try w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000000) / 1000000}), | |
| 1106 | inline else => |x| try w.print("{d}", .{@as(f64, @floatCast(x))}), | |
| 971 | 1107 | }, |
| 972 | .bytes => |b| return printString(b, ty, comp, w), | |
| 1108 | .bytes => |b| try printString(b, qt, comp, w), | |
| 973 | 1109 | .complex => |repr| switch (repr) { |
| 974 | .cf32 => |components| return w.print("{d} + {d}i", .{ @round(@as(f64, @floatCast(components[0])) * 1000000) / 1000000, @round(@as(f64, @floatCast(components[1])) * 1000000) / 1000000 }), | |
| 975 | inline else => |components| return w.print("{d} + {d}i", .{ @as(f64, @floatCast(components[0])), @as(f64, @floatCast(components[1])) }), | |
| 1110 | .cf32 => |components| try w.print("{d} + {d}i", .{ @round(@as(f64, @floatCast(components[0])) * 1000000) / 1000000, @round(@as(f64, @floatCast(components[1])) * 1000000) / 1000000 }), | |
| 1111 | inline else => |components| try w.print("{d} + {d}i", .{ @as(f64, @floatCast(components[0])), @as(f64, @floatCast(components[1])) }), | |
| 976 | 1112 | }, |
| 1113 | .pointer => |ptr| return .{ .pointer = .{ .node = ptr.node, .offset = fromRef(ptr.offset) } }, | |
| 977 | 1114 | else => unreachable, // not a value |
| 978 | 1115 | } |
| 1116 | return null; | |
| 979 | 1117 | } |
| 980 | 1118 | |
| 981 | pub fn printString(bytes: []const u8, ty: Type, comp: *const Compilation, w: *Writer) Writer.Error!void { | |
| 982 | const size: Compilation.CharUnitSize = @enumFromInt(ty.elemType().sizeof(comp).?); | |
| 1119 | pub fn printString(bytes: []const u8, qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { | |
| 1120 | const size: Compilation.CharUnitSize = @enumFromInt(qt.childType(comp).sizeof(comp)); | |
| 983 | 1121 | const without_null = bytes[0 .. bytes.len - @intFromEnum(size)]; |
| 984 | 1122 | try w.writeByte('"'); |
| 985 | 1123 | switch (size) { |
| 986 | .@"1" => try w.print("{f}", .{std.zig.fmtString(without_null)}), | |
| 1124 | .@"1" => try std.zig.stringEscape(without_null, w), | |
| 987 | 1125 | .@"2" => { |
| 988 | 1126 | var items: [2]u16 = undefined; |
| 989 | 1127 | var i: usize = 0; |
lib/compiler/aro/aro/char_info.zig+40-40| ... | ... | @@ -442,48 +442,48 @@ pub fn isInvisible(codepoint: u21) bool { |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | /// Checks for identifier characters which resemble non-identifier characters |
| 445 | pub fn homoglyph(codepoint: u21) ?u21 { | |
| 445 | pub fn homoglyph(codepoint: u21) ?[]const u8 { | |
| 446 | 446 | assert(codepoint > 0x7F); |
| 447 | 447 | return switch (codepoint) { |
| 448 | 0x01c3 => '!', // LATIN LETTER RETROFLEX CLICK | |
| 449 | 0x037e => ';', // GREEK QUESTION MARK | |
| 450 | 0x2212 => '-', // MINUS SIGN | |
| 451 | 0x2215 => '/', // DIVISION SLASH | |
| 452 | 0x2216 => '\\', // SET MINUS | |
| 453 | 0x2217 => '*', // ASTERISK OPERATOR | |
| 454 | 0x2223 => '|', // DIVIDES | |
| 455 | 0x2227 => '^', // LOGICAL AND | |
| 456 | 0x2236 => ':', // RATIO | |
| 457 | 0x223c => '~', // TILDE OPERATOR | |
| 458 | 0xa789 => ':', // MODIFIER LETTER COLON | |
| 459 | 0xff01 => '!', // FULLWIDTH EXCLAMATION MARK | |
| 460 | 0xff03 => '#', // FULLWIDTH NUMBER SIGN | |
| 461 | 0xff04 => '$', // FULLWIDTH DOLLAR SIGN | |
| 462 | 0xff05 => '%', // FULLWIDTH PERCENT SIGN | |
| 463 | 0xff06 => '&', // FULLWIDTH AMPERSAND | |
| 464 | 0xff08 => '(', // FULLWIDTH LEFT PARENTHESIS | |
| 465 | 0xff09 => ')', // FULLWIDTH RIGHT PARENTHESIS | |
| 466 | 0xff0a => '*', // FULLWIDTH ASTERISK | |
| 467 | 0xff0b => '+', // FULLWIDTH ASTERISK | |
| 468 | 0xff0c => ',', // FULLWIDTH COMMA | |
| 469 | 0xff0d => '-', // FULLWIDTH HYPHEN-MINUS | |
| 470 | 0xff0e => '.', // FULLWIDTH FULL STOP | |
| 471 | 0xff0f => '/', // FULLWIDTH SOLIDUS | |
| 472 | 0xff1a => ':', // FULLWIDTH COLON | |
| 473 | 0xff1b => ';', // FULLWIDTH SEMICOLON | |
| 474 | 0xff1c => '<', // FULLWIDTH LESS-THAN SIGN | |
| 475 | 0xff1d => '=', // FULLWIDTH EQUALS SIGN | |
| 476 | 0xff1e => '>', // FULLWIDTH GREATER-THAN SIGN | |
| 477 | 0xff1f => '?', // FULLWIDTH QUESTION MARK | |
| 478 | 0xff20 => '@', // FULLWIDTH COMMERCIAL AT | |
| 479 | 0xff3b => '[', // FULLWIDTH LEFT SQUARE BRACKET | |
| 480 | 0xff3c => '\\', // FULLWIDTH REVERSE SOLIDUS | |
| 481 | 0xff3d => ']', // FULLWIDTH RIGHT SQUARE BRACKET | |
| 482 | 0xff3e => '^', // FULLWIDTH CIRCUMFLEX ACCENT | |
| 483 | 0xff5b => '{', // FULLWIDTH LEFT CURLY BRACKET | |
| 484 | 0xff5c => '|', // FULLWIDTH VERTICAL LINE | |
| 485 | 0xff5d => '}', // FULLWIDTH RIGHT CURLY BRACKET | |
| 486 | 0xff5e => '~', // FULLWIDTH TILDE | |
| 448 | 0x01c3 => "!", // LATIN LETTER RETROFLEX CLICK | |
| 449 | 0x037e => ";", // GREEK QUESTION MARK | |
| 450 | 0x2212 => "-", // MINUS SIGN | |
| 451 | 0x2215 => "/", // DIVISION SLASH | |
| 452 | 0x2216 => "\\", // SET MINUS | |
| 453 | 0x2217 => "*", // ASTERISK OPERATOR | |
| 454 | 0x2223 => "|", // DIVIDES | |
| 455 | 0x2227 => "^", // LOGICAL AND | |
| 456 | 0x2236 => ":", // RATIO | |
| 457 | 0x223c => "~", // TILDE OPERATOR | |
| 458 | 0xa789 => ":", // MODIFIER LETTER COLON | |
| 459 | 0xff01 => "!", // FULLWIDTH EXCLAMATION MARK | |
| 460 | 0xff03 => "#", // FULLWIDTH NUMBER SIGN | |
| 461 | 0xff04 => "$", // FULLWIDTH DOLLAR SIGN | |
| 462 | 0xff05 => "%", // FULLWIDTH PERCENT SIGN | |
| 463 | 0xff06 => "&", // FULLWIDTH AMPERSAND | |
| 464 | 0xff08 => "(", // FULLWIDTH LEFT PARENTHESIS | |
| 465 | 0xff09 => ")", // FULLWIDTH RIGHT PARENTHESIS | |
| 466 | 0xff0a => "*", // FULLWIDTH ASTERISK | |
| 467 | 0xff0b => "+", // FULLWIDTH ASTERISK | |
| 468 | 0xff0c => ",", // FULLWIDTH COMMA | |
| 469 | 0xff0d => "-", // FULLWIDTH HYPHEN-MINUS | |
| 470 | 0xff0e => ".", // FULLWIDTH FULL STOP | |
| 471 | 0xff0f => "/", // FULLWIDTH SOLIDUS | |
| 472 | 0xff1a => ":", // FULLWIDTH COLON | |
| 473 | 0xff1b => ";", // FULLWIDTH SEMICOLON | |
| 474 | 0xff1c => "<", // FULLWIDTH LESS-THAN SIGN | |
| 475 | 0xff1d => "=", // FULLWIDTH EQUALS SIGN | |
| 476 | 0xff1e => ">", // FULLWIDTH GREATER-THAN SIGN | |
| 477 | 0xff1f => "?", // FULLWIDTH QUESTION MARK | |
| 478 | 0xff20 => "@", // FULLWIDTH COMMERCIAL AT | |
| 479 | 0xff3b => "[", // FULLWIDTH LEFT SQUARE BRACKET | |
| 480 | 0xff3c => "\\", // FULLWIDTH REVERSE SOLIDUS | |
| 481 | 0xff3d => "]", // FULLWIDTH RIGHT SQUARE BRACKET | |
| 482 | 0xff3e => "^", // FULLWIDTH CIRCUMFLEX ACCENT | |
| 483 | 0xff5b => "{", // FULLWIDTH LEFT CURLY BRACKET | |
| 484 | 0xff5c => "|", // FULLWIDTH VERTICAL LINE | |
| 485 | 0xff5d => "}", // FULLWIDTH RIGHT CURLY BRACKET | |
| 486 | 0xff5e => "~", // FULLWIDTH TILDE | |
| 487 | 487 | else => null, |
| 488 | 488 | }; |
| 489 | 489 | } |
lib/compiler/aro/aro/features.zig+2-2| ... | ... | @@ -57,13 +57,13 @@ pub fn hasExtension(comp: *Compilation, ext: []const u8) bool { |
| 57 | 57 | // C11 features |
| 58 | 58 | .c_alignas = true, |
| 59 | 59 | .c_alignof = true, |
| 60 | .c_atomic = false, // TODO | |
| 60 | .c_atomic = true, | |
| 61 | 61 | .c_generic_selections = true, |
| 62 | 62 | .c_static_assert = true, |
| 63 | 63 | .c_thread_local = target_util.isTlsSupported(comp.target), |
| 64 | 64 | // misc |
| 65 | 65 | .overloadable_unmarked = false, // TODO |
| 66 | .statement_attributes_with_gnu_syntax = false, // TODO | |
| 66 | .statement_attributes_with_gnu_syntax = true, | |
| 67 | 67 | .gnu_asm = true, |
| 68 | 68 | .gnu_asm_goto_with_outputs = true, |
| 69 | 69 | .matrix_types = false, // TODO |
lib/compiler/aro/aro/pragmas/gcc.zig+27-55| ... | ... | @@ -1,10 +1,11 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | ||
| 3 | 4 | const Compilation = @import("../Compilation.zig"); |
| 4 | const Pragma = @import("../Pragma.zig"); | |
| 5 | 5 | const Diagnostics = @import("../Diagnostics.zig"); |
| 6 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 7 | 6 | const Parser = @import("../Parser.zig"); |
| 7 | const Pragma = @import("../Pragma.zig"); | |
| 8 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 8 | 9 | const TokenIndex = @import("../Tree.zig").TokenIndex; |
| 9 | 10 | |
| 10 | 11 | const GCC = @This(); |
| ... | ... | @@ -18,8 +19,8 @@ pragma: Pragma = .{ |
| 18 | 19 | .parserHandler = parserHandler, |
| 19 | 20 | .preserveTokens = preserveTokens, |
| 20 | 21 | }, |
| 21 | original_options: Diagnostics.Options = .{}, | |
| 22 | options_stack: std.ArrayListUnmanaged(Diagnostics.Options) = .empty, | |
| 22 | original_state: Diagnostics.State = .{}, | |
| 23 | state_stack: std.ArrayList(Diagnostics.State) = .empty, | |
| 23 | 24 | |
| 24 | 25 | const Directive = enum { |
| 25 | 26 | warning, |
| ... | ... | @@ -38,19 +39,19 @@ const Directive = enum { |
| 38 | 39 | |
| 39 | 40 | fn beforePreprocess(pragma: *Pragma, comp: *Compilation) void { |
| 40 | 41 | var self: *GCC = @fieldParentPtr("pragma", pragma); |
| 41 | self.original_options = comp.diagnostics.options; | |
| 42 | self.original_state = comp.diagnostics.state; | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | fn beforeParse(pragma: *Pragma, comp: *Compilation) void { |
| 45 | 46 | var self: *GCC = @fieldParentPtr("pragma", pragma); |
| 46 | comp.diagnostics.options = self.original_options; | |
| 47 | self.options_stack.items.len = 0; | |
| 47 | comp.diagnostics.state = self.original_state; | |
| 48 | self.state_stack.items.len = 0; | |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 51 | fn afterParse(pragma: *Pragma, comp: *Compilation) void { |
| 51 | 52 | var self: *GCC = @fieldParentPtr("pragma", pragma); |
| 52 | comp.diagnostics.options = self.original_options; | |
| 53 | self.options_stack.items.len = 0; | |
| 53 | comp.diagnostics.state = self.original_state; | |
| 54 | self.state_stack.items.len = 0; | |
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | pub fn init(allocator: mem.Allocator) !*Pragma { |
| ... | ... | @@ -61,7 +62,7 @@ pub fn init(allocator: mem.Allocator) !*Pragma { |
| 61 | 62 | |
| 62 | 63 | fn deinit(pragma: *Pragma, comp: *Compilation) void { |
| 63 | 64 | var self: *GCC = @fieldParentPtr("pragma", pragma); |
| 64 | self.options_stack.deinit(comp.gpa); | |
| 65 | self.state_stack.deinit(comp.gpa); | |
| 65 | 66 | comp.gpa.destroy(self); |
| 66 | 67 | } |
| 67 | 68 | |
| ... | ... | @@ -76,23 +77,14 @@ fn diagnosticHandler(self: *GCC, pp: *Preprocessor, start_idx: TokenIndex) Pragm |
| 76 | 77 | .ignored, .warning, .@"error", .fatal => { |
| 77 | 78 | const str = Pragma.pasteTokens(pp, start_idx + 1) catch |err| switch (err) { |
| 78 | 79 | error.ExpectedStringLiteral => { |
| 79 | return pp.comp.addDiagnostic(.{ | |
| 80 | .tag = .pragma_requires_string_literal, | |
| 81 | .loc = diagnostic_tok.loc, | |
| 82 | .extra = .{ .str = "GCC diagnostic" }, | |
| 83 | }, pp.expansionSlice(start_idx)); | |
| 80 | return Pragma.err(pp, start_idx, .pragma_requires_string_literal, .{"GCC diagnostic"}); | |
| 84 | 81 | }, |
| 85 | 82 | else => |e| return e, |
| 86 | 83 | }; |
| 87 | 84 | if (!mem.startsWith(u8, str, "-W")) { |
| 88 | const next = pp.tokens.get(start_idx + 1); | |
| 89 | return pp.comp.addDiagnostic(.{ | |
| 90 | .tag = .malformed_warning_check, | |
| 91 | .loc = next.loc, | |
| 92 | .extra = .{ .str = "GCC diagnostic" }, | |
| 93 | }, pp.expansionSlice(start_idx + 1)); | |
| 85 | return Pragma.err(pp, start_idx + 1, .malformed_warning_check, .{"GCC diagnostic"}); | |
| 94 | 86 | } |
| 95 | const new_kind: Diagnostics.Kind = switch (diagnostic) { | |
| 87 | const new_kind: Diagnostics.Message.Kind = switch (diagnostic) { | |
| 96 | 88 | .ignored => .off, |
| 97 | 89 | .warning => .warning, |
| 98 | 90 | .@"error" => .@"error", |
| ... | ... | @@ -100,10 +92,10 @@ fn diagnosticHandler(self: *GCC, pp: *Preprocessor, start_idx: TokenIndex) Pragm |
| 100 | 92 | else => unreachable, |
| 101 | 93 | }; |
| 102 | 94 | |
| 103 | try pp.comp.diagnostics.set(str[2..], new_kind); | |
| 95 | try pp.diagnostics.set(str[2..], new_kind); | |
| 104 | 96 | }, |
| 105 | .push => try self.options_stack.append(pp.comp.gpa, pp.comp.diagnostics.options), | |
| 106 | .pop => pp.comp.diagnostics.options = self.options_stack.pop() orelse self.original_options, | |
| 97 | .push => try self.state_stack.append(pp.comp.gpa, pp.diagnostics.state), | |
| 98 | .pop => pp.diagnostics.state = self.state_stack.pop() orelse self.original_state, | |
| 107 | 99 | } |
| 108 | 100 | } |
| 109 | 101 | |
| ... | ... | @@ -112,38 +104,24 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex |
| 112 | 104 | const directive_tok = pp.tokens.get(start_idx + 1); |
| 113 | 105 | if (directive_tok.id == .nl) return; |
| 114 | 106 | |
| 115 | const gcc_pragma = std.meta.stringToEnum(Directive, pp.expandedSlice(directive_tok)) orelse | |
| 116 | return pp.comp.addDiagnostic(.{ | |
| 117 | .tag = .unknown_gcc_pragma, | |
| 118 | .loc = directive_tok.loc, | |
| 119 | }, pp.expansionSlice(start_idx + 1)); | |
| 107 | const gcc_pragma = std.meta.stringToEnum(Directive, pp.expandedSlice(directive_tok)) orelse { | |
| 108 | return Pragma.err(pp, start_idx + 1, .unknown_gcc_pragma, .{}); | |
| 109 | }; | |
| 120 | 110 | |
| 121 | 111 | switch (gcc_pragma) { |
| 122 | 112 | .warning, .@"error" => { |
| 123 | 113 | const text = Pragma.pasteTokens(pp, start_idx + 2) catch |err| switch (err) { |
| 124 | 114 | error.ExpectedStringLiteral => { |
| 125 | return pp.comp.addDiagnostic(.{ | |
| 126 | .tag = .pragma_requires_string_literal, | |
| 127 | .loc = directive_tok.loc, | |
| 128 | .extra = .{ .str = @tagName(gcc_pragma) }, | |
| 129 | }, pp.expansionSlice(start_idx + 1)); | |
| 115 | return Pragma.err(pp, start_idx + 1, .pragma_requires_string_literal, .{@tagName(gcc_pragma)}); | |
| 130 | 116 | }, |
| 131 | 117 | else => |e| return e, |
| 132 | 118 | }; |
| 133 | const extra = Diagnostics.Message.Extra{ .str = try pp.comp.diagnostics.arena.allocator().dupe(u8, text) }; | |
| 134 | const diagnostic_tag: Diagnostics.Tag = if (gcc_pragma == .warning) .pragma_warning_message else .pragma_error_message; | |
| 135 | return pp.comp.addDiagnostic( | |
| 136 | .{ .tag = diagnostic_tag, .loc = directive_tok.loc, .extra = extra }, | |
| 137 | pp.expansionSlice(start_idx + 1), | |
| 138 | ); | |
| 119 | ||
| 120 | return Pragma.err(pp, start_idx + 1, if (gcc_pragma == .warning) .pragma_warning_message else .pragma_error_message, .{text}); | |
| 139 | 121 | }, |
| 140 | 122 | .diagnostic => return self.diagnosticHandler(pp, start_idx + 2) catch |err| switch (err) { |
| 141 | 123 | error.UnknownPragma => { |
| 142 | const tok = pp.tokens.get(start_idx + 2); | |
| 143 | return pp.comp.addDiagnostic(.{ | |
| 144 | .tag = .unknown_gcc_pragma_directive, | |
| 145 | .loc = tok.loc, | |
| 146 | }, pp.expansionSlice(start_idx + 2)); | |
| 124 | return Pragma.err(pp, start_idx + 2, .unknown_gcc_pragma_directive, .{}); | |
| 147 | 125 | }, |
| 148 | 126 | else => |e| return e, |
| 149 | 127 | }, |
| ... | ... | @@ -154,19 +132,13 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex |
| 154 | 132 | if (tok.id == .nl) break; |
| 155 | 133 | |
| 156 | 134 | if (!tok.id.isMacroIdentifier()) { |
| 157 | return pp.comp.addDiagnostic(.{ | |
| 158 | .tag = .pragma_poison_identifier, | |
| 159 | .loc = tok.loc, | |
| 160 | }, pp.expansionSlice(start_idx + i)); | |
| 135 | return Pragma.err(pp, start_idx + i, .pragma_poison_identifier, .{}); | |
| 161 | 136 | } |
| 162 | 137 | const str = pp.expandedSlice(tok); |
| 163 | 138 | if (pp.defines.get(str) != null) { |
| 164 | try pp.comp.addDiagnostic(.{ | |
| 165 | .tag = .pragma_poison_macro, | |
| 166 | .loc = tok.loc, | |
| 167 | }, pp.expansionSlice(start_idx + i)); | |
| 139 | try Pragma.err(pp, start_idx + i, .pragma_poison_macro, .{}); | |
| 168 | 140 | } |
| 169 | try pp.poisoned_identifiers.put(str, {}); | |
| 141 | try pp.poisoned_identifiers.put(pp.comp.gpa, str, {}); | |
| 170 | 142 | } |
| 171 | 143 | return; |
| 172 | 144 | }, |
lib/compiler/aro/aro/pragmas/message.zig+22-13| ... | ... | @@ -1,12 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | ||
| 3 | 4 | const Compilation = @import("../Compilation.zig"); |
| 4 | const Pragma = @import("../Pragma.zig"); | |
| 5 | 5 | const Diagnostics = @import("../Diagnostics.zig"); |
| 6 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 7 | 6 | const Parser = @import("../Parser.zig"); |
| 8 | const TokenIndex = @import("../Tree.zig").TokenIndex; | |
| 7 | const Pragma = @import("../Pragma.zig"); | |
| 8 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 9 | 9 | const Source = @import("../Source.zig"); |
| 10 | const TokenIndex = @import("../Tree.zig").TokenIndex; | |
| 10 | 11 | |
| 11 | 12 | const Message = @This(); |
| 12 | 13 | |
| ... | ... | @@ -27,24 +28,32 @@ fn deinit(pragma: *Pragma, comp: *Compilation) void { |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | fn preprocessorHandler(_: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) Pragma.Error!void { |
| 30 | const message_tok = pp.tokens.get(start_idx); | |
| 31 | const message_expansion_locs = pp.expansionSlice(start_idx); | |
| 32 | ||
| 33 | 31 | const str = Pragma.pasteTokens(pp, start_idx + 1) catch |err| switch (err) { |
| 34 | 32 | error.ExpectedStringLiteral => { |
| 35 | return pp.comp.addDiagnostic(.{ | |
| 36 | .tag = .pragma_requires_string_literal, | |
| 37 | .loc = message_tok.loc, | |
| 38 | .extra = .{ .str = "message" }, | |
| 39 | }, message_expansion_locs); | |
| 33 | return Pragma.err(pp, start_idx, .pragma_requires_string_literal, .{"message"}); | |
| 40 | 34 | }, |
| 41 | 35 | else => |e| return e, |
| 42 | 36 | }; |
| 43 | 37 | |
| 38 | const message_tok = pp.tokens.get(start_idx); | |
| 39 | const message_expansion_locs = pp.expansionSlice(start_idx); | |
| 44 | 40 | const loc = if (message_expansion_locs.len != 0) |
| 45 | 41 | message_expansion_locs[message_expansion_locs.len - 1] |
| 46 | 42 | else |
| 47 | 43 | message_tok.loc; |
| 48 | const extra = Diagnostics.Message.Extra{ .str = try pp.comp.diagnostics.arena.allocator().dupe(u8, str) }; | |
| 49 | return pp.comp.addDiagnostic(.{ .tag = .pragma_message, .loc = loc, .extra = extra }, &.{}); | |
| 44 | ||
| 45 | const diagnostic: Pragma.Diagnostic = .pragma_message; | |
| 46 | ||
| 47 | var sf = std.heap.stackFallback(1024, pp.comp.gpa); | |
| 48 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 49 | defer allocating.deinit(); | |
| 50 | ||
| 51 | Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, .{str}) catch return error.OutOfMemory; | |
| 52 | ||
| 53 | try pp.diagnostics.add(.{ | |
| 54 | .text = allocating.written(), | |
| 55 | .kind = diagnostic.kind, | |
| 56 | .opt = diagnostic.opt, | |
| 57 | .location = loc.expand(pp.comp), | |
| 58 | }); | |
| 50 | 59 | } |
lib/compiler/aro/aro/pragmas/once.zig+21-13| ... | ... | @@ -1,12 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | ||
| 3 | 4 | const Compilation = @import("../Compilation.zig"); |
| 4 | const Pragma = @import("../Pragma.zig"); | |
| 5 | 5 | const Diagnostics = @import("../Diagnostics.zig"); |
| 6 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 7 | 6 | const Parser = @import("../Parser.zig"); |
| 8 | const TokenIndex = @import("../Tree.zig").TokenIndex; | |
| 7 | const Pragma = @import("../Pragma.zig"); | |
| 8 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 9 | 9 | const Source = @import("../Source.zig"); |
| 10 | const TokenIndex = @import("../Tree.zig").TokenIndex; | |
| 10 | 11 | |
| 11 | 12 | const Once = @This(); |
| 12 | 13 | |
| ... | ... | @@ -14,15 +15,14 @@ pragma: Pragma = .{ |
| 14 | 15 | .afterParse = afterParse, |
| 15 | 16 | .deinit = deinit, |
| 16 | 17 | .preprocessorHandler = preprocessorHandler, |
| 18 | .preserveTokens = preserveTokens, | |
| 17 | 19 | }, |
| 18 | pragma_once: std.AutoHashMap(Source.Id, void), | |
| 20 | pragma_once: std.AutoHashMapUnmanaged(Source.Id, void) = .empty, | |
| 19 | 21 | preprocess_count: u32 = 0, |
| 20 | 22 | |
| 21 | 23 | pub fn init(allocator: mem.Allocator) !*Pragma { |
| 22 | 24 | var once = try allocator.create(Once); |
| 23 | once.* = .{ | |
| 24 | .pragma_once = std.AutoHashMap(Source.Id, void).init(allocator), | |
| 25 | }; | |
| 25 | once.* = .{}; | |
| 26 | 26 | return &once.pragma; |
| 27 | 27 | } |
| 28 | 28 | |
| ... | ... | @@ -33,8 +33,9 @@ fn afterParse(pragma: *Pragma, _: *Compilation) void { |
| 33 | 33 | |
| 34 | 34 | fn deinit(pragma: *Pragma, comp: *Compilation) void { |
| 35 | 35 | var self: *Once = @fieldParentPtr("pragma", pragma); |
| 36 | self.pragma_once.deinit(); | |
| 36 | self.pragma_once.deinit(comp.gpa); | |
| 37 | 37 | comp.gpa.destroy(self); |
| 38 | pragma.* = undefined; | |
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | 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 |
| 42 | 43 | const name_tok = pp.tokens.get(start_idx); |
| 43 | 44 | const next = pp.tokens.get(start_idx + 1); |
| 44 | 45 | if (next.id != .nl) { |
| 45 | try pp.comp.addDiagnostic(.{ | |
| 46 | .tag = .extra_tokens_directive_end, | |
| 47 | .loc = name_tok.loc, | |
| 48 | }, pp.expansionSlice(start_idx + 1)); | |
| 46 | const diagnostic: Preprocessor.Diagnostic = .extra_tokens_directive_end; | |
| 47 | return pp.diagnostics.addWithLocation(pp.comp, .{ | |
| 48 | .text = diagnostic.fmt, | |
| 49 | .kind = diagnostic.kind, | |
| 50 | .opt = diagnostic.opt, | |
| 51 | .location = name_tok.loc.expand(pp.comp), | |
| 52 | }, pp.expansionSlice(start_idx + 1), true); | |
| 49 | 53 | } |
| 50 | 54 | const seen = self.preprocess_count == pp.preprocess_count; |
| 51 | const prev = try self.pragma_once.fetchPut(name_tok.loc.id, {}); | |
| 55 | const prev = try self.pragma_once.fetchPut(pp.comp.gpa, name_tok.loc.id, {}); | |
| 52 | 56 | if (prev != null and !seen) { |
| 53 | 57 | return error.StopPreprocessing; |
| 54 | 58 | } |
| 55 | 59 | self.preprocess_count = pp.preprocess_count; |
| 56 | 60 | } |
| 61 | ||
| 62 | fn preserveTokens(_: *Pragma, _: *Preprocessor, _: TokenIndex) bool { | |
| 63 | return false; | |
| 64 | } |
lib/compiler/aro/aro/pragmas/pack.zig+17-24| ... | ... | @@ -1,10 +1,11 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const mem = std.mem; |
| 3 | ||
| 3 | 4 | const Compilation = @import("../Compilation.zig"); |
| 4 | const Pragma = @import("../Pragma.zig"); | |
| 5 | 5 | const Diagnostics = @import("../Diagnostics.zig"); |
| 6 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 7 | 6 | const Parser = @import("../Parser.zig"); |
| 7 | const Pragma = @import("../Pragma.zig"); | |
| 8 | const Preprocessor = @import("../Preprocessor.zig"); | |
| 8 | 9 | const Tree = @import("../Tree.zig"); |
| 9 | 10 | const TokenIndex = Tree.TokenIndex; |
| 10 | 11 | |
| ... | ... | @@ -13,9 +14,8 @@ const Pack = @This(); |
| 13 | 14 | pragma: Pragma = .{ |
| 14 | 15 | .deinit = deinit, |
| 15 | 16 | .parserHandler = parserHandler, |
| 16 | .preserveTokens = preserveTokens, | |
| 17 | 17 | }, |
| 18 | stack: std.ArrayListUnmanaged(struct { label: []const u8, val: u8 }) = .empty, | |
| 18 | stack: std.ArrayList(struct { label: []const u8, val: u8 }) = .empty, | |
| 19 | 19 | |
| 20 | 20 | pub fn init(allocator: mem.Allocator) !*Pragma { |
| 21 | 21 | var pack = try allocator.create(Pack); |
| ... | ... | @@ -34,10 +34,7 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation |
| 34 | 34 | var idx = start_idx + 1; |
| 35 | 35 | const l_paren = p.pp.tokens.get(idx); |
| 36 | 36 | if (l_paren.id != .l_paren) { |
| 37 | return p.comp.addDiagnostic(.{ | |
| 38 | .tag = .pragma_pack_lparen, | |
| 39 | .loc = l_paren.loc, | |
| 40 | }, p.pp.expansionSlice(idx)); | |
| 37 | return Pragma.err(p.pp, idx, .pragma_pack_lparen, .{}); | |
| 41 | 38 | } |
| 42 | 39 | idx += 1; |
| 43 | 40 | |
| ... | ... | @@ -54,11 +51,11 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation |
| 54 | 51 | pop, |
| 55 | 52 | }; |
| 56 | 53 | const action = std.meta.stringToEnum(Action, p.tokSlice(arg)) orelse { |
| 57 | return p.errTok(.pragma_pack_unknown_action, arg); | |
| 54 | return Pragma.err(p.pp, arg, .pragma_pack_unknown_action, .{}); | |
| 58 | 55 | }; |
| 59 | 56 | switch (action) { |
| 60 | 57 | .show => { |
| 61 | try p.errExtra(.pragma_pack_show, arg, .{ .unsigned = p.pragma_pack orelse 8 }); | |
| 58 | return Pragma.err(p.pp, arg, .pragma_pack_show, .{p.pragma_pack orelse 8}); | |
| 62 | 59 | }, |
| 63 | 60 | .push, .pop => { |
| 64 | 61 | var new_val: ?u8 = null; |
| ... | ... | @@ -75,21 +72,23 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation |
| 75 | 72 | idx += 1; |
| 76 | 73 | const int = idx; |
| 77 | 74 | idx += 1; |
| 78 | if (tok_ids[int] != .pp_num) return p.errTok(.pragma_pack_int_ident, int); | |
| 75 | if (tok_ids[int] != .pp_num) { | |
| 76 | return Pragma.err(p.pp, int, .pragma_pack_int_ident, .{}); | |
| 77 | } | |
| 79 | 78 | new_val = (try packInt(p, int)) orelse return; |
| 80 | 79 | } |
| 81 | 80 | }, |
| 82 | else => return p.errTok(.pragma_pack_int_ident, next), | |
| 81 | else => return Pragma.err(p.pp, next, .pragma_pack_int_ident, .{}), | |
| 83 | 82 | } |
| 84 | 83 | } |
| 85 | 84 | if (action == .push) { |
| 86 | try pack.stack.append(p.gpa, .{ .label = label orelse "", .val = p.pragma_pack orelse 8 }); | |
| 85 | try pack.stack.append(p.comp.gpa, .{ .label = label orelse "", .val = p.pragma_pack orelse 8 }); | |
| 87 | 86 | } else { |
| 88 | 87 | pack.pop(p, label); |
| 89 | 88 | if (new_val != null) { |
| 90 | try p.errTok(.pragma_pack_undefined_pop, arg); | |
| 89 | try Pragma.err(p.pp, arg, .pragma_pack_undefined_pop, .{}); | |
| 91 | 90 | } else if (pack.stack.items.len == 0) { |
| 92 | try p.errTok(.pragma_pack_empty_stack, arg); | |
| 91 | try Pragma.err(p.pp, arg, .pragma_pack_empty_stack, .{}); | |
| 93 | 92 | } |
| 94 | 93 | } |
| 95 | 94 | if (new_val) |some| { |
| ... | ... | @@ -115,14 +114,14 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation |
| 115 | 114 | } |
| 116 | 115 | |
| 117 | 116 | if (tok_ids[idx] != .r_paren) { |
| 118 | return p.errTok(.pragma_pack_rparen, idx); | |
| 117 | return Pragma.err(p.pp, idx, .pragma_pack_rparen, .{}); | |
| 119 | 118 | } |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 121 | fn packInt(p: *Parser, tok_i: TokenIndex) Compilation.Error!?u8 { |
| 123 | 122 | const res = p.parseNumberToken(tok_i) catch |err| switch (err) { |
| 124 | 123 | error.ParsingFailed => { |
| 125 | try p.errTok(.pragma_pack_int, tok_i); | |
| 124 | try Pragma.err(p.pp, tok_i, .pragma_pack_int, .{}); | |
| 126 | 125 | return null; |
| 127 | 126 | }, |
| 128 | 127 | else => |e| return e, |
| ... | ... | @@ -131,7 +130,7 @@ fn packInt(p: *Parser, tok_i: TokenIndex) Compilation.Error!?u8 { |
| 131 | 130 | switch (int) { |
| 132 | 131 | 1, 2, 4, 8, 16 => return @intCast(int), |
| 133 | 132 | else => { |
| 134 | try p.errTok(.pragma_pack_int, tok_i); | |
| 133 | try Pragma.err(p.pp, tok_i, .pragma_pack_int, .{}); | |
| 135 | 134 | return null; |
| 136 | 135 | }, |
| 137 | 136 | } |
| ... | ... | @@ -156,9 +155,3 @@ fn pop(pack: *Pack, p: *Parser, maybe_label: ?[]const u8) void { |
| 156 | 155 | p.pragma_pack = prev.val; |
| 157 | 156 | } |
| 158 | 157 | } |
| 159 | ||
| 160 | fn preserveTokens(_: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) bool { | |
| 161 | _ = pp; | |
| 162 | _ = start_idx; | |
| 163 | return true; | |
| 164 | } |
lib/compiler/aro/aro/record_layout.zig+80-82| ... | ... | @@ -2,15 +2,18 @@ |
| 2 | 2 | //! Licensed under MIT license: https://github.com/mahkoh/repr-c/tree/master/repc/facade |
| 3 | 3 | |
| 4 | 4 | const std = @import("std"); |
| 5 | const Type = @import("Type.zig"); | |
| 5 | ||
| 6 | 6 | const Attribute = @import("Attribute.zig"); |
| 7 | 7 | const Compilation = @import("Compilation.zig"); |
| 8 | 8 | const Parser = @import("Parser.zig"); |
| 9 | const target_util = @import("target.zig"); | |
| 10 | const TypeStore = @import("TypeStore.zig"); | |
| 11 | const QualType = TypeStore.QualType; | |
| 12 | const Type = TypeStore.Type; | |
| 9 | 13 | const Record = Type.Record; |
| 10 | 14 | const Field = Record.Field; |
| 11 | const TypeLayout = Type.TypeLayout; | |
| 12 | const FieldLayout = Type.FieldLayout; | |
| 13 | const target_util = @import("target.zig"); | |
| 15 | const RecordLayout = Type.Record.Layout; | |
| 16 | const FieldLayout = Type.Record.Field.Layout; | |
| 14 | 17 | |
| 15 | 18 | const BITS_PER_BYTE = 8; |
| 16 | 19 | |
| ... | ... | @@ -42,36 +45,33 @@ const SysVContext = struct { |
| 42 | 45 | |
| 43 | 46 | comp: *const Compilation, |
| 44 | 47 | |
| 45 | fn init(ty: Type, comp: *const Compilation, pragma_pack: ?u8) SysVContext { | |
| 48 | fn init(qt: QualType, comp: *const Compilation, pragma_pack: ?u8) SysVContext { | |
| 46 | 49 | const pack_value: ?u64 = if (pragma_pack) |pak| @as(u64, pak) * BITS_PER_BYTE else null; |
| 47 | const req_align = @as(u32, (ty.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; | |
| 50 | const req_align = @as(u32, (qt.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; | |
| 48 | 51 | return SysVContext{ |
| 49 | .attr_packed = ty.hasAttribute(.@"packed"), | |
| 52 | .attr_packed = qt.hasAttribute(comp, .@"packed"), | |
| 50 | 53 | .max_field_align_bits = pack_value, |
| 51 | 54 | .aligned_bits = req_align, |
| 52 | .is_union = ty.is(.@"union"), | |
| 55 | .is_union = qt.is(comp, .@"union"), | |
| 53 | 56 | .size_bits = 0, |
| 54 | 57 | .comp = comp, |
| 55 | 58 | .ongoing_bitfield = null, |
| 56 | 59 | }; |
| 57 | 60 | } |
| 58 | 61 | |
| 59 | fn layoutFields(self: *SysVContext, rec: *const Record) !void { | |
| 60 | for (rec.fields, 0..) |*fld, fld_indx| { | |
| 61 | if (fld.ty.specifier == .invalid) continue; | |
| 62 | const type_layout = computeLayout(fld.ty, self.comp); | |
| 62 | fn layoutFields(self: *SysVContext, fields: []Type.Record.Field) !void { | |
| 63 | for (fields) |*field| { | |
| 64 | if (field.qt.isInvalid()) continue; | |
| 65 | const type_layout = computeLayout(field.qt, self.comp); | |
| 63 | 66 | |
| 64 | var field_attrs: ?[]const Attribute = null; | |
| 65 | if (rec.field_attributes) |attrs| { | |
| 66 | field_attrs = attrs[fld_indx]; | |
| 67 | } | |
| 67 | const attributes = field.attributes(self.comp); | |
| 68 | 68 | if (self.comp.target.isMinGW()) { |
| 69 | fld.layout = try self.layoutMinGWField(fld, field_attrs, type_layout); | |
| 69 | field.layout = try self.layoutMinGWField(field, attributes, type_layout); | |
| 70 | 70 | } else { |
| 71 | if (fld.isRegularField()) { | |
| 72 | fld.layout = try self.layoutRegularField(field_attrs, type_layout); | |
| 71 | if (field.bit_width.unpack()) |bit_width| { | |
| 72 | field.layout = try self.layoutBitField(attributes, type_layout, field.name_tok != 0, bit_width); | |
| 73 | 73 | } else { |
| 74 | fld.layout = try self.layoutBitField(field_attrs, type_layout, fld.isNamed(), fld.specifiedBitWidth()); | |
| 74 | field.layout = try self.layoutRegularField(attributes, type_layout); | |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } |
| ... | ... | @@ -83,7 +83,7 @@ const SysVContext = struct { |
| 83 | 83 | /// - the field is a bit-field and the previous field was a non-zero-sized bit-field with the same type size |
| 84 | 84 | /// - the field is a zero-sized bit-field and the previous field was not a non-zero-sized bit-field |
| 85 | 85 | /// See test case 0068. |
| 86 | fn ignoreTypeAlignment(is_attr_packed: bool, bit_width: ?u32, ongoing_bitfield: ?OngoingBitfield, fld_layout: TypeLayout) bool { | |
| 86 | fn ignoreTypeAlignment(is_attr_packed: bool, bit_width: ?u32, ongoing_bitfield: ?OngoingBitfield, fld_layout: RecordLayout) bool { | |
| 87 | 87 | if (is_attr_packed) return true; |
| 88 | 88 | if (bit_width) |width| { |
| 89 | 89 | if (ongoing_bitfield) |ongoing| { |
| ... | ... | @@ -98,12 +98,12 @@ const SysVContext = struct { |
| 98 | 98 | fn layoutMinGWField( |
| 99 | 99 | self: *SysVContext, |
| 100 | 100 | field: *const Field, |
| 101 | field_attrs: ?[]const Attribute, | |
| 102 | field_layout: TypeLayout, | |
| 101 | field_attrs: []const Attribute, | |
| 102 | field_layout: RecordLayout, | |
| 103 | 103 | ) !FieldLayout { |
| 104 | const annotation_alignment_bits = BITS_PER_BYTE * @as(u32, (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(field_attrs)) orelse 1)); | |
| 104 | const annotation_alignment_bits = BITS_PER_BYTE * (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(field_attrs)) orelse 1); | |
| 105 | 105 | const is_attr_packed = self.attr_packed or isPacked(field_attrs); |
| 106 | const ignore_type_alignment = ignoreTypeAlignment(is_attr_packed, field.bit_width, self.ongoing_bitfield, field_layout); | |
| 106 | const ignore_type_alignment = ignoreTypeAlignment(is_attr_packed, field.bit_width.unpack(), self.ongoing_bitfield, field_layout); | |
| 107 | 107 | |
| 108 | 108 | var field_alignment_bits: u64 = field_layout.field_alignment_bits; |
| 109 | 109 | if (ignore_type_alignment) { |
| ... | ... | @@ -120,16 +120,16 @@ const SysVContext = struct { |
| 120 | 120 | // - the field is a non-zero-width bit-field and not packed. |
| 121 | 121 | // See test case 0069. |
| 122 | 122 | const update_record_alignment = |
| 123 | field.isRegularField() or | |
| 124 | (field.specifiedBitWidth() == 0 and self.ongoing_bitfield != null) or | |
| 125 | (field.specifiedBitWidth() != 0 and !is_attr_packed); | |
| 123 | field.bit_width == .null or | |
| 124 | (field.bit_width.unpack().? == 0 and self.ongoing_bitfield != null) or | |
| 125 | (field.bit_width.unpack().? != 0 and !is_attr_packed); | |
| 126 | 126 | |
| 127 | 127 | // If a field affects the alignment of a record, the alignment is calculated in the |
| 128 | 128 | // usual way except that __attribute__((packed)) is ignored on a zero-width bit-field. |
| 129 | 129 | // See test case 0068. |
| 130 | 130 | if (update_record_alignment) { |
| 131 | 131 | var ty_alignment_bits = field_layout.field_alignment_bits; |
| 132 | if (is_attr_packed and (field.isRegularField() or field.specifiedBitWidth() != 0)) { | |
| 132 | if (is_attr_packed and (field.bit_width == .null or field.bit_width.unpack().? != 0)) { | |
| 133 | 133 | ty_alignment_bits = BITS_PER_BYTE; |
| 134 | 134 | } |
| 135 | 135 | ty_alignment_bits = @max(ty_alignment_bits, annotation_alignment_bits); |
| ... | ... | @@ -145,10 +145,10 @@ const SysVContext = struct { |
| 145 | 145 | // @attr_packed _ { size: 64, alignment: 64 }long long:0, |
| 146 | 146 | // { offset: 8, size: 8 }d { size: 8, alignment: 8 }char, |
| 147 | 147 | // } |
| 148 | if (field.isRegularField()) { | |
| 149 | return self.layoutRegularFieldMinGW(field_layout.size_bits, field_alignment_bits); | |
| 148 | if (field.bit_width.unpack()) |bit_width| { | |
| 149 | return self.layoutBitFieldMinGW(field_layout.size_bits, field_alignment_bits, field.name_tok != 0, bit_width); | |
| 150 | 150 | } else { |
| 151 | return self.layoutBitFieldMinGW(field_layout.size_bits, field_alignment_bits, field.isNamed(), field.specifiedBitWidth()); | |
| 151 | return self.layoutRegularFieldMinGW(field_layout.size_bits, field_alignment_bits); | |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| ... | ... | @@ -227,8 +227,8 @@ const SysVContext = struct { |
| 227 | 227 | |
| 228 | 228 | fn layoutRegularField( |
| 229 | 229 | self: *SysVContext, |
| 230 | fld_attrs: ?[]const Attribute, | |
| 231 | fld_layout: TypeLayout, | |
| 230 | fld_attrs: []const Attribute, | |
| 231 | fld_layout: RecordLayout, | |
| 232 | 232 | ) !FieldLayout { |
| 233 | 233 | var fld_align_bits = fld_layout.field_alignment_bits; |
| 234 | 234 | |
| ... | ... | @@ -240,7 +240,7 @@ const SysVContext = struct { |
| 240 | 240 | |
| 241 | 241 | // The field alignment can be increased by __attribute__((aligned)) annotations on the |
| 242 | 242 | // field. See test case 0085. |
| 243 | if (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { | |
| 243 | if (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { | |
| 244 | 244 | fld_align_bits = @max(fld_align_bits, @as(u32, anno) * BITS_PER_BYTE); |
| 245 | 245 | } |
| 246 | 246 | |
| ... | ... | @@ -268,8 +268,8 @@ const SysVContext = struct { |
| 268 | 268 | |
| 269 | 269 | fn layoutBitField( |
| 270 | 270 | self: *SysVContext, |
| 271 | fld_attrs: ?[]const Attribute, | |
| 272 | fld_layout: TypeLayout, | |
| 271 | fld_attrs: []const Attribute, | |
| 272 | fld_layout: RecordLayout, | |
| 273 | 273 | is_named: bool, |
| 274 | 274 | bit_width: u64, |
| 275 | 275 | ) !FieldLayout { |
| ... | ... | @@ -302,7 +302,7 @@ const SysVContext = struct { |
| 302 | 302 | const attr_packed = self.attr_packed or isPacked(fld_attrs); |
| 303 | 303 | const has_packing_annotation = attr_packed or self.max_field_align_bits != null; |
| 304 | 304 | |
| 305 | const annotation_alignment = if (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| @as(u32, anno) * BITS_PER_BYTE else 1; | |
| 305 | const annotation_alignment = if (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| @as(u32, anno) * BITS_PER_BYTE else 1; | |
| 306 | 306 | |
| 307 | 307 | const first_unused_bit: u64 = if (self.is_union) 0 else self.size_bits; |
| 308 | 308 | var field_align_bits: u64 = 1; |
| ... | ... | @@ -403,9 +403,9 @@ const MsvcContext = struct { |
| 403 | 403 | is_union: bool, |
| 404 | 404 | comp: *const Compilation, |
| 405 | 405 | |
| 406 | fn init(ty: Type, comp: *const Compilation, pragma_pack: ?u8) MsvcContext { | |
| 406 | fn init(qt: QualType, comp: *const Compilation, pragma_pack: ?u8) MsvcContext { | |
| 407 | 407 | var pack_value: ?u32 = null; |
| 408 | if (ty.hasAttribute(.@"packed")) { | |
| 408 | if (qt.hasAttribute(comp, .@"packed")) { | |
| 409 | 409 | // __attribute__((packed)) behaves like #pragma pack(1) in clang. See test case 0056. |
| 410 | 410 | pack_value = BITS_PER_BYTE; |
| 411 | 411 | } |
| ... | ... | @@ -420,8 +420,8 @@ const MsvcContext = struct { |
| 420 | 420 | |
| 421 | 421 | // The required alignment can be increased by adding a __declspec(align) |
| 422 | 422 | // annotation. See test case 0023. |
| 423 | const must_align = @as(u32, (ty.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; | |
| 424 | return MsvcContext{ | |
| 423 | const must_align = @as(u32, (qt.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; | |
| 424 | return .{ | |
| 425 | 425 | .req_align_bits = must_align, |
| 426 | 426 | .pointer_align_bits = must_align, |
| 427 | 427 | .field_align_bits = must_align, |
| ... | ... | @@ -429,26 +429,26 @@ const MsvcContext = struct { |
| 429 | 429 | .max_field_align_bits = pack_value, |
| 430 | 430 | .ongoing_bitfield = null, |
| 431 | 431 | .contains_non_bitfield = false, |
| 432 | .is_union = ty.is(.@"union"), | |
| 432 | .is_union = qt.is(comp, .@"union"), | |
| 433 | 433 | .comp = comp, |
| 434 | 434 | }; |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | fn layoutField(self: *MsvcContext, fld: *const Field, fld_attrs: ?[]const Attribute) !FieldLayout { | |
| 438 | const type_layout = computeLayout(fld.ty, self.comp); | |
| 437 | fn layoutField(self: *MsvcContext, fld: *const Field, fld_attrs: []const Attribute) !FieldLayout { | |
| 438 | const type_layout = computeLayout(fld.qt, self.comp); | |
| 439 | 439 | |
| 440 | 440 | // The required alignment of the field is the maximum of the required alignment of the |
| 441 | 441 | // underlying type and the __declspec(align) annotation on the field itself. |
| 442 | 442 | // See test case 0028. |
| 443 | 443 | var req_align = type_layout.required_alignment_bits; |
| 444 | if (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { | |
| 444 | if (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { | |
| 445 | 445 | req_align = @max(@as(u32, anno) * BITS_PER_BYTE, req_align); |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | // The required alignment of a record is the maximum of the required alignments of its |
| 449 | 449 | // fields except that the required alignment of bitfields is ignored. |
| 450 | 450 | // See test case 0029. |
| 451 | if (fld.isRegularField()) { | |
| 451 | if (fld.bit_width == .null) { | |
| 452 | 452 | self.req_align_bits = @max(self.req_align_bits, req_align); |
| 453 | 453 | } |
| 454 | 454 | |
| ... | ... | @@ -459,7 +459,7 @@ const MsvcContext = struct { |
| 459 | 459 | fld_align_bits = @min(fld_align_bits, max_align); |
| 460 | 460 | } |
| 461 | 461 | // check the requested alignment of the field type. |
| 462 | if (fld.ty.requestedAlignment(self.comp)) |type_req_align| { | |
| 462 | if (fld.qt.requestedAlignment(self.comp)) |type_req_align| { | |
| 463 | 463 | fld_align_bits = @max(fld_align_bits, type_req_align * 8); |
| 464 | 464 | } |
| 465 | 465 | |
| ... | ... | @@ -471,10 +471,10 @@ const MsvcContext = struct { |
| 471 | 471 | // __attribute__((packed)) on a field is a clang extension. It behaves as if #pragma |
| 472 | 472 | // pack(1) had been applied only to this field. See test case 0057. |
| 473 | 473 | fld_align_bits = @max(fld_align_bits, req_align); |
| 474 | if (fld.isRegularField()) { | |
| 475 | return self.layoutRegularField(type_layout.size_bits, fld_align_bits); | |
| 474 | if (fld.bit_width.unpack()) |bit_width| { | |
| 475 | return self.layoutBitField(type_layout.size_bits, fld_align_bits, bit_width); | |
| 476 | 476 | } else { |
| 477 | return self.layoutBitField(type_layout.size_bits, fld_align_bits, fld.specifiedBitWidth()); | |
| 477 | return self.layoutRegularField(type_layout.size_bits, fld_align_bits); | |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | |
| ... | ... | @@ -567,16 +567,16 @@ const MsvcContext = struct { |
| 567 | 567 | } |
| 568 | 568 | }; |
| 569 | 569 | |
| 570 | pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pack: ?u8) Error!void { | |
| 570 | pub fn compute(fields: []Type.Record.Field, qt: QualType, comp: *const Compilation, pragma_pack: ?u8) Error!Type.Record.Layout { | |
| 571 | 571 | switch (comp.langopts.emulate) { |
| 572 | 572 | .gcc, .clang => { |
| 573 | var context = SysVContext.init(ty, comp, pragma_pack); | |
| 573 | var context = SysVContext.init(qt, comp, pragma_pack); | |
| 574 | 574 | |
| 575 | try context.layoutFields(rec); | |
| 575 | try context.layoutFields(fields); | |
| 576 | 576 | |
| 577 | 577 | context.size_bits = try alignForward(context.size_bits, context.aligned_bits); |
| 578 | 578 | |
| 579 | rec.type_layout = .{ | |
| 579 | return .{ | |
| 580 | 580 | .size_bits = context.size_bits, |
| 581 | 581 | .field_alignment_bits = context.aligned_bits, |
| 582 | 582 | .pointer_alignment_bits = context.aligned_bits, |
| ... | ... | @@ -584,15 +584,10 @@ pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pac |
| 584 | 584 | }; |
| 585 | 585 | }, |
| 586 | 586 | .msvc => { |
| 587 | var context = MsvcContext.init(ty, comp, pragma_pack); | |
| 588 | for (rec.fields, 0..) |*fld, fld_indx| { | |
| 589 | if (fld.ty.specifier == .invalid) continue; | |
| 590 | var field_attrs: ?[]const Attribute = null; | |
| 591 | if (rec.field_attributes) |attrs| { | |
| 592 | field_attrs = attrs[fld_indx]; | |
| 593 | } | |
| 594 | ||
| 595 | fld.layout = try context.layoutField(fld, field_attrs); | |
| 587 | var context = MsvcContext.init(qt, comp, pragma_pack); | |
| 588 | for (fields) |*field| { | |
| 589 | if (field.qt.isInvalid()) continue; | |
| 590 | field.layout = try context.layoutField(field, field.attributes(comp)); | |
| 596 | 591 | } |
| 597 | 592 | if (context.size_bits == 0) { |
| 598 | 593 | // 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 |
| 601 | 596 | context.handleZeroSizedRecord(); |
| 602 | 597 | } |
| 603 | 598 | context.size_bits = try alignForward(context.size_bits, context.pointer_align_bits); |
| 604 | rec.type_layout = .{ | |
| 599 | return .{ | |
| 605 | 600 | .size_bits = context.size_bits, |
| 606 | 601 | .field_alignment_bits = context.field_align_bits, |
| 607 | 602 | .pointer_alignment_bits = context.pointer_align_bits, |
| ... | ... | @@ -611,23 +606,26 @@ pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pac |
| 611 | 606 | } |
| 612 | 607 | } |
| 613 | 608 | |
| 614 | fn computeLayout(ty: Type, comp: *const Compilation) TypeLayout { | |
| 615 | if (ty.getRecord()) |rec| { | |
| 616 | const requested = BITS_PER_BYTE * (ty.requestedAlignment(comp) orelse 0); | |
| 617 | return .{ | |
| 618 | .size_bits = rec.type_layout.size_bits, | |
| 619 | .pointer_alignment_bits = @max(requested, rec.type_layout.pointer_alignment_bits), | |
| 620 | .field_alignment_bits = @max(requested, rec.type_layout.field_alignment_bits), | |
| 621 | .required_alignment_bits = rec.type_layout.required_alignment_bits, | |
| 622 | }; | |
| 623 | } else { | |
| 624 | const type_align = ty.alignof(comp) * BITS_PER_BYTE; | |
| 625 | return .{ | |
| 626 | .size_bits = ty.bitSizeof(comp) orelse 0, | |
| 627 | .pointer_alignment_bits = type_align, | |
| 628 | .field_alignment_bits = type_align, | |
| 629 | .required_alignment_bits = BITS_PER_BYTE, | |
| 630 | }; | |
| 609 | fn computeLayout(qt: QualType, comp: *const Compilation) RecordLayout { | |
| 610 | switch (qt.base(comp).type) { | |
| 611 | .@"struct", .@"union" => |record| { | |
| 612 | const requested = BITS_PER_BYTE * (qt.requestedAlignment(comp) orelse 0); | |
| 613 | return .{ | |
| 614 | .size_bits = record.layout.?.size_bits, | |
| 615 | .pointer_alignment_bits = @max(requested, record.layout.?.pointer_alignment_bits), | |
| 616 | .field_alignment_bits = @max(requested, record.layout.?.field_alignment_bits), | |
| 617 | .required_alignment_bits = record.layout.?.required_alignment_bits, | |
| 618 | }; | |
| 619 | }, | |
| 620 | else => { | |
| 621 | const type_align = qt.alignof(comp) * BITS_PER_BYTE; | |
| 622 | return .{ | |
| 623 | .size_bits = qt.bitSizeofOrNull(comp) orelse 0, | |
| 624 | .pointer_alignment_bits = type_align, | |
| 625 | .field_alignment_bits = type_align, | |
| 626 | .required_alignment_bits = BITS_PER_BYTE, | |
| 627 | }; | |
| 628 | }, | |
| 631 | 629 | } |
| 632 | 630 | } |
| 633 | 631 |
lib/compiler/aro/aro/target.zig+303-88| ... | ... | @@ -1,15 +1,18 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | ||
| 3 | const backend = @import("../backend.zig"); | |
| 4 | ||
| 2 | 5 | const LangOpts = @import("LangOpts.zig"); |
| 3 | const Type = @import("Type.zig"); | |
| 4 | 6 | const TargetSet = @import("Builtins/Properties.zig").TargetSet; |
| 7 | const QualType = @import("TypeStore.zig").QualType; | |
| 5 | 8 | |
| 6 | 9 | /// intmax_t for this target |
| 7 | pub fn intMaxType(target: std.Target) Type { | |
| 10 | pub fn intMaxType(target: std.Target) QualType { | |
| 8 | 11 | switch (target.cpu.arch) { |
| 9 | 12 | .aarch64, |
| 10 | 13 | .aarch64_be, |
| 11 | 14 | .sparc64, |
| 12 | => if (target.os.tag != .openbsd) return .{ .specifier = .long }, | |
| 15 | => if (target.os.tag != .openbsd) return .long, | |
| 13 | 16 | |
| 14 | 17 | .bpfel, |
| 15 | 18 | .bpfeb, |
| ... | ... | @@ -19,28 +22,28 @@ pub fn intMaxType(target: std.Target) Type { |
| 19 | 22 | .powerpc64, |
| 20 | 23 | .powerpc64le, |
| 21 | 24 | .ve, |
| 22 | => return .{ .specifier = .long }, | |
| 25 | => return .long, | |
| 23 | 26 | |
| 24 | 27 | .x86_64 => switch (target.os.tag) { |
| 25 | 28 | .windows, .openbsd => {}, |
| 26 | 29 | else => switch (target.abi) { |
| 27 | 30 | .gnux32, .muslx32 => {}, |
| 28 | else => return .{ .specifier = .long }, | |
| 31 | else => return .long, | |
| 29 | 32 | }, |
| 30 | 33 | }, |
| 31 | 34 | |
| 32 | 35 | else => {}, |
| 33 | 36 | } |
| 34 | return .{ .specifier = .long_long }; | |
| 37 | return .long_long; | |
| 35 | 38 | } |
| 36 | 39 | |
| 37 | 40 | /// intptr_t for this target |
| 38 | pub fn intPtrType(target: std.Target) Type { | |
| 39 | if (target.os.tag == .haiku) return .{ .specifier = .long }; | |
| 41 | pub fn intPtrType(target: std.Target) QualType { | |
| 42 | if (target.os.tag == .haiku) return .long; | |
| 40 | 43 | |
| 41 | 44 | switch (target.cpu.arch) { |
| 42 | 45 | .aarch64, .aarch64_be => switch (target.os.tag) { |
| 43 | .windows => return .{ .specifier = .long_long }, | |
| 46 | .windows => return .long_long, | |
| 44 | 47 | else => {}, |
| 45 | 48 | }, |
| 46 | 49 | |
| ... | ... | @@ -55,28 +58,28 @@ pub fn intPtrType(target: std.Target) Type { |
| 55 | 58 | .spirv32, |
| 56 | 59 | .arc, |
| 57 | 60 | .avr, |
| 58 | => return .{ .specifier = .int }, | |
| 61 | => return .int, | |
| 59 | 62 | |
| 60 | 63 | .sparc => switch (target.os.tag) { |
| 61 | 64 | .netbsd, .openbsd => {}, |
| 62 | else => return .{ .specifier = .int }, | |
| 65 | else => return .int, | |
| 63 | 66 | }, |
| 64 | 67 | |
| 65 | 68 | .powerpc, .powerpcle => switch (target.os.tag) { |
| 66 | .linux, .freebsd, .netbsd => return .{ .specifier = .int }, | |
| 69 | .linux, .freebsd, .netbsd => return .int, | |
| 67 | 70 | else => {}, |
| 68 | 71 | }, |
| 69 | 72 | |
| 70 | 73 | // 32-bit x86 Darwin, OpenBSD, and RTEMS use long (the default); others use int |
| 71 | 74 | .x86 => switch (target.os.tag) { |
| 72 | 75 | .openbsd, .rtems => {}, |
| 73 | else => if (!target.os.tag.isDarwin()) return .{ .specifier = .int }, | |
| 76 | else => if (!target.os.tag.isDarwin()) return .int, | |
| 74 | 77 | }, |
| 75 | 78 | |
| 76 | 79 | .x86_64 => switch (target.os.tag) { |
| 77 | .windows => return .{ .specifier = .long_long }, | |
| 80 | .windows => return .long_long, | |
| 78 | 81 | else => switch (target.abi) { |
| 79 | .gnux32, .muslx32 => return .{ .specifier = .int }, | |
| 82 | .gnux32, .muslx32 => return .int, | |
| 80 | 83 | else => {}, |
| 81 | 84 | }, |
| 82 | 85 | }, |
| ... | ... | @@ -84,29 +87,29 @@ pub fn intPtrType(target: std.Target) Type { |
| 84 | 87 | else => {}, |
| 85 | 88 | } |
| 86 | 89 | |
| 87 | return .{ .specifier = .long }; | |
| 90 | return .long; | |
| 88 | 91 | } |
| 89 | 92 | |
| 90 | 93 | /// int16_t for this target |
| 91 | pub fn int16Type(target: std.Target) Type { | |
| 94 | pub fn int16Type(target: std.Target) QualType { | |
| 92 | 95 | return switch (target.cpu.arch) { |
| 93 | .avr => .{ .specifier = .int }, | |
| 94 | else => .{ .specifier = .short }, | |
| 96 | .avr => .int, | |
| 97 | else => .short, | |
| 95 | 98 | }; |
| 96 | 99 | } |
| 97 | 100 | |
| 98 | 101 | /// sig_atomic_t for this target |
| 99 | pub fn sigAtomicType(target: std.Target) Type { | |
| 100 | if (target.cpu.arch.isWasm()) return .{ .specifier = .long }; | |
| 102 | pub fn sigAtomicType(target: std.Target) QualType { | |
| 103 | if (target.cpu.arch.isWasm()) return .long; | |
| 101 | 104 | return switch (target.cpu.arch) { |
| 102 | .avr => .{ .specifier = .schar }, | |
| 103 | .msp430 => .{ .specifier = .long }, | |
| 104 | else => .{ .specifier = .int }, | |
| 105 | .avr => .schar, | |
| 106 | .msp430 => .long, | |
| 107 | else => .int, | |
| 105 | 108 | }; |
| 106 | 109 | } |
| 107 | 110 | |
| 108 | 111 | /// int64_t for this target |
| 109 | pub fn int64Type(target: std.Target) Type { | |
| 112 | pub fn int64Type(target: std.Target) QualType { | |
| 110 | 113 | switch (target.cpu.arch) { |
| 111 | 114 | .loongarch64, |
| 112 | 115 | .ve, |
| ... | ... | @@ -116,20 +119,20 @@ pub fn int64Type(target: std.Target) Type { |
| 116 | 119 | .powerpc64le, |
| 117 | 120 | .bpfel, |
| 118 | 121 | .bpfeb, |
| 119 | => return .{ .specifier = .long }, | |
| 122 | => return .long, | |
| 120 | 123 | |
| 121 | 124 | .sparc64 => return intMaxType(target), |
| 122 | 125 | |
| 123 | 126 | .x86, .x86_64 => if (!target.os.tag.isDarwin()) return intMaxType(target), |
| 124 | .aarch64, .aarch64_be => if (!target.os.tag.isDarwin() and target.os.tag != .openbsd and target.os.tag != .windows) return .{ .specifier = .long }, | |
| 127 | .aarch64, .aarch64_be => if (!target.os.tag.isDarwin() and target.os.tag != .openbsd and target.os.tag != .windows) return .long, | |
| 125 | 128 | else => {}, |
| 126 | 129 | } |
| 127 | return .{ .specifier = .long_long }; | |
| 130 | return .long_long; | |
| 128 | 131 | } |
| 129 | 132 | |
| 130 | pub fn float80Type(target: std.Target) ?Type { | |
| 133 | pub fn float80Type(target: std.Target) ?QualType { | |
| 131 | 134 | switch (target.cpu.arch) { |
| 132 | .x86, .x86_64 => return .{ .specifier = .long_double }, | |
| 135 | .x86, .x86_64 => return .long_double, | |
| 133 | 136 | else => {}, |
| 134 | 137 | } |
| 135 | 138 | return null; |
| ... | ... | @@ -165,7 +168,7 @@ pub fn ignoreNonZeroSizedBitfieldTypeAlignment(target: std.Target) bool { |
| 165 | 168 | switch (target.cpu.arch) { |
| 166 | 169 | .avr => return true, |
| 167 | 170 | .arm => { |
| 168 | if (target.cpu.has(.arm, .has_v7)) { | |
| 171 | if (std.Target.arm.featureSetHas(target.cpu.features, .has_v7)) { | |
| 169 | 172 | switch (target.os.tag) { |
| 170 | 173 | .ios => return true, |
| 171 | 174 | else => return false, |
| ... | ... | @@ -188,7 +191,7 @@ pub fn minZeroWidthBitfieldAlignment(target: std.Target) ?u29 { |
| 188 | 191 | switch (target.cpu.arch) { |
| 189 | 192 | .avr => return 8, |
| 190 | 193 | .arm => { |
| 191 | if (target.cpu.has(.arm, .has_v7)) { | |
| 194 | if (std.Target.arm.featureSetHas(target.cpu.features, .has_v7)) { | |
| 192 | 195 | switch (target.os.tag) { |
| 193 | 196 | .ios => return 32, |
| 194 | 197 | else => return null, |
| ... | ... | @@ -206,7 +209,7 @@ pub fn unnamedFieldAffectsAlignment(target: std.Target) bool { |
| 206 | 209 | return true; |
| 207 | 210 | }, |
| 208 | 211 | .armeb => { |
| 209 | if (target.cpu.has(.arm, .has_v7)) { | |
| 212 | if (std.Target.arm.featureSetHas(target.cpu.features, .has_v7)) { | |
| 210 | 213 | if (std.Target.Abi.default(target.cpu.arch, target.os.tag) == .eabi) return true; |
| 211 | 214 | } |
| 212 | 215 | }, |
| ... | ... | @@ -233,7 +236,7 @@ pub fn defaultAlignment(target: std.Target) u29 { |
| 233 | 236 | switch (target.cpu.arch) { |
| 234 | 237 | .avr => return 1, |
| 235 | 238 | .arm => if (target.abi.isAndroid() or target.os.tag == .ios) return 16 else return 8, |
| 236 | .sparc => if (target.cpu.has(.sparc, .v9)) return 16 else return 8, | |
| 239 | .sparc => if (std.Target.sparc.featureSetHas(target.cpu.features, .v9)) return 16 else return 8, | |
| 237 | 240 | .mips, .mipsel => switch (target.abi) { |
| 238 | 241 | .none, .gnuabi64 => return 16, |
| 239 | 242 | else => return 8, |
| ... | ... | @@ -245,7 +248,8 @@ pub fn defaultAlignment(target: std.Target) u29 { |
| 245 | 248 | pub fn systemCompiler(target: std.Target) LangOpts.Compiler { |
| 246 | 249 | // Android is linux but not gcc, so these checks go first |
| 247 | 250 | // the rest for documentation as fn returns .clang |
| 248 | if (target.abi.isAndroid() or | |
| 251 | if (target.os.tag.isDarwin() or | |
| 252 | target.abi.isAndroid() or | |
| 249 | 253 | target.os.tag.isBSD() or |
| 250 | 254 | target.os.tag == .fuchsia or |
| 251 | 255 | target.os.tag == .solaris or |
| ... | ... | @@ -271,7 +275,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler { |
| 271 | 275 | pub fn hasFloat128(target: std.Target) bool { |
| 272 | 276 | if (target.cpu.arch.isWasm()) return true; |
| 273 | 277 | if (target.os.tag.isDarwin()) return false; |
| 274 | if (target.cpu.arch.isPowerPC()) return target.cpu.has(.powerpc, .float128); | |
| 278 | if (target.cpu.arch.isPowerPC()) return std.Target.powerpc.featureSetHas(target.cpu.features, .float128); | |
| 275 | 279 | return switch (target.os.tag) { |
| 276 | 280 | .dragonfly, |
| 277 | 281 | .haiku, |
| ... | ... | @@ -339,7 +343,7 @@ pub const FPSemantics = enum { |
| 339 | 343 | .spirv32, |
| 340 | 344 | .spirv64, |
| 341 | 345 | => return .IEEEHalf, |
| 342 | .x86, .x86_64 => if (target.cpu.has(.x86, .sse2)) return .IEEEHalf, | |
| 346 | .x86, .x86_64 => if (std.Target.x86.featureSetHas(target.cpu.features, .sse2)) return .IEEEHalf, | |
| 343 | 347 | else => {}, |
| 344 | 348 | } |
| 345 | 349 | return null; |
| ... | ... | @@ -374,6 +378,10 @@ pub fn isCygwinMinGW(target: std.Target) bool { |
| 374 | 378 | return target.os.tag == .windows and (target.abi == .gnu or target.abi == .cygnus); |
| 375 | 379 | } |
| 376 | 380 | |
| 381 | pub fn isPS(target: std.Target) bool { | |
| 382 | return (target.os.tag == .ps4 or target.os.tag == .ps5) and target.cpu.arch == .x86_64; | |
| 383 | } | |
| 384 | ||
| 377 | 385 | pub fn builtinEnabled(target: std.Target, enabled_for: TargetSet) bool { |
| 378 | 386 | var it = enabled_for.iterator(); |
| 379 | 387 | while (it.next()) |val| { |
| ... | ... | @@ -404,7 +412,7 @@ pub fn defaultFpEvalMethod(target: std.Target) LangOpts.FPEvalMethod { |
| 404 | 412 | return .double; |
| 405 | 413 | } |
| 406 | 414 | } |
| 407 | if (target.cpu.has(.x86, .sse)) { | |
| 415 | if (std.Target.x86.featureSetHas(target.cpu.features, .sse)) { | |
| 408 | 416 | return .source; |
| 409 | 417 | } |
| 410 | 418 | return .extended; |
| ... | ... | @@ -497,6 +505,8 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target { |
| 497 | 505 | .spirv32, |
| 498 | 506 | .loongarch32, |
| 499 | 507 | .xtensa, |
| 508 | .propeller, | |
| 509 | .or1k, | |
| 500 | 510 | => {}, // Already 32 bit |
| 501 | 511 | |
| 502 | 512 | .aarch64 => copy.cpu.arch = .arm, |
| ... | ... | @@ -530,6 +540,8 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target { |
| 530 | 540 | .msp430, |
| 531 | 541 | .xcore, |
| 532 | 542 | .xtensa, |
| 543 | .propeller, | |
| 544 | .or1k, | |
| 533 | 545 | => return null, |
| 534 | 546 | |
| 535 | 547 | .aarch64, |
| ... | ... | @@ -621,11 +633,14 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { |
| 621 | 633 | .nvptx64 => "nvptx64", |
| 622 | 634 | .spirv32 => "spirv32", |
| 623 | 635 | .spirv64 => "spirv64", |
| 624 | .kalimba => "kalimba", | |
| 625 | 636 | .lanai => "lanai", |
| 626 | 637 | .wasm32 => "wasm32", |
| 627 | 638 | .wasm64 => "wasm64", |
| 628 | 639 | .ve => "ve", |
| 640 | // Note: propeller1, kalimba and or1k are not supported in LLVM; this is the Zig arch name | |
| 641 | .kalimba => "kalimba", | |
| 642 | .propeller => "propeller", | |
| 643 | .or1k => "or1k", | |
| 629 | 644 | }; |
| 630 | 645 | writer.writeAll(llvm_arch) catch unreachable; |
| 631 | 646 | writer.writeByte('-') catch unreachable; |
| ... | ... | @@ -666,10 +681,12 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { |
| 666 | 681 | .driverkit => "driverkit", |
| 667 | 682 | .visionos => "xros", |
| 668 | 683 | .serenity => "serenity", |
| 684 | .vulkan => "vulkan", | |
| 669 | 685 | .managarm => "managarm", |
| 686 | .@"3ds", | |
| 687 | .vita, | |
| 670 | 688 | .opencl, |
| 671 | 689 | .opengl, |
| 672 | .vulkan, | |
| 673 | 690 | .plan9, |
| 674 | 691 | .other, |
| 675 | 692 | => "unknown", |
| ... | ... | @@ -721,64 +738,262 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { |
| 721 | 738 | return writer.buffered(); |
| 722 | 739 | } |
| 723 | 740 | |
| 724 | test "alignment functions - smoke test" { | |
| 725 | var target: std.Target = undefined; | |
| 726 | const x86 = std.Target.Cpu.Arch.x86_64; | |
| 727 | target.os = std.Target.Os.Tag.defaultVersionRange(.linux, x86, .none); | |
| 728 | target.cpu = std.Target.Cpu.baseline(x86, target.os); | |
| 729 | target.abi = std.Target.Abi.default(x86, target.os.tag); | |
| 730 | ||
| 731 | try std.testing.expect(isTlsSupported(target)); | |
| 732 | try std.testing.expect(!ignoreNonZeroSizedBitfieldTypeAlignment(target)); | |
| 733 | try std.testing.expect(minZeroWidthBitfieldAlignment(target) == null); | |
| 734 | try std.testing.expect(!unnamedFieldAffectsAlignment(target)); | |
| 735 | try std.testing.expect(defaultAlignment(target) == 16); | |
| 736 | try std.testing.expect(!packAllEnums(target)); | |
| 737 | try std.testing.expect(systemCompiler(target) == .gcc); | |
| 738 | ||
| 739 | const arm = std.Target.Cpu.Arch.arm; | |
| 740 | target.os = std.Target.Os.Tag.defaultVersionRange(.ios, arm, .none); | |
| 741 | target.cpu = std.Target.Cpu.baseline(arm, target.os); | |
| 742 | target.abi = std.Target.Abi.default(arm, target.os.tag); | |
| 743 | ||
| 744 | try std.testing.expect(!isTlsSupported(target)); | |
| 745 | try std.testing.expect(ignoreNonZeroSizedBitfieldTypeAlignment(target)); | |
| 746 | try std.testing.expectEqual(@as(?u29, 32), minZeroWidthBitfieldAlignment(target)); | |
| 747 | try std.testing.expect(unnamedFieldAffectsAlignment(target)); | |
| 748 | try std.testing.expect(defaultAlignment(target) == 16); | |
| 749 | try std.testing.expect(!packAllEnums(target)); | |
| 750 | try std.testing.expect(systemCompiler(target) == .clang); | |
| 741 | pub const DefaultPIStatus = enum { yes, no, depends_on_linker }; | |
| 742 | ||
| 743 | pub fn isPIEDefault(target: std.Target) DefaultPIStatus { | |
| 744 | return switch (target.os.tag) { | |
| 745 | .aix, | |
| 746 | .haiku, | |
| 747 | ||
| 748 | .macos, | |
| 749 | .ios, | |
| 750 | .tvos, | |
| 751 | .watchos, | |
| 752 | .visionos, | |
| 753 | .driverkit, | |
| 754 | ||
| 755 | .dragonfly, | |
| 756 | .netbsd, | |
| 757 | .freebsd, | |
| 758 | .solaris, | |
| 759 | ||
| 760 | .cuda, | |
| 761 | .amdhsa, | |
| 762 | .amdpal, | |
| 763 | .mesa3d, | |
| 764 | ||
| 765 | .ps4, | |
| 766 | .ps5, | |
| 767 | ||
| 768 | .hurd, | |
| 769 | .zos, | |
| 770 | => .no, | |
| 771 | ||
| 772 | .openbsd, | |
| 773 | .fuchsia, | |
| 774 | => .yes, | |
| 775 | ||
| 776 | .linux => { | |
| 777 | if (target.abi == .ohos) | |
| 778 | return .yes; | |
| 779 | ||
| 780 | switch (target.cpu.arch) { | |
| 781 | .ve => return .no, | |
| 782 | else => return if (target.os.tag == .linux or target.abi.isAndroid() or target.abi.isMusl()) .yes else .no, | |
| 783 | } | |
| 784 | }, | |
| 785 | ||
| 786 | .windows => { | |
| 787 | if (target.isMinGW()) | |
| 788 | return .no; | |
| 789 | ||
| 790 | if (target.abi == .itanium) | |
| 791 | return if (target.cpu.arch == .x86_64) .yes else .no; | |
| 792 | ||
| 793 | if (target.abi == .msvc or target.abi == .none) | |
| 794 | return .depends_on_linker; | |
| 795 | ||
| 796 | return .no; | |
| 797 | }, | |
| 798 | ||
| 799 | else => { | |
| 800 | switch (target.cpu.arch) { | |
| 801 | .hexagon => { | |
| 802 | // CLANG_DEFAULT_PIE_ON_LINUX | |
| 803 | return if (target.os.tag == .linux or target.abi.isAndroid() or target.abi.isMusl()) .yes else .no; | |
| 804 | }, | |
| 805 | ||
| 806 | else => return .no, | |
| 807 | } | |
| 808 | }, | |
| 809 | }; | |
| 751 | 810 | } |
| 752 | 811 | |
| 753 | test "target size/align tests" { | |
| 754 | var comp: @import("Compilation.zig") = undefined; | |
| 812 | pub fn isPICdefault(target: std.Target) DefaultPIStatus { | |
| 813 | return switch (target.os.tag) { | |
| 814 | .aix, | |
| 815 | .haiku, | |
| 816 | ||
| 817 | .macos, | |
| 818 | .ios, | |
| 819 | .tvos, | |
| 820 | .watchos, | |
| 821 | .visionos, | |
| 822 | .driverkit, | |
| 823 | ||
| 824 | .amdhsa, | |
| 825 | .amdpal, | |
| 826 | .mesa3d, | |
| 827 | ||
| 828 | .ps4, | |
| 829 | .ps5, | |
| 830 | => .yes, | |
| 831 | ||
| 832 | .fuchsia, | |
| 833 | .cuda, | |
| 834 | .zos, | |
| 835 | => .no, | |
| 836 | ||
| 837 | .dragonfly, | |
| 838 | .openbsd, | |
| 839 | .netbsd, | |
| 840 | .freebsd, | |
| 841 | .solaris, | |
| 842 | .hurd, | |
| 843 | => { | |
| 844 | return switch (target.cpu.arch) { | |
| 845 | .mips64, .mips64el => .yes, | |
| 846 | else => .no, | |
| 847 | }; | |
| 848 | }, | |
| 849 | ||
| 850 | .linux => { | |
| 851 | if (target.abi == .ohos) | |
| 852 | return .no; | |
| 755 | 853 | |
| 756 | const x86 = std.Target.Cpu.Arch.x86; | |
| 757 | comp.target.cpu.arch = x86; | |
| 758 | comp.target.cpu.model = &std.Target.x86.cpu.i586; | |
| 759 | comp.target.os = std.Target.Os.Tag.defaultVersionRange(.linux, x86, .none); | |
| 760 | comp.target.abi = std.Target.Abi.gnu; | |
| 854 | return switch (target.cpu.arch) { | |
| 855 | .mips64, .mips64el => .yes, | |
| 856 | else => .no, | |
| 857 | }; | |
| 858 | }, | |
| 761 | 859 | |
| 762 | const tt: Type = .{ | |
| 763 | .specifier = .long_long, | |
| 860 | .windows => { | |
| 861 | if (target.isMinGW()) | |
| 862 | return if (target.cpu.arch == .x86_64 or target.cpu.arch == .aarch64) .yes else .no; | |
| 863 | ||
| 864 | if (target.abi == .itanium) | |
| 865 | return if (target.cpu.arch == .x86_64) .yes else .no; | |
| 866 | ||
| 867 | if (target.abi == .msvc or target.abi == .none) | |
| 868 | return .depends_on_linker; | |
| 869 | ||
| 870 | if (target.ofmt == .macho) | |
| 871 | return .yes; | |
| 872 | ||
| 873 | return switch (target.cpu.arch) { | |
| 874 | .x86_64, .mips64, .mips64el => .yes, | |
| 875 | else => .no, | |
| 876 | }; | |
| 877 | }, | |
| 878 | ||
| 879 | else => { | |
| 880 | if (target.ofmt == .macho) | |
| 881 | return .yes; | |
| 882 | ||
| 883 | return switch (target.cpu.arch) { | |
| 884 | .mips64, .mips64el => .yes, | |
| 885 | else => .no, | |
| 886 | }; | |
| 887 | }, | |
| 764 | 888 | }; |
| 889 | } | |
| 765 | 890 | |
| 766 | try std.testing.expectEqual(@as(u64, 8), tt.sizeof(&comp).?); | |
| 767 | try std.testing.expectEqual(@as(u64, 4), tt.alignof(&comp)); | |
| 891 | pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus { | |
| 892 | return switch (target.os.tag) { | |
| 893 | .aix, .amdhsa, .amdpal, .mesa3d => .yes, | |
| 894 | ||
| 895 | .haiku, | |
| 896 | .dragonfly, | |
| 897 | .openbsd, | |
| 898 | .netbsd, | |
| 899 | .freebsd, | |
| 900 | .solaris, | |
| 901 | .cuda, | |
| 902 | .ps4, | |
| 903 | .ps5, | |
| 904 | .hurd, | |
| 905 | .linux, | |
| 906 | .fuchsia, | |
| 907 | .zos, | |
| 908 | => .no, | |
| 909 | ||
| 910 | .windows => { | |
| 911 | if (target.isMinGW()) | |
| 912 | return .yes; | |
| 768 | 913 | |
| 769 | const arm = std.Target.Cpu.Arch.arm; | |
| 770 | comp.target.cpu = std.Target.Cpu.Model.toCpu(&std.Target.arm.cpu.cortex_r4, arm); | |
| 771 | comp.target.os = std.Target.Os.Tag.defaultVersionRange(.ios, arm, .none); | |
| 772 | comp.target.abi = std.Target.Abi.none; | |
| 914 | if (target.abi == .itanium) | |
| 915 | return if (target.cpu.arch == .x86_64) .yes else .no; | |
| 773 | 916 | |
| 774 | const ct: Type = .{ | |
| 775 | .specifier = .char, | |
| 917 | // if (bfd) return target.cpu.arch == .x86_64 else target.cpu.arch == .x86_64 or target.cpu.arch == .aarch64; | |
| 918 | if (target.abi == .msvc or target.abi == .none) | |
| 919 | return .depends_on_linker; | |
| 920 | ||
| 921 | if (target.ofmt == .macho) | |
| 922 | return if (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64) .yes else .no; | |
| 923 | ||
| 924 | return if (target.cpu.arch == .x86_64) .yes else .no; | |
| 925 | }, | |
| 926 | ||
| 927 | .macos, | |
| 928 | .ios, | |
| 929 | .tvos, | |
| 930 | .watchos, | |
| 931 | .visionos, | |
| 932 | .driverkit, | |
| 933 | => if (target.cpu.arch == .x86_64 or target.cpu.arch == .aarch64) .yes else .no, | |
| 934 | ||
| 935 | else => { | |
| 936 | return switch (target.cpu.arch) { | |
| 937 | .hexagon, | |
| 938 | .lanai, | |
| 939 | .avr, | |
| 940 | .riscv32, | |
| 941 | .riscv64, | |
| 942 | .csky, | |
| 943 | .xcore, | |
| 944 | .wasm32, | |
| 945 | .wasm64, | |
| 946 | .ve, | |
| 947 | .spirv32, | |
| 948 | .spirv64, | |
| 949 | => .no, | |
| 950 | ||
| 951 | .msp430 => .yes, | |
| 952 | ||
| 953 | else => { | |
| 954 | if (target.ofmt == .macho) | |
| 955 | return if (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64) .yes else .no; | |
| 956 | return .no; | |
| 957 | }, | |
| 958 | }; | |
| 959 | }, | |
| 776 | 960 | }; |
| 961 | } | |
| 777 | 962 | |
| 778 | try std.testing.expectEqual(true, comp.target.cpu.has(.arm, .has_v7)); | |
| 779 | try std.testing.expectEqual(@as(u64, 1), ct.sizeof(&comp).?); | |
| 780 | try std.testing.expectEqual(@as(u64, 1), ct.alignof(&comp)); | |
| 781 | try std.testing.expectEqual(true, ignoreNonZeroSizedBitfieldTypeAlignment(comp.target)); | |
| 963 | test "alignment functions - smoke test" { | |
| 964 | const linux: std.Target.Os = .{ .tag = .linux, .version_range = .{ .none = {} } }; | |
| 965 | const x86_64_target: std.Target = .{ | |
| 966 | .abi = std.Target.Abi.default(.x86_64, linux.tag), | |
| 967 | .cpu = std.Target.Cpu.Model.generic(.x86_64).toCpu(.x86_64), | |
| 968 | .os = linux, | |
| 969 | .ofmt = .elf, | |
| 970 | }; | |
| 971 | ||
| 972 | try std.testing.expect(isTlsSupported(x86_64_target)); | |
| 973 | try std.testing.expect(!ignoreNonZeroSizedBitfieldTypeAlignment(x86_64_target)); | |
| 974 | try std.testing.expect(minZeroWidthBitfieldAlignment(x86_64_target) == null); | |
| 975 | try std.testing.expect(!unnamedFieldAffectsAlignment(x86_64_target)); | |
| 976 | try std.testing.expect(defaultAlignment(x86_64_target) == 16); | |
| 977 | try std.testing.expect(!packAllEnums(x86_64_target)); | |
| 978 | try std.testing.expect(systemCompiler(x86_64_target) == .gcc); | |
| 979 | } | |
| 980 | ||
| 981 | test "target size/align tests" { | |
| 982 | var comp: @import("Compilation.zig") = undefined; | |
| 983 | ||
| 984 | const linux: std.Target.Os = .{ .tag = .linux, .version_range = .{ .none = {} } }; | |
| 985 | const x86_target: std.Target = .{ | |
| 986 | .abi = std.Target.Abi.default(.x86, linux.tag), | |
| 987 | .cpu = std.Target.Cpu.Model.generic(.x86).toCpu(.x86), | |
| 988 | .os = linux, | |
| 989 | .ofmt = .elf, | |
| 990 | }; | |
| 991 | comp.target = x86_target; | |
| 992 | ||
| 993 | const tt: QualType = .long_long; | |
| 994 | ||
| 995 | try std.testing.expectEqual(@as(u64, 8), tt.sizeof(&comp)); | |
| 996 | try std.testing.expectEqual(@as(u64, 4), tt.alignof(&comp)); | |
| 782 | 997 | } |
| 783 | 998 | |
| 784 | 999 | /// The canonical integer representation of nullptr_t. |
lib/compiler/aro/aro/text_literal.zig+260-104| ... | ... | @@ -1,11 +1,13 @@ |
| 1 | 1 | //! Parsing and classification of string and character literals |
| 2 | 2 | |
| 3 | 3 | const std = @import("std"); |
| 4 | const mem = std.mem; | |
| 5 | ||
| 4 | 6 | const Compilation = @import("Compilation.zig"); |
| 5 | const Type = @import("Type.zig"); | |
| 6 | 7 | const Diagnostics = @import("Diagnostics.zig"); |
| 7 | 8 | const Tokenizer = @import("Tokenizer.zig"); |
| 8 | const mem = std.mem; | |
| 9 | const QualType = @import("TypeStore.zig").QualType; | |
| 10 | const Source = @import("Source.zig"); | |
| 9 | 11 | |
| 10 | 12 | pub const Item = union(enum) { |
| 11 | 13 | /// decoded hex or character escape |
| ... | ... | @@ -18,11 +20,6 @@ pub const Item = union(enum) { |
| 18 | 20 | utf8_text: std.unicode.Utf8View, |
| 19 | 21 | }; |
| 20 | 22 | |
| 21 | const CharDiagnostic = struct { | |
| 22 | tag: Diagnostics.Tag, | |
| 23 | extra: Diagnostics.Message.Extra, | |
| 24 | }; | |
| 25 | ||
| 26 | 23 | pub const Kind = enum { |
| 27 | 24 | char, |
| 28 | 25 | wide, |
| ... | ... | @@ -91,13 +88,13 @@ pub const Kind = enum { |
| 91 | 88 | } |
| 92 | 89 | |
| 93 | 90 | /// The C type of a character literal of this kind |
| 94 | pub fn charLiteralType(kind: Kind, comp: *const Compilation) Type { | |
| 91 | pub fn charLiteralType(kind: Kind, comp: *const Compilation) QualType { | |
| 95 | 92 | return switch (kind) { |
| 96 | .char => Type.int, | |
| 97 | .wide => comp.types.wchar, | |
| 98 | .utf_8 => .{ .specifier = .uchar }, | |
| 99 | .utf_16 => comp.types.uint_least16_t, | |
| 100 | .utf_32 => comp.types.uint_least32_t, | |
| 93 | .char => .int, | |
| 94 | .wide => comp.type_store.wchar, | |
| 95 | .utf_8 => .uchar, | |
| 96 | .utf_16 => comp.type_store.uint_least16_t, | |
| 97 | .utf_32 => comp.type_store.uint_least32_t, | |
| 101 | 98 | .unterminated => unreachable, |
| 102 | 99 | }; |
| 103 | 100 | } |
| ... | ... | @@ -120,7 +117,7 @@ pub const Kind = enum { |
| 120 | 117 | pub fn charUnitSize(kind: Kind, comp: *const Compilation) Compilation.CharUnitSize { |
| 121 | 118 | return switch (kind) { |
| 122 | 119 | .char => .@"1", |
| 123 | .wide => switch (comp.types.wchar.sizeof(comp).?) { | |
| 120 | .wide => switch (comp.type_store.wchar.sizeof(comp)) { | |
| 124 | 121 | 2 => .@"2", |
| 125 | 122 | 4 => .@"4", |
| 126 | 123 | else => unreachable, |
| ... | ... | @@ -140,37 +137,52 @@ pub const Kind = enum { |
| 140 | 137 | } |
| 141 | 138 | |
| 142 | 139 | /// The C type of an element of a string literal of this kind |
| 143 | pub fn elementType(kind: Kind, comp: *const Compilation) Type { | |
| 140 | pub fn elementType(kind: Kind, comp: *const Compilation) QualType { | |
| 144 | 141 | return switch (kind) { |
| 145 | 142 | .unterminated => unreachable, |
| 146 | .char => .{ .specifier = .char }, | |
| 147 | .utf_8 => if (comp.langopts.hasChar8_T()) .{ .specifier = .uchar } else .{ .specifier = .char }, | |
| 143 | .char => .char, | |
| 144 | .utf_8 => if (comp.langopts.hasChar8_T()) .uchar else .char, | |
| 148 | 145 | else => kind.charLiteralType(comp), |
| 149 | 146 | }; |
| 150 | 147 | } |
| 151 | 148 | }; |
| 152 | 149 | |
| 150 | pub const Ascii = struct { | |
| 151 | val: u7, | |
| 152 | ||
| 153 | pub fn init(val: anytype) Ascii { | |
| 154 | return .{ .val = @intCast(val) }; | |
| 155 | } | |
| 156 | ||
| 157 | pub fn format(ctx: Ascii, w: *std.Io.Writer, fmt: []const u8) !usize { | |
| 158 | const i = Diagnostics.templateIndex(w, fmt, "{c}"); | |
| 159 | if (std.ascii.isPrint(ctx.val)) { | |
| 160 | try w.writeByte(ctx.val); | |
| 161 | } else { | |
| 162 | try w.print("x{x:0>2}", .{ctx.val}); | |
| 163 | } | |
| 164 | return i; | |
| 165 | } | |
| 166 | }; | |
| 167 | ||
| 153 | 168 | pub const Parser = struct { |
| 169 | comp: *const Compilation, | |
| 154 | 170 | literal: []const u8, |
| 155 | 171 | i: usize = 0, |
| 156 | 172 | kind: Kind, |
| 157 | 173 | max_codepoint: u21, |
| 174 | loc: Source.Location, | |
| 175 | /// Offset added to `loc.byte_offset` when emitting an error. | |
| 176 | offset: u32 = 0, | |
| 177 | expansion_locs: []const Source.Location, | |
| 158 | 178 | /// We only want to issue a max of 1 error per char literal |
| 159 | 179 | errored: bool = false, |
| 160 | errors_buffer: [4]CharDiagnostic, | |
| 161 | errors_len: usize, | |
| 162 | comp: *const Compilation, | |
| 163 | ||
| 164 | pub fn init(literal: []const u8, kind: Kind, max_codepoint: u21, comp: *const Compilation) Parser { | |
| 165 | return .{ | |
| 166 | .literal = literal, | |
| 167 | .comp = comp, | |
| 168 | .kind = kind, | |
| 169 | .max_codepoint = max_codepoint, | |
| 170 | .errors_buffer = undefined, | |
| 171 | .errors_len = 0, | |
| 172 | }; | |
| 173 | } | |
| 180 | /// Makes incorrect encoding always an error. | |
| 181 | /// Used when concatenating string literals. | |
| 182 | incorrect_encoding_is_error: bool = false, | |
| 183 | /// If this is false, do not issue any diagnostics for incorrect character encoding | |
| 184 | /// Incorrect encoding is allowed if we are unescaping an identifier in the preprocessor | |
| 185 | diagnose_incorrect_encoding: bool = true, | |
| 174 | 186 | |
| 175 | 187 | fn prefixLen(self: *const Parser) usize { |
| 176 | 188 | return switch (self.kind) { |
| ... | ... | @@ -181,65 +193,204 @@ pub const Parser = struct { |
| 181 | 193 | }; |
| 182 | 194 | } |
| 183 | 195 | |
| 184 | pub fn errors(p: *Parser) []CharDiagnostic { | |
| 185 | return p.errors_buffer[0..p.errors_len]; | |
| 196 | const Diagnostic = struct { | |
| 197 | fmt: []const u8, | |
| 198 | kind: Diagnostics.Message.Kind, | |
| 199 | opt: ?Diagnostics.Option = null, | |
| 200 | extension: bool = false, | |
| 201 | ||
| 202 | pub const illegal_char_encoding_error: Diagnostic = .{ | |
| 203 | .fmt = "illegal character encoding in character literal", | |
| 204 | .kind = .@"error", | |
| 205 | }; | |
| 206 | ||
| 207 | pub const illegal_char_encoding_warning: Diagnostic = .{ | |
| 208 | .fmt = "illegal character encoding in character literal", | |
| 209 | .kind = .warning, | |
| 210 | .opt = .@"invalid-source-encoding", | |
| 211 | }; | |
| 212 | ||
| 213 | pub const missing_hex_escape: Diagnostic = .{ | |
| 214 | .fmt = "\\{c} used with no following hex digits", | |
| 215 | .kind = .@"error", | |
| 216 | }; | |
| 217 | ||
| 218 | pub const escape_sequence_overflow: Diagnostic = .{ | |
| 219 | .fmt = "escape sequence out of range", | |
| 220 | .kind = .@"error", | |
| 221 | }; | |
| 222 | ||
| 223 | pub const incomplete_universal_character: Diagnostic = .{ | |
| 224 | .fmt = "incomplete universal character name", | |
| 225 | .kind = .@"error", | |
| 226 | }; | |
| 227 | ||
| 228 | pub const invalid_universal_character: Diagnostic = .{ | |
| 229 | .fmt = "invalid universal character", | |
| 230 | .kind = .@"error", | |
| 231 | }; | |
| 232 | ||
| 233 | pub const char_too_large: Diagnostic = .{ | |
| 234 | .fmt = "character too large for enclosing character literal type", | |
| 235 | .kind = .@"error", | |
| 236 | }; | |
| 237 | ||
| 238 | pub const ucn_basic_char_error: Diagnostic = .{ | |
| 239 | .fmt = "character '{c}' cannot be specified by a universal character name", | |
| 240 | .kind = .@"error", | |
| 241 | }; | |
| 242 | ||
| 243 | pub const ucn_basic_char_warning: Diagnostic = .{ | |
| 244 | .fmt = "specifying character '{c}' with a universal character name is incompatible with C standards before C23", | |
| 245 | .kind = .off, | |
| 246 | .opt = .@"pre-c23-compat", | |
| 247 | }; | |
| 248 | ||
| 249 | pub const ucn_control_char_error: Diagnostic = .{ | |
| 250 | .fmt = "universal character name refers to a control character", | |
| 251 | .kind = .@"error", | |
| 252 | }; | |
| 253 | ||
| 254 | pub const ucn_control_char_warning: Diagnostic = .{ | |
| 255 | .fmt = "universal character name referring to a control character is incompatible with C standards before C23", | |
| 256 | .kind = .off, | |
| 257 | .opt = .@"pre-c23-compat", | |
| 258 | }; | |
| 259 | ||
| 260 | pub const c89_ucn_in_literal: Diagnostic = .{ | |
| 261 | .fmt = "universal character names are only valid in C99 or later", | |
| 262 | .kind = .warning, | |
| 263 | .opt = .unicode, | |
| 264 | }; | |
| 265 | ||
| 266 | const non_standard_escape_char: Diagnostic = .{ | |
| 267 | .fmt = "use of non-standard escape character '\\{c}'", | |
| 268 | .kind = .off, | |
| 269 | .extension = true, | |
| 270 | }; | |
| 271 | ||
| 272 | pub const unknown_escape_sequence: Diagnostic = .{ | |
| 273 | .fmt = "unknown escape sequence '\\{c}'", | |
| 274 | .kind = .warning, | |
| 275 | .opt = .@"unknown-escape-sequence", | |
| 276 | }; | |
| 277 | ||
| 278 | pub const four_char_char_literal: Diagnostic = .{ | |
| 279 | .fmt = "multi-character character constant", | |
| 280 | .opt = .@"four-char-constants", | |
| 281 | .kind = .off, | |
| 282 | }; | |
| 283 | ||
| 284 | pub const multichar_literal_warning: Diagnostic = .{ | |
| 285 | .fmt = "multi-character character constant", | |
| 286 | .kind = .warning, | |
| 287 | .opt = .multichar, | |
| 288 | }; | |
| 289 | ||
| 290 | pub const invalid_multichar_literal: Diagnostic = .{ | |
| 291 | .fmt = "{s} character literals may not contain multiple characters", | |
| 292 | .kind = .@"error", | |
| 293 | }; | |
| 294 | ||
| 295 | pub const char_lit_too_wide: Diagnostic = .{ | |
| 296 | .fmt = "character constant too long for its type", | |
| 297 | .kind = .warning, | |
| 298 | }; | |
| 299 | ||
| 300 | // pub const wide_multichar_literal: Diagnostic = .{ | |
| 301 | // .fmt = "extraneous characters in character constant ignored", | |
| 302 | // .kind = .warning, | |
| 303 | // }; | |
| 304 | }; | |
| 305 | ||
| 306 | pub fn err(p: *Parser, diagnostic: Diagnostic, args: anytype) !void { | |
| 307 | defer p.offset = 0; | |
| 308 | if (p.errored) return; | |
| 309 | defer p.errored = true; | |
| 310 | try p.warn(diagnostic, args); | |
| 186 | 311 | } |
| 187 | 312 | |
| 188 | pub fn err(self: *Parser, tag: Diagnostics.Tag, extra: Diagnostics.Message.Extra) void { | |
| 189 | if (self.errored) return; | |
| 190 | self.errored = true; | |
| 191 | const diagnostic: CharDiagnostic = .{ .tag = tag, .extra = extra }; | |
| 192 | if (self.errors_len == self.errors_buffer.len) { | |
| 193 | self.errors_buffer[self.errors_buffer.len - 1] = diagnostic; | |
| 194 | } else { | |
| 195 | self.errors_buffer[self.errors_len] = diagnostic; | |
| 196 | self.errors_len += 1; | |
| 197 | } | |
| 313 | pub fn warn(p: *Parser, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { | |
| 314 | defer p.offset = 0; | |
| 315 | if (p.errored) return; | |
| 316 | if (p.comp.diagnostics.effectiveKind(diagnostic) == .off) return; | |
| 317 | ||
| 318 | var sf = std.heap.stackFallback(1024, p.comp.gpa); | |
| 319 | var allocating: std.Io.Writer.Allocating = .init(sf.get()); | |
| 320 | defer allocating.deinit(); | |
| 321 | ||
| 322 | formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; | |
| 323 | ||
| 324 | var offset_location = p.loc; | |
| 325 | offset_location.byte_offset += p.offset; | |
| 326 | try p.comp.diagnostics.addWithLocation(p.comp, .{ | |
| 327 | .kind = diagnostic.kind, | |
| 328 | .text = allocating.written(), | |
| 329 | .opt = diagnostic.opt, | |
| 330 | .extension = diagnostic.extension, | |
| 331 | .location = offset_location.expand(p.comp), | |
| 332 | }, p.expansion_locs, true); | |
| 198 | 333 | } |
| 199 | 334 | |
| 200 | pub fn warn(self: *Parser, tag: Diagnostics.Tag, extra: Diagnostics.Message.Extra) void { | |
| 201 | if (self.errored) return; | |
| 202 | if (self.errors_len < self.errors_buffer.len) { | |
| 203 | self.errors_buffer[self.errors_len] = .{ .tag = tag, .extra = extra }; | |
| 204 | self.errors_len += 1; | |
| 335 | fn formatArgs(w: *std.Io.Writer, fmt: []const u8, args: anytype) !void { | |
| 336 | var i: usize = 0; | |
| 337 | inline for (std.meta.fields(@TypeOf(args))) |arg_info| { | |
| 338 | const arg = @field(args, arg_info.name); | |
| 339 | i += switch (@TypeOf(arg)) { | |
| 340 | []const u8 => try Diagnostics.formatString(w, fmt[i..], arg), | |
| 341 | Ascii => try arg.format(w, fmt[i..]), | |
| 342 | else => switch (@typeInfo(@TypeOf(arg))) { | |
| 343 | .int, .comptime_int => try Diagnostics.formatInt(w, fmt[i..], arg), | |
| 344 | .pointer => try Diagnostics.formatString(w, fmt[i..], arg), | |
| 345 | else => comptime unreachable, | |
| 346 | }, | |
| 347 | }; | |
| 205 | 348 | } |
| 349 | try w.writeAll(fmt[i..]); | |
| 206 | 350 | } |
| 207 | 351 | |
| 208 | pub fn next(self: *Parser) ?Item { | |
| 209 | if (self.i >= self.literal.len) return null; | |
| 352 | pub fn next(p: *Parser) !?Item { | |
| 353 | if (p.i >= p.literal.len) return null; | |
| 210 | 354 | |
| 211 | const start = self.i; | |
| 212 | if (self.literal[start] != '\\') { | |
| 213 | self.i = mem.indexOfScalarPos(u8, self.literal, start + 1, '\\') orelse self.literal.len; | |
| 214 | const unescaped_slice = self.literal[start..self.i]; | |
| 355 | const start = p.i; | |
| 356 | if (p.literal[start] != '\\') { | |
| 357 | p.i = mem.indexOfScalarPos(u8, p.literal, start + 1, '\\') orelse p.literal.len; | |
| 358 | const unescaped_slice = p.literal[start..p.i]; | |
| 215 | 359 | |
| 216 | 360 | const view = std.unicode.Utf8View.init(unescaped_slice) catch { |
| 217 | if (self.kind != .char) { | |
| 218 | self.err(.illegal_char_encoding_error, .{ .none = {} }); | |
| 361 | if (!p.diagnose_incorrect_encoding) { | |
| 362 | return .{ .improperly_encoded = p.literal[start..p.i] }; | |
| 363 | } | |
| 364 | if (p.incorrect_encoding_is_error) { | |
| 365 | try p.warn(.illegal_char_encoding_error, .{}); | |
| 366 | return .{ .improperly_encoded = p.literal[start..p.i] }; | |
| 367 | } | |
| 368 | if (p.kind != .char) { | |
| 369 | try p.err(.illegal_char_encoding_error, .{}); | |
| 219 | 370 | return null; |
| 220 | 371 | } |
| 221 | self.warn(.illegal_char_encoding_warning, .{ .none = {} }); | |
| 222 | return .{ .improperly_encoded = self.literal[start..self.i] }; | |
| 372 | try p.warn(.illegal_char_encoding_warning, .{}); | |
| 373 | return .{ .improperly_encoded = p.literal[start..p.i] }; | |
| 223 | 374 | }; |
| 224 | 375 | return .{ .utf8_text = view }; |
| 225 | 376 | } |
| 226 | switch (self.literal[start + 1]) { | |
| 227 | 'u', 'U' => return self.parseUnicodeEscape(), | |
| 228 | else => return self.parseEscapedChar(), | |
| 377 | switch (p.literal[start + 1]) { | |
| 378 | 'u', 'U' => return try p.parseUnicodeEscape(), | |
| 379 | else => return try p.parseEscapedChar(), | |
| 229 | 380 | } |
| 230 | 381 | } |
| 231 | 382 | |
| 232 | fn parseUnicodeEscape(self: *Parser) ?Item { | |
| 233 | const start = self.i; | |
| 383 | fn parseUnicodeEscape(p: *Parser) !?Item { | |
| 384 | const start = p.i; | |
| 234 | 385 | |
| 235 | std.debug.assert(self.literal[self.i] == '\\'); | |
| 386 | std.debug.assert(p.literal[p.i] == '\\'); | |
| 236 | 387 | |
| 237 | const kind = self.literal[self.i + 1]; | |
| 388 | const kind = p.literal[p.i + 1]; | |
| 238 | 389 | std.debug.assert(kind == 'u' or kind == 'U'); |
| 239 | 390 | |
| 240 | self.i += 2; | |
| 241 | if (self.i >= self.literal.len or !std.ascii.isHex(self.literal[self.i])) { | |
| 242 | self.err(.missing_hex_escape, .{ .ascii = @intCast(kind) }); | |
| 391 | p.i += 2; | |
| 392 | if (p.i >= p.literal.len or !std.ascii.isHex(p.literal[p.i])) { | |
| 393 | try p.err(.missing_hex_escape, .{Ascii.init(kind)}); | |
| 243 | 394 | return null; |
| 244 | 395 | } |
| 245 | 396 | const expected_len: usize = if (kind == 'u') 4 else 8; |
| ... | ... | @@ -247,66 +398,66 @@ pub const Parser = struct { |
| 247 | 398 | var count: usize = 0; |
| 248 | 399 | var val: u32 = 0; |
| 249 | 400 | |
| 250 | for (self.literal[self.i..], 0..) |c, i| { | |
| 401 | for (p.literal[p.i..], 0..) |c, i| { | |
| 251 | 402 | if (i == expected_len) break; |
| 252 | 403 | |
| 253 | const char = std.fmt.charToDigit(c, 16) catch { | |
| 254 | break; | |
| 255 | }; | |
| 404 | const char = std.fmt.charToDigit(c, 16) catch break; | |
| 256 | 405 | |
| 257 | 406 | val, const overflow = @shlWithOverflow(val, 4); |
| 258 | 407 | overflowed = overflowed or overflow != 0; |
| 259 | 408 | val |= char; |
| 260 | 409 | count += 1; |
| 261 | 410 | } |
| 262 | self.i += expected_len; | |
| 411 | p.i += expected_len; | |
| 263 | 412 | |
| 264 | 413 | if (overflowed) { |
| 265 | self.err(.escape_sequence_overflow, .{ .offset = start + self.prefixLen() }); | |
| 414 | p.offset += @intCast(start + p.prefixLen()); | |
| 415 | try p.err(.escape_sequence_overflow, .{}); | |
| 266 | 416 | return null; |
| 267 | 417 | } |
| 268 | 418 | |
| 269 | 419 | if (count != expected_len) { |
| 270 | self.err(.incomplete_universal_character, .{ .none = {} }); | |
| 420 | try p.err(.incomplete_universal_character, .{}); | |
| 271 | 421 | return null; |
| 272 | 422 | } |
| 273 | 423 | |
| 274 | 424 | if (val > std.math.maxInt(u21) or !std.unicode.utf8ValidCodepoint(@intCast(val))) { |
| 275 | self.err(.invalid_universal_character, .{ .offset = start + self.prefixLen() }); | |
| 425 | p.offset += @intCast(start + p.prefixLen()); | |
| 426 | try p.err(.invalid_universal_character, .{}); | |
| 276 | 427 | return null; |
| 277 | 428 | } |
| 278 | 429 | |
| 279 | if (val > self.max_codepoint) { | |
| 280 | self.err(.char_too_large, .{ .none = {} }); | |
| 430 | if (val > p.max_codepoint) { | |
| 431 | try p.err(.char_too_large, .{}); | |
| 281 | 432 | return null; |
| 282 | 433 | } |
| 283 | 434 | |
| 284 | 435 | if (val < 0xA0 and (val != '$' and val != '@' and val != '`')) { |
| 285 | const is_error = !self.comp.langopts.standard.atLeast(.c23); | |
| 436 | const is_error = !p.comp.langopts.standard.atLeast(.c23); | |
| 286 | 437 | if (val >= 0x20 and val <= 0x7F) { |
| 287 | 438 | if (is_error) { |
| 288 | self.err(.ucn_basic_char_error, .{ .ascii = @intCast(val) }); | |
| 289 | } else { | |
| 290 | self.warn(.ucn_basic_char_warning, .{ .ascii = @intCast(val) }); | |
| 439 | try p.err(.ucn_basic_char_error, .{Ascii.init(val)}); | |
| 440 | } else if (!p.comp.langopts.standard.atLeast(.c23)) { | |
| 441 | try p.warn(.ucn_basic_char_warning, .{Ascii.init(val)}); | |
| 291 | 442 | } |
| 292 | 443 | } else { |
| 293 | 444 | if (is_error) { |
| 294 | self.err(.ucn_control_char_error, .{ .none = {} }); | |
| 295 | } else { | |
| 296 | self.warn(.ucn_control_char_warning, .{ .none = {} }); | |
| 445 | try p.err(.ucn_control_char_error, .{}); | |
| 446 | } else if (!p.comp.langopts.standard.atLeast(.c23)) { | |
| 447 | try p.warn(.ucn_control_char_warning, .{}); | |
| 297 | 448 | } |
| 298 | 449 | } |
| 299 | 450 | } |
| 300 | 451 | |
| 301 | self.warn(.c89_ucn_in_literal, .{ .none = {} }); | |
| 452 | if (!p.comp.langopts.standard.atLeast(.c99)) try p.warn(.c89_ucn_in_literal, .{}); | |
| 302 | 453 | return .{ .codepoint = @intCast(val) }; |
| 303 | 454 | } |
| 304 | 455 | |
| 305 | fn parseEscapedChar(self: *Parser) Item { | |
| 306 | self.i += 1; | |
| 307 | const c = self.literal[self.i]; | |
| 456 | fn parseEscapedChar(p: *Parser) !Item { | |
| 457 | p.i += 1; | |
| 458 | const c = p.literal[p.i]; | |
| 308 | 459 | defer if (c != 'x' and (c < '0' or c > '7')) { |
| 309 | self.i += 1; | |
| 460 | p.i += 1; | |
| 310 | 461 | }; |
| 311 | 462 | |
| 312 | 463 | switch (c) { |
| ... | ... | @@ -319,36 +470,40 @@ pub const Parser = struct { |
| 319 | 470 | 'a' => return .{ .value = 0x07 }, |
| 320 | 471 | 'b' => return .{ .value = 0x08 }, |
| 321 | 472 | 'e', 'E' => { |
| 322 | self.warn(.non_standard_escape_char, .{ .invalid_escape = .{ .char = c, .offset = @intCast(self.i) } }); | |
| 473 | p.offset += @intCast(p.i); | |
| 474 | try p.warn(.non_standard_escape_char, .{Ascii.init(c)}); | |
| 323 | 475 | return .{ .value = 0x1B }; |
| 324 | 476 | }, |
| 325 | 477 | '(', '{', '[', '%' => { |
| 326 | self.warn(.non_standard_escape_char, .{ .invalid_escape = .{ .char = c, .offset = @intCast(self.i) } }); | |
| 478 | p.offset += @intCast(p.i); | |
| 479 | try p.warn(.non_standard_escape_char, .{Ascii.init(c)}); | |
| 327 | 480 | return .{ .value = c }; |
| 328 | 481 | }, |
| 329 | 482 | 'f' => return .{ .value = 0x0C }, |
| 330 | 483 | 'v' => return .{ .value = 0x0B }, |
| 331 | 'x' => return .{ .value = self.parseNumberEscape(.hex) }, | |
| 332 | '0'...'7' => return .{ .value = self.parseNumberEscape(.octal) }, | |
| 484 | 'x' => return .{ .value = try p.parseNumberEscape(.hex) }, | |
| 485 | '0'...'7' => return .{ .value = try p.parseNumberEscape(.octal) }, | |
| 333 | 486 | 'u', 'U' => unreachable, // handled by parseUnicodeEscape |
| 334 | 487 | else => { |
| 335 | self.warn(.unknown_escape_sequence, .{ .invalid_escape = .{ .char = c, .offset = @intCast(self.i) } }); | |
| 488 | p.offset += @intCast(p.i); | |
| 489 | try p.warn(.unknown_escape_sequence, .{Ascii.init(c)}); | |
| 336 | 490 | return .{ .value = c }; |
| 337 | 491 | }, |
| 338 | 492 | } |
| 339 | 493 | } |
| 340 | 494 | |
| 341 | fn parseNumberEscape(self: *Parser, base: EscapeBase) u32 { | |
| 495 | fn parseNumberEscape(p: *Parser, base: EscapeBase) !u32 { | |
| 342 | 496 | var val: u32 = 0; |
| 343 | 497 | var count: usize = 0; |
| 344 | 498 | var overflowed = false; |
| 345 | const start = self.i; | |
| 346 | defer self.i += count; | |
| 499 | const start = p.i; | |
| 500 | defer p.i += count; | |
| 501 | ||
| 347 | 502 | const slice = switch (base) { |
| 348 | .octal => self.literal[self.i..@min(self.literal.len, self.i + 3)], // max 3 chars | |
| 503 | .octal => p.literal[p.i..@min(p.literal.len, p.i + 3)], // max 3 chars | |
| 349 | 504 | .hex => blk: { |
| 350 | self.i += 1; | |
| 351 | break :blk self.literal[self.i..]; // skip over 'x'; could have an arbitrary number of chars | |
| 505 | p.i += 1; | |
| 506 | break :blk p.literal[p.i..]; // skip over 'x'; could have an arbitrary number of chars | |
| 352 | 507 | }, |
| 353 | 508 | }; |
| 354 | 509 | for (slice) |c| { |
| ... | ... | @@ -358,13 +513,14 @@ pub const Parser = struct { |
| 358 | 513 | val += char; |
| 359 | 514 | count += 1; |
| 360 | 515 | } |
| 361 | if (overflowed or val > self.kind.maxInt(self.comp)) { | |
| 362 | self.err(.escape_sequence_overflow, .{ .offset = start + self.prefixLen() }); | |
| 516 | if (overflowed or val > p.kind.maxInt(p.comp)) { | |
| 517 | p.offset += @intCast(start + p.prefixLen()); | |
| 518 | try p.err(.escape_sequence_overflow, .{}); | |
| 363 | 519 | return 0; |
| 364 | 520 | } |
| 365 | 521 | if (count == 0) { |
| 366 | 522 | std.debug.assert(base == .hex); |
| 367 | self.err(.missing_hex_escape, .{ .ascii = 'x' }); | |
| 523 | try p.err(.missing_hex_escape, .{Ascii.init('x')}); | |
| 368 | 524 | } |
| 369 | 525 | return val; |
| 370 | 526 | } |
lib/compiler/aro/aro/toolchains/Linux.zig deleted-517| ... | ... | @@ -1,517 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const mem = std.mem; | |
| 3 | const Compilation = @import("../Compilation.zig"); | |
| 4 | const GCCDetector = @import("../Driver/GCCDetector.zig"); | |
| 5 | const Toolchain = @import("../Toolchain.zig"); | |
| 6 | const Driver = @import("../Driver.zig"); | |
| 7 | const Distro = @import("../Driver/Distro.zig"); | |
| 8 | const target_util = @import("../target.zig"); | |
| 9 | const system_defaults = @import("system_defaults"); | |
| 10 | ||
| 11 | const Linux = @This(); | |
| 12 | ||
| 13 | distro: Distro.Tag = .unknown, | |
| 14 | extra_opts: std.ArrayListUnmanaged([]const u8) = .empty, | |
| 15 | gcc_detector: GCCDetector = .{}, | |
| 16 | ||
| 17 | pub fn discover(self: *Linux, tc: *Toolchain) !void { | |
| 18 | self.distro = Distro.detect(tc.getTarget(), tc.filesystem); | |
| 19 | try self.gcc_detector.discover(tc); | |
| 20 | tc.selected_multilib = self.gcc_detector.selected; | |
| 21 | ||
| 22 | try self.gcc_detector.appendToolPath(tc); | |
| 23 | try self.buildExtraOpts(tc); | |
| 24 | try self.findPaths(tc); | |
| 25 | } | |
| 26 | ||
| 27 | fn buildExtraOpts(self: *Linux, tc: *const Toolchain) !void { | |
| 28 | const gpa = tc.driver.comp.gpa; | |
| 29 | const target = tc.getTarget(); | |
| 30 | const is_android = target.abi.isAndroid(); | |
| 31 | if (self.distro.isAlpine() or is_android) { | |
| 32 | try self.extra_opts.ensureUnusedCapacity(gpa, 2); | |
| 33 | self.extra_opts.appendAssumeCapacity("-z"); | |
| 34 | self.extra_opts.appendAssumeCapacity("now"); | |
| 35 | } | |
| 36 | ||
| 37 | if (self.distro.isOpenSUSE() or self.distro.isUbuntu() or self.distro.isAlpine() or is_android) { | |
| 38 | try self.extra_opts.ensureUnusedCapacity(gpa, 2); | |
| 39 | self.extra_opts.appendAssumeCapacity("-z"); | |
| 40 | self.extra_opts.appendAssumeCapacity("relro"); | |
| 41 | } | |
| 42 | ||
| 43 | if ((target.cpu.arch.isArm() and !target.cpu.arch.isThumb()) or target.cpu.arch.isAARCH64() or is_android) { | |
| 44 | try self.extra_opts.ensureUnusedCapacity(gpa, 2); | |
| 45 | self.extra_opts.appendAssumeCapacity("-z"); | |
| 46 | self.extra_opts.appendAssumeCapacity("max-page-size=4096"); | |
| 47 | } | |
| 48 | ||
| 49 | if (target.cpu.arch == .arm or target.cpu.arch == .thumb) { | |
| 50 | try self.extra_opts.append(gpa, "-X"); | |
| 51 | } | |
| 52 | ||
| 53 | if (!target.cpu.arch.isMIPS() and target.cpu.arch != .hexagon) { | |
| 54 | const hash_style = if (is_android) .both else self.distro.getHashStyle(); | |
| 55 | try self.extra_opts.append(gpa, switch (hash_style) { | |
| 56 | inline else => |tag| "--hash-style=" ++ @tagName(tag), | |
| 57 | }); | |
| 58 | } | |
| 59 | ||
| 60 | if (system_defaults.enable_linker_build_id) { | |
| 61 | try self.extra_opts.append(gpa, "--build-id"); | |
| 62 | } | |
| 63 | } | |
| 64 | ||
| 65 | fn addMultiLibPaths(self: *Linux, tc: *Toolchain, sysroot: []const u8, os_lib_dir: []const u8) !void { | |
| 66 | if (!self.gcc_detector.is_valid) return; | |
| 67 | const gcc_triple = self.gcc_detector.gcc_triple; | |
| 68 | const lib_path = self.gcc_detector.parent_lib_path; | |
| 69 | ||
| 70 | // Add lib/gcc/$triple/$version, with an optional /multilib suffix. | |
| 71 | try tc.addPathIfExists(&.{ self.gcc_detector.install_path, tc.selected_multilib.gcc_suffix }, .file); | |
| 72 | ||
| 73 | // Add lib/gcc/$triple/$libdir | |
| 74 | // For GCC built with --enable-version-specific-runtime-libs. | |
| 75 | try tc.addPathIfExists(&.{ self.gcc_detector.install_path, "..", os_lib_dir }, .file); | |
| 76 | ||
| 77 | try tc.addPathIfExists(&.{ lib_path, "..", gcc_triple, "lib", "..", os_lib_dir, tc.selected_multilib.os_suffix }, .file); | |
| 78 | ||
| 79 | // If the GCC installation we found is inside of the sysroot, we want to | |
| 80 | // prefer libraries installed in the parent prefix of the GCC installation. | |
| 81 | // It is important to *not* use these paths when the GCC installation is | |
| 82 | // outside of the system root as that can pick up unintended libraries. | |
| 83 | // This usually happens when there is an external cross compiler on the | |
| 84 | // host system, and a more minimal sysroot available that is the target of | |
| 85 | // the cross. Note that GCC does include some of these directories in some | |
| 86 | // configurations but this seems somewhere between questionable and simply | |
| 87 | // a bug. | |
| 88 | if (mem.startsWith(u8, lib_path, sysroot)) { | |
| 89 | try tc.addPathIfExists(&.{ lib_path, "..", os_lib_dir }, .file); | |
| 90 | } | |
| 91 | } | |
| 92 | ||
| 93 | fn addMultiArchPaths(self: *Linux, tc: *Toolchain) !void { | |
| 94 | if (!self.gcc_detector.is_valid) return; | |
| 95 | const lib_path = self.gcc_detector.parent_lib_path; | |
| 96 | const gcc_triple = self.gcc_detector.gcc_triple; | |
| 97 | const multilib = self.gcc_detector.selected; | |
| 98 | try tc.addPathIfExists(&.{ lib_path, "..", gcc_triple, "lib", multilib.os_suffix }, .file); | |
| 99 | } | |
| 100 | ||
| 101 | /// TODO: Very incomplete | |
| 102 | fn findPaths(self: *Linux, tc: *Toolchain) !void { | |
| 103 | const target = tc.getTarget(); | |
| 104 | const sysroot = tc.getSysroot(); | |
| 105 | ||
| 106 | var output: [64]u8 = undefined; | |
| 107 | ||
| 108 | const os_lib_dir = getOSLibDir(target); | |
| 109 | const multiarch_triple = getMultiarchTriple(target) orelse target_util.toLLVMTriple(target, &output); | |
| 110 | ||
| 111 | try self.addMultiLibPaths(tc, sysroot, os_lib_dir); | |
| 112 | ||
| 113 | try tc.addPathIfExists(&.{ sysroot, "/lib", multiarch_triple }, .file); | |
| 114 | try tc.addPathIfExists(&.{ sysroot, "/lib", "..", os_lib_dir }, .file); | |
| 115 | ||
| 116 | if (target.abi.isAndroid()) { | |
| 117 | // TODO | |
| 118 | } | |
| 119 | try tc.addPathIfExists(&.{ sysroot, "/usr", "lib", multiarch_triple }, .file); | |
| 120 | try tc.addPathIfExists(&.{ sysroot, "/usr", "lib", "..", os_lib_dir }, .file); | |
| 121 | ||
| 122 | try self.addMultiArchPaths(tc); | |
| 123 | ||
| 124 | try tc.addPathIfExists(&.{ sysroot, "/lib" }, .file); | |
| 125 | try tc.addPathIfExists(&.{ sysroot, "/usr", "lib" }, .file); | |
| 126 | } | |
| 127 | ||
| 128 | pub fn deinit(self: *Linux, allocator: std.mem.Allocator) void { | |
| 129 | self.extra_opts.deinit(allocator); | |
| 130 | } | |
| 131 | ||
| 132 | fn isPIEDefault(self: *const Linux) bool { | |
| 133 | _ = self; | |
| 134 | return false; | |
| 135 | } | |
| 136 | ||
| 137 | fn getPIE(self: *const Linux, d: *const Driver) bool { | |
| 138 | if (d.shared or d.static or d.relocatable or d.static_pie) { | |
| 139 | return false; | |
| 140 | } | |
| 141 | return d.pie orelse self.isPIEDefault(); | |
| 142 | } | |
| 143 | ||
| 144 | fn getStaticPIE(self: *const Linux, d: *Driver) !bool { | |
| 145 | _ = self; | |
| 146 | if (d.static_pie and d.pie != null) { | |
| 147 | try d.err("cannot specify 'nopie' along with 'static-pie'"); | |
| 148 | } | |
| 149 | return d.static_pie; | |
| 150 | } | |
| 151 | ||
| 152 | fn getStatic(self: *const Linux, d: *const Driver) bool { | |
| 153 | _ = self; | |
| 154 | return d.static and !d.static_pie; | |
| 155 | } | |
| 156 | ||
| 157 | pub fn getDefaultLinker(self: *const Linux, target: std.Target) []const u8 { | |
| 158 | _ = self; | |
| 159 | if (target.abi.isAndroid()) { | |
| 160 | return "ld.lld"; | |
| 161 | } | |
| 162 | return "ld"; | |
| 163 | } | |
| 164 | ||
| 165 | pub fn buildLinkerArgs(self: *const Linux, tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) Compilation.Error!void { | |
| 166 | const d = tc.driver; | |
| 167 | const target = tc.getTarget(); | |
| 168 | ||
| 169 | const is_pie = self.getPIE(d); | |
| 170 | const is_static_pie = try self.getStaticPIE(d); | |
| 171 | const is_static = self.getStatic(d); | |
| 172 | const is_android = target.abi.isAndroid(); | |
| 173 | const is_ve = target.cpu.arch == .ve; | |
| 174 | const has_crt_begin_end_files = target.abi != .none; // TODO: clang checks for MIPS vendor | |
| 175 | ||
| 176 | if (is_pie) { | |
| 177 | try argv.append("-pie"); | |
| 178 | } | |
| 179 | if (is_static_pie) { | |
| 180 | try argv.appendSlice(&.{ "-static", "-pie", "--no-dynamic-linker", "-z", "text" }); | |
| 181 | } | |
| 182 | ||
| 183 | if (d.rdynamic) { | |
| 184 | try argv.append("-export-dynamic"); | |
| 185 | } | |
| 186 | ||
| 187 | if (d.strip) { | |
| 188 | try argv.append("-s"); | |
| 189 | } | |
| 190 | ||
| 191 | try argv.appendSlice(self.extra_opts.items); | |
| 192 | try argv.append("--eh-frame-hdr"); | |
| 193 | ||
| 194 | // Todo: Driver should parse `-EL`/`-EB` for arm to set endianness for arm targets | |
| 195 | if (target_util.ldEmulationOption(d.comp.target, null)) |emulation| { | |
| 196 | try argv.appendSlice(&.{ "-m", emulation }); | |
| 197 | } else { | |
| 198 | try d.err("Unknown target triple"); | |
| 199 | return; | |
| 200 | } | |
| 201 | if (d.comp.target.cpu.arch.isRISCV()) { | |
| 202 | try argv.append("-X"); | |
| 203 | } | |
| 204 | if (d.shared) { | |
| 205 | try argv.append("-shared"); | |
| 206 | } | |
| 207 | if (is_static) { | |
| 208 | try argv.append("-static"); | |
| 209 | } else { | |
| 210 | if (d.rdynamic) { | |
| 211 | try argv.append("-export-dynamic"); | |
| 212 | } | |
| 213 | if (!d.shared and !is_static_pie and !d.relocatable) { | |
| 214 | const dynamic_linker = d.comp.target.standardDynamicLinkerPath(); | |
| 215 | // todo: check for --dyld-prefix | |
| 216 | if (dynamic_linker.get()) |path| { | |
| 217 | try argv.appendSlice(&.{ "-dynamic-linker", try tc.arena.dupe(u8, path) }); | |
| 218 | } else { | |
| 219 | try d.err("Could not find dynamic linker path"); | |
| 220 | } | |
| 221 | } | |
| 222 | } | |
| 223 | ||
| 224 | try argv.appendSlice(&.{ "-o", d.output_name orelse "a.out" }); | |
| 225 | ||
| 226 | if (!d.nostdlib and !d.nostartfiles and !d.relocatable) { | |
| 227 | if (!is_android) { | |
| 228 | if (!d.shared) { | |
| 229 | const crt1 = if (is_pie) | |
| 230 | "Scrt1.o" | |
| 231 | else if (is_static_pie) | |
| 232 | "rcrt1.o" | |
| 233 | else | |
| 234 | "crt1.o"; | |
| 235 | try argv.append(try tc.getFilePath(crt1)); | |
| 236 | } | |
| 237 | try argv.append(try tc.getFilePath("crti.o")); | |
| 238 | } | |
| 239 | if (is_ve) { | |
| 240 | try argv.appendSlice(&.{ "-z", "max-page-size=0x4000000" }); | |
| 241 | } | |
| 242 | ||
| 243 | if (has_crt_begin_end_files) { | |
| 244 | var path: []const u8 = ""; | |
| 245 | if (tc.getRuntimeLibKind() == .compiler_rt and !is_android) { | |
| 246 | const crt_begin = try tc.getCompilerRt("crtbegin", .object); | |
| 247 | if (tc.filesystem.exists(crt_begin)) { | |
| 248 | path = crt_begin; | |
| 249 | } | |
| 250 | } | |
| 251 | if (path.len == 0) { | |
| 252 | const crt_begin = if (tc.driver.shared) | |
| 253 | if (is_android) "crtbegin_so.o" else "crtbeginS.o" | |
| 254 | else if (is_static) | |
| 255 | if (is_android) "crtbegin_static.o" else "crtbeginT.o" | |
| 256 | else if (is_pie or is_static_pie) | |
| 257 | if (is_android) "crtbegin_dynamic.o" else "crtbeginS.o" | |
| 258 | else if (is_android) "crtbegin_dynamic.o" else "crtbegin.o"; | |
| 259 | path = try tc.getFilePath(crt_begin); | |
| 260 | } | |
| 261 | try argv.append(path); | |
| 262 | } | |
| 263 | } | |
| 264 | ||
| 265 | // TODO add -L opts | |
| 266 | // TODO add -u opts | |
| 267 | ||
| 268 | try tc.addFilePathLibArgs(argv); | |
| 269 | ||
| 270 | // TODO handle LTO | |
| 271 | ||
| 272 | try argv.appendSlice(d.link_objects.items); | |
| 273 | ||
| 274 | if (!d.nostdlib and !d.relocatable) { | |
| 275 | if (!d.nodefaultlibs) { | |
| 276 | if (is_static or is_static_pie) { | |
| 277 | try argv.append("--start-group"); | |
| 278 | } | |
| 279 | try tc.addRuntimeLibs(argv); | |
| 280 | ||
| 281 | // TODO: add pthread if needed | |
| 282 | if (!d.nolibc) { | |
| 283 | try argv.append("-lc"); | |
| 284 | } | |
| 285 | if (is_static or is_static_pie) { | |
| 286 | try argv.append("--end-group"); | |
| 287 | } else { | |
| 288 | try tc.addRuntimeLibs(argv); | |
| 289 | } | |
| 290 | } | |
| 291 | if (!d.nostartfiles) { | |
| 292 | if (has_crt_begin_end_files) { | |
| 293 | var path: []const u8 = ""; | |
| 294 | if (tc.getRuntimeLibKind() == .compiler_rt and !is_android) { | |
| 295 | const crt_end = try tc.getCompilerRt("crtend", .object); | |
| 296 | if (tc.filesystem.exists(crt_end)) { | |
| 297 | path = crt_end; | |
| 298 | } | |
| 299 | } | |
| 300 | if (path.len == 0) { | |
| 301 | const crt_end = if (d.shared) | |
| 302 | if (is_android) "crtend_so.o" else "crtendS.o" | |
| 303 | else if (is_pie or is_static_pie) | |
| 304 | if (is_android) "crtend_android.o" else "crtendS.o" | |
| 305 | else if (is_android) "crtend_android.o" else "crtend.o"; | |
| 306 | path = try tc.getFilePath(crt_end); | |
| 307 | } | |
| 308 | try argv.append(path); | |
| 309 | } | |
| 310 | if (!is_android) { | |
| 311 | try argv.append(try tc.getFilePath("crtn.o")); | |
| 312 | } | |
| 313 | } | |
| 314 | } | |
| 315 | ||
| 316 | // TODO add -T args | |
| 317 | } | |
| 318 | ||
| 319 | fn getMultiarchTriple(target: std.Target) ?[]const u8 { | |
| 320 | const is_android = target.abi.isAndroid(); | |
| 321 | const is_mips_r6 = target.cpu.has(.mips, .mips32r6); | |
| 322 | return switch (target.cpu.arch) { | |
| 323 | .arm, .thumb => if (is_android) "arm-linux-androideabi" else if (target.abi == .gnueabihf) "arm-linux-gnueabihf" else "arm-linux-gnueabi", | |
| 324 | .armeb, .thumbeb => if (target.abi == .gnueabihf) "armeb-linux-gnueabihf" else "armeb-linux-gnueabi", | |
| 325 | .aarch64 => if (is_android) "aarch64-linux-android" else "aarch64-linux-gnu", | |
| 326 | .aarch64_be => "aarch64_be-linux-gnu", | |
| 327 | .x86 => if (is_android) "i686-linux-android" else "i386-linux-gnu", | |
| 328 | .x86_64 => if (is_android) "x86_64-linux-android" else if (target.abi == .gnux32) "x86_64-linux-gnux32" else "x86_64-linux-gnu", | |
| 329 | .m68k => "m68k-linux-gnu", | |
| 330 | .mips => if (is_mips_r6) "mipsisa32r6-linux-gnu" else "mips-linux-gnu", | |
| 331 | .mipsel => if (is_android) "mipsel-linux-android" else if (is_mips_r6) "mipsisa32r6el-linux-gnu" else "mipsel-linux-gnu", | |
| 332 | .powerpcle => "powerpcle-linux-gnu", | |
| 333 | .powerpc64 => "powerpc64-linux-gnu", | |
| 334 | .powerpc64le => "powerpc64le-linux-gnu", | |
| 335 | .riscv64 => "riscv64-linux-gnu", | |
| 336 | .sparc => "sparc-linux-gnu", | |
| 337 | .sparc64 => "sparc64-linux-gnu", | |
| 338 | .s390x => "s390x-linux-gnu", | |
| 339 | ||
| 340 | // TODO: expand this | |
| 341 | else => null, | |
| 342 | }; | |
| 343 | } | |
| 344 | ||
| 345 | fn getOSLibDir(target: std.Target) []const u8 { | |
| 346 | switch (target.cpu.arch) { | |
| 347 | .x86, | |
| 348 | .powerpc, | |
| 349 | .powerpcle, | |
| 350 | .sparc, | |
| 351 | => return "lib32", | |
| 352 | else => {}, | |
| 353 | } | |
| 354 | if (target.cpu.arch == .x86_64 and (target.abi == .gnux32 or target.abi == .muslx32)) { | |
| 355 | return "libx32"; | |
| 356 | } | |
| 357 | if (target.cpu.arch == .riscv32) { | |
| 358 | return "lib32"; | |
| 359 | } | |
| 360 | if (target.ptrBitWidth() == 32) { | |
| 361 | return "lib"; | |
| 362 | } | |
| 363 | return "lib64"; | |
| 364 | } | |
| 365 | ||
| 366 | pub fn defineSystemIncludes(self: *const Linux, tc: *const Toolchain) !void { | |
| 367 | if (tc.driver.nostdinc) return; | |
| 368 | ||
| 369 | const comp = tc.driver.comp; | |
| 370 | const target = tc.getTarget(); | |
| 371 | ||
| 372 | // musl prefers /usr/include before builtin includes, so musl targets will add builtins | |
| 373 | // at the end of this function (unless disabled with nostdlibinc) | |
| 374 | if (!tc.driver.nobuiltininc and (!target.abi.isMusl() or tc.driver.nostdlibinc)) { | |
| 375 | try comp.addBuiltinIncludeDir(tc.driver.aro_name); | |
| 376 | } | |
| 377 | ||
| 378 | if (tc.driver.nostdlibinc) return; | |
| 379 | ||
| 380 | const sysroot = tc.getSysroot(); | |
| 381 | const local_include = try std.fmt.allocPrint(comp.gpa, "{s}{s}", .{ sysroot, "/usr/local/include" }); | |
| 382 | defer comp.gpa.free(local_include); | |
| 383 | try comp.addSystemIncludeDir(local_include); | |
| 384 | ||
| 385 | if (self.gcc_detector.is_valid) { | |
| 386 | const gcc_include_path = try std.fs.path.join(comp.gpa, &.{ self.gcc_detector.parent_lib_path, "..", self.gcc_detector.gcc_triple, "include" }); | |
| 387 | defer comp.gpa.free(gcc_include_path); | |
| 388 | try comp.addSystemIncludeDir(gcc_include_path); | |
| 389 | } | |
| 390 | ||
| 391 | if (getMultiarchTriple(target)) |triple| { | |
| 392 | const joined = try std.fs.path.join(comp.gpa, &.{ sysroot, "usr", "include", triple }); | |
| 393 | defer comp.gpa.free(joined); | |
| 394 | if (tc.filesystem.exists(joined)) { | |
| 395 | try comp.addSystemIncludeDir(joined); | |
| 396 | } | |
| 397 | } | |
| 398 | ||
| 399 | if (target.os.tag == .rtems) return; | |
| 400 | ||
| 401 | try comp.addSystemIncludeDir("/include"); | |
| 402 | try comp.addSystemIncludeDir("/usr/include"); | |
| 403 | ||
| 404 | std.debug.assert(!tc.driver.nostdlibinc); | |
| 405 | if (!tc.driver.nobuiltininc and target.abi.isMusl()) { | |
| 406 | try comp.addBuiltinIncludeDir(tc.driver.aro_name); | |
| 407 | } | |
| 408 | } | |
| 409 | ||
| 410 | test Linux { | |
| 411 | if (@import("builtin").os.tag == .windows) return error.SkipZigTest; | |
| 412 | ||
| 413 | var arena_instance = std.heap.ArenaAllocator.init(std.testing.allocator); | |
| 414 | defer arena_instance.deinit(); | |
| 415 | const arena = arena_instance.allocator(); | |
| 416 | ||
| 417 | var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); | |
| 418 | defer comp.deinit(); | |
| 419 | comp.environment = .{ | |
| 420 | .path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", | |
| 421 | }; | |
| 422 | defer comp.environment = .{}; | |
| 423 | ||
| 424 | const raw_triple = "x86_64-linux-gnu"; | |
| 425 | const target_query = try std.Target.Query.parse(.{ .arch_os_abi = raw_triple }); | |
| 426 | comp.target = try std.zig.system.resolveTargetQuery(target_query); | |
| 427 | comp.langopts.setEmulatedCompiler(.gcc); | |
| 428 | ||
| 429 | var driver: Driver = .{ .comp = &comp }; | |
| 430 | defer driver.deinit(); | |
| 431 | driver.raw_target_triple = raw_triple; | |
| 432 | ||
| 433 | const link_obj = try driver.comp.gpa.dupe(u8, "/tmp/foo.o"); | |
| 434 | try driver.link_objects.append(driver.comp.gpa, link_obj); | |
| 435 | driver.temp_file_count += 1; | |
| 436 | ||
| 437 | var toolchain: Toolchain = .{ .driver = &driver, .arena = arena, .filesystem = .{ .fake = &.{ | |
| 438 | .{ .path = "/tmp" }, | |
| 439 | .{ .path = "/usr" }, | |
| 440 | .{ .path = "/usr/lib64" }, | |
| 441 | .{ .path = "/usr/bin" }, | |
| 442 | .{ .path = "/usr/bin/ld", .executable = true }, | |
| 443 | .{ .path = "/lib" }, | |
| 444 | .{ .path = "/lib/x86_64-linux-gnu" }, | |
| 445 | .{ .path = "/lib/x86_64-linux-gnu/crt1.o" }, | |
| 446 | .{ .path = "/lib/x86_64-linux-gnu/crti.o" }, | |
| 447 | .{ .path = "/lib/x86_64-linux-gnu/crtn.o" }, | |
| 448 | .{ .path = "/lib64" }, | |
| 449 | .{ .path = "/usr/lib" }, | |
| 450 | .{ .path = "/usr/lib/gcc" }, | |
| 451 | .{ .path = "/usr/lib/gcc/x86_64-linux-gnu" }, | |
| 452 | .{ .path = "/usr/lib/gcc/x86_64-linux-gnu/9" }, | |
| 453 | .{ .path = "/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.o" }, | |
| 454 | .{ .path = "/usr/lib/gcc/x86_64-linux-gnu/9/crtend.o" }, | |
| 455 | .{ .path = "/usr/lib/x86_64-linux-gnu" }, | |
| 456 | .{ .path = "/etc/lsb-release", .contents = | |
| 457 | \\DISTRIB_ID=Ubuntu | |
| 458 | \\DISTRIB_RELEASE=20.04 | |
| 459 | \\DISTRIB_CODENAME=focal | |
| 460 | \\DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS" | |
| 461 | \\ | |
| 462 | }, | |
| 463 | } } }; | |
| 464 | defer toolchain.deinit(); | |
| 465 | ||
| 466 | try toolchain.discover(); | |
| 467 | ||
| 468 | var argv = std.array_list.Managed([]const u8).init(driver.comp.gpa); | |
| 469 | defer argv.deinit(); | |
| 470 | ||
| 471 | var linker_path_buf: [std.fs.max_path_bytes]u8 = undefined; | |
| 472 | const linker_path = try toolchain.getLinkerPath(&linker_path_buf); | |
| 473 | try argv.append(linker_path); | |
| 474 | ||
| 475 | try toolchain.buildLinkerArgs(&argv); | |
| 476 | ||
| 477 | const expected = [_][]const u8{ | |
| 478 | "/usr/bin/ld", | |
| 479 | "-z", | |
| 480 | "relro", | |
| 481 | "--hash-style=gnu", | |
| 482 | "--eh-frame-hdr", | |
| 483 | "-m", | |
| 484 | "elf_x86_64", | |
| 485 | "-dynamic-linker", | |
| 486 | "/lib64/ld-linux-x86-64.so.2", | |
| 487 | "-o", | |
| 488 | "a.out", | |
| 489 | "/lib/x86_64-linux-gnu/crt1.o", | |
| 490 | "/lib/x86_64-linux-gnu/crti.o", | |
| 491 | "/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.o", | |
| 492 | "-L/usr/lib/gcc/x86_64-linux-gnu/9", | |
| 493 | "-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib64", | |
| 494 | "-L/lib/x86_64-linux-gnu", | |
| 495 | "-L/lib/../lib64", | |
| 496 | "-L/usr/lib/x86_64-linux-gnu", | |
| 497 | "-L/usr/lib/../lib64", | |
| 498 | "-L/lib", | |
| 499 | "-L/usr/lib", | |
| 500 | link_obj, | |
| 501 | "-lgcc", | |
| 502 | "--as-needed", | |
| 503 | "-lgcc_s", | |
| 504 | "--no-as-needed", | |
| 505 | "-lc", | |
| 506 | "-lgcc", | |
| 507 | "--as-needed", | |
| 508 | "-lgcc_s", | |
| 509 | "--no-as-needed", | |
| 510 | "/usr/lib/gcc/x86_64-linux-gnu/9/crtend.o", | |
| 511 | "/lib/x86_64-linux-gnu/crtn.o", | |
| 512 | }; | |
| 513 | try std.testing.expectEqual(expected.len, argv.items.len); | |
| 514 | for (expected, argv.items) |expected_item, actual_item| { | |
| 515 | try std.testing.expectEqualStrings(expected_item, actual_item); | |
| 516 | } | |
| 517 | } |
lib/compiler/aro/assembly_backend.zig created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | const aro = @import("aro"); | |
| 4 | ||
| 5 | pub const x86_64 = @import("assembly_backend/x86_64.zig"); | |
| 6 | ||
| 7 | pub fn genAsm(target: std.Target, tree: *const aro.Tree) aro.Compilation.Error!aro.Assembly { | |
| 8 | return switch (target.cpu.arch) { | |
| 9 | .x86_64 => x86_64.genAsm(tree), | |
| 10 | else => std.debug.panic("genAsm not implemented: {s}", .{@tagName(target.cpu.arch)}), | |
| 11 | }; | |
| 12 | } |
lib/compiler/aro/assembly_backend/x86_64.zig created+255| ... | ... | @@ -0,0 +1,255 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Allocator = std.mem.Allocator; | |
| 3 | const assert = std.debug.assert; | |
| 4 | ||
| 5 | const aro = @import("aro"); | |
| 6 | const Assembly = aro.Assembly; | |
| 7 | const Compilation = aro.Compilation; | |
| 8 | const Node = Tree.Node; | |
| 9 | const Source = aro.Source; | |
| 10 | const Tree = aro.Tree; | |
| 11 | const QualType = aro.QualType; | |
| 12 | const Value = aro.Value; | |
| 13 | ||
| 14 | const AsmCodeGen = @This(); | |
| 15 | const Error = aro.Compilation.Error; | |
| 16 | ||
| 17 | tree: *const Tree, | |
| 18 | comp: *Compilation, | |
| 19 | text: *std.Io.Writer, | |
| 20 | data: *std.Io.Writer, | |
| 21 | ||
| 22 | const StorageUnit = enum(u8) { | |
| 23 | byte = 8, | |
| 24 | short = 16, | |
| 25 | long = 32, | |
| 26 | quad = 64, | |
| 27 | ||
| 28 | fn trunc(self: StorageUnit, val: u64) u64 { | |
| 29 | return switch (self) { | |
| 30 | .byte => @as(u8, @truncate(val)), | |
| 31 | .short => @as(u16, @truncate(val)), | |
| 32 | .long => @as(u32, @truncate(val)), | |
| 33 | .quad => val, | |
| 34 | }; | |
| 35 | } | |
| 36 | }; | |
| 37 | ||
| 38 | fn serializeInt(value: u64, storage_unit: StorageUnit, w: *std.Io.Writer) !void { | |
| 39 | try w.print(" .{s} 0x{x}\n", .{ @tagName(storage_unit), storage_unit.trunc(value) }); | |
| 40 | } | |
| 41 | ||
| 42 | fn serializeFloat(comptime T: type, value: T, w: *std.Io.Writer) !void { | |
| 43 | switch (T) { | |
| 44 | f128 => { | |
| 45 | const bytes = std.mem.asBytes(&value); | |
| 46 | const first = std.mem.bytesToValue(u64, bytes[0..8]); | |
| 47 | try serializeInt(first, .quad, w); | |
| 48 | const second = std.mem.bytesToValue(u64, bytes[8..16]); | |
| 49 | return serializeInt(second, .quad, w); | |
| 50 | }, | |
| 51 | f80 => { | |
| 52 | const bytes = std.mem.asBytes(&value); | |
| 53 | const first = std.mem.bytesToValue(u64, bytes[0..8]); | |
| 54 | try serializeInt(first, .quad, w); | |
| 55 | const second = std.mem.bytesToValue(u16, bytes[8..10]); | |
| 56 | try serializeInt(second, .short, w); | |
| 57 | return w.writeAll(" .zero 6\n"); | |
| 58 | }, | |
| 59 | else => { | |
| 60 | const size = @bitSizeOf(T); | |
| 61 | const storage_unit = std.meta.intToEnum(StorageUnit, size) catch unreachable; | |
| 62 | const IntTy = @Type(.{ .int = .{ .signedness = .unsigned, .bits = size } }); | |
| 63 | const int_val: IntTy = @bitCast(value); | |
| 64 | return serializeInt(int_val, storage_unit, w); | |
| 65 | }, | |
| 66 | } | |
| 67 | } | |
| 68 | ||
| 69 | pub fn todo(c: *AsmCodeGen, msg: []const u8, tok: Tree.TokenIndex) Error { | |
| 70 | const loc: Source.Location = c.tree.tokens.items(.loc)[tok]; | |
| 71 | ||
| 72 | var sf = std.heap.stackFallback(1024, c.comp.gpa); | |
| 73 | const allocator = sf.get(); | |
| 74 | var buf: std.ArrayList(u8) = .empty; | |
| 75 | defer buf.deinit(allocator); | |
| 76 | ||
| 77 | try buf.print(allocator, "TODO: {s}", .{msg}); | |
| 78 | try c.comp.diagnostics.add(.{ | |
| 79 | .text = buf.items, | |
| 80 | .kind = .@"error", | |
| 81 | .location = loc.expand(c.comp), | |
| 82 | }); | |
| 83 | return error.FatalError; | |
| 84 | } | |
| 85 | ||
| 86 | fn emitAggregate(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void { | |
| 87 | _ = qt; | |
| 88 | return c.todo("Codegen aggregates", node.tok(c.tree)); | |
| 89 | } | |
| 90 | ||
| 91 | fn emitSingleValue(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void { | |
| 92 | const value = c.tree.value_map.get(node) orelse return; | |
| 93 | const bit_size = qt.bitSizeof(c.comp); | |
| 94 | const scalar_kind = qt.scalarKind(c.comp); | |
| 95 | if (!scalar_kind.isReal()) { | |
| 96 | return c.todo("Codegen _Complex values", node.tok(c.tree)); | |
| 97 | } else if (scalar_kind.isInt()) { | |
| 98 | const storage_unit = std.meta.intToEnum(StorageUnit, bit_size) catch return c.todo("Codegen _BitInt values", node.tok(c.tree)); | |
| 99 | try c.data.print(" .{s} ", .{@tagName(storage_unit)}); | |
| 100 | _ = try value.print(qt, c.comp, c.data); | |
| 101 | try c.data.writeByte('\n'); | |
| 102 | } else if (scalar_kind.isFloat()) { | |
| 103 | switch (bit_size) { | |
| 104 | 16 => return serializeFloat(f16, value.toFloat(f16, c.comp), c.data), | |
| 105 | 32 => return serializeFloat(f32, value.toFloat(f32, c.comp), c.data), | |
| 106 | 64 => return serializeFloat(f64, value.toFloat(f64, c.comp), c.data), | |
| 107 | 80 => return serializeFloat(f80, value.toFloat(f80, c.comp), c.data), | |
| 108 | 128 => return serializeFloat(f128, value.toFloat(f128, c.comp), c.data), | |
| 109 | else => unreachable, | |
| 110 | } | |
| 111 | } else if (scalar_kind.isPointer()) { | |
| 112 | return c.todo("Codegen pointer", node.tok(c.tree)); | |
| 113 | } else if (qt.is(c.comp, .array)) { | |
| 114 | // Todo: | |
| 115 | // Handle truncated initializers e.g. char x[3] = "hello"; | |
| 116 | // Zero out remaining bytes if initializer is shorter than storage capacity | |
| 117 | // Handle non-char strings | |
| 118 | const bytes = value.toBytes(c.comp); | |
| 119 | const directive = if (bytes.len > bit_size / 8) "ascii" else "string"; | |
| 120 | try c.data.print(" .{s} ", .{directive}); | |
| 121 | try Value.printString(bytes, qt, c.comp, c.data); | |
| 122 | ||
| 123 | try c.data.writeByte('\n'); | |
| 124 | } else unreachable; | |
| 125 | } | |
| 126 | ||
| 127 | fn emitValue(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void { | |
| 128 | switch (node.get(c.tree)) { | |
| 129 | .array_init_expr, | |
| 130 | .struct_init_expr, | |
| 131 | .union_init_expr, | |
| 132 | => return c.todo("Codegen multiple inits", node.tok(c.tree)), | |
| 133 | else => return c.emitSingleValue(qt, node), | |
| 134 | } | |
| 135 | } | |
| 136 | ||
| 137 | pub fn genAsm(tree: *const Tree) Error!Assembly { | |
| 138 | var data: std.Io.Writer.Allocating = .init(tree.comp.gpa); | |
| 139 | defer data.deinit(); | |
| 140 | ||
| 141 | var text: std.Io.Writer.Allocating = .init(tree.comp.gpa); | |
| 142 | defer text.deinit(); | |
| 143 | ||
| 144 | var codegen: AsmCodeGen = .{ | |
| 145 | .tree = tree, | |
| 146 | .comp = tree.comp, | |
| 147 | .text = &text.writer, | |
| 148 | .data = &data.writer, | |
| 149 | }; | |
| 150 | ||
| 151 | codegen.genDecls() catch |err| switch (err) { | |
| 152 | error.WriteFailed => return error.OutOfMemory, | |
| 153 | error.OutOfMemory => return error.OutOfMemory, | |
| 154 | error.FatalError => return error.FatalError, | |
| 155 | }; | |
| 156 | ||
| 157 | const text_slice = try text.toOwnedSlice(); | |
| 158 | errdefer tree.comp.gpa.free(text_slice); | |
| 159 | const data_slice = try data.toOwnedSlice(); | |
| 160 | return .{ | |
| 161 | .text = text_slice, | |
| 162 | .data = data_slice, | |
| 163 | }; | |
| 164 | } | |
| 165 | ||
| 166 | fn genDecls(c: *AsmCodeGen) !void { | |
| 167 | if (c.tree.comp.code_gen_options.debug != .strip) { | |
| 168 | const sources = c.tree.comp.sources.values(); | |
| 169 | for (sources) |source| { | |
| 170 | try c.data.print(" .file {d} \"{s}\"\n", .{ @intFromEnum(source.id) - 1, source.path }); | |
| 171 | } | |
| 172 | } | |
| 173 | ||
| 174 | for (c.tree.root_decls.items) |decl| { | |
| 175 | switch (decl.get(c.tree)) { | |
| 176 | .static_assert, | |
| 177 | .typedef, | |
| 178 | .struct_decl, | |
| 179 | .union_decl, | |
| 180 | .enum_decl, | |
| 181 | => {}, | |
| 182 | ||
| 183 | .function => |function| { | |
| 184 | if (function.body == null) continue; | |
| 185 | try c.genFn(function); | |
| 186 | }, | |
| 187 | ||
| 188 | .variable => |variable| try c.genVar(variable), | |
| 189 | ||
| 190 | else => unreachable, | |
| 191 | } | |
| 192 | } | |
| 193 | try c.text.writeAll(" .section .note.GNU-stack,\"\",@progbits\n"); | |
| 194 | } | |
| 195 | ||
| 196 | fn genFn(c: *AsmCodeGen, function: Node.Function) !void { | |
| 197 | return c.todo("Codegen functions", function.name_tok); | |
| 198 | } | |
| 199 | ||
| 200 | fn genVar(c: *AsmCodeGen, variable: Node.Variable) !void { | |
| 201 | const comp = c.comp; | |
| 202 | const qt = variable.qt; | |
| 203 | ||
| 204 | const is_tentative = variable.initializer == null; | |
| 205 | const size = qt.sizeofOrNull(comp) orelse blk: { | |
| 206 | // tentative array definition assumed to have one element | |
| 207 | std.debug.assert(is_tentative and qt.is(c.comp, .array)); | |
| 208 | break :blk qt.childType(c.comp).sizeof(comp); | |
| 209 | }; | |
| 210 | ||
| 211 | const name = c.tree.tokSlice(variable.name_tok); | |
| 212 | const nat_align = qt.alignof(comp); | |
| 213 | const alignment = if (qt.is(c.comp, .array) and size >= 16) @max(16, nat_align) else nat_align; | |
| 214 | ||
| 215 | if (variable.storage_class == .static) { | |
| 216 | try c.data.print(" .local \"{s}\"\n", .{name}); | |
| 217 | } else { | |
| 218 | try c.data.print(" .globl \"{s}\"\n", .{name}); | |
| 219 | } | |
| 220 | ||
| 221 | if (is_tentative and comp.code_gen_options.common) { | |
| 222 | try c.data.print(" .comm \"{s}\", {d}, {d}\n", .{ name, size, alignment }); | |
| 223 | return; | |
| 224 | } | |
| 225 | if (variable.initializer) |init| { | |
| 226 | if (variable.thread_local and comp.code_gen_options.data_sections) { | |
| 227 | try c.data.print(" .section .tdata.\"{s}\",\"awT\",@progbits\n", .{name}); | |
| 228 | } else if (variable.thread_local) { | |
| 229 | try c.data.writeAll(" .section .tdata,\"awT\",@progbits\n"); | |
| 230 | } else if (comp.code_gen_options.data_sections) { | |
| 231 | try c.data.print(" .section .data.\"{s}\",\"aw\",@progbits\n", .{name}); | |
| 232 | } else { | |
| 233 | try c.data.writeAll(" .data\n"); | |
| 234 | } | |
| 235 | ||
| 236 | try c.data.print(" .type \"{s}\", @object\n", .{name}); | |
| 237 | try c.data.print(" .size \"{s}\", {d}\n", .{ name, size }); | |
| 238 | try c.data.print(" .align {d}\n", .{alignment}); | |
| 239 | try c.data.print("\"{s}\":\n", .{name}); | |
| 240 | try c.emitValue(qt, init); | |
| 241 | return; | |
| 242 | } | |
| 243 | if (variable.thread_local and comp.code_gen_options.data_sections) { | |
| 244 | try c.data.print(" .section .tbss.\"{s}\",\"awT\",@nobits\n", .{name}); | |
| 245 | } else if (variable.thread_local) { | |
| 246 | try c.data.writeAll(" .section .tbss,\"awT\",@nobits\n"); | |
| 247 | } else if (comp.code_gen_options.data_sections) { | |
| 248 | try c.data.print(" .section .bss.\"{s}\",\"aw\",@nobits\n", .{name}); | |
| 249 | } else { | |
| 250 | try c.data.writeAll(" .bss\n"); | |
| 251 | } | |
| 252 | try c.data.print(" .align {d}\n", .{alignment}); | |
| 253 | try c.data.print("\"{s}\":\n", .{name}); | |
| 254 | try c.data.print(" .zero {d}\n", .{size}); | |
| 255 | } |
lib/compiler/aro/backend.zig+12-1| ... | ... | @@ -1,12 +1,23 @@ |
| 1 | pub const Assembly = @import("backend/Assembly.zig"); | |
| 2 | pub const CodeGenOptions = @import("backend/CodeGenOptions.zig"); | |
| 1 | 3 | pub const Interner = @import("backend/Interner.zig"); |
| 2 | 4 | pub const Ir = @import("backend/Ir.zig"); |
| 3 | 5 | pub const Object = @import("backend/Object.zig"); |
| 4 | 6 | |
| 5 | 7 | pub const CallingConvention = enum { |
| 6 | C, | |
| 8 | c, | |
| 7 | 9 | stdcall, |
| 8 | 10 | thiscall, |
| 9 | 11 | vectorcall, |
| 12 | fastcall, | |
| 13 | regcall, | |
| 14 | riscv_vector, | |
| 15 | aarch64_sve_pcs, | |
| 16 | aarch64_vector_pcs, | |
| 17 | arm_aapcs, | |
| 18 | arm_aapcs_vfp, | |
| 19 | x86_64_sysv, | |
| 20 | x86_64_win, | |
| 10 | 21 | }; |
| 11 | 22 | |
| 12 | 23 | pub const version_str = "aro-zig"; |
lib/compiler/aro/backend/Assembly.zig created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Allocator = std.mem.Allocator; | |
| 3 | ||
| 4 | data: []const u8, | |
| 5 | text: []const u8, | |
| 6 | ||
| 7 | const Assembly = @This(); | |
| 8 | ||
| 9 | pub fn deinit(self: *const Assembly, gpa: Allocator) void { | |
| 10 | gpa.free(self.data); | |
| 11 | gpa.free(self.text); | |
| 12 | } | |
| 13 | ||
| 14 | pub fn writeToFile(self: Assembly, file: std.fs.File) !void { | |
| 15 | var vec: [2]std.posix.iovec_const = .{ | |
| 16 | .{ .base = self.data.ptr, .len = self.data.len }, | |
| 17 | .{ .base = self.text.ptr, .len = self.text.len }, | |
| 18 | }; | |
| 19 | return file.writevAll(&vec); | |
| 20 | } |
lib/compiler/aro/backend/CodeGenOptions.zig created+94| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | /// place uninitialized global variables in a common block | |
| 4 | common: bool, | |
| 5 | /// Place each function into its own section in the output file if the target supports arbitrary sections | |
| 6 | func_sections: bool, | |
| 7 | /// Place each data item into its own section in the output file if the target supports arbitrary sections | |
| 8 | data_sections: bool, | |
| 9 | pic_level: PicLevel, | |
| 10 | /// Generate position-independent code that can only be linked into executables | |
| 11 | is_pie: bool, | |
| 12 | optimization_level: OptimizationLevel, | |
| 13 | /// Generate debug information | |
| 14 | debug: DebugFormat, | |
| 15 | dwarf_version: DwarfVersion, | |
| 16 | ||
| 17 | pub const DebugFormat = union(enum) { | |
| 18 | strip, | |
| 19 | dwarf: std.dwarf.Format, | |
| 20 | code_view, | |
| 21 | }; | |
| 22 | ||
| 23 | pub const DwarfVersion = enum(u3) { | |
| 24 | @"0" = 0, | |
| 25 | @"2" = 2, | |
| 26 | @"3" = 3, | |
| 27 | @"4" = 4, | |
| 28 | @"5" = 5, | |
| 29 | }; | |
| 30 | ||
| 31 | pub const PicLevel = enum(u8) { | |
| 32 | /// Do not generate position-independent code | |
| 33 | none = 0, | |
| 34 | /// Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine. | |
| 35 | one = 1, | |
| 36 | /// If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding | |
| 37 | /// any limit on the size of the global offset table. | |
| 38 | two = 2, | |
| 39 | }; | |
| 40 | ||
| 41 | pub const OptimizationLevel = enum { | |
| 42 | @"0", | |
| 43 | @"1", | |
| 44 | @"2", | |
| 45 | @"3", | |
| 46 | /// Optimize for size | |
| 47 | s, | |
| 48 | /// Disregard strict standards compliance | |
| 49 | fast, | |
| 50 | /// Optimize debugging experience | |
| 51 | g, | |
| 52 | /// Optimize aggressively for size rather than speed | |
| 53 | z, | |
| 54 | ||
| 55 | const level_map = std.StaticStringMap(OptimizationLevel).initComptime(.{ | |
| 56 | .{ "0", .@"0" }, | |
| 57 | .{ "1", .@"1" }, | |
| 58 | .{ "2", .@"2" }, | |
| 59 | .{ "3", .@"3" }, | |
| 60 | .{ "s", .s }, | |
| 61 | .{ "fast", .fast }, | |
| 62 | .{ "g", .g }, | |
| 63 | .{ "z", .z }, | |
| 64 | }); | |
| 65 | ||
| 66 | pub fn fromString(str: []const u8) ?OptimizationLevel { | |
| 67 | return level_map.get(str); | |
| 68 | } | |
| 69 | ||
| 70 | pub fn isSizeOptimized(self: OptimizationLevel) bool { | |
| 71 | return switch (self) { | |
| 72 | .s, .z => true, | |
| 73 | .@"0", .@"1", .@"2", .@"3", .fast, .g => false, | |
| 74 | }; | |
| 75 | } | |
| 76 | ||
| 77 | pub fn hasAnyOptimizations(self: OptimizationLevel) bool { | |
| 78 | return switch (self) { | |
| 79 | .@"0" => false, | |
| 80 | .@"1", .@"2", .@"3", .s, .fast, .g, .z => true, | |
| 81 | }; | |
| 82 | } | |
| 83 | }; | |
| 84 | ||
| 85 | pub const default: @This() = .{ | |
| 86 | .common = false, | |
| 87 | .func_sections = false, | |
| 88 | .data_sections = false, | |
| 89 | .pic_level = .none, | |
| 90 | .is_pie = false, | |
| 91 | .optimization_level = .@"0", | |
| 92 | .debug = .strip, | |
| 93 | .dwarf_version = .@"0", | |
| 94 | }; |
lib/compiler/aro/backend/Interner.zig+38-4| ... | ... | @@ -12,10 +12,10 @@ map: std.AutoArrayHashMapUnmanaged(void, void) = .empty, |
| 12 | 12 | items: std.MultiArrayList(struct { |
| 13 | 13 | tag: Tag, |
| 14 | 14 | data: u32, |
| 15 | }) = .{}, | |
| 16 | extra: std.ArrayListUnmanaged(u32) = .empty, | |
| 17 | limbs: std.ArrayListUnmanaged(Limb) = .empty, | |
| 18 | strings: std.ArrayListUnmanaged(u8) = .empty, | |
| 15 | }) = .empty, | |
| 16 | extra: std.ArrayList(u32) = .empty, | |
| 17 | limbs: std.ArrayList(Limb) = .empty, | |
| 18 | strings: std.ArrayList(u8) = .empty, | |
| 19 | 19 | |
| 20 | 20 | const KeyAdapter = struct { |
| 21 | 21 | interner: *const Interner, |
| ... | ... | @@ -65,6 +65,7 @@ pub const Key = union(enum) { |
| 65 | 65 | float: Float, |
| 66 | 66 | complex: Complex, |
| 67 | 67 | bytes: []const u8, |
| 68 | pointer: Pointer, | |
| 68 | 69 | |
| 69 | 70 | pub const Float = union(enum) { |
| 70 | 71 | f16: f16, |
| ... | ... | @@ -80,6 +81,12 @@ pub const Key = union(enum) { |
| 80 | 81 | cf80: [2]f80, |
| 81 | 82 | cf128: [2]f128, |
| 82 | 83 | }; |
| 84 | pub const Pointer = struct { | |
| 85 | /// NodeIndex of decl or compound literal whose address we are offsetting from | |
| 86 | node: u32, | |
| 87 | /// Offset in bytes | |
| 88 | offset: Ref, | |
| 89 | }; | |
| 83 | 90 | |
| 84 | 91 | pub fn hash(key: Key) u32 { |
| 85 | 92 | var hasher = Hash.init(0); |
| ... | ... | @@ -199,6 +206,10 @@ pub const Key = union(enum) { |
| 199 | 206 | } |
| 200 | 207 | return null; |
| 201 | 208 | } |
| 209 | ||
| 210 | pub fn toBigInt(key: Key, space: *Tag.Int.BigIntSpace) BigIntConst { | |
| 211 | return key.int.toBigInt(space); | |
| 212 | } | |
| 202 | 213 | }; |
| 203 | 214 | |
| 204 | 215 | pub const Ref = enum(u32) { |
| ... | ... | @@ -303,6 +314,8 @@ pub const Tag = enum(u8) { |
| 303 | 314 | bytes, |
| 304 | 315 | /// `data` is `Record` |
| 305 | 316 | record_ty, |
| 317 | /// `data` is Pointer | |
| 318 | pointer, | |
| 306 | 319 | |
| 307 | 320 | pub const Array = struct { |
| 308 | 321 | len0: u32, |
| ... | ... | @@ -322,6 +335,11 @@ pub const Tag = enum(u8) { |
| 322 | 335 | child: Ref, |
| 323 | 336 | }; |
| 324 | 337 | |
| 338 | pub const Pointer = struct { | |
| 339 | node: u32, | |
| 340 | offset: Ref, | |
| 341 | }; | |
| 342 | ||
| 325 | 343 | pub const Int = struct { |
| 326 | 344 | limbs_index: u32, |
| 327 | 345 | limbs_len: u32, |
| ... | ... | @@ -606,6 +624,15 @@ pub fn put(i: *Interner, gpa: Allocator, key: Key) !Ref { |
| 606 | 624 | }), |
| 607 | 625 | }); |
| 608 | 626 | }, |
| 627 | .pointer => |info| { | |
| 628 | i.items.appendAssumeCapacity(.{ | |
| 629 | .tag = .pointer, | |
| 630 | .data = try i.addExtra(gpa, Tag.Pointer{ | |
| 631 | .node = info.node, | |
| 632 | .offset = info.offset, | |
| 633 | }), | |
| 634 | }); | |
| 635 | }, | |
| 609 | 636 | .int => |repr| int: { |
| 610 | 637 | var space: Tag.Int.BigIntSpace = undefined; |
| 611 | 638 | const big = repr.toBigInt(&space); |
| ... | ... | @@ -792,6 +819,13 @@ pub fn get(i: *const Interner, ref: Ref) Key { |
| 792 | 819 | .child = vector_ty.child, |
| 793 | 820 | } }; |
| 794 | 821 | }, |
| 822 | .pointer => { | |
| 823 | const pointer = i.extraData(Tag.Pointer, data); | |
| 824 | return .{ .pointer = .{ | |
| 825 | .node = pointer.node, | |
| 826 | .offset = pointer.offset, | |
| 827 | } }; | |
| 828 | }, | |
| 795 | 829 | .u32 => .{ .int = .{ .u64 = data } }, |
| 796 | 830 | .i32 => .{ .int = .{ .i64 = @as(i32, @bitCast(data)) } }, |
| 797 | 831 | .int_positive, .int_negative => { |
lib/compiler/aro/backend/Ir.zig+27-26| ... | ... | @@ -11,7 +11,7 @@ decls: std.StringArrayHashMapUnmanaged(Decl), |
| 11 | 11 | |
| 12 | 12 | pub const Decl = struct { |
| 13 | 13 | instructions: std.MultiArrayList(Inst), |
| 14 | body: std.ArrayListUnmanaged(Ref), | |
| 14 | body: std.ArrayList(Ref), | |
| 15 | 15 | arena: std.heap.ArenaAllocator.State, |
| 16 | 16 | |
| 17 | 17 | pub fn deinit(decl: *Decl, gpa: Allocator) void { |
| ... | ... | @@ -27,8 +27,8 @@ pub const Builder = struct { |
| 27 | 27 | interner: *Interner, |
| 28 | 28 | |
| 29 | 29 | decls: std.StringArrayHashMapUnmanaged(Decl) = .empty, |
| 30 | instructions: std.MultiArrayList(Ir.Inst) = .{}, | |
| 31 | body: std.ArrayListUnmanaged(Ref) = .empty, | |
| 30 | instructions: std.MultiArrayList(Ir.Inst) = .empty, | |
| 31 | body: std.ArrayList(Ref) = .empty, | |
| 32 | 32 | alloc_count: u32 = 0, |
| 33 | 33 | arg_count: u32 = 0, |
| 34 | 34 | current_label: Ref = undefined, |
| ... | ... | @@ -380,23 +380,24 @@ const REF = std.Io.tty.Color.bright_blue; |
| 380 | 380 | const LITERAL = std.Io.tty.Color.bright_green; |
| 381 | 381 | const ATTRIBUTE = std.Io.tty.Color.bright_yellow; |
| 382 | 382 | |
| 383 | const RefMap = std.AutoArrayHashMap(Ref, void); | |
| 383 | const RefMap = std.AutoArrayHashMapUnmanaged(Ref, void); | |
| 384 | 384 | |
| 385 | pub fn dump(ir: *const Ir, gpa: Allocator, config: std.Io.tty.Config, w: anytype) !void { | |
| 385 | pub fn dump(ir: *const Ir, gpa: Allocator, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 386 | 386 | for (ir.decls.keys(), ir.decls.values()) |name, *decl| { |
| 387 | 387 | try ir.dumpDecl(decl, gpa, name, config, w); |
| 388 | 388 | } |
| 389 | try w.flush(); | |
| 389 | 390 | } |
| 390 | 391 | |
| 391 | fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, config: std.Io.tty.Config, w: anytype) !void { | |
| 392 | fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 392 | 393 | const tags = decl.instructions.items(.tag); |
| 393 | 394 | const data = decl.instructions.items(.data); |
| 394 | 395 | |
| 395 | var ref_map = RefMap.init(gpa); | |
| 396 | defer ref_map.deinit(); | |
| 396 | var ref_map: RefMap = .empty; | |
| 397 | defer ref_map.deinit(gpa); | |
| 397 | 398 | |
| 398 | var label_map = RefMap.init(gpa); | |
| 399 | defer label_map.deinit(); | |
| 399 | var label_map: RefMap = .empty; | |
| 400 | defer label_map.deinit(gpa); | |
| 400 | 401 | |
| 401 | 402 | const ret_inst = decl.body.items[decl.body.items.len - 1]; |
| 402 | 403 | 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, |
| 412 | 413 | const ref = decl.body.items[arg_count]; |
| 413 | 414 | if (tags[@intFromEnum(ref)] != .arg) break; |
| 414 | 415 | if (arg_count != 0) try w.writeAll(", "); |
| 415 | try ref_map.put(ref, {}); | |
| 416 | try ref_map.put(gpa, ref, {}); | |
| 416 | 417 | try ir.writeRef(decl, &ref_map, ref, config, w); |
| 417 | 418 | try config.setColor(w, .reset); |
| 418 | 419 | } |
| 419 | 420 | try w.writeAll(") {\n"); |
| 420 | 421 | for (decl.body.items[arg_count..]) |ref| { |
| 421 | 422 | switch (tags[@intFromEnum(ref)]) { |
| 422 | .label => try label_map.put(ref, {}), | |
| 423 | .label => try label_map.put(gpa, ref, {}), | |
| 423 | 424 | else => {}, |
| 424 | 425 | } |
| 425 | 426 | } |
| ... | ... | @@ -460,7 +461,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 460 | 461 | }, |
| 461 | 462 | .select => { |
| 462 | 463 | const br = data[i].branch; |
| 463 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 464 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 464 | 465 | try w.writeAll("select "); |
| 465 | 466 | try ir.writeRef(decl, &ref_map, br.cond, config, w); |
| 466 | 467 | try config.setColor(w, .reset); |
| ... | ... | @@ -500,7 +501,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 500 | 501 | }, |
| 501 | 502 | .call => { |
| 502 | 503 | const call = data[i].call; |
| 503 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 504 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 504 | 505 | try w.writeAll("call "); |
| 505 | 506 | try ir.writeRef(decl, &ref_map, call.func, config, w); |
| 506 | 507 | try config.setColor(w, .reset); |
| ... | ... | @@ -514,7 +515,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 514 | 515 | }, |
| 515 | 516 | .alloc => { |
| 516 | 517 | const alloc = data[i].alloc; |
| 517 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 518 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 518 | 519 | try w.writeAll("alloc "); |
| 519 | 520 | try config.setColor(w, ATTRIBUTE); |
| 520 | 521 | try w.writeAll("size "); |
| ... | ... | @@ -527,7 +528,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 527 | 528 | try w.writeByte('\n'); |
| 528 | 529 | }, |
| 529 | 530 | .phi => { |
| 530 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 531 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 531 | 532 | try w.writeAll("phi"); |
| 532 | 533 | try config.setColor(w, .reset); |
| 533 | 534 | try w.writeAll(" {"); |
| ... | ... | @@ -559,7 +560,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 559 | 560 | try w.writeByte('\n'); |
| 560 | 561 | }, |
| 561 | 562 | .load => { |
| 562 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 563 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 563 | 564 | try w.writeAll("load "); |
| 564 | 565 | try ir.writeRef(decl, &ref_map, data[i].un, config, w); |
| 565 | 566 | try w.writeByte('\n'); |
| ... | ... | @@ -582,7 +583,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 582 | 583 | .mod, |
| 583 | 584 | => { |
| 584 | 585 | const bin = data[i].bin; |
| 585 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 586 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 586 | 587 | try w.print("{s} ", .{@tagName(tag)}); |
| 587 | 588 | try ir.writeRef(decl, &ref_map, bin.lhs, config, w); |
| 588 | 589 | try config.setColor(w, .reset); |
| ... | ... | @@ -597,7 +598,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 597 | 598 | .sext, |
| 598 | 599 | => { |
| 599 | 600 | const un = data[i].un; |
| 600 | try ir.writeNewRef(decl, &ref_map, ref, config, w); | |
| 601 | try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); | |
| 601 | 602 | try w.print("{s} ", .{@tagName(tag)}); |
| 602 | 603 | try ir.writeRef(decl, &ref_map, un, config, w); |
| 603 | 604 | try w.writeByte('\n'); |
| ... | ... | @@ -609,7 +610,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, |
| 609 | 610 | try w.writeAll("}\n\n"); |
| 610 | 611 | } |
| 611 | 612 | |
| 612 | fn writeType(ir: Ir, ty_ref: Interner.Ref, config: std.Io.tty.Config, w: anytype) !void { | |
| 613 | fn writeType(ir: Ir, ty_ref: Interner.Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 613 | 614 | const ty = ir.interner.get(ty_ref); |
| 614 | 615 | try config.setColor(w, TYPE); |
| 615 | 616 | switch (ty) { |
| ... | ... | @@ -639,7 +640,7 @@ fn writeType(ir: Ir, ty_ref: Interner.Ref, config: std.Io.tty.Config, w: anytype |
| 639 | 640 | } |
| 640 | 641 | } |
| 641 | 642 | |
| 642 | fn writeValue(ir: Ir, val: Interner.Ref, config: std.Io.tty.Config, w: anytype) !void { | |
| 643 | fn writeValue(ir: Ir, val: Interner.Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 643 | 644 | try config.setColor(w, LITERAL); |
| 644 | 645 | const key = ir.interner.get(val); |
| 645 | 646 | switch (key) { |
| ... | ... | @@ -650,12 +651,12 @@ fn writeValue(ir: Ir, val: Interner.Ref, config: std.Io.tty.Config, w: anytype) |
| 650 | 651 | .float => |repr| switch (repr) { |
| 651 | 652 | inline else => |x| return w.print("{d}", .{@as(f64, @floatCast(x))}), |
| 652 | 653 | }, |
| 653 | .bytes => |b| return std.zig.stringEscape(b, "", .{}, w), | |
| 654 | .bytes => |b| return std.zig.stringEscape(b, w), | |
| 654 | 655 | else => unreachable, // not a value |
| 655 | 656 | } |
| 656 | 657 | } |
| 657 | 658 | |
| 658 | fn writeRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: anytype) !void { | |
| 659 | fn writeRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 659 | 660 | assert(ref != .none); |
| 660 | 661 | const index = @intFromEnum(ref); |
| 661 | 662 | 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 |
| 678 | 679 | try w.print(" %{d}", .{ref_index}); |
| 679 | 680 | } |
| 680 | 681 | |
| 681 | fn writeNewRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: anytype) !void { | |
| 682 | try ref_map.put(ref, {}); | |
| 682 | fn writeNewRef(ir: Ir, gpa: Allocator, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 683 | try ref_map.put(gpa, ref, {}); | |
| 683 | 684 | try w.writeAll(" "); |
| 684 | 685 | try ir.writeRef(decl, ref_map, ref, config, w); |
| 685 | 686 | try config.setColor(w, .reset); |
| ... | ... | @@ -687,7 +688,7 @@ fn writeNewRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: st |
| 687 | 688 | try config.setColor(w, INST); |
| 688 | 689 | } |
| 689 | 690 | |
| 690 | fn writeLabel(decl: *const Decl, label_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: anytype) !void { | |
| 691 | fn writeLabel(decl: *const Decl, label_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { | |
| 691 | 692 | assert(ref != .none); |
| 692 | 693 | const index = @intFromEnum(ref); |
| 693 | 694 | const label = decl.instructions.items(.data)[index].label; |
lib/compiler/aro/backend/Object.zig+3-3| ... | ... | @@ -30,7 +30,7 @@ pub const Section = union(enum) { |
| 30 | 30 | custom: []const u8, |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | pub fn getSection(obj: *Object, section: Section) !*std.array_list.Managed(u8) { | |
| 33 | pub fn getSection(obj: *Object, section: Section) !*std.ArrayList(u8) { | |
| 34 | 34 | switch (obj.format) { |
| 35 | 35 | .elf => return @as(*Elf, @alignCast(@fieldParentPtr("obj", obj))).getSection(section), |
| 36 | 36 | else => unreachable, |
| ... | ... | @@ -65,9 +65,9 @@ pub fn addRelocation(obj: *Object, name: []const u8, section: Section, address: |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | pub fn finish(obj: *Object, file: std.fs.File) !void { | |
| 68 | pub fn finish(obj: *Object, w: *std.Io.Writer) !void { | |
| 69 | 69 | switch (obj.format) { |
| 70 | .elf => return @as(*Elf, @alignCast(@fieldParentPtr("obj", obj))).finish(file), | |
| 70 | .elf => return @as(*Elf, @alignCast(@fieldParentPtr("obj", obj))).finish(w), | |
| 71 | 71 | else => unreachable, |
| 72 | 72 | } |
| 73 | 73 | } |
lib/compiler/aro/backend/Object/Elf.zig+23-26| ... | ... | @@ -4,8 +4,8 @@ const Target = std.Target; |
| 4 | 4 | const Object = @import("../Object.zig"); |
| 5 | 5 | |
| 6 | 6 | const Section = struct { |
| 7 | data: std.array_list.Managed(u8), | |
| 8 | relocations: std.ArrayListUnmanaged(Relocation) = .empty, | |
| 7 | data: std.ArrayList(u8) = .empty, | |
| 8 | relocations: std.ArrayList(Relocation) = .empty, | |
| 9 | 9 | flags: u64, |
| 10 | 10 | type: u32, |
| 11 | 11 | index: u16 = undefined, |
| ... | ... | @@ -58,7 +58,7 @@ pub fn deinit(elf: *Elf) void { |
| 58 | 58 | { |
| 59 | 59 | var it = elf.sections.valueIterator(); |
| 60 | 60 | while (it.next()) |sect| { |
| 61 | sect.*.data.deinit(); | |
| 61 | sect.*.data.deinit(gpa); | |
| 62 | 62 | sect.*.relocations.deinit(gpa); |
| 63 | 63 | } |
| 64 | 64 | } |
| ... | ... | @@ -80,12 +80,12 @@ fn sectionString(sec: Object.Section) []const u8 { |
| 80 | 80 | }; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | pub fn getSection(elf: *Elf, section_kind: Object.Section) !*std.array_list.Managed(u8) { | |
| 83 | pub fn getSection(elf: *Elf, section_kind: Object.Section) !*std.ArrayList(u8) { | |
| 84 | 84 | const section_name = sectionString(section_kind); |
| 85 | 85 | const section = elf.sections.get(section_name) orelse blk: { |
| 86 | 86 | const section = try elf.arena.allocator().create(Section); |
| 87 | 87 | section.* = .{ |
| 88 | .data = std.array_list.Managed(u8).init(elf.arena.child_allocator), | |
| 88 | .data = std.ArrayList(u8).init(elf.arena.child_allocator), | |
| 89 | 89 | .type = std.elf.SHT_PROGBITS, |
| 90 | 90 | .flags = switch (section_kind) { |
| 91 | 91 | .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, |
| 170 | 170 | /// relocations |
| 171 | 171 | /// strtab |
| 172 | 172 | /// section headers |
| 173 | pub fn finish(elf: *Elf, file: std.fs.File) !void { | |
| 174 | var file_buffer: [1024]u8 = undefined; | |
| 175 | var file_writer = file.writer(&file_buffer); | |
| 176 | const w = &file_writer.interface; | |
| 177 | ||
| 178 | var num_sections: std.elf.Elf64_Half = additional_sections; | |
| 173 | pub fn finish(elf: *Elf, w: *std.Io.Writer) !void { | |
| 174 | var num_sections: std.elf.Half = additional_sections; | |
| 179 | 175 | var relocations_len: std.elf.Elf64_Off = 0; |
| 180 | 176 | var sections_len: std.elf.Elf64_Off = 0; |
| 181 | 177 | { |
| ... | ... | @@ -196,8 +192,9 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 196 | 192 | const strtab_offset = rela_offset + relocations_len; |
| 197 | 193 | const sh_offset = strtab_offset + elf.strtab_len; |
| 198 | 194 | const sh_offset_aligned = std.mem.alignForward(u64, sh_offset, 16); |
| 195 | const endian = elf.obj.target.cpu.arch.endian(); | |
| 199 | 196 | |
| 200 | const elf_header = std.elf.Elf64_Ehdr{ | |
| 197 | const elf_header: std.elf.Elf64_Ehdr = .{ | |
| 201 | 198 | .e_ident = .{ 0x7F, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 202 | 199 | .e_type = std.elf.ET.REL, // we only produce relocatables |
| 203 | 200 | .e_machine = elf.obj.target.toElfMachine(), |
| ... | ... | @@ -213,7 +210,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 213 | 210 | .e_shnum = num_sections, |
| 214 | 211 | .e_shstrndx = strtab_index, |
| 215 | 212 | }; |
| 216 | try w.writeStruct(elf_header); | |
| 213 | try w.writeStruct(elf_header, endian); | |
| 217 | 214 | |
| 218 | 215 | // write contents of sections |
| 219 | 216 | { |
| ... | ... | @@ -222,13 +219,13 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 222 | 219 | } |
| 223 | 220 | |
| 224 | 221 | // pad to 8 bytes |
| 225 | try w.writeByteNTimes(0, @intCast(symtab_offset_aligned - symtab_offset)); | |
| 222 | try w.splatByteAll(0, @intCast(symtab_offset_aligned - symtab_offset)); | |
| 226 | 223 | |
| 227 | 224 | var name_offset: u32 = strtab_default.len; |
| 228 | 225 | // write symbols |
| 229 | 226 | { |
| 230 | 227 | // first symbol must be null |
| 231 | try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Sym)); | |
| 228 | try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Sym), endian); | |
| 232 | 229 | |
| 233 | 230 | var sym_index: u16 = 1; |
| 234 | 231 | var it = elf.local_symbols.iterator(); |
| ... | ... | @@ -241,7 +238,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 241 | 238 | .st_shndx = if (sym.section) |some| some.index else 0, |
| 242 | 239 | .st_value = sym.offset, |
| 243 | 240 | .st_size = sym.size, |
| 244 | }); | |
| 241 | }, endian); | |
| 245 | 242 | sym.index = sym_index; |
| 246 | 243 | sym_index += 1; |
| 247 | 244 | 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 { |
| 256 | 253 | .st_shndx = if (sym.section) |some| some.index else 0, |
| 257 | 254 | .st_value = sym.offset, |
| 258 | 255 | .st_size = sym.size, |
| 259 | }); | |
| 256 | }, endian); | |
| 260 | 257 | sym.index = sym_index; |
| 261 | 258 | sym_index += 1; |
| 262 | 259 | 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 { |
| 272 | 269 | .r_offset = rela.offset, |
| 273 | 270 | .r_addend = rela.addend, |
| 274 | 271 | .r_info = (@as(u64, rela.symbol.index) << 32) | rela.type, |
| 275 | }); | |
| 272 | }, endian); | |
| 276 | 273 | } |
| 277 | 274 | } |
| 278 | 275 | } |
| ... | ... | @@ -294,13 +291,13 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 294 | 291 | } |
| 295 | 292 | |
| 296 | 293 | // pad to 16 bytes |
| 297 | try w.writeByteNTimes(0, @intCast(sh_offset_aligned - sh_offset)); | |
| 294 | try w.splatByteAll(0, @intCast(sh_offset_aligned - sh_offset)); | |
| 298 | 295 | // mandatory null header |
| 299 | try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Shdr)); | |
| 296 | try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Shdr), endian); | |
| 300 | 297 | |
| 301 | 298 | // write strtab section header |
| 302 | 299 | { |
| 303 | const sect_header = std.elf.Elf64_Shdr{ | |
| 300 | const sect_header: std.elf.Elf64_Shdr = .{ | |
| 304 | 301 | .sh_name = strtab_name, |
| 305 | 302 | .sh_type = std.elf.SHT_STRTAB, |
| 306 | 303 | .sh_flags = 0, |
| ... | ... | @@ -312,12 +309,12 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 312 | 309 | .sh_addralign = 1, |
| 313 | 310 | .sh_entsize = 0, |
| 314 | 311 | }; |
| 315 | try w.writeStruct(sect_header); | |
| 312 | try w.writeStruct(sect_header, endian); | |
| 316 | 313 | } |
| 317 | 314 | |
| 318 | 315 | // write symtab section header |
| 319 | 316 | { |
| 320 | const sect_header = std.elf.Elf64_Shdr{ | |
| 317 | const sect_header: std.elf.Elf64_Shdr = .{ | |
| 321 | 318 | .sh_name = symtab_name, |
| 322 | 319 | .sh_type = std.elf.SHT_SYMTAB, |
| 323 | 320 | .sh_flags = 0, |
| ... | ... | @@ -329,7 +326,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 329 | 326 | .sh_addralign = 8, |
| 330 | 327 | .sh_entsize = @sizeOf(std.elf.Elf64_Sym), |
| 331 | 328 | }; |
| 332 | try w.writeStruct(sect_header); | |
| 329 | try w.writeStruct(sect_header, endian); | |
| 333 | 330 | } |
| 334 | 331 | |
| 335 | 332 | // remaining section headers |
| ... | ... | @@ -352,7 +349,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 352 | 349 | .sh_info = 0, |
| 353 | 350 | .sh_addralign = if (sect.flags & std.elf.SHF_EXECINSTR != 0) 16 else 1, |
| 354 | 351 | .sh_entsize = 0, |
| 355 | }); | |
| 352 | }, endian); | |
| 356 | 353 | |
| 357 | 354 | if (rela_count != 0) { |
| 358 | 355 | const size = rela_count * @sizeOf(std.elf.Elf64_Rela); |
| ... | ... | @@ -367,7 +364,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { |
| 367 | 364 | .sh_info = sect.index, |
| 368 | 365 | .sh_addralign = 8, |
| 369 | 366 | .sh_entsize = @sizeOf(std.elf.Elf64_Rela), |
| 370 | }); | |
| 367 | }, endian); | |
| 371 | 368 | rela_sect_offset += size; |
| 372 | 369 | } |
| 373 | 370 |
lib/compiler/aro/include/float.h created+126| ... | ... | @@ -0,0 +1,126 @@ |
| 1 | /* <float.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #undef FLT_RADIX | |
| 6 | #define FLT_RADIX __FLT_RADIX__ | |
| 7 | ||
| 8 | #undef FLT_MANT_DIG | |
| 9 | #define FLT_MANT_DIG __FLT_MANT_DIG__ | |
| 10 | ||
| 11 | #undef DBL_MANT_DIG | |
| 12 | #define DBL_MANT_DIG __DBL_MANT_DIG__ | |
| 13 | ||
| 14 | #undef LDBL_MANT_DIG | |
| 15 | #define LDBL_MANT_DIG __LDBL_MANT_DIG__ | |
| 16 | ||
| 17 | #if __STDC_VERSION__ >= 199901L | |
| 18 | #undef FLT_EVAL_METHOD | |
| 19 | #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ | |
| 20 | ||
| 21 | #undef DECIMAL_DIG | |
| 22 | #define DECIMAL_DIG __DECIMAL_DIG__ | |
| 23 | #endif /* __STDC_VERSION__ >= 199901L */ | |
| 24 | ||
| 25 | #undef FLT_DIG | |
| 26 | #define FLT_DIG __FLT_DIG__ | |
| 27 | ||
| 28 | #undef DBL_DIG | |
| 29 | #define DBL_DIG __DBL_DIG__ | |
| 30 | ||
| 31 | #undef LDBL_DIG | |
| 32 | #define LDBL_DIG __LDBL_DIG__ | |
| 33 | ||
| 34 | #undef FLT_MIN_EXP | |
| 35 | #define FLT_MIN_EXP __FLT_MIN_EXP__ | |
| 36 | ||
| 37 | #undef DBL_MIN_EXP | |
| 38 | #define DBL_MIN_EXP __DBL_MIN_EXP__ | |
| 39 | ||
| 40 | #undef LDBL_MIN_EXP | |
| 41 | #define LDBL_MIN_EXP __LDBL_MIN_EXP__ | |
| 42 | ||
| 43 | #undef FLT_MIN_10_EXP | |
| 44 | #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ | |
| 45 | ||
| 46 | #undef DBL_MIN_10_EXP | |
| 47 | #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ | |
| 48 | ||
| 49 | #undef LDBL_MIN_10_EXP | |
| 50 | #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ | |
| 51 | ||
| 52 | #undef FLT_MAX_EXP | |
| 53 | #define FLT_MAX_EXP __FLT_MAX_EXP__ | |
| 54 | ||
| 55 | #undef DBL_MAX_EXP | |
| 56 | #define DBL_MAX_EXP __DBL_MAX_EXP__ | |
| 57 | ||
| 58 | #undef LDBL_MAX_EXP | |
| 59 | #define LDBL_MAX_EXP __LDBL_MAX_EXP__ | |
| 60 | ||
| 61 | #undef FLT_MAX_10_EXP | |
| 62 | #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ | |
| 63 | ||
| 64 | #undef DBL_MAX_10_EXP | |
| 65 | #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ | |
| 66 | ||
| 67 | #undef LDBL_MAX_10_EXP | |
| 68 | #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ | |
| 69 | ||
| 70 | #undef FLT_MAX | |
| 71 | #define FLT_MAX __FLT_MAX__ | |
| 72 | ||
| 73 | #undef DBL_MAX | |
| 74 | #define DBL_MAX __DBL_MAX__ | |
| 75 | ||
| 76 | #undef LDBL_MAX | |
| 77 | #define LDBL_MAX __LDBL_MAX__ | |
| 78 | ||
| 79 | #undef FLT_EPSILON | |
| 80 | #define FLT_EPSILON __FLT_EPSILON__ | |
| 81 | ||
| 82 | #undef DBL_EPSILON | |
| 83 | #define DBL_EPSILON __DBL_EPSILON__ | |
| 84 | ||
| 85 | #undef LDBL_EPSILON | |
| 86 | #define LDBL_EPSILON __LDBL_EPSILON__ | |
| 87 | ||
| 88 | #undef FLT_MIN | |
| 89 | #define FLT_MIN __FLT_MIN__ | |
| 90 | ||
| 91 | #undef DBL_MIN | |
| 92 | #define DBL_MIN __DBL_MIN__ | |
| 93 | ||
| 94 | #undef LDBL_MIN | |
| 95 | #define LDBL_MIN __LDBL_MIN__ | |
| 96 | ||
| 97 | #if __STDC_VERSION__ >= 201112L | |
| 98 | ||
| 99 | #undef FLT_TRUE_MIN | |
| 100 | #define FLT_TRUE_MIN __FLT_DENORM_MIN__ | |
| 101 | ||
| 102 | #undef DBL_TRUE_MIN | |
| 103 | #define DBL_TRUE_MIN __DBL_DENORM_MIN__ | |
| 104 | ||
| 105 | #undef LDBL_TRUE_MIN | |
| 106 | #define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ | |
| 107 | ||
| 108 | #undef FLT_DECIMAL_DIG | |
| 109 | #define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__ | |
| 110 | ||
| 111 | #undef DBL_DECIMAL_DIG | |
| 112 | #define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__ | |
| 113 | ||
| 114 | #undef LDBL_DECIMAL_DIG | |
| 115 | #define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__ | |
| 116 | ||
| 117 | #undef FLT_HAS_SUBNORM | |
| 118 | #define FLT_HAS_SUBNORM __FLT_HAS_DENORM__ | |
| 119 | ||
| 120 | #undef DBL_HAS_SUBNORM | |
| 121 | #define DBL_HAS_SUBNORM __DBL_HAS_DENORM__ | |
| 122 | ||
| 123 | #undef LDBL_HAS_SUBNORM | |
| 124 | #define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ | |
| 125 | ||
| 126 | #endif /* __STDC_VERSION__ >= 201112L */ |
lib/compiler/aro/include/iso646.h created+15| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | /* <iso646.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #define and && | |
| 6 | #define and_eq &= | |
| 7 | #define bitand & | |
| 8 | #define bitor | | |
| 9 | #define compl ~ | |
| 10 | #define not ! | |
| 11 | #define not_eq != | |
| 12 | #define or || | |
| 13 | #define or_eq |= | |
| 14 | #define xor ^ | |
| 15 | #define xor_eq ^= |
lib/compiler/aro/include/limits.h created+124| ... | ... | @@ -0,0 +1,124 @@ |
| 1 | /* <limits.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | /* GlibC will try to include_next GCC's limits.h which will fail. | |
| 6 | Define _GCC_LIMITS_H_ to prevent it. */ | |
| 7 | #if defined __GNUC__ && !defined _GCC_LIMITS_H_ | |
| 8 | #define _GCC_LIMITS_H_ | |
| 9 | #endif | |
| 10 | ||
| 11 | /* Include the system's limits.h */ | |
| 12 | #if __STDC_HOSTED__ && __has_include_next(<limits.h>) | |
| 13 | #include_next <limits.h> | |
| 14 | #endif | |
| 15 | ||
| 16 | #undef SCHAR_MAX | |
| 17 | #define SCHAR_MAX __SCHAR_MAX__ | |
| 18 | ||
| 19 | #undef SHRT_MAX | |
| 20 | #define SHRT_MAX __SHRT_MAX__ | |
| 21 | ||
| 22 | #undef INT_MAX | |
| 23 | #define INT_MAX __INT_MAX__ | |
| 24 | ||
| 25 | #undef LONG_MAX | |
| 26 | #define LONG_MAX __LONG_MAX__ | |
| 27 | ||
| 28 | #undef SCHAR_MIN | |
| 29 | #define SCHAR_MIN (-__SCHAR_MAX__-1) | |
| 30 | ||
| 31 | #undef SHRT_MIN | |
| 32 | #define SHRT_MIN (-__SHRT_MAX__ -1) | |
| 33 | ||
| 34 | #undef INT_MIN | |
| 35 | #define INT_MIN (-__INT_MAX__ -1) | |
| 36 | ||
| 37 | #undef LONG_MIN | |
| 38 | #define LONG_MIN (-__LONG_MAX__ -1L) | |
| 39 | ||
| 40 | #undef UCHAR_MAX | |
| 41 | #define UCHAR_MAX (__SCHAR_MAX__*2 +1) | |
| 42 | ||
| 43 | #undef USHRT_MAX | |
| 44 | #define USHRT_MAX (__SHRT_MAX__ *2 +1) | |
| 45 | ||
| 46 | #undef UINT_MAX | |
| 47 | #define UINT_MAX (__INT_MAX__ *2U +1U) | |
| 48 | ||
| 49 | #undef ULONG_MAX | |
| 50 | #define ULONG_MAX (__LONG_MAX__ *2UL+1UL) | |
| 51 | ||
| 52 | #ifndef MB_LEN_MAX | |
| 53 | #define MB_LEN_MAX 1 | |
| 54 | #endif | |
| 55 | ||
| 56 | #undef CHAR_BIT | |
| 57 | #define CHAR_BIT __CHAR_BIT__ | |
| 58 | ||
| 59 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 60 | ||
| 61 | #undef BOOL_WIDTH | |
| 62 | #define BOOL_WIDTH __BOOL_WIDTH__ | |
| 63 | ||
| 64 | #undef CHAR_WIDTH | |
| 65 | #define CHAR_WIDTH CHAR_BIT | |
| 66 | ||
| 67 | #undef SCHAR_WIDTH | |
| 68 | #define SCHAR_WIDTH CHAR_BIT | |
| 69 | ||
| 70 | #undef UCHAR_WIDTH | |
| 71 | #define UCHAR_WIDTH CHAR_BIT | |
| 72 | ||
| 73 | #undef USHRT_WIDTH | |
| 74 | #define USHRT_WIDTH __SHRT_WIDTH__ | |
| 75 | ||
| 76 | #undef SHRT_WIDTH | |
| 77 | #define SHRT_WIDTH __SHRT_WIDTH__ | |
| 78 | ||
| 79 | #undef UINT_WIDTH | |
| 80 | #define UINT_WIDTH __INT_WIDTH__ | |
| 81 | ||
| 82 | #undef INT_WIDTH | |
| 83 | #define INT_WIDTH __INT_WIDTH__ | |
| 84 | ||
| 85 | #undef ULONG_WIDTH | |
| 86 | #define ULONG_WIDTH __LONG_WIDTH__ | |
| 87 | ||
| 88 | #undef LONG_WIDTH | |
| 89 | #define LONG_WIDTH __LONG_WIDTH__ | |
| 90 | ||
| 91 | #undef ULLONG_WIDTH | |
| 92 | #define ULLONG_WIDTH __LLONG_WIDTH__ | |
| 93 | ||
| 94 | #undef LLONG_WIDTH | |
| 95 | #define LLONG_WIDTH __LLONG_WIDTH__ | |
| 96 | ||
| 97 | #undef BITINT_MAXWIDTH | |
| 98 | #define BITINT_MAXWIDTH __BITINT_MAXWIDTH__ | |
| 99 | ||
| 100 | #endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L */ | |
| 101 | ||
| 102 | #undef CHAR_MIN | |
| 103 | #undef CHAR_MAX | |
| 104 | #ifdef __CHAR_UNSIGNED__ | |
| 105 | #define CHAR_MIN 0 | |
| 106 | #define CHAR_MAX UCHAR_MAX | |
| 107 | #else | |
| 108 | #define CHAR_MIN SCHAR_MIN | |
| 109 | #define CHAR_MAX __SCHAR_MAX__ | |
| 110 | #endif | |
| 111 | ||
| 112 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
| 113 | ||
| 114 | #undef LLONG_MIN | |
| 115 | #define LLONG_MIN (-__LONG_LONG_MAX__-1LL) | |
| 116 | ||
| 117 | #undef LLONG_MAX | |
| 118 | #define LLONG_MAX __LONG_LONG_MAX__ | |
| 119 | ||
| 120 | #undef ULLONG_MAX | |
| 121 | #define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL) | |
| 122 | ||
| 123 | #endif | |
| 124 |
lib/compiler/aro/include/stdalign.h created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | /* <stdalign.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | #if __STDC_VERSION__ < 202311L | |
| 5 | ||
| 6 | #define alignas _Alignas | |
| 7 | #define alignof _Alignof | |
| 8 | ||
| 9 | #define __alignas_is_defined 1 | |
| 10 | #define __alignof_is_defined 1 | |
| 11 | #endif |
lib/compiler/aro/include/stdarg.h created+28| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | /* <stdarg.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | /* Todo: Set to 202311L once header is compliant with C23 */ | |
| 5 | #define __STDC_VERSION_STDARG_H__ 0 | |
| 6 | ||
| 7 | typedef __builtin_va_list va_list; | |
| 8 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L | |
| 9 | /* C23 no longer requires the second parameter */ | |
| 10 | #define va_start(ap, ...) __builtin_va_start(ap, __VA_ARGS__) | |
| 11 | #else | |
| 12 | #define va_start(ap, param) __builtin_va_start(ap, param) | |
| 13 | #endif | |
| 14 | #define va_end(ap) __builtin_va_end(ap) | |
| 15 | #define va_arg(ap, type) __builtin_va_arg(ap, type) | |
| 16 | ||
| 17 | /* GCC and Clang always define __va_copy */ | |
| 18 | #define __va_copy(d, s) __builtin_va_copy(d, s) | |
| 19 | ||
| 20 | /* but va_copy only on c99+ or when strict ansi mode is turned off */ | |
| 21 | #if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) | |
| 22 | #define va_copy(d, s) __builtin_va_copy(d, s) | |
| 23 | #endif | |
| 24 | ||
| 25 | #ifndef __GNUC_VA_LIST | |
| 26 | #define __GNUC_VA_LIST 1 | |
| 27 | typedef __builtin_va_list __gnuc_va_list; | |
| 28 | #endif |
lib/compiler/aro/include/stdatomic.h created+138| ... | ... | @@ -0,0 +1,138 @@ |
| 1 | /* <stdatomic.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #define __STDC_VERSION_STDATOMIC_H__ 202311L | |
| 6 | ||
| 7 | #if __STDC_HOSTED__ && __has_include_next(<stdatomic.h>) | |
| 8 | #include_next <stdatomic.h> | |
| 9 | #else | |
| 10 | ||
| 11 | #include <stddef.h> | |
| 12 | #include <stdint.h> | |
| 13 | ||
| 14 | #define ATOMIC_BOOL_LOCK_FREE __ATOMIC_BOOL_LOCK_FREE | |
| 15 | #define ATOMIC_CHAR_LOCK_FREE __ATOMIC_CHAR_LOCK_FREE | |
| 16 | #define ATOMIC_CHAR16_T_LOCK_FREE __ATOMIC_CHAR16_T_LOCK_FREE | |
| 17 | #define ATOMIC_CHAR32_T_LOCK_FREE __ATOMIC_CHAR32_T_LOCK_FREE | |
| 18 | #define ATOMIC_WCHAR_T_LOCK_FREE __ATOMIC_WCHAR_T_LOCK_FREE | |
| 19 | #define ATOMIC_SHORT_LOCK_FREE __ATOMIC_SHORT_LOCK_FREE | |
| 20 | #define ATOMIC_INT_LOCK_FREE __ATOMIC_INT_LOCK_FREE | |
| 21 | #define ATOMIC_LONG_LOCK_FREE __ATOMIC_LONG_LOCK_FREE | |
| 22 | #define ATOMIC_LLONG_LOCK_FREE __ATOMIC_LLONG_LOCK_FREE | |
| 23 | #define ATOMIC_POINTER_LOCK_FREE __ATOMIC_POINTER_LOCK_FREE | |
| 24 | #if defined(__ATOMIC_CHAR8_T_LOCK_FREE) | |
| 25 | #define ATOMIC_CHAR8_T_LOCK_FREE __ATOMIC_CHAR8_T_LOCK_FREE | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __STDC_VERSION__ < 202311L | |
| 29 | /* ATOMIC_VAR_INIT was removed in C23 */ | |
| 30 | #define ATOMIC_VAR_INIT(value) (value) | |
| 31 | #endif | |
| 32 | ||
| 33 | #define atomic_init __c11_atomic_init | |
| 34 | ||
| 35 | typedef enum memory_order { | |
| 36 | memory_order_relaxed = __ATOMIC_RELAXED, | |
| 37 | memory_order_consume = __ATOMIC_CONSUME, | |
| 38 | memory_order_acquire = __ATOMIC_ACQUIRE, | |
| 39 | memory_order_release = __ATOMIC_RELEASE, | |
| 40 | memory_order_acq_rel = __ATOMIC_ACQ_REL, | |
| 41 | memory_order_seq_cst = __ATOMIC_SEQ_CST | |
| 42 | } memory_order; | |
| 43 | ||
| 44 | #define kill_dependency(y) (y) | |
| 45 | ||
| 46 | void atomic_thread_fence(memory_order); | |
| 47 | void atomic_signal_fence(memory_order); | |
| 48 | ||
| 49 | #define atomic_thread_fence(order) __c11_atomic_thread_fence(order) | |
| 50 | #define atomic_signal_fence(order) __c11_atomic_signal_fence(order) | |
| 51 | ||
| 52 | #define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj))) | |
| 53 | ||
| 54 | typedef _Atomic(_Bool) atomic_bool; | |
| 55 | typedef _Atomic(char) atomic_char; | |
| 56 | typedef _Atomic(signed char) atomic_schar; | |
| 57 | typedef _Atomic(unsigned char) atomic_uchar; | |
| 58 | typedef _Atomic(short) atomic_short; | |
| 59 | typedef _Atomic(unsigned short) atomic_ushort; | |
| 60 | typedef _Atomic(int) atomic_int; | |
| 61 | typedef _Atomic(unsigned int) atomic_uint; | |
| 62 | typedef _Atomic(long) atomic_long; | |
| 63 | typedef _Atomic(unsigned long) atomic_ulong; | |
| 64 | typedef _Atomic(long long) atomic_llong; | |
| 65 | typedef _Atomic(unsigned long long) atomic_ullong; | |
| 66 | typedef _Atomic(uint_least16_t) atomic_char16_t; | |
| 67 | typedef _Atomic(uint_least32_t) atomic_char32_t; | |
| 68 | typedef _Atomic(wchar_t) atomic_wchar_t; | |
| 69 | typedef _Atomic(int_least8_t) atomic_int_least8_t; | |
| 70 | typedef _Atomic(uint_least8_t) atomic_uint_least8_t; | |
| 71 | typedef _Atomic(int_least16_t) atomic_int_least16_t; | |
| 72 | typedef _Atomic(uint_least16_t) atomic_uint_least16_t; | |
| 73 | typedef _Atomic(int_least32_t) atomic_int_least32_t; | |
| 74 | typedef _Atomic(uint_least32_t) atomic_uint_least32_t; | |
| 75 | typedef _Atomic(int_least64_t) atomic_int_least64_t; | |
| 76 | typedef _Atomic(uint_least64_t) atomic_uint_least64_t; | |
| 77 | typedef _Atomic(int_fast8_t) atomic_int_fast8_t; | |
| 78 | typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t; | |
| 79 | typedef _Atomic(int_fast16_t) atomic_int_fast16_t; | |
| 80 | typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t; | |
| 81 | typedef _Atomic(int_fast32_t) atomic_int_fast32_t; | |
| 82 | typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t; | |
| 83 | typedef _Atomic(int_fast64_t) atomic_int_fast64_t; | |
| 84 | typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t; | |
| 85 | typedef _Atomic(intptr_t) atomic_intptr_t; | |
| 86 | typedef _Atomic(uintptr_t) atomic_uintptr_t; | |
| 87 | typedef _Atomic(size_t) atomic_size_t; | |
| 88 | typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t; | |
| 89 | typedef _Atomic(intmax_t) atomic_intmax_t; | |
| 90 | typedef _Atomic(uintmax_t) atomic_uintmax_t; | |
| 91 | ||
| 92 | #define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST) | |
| 93 | #define atomic_store_explicit __c11_atomic_store | |
| 94 | ||
| 95 | #define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST) | |
| 96 | #define atomic_load_explicit __c11_atomic_load | |
| 97 | ||
| 98 | #define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST) | |
| 99 | #define atomic_exchange_explicit __c11_atomic_exchange | |
| 100 | ||
| 101 | #define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) | |
| 102 | #define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong | |
| 103 | ||
| 104 | #define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) | |
| 105 | #define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak | |
| 106 | ||
| 107 | #define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST) | |
| 108 | #define atomic_fetch_add_explicit __c11_atomic_fetch_add | |
| 109 | ||
| 110 | #define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST) | |
| 111 | #define atomic_fetch_sub_explicit __c11_atomic_fetch_sub | |
| 112 | ||
| 113 | #define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST) | |
| 114 | #define atomic_fetch_or_explicit __c11_atomic_fetch_or | |
| 115 | ||
| 116 | #define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST) | |
| 117 | #define atomic_fetch_xor_explicit __c11_atomic_fetch_xor | |
| 118 | ||
| 119 | #define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST) | |
| 120 | #define atomic_fetch_and_explicit __c11_atomic_fetch_and | |
| 121 | ||
| 122 | typedef struct atomic_flag { atomic_bool _Value; } atomic_flag; | |
| 123 | ||
| 124 | #define ATOMIC_FLAG_INIT { 0 } | |
| 125 | ||
| 126 | _Bool atomic_flag_test_and_set(volatile atomic_flag *); | |
| 127 | _Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order); | |
| 128 | void atomic_flag_clear(volatile atomic_flag *); | |
| 129 | void atomic_flag_clear_explicit(volatile atomic_flag *, memory_order); | |
| 130 | ||
| 131 | #define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST) | |
| 132 | #define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order) | |
| 133 | ||
| 134 | #define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST) | |
| 135 | #define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order) | |
| 136 | ||
| 137 | ||
| 138 | #endif |
lib/compiler/aro/include/stdbool.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* <stdbool.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #if __STDC_VERSION__ < 202311L | |
| 6 | #define bool _Bool | |
| 7 | ||
| 8 | #define true 1 | |
| 9 | #define false 0 | |
| 10 | ||
| 11 | #define __bool_true_false_are_defined 1 | |
| 12 | ||
| 13 | #endif |
lib/compiler/aro/include/stdckdint.h created+9| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | /* <stdckdint.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #define __STDC_VERSION_STDCKDINT_H__ 202311L | |
| 6 | ||
| 7 | #define ckd_add(result, a, b) __builtin_add_overflow(a, b, result) | |
| 8 | #define ckd_sub(result, a, b) __builtin_sub_overflow(a, b, result) | |
| 9 | #define ckd_mul(result, a, b) __builtin_mul_overflow(a, b, result) |
lib/compiler/aro/include/stddef.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* <stddef.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #define __STDC_VERSION_STDDEF_H__ 202311L | |
| 6 | ||
| 7 | typedef __PTRDIFF_TYPE__ ptrdiff_t; | |
| 8 | typedef __SIZE_TYPE__ size_t; | |
| 9 | typedef __WCHAR_TYPE__ wchar_t; | |
| 10 | ||
| 11 | /* define max_align_t to match GCC and Clang */ | |
| 12 | typedef struct { | |
| 13 | long long __aro_max_align_ll; | |
| 14 | long double __aro_max_align_ld; | |
| 15 | } max_align_t; | |
| 16 | ||
| 17 | #define NULL ((void*)0) | |
| 18 | #define offsetof(T, member) __builtin_offsetof(T, member) | |
| 19 | ||
| 20 | #if __STDC_VERSION__ >= 202311L | |
| 21 | # pragma GCC diagnostic push | |
| 22 | # pragma GCC diagnostic ignored "-Wpre-c23-compat" | |
| 23 | typedef typeof(nullptr) nullptr_t; | |
| 24 | # pragma GCC diagnostic pop | |
| 25 | ||
| 26 | # if defined unreachable | |
| 27 | # error unreachable() is a standard macro in C23 | |
| 28 | # else | |
| 29 | # define unreachable() __builtin_unreachable() | |
| 30 | # endif | |
| 31 | #endif |
lib/compiler/aro/include/stdint.h created+289| ... | ... | @@ -0,0 +1,289 @@ |
| 1 | /* <stdint.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | ||
| 6 | #if __STDC_HOSTED__ && __has_include_next(<stdint.h>) | |
| 7 | ||
| 8 | # include_next <stdint.h> | |
| 9 | ||
| 10 | #else | |
| 11 | ||
| 12 | #define __stdint_int_c_cat(X, Y) X ## Y | |
| 13 | #define __stdint_int_c(V, SUFFIX) __stdint_int_c_cat(V, SUFFIX) | |
| 14 | #define __stdint_uint_c(V, SUFFIX) __stdint_int_c_cat(V##U, SUFFIX) | |
| 15 | ||
| 16 | #define INTPTR_MIN (-__INTPTR_MAX__-1) | |
| 17 | #define INTPTR_MAX __INTPTR_MAX__ | |
| 18 | #define UINTPTR_MAX __UINTPTR_MAX__ | |
| 19 | #define PTRDIFF_MIN (-__PTRDIFF_MAX__-1) | |
| 20 | #define PTRDIFF_MAX __PTRDIFF_MAX__ | |
| 21 | #define SIZE_MAX __SIZE_MAX__ | |
| 22 | #define INTMAX_MIN (-__INTMAX_MAX__-1) | |
| 23 | #define INTMAX_MAX __INTMAX_MAX__ | |
| 24 | #define UINTMAX_MAX __UINTMAX_MAX__ | |
| 25 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 26 | # define INTPTR_WIDTH __INTPTR_WIDTH__ | |
| 27 | # define UINTPTR_WIDTH __UINTPTR_WIDTH__ | |
| 28 | # define INTMAX_WIDTH __INTMAX_WIDTH__ | |
| 29 | # define UINTMAX_WIDTH __UINTMAX_WIDTH__ | |
| 30 | # define PTRDIFF_WIDTH __PTRDIFF_WIDTH__ | |
| 31 | # define SIZE_WIDTH __SIZE_WIDTH__ | |
| 32 | # define WCHAR_WIDTH __WCHAR_WIDTH__ | |
| 33 | #endif | |
| 34 | ||
| 35 | typedef __INTMAX_TYPE__ intmax_t; | |
| 36 | typedef __UINTMAX_TYPE__ uintmax_t; | |
| 37 | ||
| 38 | #ifndef _INTPTR_T | |
| 39 | # ifndef __intptr_t_defined | |
| 40 | typedef __INTPTR_TYPE__ intptr_t; | |
| 41 | # define __intptr_t_defined | |
| 42 | # define _INTPTR_T | |
| 43 | # endif | |
| 44 | #endif | |
| 45 | ||
| 46 | #ifndef _UINTPTR_T | |
| 47 | typedef __UINTPTR_TYPE__ uintptr_t; | |
| 48 | # define _UINTPTR_T | |
| 49 | #endif | |
| 50 | ||
| 51 | ||
| 52 | #ifdef __INT64_TYPE__ | |
| 53 | # ifndef __int8_t_defined /* glibc sys/types.h also defines int64_t*/ | |
| 54 | typedef __INT64_TYPE__ int64_t; | |
| 55 | # endif /* __int8_t_defined */ | |
| 56 | typedef __UINT64_TYPE__ uint64_t; | |
| 57 | ||
| 58 | # undef __int64_c_suffix | |
| 59 | # undef __int32_c_suffix | |
| 60 | # undef __int16_c_suffix | |
| 61 | # undef __int8_c_suffix | |
| 62 | # ifdef __INT64_C_SUFFIX__ | |
| 63 | # define __int64_c_suffix __INT64_C_SUFFIX__ | |
| 64 | # define __int32_c_suffix __INT64_C_SUFFIX__ | |
| 65 | # define __int16_c_suffix __INT64_C_SUFFIX__ | |
| 66 | # define __int8_c_suffix __INT64_C_SUFFIX__ | |
| 67 | # endif /* __INT64_C_SUFFIX__ */ | |
| 68 | ||
| 69 | # ifdef __int64_c_suffix | |
| 70 | # define INT64_C(v) (__stdint_int_c(v, __int64_c_suffix)) | |
| 71 | # define UINT64_C(v) (__stdint_uint_c(v, __int64_c_suffix)) | |
| 72 | # else | |
| 73 | # define INT64_C(v) (v) | |
| 74 | # define UINT64_C(v) (v ## U) | |
| 75 | # endif /* __int64_c_suffix */ | |
| 76 | ||
| 77 | # define INT64_MAX INT64_C( 9223372036854775807) | |
| 78 | # define INT64_MIN (-INT64_C( 9223372036854775807)-1) | |
| 79 | # define UINT64_MAX UINT64_C(18446744073709551615) | |
| 80 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 81 | # define UINT64_WIDTH 64 | |
| 82 | # define INT64_WIDTH UINT64_WIDTH | |
| 83 | # endif /* __STDC_VERSION__ */ | |
| 84 | ||
| 85 | #endif /* __INT64_TYPE__ */ | |
| 86 | ||
| 87 | #ifdef __INT32_TYPE__ | |
| 88 | # ifndef __int8_t_defined /* glibc sys/types.h also defines int32_t*/ | |
| 89 | typedef __INT32_TYPE__ int32_t; | |
| 90 | # endif /* __int8_t_defined */ | |
| 91 | typedef __UINT32_TYPE__ uint32_t; | |
| 92 | ||
| 93 | # undef __int32_c_suffix | |
| 94 | # undef __int16_c_suffix | |
| 95 | # undef __int8_c_suffix | |
| 96 | # ifdef __INT32_C_SUFFIX__ | |
| 97 | # define __int32_c_suffix __INT32_C_SUFFIX__ | |
| 98 | # define __int16_c_suffix __INT32_C_SUFFIX__ | |
| 99 | # define __int8_c_suffix __INT32_C_SUFFIX__ | |
| 100 | # endif /* __INT32_C_SUFFIX__ */ | |
| 101 | ||
| 102 | # ifdef __int32_c_suffix | |
| 103 | # define INT32_C(v) (__stdint_int_c(v, __int32_c_suffix)) | |
| 104 | # define UINT32_C(v) (__stdint_uint_c(v, __int32_c_suffix)) | |
| 105 | # else | |
| 106 | # define INT32_C(v) (v) | |
| 107 | # define UINT32_C(v) (v ## U) | |
| 108 | # endif /* __int32_c_suffix */ | |
| 109 | ||
| 110 | # define INT32_MAX INT32_C( 2147483647) | |
| 111 | # define INT32_MIN (-INT32_C( 2147483647)-1) | |
| 112 | # define UINT32_MAX UINT32_C(4294967295) | |
| 113 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 114 | # define UINT32_WIDTH 32 | |
| 115 | # define INT32_WIDTH UINT32_WIDTH | |
| 116 | # endif /* __STDC_VERSION__ */ | |
| 117 | ||
| 118 | #endif /* __INT32_TYPE__ */ | |
| 119 | ||
| 120 | #ifdef __INT16_TYPE__ | |
| 121 | # ifndef __int8_t_defined /* glibc sys/types.h also defines int16_t*/ | |
| 122 | typedef __INT16_TYPE__ int16_t; | |
| 123 | # endif /* __int8_t_defined */ | |
| 124 | typedef __UINT16_TYPE__ uint16_t; | |
| 125 | ||
| 126 | # undef __int16_c_suffix | |
| 127 | # undef __int8_c_suffix | |
| 128 | # ifdef __INT16_C_SUFFIX__ | |
| 129 | # define __int16_c_suffix __INT16_C_SUFFIX__ | |
| 130 | # define __int8_c_suffix __INT16_C_SUFFIX__ | |
| 131 | # endif /* __INT16_C_SUFFIX__ */ | |
| 132 | ||
| 133 | # ifdef __int16_c_suffix | |
| 134 | # define INT16_C(v) (__stdint_int_c(v, __int16_c_suffix)) | |
| 135 | # define UINT16_C(v) (__stdint_uint_c(v, __int16_c_suffix)) | |
| 136 | # else | |
| 137 | # define INT16_C(v) (v) | |
| 138 | # define UINT16_C(v) (v ## U) | |
| 139 | # endif /* __int16_c_suffix */ | |
| 140 | ||
| 141 | # define INT16_MAX INT16_C( 32767) | |
| 142 | # define INT16_MIN (-INT16_C( 32767)-1) | |
| 143 | # define UINT16_MAX UINT16_C(65535) | |
| 144 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 145 | # define UINT16_WIDTH 16 | |
| 146 | # define INT16_WIDTH UINT16_WIDTH | |
| 147 | # endif /* __STDC_VERSION__ */ | |
| 148 | ||
| 149 | #endif /* __INT16_TYPE__ */ | |
| 150 | ||
| 151 | #ifdef __INT8_TYPE__ | |
| 152 | # ifndef __int8_t_defined /* glibc sys/types.h also defines int8_t*/ | |
| 153 | typedef __INT8_TYPE__ int8_t; | |
| 154 | # endif /* __int8_t_defined */ | |
| 155 | typedef __UINT8_TYPE__ uint8_t; | |
| 156 | ||
| 157 | # undef __int8_c_suffix | |
| 158 | # ifdef __INT8_C_SUFFIX__ | |
| 159 | # define __int8_c_suffix __INT8_C_SUFFIX__ | |
| 160 | # endif /* __INT8_C_SUFFIX__ */ | |
| 161 | ||
| 162 | # ifdef __int8_c_suffix | |
| 163 | # define INT8_C(v) (__stdint_int_c(v, __int8_c_suffix)) | |
| 164 | # define UINT8_C(v) (__stdint_uint_c(v, __int8_c_suffix)) | |
| 165 | # else | |
| 166 | # define INT8_C(v) (v) | |
| 167 | # define UINT8_C(v) (v ## U) | |
| 168 | # endif /* __int8_c_suffix */ | |
| 169 | ||
| 170 | # define INT8_MAX INT8_C(127) | |
| 171 | # define INT8_MIN (-INT8_C(127)-1) | |
| 172 | # define UINT8_MAX UINT8_C(255) | |
| 173 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 174 | # define UINT8_WIDTH 8 | |
| 175 | # define INT8_WIDTH UINT8_WIDTH | |
| 176 | # endif /* __STDC_VERSION__ */ | |
| 177 | ||
| 178 | #endif /* __INT8_TYPE__ */ | |
| 179 | ||
| 180 | typedef __INT_LEAST64_TYPE__ int_least64_t; | |
| 181 | typedef __INT_LEAST32_TYPE__ int_least32_t; | |
| 182 | typedef __INT_LEAST16_TYPE__ int_least16_t; | |
| 183 | typedef __INT_LEAST8_TYPE__ int_least8_t; | |
| 184 | ||
| 185 | typedef __UINT_LEAST64_TYPE__ uint_least64_t; | |
| 186 | typedef __UINT_LEAST32_TYPE__ uint_least32_t; | |
| 187 | typedef __UINT_LEAST16_TYPE__ uint_least16_t; | |
| 188 | typedef __UINT_LEAST8_TYPE__ uint_least8_t; | |
| 189 | ||
| 190 | #define INT_LEAST8_MAX __INT_LEAST8_MAX__ | |
| 191 | #define INT_LEAST8_MIN (-__INT_LEAST8_MAX__-1) | |
| 192 | #define UINT_LEAST8_MAX __UINT_LEAST8_MAX__ | |
| 193 | ||
| 194 | #define INT_LEAST16_MAX __INT_LEAST16_MAX__ | |
| 195 | #define INT_LEAST16_MIN (-__INT_LEAST16_MAX__-1) | |
| 196 | #define UINT_LEAST16_MAX __UINT_LEAST16_MAX__ | |
| 197 | ||
| 198 | #define INT_LEAST32_MAX __INT_LEAST32_MAX__ | |
| 199 | #define INT_LEAST32_MIN (-__INT_LEAST32_MAX__-1) | |
| 200 | #define UINT_LEAST32_MAX __UINT_LEAST32_MAX__ | |
| 201 | ||
| 202 | #define INT_LEAST64_MAX __INT_LEAST64_MAX__ | |
| 203 | #define INT_LEAST64_MIN (-__INT_LEAST64_MAX__-1) | |
| 204 | #define UINT_LEAST64_MAX __UINT_LEAST64_MAX__ | |
| 205 | ||
| 206 | ||
| 207 | typedef __INT_FAST64_TYPE__ int_fast64_t; | |
| 208 | typedef __INT_FAST32_TYPE__ int_fast32_t; | |
| 209 | typedef __INT_FAST16_TYPE__ int_fast16_t; | |
| 210 | typedef __INT_FAST8_TYPE__ int_fast8_t; | |
| 211 | ||
| 212 | typedef __UINT_FAST64_TYPE__ uint_fast64_t; | |
| 213 | typedef __UINT_FAST32_TYPE__ uint_fast32_t; | |
| 214 | typedef __UINT_FAST16_TYPE__ uint_fast16_t; | |
| 215 | typedef __UINT_FAST8_TYPE__ uint_fast8_t; | |
| 216 | ||
| 217 | #define INT_FAST8_MAX __INT_FAST8_MAX__ | |
| 218 | #define INT_FAST8_MIN (-__INT_FAST8_MAX__-1) | |
| 219 | #define UINT_FAST8_MAX __UINT_FAST8_MAX__ | |
| 220 | ||
| 221 | #define INT_FAST16_MAX __INT_FAST16_MAX__ | |
| 222 | #define INT_FAST16_MIN (-__INT_FAST16_MAX__-1) | |
| 223 | #define UINT_FAST16_MAX __UINT_FAST16_MAX__ | |
| 224 | ||
| 225 | #define INT_FAST32_MAX __INT_FAST32_MAX__ | |
| 226 | #define INT_FAST32_MIN (-__INT_FAST32_MAX__-1) | |
| 227 | #define UINT_FAST32_MAX __UINT_FAST32_MAX__ | |
| 228 | ||
| 229 | #define INT_FAST64_MAX __INT_FAST64_MAX__ | |
| 230 | #define INT_FAST64_MIN (-__INT_FAST64_MAX__-1) | |
| 231 | #define UINT_FAST64_MAX __UINT_FAST64_MAX__ | |
| 232 | ||
| 233 | ||
| 234 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 235 | ||
| 236 | #define INT_FAST8_WIDTH __INT_FAST8_WIDTH__ | |
| 237 | #define UINT_FAST8_WIDTH __INT_FAST8_WIDTH__ | |
| 238 | #define INT_LEAST8_WIDTH __INT_LEAST8_WIDTH__ | |
| 239 | #define UINT_LEAST8_WIDTH __INT_LEAST8_WIDTH__ | |
| 240 | ||
| 241 | #define INT_FAST16_WIDTH __INT_FAST16_WIDTH__ | |
| 242 | #define UINT_FAST16_WIDTH __INT_FAST16_WIDTH__ | |
| 243 | #define INT_LEAST16_WIDTH __INT_LEAST16_WIDTH__ | |
| 244 | #define UINT_LEAST16_WIDTH __INT_LEAST16_WIDTH__ | |
| 245 | ||
| 246 | #define INT_FAST32_WIDTH __INT_FAST32_WIDTH__ | |
| 247 | #define UINT_FAST32_WIDTH __INT_FAST32_WIDTH__ | |
| 248 | #define INT_LEAST32_WIDTH __INT_LEAST32_WIDTH__ | |
| 249 | #define UINT_LEAST32_WIDTH __INT_LEAST32_WIDTH__ | |
| 250 | ||
| 251 | #define INT_FAST64_WIDTH __INT_FAST64_WIDTH__ | |
| 252 | #define UINT_FAST64_WIDTH __INT_FAST64_WIDTH__ | |
| 253 | #define INT_LEAST64_WIDTH __INT_LEAST64_WIDTH__ | |
| 254 | #define UINT_LEAST64_WIDTH __INT_LEAST64_WIDTH__ | |
| 255 | ||
| 256 | #endif | |
| 257 | ||
| 258 | #ifdef __SIZEOF_INT128__ | |
| 259 | typedef signed __int128 int128_t; | |
| 260 | typedef unsigned __int128 uint128_t; | |
| 261 | typedef signed __int128 int_fast128_t; | |
| 262 | typedef unsigned __int128 uint_fast128_t; | |
| 263 | typedef signed __int128 int_least128_t; | |
| 264 | typedef unsigned __int128 uint_least128_t; | |
| 265 | # define UINT128_MAX ((uint128_t)-1) | |
| 266 | # define INT128_MAX ((int128_t)+(UINT128_MAX/2)) | |
| 267 | # define INT128_MIN (-INT128_MAX-1) | |
| 268 | # define UINT_LEAST128_MAX UINT128_MAX | |
| 269 | # define INT_LEAST128_MAX INT128_MAX | |
| 270 | # define INT_LEAST128_MIN INT128_MIN | |
| 271 | # define UINT_FAST128_MAX UINT128_MAX | |
| 272 | # define INT_FAST128_MAX INT128_MAX | |
| 273 | # define INT_FAST128_MIN INT128_MIN | |
| 274 | # define INT128_WIDTH 128 | |
| 275 | # define UINT128_WIDTH 128 | |
| 276 | # define INT_LEAST128_WIDTH 128 | |
| 277 | # define UINT_LEAST128_WIDTH 128 | |
| 278 | # define INT_FAST128_WIDTH 128 | |
| 279 | # define UINT_FAST128_WIDTH 128 | |
| 280 | # if UINT128_WIDTH > __LLONG_WIDTH__ | |
| 281 | # define INT128_C(N) ((int_least128_t)+N ## WB) | |
| 282 | # define UINT128_C(N) ((uint_least128_t)+N ## WBU) | |
| 283 | # else | |
| 284 | # define INT128_C(N) ((int_least128_t)+N ## LL) | |
| 285 | # define UINT128_C(N) ((uint_least128_t)+N ## LLU) | |
| 286 | # endif | |
| 287 | #endif | |
| 288 | ||
| 289 | #endif /* __STDC_HOSTED__ && __has_include_next(<stdint.h>) */ |
lib/compiler/aro/include/stdnoreturn.h created+6| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | /* <stdnoreturn.h> for the Aro C compiler */ | |
| 2 | ||
| 3 | #pragma once | |
| 4 | ||
| 5 | #define noreturn _Noreturn | |
| 6 | #define __noreturn_is_defined 1 |
lib/compiler/aro/include/varargs.h created+3| ... | ... | @@ -0,0 +1,3 @@ |
| 1 | /* <varargs.h> for the Aro C compiler */ | |
| 2 | #pragma once | |
| 3 | #error please use <stdarg.h> instead of <varargs.h> |
lib/compiler/aro/main.zig created+80| ... | ... | @@ -0,0 +1,80 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Allocator = mem.Allocator; | |
| 3 | const mem = std.mem; | |
| 4 | const process = std.process; | |
| 5 | const aro = @import("aro"); | |
| 6 | const Compilation = aro.Compilation; | |
| 7 | const Diagnostics = aro.Diagnostics; | |
| 8 | const Driver = aro.Driver; | |
| 9 | const Toolchain = aro.Toolchain; | |
| 10 | const assembly_backend = @import("assembly_backend"); | |
| 11 | ||
| 12 | var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; | |
| 13 | ||
| 14 | pub fn main() u8 { | |
| 15 | const gpa = if (@import("builtin").link_libc) | |
| 16 | std.heap.raw_c_allocator | |
| 17 | else | |
| 18 | general_purpose_allocator.allocator(); | |
| 19 | defer if (!@import("builtin").link_libc) { | |
| 20 | _ = general_purpose_allocator.deinit(); | |
| 21 | }; | |
| 22 | ||
| 23 | var arena_instance = std.heap.ArenaAllocator.init(gpa); | |
| 24 | defer arena_instance.deinit(); | |
| 25 | const arena = arena_instance.allocator(); | |
| 26 | ||
| 27 | const fast_exit = @import("builtin").mode != .Debug; | |
| 28 | ||
| 29 | const args = process.argsAlloc(arena) catch { | |
| 30 | std.debug.print("out of memory\n", .{}); | |
| 31 | if (fast_exit) process.exit(1); | |
| 32 | return 1; | |
| 33 | }; | |
| 34 | ||
| 35 | const aro_name = std.fs.selfExePathAlloc(gpa) catch { | |
| 36 | std.debug.print("unable to find Aro executable path\n", .{}); | |
| 37 | if (fast_exit) process.exit(1); | |
| 38 | return 1; | |
| 39 | }; | |
| 40 | defer gpa.free(aro_name); | |
| 41 | ||
| 42 | var stderr_buf: [1024]u8 = undefined; | |
| 43 | var stderr = std.fs.File.stderr().writer(&stderr_buf); | |
| 44 | var diagnostics: Diagnostics = .{ | |
| 45 | .output = .{ .to_writer = .{ | |
| 46 | .color = .detect(stderr.file), | |
| 47 | .writer = &stderr.interface, | |
| 48 | } }, | |
| 49 | }; | |
| 50 | ||
| 51 | var comp = Compilation.initDefault(gpa, arena, &diagnostics, std.fs.cwd()) catch |er| switch (er) { | |
| 52 | error.OutOfMemory => { | |
| 53 | std.debug.print("out of memory\n", .{}); | |
| 54 | if (fast_exit) process.exit(1); | |
| 55 | return 1; | |
| 56 | }, | |
| 57 | }; | |
| 58 | defer comp.deinit(); | |
| 59 | ||
| 60 | var driver: Driver = .{ .comp = &comp, .aro_name = aro_name, .diagnostics = &diagnostics }; | |
| 61 | defer driver.deinit(); | |
| 62 | ||
| 63 | var toolchain: Toolchain = .{ .driver = &driver, .filesystem = .{ .real = comp.cwd } }; | |
| 64 | defer toolchain.deinit(); | |
| 65 | ||
| 66 | driver.main(&toolchain, args, fast_exit, assembly_backend.genAsm) catch |er| switch (er) { | |
| 67 | error.OutOfMemory => { | |
| 68 | std.debug.print("out of memory\n", .{}); | |
| 69 | if (fast_exit) process.exit(1); | |
| 70 | return 1; | |
| 71 | }, | |
| 72 | error.FatalError => { | |
| 73 | driver.printDiagnosticsStats(); | |
| 74 | if (fast_exit) process.exit(1); | |
| 75 | return 1; | |
| 76 | }, | |
| 77 | }; | |
| 78 | if (fast_exit) process.exit(@intFromBool(comp.diagnostics.errors != 0)); | |
| 79 | return @intFromBool(diagnostics.errors != 0); | |
| 80 | } |
lib/compiler/aro_translate_c.zig deleted-1832| ... | ... | @@ -1,1832 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const mem = std.mem; | |
| 3 | const assert = std.debug.assert; | |
| 4 | const CallingConvention = std.builtin.CallingConvention; | |
| 5 | const aro = @import("aro"); | |
| 6 | const CToken = aro.Tokenizer.Token; | |
| 7 | const Tree = aro.Tree; | |
| 8 | const NodeIndex = Tree.NodeIndex; | |
| 9 | const TokenIndex = Tree.TokenIndex; | |
| 10 | const Type = aro.Type; | |
| 11 | pub const ast = @import("aro_translate_c/ast.zig"); | |
| 12 | const ZigNode = ast.Node; | |
| 13 | const ZigTag = ZigNode.Tag; | |
| 14 | const Scope = ScopeExtra(Context, Type); | |
| 15 | const Context = @This(); | |
| 16 | ||
| 17 | gpa: mem.Allocator, | |
| 18 | arena: mem.Allocator, | |
| 19 | decl_table: std.AutoArrayHashMapUnmanaged(usize, []const u8) = .empty, | |
| 20 | alias_list: AliasList, | |
| 21 | global_scope: *Scope.Root, | |
| 22 | mangle_count: u32 = 0, | |
| 23 | /// Table of record decls that have been demoted to opaques. | |
| 24 | opaque_demotes: std.AutoHashMapUnmanaged(usize, void) = .empty, | |
| 25 | /// Table of unnamed enums and records that are child types of typedefs. | |
| 26 | unnamed_typedefs: std.AutoHashMapUnmanaged(usize, []const u8) = .empty, | |
| 27 | /// Needed to decide if we are parsing a typename | |
| 28 | typedefs: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 29 | ||
| 30 | /// This one is different than the root scope's name table. This contains | |
| 31 | /// a list of names that we found by visiting all the top level decls without | |
| 32 | /// translating them. The other maps are updated as we translate; this one is updated | |
| 33 | /// up front in a pre-processing step. | |
| 34 | global_names: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 35 | ||
| 36 | /// This is similar to `global_names`, but contains names which we would | |
| 37 | /// *like* to use, but do not strictly *have* to if they are unavailable. | |
| 38 | /// These are relevant to types, which ideally we would name like | |
| 39 | /// 'struct_foo' with an alias 'foo', but if either of those names is taken, | |
| 40 | /// may be mangled. | |
| 41 | /// This is distinct from `global_names` so we can detect at a type | |
| 42 | /// declaration whether or not the name is available. | |
| 43 | weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 44 | ||
| 45 | pattern_list: PatternList, | |
| 46 | tree: Tree, | |
| 47 | comp: *aro.Compilation, | |
| 48 | mapper: aro.TypeMapper, | |
| 49 | ||
| 50 | fn getMangle(c: *Context) u32 { | |
| 51 | c.mangle_count += 1; | |
| 52 | return c.mangle_count; | |
| 53 | } | |
| 54 | ||
| 55 | /// Convert an aro TokenIndex to a 'file:line:column' string | |
| 56 | fn locStr(c: *Context, tok_idx: TokenIndex) ![]const u8 { | |
| 57 | const token_loc = c.tree.tokens.items(.loc)[tok_idx]; | |
| 58 | const source = c.comp.getSource(token_loc.id); | |
| 59 | const line_col = source.lineCol(token_loc); | |
| 60 | const filename = source.path; | |
| 61 | ||
| 62 | const line = source.physicalLine(token_loc); | |
| 63 | const col = line_col.col; | |
| 64 | ||
| 65 | return std.fmt.allocPrint(c.arena, "{s}:{d}:{d}", .{ filename, line, col }); | |
| 66 | } | |
| 67 | ||
| 68 | fn maybeSuppressResult(c: *Context, used: ResultUsed, result: ZigNode) TransError!ZigNode { | |
| 69 | if (used == .used) return result; | |
| 70 | return ZigTag.discard.create(c.arena, .{ .should_skip = false, .value = result }); | |
| 71 | } | |
| 72 | ||
| 73 | fn addTopLevelDecl(c: *Context, name: []const u8, decl_node: ZigNode) !void { | |
| 74 | const gop = try c.global_scope.sym_table.getOrPut(name); | |
| 75 | if (!gop.found_existing) { | |
| 76 | gop.value_ptr.* = decl_node; | |
| 77 | try c.global_scope.nodes.append(decl_node); | |
| 78 | } | |
| 79 | } | |
| 80 | ||
| 81 | fn fail( | |
| 82 | c: *Context, | |
| 83 | err: anytype, | |
| 84 | source_loc: TokenIndex, | |
| 85 | comptime format: []const u8, | |
| 86 | args: anytype, | |
| 87 | ) (@TypeOf(err) || error{OutOfMemory}) { | |
| 88 | try warn(c, &c.global_scope.base, source_loc, format, args); | |
| 89 | return err; | |
| 90 | } | |
| 91 | ||
| 92 | fn failDecl(c: *Context, loc: TokenIndex, name: []const u8, comptime format: []const u8, args: anytype) Error!void { | |
| 93 | // location | |
| 94 | // pub const name = @compileError(msg); | |
| 95 | const fail_msg = try std.fmt.allocPrint(c.arena, format, args); | |
| 96 | try addTopLevelDecl(c, name, try ZigTag.fail_decl.create(c.arena, .{ .actual = name, .mangled = fail_msg })); | |
| 97 | const str = try c.locStr(loc); | |
| 98 | const location_comment = try std.fmt.allocPrint(c.arena, "// {s}", .{str}); | |
| 99 | try c.global_scope.nodes.append(try ZigTag.warning.create(c.arena, location_comment)); | |
| 100 | } | |
| 101 | ||
| 102 | fn warn(c: *Context, scope: *Scope, loc: TokenIndex, comptime format: []const u8, args: anytype) !void { | |
| 103 | const str = try c.locStr(loc); | |
| 104 | const value = try std.fmt.allocPrint(c.arena, "// {s}: warning: " ++ format, .{str} ++ args); | |
| 105 | try scope.appendNode(try ZigTag.warning.create(c.arena, value)); | |
| 106 | } | |
| 107 | ||
| 108 | pub fn translate( | |
| 109 | gpa: mem.Allocator, | |
| 110 | comp: *aro.Compilation, | |
| 111 | args: []const []const u8, | |
| 112 | ) !std.zig.Ast { | |
| 113 | try comp.addDefaultPragmaHandlers(); | |
| 114 | comp.langopts.setEmulatedCompiler(aro.target_util.systemCompiler(comp.target)); | |
| 115 | ||
| 116 | var driver: aro.Driver = .{ .comp = comp }; | |
| 117 | defer driver.deinit(); | |
| 118 | ||
| 119 | var macro_buf: std.Io.Writer.Allocating = .init(gpa); | |
| 120 | defer macro_buf.deinit(); | |
| 121 | ||
| 122 | var trash: [64]u8 = undefined; | |
| 123 | var discarding: std.Io.Writer.Discarding = .init(&trash); | |
| 124 | assert(!try driver.parseArgs(&discarding.writer, &macro_buf.writer, args)); | |
| 125 | assert(driver.inputs.items.len == 1); | |
| 126 | const source = driver.inputs.items[0]; | |
| 127 | ||
| 128 | const builtin_macros = try comp.generateBuiltinMacros(.include_system_defines); | |
| 129 | const user_macros = try comp.addSourceFromBuffer("<command line>", macro_buf.written()); | |
| 130 | ||
| 131 | var pp = try aro.Preprocessor.initDefault(comp); | |
| 132 | defer pp.deinit(); | |
| 133 | ||
| 134 | try pp.preprocessSources(&.{ source, builtin_macros, user_macros }); | |
| 135 | ||
| 136 | var tree = try pp.parse(); | |
| 137 | defer tree.deinit(); | |
| 138 | ||
| 139 | // Workaround for https://github.com/Vexu/arocc/issues/603 | |
| 140 | for (comp.diagnostics.list.items) |msg| { | |
| 141 | if (msg.kind == .@"error" or msg.kind == .@"fatal error") return error.ParsingFailed; | |
| 142 | } | |
| 143 | ||
| 144 | const mapper = tree.comp.string_interner.getFastTypeMapper(tree.comp.gpa) catch tree.comp.string_interner.getSlowTypeMapper(); | |
| 145 | defer mapper.deinit(tree.comp.gpa); | |
| 146 | ||
| 147 | var arena_allocator = std.heap.ArenaAllocator.init(gpa); | |
| 148 | defer arena_allocator.deinit(); | |
| 149 | const arena = arena_allocator.allocator(); | |
| 150 | ||
| 151 | var context = Context{ | |
| 152 | .gpa = gpa, | |
| 153 | .arena = arena, | |
| 154 | .alias_list = AliasList.init(gpa), | |
| 155 | .global_scope = try arena.create(Scope.Root), | |
| 156 | .pattern_list = try PatternList.init(gpa), | |
| 157 | .comp = comp, | |
| 158 | .mapper = mapper, | |
| 159 | .tree = tree, | |
| 160 | }; | |
| 161 | context.global_scope.* = Scope.Root.init(&context); | |
| 162 | defer { | |
| 163 | context.decl_table.deinit(gpa); | |
| 164 | context.alias_list.deinit(); | |
| 165 | context.global_names.deinit(gpa); | |
| 166 | context.opaque_demotes.deinit(gpa); | |
| 167 | context.unnamed_typedefs.deinit(gpa); | |
| 168 | context.typedefs.deinit(gpa); | |
| 169 | context.global_scope.deinit(); | |
| 170 | context.pattern_list.deinit(gpa); | |
| 171 | } | |
| 172 | ||
| 173 | @setEvalBranchQuota(2000); | |
| 174 | inline for (@typeInfo(std.zig.c_builtins).@"struct".decls) |decl| { | |
| 175 | const builtin_fn = try ZigTag.pub_var_simple.create(arena, .{ | |
| 176 | .name = decl.name, | |
| 177 | .init = try ZigTag.import_c_builtin.create(arena, decl.name), | |
| 178 | }); | |
| 179 | try addTopLevelDecl(&context, decl.name, builtin_fn); | |
| 180 | } | |
| 181 | ||
| 182 | try prepopulateGlobalNameTable(&context); | |
| 183 | try transTopLevelDecls(&context); | |
| 184 | ||
| 185 | for (context.alias_list.items) |alias| { | |
| 186 | if (!context.global_scope.sym_table.contains(alias.alias)) { | |
| 187 | const node = try ZigTag.alias.create(arena, .{ .actual = alias.alias, .mangled = alias.name }); | |
| 188 | try addTopLevelDecl(&context, alias.alias, node); | |
| 189 | } | |
| 190 | } | |
| 191 | ||
| 192 | return ast.render(gpa, context.global_scope.nodes.items); | |
| 193 | } | |
| 194 | ||
| 195 | fn prepopulateGlobalNameTable(c: *Context) !void { | |
| 196 | const node_tags = c.tree.nodes.items(.tag); | |
| 197 | const node_types = c.tree.nodes.items(.ty); | |
| 198 | const node_data = c.tree.nodes.items(.data); | |
| 199 | for (c.tree.root_decls) |node| { | |
| 200 | const data = node_data[@intFromEnum(node)]; | |
| 201 | switch (node_tags[@intFromEnum(node)]) { | |
| 202 | .typedef => {}, | |
| 203 | ||
| 204 | .struct_decl_two, | |
| 205 | .union_decl_two, | |
| 206 | .struct_decl, | |
| 207 | .union_decl, | |
| 208 | .struct_forward_decl, | |
| 209 | .union_forward_decl, | |
| 210 | .enum_decl_two, | |
| 211 | .enum_decl, | |
| 212 | .enum_forward_decl, | |
| 213 | => { | |
| 214 | const raw_ty = node_types[@intFromEnum(node)]; | |
| 215 | const ty = raw_ty.canonicalize(.standard); | |
| 216 | const name_id = if (ty.isRecord()) ty.data.record.name else ty.data.@"enum".name; | |
| 217 | const decl_name = c.mapper.lookup(name_id); | |
| 218 | const container_prefix = if (ty.is(.@"struct")) "struct" else if (ty.is(.@"union")) "union" else "enum"; | |
| 219 | const prefixed_name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_prefix, decl_name }); | |
| 220 | // `decl_name` and `prefixed_name` are the preferred names for this type. | |
| 221 | // However, we can name it anything else if necessary, so these are "weak names". | |
| 222 | try c.weak_global_names.ensureUnusedCapacity(c.gpa, 2); | |
| 223 | c.weak_global_names.putAssumeCapacity(decl_name, {}); | |
| 224 | c.weak_global_names.putAssumeCapacity(prefixed_name, {}); | |
| 225 | }, | |
| 226 | ||
| 227 | .fn_proto, | |
| 228 | .static_fn_proto, | |
| 229 | .inline_fn_proto, | |
| 230 | .inline_static_fn_proto, | |
| 231 | .fn_def, | |
| 232 | .static_fn_def, | |
| 233 | .inline_fn_def, | |
| 234 | .inline_static_fn_def, | |
| 235 | .@"var", | |
| 236 | .extern_var, | |
| 237 | .static_var, | |
| 238 | .threadlocal_var, | |
| 239 | .threadlocal_extern_var, | |
| 240 | .threadlocal_static_var, | |
| 241 | => { | |
| 242 | const decl_name = c.tree.tokSlice(data.decl.name); | |
| 243 | try c.global_names.put(c.gpa, decl_name, {}); | |
| 244 | }, | |
| 245 | .static_assert => {}, | |
| 246 | else => unreachable, | |
| 247 | } | |
| 248 | } | |
| 249 | } | |
| 250 | ||
| 251 | fn transTopLevelDecls(c: *Context) !void { | |
| 252 | for (c.tree.root_decls) |node| { | |
| 253 | try transDecl(c, &c.global_scope.base, node); | |
| 254 | } | |
| 255 | } | |
| 256 | ||
| 257 | fn transDecl(c: *Context, scope: *Scope, decl: NodeIndex) !void { | |
| 258 | const node_tags = c.tree.nodes.items(.tag); | |
| 259 | const node_data = c.tree.nodes.items(.data); | |
| 260 | const node_ty = c.tree.nodes.items(.ty); | |
| 261 | const data = node_data[@intFromEnum(decl)]; | |
| 262 | switch (node_tags[@intFromEnum(decl)]) { | |
| 263 | .typedef => { | |
| 264 | try transTypeDef(c, scope, decl); | |
| 265 | }, | |
| 266 | ||
| 267 | .struct_decl_two, | |
| 268 | .union_decl_two, | |
| 269 | => { | |
| 270 | try transRecordDecl(c, scope, node_ty[@intFromEnum(decl)]); | |
| 271 | }, | |
| 272 | .struct_decl, | |
| 273 | .union_decl, | |
| 274 | => { | |
| 275 | try transRecordDecl(c, scope, node_ty[@intFromEnum(decl)]); | |
| 276 | }, | |
| 277 | ||
| 278 | .enum_decl_two => { | |
| 279 | var fields = [2]NodeIndex{ data.bin.lhs, data.bin.rhs }; | |
| 280 | var field_count: u8 = 0; | |
| 281 | if (fields[0] != .none) field_count += 1; | |
| 282 | if (fields[1] != .none) field_count += 1; | |
| 283 | const enum_decl = node_ty[@intFromEnum(decl)].canonicalize(.standard).data.@"enum"; | |
| 284 | try transEnumDecl(c, scope, enum_decl, fields[0..field_count]); | |
| 285 | }, | |
| 286 | .enum_decl => { | |
| 287 | const fields = c.tree.data[data.range.start..data.range.end]; | |
| 288 | const enum_decl = node_ty[@intFromEnum(decl)].canonicalize(.standard).data.@"enum"; | |
| 289 | try transEnumDecl(c, scope, enum_decl, fields); | |
| 290 | }, | |
| 291 | ||
| 292 | .enum_field_decl, | |
| 293 | .record_field_decl, | |
| 294 | .indirect_record_field_decl, | |
| 295 | .struct_forward_decl, | |
| 296 | .union_forward_decl, | |
| 297 | .enum_forward_decl, | |
| 298 | => return, | |
| 299 | ||
| 300 | .fn_proto, | |
| 301 | .static_fn_proto, | |
| 302 | .inline_fn_proto, | |
| 303 | .inline_static_fn_proto, | |
| 304 | .fn_def, | |
| 305 | .static_fn_def, | |
| 306 | .inline_fn_def, | |
| 307 | .inline_static_fn_def, | |
| 308 | => { | |
| 309 | try transFnDecl(c, decl, true); | |
| 310 | }, | |
| 311 | ||
| 312 | .@"var", | |
| 313 | .extern_var, | |
| 314 | .static_var, | |
| 315 | .threadlocal_var, | |
| 316 | .threadlocal_extern_var, | |
| 317 | .threadlocal_static_var, | |
| 318 | => { | |
| 319 | try transVarDecl(c, decl); | |
| 320 | }, | |
| 321 | .static_assert => try warn(c, &c.global_scope.base, 0, "ignoring _Static_assert declaration", .{}), | |
| 322 | else => unreachable, | |
| 323 | } | |
| 324 | } | |
| 325 | ||
| 326 | fn transTypeDef(c: *Context, scope: *Scope, typedef_decl: NodeIndex) Error!void { | |
| 327 | const ty = c.tree.nodes.items(.ty)[@intFromEnum(typedef_decl)]; | |
| 328 | const data = c.tree.nodes.items(.data)[@intFromEnum(typedef_decl)]; | |
| 329 | ||
| 330 | const toplevel = scope.id == .root; | |
| 331 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; | |
| 332 | ||
| 333 | var name: []const u8 = c.tree.tokSlice(data.decl.name); | |
| 334 | try c.typedefs.put(c.gpa, name, {}); | |
| 335 | ||
| 336 | if (!toplevel) name = try bs.makeMangledName(c, name); | |
| 337 | ||
| 338 | const typedef_loc = data.decl.name; | |
| 339 | const init_node = transType(c, scope, ty, .standard, typedef_loc) catch |err| switch (err) { | |
| 340 | error.UnsupportedType => { | |
| 341 | return failDecl(c, typedef_loc, name, "unable to resolve typedef child type", .{}); | |
| 342 | }, | |
| 343 | error.OutOfMemory => |e| return e, | |
| 344 | }; | |
| 345 | ||
| 346 | const payload = try c.arena.create(ast.Payload.SimpleVarDecl); | |
| 347 | payload.* = .{ | |
| 348 | .base = .{ .tag = ([2]ZigTag{ .var_simple, .pub_var_simple })[@intFromBool(toplevel)] }, | |
| 349 | .data = .{ | |
| 350 | .name = name, | |
| 351 | .init = init_node, | |
| 352 | }, | |
| 353 | }; | |
| 354 | const node = ZigNode.initPayload(&payload.base); | |
| 355 | ||
| 356 | if (toplevel) { | |
| 357 | try addTopLevelDecl(c, name, node); | |
| 358 | } else { | |
| 359 | try scope.appendNode(node); | |
| 360 | if (node.tag() != .pub_var_simple) { | |
| 361 | try bs.discardVariable(c, name); | |
| 362 | } | |
| 363 | } | |
| 364 | } | |
| 365 | ||
| 366 | fn mangleWeakGlobalName(c: *Context, want_name: []const u8) ![]const u8 { | |
| 367 | var cur_name = want_name; | |
| 368 | ||
| 369 | if (!c.weak_global_names.contains(want_name)) { | |
| 370 | // This type wasn't noticed by the name detection pass, so nothing has been treating this as | |
| 371 | // a weak global name. We must mangle it to avoid conflicts with locals. | |
| 372 | cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); | |
| 373 | } | |
| 374 | ||
| 375 | while (c.global_names.contains(cur_name)) { | |
| 376 | cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); | |
| 377 | } | |
| 378 | return cur_name; | |
| 379 | } | |
| 380 | ||
| 381 | fn transRecordDecl(c: *Context, scope: *Scope, record_ty: Type) Error!void { | |
| 382 | const record_decl = record_ty.getRecord().?; | |
| 383 | if (c.decl_table.get(@intFromPtr(record_decl))) |_| | |
| 384 | return; // Avoid processing this decl twice | |
| 385 | const toplevel = scope.id == .root; | |
| 386 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; | |
| 387 | ||
| 388 | const container_kind: ZigTag = if (record_ty.is(.@"union")) .@"union" else .@"struct"; | |
| 389 | const container_kind_name: []const u8 = @tagName(container_kind); | |
| 390 | ||
| 391 | var is_unnamed = false; | |
| 392 | var bare_name: []const u8 = c.mapper.lookup(record_decl.name); | |
| 393 | var name = bare_name; | |
| 394 | ||
| 395 | if (c.unnamed_typedefs.get(@intFromPtr(record_decl))) |typedef_name| { | |
| 396 | bare_name = typedef_name; | |
| 397 | name = typedef_name; | |
| 398 | } else { | |
| 399 | if (record_ty.isAnonymousRecord(c.comp)) { | |
| 400 | bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); | |
| 401 | is_unnamed = true; | |
| 402 | } | |
| 403 | name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_kind_name, bare_name }); | |
| 404 | if (toplevel and !is_unnamed) { | |
| 405 | name = try mangleWeakGlobalName(c, name); | |
| 406 | } | |
| 407 | } | |
| 408 | if (!toplevel) name = try bs.makeMangledName(c, name); | |
| 409 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(record_decl), name); | |
| 410 | ||
| 411 | const is_pub = toplevel and !is_unnamed; | |
| 412 | const init_node = blk: { | |
| 413 | if (record_decl.isIncomplete()) { | |
| 414 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl), {}); | |
| 415 | break :blk ZigTag.opaque_literal.init(); | |
| 416 | } | |
| 417 | ||
| 418 | var fields = try std.array_list.Managed(ast.Payload.Record.Field).initCapacity(c.gpa, record_decl.fields.len); | |
| 419 | defer fields.deinit(); | |
| 420 | ||
| 421 | // TODO: Add support for flexible array field functions | |
| 422 | var functions = std.array_list.Managed(ZigNode).init(c.gpa); | |
| 423 | defer functions.deinit(); | |
| 424 | ||
| 425 | var unnamed_field_count: u32 = 0; | |
| 426 | ||
| 427 | // If a record doesn't have any attributes that would affect the alignment and | |
| 428 | // layout, then we can just use a simple `extern` type. If it does have attributes, | |
| 429 | // then we need to inspect the layout and assign an `align` value for each field. | |
| 430 | const has_alignment_attributes = record_decl.field_attributes != null or | |
| 431 | record_ty.hasAttribute(.@"packed") or | |
| 432 | record_ty.hasAttribute(.aligned); | |
| 433 | const head_field_alignment: ?c_uint = if (has_alignment_attributes) headFieldAlignment(record_decl) else null; | |
| 434 | ||
| 435 | for (record_decl.fields, 0..) |field, field_index| { | |
| 436 | const field_loc = field.name_tok; | |
| 437 | ||
| 438 | // Demote record to opaque if it contains a bitfield | |
| 439 | if (!field.isRegularField()) { | |
| 440 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl), {}); | |
| 441 | try warn(c, scope, field_loc, "{s} demoted to opaque type - has bitfield", .{container_kind_name}); | |
| 442 | break :blk ZigTag.opaque_literal.init(); | |
| 443 | } | |
| 444 | ||
| 445 | var field_name = c.mapper.lookup(field.name); | |
| 446 | if (!field.isNamed()) { | |
| 447 | field_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{unnamed_field_count}); | |
| 448 | unnamed_field_count += 1; | |
| 449 | } | |
| 450 | const field_type = transType(c, scope, field.ty, .preserve_quals, field_loc) catch |err| switch (err) { | |
| 451 | error.UnsupportedType => { | |
| 452 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl), {}); | |
| 453 | try warn(c, scope, 0, "{s} demoted to opaque type - unable to translate type of field {s}", .{ | |
| 454 | container_kind_name, | |
| 455 | field_name, | |
| 456 | }); | |
| 457 | break :blk ZigTag.opaque_literal.init(); | |
| 458 | }, | |
| 459 | else => |e| return e, | |
| 460 | }; | |
| 461 | ||
| 462 | const field_alignment = if (has_alignment_attributes) | |
| 463 | alignmentForField(record_decl, head_field_alignment, field_index) | |
| 464 | else | |
| 465 | null; | |
| 466 | ||
| 467 | // C99 introduced designated initializers for structs. Omitted fields are implicitly | |
| 468 | // initialized to zero. Some C APIs are designed with this in mind. Defaulting to zero | |
| 469 | // values for translated struct fields permits Zig code to comfortably use such an API. | |
| 470 | const default_value = if (container_kind == .@"struct") | |
| 471 | try ZigTag.std_mem_zeroes.create(c.arena, field_type) | |
| 472 | else | |
| 473 | null; | |
| 474 | ||
| 475 | fields.appendAssumeCapacity(.{ | |
| 476 | .name = field_name, | |
| 477 | .type = field_type, | |
| 478 | .alignment = field_alignment, | |
| 479 | .default_value = default_value, | |
| 480 | }); | |
| 481 | } | |
| 482 | ||
| 483 | const record_payload = try c.arena.create(ast.Payload.Record); | |
| 484 | record_payload.* = .{ | |
| 485 | .base = .{ .tag = container_kind }, | |
| 486 | .data = .{ | |
| 487 | .layout = .@"extern", | |
| 488 | .fields = try c.arena.dupe(ast.Payload.Record.Field, fields.items), | |
| 489 | .functions = try c.arena.dupe(ZigNode, functions.items), | |
| 490 | .variables = &.{}, | |
| 491 | }, | |
| 492 | }; | |
| 493 | break :blk ZigNode.initPayload(&record_payload.base); | |
| 494 | }; | |
| 495 | ||
| 496 | const payload = try c.arena.create(ast.Payload.SimpleVarDecl); | |
| 497 | payload.* = .{ | |
| 498 | .base = .{ .tag = ([2]ZigTag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, | |
| 499 | .data = .{ | |
| 500 | .name = name, | |
| 501 | .init = init_node, | |
| 502 | }, | |
| 503 | }; | |
| 504 | const node = ZigNode.initPayload(&payload.base); | |
| 505 | if (toplevel) { | |
| 506 | try addTopLevelDecl(c, name, node); | |
| 507 | // Only add the alias if the name is available *and* it was caught by | |
| 508 | // name detection. Don't bother performing a weak mangle, since a | |
| 509 | // mangled name is of no real use here. | |
| 510 | if (!is_unnamed and !c.global_names.contains(bare_name) and c.weak_global_names.contains(bare_name)) | |
| 511 | try c.alias_list.append(.{ .alias = bare_name, .name = name }); | |
| 512 | } else { | |
| 513 | try scope.appendNode(node); | |
| 514 | if (node.tag() != .pub_var_simple) { | |
| 515 | try bs.discardVariable(c, name); | |
| 516 | } | |
| 517 | } | |
| 518 | } | |
| 519 | ||
| 520 | fn transFnDecl(c: *Context, fn_decl: NodeIndex, is_pub: bool) Error!void { | |
| 521 | const raw_ty = c.tree.nodes.items(.ty)[@intFromEnum(fn_decl)]; | |
| 522 | const fn_ty = raw_ty.canonicalize(.standard); | |
| 523 | const node_data = c.tree.nodes.items(.data)[@intFromEnum(fn_decl)]; | |
| 524 | if (c.decl_table.get(@intFromPtr(fn_ty.data.func))) |_| | |
| 525 | return; // Avoid processing this decl twice | |
| 526 | ||
| 527 | const fn_name = c.tree.tokSlice(node_data.decl.name); | |
| 528 | if (c.global_scope.sym_table.contains(fn_name)) | |
| 529 | return; // Avoid processing this decl twice | |
| 530 | ||
| 531 | const fn_decl_loc = 0; // TODO | |
| 532 | const has_body = node_data.decl.node != .none; | |
| 533 | const is_always_inline = has_body and raw_ty.getAttribute(.always_inline) != null; | |
| 534 | const proto_ctx = FnProtoContext{ | |
| 535 | .fn_name = fn_name, | |
| 536 | .is_inline = is_always_inline, | |
| 537 | .is_extern = !has_body, | |
| 538 | .is_export = switch (c.tree.nodes.items(.tag)[@intFromEnum(fn_decl)]) { | |
| 539 | .fn_proto, .fn_def => has_body and !is_always_inline, | |
| 540 | ||
| 541 | .inline_fn_proto, .inline_fn_def, .inline_static_fn_proto, .inline_static_fn_def, .static_fn_proto, .static_fn_def => false, | |
| 542 | ||
| 543 | else => unreachable, | |
| 544 | }, | |
| 545 | .is_pub = is_pub, | |
| 546 | }; | |
| 547 | ||
| 548 | const proto_node = transFnType(c, &c.global_scope.base, raw_ty, fn_ty, fn_decl_loc, proto_ctx) catch |err| switch (err) { | |
| 549 | error.UnsupportedType => { | |
| 550 | return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); | |
| 551 | }, | |
| 552 | error.OutOfMemory => |e| return e, | |
| 553 | }; | |
| 554 | ||
| 555 | if (!has_body) { | |
| 556 | return addTopLevelDecl(c, fn_name, proto_node); | |
| 557 | } | |
| 558 | const proto_payload = proto_node.castTag(.func).?; | |
| 559 | ||
| 560 | // actual function definition with body | |
| 561 | const body_stmt = node_data.decl.node; | |
| 562 | var block_scope = try Scope.Block.init(c, &c.global_scope.base, false); | |
| 563 | block_scope.return_type = fn_ty.data.func.return_type; | |
| 564 | defer block_scope.deinit(); | |
| 565 | ||
| 566 | var scope = &block_scope.base; | |
| 567 | _ = &scope; | |
| 568 | ||
| 569 | var param_id: c_uint = 0; | |
| 570 | for (proto_payload.data.params, fn_ty.data.func.params) |*param, param_info| { | |
| 571 | const param_name = param.name orelse { | |
| 572 | proto_payload.data.is_extern = true; | |
| 573 | proto_payload.data.is_export = false; | |
| 574 | proto_payload.data.is_inline = false; | |
| 575 | try warn(c, &c.global_scope.base, fn_decl_loc, "function {s} parameter has no name, demoted to extern", .{fn_name}); | |
| 576 | return addTopLevelDecl(c, fn_name, proto_node); | |
| 577 | }; | |
| 578 | ||
| 579 | const is_const = param_info.ty.qual.@"const"; | |
| 580 | ||
| 581 | const mangled_param_name = try block_scope.makeMangledName(c, param_name); | |
| 582 | param.name = mangled_param_name; | |
| 583 | ||
| 584 | if (!is_const) { | |
| 585 | const bare_arg_name = try std.fmt.allocPrint(c.arena, "arg_{s}", .{mangled_param_name}); | |
| 586 | const arg_name = try block_scope.makeMangledName(c, bare_arg_name); | |
| 587 | param.name = arg_name; | |
| 588 | ||
| 589 | const redecl_node = try ZigTag.arg_redecl.create(c.arena, .{ .actual = mangled_param_name, .mangled = arg_name }); | |
| 590 | try block_scope.statements.append(redecl_node); | |
| 591 | } | |
| 592 | try block_scope.discardVariable(c, mangled_param_name); | |
| 593 | ||
| 594 | param_id += 1; | |
| 595 | } | |
| 596 | ||
| 597 | transCompoundStmtInline(c, body_stmt, &block_scope) catch |err| switch (err) { | |
| 598 | error.OutOfMemory => |e| return e, | |
| 599 | error.UnsupportedTranslation, | |
| 600 | error.UnsupportedType, | |
| 601 | => { | |
| 602 | proto_payload.data.is_extern = true; | |
| 603 | proto_payload.data.is_export = false; | |
| 604 | proto_payload.data.is_inline = false; | |
| 605 | try warn(c, &c.global_scope.base, fn_decl_loc, "unable to translate function, demoted to extern", .{}); | |
| 606 | return addTopLevelDecl(c, fn_name, proto_node); | |
| 607 | }, | |
| 608 | }; | |
| 609 | ||
| 610 | proto_payload.data.body = try block_scope.complete(c); | |
| 611 | return addTopLevelDecl(c, fn_name, proto_node); | |
| 612 | } | |
| 613 | ||
| 614 | fn transVarDecl(c: *Context, node: NodeIndex) Error!void { | |
| 615 | const data = c.tree.nodes.items(.data)[@intFromEnum(node)]; | |
| 616 | const name = c.tree.tokSlice(data.decl.name); | |
| 617 | return failDecl(c, data.decl.name, name, "unable to translate variable declaration", .{}); | |
| 618 | } | |
| 619 | ||
| 620 | fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: *const Type.Enum, field_nodes: []const NodeIndex) Error!void { | |
| 621 | if (c.decl_table.get(@intFromPtr(enum_decl))) |_| | |
| 622 | return; // Avoid processing this decl twice | |
| 623 | const toplevel = scope.id == .root; | |
| 624 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; | |
| 625 | ||
| 626 | var is_unnamed = false; | |
| 627 | var bare_name: []const u8 = c.mapper.lookup(enum_decl.name); | |
| 628 | var name = bare_name; | |
| 629 | if (c.unnamed_typedefs.get(@intFromPtr(enum_decl))) |typedef_name| { | |
| 630 | bare_name = typedef_name; | |
| 631 | name = typedef_name; | |
| 632 | } else { | |
| 633 | if (bare_name.len == 0) { | |
| 634 | bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); | |
| 635 | is_unnamed = true; | |
| 636 | } | |
| 637 | name = try std.fmt.allocPrint(c.arena, "enum_{s}", .{bare_name}); | |
| 638 | } | |
| 639 | if (!toplevel) name = try bs.makeMangledName(c, name); | |
| 640 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(enum_decl), name); | |
| 641 | ||
| 642 | const enum_type_node = if (!enum_decl.isIncomplete()) blk: { | |
| 643 | for (enum_decl.fields, field_nodes) |field, field_node| { | |
| 644 | var enum_val_name: []const u8 = c.mapper.lookup(field.name); | |
| 645 | if (!toplevel) { | |
| 646 | enum_val_name = try bs.makeMangledName(c, enum_val_name); | |
| 647 | } | |
| 648 | ||
| 649 | const enum_const_type_node: ?ZigNode = transType(c, scope, field.ty, .standard, field.name_tok) catch |err| switch (err) { | |
| 650 | error.UnsupportedType => null, | |
| 651 | else => |e| return e, | |
| 652 | }; | |
| 653 | ||
| 654 | const val = c.tree.value_map.get(field_node).?; | |
| 655 | const enum_const_def = try ZigTag.enum_constant.create(c.arena, .{ | |
| 656 | .name = enum_val_name, | |
| 657 | .is_public = toplevel, | |
| 658 | .type = enum_const_type_node, | |
| 659 | .value = try transCreateNodeAPInt(c, val), | |
| 660 | }); | |
| 661 | if (toplevel) | |
| 662 | try addTopLevelDecl(c, enum_val_name, enum_const_def) | |
| 663 | else { | |
| 664 | try scope.appendNode(enum_const_def); | |
| 665 | try bs.discardVariable(c, enum_val_name); | |
| 666 | } | |
| 667 | } | |
| 668 | ||
| 669 | break :blk transType(c, scope, enum_decl.tag_ty, .standard, 0) catch |err| switch (err) { | |
| 670 | error.UnsupportedType => { | |
| 671 | return failDecl(c, 0, name, "unable to translate enum integer type", .{}); | |
| 672 | }, | |
| 673 | else => |e| return e, | |
| 674 | }; | |
| 675 | } else blk: { | |
| 676 | try c.opaque_demotes.put(c.gpa, @intFromPtr(enum_decl), {}); | |
| 677 | break :blk ZigTag.opaque_literal.init(); | |
| 678 | }; | |
| 679 | ||
| 680 | const is_pub = toplevel and !is_unnamed; | |
| 681 | const payload = try c.arena.create(ast.Payload.SimpleVarDecl); | |
| 682 | payload.* = .{ | |
| 683 | .base = .{ .tag = ([2]ZigTag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, | |
| 684 | .data = .{ | |
| 685 | .init = enum_type_node, | |
| 686 | .name = name, | |
| 687 | }, | |
| 688 | }; | |
| 689 | const node = ZigNode.initPayload(&payload.base); | |
| 690 | if (toplevel) { | |
| 691 | try addTopLevelDecl(c, name, node); | |
| 692 | if (!is_unnamed) | |
| 693 | try c.alias_list.append(.{ .alias = bare_name, .name = name }); | |
| 694 | } else { | |
| 695 | try scope.appendNode(node); | |
| 696 | if (node.tag() != .pub_var_simple) { | |
| 697 | try bs.discardVariable(c, name); | |
| 698 | } | |
| 699 | } | |
| 700 | } | |
| 701 | ||
| 702 | fn getTypeStr(c: *Context, ty: Type) ![]const u8 { | |
| 703 | var allocating: std.Io.Writer.Allocating = .init(c.gpa); | |
| 704 | defer allocating.deinit(); | |
| 705 | ty.print(c.mapper, c.comp.langopts, &allocating.writer) catch return error.OutOfMemory; | |
| 706 | return c.arena.dupe(u8, allocating.written()); | |
| 707 | } | |
| 708 | ||
| 709 | fn transType(c: *Context, scope: *Scope, raw_ty: Type, qual_handling: Type.QualHandling, source_loc: TokenIndex) TypeError!ZigNode { | |
| 710 | const ty = raw_ty.canonicalize(qual_handling); | |
| 711 | if (ty.qual.atomic) { | |
| 712 | const type_name = try getTypeStr(c, ty); | |
| 713 | return fail(c, error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{type_name}); | |
| 714 | } | |
| 715 | ||
| 716 | switch (ty.specifier) { | |
| 717 | .void => return ZigTag.type.create(c.arena, "anyopaque"), | |
| 718 | .bool => return ZigTag.type.create(c.arena, "bool"), | |
| 719 | .char => return ZigTag.type.create(c.arena, "c_char"), | |
| 720 | .schar => return ZigTag.type.create(c.arena, "i8"), | |
| 721 | .uchar => return ZigTag.type.create(c.arena, "u8"), | |
| 722 | .short => return ZigTag.type.create(c.arena, "c_short"), | |
| 723 | .ushort => return ZigTag.type.create(c.arena, "c_ushort"), | |
| 724 | .int => return ZigTag.type.create(c.arena, "c_int"), | |
| 725 | .uint => return ZigTag.type.create(c.arena, "c_uint"), | |
| 726 | .long => return ZigTag.type.create(c.arena, "c_long"), | |
| 727 | .ulong => return ZigTag.type.create(c.arena, "c_ulong"), | |
| 728 | .long_long => return ZigTag.type.create(c.arena, "c_longlong"), | |
| 729 | .ulong_long => return ZigTag.type.create(c.arena, "c_ulonglong"), | |
| 730 | .int128 => return ZigTag.type.create(c.arena, "i128"), | |
| 731 | .uint128 => return ZigTag.type.create(c.arena, "u128"), | |
| 732 | .fp16, .float16 => return ZigTag.type.create(c.arena, "f16"), | |
| 733 | .float => return ZigTag.type.create(c.arena, "f32"), | |
| 734 | .double => return ZigTag.type.create(c.arena, "f64"), | |
| 735 | .long_double => return ZigTag.type.create(c.arena, "c_longdouble"), | |
| 736 | .float128 => return ZigTag.type.create(c.arena, "f128"), | |
| 737 | .@"enum" => { | |
| 738 | const enum_decl = ty.data.@"enum"; | |
| 739 | var trans_scope = scope; | |
| 740 | if (enum_decl.name != .empty) { | |
| 741 | const decl_name = c.mapper.lookup(enum_decl.name); | |
| 742 | if (c.weak_global_names.contains(decl_name)) trans_scope = &c.global_scope.base; | |
| 743 | } | |
| 744 | try transEnumDecl(c, trans_scope, enum_decl, &.{}); | |
| 745 | return ZigTag.identifier.create(c.arena, c.decl_table.get(@intFromPtr(enum_decl)).?); | |
| 746 | }, | |
| 747 | .pointer => { | |
| 748 | const child_type = ty.elemType(); | |
| 749 | ||
| 750 | const is_fn_proto = child_type.isFunc(); | |
| 751 | const is_const = is_fn_proto or child_type.isConst(); | |
| 752 | const is_volatile = child_type.qual.@"volatile"; | |
| 753 | const elem_type = try transType(c, scope, child_type, qual_handling, source_loc); | |
| 754 | const ptr_info: @FieldType(ast.Payload.Pointer, "data") = .{ | |
| 755 | .is_const = is_const, | |
| 756 | .is_volatile = is_volatile, | |
| 757 | .elem_type = elem_type, | |
| 758 | }; | |
| 759 | if (is_fn_proto or | |
| 760 | typeIsOpaque(c, child_type) or | |
| 761 | typeWasDemotedToOpaque(c, child_type)) | |
| 762 | { | |
| 763 | const ptr = try ZigTag.single_pointer.create(c.arena, ptr_info); | |
| 764 | return ZigTag.optional_type.create(c.arena, ptr); | |
| 765 | } | |
| 766 | ||
| 767 | return ZigTag.c_pointer.create(c.arena, ptr_info); | |
| 768 | }, | |
| 769 | .unspecified_variable_len_array, .incomplete_array => { | |
| 770 | const child_type = ty.elemType(); | |
| 771 | const is_const = child_type.qual.@"const"; | |
| 772 | const is_volatile = child_type.qual.@"volatile"; | |
| 773 | const elem_type = try transType(c, scope, child_type, qual_handling, source_loc); | |
| 774 | ||
| 775 | return ZigTag.c_pointer.create(c.arena, .{ .is_const = is_const, .is_volatile = is_volatile, .elem_type = elem_type }); | |
| 776 | }, | |
| 777 | .array, | |
| 778 | .static_array, | |
| 779 | => { | |
| 780 | const size = ty.arrayLen().?; | |
| 781 | const elem_type = try transType(c, scope, ty.elemType(), qual_handling, source_loc); | |
| 782 | return ZigTag.array_type.create(c.arena, .{ .len = size, .elem_type = elem_type }); | |
| 783 | }, | |
| 784 | .func, | |
| 785 | .var_args_func, | |
| 786 | .old_style_func, | |
| 787 | => return transFnType(c, scope, ty, ty, source_loc, .{}), | |
| 788 | .@"struct", | |
| 789 | .@"union", | |
| 790 | => { | |
| 791 | var trans_scope = scope; | |
| 792 | if (ty.isAnonymousRecord(c.comp)) { | |
| 793 | const record_decl = ty.data.record; | |
| 794 | const name_id = c.mapper.lookup(record_decl.name); | |
| 795 | if (c.weak_global_names.contains(name_id)) trans_scope = &c.global_scope.base; | |
| 796 | } | |
| 797 | try transRecordDecl(c, trans_scope, ty); | |
| 798 | const name = c.decl_table.get(@intFromPtr(ty.data.record)).?; | |
| 799 | return ZigTag.identifier.create(c.arena, name); | |
| 800 | }, | |
| 801 | .attributed, | |
| 802 | .typeof_type, | |
| 803 | .typeof_expr, | |
| 804 | => unreachable, | |
| 805 | else => return error.UnsupportedType, | |
| 806 | } | |
| 807 | } | |
| 808 | ||
| 809 | /// Look ahead through the fields of the record to determine what the alignment of the record | |
| 810 | /// would be without any align/packed/etc. attributes. This helps us determine whether or not | |
| 811 | /// the fields with 0 offset need an `align` qualifier. Strictly speaking, we could just | |
| 812 | /// pedantically assign those fields the same alignment as the parent's pointer alignment, | |
| 813 | /// but this helps the generated code to be a little less verbose. | |
| 814 | fn headFieldAlignment(record_decl: *const Type.Record) ?c_uint { | |
| 815 | const bits_per_byte = 8; | |
| 816 | const parent_ptr_alignment_bits = record_decl.type_layout.pointer_alignment_bits; | |
| 817 | const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; | |
| 818 | var max_field_alignment_bits: u64 = 0; | |
| 819 | for (record_decl.fields) |field| { | |
| 820 | if (field.ty.getRecord()) |field_record_decl| { | |
| 821 | const child_record_alignment = field_record_decl.type_layout.field_alignment_bits; | |
| 822 | if (child_record_alignment > max_field_alignment_bits) | |
| 823 | max_field_alignment_bits = child_record_alignment; | |
| 824 | } else { | |
| 825 | const field_size = field.layout.size_bits; | |
| 826 | if (field_size > max_field_alignment_bits) | |
| 827 | max_field_alignment_bits = field_size; | |
| 828 | } | |
| 829 | } | |
| 830 | if (max_field_alignment_bits != parent_ptr_alignment_bits) { | |
| 831 | return parent_ptr_alignment; | |
| 832 | } else { | |
| 833 | return null; | |
| 834 | } | |
| 835 | } | |
| 836 | ||
| 837 | /// This function inspects the generated layout of a record to determine the alignment for a | |
| 838 | /// particular field. This approach is necessary because unlike Zig, a C compiler is not | |
| 839 | /// required to fulfill the requested alignment, which means we'd risk generating different code | |
| 840 | /// if we only look at the user-requested alignment. | |
| 841 | /// | |
| 842 | /// Returns a ?c_uint to match Clang's behaviour of using c_uint. The return type can be changed | |
| 843 | /// after the Clang frontend for translate-c is removed. A null value indicates that a field is | |
| 844 | /// 'naturally aligned'. | |
| 845 | fn alignmentForField( | |
| 846 | record_decl: *const Type.Record, | |
| 847 | head_field_alignment: ?c_uint, | |
| 848 | field_index: usize, | |
| 849 | ) ?c_uint { | |
| 850 | const fields = record_decl.fields; | |
| 851 | assert(fields.len != 0); | |
| 852 | const field = fields[field_index]; | |
| 853 | ||
| 854 | const bits_per_byte = 8; | |
| 855 | const parent_ptr_alignment_bits = record_decl.type_layout.pointer_alignment_bits; | |
| 856 | const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; | |
| 857 | ||
| 858 | // bitfields aren't supported yet. Until support is added, records with bitfields | |
| 859 | // should be demoted to opaque, and this function shouldn't be called for them. | |
| 860 | if (!field.isRegularField()) { | |
| 861 | @panic("TODO: add bitfield support for records"); | |
| 862 | } | |
| 863 | ||
| 864 | const field_offset_bits: u64 = field.layout.offset_bits; | |
| 865 | const field_size_bits: u64 = field.layout.size_bits; | |
| 866 | ||
| 867 | // Fields with zero width always have an alignment of 1 | |
| 868 | if (field_size_bits == 0) { | |
| 869 | return 1; | |
| 870 | } | |
| 871 | ||
| 872 | // Fields with 0 offset inherit the parent's pointer alignment. | |
| 873 | if (field_offset_bits == 0) { | |
| 874 | return head_field_alignment; | |
| 875 | } | |
| 876 | ||
| 877 | // Records have a natural alignment when used as a field, and their size is | |
| 878 | // a multiple of this alignment value. For all other types, the natural alignment | |
| 879 | // is their size. | |
| 880 | const field_natural_alignment_bits: u64 = if (field.ty.getRecord()) |record| record.type_layout.field_alignment_bits else field_size_bits; | |
| 881 | const rem_bits = field_offset_bits % field_natural_alignment_bits; | |
| 882 | ||
| 883 | // If there's a remainder, then the alignment is smaller than the field's | |
| 884 | // natural alignment | |
| 885 | if (rem_bits > 0) { | |
| 886 | const rem_alignment = rem_bits / bits_per_byte; | |
| 887 | if (rem_alignment > 0 and std.math.isPowerOfTwo(rem_alignment)) { | |
| 888 | const actual_alignment = @min(rem_alignment, parent_ptr_alignment); | |
| 889 | return @as(c_uint, @truncate(actual_alignment)); | |
| 890 | } else { | |
| 891 | return 1; | |
| 892 | } | |
| 893 | } | |
| 894 | ||
| 895 | // A field may have an offset which positions it to be naturally aligned, but the | |
| 896 | // parent's pointer alignment determines if this is actually true, so we take the minimum | |
| 897 | // value. | |
| 898 | // For example, a float field (4 bytes wide) with a 4 byte offset is positioned to have natural | |
| 899 | // alignment, but if the parent pointer alignment is 2, then the actual alignment of the | |
| 900 | // float is 2. | |
| 901 | const field_natural_alignment: u64 = field_natural_alignment_bits / bits_per_byte; | |
| 902 | const offset_alignment = field_offset_bits / bits_per_byte; | |
| 903 | const possible_alignment = @min(parent_ptr_alignment, offset_alignment); | |
| 904 | if (possible_alignment == field_natural_alignment) { | |
| 905 | return null; | |
| 906 | } else if (possible_alignment < field_natural_alignment) { | |
| 907 | if (std.math.isPowerOfTwo(possible_alignment)) { | |
| 908 | return possible_alignment; | |
| 909 | } else { | |
| 910 | return 1; | |
| 911 | } | |
| 912 | } else { // possible_alignment > field_natural_alignment | |
| 913 | // Here, the field is positioned be at a higher alignment than it's natural alignment. This means we | |
| 914 | // need to determine whether it's a specified alignment. We can determine that from the padding preceding | |
| 915 | // the field. | |
| 916 | const padding_from_prev_field: u64 = blk: { | |
| 917 | if (field_offset_bits != 0) { | |
| 918 | const previous_field = fields[field_index - 1]; | |
| 919 | break :blk (field_offset_bits - previous_field.layout.offset_bits) - previous_field.layout.size_bits; | |
| 920 | } else { | |
| 921 | break :blk 0; | |
| 922 | } | |
| 923 | }; | |
| 924 | if (padding_from_prev_field < field_natural_alignment_bits) { | |
| 925 | return null; | |
| 926 | } else { | |
| 927 | return possible_alignment; | |
| 928 | } | |
| 929 | } | |
| 930 | } | |
| 931 | ||
| 932 | const FnProtoContext = struct { | |
| 933 | is_pub: bool = false, | |
| 934 | is_export: bool = false, | |
| 935 | is_extern: bool = false, | |
| 936 | is_inline: bool = false, | |
| 937 | fn_name: ?[]const u8 = null, | |
| 938 | }; | |
| 939 | ||
| 940 | fn transFnType( | |
| 941 | c: *Context, | |
| 942 | scope: *Scope, | |
| 943 | raw_ty: Type, | |
| 944 | fn_ty: Type, | |
| 945 | source_loc: TokenIndex, | |
| 946 | ctx: FnProtoContext, | |
| 947 | ) !ZigNode { | |
| 948 | const param_count: usize = fn_ty.data.func.params.len; | |
| 949 | const fn_params = try c.arena.alloc(ast.Payload.Param, param_count); | |
| 950 | ||
| 951 | for (fn_ty.data.func.params, fn_params) |param_info, *param_node| { | |
| 952 | const param_ty = param_info.ty; | |
| 953 | const is_noalias = param_ty.qual.restrict; | |
| 954 | ||
| 955 | const param_name: ?[]const u8 = if (param_info.name == .empty) | |
| 956 | null | |
| 957 | else | |
| 958 | c.mapper.lookup(param_info.name); | |
| 959 | ||
| 960 | const type_node = try transType(c, scope, param_ty, .standard, param_info.name_tok); | |
| 961 | param_node.* = .{ | |
| 962 | .is_noalias = is_noalias, | |
| 963 | .name = param_name, | |
| 964 | .type = type_node, | |
| 965 | }; | |
| 966 | } | |
| 967 | ||
| 968 | const linksection_string = blk: { | |
| 969 | if (raw_ty.getAttribute(.section)) |section| { | |
| 970 | break :blk c.comp.interner.get(section.name.ref()).bytes; | |
| 971 | } | |
| 972 | break :blk null; | |
| 973 | }; | |
| 974 | ||
| 975 | const alignment: ?c_uint = raw_ty.requestedAlignment(c.comp) orelse null; | |
| 976 | ||
| 977 | const explicit_callconv = null; | |
| 978 | // const explicit_callconv = if ((ctx.is_inline or ctx.is_export or ctx.is_extern) and ctx.cc == .C) null else ctx.cc; | |
| 979 | ||
| 980 | const return_type_node = blk: { | |
| 981 | if (raw_ty.getAttribute(.noreturn) != null) { | |
| 982 | break :blk ZigTag.noreturn_type.init(); | |
| 983 | } else { | |
| 984 | const return_ty = fn_ty.data.func.return_type; | |
| 985 | if (return_ty.is(.void)) { | |
| 986 | // convert primitive anyopaque to actual void (only for return type) | |
| 987 | break :blk ZigTag.void_type.init(); | |
| 988 | } else { | |
| 989 | break :blk transType(c, scope, return_ty, .standard, source_loc) catch |err| switch (err) { | |
| 990 | error.UnsupportedType => { | |
| 991 | try warn(c, scope, source_loc, "unsupported function proto return type", .{}); | |
| 992 | return err; | |
| 993 | }, | |
| 994 | error.OutOfMemory => |e| return e, | |
| 995 | }; | |
| 996 | } | |
| 997 | } | |
| 998 | }; | |
| 999 | ||
| 1000 | const payload = try c.arena.create(ast.Payload.Func); | |
| 1001 | payload.* = .{ | |
| 1002 | .base = .{ .tag = .func }, | |
| 1003 | .data = .{ | |
| 1004 | .is_pub = ctx.is_pub, | |
| 1005 | .is_extern = ctx.is_extern, | |
| 1006 | .is_export = ctx.is_export, | |
| 1007 | .is_inline = ctx.is_inline, | |
| 1008 | .is_var_args = switch (fn_ty.specifier) { | |
| 1009 | .func => false, | |
| 1010 | .var_args_func => true, | |
| 1011 | .old_style_func => !ctx.is_export and !ctx.is_inline, | |
| 1012 | else => unreachable, | |
| 1013 | }, | |
| 1014 | .name = ctx.fn_name, | |
| 1015 | .linksection_string = linksection_string, | |
| 1016 | .explicit_callconv = explicit_callconv, | |
| 1017 | .params = fn_params, | |
| 1018 | .return_type = return_type_node, | |
| 1019 | .body = null, | |
| 1020 | .alignment = alignment, | |
| 1021 | }, | |
| 1022 | }; | |
| 1023 | return ZigNode.initPayload(&payload.base); | |
| 1024 | } | |
| 1025 | ||
| 1026 | fn transStmt(c: *Context, node: NodeIndex) TransError!ZigNode { | |
| 1027 | _ = c; | |
| 1028 | _ = node; | |
| 1029 | return error.UnsupportedTranslation; | |
| 1030 | } | |
| 1031 | ||
| 1032 | fn transCompoundStmtInline(c: *Context, compound: NodeIndex, block: *Scope.Block) TransError!void { | |
| 1033 | const data = c.tree.nodes.items(.data)[@intFromEnum(compound)]; | |
| 1034 | var buf: [2]NodeIndex = undefined; | |
| 1035 | // TODO move these helpers to Aro | |
| 1036 | const stmts = switch (c.tree.nodes.items(.tag)[@intFromEnum(compound)]) { | |
| 1037 | .compound_stmt_two => blk: { | |
| 1038 | if (data.bin.lhs != .none) buf[0] = data.bin.lhs; | |
| 1039 | if (data.bin.rhs != .none) buf[1] = data.bin.rhs; | |
| 1040 | break :blk buf[0 .. @as(u32, @intFromBool(data.bin.lhs != .none)) + @intFromBool(data.bin.rhs != .none)]; | |
| 1041 | }, | |
| 1042 | .compound_stmt => c.tree.data[data.range.start..data.range.end], | |
| 1043 | else => unreachable, | |
| 1044 | }; | |
| 1045 | for (stmts) |stmt| { | |
| 1046 | const result = try transStmt(c, stmt); | |
| 1047 | switch (result.tag()) { | |
| 1048 | .declaration, .empty_block => {}, | |
| 1049 | else => try block.statements.append(result), | |
| 1050 | } | |
| 1051 | } | |
| 1052 | } | |
| 1053 | ||
| 1054 | fn recordHasBitfield(record: *const Type.Record) bool { | |
| 1055 | if (record.isIncomplete()) return false; | |
| 1056 | for (record.fields) |field| { | |
| 1057 | if (!field.isRegularField()) return true; | |
| 1058 | } | |
| 1059 | return false; | |
| 1060 | } | |
| 1061 | ||
| 1062 | fn typeIsOpaque(c: *Context, ty: Type) bool { | |
| 1063 | return switch (ty.specifier) { | |
| 1064 | .void => true, | |
| 1065 | .@"struct", .@"union" => recordHasBitfield(ty.getRecord().?), | |
| 1066 | .typeof_type => typeIsOpaque(c, ty.data.sub_type.*), | |
| 1067 | .typeof_expr => typeIsOpaque(c, ty.data.expr.ty), | |
| 1068 | .attributed => typeIsOpaque(c, ty.data.attributed.base), | |
| 1069 | else => false, | |
| 1070 | }; | |
| 1071 | } | |
| 1072 | ||
| 1073 | fn typeWasDemotedToOpaque(c: *Context, ty: Type) bool { | |
| 1074 | switch (ty.specifier) { | |
| 1075 | .@"struct", .@"union" => { | |
| 1076 | const record = ty.getRecord().?; | |
| 1077 | if (c.opaque_demotes.contains(@intFromPtr(record))) return true; | |
| 1078 | for (record.fields) |field| { | |
| 1079 | if (typeWasDemotedToOpaque(c, field.ty)) return true; | |
| 1080 | } | |
| 1081 | return false; | |
| 1082 | }, | |
| 1083 | ||
| 1084 | .@"enum" => return c.opaque_demotes.contains(@intFromPtr(ty.data.@"enum")), | |
| 1085 | ||
| 1086 | .typeof_type => return typeWasDemotedToOpaque(c, ty.data.sub_type.*), | |
| 1087 | .typeof_expr => return typeWasDemotedToOpaque(c, ty.data.expr.ty), | |
| 1088 | .attributed => return typeWasDemotedToOpaque(c, ty.data.attributed.base), | |
| 1089 | else => return false, | |
| 1090 | } | |
| 1091 | } | |
| 1092 | ||
| 1093 | fn transCompoundStmt(c: *Context, scope: *Scope, compound: NodeIndex) TransError!ZigNode { | |
| 1094 | var block_scope = try Scope.Block.init(c, scope, false); | |
| 1095 | defer block_scope.deinit(); | |
| 1096 | try transCompoundStmtInline(c, compound, &block_scope); | |
| 1097 | return try block_scope.complete(c); | |
| 1098 | } | |
| 1099 | ||
| 1100 | fn transExpr(c: *Context, node: NodeIndex, result_used: ResultUsed) TransError!ZigNode { | |
| 1101 | std.debug.assert(node != .none); | |
| 1102 | const ty = c.tree.nodes.items(.ty)[@intFromEnum(node)]; | |
| 1103 | if (c.tree.value_map.get(node)) |val| { | |
| 1104 | // TODO handle other values | |
| 1105 | const int = try transCreateNodeAPInt(c, val); | |
| 1106 | const as_node = try ZigTag.as.create(c.arena, .{ | |
| 1107 | .lhs = try transType(c, undefined, ty, .standard, undefined), | |
| 1108 | .rhs = int, | |
| 1109 | }); | |
| 1110 | return maybeSuppressResult(c, result_used, as_node); | |
| 1111 | } | |
| 1112 | const node_tags = c.tree.nodes.items(.tag); | |
| 1113 | switch (node_tags[@intFromEnum(node)]) { | |
| 1114 | else => unreachable, // Not an expression. | |
| 1115 | } | |
| 1116 | return .none; | |
| 1117 | } | |
| 1118 | ||
| 1119 | fn transCreateNodeAPInt(c: *Context, int: aro.Value) !ZigNode { | |
| 1120 | var space: aro.Interner.Tag.Int.BigIntSpace = undefined; | |
| 1121 | var big = int.toBigInt(&space, c.comp); | |
| 1122 | const is_negative = !big.positive; | |
| 1123 | big.positive = true; | |
| 1124 | ||
| 1125 | const str = big.toStringAlloc(c.arena, 10, .lower) catch |err| switch (err) { | |
| 1126 | error.OutOfMemory => return error.OutOfMemory, | |
| 1127 | }; | |
| 1128 | const res = try ZigTag.integer_literal.create(c.arena, str); | |
| 1129 | if (is_negative) return ZigTag.negate.create(c.arena, res); | |
| 1130 | return res; | |
| 1131 | } | |
| 1132 | ||
| 1133 | pub const PatternList = struct { | |
| 1134 | patterns: []Pattern, | |
| 1135 | ||
| 1136 | /// Templates must be function-like macros | |
| 1137 | /// first element is macro source, second element is the name of the function | |
| 1138 | /// in std.lib.zig.c_translation.Macros which implements it | |
| 1139 | const templates = [_][2][]const u8{ | |
| 1140 | [2][]const u8{ "f_SUFFIX(X) (X ## f)", "F_SUFFIX" }, | |
| 1141 | [2][]const u8{ "F_SUFFIX(X) (X ## F)", "F_SUFFIX" }, | |
| 1142 | ||
| 1143 | [2][]const u8{ "u_SUFFIX(X) (X ## u)", "U_SUFFIX" }, | |
| 1144 | [2][]const u8{ "U_SUFFIX(X) (X ## U)", "U_SUFFIX" }, | |
| 1145 | ||
| 1146 | [2][]const u8{ "l_SUFFIX(X) (X ## l)", "L_SUFFIX" }, | |
| 1147 | [2][]const u8{ "L_SUFFIX(X) (X ## L)", "L_SUFFIX" }, | |
| 1148 | ||
| 1149 | [2][]const u8{ "ul_SUFFIX(X) (X ## ul)", "UL_SUFFIX" }, | |
| 1150 | [2][]const u8{ "uL_SUFFIX(X) (X ## uL)", "UL_SUFFIX" }, | |
| 1151 | [2][]const u8{ "Ul_SUFFIX(X) (X ## Ul)", "UL_SUFFIX" }, | |
| 1152 | [2][]const u8{ "UL_SUFFIX(X) (X ## UL)", "UL_SUFFIX" }, | |
| 1153 | ||
| 1154 | [2][]const u8{ "ll_SUFFIX(X) (X ## ll)", "LL_SUFFIX" }, | |
| 1155 | [2][]const u8{ "LL_SUFFIX(X) (X ## LL)", "LL_SUFFIX" }, | |
| 1156 | ||
| 1157 | [2][]const u8{ "ull_SUFFIX(X) (X ## ull)", "ULL_SUFFIX" }, | |
| 1158 | [2][]const u8{ "uLL_SUFFIX(X) (X ## uLL)", "ULL_SUFFIX" }, | |
| 1159 | [2][]const u8{ "Ull_SUFFIX(X) (X ## Ull)", "ULL_SUFFIX" }, | |
| 1160 | [2][]const u8{ "ULL_SUFFIX(X) (X ## ULL)", "ULL_SUFFIX" }, | |
| 1161 | ||
| 1162 | [2][]const u8{ "f_SUFFIX(X) X ## f", "F_SUFFIX" }, | |
| 1163 | [2][]const u8{ "F_SUFFIX(X) X ## F", "F_SUFFIX" }, | |
| 1164 | ||
| 1165 | [2][]const u8{ "u_SUFFIX(X) X ## u", "U_SUFFIX" }, | |
| 1166 | [2][]const u8{ "U_SUFFIX(X) X ## U", "U_SUFFIX" }, | |
| 1167 | ||
| 1168 | [2][]const u8{ "l_SUFFIX(X) X ## l", "L_SUFFIX" }, | |
| 1169 | [2][]const u8{ "L_SUFFIX(X) X ## L", "L_SUFFIX" }, | |
| 1170 | ||
| 1171 | [2][]const u8{ "ul_SUFFIX(X) X ## ul", "UL_SUFFIX" }, | |
| 1172 | [2][]const u8{ "uL_SUFFIX(X) X ## uL", "UL_SUFFIX" }, | |
| 1173 | [2][]const u8{ "Ul_SUFFIX(X) X ## Ul", "UL_SUFFIX" }, | |
| 1174 | [2][]const u8{ "UL_SUFFIX(X) X ## UL", "UL_SUFFIX" }, | |
| 1175 | ||
| 1176 | [2][]const u8{ "ll_SUFFIX(X) X ## ll", "LL_SUFFIX" }, | |
| 1177 | [2][]const u8{ "LL_SUFFIX(X) X ## LL", "LL_SUFFIX" }, | |
| 1178 | ||
| 1179 | [2][]const u8{ "ull_SUFFIX(X) X ## ull", "ULL_SUFFIX" }, | |
| 1180 | [2][]const u8{ "uLL_SUFFIX(X) X ## uLL", "ULL_SUFFIX" }, | |
| 1181 | [2][]const u8{ "Ull_SUFFIX(X) X ## Ull", "ULL_SUFFIX" }, | |
| 1182 | [2][]const u8{ "ULL_SUFFIX(X) X ## ULL", "ULL_SUFFIX" }, | |
| 1183 | ||
| 1184 | [2][]const u8{ "CAST_OR_CALL(X, Y) (X)(Y)", "CAST_OR_CALL" }, | |
| 1185 | [2][]const u8{ "CAST_OR_CALL(X, Y) ((X)(Y))", "CAST_OR_CALL" }, | |
| 1186 | ||
| 1187 | [2][]const u8{ | |
| 1188 | \\wl_container_of(ptr, sample, member) \ | |
| 1189 | \\(__typeof__(sample))((char *)(ptr) - \ | |
| 1190 | \\ offsetof(__typeof__(*sample), member)) | |
| 1191 | , | |
| 1192 | "WL_CONTAINER_OF", | |
| 1193 | }, | |
| 1194 | ||
| 1195 | [2][]const u8{ "IGNORE_ME(X) ((void)(X))", "DISCARD" }, | |
| 1196 | [2][]const u8{ "IGNORE_ME(X) (void)(X)", "DISCARD" }, | |
| 1197 | [2][]const u8{ "IGNORE_ME(X) ((const void)(X))", "DISCARD" }, | |
| 1198 | [2][]const u8{ "IGNORE_ME(X) (const void)(X)", "DISCARD" }, | |
| 1199 | [2][]const u8{ "IGNORE_ME(X) ((volatile void)(X))", "DISCARD" }, | |
| 1200 | [2][]const u8{ "IGNORE_ME(X) (volatile void)(X)", "DISCARD" }, | |
| 1201 | [2][]const u8{ "IGNORE_ME(X) ((const volatile void)(X))", "DISCARD" }, | |
| 1202 | [2][]const u8{ "IGNORE_ME(X) (const volatile void)(X)", "DISCARD" }, | |
| 1203 | [2][]const u8{ "IGNORE_ME(X) ((volatile const void)(X))", "DISCARD" }, | |
| 1204 | [2][]const u8{ "IGNORE_ME(X) (volatile const void)(X)", "DISCARD" }, | |
| 1205 | }; | |
| 1206 | ||
| 1207 | /// Assumes that `ms` represents a tokenized function-like macro. | |
| 1208 | fn buildArgsHash(allocator: mem.Allocator, ms: MacroSlicer, hash: *ArgsPositionMap) MacroProcessingError!void { | |
| 1209 | assert(ms.tokens.len > 2); | |
| 1210 | assert(ms.tokens[0].id.isMacroIdentifier()); | |
| 1211 | assert(ms.tokens[1].id == .l_paren); | |
| 1212 | ||
| 1213 | var i: usize = 2; | |
| 1214 | while (true) : (i += 1) { | |
| 1215 | const token = ms.tokens[i]; | |
| 1216 | switch (token.id) { | |
| 1217 | .r_paren => break, | |
| 1218 | .comma => continue, | |
| 1219 | .identifier, .extended_identifier => { | |
| 1220 | const identifier = ms.slice(token); | |
| 1221 | try hash.put(allocator, identifier, i); | |
| 1222 | }, | |
| 1223 | else => return error.UnexpectedMacroToken, | |
| 1224 | } | |
| 1225 | } | |
| 1226 | } | |
| 1227 | ||
| 1228 | const Pattern = struct { | |
| 1229 | tokens: []const CToken, | |
| 1230 | source: []const u8, | |
| 1231 | impl: []const u8, | |
| 1232 | args_hash: ArgsPositionMap, | |
| 1233 | ||
| 1234 | fn init(self: *Pattern, allocator: mem.Allocator, template: [2][]const u8) Error!void { | |
| 1235 | const source = template[0]; | |
| 1236 | const impl = template[1]; | |
| 1237 | ||
| 1238 | var tok_list = std.array_list.Managed(CToken).init(allocator); | |
| 1239 | defer tok_list.deinit(); | |
| 1240 | try tokenizeMacro(source, &tok_list); | |
| 1241 | const tokens = try allocator.dupe(CToken, tok_list.items); | |
| 1242 | ||
| 1243 | self.* = .{ | |
| 1244 | .tokens = tokens, | |
| 1245 | .source = source, | |
| 1246 | .impl = impl, | |
| 1247 | .args_hash = .{}, | |
| 1248 | }; | |
| 1249 | const ms = MacroSlicer{ .source = source, .tokens = tokens }; | |
| 1250 | buildArgsHash(allocator, ms, &self.args_hash) catch |err| switch (err) { | |
| 1251 | error.UnexpectedMacroToken => unreachable, | |
| 1252 | else => |e| return e, | |
| 1253 | }; | |
| 1254 | } | |
| 1255 | ||
| 1256 | fn deinit(self: *Pattern, allocator: mem.Allocator) void { | |
| 1257 | self.args_hash.deinit(allocator); | |
| 1258 | allocator.free(self.tokens); | |
| 1259 | } | |
| 1260 | ||
| 1261 | /// This function assumes that `ms` has already been validated to contain a function-like | |
| 1262 | /// macro, and that the parsed template macro in `self` also contains a function-like | |
| 1263 | /// macro. Please review this logic carefully if changing that assumption. Two | |
| 1264 | /// function-like macros are considered equivalent if and only if they contain the same | |
| 1265 | /// list of tokens, modulo parameter names. | |
| 1266 | pub fn isEquivalent(self: Pattern, ms: MacroSlicer, args_hash: ArgsPositionMap) bool { | |
| 1267 | if (self.tokens.len != ms.tokens.len) return false; | |
| 1268 | if (args_hash.count() != self.args_hash.count()) return false; | |
| 1269 | ||
| 1270 | var i: usize = 2; | |
| 1271 | while (self.tokens[i].id != .r_paren) : (i += 1) {} | |
| 1272 | ||
| 1273 | const pattern_slicer = MacroSlicer{ .source = self.source, .tokens = self.tokens }; | |
| 1274 | while (i < self.tokens.len) : (i += 1) { | |
| 1275 | const pattern_token = self.tokens[i]; | |
| 1276 | const macro_token = ms.tokens[i]; | |
| 1277 | if (pattern_token.id != macro_token.id) return false; | |
| 1278 | ||
| 1279 | const pattern_bytes = pattern_slicer.slice(pattern_token); | |
| 1280 | const macro_bytes = ms.slice(macro_token); | |
| 1281 | switch (pattern_token.id) { | |
| 1282 | .identifier, .extended_identifier => { | |
| 1283 | const pattern_arg_index = self.args_hash.get(pattern_bytes); | |
| 1284 | const macro_arg_index = args_hash.get(macro_bytes); | |
| 1285 | ||
| 1286 | if (pattern_arg_index == null and macro_arg_index == null) { | |
| 1287 | if (!mem.eql(u8, pattern_bytes, macro_bytes)) return false; | |
| 1288 | } else if (pattern_arg_index != null and macro_arg_index != null) { | |
| 1289 | if (pattern_arg_index.? != macro_arg_index.?) return false; | |
| 1290 | } else { | |
| 1291 | return false; | |
| 1292 | } | |
| 1293 | }, | |
| 1294 | .string_literal, .char_literal, .pp_num => { | |
| 1295 | if (!mem.eql(u8, pattern_bytes, macro_bytes)) return false; | |
| 1296 | }, | |
| 1297 | else => { | |
| 1298 | // other tags correspond to keywords and operators that do not contain a "payload" | |
| 1299 | // that can vary | |
| 1300 | }, | |
| 1301 | } | |
| 1302 | } | |
| 1303 | return true; | |
| 1304 | } | |
| 1305 | }; | |
| 1306 | ||
| 1307 | pub fn init(allocator: mem.Allocator) Error!PatternList { | |
| 1308 | const patterns = try allocator.alloc(Pattern, templates.len); | |
| 1309 | for (templates, 0..) |template, i| { | |
| 1310 | try patterns[i].init(allocator, template); | |
| 1311 | } | |
| 1312 | return PatternList{ .patterns = patterns }; | |
| 1313 | } | |
| 1314 | ||
| 1315 | pub fn deinit(self: *PatternList, allocator: mem.Allocator) void { | |
| 1316 | for (self.patterns) |*pattern| pattern.deinit(allocator); | |
| 1317 | allocator.free(self.patterns); | |
| 1318 | } | |
| 1319 | ||
| 1320 | pub fn match(self: PatternList, allocator: mem.Allocator, ms: MacroSlicer) Error!?Pattern { | |
| 1321 | var args_hash: ArgsPositionMap = .{}; | |
| 1322 | defer args_hash.deinit(allocator); | |
| 1323 | ||
| 1324 | buildArgsHash(allocator, ms, &args_hash) catch |err| switch (err) { | |
| 1325 | error.UnexpectedMacroToken => return null, | |
| 1326 | else => |e| return e, | |
| 1327 | }; | |
| 1328 | ||
| 1329 | for (self.patterns) |pattern| if (pattern.isEquivalent(ms, args_hash)) return pattern; | |
| 1330 | return null; | |
| 1331 | } | |
| 1332 | }; | |
| 1333 | ||
| 1334 | pub const MacroSlicer = struct { | |
| 1335 | source: []const u8, | |
| 1336 | tokens: []const CToken, | |
| 1337 | ||
| 1338 | pub fn slice(self: MacroSlicer, token: CToken) []const u8 { | |
| 1339 | return self.source[token.start..token.end]; | |
| 1340 | } | |
| 1341 | }; | |
| 1342 | ||
| 1343 | // Maps macro parameter names to token position, for determining if different | |
| 1344 | // identifiers refer to the same positional argument in different macros. | |
| 1345 | pub const ArgsPositionMap = std.StringArrayHashMapUnmanaged(usize); | |
| 1346 | ||
| 1347 | pub const Error = std.mem.Allocator.Error; | |
| 1348 | pub const MacroProcessingError = Error || error{UnexpectedMacroToken}; | |
| 1349 | pub const TypeError = Error || error{UnsupportedType}; | |
| 1350 | pub const TransError = TypeError || error{UnsupportedTranslation}; | |
| 1351 | ||
| 1352 | pub const SymbolTable = std.StringArrayHashMap(ast.Node); | |
| 1353 | pub const AliasList = std.array_list.Managed(struct { | |
| 1354 | alias: []const u8, | |
| 1355 | name: []const u8, | |
| 1356 | }); | |
| 1357 | ||
| 1358 | pub const ResultUsed = enum { | |
| 1359 | used, | |
| 1360 | unused, | |
| 1361 | }; | |
| 1362 | ||
| 1363 | pub fn ScopeExtra(comptime ScopeExtraContext: type, comptime ScopeExtraType: type) type { | |
| 1364 | return struct { | |
| 1365 | id: Id, | |
| 1366 | parent: ?*ScopeExtraScope, | |
| 1367 | ||
| 1368 | const ScopeExtraScope = @This(); | |
| 1369 | ||
| 1370 | pub const Id = enum { | |
| 1371 | block, | |
| 1372 | root, | |
| 1373 | condition, | |
| 1374 | loop, | |
| 1375 | do_loop, | |
| 1376 | }; | |
| 1377 | ||
| 1378 | /// Used for the scope of condition expressions, for example `if (cond)`. | |
| 1379 | /// The block is lazily initialised because it is only needed for rare | |
| 1380 | /// cases of comma operators being used. | |
| 1381 | pub const Condition = struct { | |
| 1382 | base: ScopeExtraScope, | |
| 1383 | block: ?Block = null, | |
| 1384 | ||
| 1385 | pub fn getBlockScope(self: *Condition, c: *ScopeExtraContext) !*Block { | |
| 1386 | if (self.block) |*b| return b; | |
| 1387 | self.block = try Block.init(c, &self.base, true); | |
| 1388 | return &self.block.?; | |
| 1389 | } | |
| 1390 | ||
| 1391 | pub fn deinit(self: *Condition) void { | |
| 1392 | if (self.block) |*b| b.deinit(); | |
| 1393 | } | |
| 1394 | }; | |
| 1395 | ||
| 1396 | /// Represents an in-progress Node.Block. This struct is stack-allocated. | |
| 1397 | /// When it is deinitialized, it produces an Node.Block which is allocated | |
| 1398 | /// into the main arena. | |
| 1399 | pub const Block = struct { | |
| 1400 | base: ScopeExtraScope, | |
| 1401 | statements: std.array_list.Managed(ast.Node), | |
| 1402 | variables: AliasList, | |
| 1403 | mangle_count: u32 = 0, | |
| 1404 | label: ?[]const u8 = null, | |
| 1405 | ||
| 1406 | /// By default all variables are discarded, since we do not know in advance if they | |
| 1407 | /// will be used. This maps the variable's name to the Discard payload, so that if | |
| 1408 | /// the variable is subsequently referenced we can indicate that the discard should | |
| 1409 | /// be skipped during the intermediate AST -> Zig AST render step. | |
| 1410 | variable_discards: std.StringArrayHashMap(*ast.Payload.Discard), | |
| 1411 | ||
| 1412 | /// When the block corresponds to a function, keep track of the return type | |
| 1413 | /// so that the return expression can be cast, if necessary | |
| 1414 | return_type: ?ScopeExtraType = null, | |
| 1415 | ||
| 1416 | /// C static local variables are wrapped in a block-local struct. The struct | |
| 1417 | /// is named after the (mangled) variable name, the Zig variable within the | |
| 1418 | /// struct itself is given this name. | |
| 1419 | pub const static_inner_name = "static"; | |
| 1420 | ||
| 1421 | /// C extern variables declared within a block are wrapped in a block-local | |
| 1422 | /// struct. The struct is named ExternLocal_[variable_name], the Zig variable | |
| 1423 | /// within the struct itself is [variable_name] by neccessity since it's an | |
| 1424 | /// extern reference to an existing symbol. | |
| 1425 | pub const extern_inner_prepend = "ExternLocal"; | |
| 1426 | ||
| 1427 | pub fn init(c: *ScopeExtraContext, parent: *ScopeExtraScope, labeled: bool) !Block { | |
| 1428 | var blk = Block{ | |
| 1429 | .base = .{ | |
| 1430 | .id = .block, | |
| 1431 | .parent = parent, | |
| 1432 | }, | |
| 1433 | .statements = std.array_list.Managed(ast.Node).init(c.gpa), | |
| 1434 | .variables = AliasList.init(c.gpa), | |
| 1435 | .variable_discards = std.StringArrayHashMap(*ast.Payload.Discard).init(c.gpa), | |
| 1436 | }; | |
| 1437 | if (labeled) { | |
| 1438 | blk.label = try blk.makeMangledName(c, "blk"); | |
| 1439 | } | |
| 1440 | return blk; | |
| 1441 | } | |
| 1442 | ||
| 1443 | pub fn deinit(self: *Block) void { | |
| 1444 | self.statements.deinit(); | |
| 1445 | self.variables.deinit(); | |
| 1446 | self.variable_discards.deinit(); | |
| 1447 | self.* = undefined; | |
| 1448 | } | |
| 1449 | ||
| 1450 | pub fn complete(self: *Block, c: *ScopeExtraContext) !ast.Node { | |
| 1451 | if (self.base.parent.?.id == .do_loop) { | |
| 1452 | // We reserve 1 extra statement if the parent is a do_loop. This is in case of | |
| 1453 | // do while, we want to put `if (cond) break;` at the end. | |
| 1454 | const alloc_len = self.statements.items.len + @intFromBool(self.base.parent.?.id == .do_loop); | |
| 1455 | var stmts = try c.arena.alloc(ast.Node, alloc_len); | |
| 1456 | stmts.len = self.statements.items.len; | |
| 1457 | @memcpy(stmts[0..self.statements.items.len], self.statements.items); | |
| 1458 | return ast.Node.Tag.block.create(c.arena, .{ | |
| 1459 | .label = self.label, | |
| 1460 | .stmts = stmts, | |
| 1461 | }); | |
| 1462 | } | |
| 1463 | if (self.statements.items.len == 0) return ast.Node.Tag.empty_block.init(); | |
| 1464 | return ast.Node.Tag.block.create(c.arena, .{ | |
| 1465 | .label = self.label, | |
| 1466 | .stmts = try c.arena.dupe(ast.Node, self.statements.items), | |
| 1467 | }); | |
| 1468 | } | |
| 1469 | ||
| 1470 | /// Given the desired name, return a name that does not shadow anything from outer scopes. | |
| 1471 | /// Inserts the returned name into the scope. | |
| 1472 | /// The name will not be visible to callers of getAlias. | |
| 1473 | pub fn reserveMangledName(scope: *Block, c: *ScopeExtraContext, name: []const u8) ![]const u8 { | |
| 1474 | return scope.createMangledName(c, name, true); | |
| 1475 | } | |
| 1476 | ||
| 1477 | /// Same as reserveMangledName, but enables the alias immediately. | |
| 1478 | pub fn makeMangledName(scope: *Block, c: *ScopeExtraContext, name: []const u8) ![]const u8 { | |
| 1479 | return scope.createMangledName(c, name, false); | |
| 1480 | } | |
| 1481 | ||
| 1482 | pub fn createMangledName(scope: *Block, c: *ScopeExtraContext, name: []const u8, reservation: bool) ![]const u8 { | |
| 1483 | const name_copy = try c.arena.dupe(u8, name); | |
| 1484 | var proposed_name = name_copy; | |
| 1485 | while (scope.contains(proposed_name)) { | |
| 1486 | scope.mangle_count += 1; | |
| 1487 | proposed_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ name, scope.mangle_count }); | |
| 1488 | } | |
| 1489 | const new_mangle = try scope.variables.addOne(); | |
| 1490 | if (reservation) { | |
| 1491 | new_mangle.* = .{ .name = name_copy, .alias = name_copy }; | |
| 1492 | } else { | |
| 1493 | new_mangle.* = .{ .name = name_copy, .alias = proposed_name }; | |
| 1494 | } | |
| 1495 | return proposed_name; | |
| 1496 | } | |
| 1497 | ||
| 1498 | pub fn getAlias(scope: *Block, name: []const u8) []const u8 { | |
| 1499 | for (scope.variables.items) |p| { | |
| 1500 | if (std.mem.eql(u8, p.name, name)) | |
| 1501 | return p.alias; | |
| 1502 | } | |
| 1503 | return scope.base.parent.?.getAlias(name); | |
| 1504 | } | |
| 1505 | ||
| 1506 | /// Finds the (potentially) mangled struct name for a locally scoped extern variable or function given the original declaration name. | |
| 1507 | /// | |
| 1508 | /// Block scoped extern declarations translate to: | |
| 1509 | /// const MangledStructName = struct {extern [qualifiers] original_extern_variable_name: [type]}; | |
| 1510 | /// This finds MangledStructName given original_extern_variable_name for referencing correctly in transDeclRefExpr() | |
| 1511 | pub fn getLocalExternAlias(scope: *Block, name: []const u8) ?[]const u8 { | |
| 1512 | for (scope.statements.items) |node| { | |
| 1513 | switch (node.tag()) { | |
| 1514 | .extern_local_var => { | |
| 1515 | const parent_node = node.castTag(.extern_local_var).?; | |
| 1516 | const init_node = parent_node.data.init.castTag(.var_decl).?; | |
| 1517 | if (std.mem.eql(u8, init_node.data.name, name)) { | |
| 1518 | return parent_node.data.name; | |
| 1519 | } | |
| 1520 | }, | |
| 1521 | .extern_local_fn => { | |
| 1522 | const parent_node = node.castTag(.extern_local_fn).?; | |
| 1523 | const init_node = parent_node.data.init.castTag(.func).?; | |
| 1524 | if (std.mem.eql(u8, init_node.data.name.?, name)) { | |
| 1525 | return parent_node.data.name; | |
| 1526 | } | |
| 1527 | }, | |
| 1528 | else => {}, | |
| 1529 | } | |
| 1530 | } | |
| 1531 | return null; | |
| 1532 | } | |
| 1533 | ||
| 1534 | pub fn localContains(scope: *Block, name: []const u8) bool { | |
| 1535 | for (scope.variables.items) |p| { | |
| 1536 | if (std.mem.eql(u8, p.alias, name)) | |
| 1537 | return true; | |
| 1538 | } | |
| 1539 | return false; | |
| 1540 | } | |
| 1541 | ||
| 1542 | pub fn contains(scope: *Block, name: []const u8) bool { | |
| 1543 | if (scope.localContains(name)) | |
| 1544 | return true; | |
| 1545 | return scope.base.parent.?.contains(name); | |
| 1546 | } | |
| 1547 | ||
| 1548 | pub fn discardVariable(scope: *Block, c: *ScopeExtraContext, name: []const u8) Error!void { | |
| 1549 | const name_node = try ast.Node.Tag.identifier.create(c.arena, name); | |
| 1550 | const discard = try ast.Node.Tag.discard.create(c.arena, .{ .should_skip = false, .value = name_node }); | |
| 1551 | try scope.statements.append(discard); | |
| 1552 | try scope.variable_discards.putNoClobber(name, discard.castTag(.discard).?); | |
| 1553 | } | |
| 1554 | }; | |
| 1555 | ||
| 1556 | pub const Root = struct { | |
| 1557 | base: ScopeExtraScope, | |
| 1558 | sym_table: SymbolTable, | |
| 1559 | blank_macros: std.StringArrayHashMap(void), | |
| 1560 | context: *ScopeExtraContext, | |
| 1561 | nodes: std.array_list.Managed(ast.Node), | |
| 1562 | ||
| 1563 | pub fn init(c: *ScopeExtraContext) Root { | |
| 1564 | return .{ | |
| 1565 | .base = .{ | |
| 1566 | .id = .root, | |
| 1567 | .parent = null, | |
| 1568 | }, | |
| 1569 | .sym_table = SymbolTable.init(c.gpa), | |
| 1570 | .blank_macros = std.StringArrayHashMap(void).init(c.gpa), | |
| 1571 | .context = c, | |
| 1572 | .nodes = std.array_list.Managed(ast.Node).init(c.gpa), | |
| 1573 | }; | |
| 1574 | } | |
| 1575 | ||
| 1576 | pub fn deinit(scope: *Root) void { | |
| 1577 | scope.sym_table.deinit(); | |
| 1578 | scope.blank_macros.deinit(); | |
| 1579 | scope.nodes.deinit(); | |
| 1580 | } | |
| 1581 | ||
| 1582 | /// Check if the global scope contains this name, without looking into the "future", e.g. | |
| 1583 | /// ignore the preprocessed decl and macro names. | |
| 1584 | pub fn containsNow(scope: *Root, name: []const u8) bool { | |
| 1585 | return scope.sym_table.contains(name); | |
| 1586 | } | |
| 1587 | ||
| 1588 | /// Check if the global scope contains the name, includes all decls that haven't been translated yet. | |
| 1589 | pub fn contains(scope: *Root, name: []const u8) bool { | |
| 1590 | return scope.containsNow(name) or scope.context.global_names.contains(name) or scope.context.weak_global_names.contains(name); | |
| 1591 | } | |
| 1592 | }; | |
| 1593 | ||
| 1594 | pub fn findBlockScope(inner: *ScopeExtraScope, c: *ScopeExtraContext) !*Block { | |
| 1595 | var scope = inner; | |
| 1596 | while (true) { | |
| 1597 | switch (scope.id) { | |
| 1598 | .root => unreachable, | |
| 1599 | .block => return @fieldParentPtr("base", scope), | |
| 1600 | .condition => return @as(*Condition, @fieldParentPtr("base", scope)).getBlockScope(c), | |
| 1601 | else => scope = scope.parent.?, | |
| 1602 | } | |
| 1603 | } | |
| 1604 | } | |
| 1605 | ||
| 1606 | pub fn findBlockReturnType(inner: *ScopeExtraScope) ScopeExtraType { | |
| 1607 | var scope = inner; | |
| 1608 | while (true) { | |
| 1609 | switch (scope.id) { | |
| 1610 | .root => unreachable, | |
| 1611 | .block => { | |
| 1612 | const block: *Block = @fieldParentPtr("base", scope); | |
| 1613 | if (block.return_type) |ty| return ty; | |
| 1614 | scope = scope.parent.?; | |
| 1615 | }, | |
| 1616 | else => scope = scope.parent.?, | |
| 1617 | } | |
| 1618 | } | |
| 1619 | } | |
| 1620 | ||
| 1621 | pub fn getAlias(scope: *ScopeExtraScope, name: []const u8) []const u8 { | |
| 1622 | return switch (scope.id) { | |
| 1623 | .root => name, | |
| 1624 | .block => @as(*Block, @fieldParentPtr("base", scope)).getAlias(name), | |
| 1625 | .loop, .do_loop, .condition => scope.parent.?.getAlias(name), | |
| 1626 | }; | |
| 1627 | } | |
| 1628 | ||
| 1629 | pub fn getLocalExternAlias(scope: *ScopeExtraScope, name: []const u8) ?[]const u8 { | |
| 1630 | return switch (scope.id) { | |
| 1631 | .root => null, | |
| 1632 | .block => ret: { | |
| 1633 | const block = @as(*Block, @fieldParentPtr("base", scope)); | |
| 1634 | const alias_name = block.getLocalExternAlias(name); | |
| 1635 | if (alias_name) |_alias_name| { | |
| 1636 | break :ret _alias_name; | |
| 1637 | } | |
| 1638 | break :ret scope.parent.?.getLocalExternAlias(name); | |
| 1639 | }, | |
| 1640 | .loop, .do_loop, .condition => scope.parent.?.getLocalExternAlias(name), | |
| 1641 | }; | |
| 1642 | } | |
| 1643 | ||
| 1644 | pub fn contains(scope: *ScopeExtraScope, name: []const u8) bool { | |
| 1645 | return switch (scope.id) { | |
| 1646 | .root => @as(*Root, @fieldParentPtr("base", scope)).contains(name), | |
| 1647 | .block => @as(*Block, @fieldParentPtr("base", scope)).contains(name), | |
| 1648 | .loop, .do_loop, .condition => scope.parent.?.contains(name), | |
| 1649 | }; | |
| 1650 | } | |
| 1651 | ||
| 1652 | pub fn getBreakableScope(inner: *ScopeExtraScope) *ScopeExtraScope { | |
| 1653 | var scope = inner; | |
| 1654 | while (true) { | |
| 1655 | switch (scope.id) { | |
| 1656 | .root => unreachable, | |
| 1657 | .loop, .do_loop => return scope, | |
| 1658 | else => scope = scope.parent.?, | |
| 1659 | } | |
| 1660 | } | |
| 1661 | } | |
| 1662 | ||
| 1663 | /// Appends a node to the first block scope if inside a function, or to the root tree if not. | |
| 1664 | pub fn appendNode(inner: *ScopeExtraScope, node: ast.Node) !void { | |
| 1665 | var scope = inner; | |
| 1666 | while (true) { | |
| 1667 | switch (scope.id) { | |
| 1668 | .root => { | |
| 1669 | const root: *Root = @fieldParentPtr("base", scope); | |
| 1670 | return root.nodes.append(node); | |
| 1671 | }, | |
| 1672 | .block => { | |
| 1673 | const block: *Block = @fieldParentPtr("base", scope); | |
| 1674 | return block.statements.append(node); | |
| 1675 | }, | |
| 1676 | else => scope = scope.parent.?, | |
| 1677 | } | |
| 1678 | } | |
| 1679 | } | |
| 1680 | ||
| 1681 | pub fn skipVariableDiscard(inner: *ScopeExtraScope, name: []const u8) void { | |
| 1682 | if (true) { | |
| 1683 | // TODO: due to 'local variable is never mutated' errors, we can | |
| 1684 | // only skip discards if a variable is used as an lvalue, which | |
| 1685 | // we don't currently have detection for in translate-c. | |
| 1686 | // Once #17584 is completed, perhaps we can do away with this | |
| 1687 | // logic entirely, and instead rely on render to fixup code. | |
| 1688 | return; | |
| 1689 | } | |
| 1690 | var scope = inner; | |
| 1691 | while (true) { | |
| 1692 | switch (scope.id) { | |
| 1693 | .root => return, | |
| 1694 | .block => { | |
| 1695 | const block: *Block = @fieldParentPtr("base", scope); | |
| 1696 | if (block.variable_discards.get(name)) |discard| { | |
| 1697 | discard.data.should_skip = true; | |
| 1698 | return; | |
| 1699 | } | |
| 1700 | }, | |
| 1701 | else => {}, | |
| 1702 | } | |
| 1703 | scope = scope.parent.?; | |
| 1704 | } | |
| 1705 | } | |
| 1706 | }; | |
| 1707 | } | |
| 1708 | ||
| 1709 | pub fn tokenizeMacro(source: []const u8, tok_list: *std.array_list.Managed(CToken)) Error!void { | |
| 1710 | var tokenizer: aro.Tokenizer = .{ | |
| 1711 | .buf = source, | |
| 1712 | .source = .unused, | |
| 1713 | .langopts = .{}, | |
| 1714 | }; | |
| 1715 | while (true) { | |
| 1716 | const tok = tokenizer.next(); | |
| 1717 | switch (tok.id) { | |
| 1718 | .whitespace => continue, | |
| 1719 | .nl, .eof => { | |
| 1720 | try tok_list.append(tok); | |
| 1721 | break; | |
| 1722 | }, | |
| 1723 | else => {}, | |
| 1724 | } | |
| 1725 | try tok_list.append(tok); | |
| 1726 | } | |
| 1727 | } | |
| 1728 | ||
| 1729 | // Testing here instead of test/translate_c.zig allows us to also test that the | |
| 1730 | // mapped function exists in `std.zig.c_translation.Macros` | |
| 1731 | test "Macro matching" { | |
| 1732 | const testing = std.testing; | |
| 1733 | const helper = struct { | |
| 1734 | const MacroFunctions = std.zig.c_translation.Macros; | |
| 1735 | fn checkMacro(allocator: mem.Allocator, pattern_list: PatternList, source: []const u8, comptime expected_match: ?[]const u8) !void { | |
| 1736 | var tok_list = std.array_list.Managed(CToken).init(allocator); | |
| 1737 | defer tok_list.deinit(); | |
| 1738 | try tokenizeMacro(source, &tok_list); | |
| 1739 | const macro_slicer: MacroSlicer = .{ .source = source, .tokens = tok_list.items }; | |
| 1740 | const matched = try pattern_list.match(allocator, macro_slicer); | |
| 1741 | if (expected_match) |expected| { | |
| 1742 | try testing.expectEqualStrings(expected, matched.?.impl); | |
| 1743 | try testing.expect(@hasDecl(MacroFunctions, expected)); | |
| 1744 | } else { | |
| 1745 | try testing.expectEqual(@as(@TypeOf(matched), null), matched); | |
| 1746 | } | |
| 1747 | } | |
| 1748 | }; | |
| 1749 | const allocator = std.testing.allocator; | |
| 1750 | var pattern_list = try PatternList.init(allocator); | |
| 1751 | defer pattern_list.deinit(allocator); | |
| 1752 | ||
| 1753 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## F)", "F_SUFFIX"); | |
| 1754 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## U)", "U_SUFFIX"); | |
| 1755 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## L)", "L_SUFFIX"); | |
| 1756 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## LL)", "LL_SUFFIX"); | |
| 1757 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## UL)", "UL_SUFFIX"); | |
| 1758 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## ULL)", "ULL_SUFFIX"); | |
| 1759 | try helper.checkMacro(allocator, pattern_list, | |
| 1760 | \\container_of(a, b, c) \ | |
| 1761 | \\(__typeof__(b))((char *)(a) - \ | |
| 1762 | \\ offsetof(__typeof__(*b), c)) | |
| 1763 | , "WL_CONTAINER_OF"); | |
| 1764 | ||
| 1765 | try helper.checkMacro(allocator, pattern_list, "NO_MATCH(X, Y) (X + Y)", null); | |
| 1766 | try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) (X)(Y)", "CAST_OR_CALL"); | |
| 1767 | try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) ((X)(Y))", "CAST_OR_CALL"); | |
| 1768 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (void)(X)", "DISCARD"); | |
| 1769 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((void)(X))", "DISCARD"); | |
| 1770 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const void)(X)", "DISCARD"); | |
| 1771 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const void)(X))", "DISCARD"); | |
| 1772 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile void)(X)", "DISCARD"); | |
| 1773 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile void)(X))", "DISCARD"); | |
| 1774 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const volatile void)(X)", "DISCARD"); | |
| 1775 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const volatile void)(X))", "DISCARD"); | |
| 1776 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile const void)(X)", "DISCARD"); | |
| 1777 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile const void)(X))", "DISCARD"); | |
| 1778 | } | |
| 1779 | ||
| 1780 | /// Renders errors and fatal errors + associated notes (e.g. "expanded from here"); does not render warnings or associated notes | |
| 1781 | /// Terminates with exit code 1 | |
| 1782 | fn renderErrorsAndExit(comp: *aro.Compilation) noreturn { | |
| 1783 | defer std.process.exit(1); | |
| 1784 | ||
| 1785 | var buffer: [1000]u8 = undefined; | |
| 1786 | var writer = aro.Diagnostics.defaultMsgWriter(std.Io.tty.detectConfig(std.fs.File.stderr()), &buffer); | |
| 1787 | defer writer.deinit(); // writer deinit must run *before* exit so that stderr is flushed | |
| 1788 | ||
| 1789 | var saw_error = false; | |
| 1790 | for (comp.diagnostics.list.items) |msg| { | |
| 1791 | switch (msg.kind) { | |
| 1792 | .@"error", .@"fatal error" => { | |
| 1793 | saw_error = true; | |
| 1794 | aro.Diagnostics.renderMessage(comp, &writer, msg); | |
| 1795 | }, | |
| 1796 | .warning => saw_error = false, | |
| 1797 | .note => { | |
| 1798 | if (saw_error) { | |
| 1799 | aro.Diagnostics.renderMessage(comp, &writer, msg); | |
| 1800 | } | |
| 1801 | }, | |
| 1802 | .off => {}, | |
| 1803 | .default => unreachable, | |
| 1804 | } | |
| 1805 | } | |
| 1806 | } | |
| 1807 | ||
| 1808 | pub fn main() !void { | |
| 1809 | var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator); | |
| 1810 | defer arena_instance.deinit(); | |
| 1811 | const arena = arena_instance.allocator(); | |
| 1812 | ||
| 1813 | var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init; | |
| 1814 | const gpa = general_purpose_allocator.allocator(); | |
| 1815 | ||
| 1816 | const args = try std.process.argsAlloc(arena); | |
| 1817 | ||
| 1818 | var aro_comp = aro.Compilation.init(gpa, std.fs.cwd()); | |
| 1819 | defer aro_comp.deinit(); | |
| 1820 | ||
| 1821 | var tree = translate(gpa, &aro_comp, args) catch |err| switch (err) { | |
| 1822 | error.ParsingFailed, error.FatalError => renderErrorsAndExit(&aro_comp), | |
| 1823 | error.OutOfMemory => return error.OutOfMemory, | |
| 1824 | error.WriteFailed => return error.WriteFailed, | |
| 1825 | error.StreamTooLong => std.process.fatal("An input file was larger than 4GiB", .{}), | |
| 1826 | }; | |
| 1827 | defer tree.deinit(gpa); | |
| 1828 | ||
| 1829 | const formatted = try tree.renderAlloc(arena); | |
| 1830 | try std.fs.File.stdout().writeAll(formatted); | |
| 1831 | return std.process.cleanExit(); | |
| 1832 | } |
lib/compiler/aro_translate_c/ast.zig deleted-2982| ... | ... | @@ -1,2982 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Allocator = std.mem.Allocator; | |
| 3 | ||
| 4 | pub const Node = extern union { | |
| 5 | /// If the tag value is less than Tag.no_payload_count, then no pointer | |
| 6 | /// dereference is needed. | |
| 7 | tag_if_small_enough: usize, | |
| 8 | ptr_otherwise: *Payload, | |
| 9 | ||
| 10 | pub const Tag = enum { | |
| 11 | /// Declarations add themselves to the correct scopes and should not be emitted as this tag. | |
| 12 | declaration, | |
| 13 | null_literal, | |
| 14 | undefined_literal, | |
| 15 | /// opaque {} | |
| 16 | opaque_literal, | |
| 17 | true_literal, | |
| 18 | false_literal, | |
| 19 | empty_block, | |
| 20 | return_void, | |
| 21 | zero_literal, | |
| 22 | one_literal, | |
| 23 | void_type, | |
| 24 | noreturn_type, | |
| 25 | @"anytype", | |
| 26 | @"continue", | |
| 27 | @"break", | |
| 28 | // After this, the tag requires a payload. | |
| 29 | ||
| 30 | integer_literal, | |
| 31 | float_literal, | |
| 32 | string_literal, | |
| 33 | char_literal, | |
| 34 | enum_literal, | |
| 35 | /// "string"[0..end] | |
| 36 | string_slice, | |
| 37 | identifier, | |
| 38 | fn_identifier, | |
| 39 | @"if", | |
| 40 | /// if (!operand) break; | |
| 41 | if_not_break, | |
| 42 | @"while", | |
| 43 | /// while (true) operand | |
| 44 | while_true, | |
| 45 | @"switch", | |
| 46 | /// else => operand, | |
| 47 | switch_else, | |
| 48 | /// items => body, | |
| 49 | switch_prong, | |
| 50 | break_val, | |
| 51 | @"return", | |
| 52 | field_access, | |
| 53 | array_access, | |
| 54 | call, | |
| 55 | var_decl, | |
| 56 | /// const name = struct { init } | |
| 57 | static_local_var, | |
| 58 | /// const ExternLocal_name = struct { init } | |
| 59 | extern_local_var, | |
| 60 | /// const ExternLocal_name = struct { init } | |
| 61 | extern_local_fn, | |
| 62 | /// var name = init.* | |
| 63 | mut_str, | |
| 64 | func, | |
| 65 | warning, | |
| 66 | @"struct", | |
| 67 | @"union", | |
| 68 | @"comptime", | |
| 69 | @"defer", | |
| 70 | array_init, | |
| 71 | tuple, | |
| 72 | container_init, | |
| 73 | container_init_dot, | |
| 74 | helpers_cast, | |
| 75 | /// _ = operand; | |
| 76 | discard, | |
| 77 | ||
| 78 | // a + b | |
| 79 | add, | |
| 80 | // a = b | |
| 81 | add_assign, | |
| 82 | // c = (a = b) | |
| 83 | add_wrap, | |
| 84 | add_wrap_assign, | |
| 85 | sub, | |
| 86 | sub_assign, | |
| 87 | sub_wrap, | |
| 88 | sub_wrap_assign, | |
| 89 | mul, | |
| 90 | mul_assign, | |
| 91 | mul_wrap, | |
| 92 | mul_wrap_assign, | |
| 93 | div, | |
| 94 | div_assign, | |
| 95 | shl, | |
| 96 | shl_assign, | |
| 97 | shr, | |
| 98 | shr_assign, | |
| 99 | mod, | |
| 100 | mod_assign, | |
| 101 | @"and", | |
| 102 | @"or", | |
| 103 | less_than, | |
| 104 | less_than_equal, | |
| 105 | greater_than, | |
| 106 | greater_than_equal, | |
| 107 | equal, | |
| 108 | not_equal, | |
| 109 | bit_and, | |
| 110 | bit_and_assign, | |
| 111 | bit_or, | |
| 112 | bit_or_assign, | |
| 113 | bit_xor, | |
| 114 | bit_xor_assign, | |
| 115 | array_cat, | |
| 116 | ellipsis3, | |
| 117 | assign, | |
| 118 | ||
| 119 | /// @import("std").zig.c_builtins.<name> | |
| 120 | import_c_builtin, | |
| 121 | /// @intCast(operand) | |
| 122 | int_cast, | |
| 123 | /// @constCast(operand) | |
| 124 | const_cast, | |
| 125 | /// @volatileCast(operand) | |
| 126 | volatile_cast, | |
| 127 | /// @import("std").zig.c_translation.promoteIntLiteral(value, type, base) | |
| 128 | helpers_promoteIntLiteral, | |
| 129 | /// @import("std").zig.c_translation.signedRemainder(lhs, rhs) | |
| 130 | signed_remainder, | |
| 131 | /// @divTrunc(lhs, rhs) | |
| 132 | div_trunc, | |
| 133 | /// @intFromBool(operand) | |
| 134 | int_from_bool, | |
| 135 | /// @as(lhs, rhs) | |
| 136 | as, | |
| 137 | /// @truncate(operand) | |
| 138 | truncate, | |
| 139 | /// @bitCast(operand) | |
| 140 | bit_cast, | |
| 141 | /// @floatCast(operand) | |
| 142 | float_cast, | |
| 143 | /// @intFromFloat(operand) | |
| 144 | int_from_float, | |
| 145 | /// @floatFromInt(operand) | |
| 146 | float_from_int, | |
| 147 | /// @ptrFromInt(operand) | |
| 148 | ptr_from_int, | |
| 149 | /// @intFromPtr(operand) | |
| 150 | int_from_ptr, | |
| 151 | /// @alignCast(operand) | |
| 152 | align_cast, | |
| 153 | /// @ptrCast(operand) | |
| 154 | ptr_cast, | |
| 155 | /// @divExact(lhs, rhs) | |
| 156 | div_exact, | |
| 157 | /// @offsetOf(lhs, rhs) | |
| 158 | offset_of, | |
| 159 | /// @splat(operand) | |
| 160 | vector_zero_init, | |
| 161 | /// @shuffle(type, a, b, mask) | |
| 162 | shuffle, | |
| 163 | /// @extern(ty, .{ .name = n }) | |
| 164 | builtin_extern, | |
| 165 | ||
| 166 | /// @import("std").zig.c_translation.MacroArithmetic.<op>(lhs, rhs) | |
| 167 | macro_arithmetic, | |
| 168 | ||
| 169 | asm_simple, | |
| 170 | ||
| 171 | negate, | |
| 172 | negate_wrap, | |
| 173 | bit_not, | |
| 174 | not, | |
| 175 | address_of, | |
| 176 | /// .? | |
| 177 | unwrap, | |
| 178 | /// .* | |
| 179 | deref, | |
| 180 | ||
| 181 | block, | |
| 182 | /// { operand } | |
| 183 | block_single, | |
| 184 | ||
| 185 | sizeof, | |
| 186 | alignof, | |
| 187 | typeof, | |
| 188 | typeinfo, | |
| 189 | type, | |
| 190 | ||
| 191 | optional_type, | |
| 192 | c_pointer, | |
| 193 | single_pointer, | |
| 194 | array_type, | |
| 195 | null_sentinel_array_type, | |
| 196 | ||
| 197 | /// @import("std").zig.c_translation.sizeof(operand) | |
| 198 | helpers_sizeof, | |
| 199 | /// @import("std").zig.c_translation.FlexibleArrayType(lhs, rhs) | |
| 200 | helpers_flexible_array_type, | |
| 201 | /// @import("std").zig.c_translation.shuffleVectorIndex(lhs, rhs) | |
| 202 | helpers_shuffle_vector_index, | |
| 203 | /// @import("std").zig.c_translation.Macro.<operand> | |
| 204 | helpers_macro, | |
| 205 | /// @Vector(lhs, rhs) | |
| 206 | vector, | |
| 207 | /// @import("std").mem.zeroes(operand) | |
| 208 | std_mem_zeroes, | |
| 209 | /// @import("std").mem.zeroInit(lhs, rhs) | |
| 210 | std_mem_zeroinit, | |
| 211 | // pub const name = @compileError(msg); | |
| 212 | fail_decl, | |
| 213 | // var actual = mangled; | |
| 214 | arg_redecl, | |
| 215 | /// pub const alias = actual; | |
| 216 | alias, | |
| 217 | /// const name = init; | |
| 218 | var_simple, | |
| 219 | /// pub const name = init; | |
| 220 | pub_var_simple, | |
| 221 | /// pub? const name (: type)? = value | |
| 222 | enum_constant, | |
| 223 | ||
| 224 | /// pub inline fn name(params) return_type body | |
| 225 | pub_inline_fn, | |
| 226 | ||
| 227 | /// [0]type{} | |
| 228 | empty_array, | |
| 229 | /// [1]type{val} ** count | |
| 230 | array_filler, | |
| 231 | ||
| 232 | pub const last_no_payload_tag = Tag.@"break"; | |
| 233 | pub const no_payload_count = @intFromEnum(last_no_payload_tag) + 1; | |
| 234 | ||
| 235 | pub fn Type(comptime t: Tag) type { | |
| 236 | return switch (t) { | |
| 237 | .declaration, | |
| 238 | .null_literal, | |
| 239 | .undefined_literal, | |
| 240 | .opaque_literal, | |
| 241 | .true_literal, | |
| 242 | .false_literal, | |
| 243 | .empty_block, | |
| 244 | .return_void, | |
| 245 | .zero_literal, | |
| 246 | .one_literal, | |
| 247 | .void_type, | |
| 248 | .noreturn_type, | |
| 249 | .@"anytype", | |
| 250 | .@"continue", | |
| 251 | .@"break", | |
| 252 | => @compileError("Type Tag " ++ @tagName(t) ++ " has no payload"), | |
| 253 | ||
| 254 | .std_mem_zeroes, | |
| 255 | .@"return", | |
| 256 | .@"comptime", | |
| 257 | .@"defer", | |
| 258 | .asm_simple, | |
| 259 | .negate, | |
| 260 | .negate_wrap, | |
| 261 | .bit_not, | |
| 262 | .not, | |
| 263 | .optional_type, | |
| 264 | .address_of, | |
| 265 | .unwrap, | |
| 266 | .deref, | |
| 267 | .int_from_ptr, | |
| 268 | .empty_array, | |
| 269 | .while_true, | |
| 270 | .if_not_break, | |
| 271 | .switch_else, | |
| 272 | .block_single, | |
| 273 | .helpers_sizeof, | |
| 274 | .int_from_bool, | |
| 275 | .sizeof, | |
| 276 | .alignof, | |
| 277 | .typeof, | |
| 278 | .typeinfo, | |
| 279 | .align_cast, | |
| 280 | .truncate, | |
| 281 | .bit_cast, | |
| 282 | .float_cast, | |
| 283 | .int_from_float, | |
| 284 | .float_from_int, | |
| 285 | .ptr_from_int, | |
| 286 | .ptr_cast, | |
| 287 | .int_cast, | |
| 288 | .const_cast, | |
| 289 | .volatile_cast, | |
| 290 | .vector_zero_init, | |
| 291 | => Payload.UnOp, | |
| 292 | ||
| 293 | .add, | |
| 294 | .add_assign, | |
| 295 | .add_wrap, | |
| 296 | .add_wrap_assign, | |
| 297 | .sub, | |
| 298 | .sub_assign, | |
| 299 | .sub_wrap, | |
| 300 | .sub_wrap_assign, | |
| 301 | .mul, | |
| 302 | .mul_assign, | |
| 303 | .mul_wrap, | |
| 304 | .mul_wrap_assign, | |
| 305 | .div, | |
| 306 | .div_assign, | |
| 307 | .shl, | |
| 308 | .shl_assign, | |
| 309 | .shr, | |
| 310 | .shr_assign, | |
| 311 | .mod, | |
| 312 | .mod_assign, | |
| 313 | .@"and", | |
| 314 | .@"or", | |
| 315 | .less_than, | |
| 316 | .less_than_equal, | |
| 317 | .greater_than, | |
| 318 | .greater_than_equal, | |
| 319 | .equal, | |
| 320 | .not_equal, | |
| 321 | .bit_and, | |
| 322 | .bit_and_assign, | |
| 323 | .bit_or, | |
| 324 | .bit_or_assign, | |
| 325 | .bit_xor, | |
| 326 | .bit_xor_assign, | |
| 327 | .div_trunc, | |
| 328 | .signed_remainder, | |
| 329 | .as, | |
| 330 | .array_cat, | |
| 331 | .ellipsis3, | |
| 332 | .assign, | |
| 333 | .array_access, | |
| 334 | .std_mem_zeroinit, | |
| 335 | .helpers_flexible_array_type, | |
| 336 | .helpers_shuffle_vector_index, | |
| 337 | .vector, | |
| 338 | .div_exact, | |
| 339 | .offset_of, | |
| 340 | .helpers_cast, | |
| 341 | => Payload.BinOp, | |
| 342 | ||
| 343 | .integer_literal, | |
| 344 | .float_literal, | |
| 345 | .string_literal, | |
| 346 | .char_literal, | |
| 347 | .enum_literal, | |
| 348 | .identifier, | |
| 349 | .fn_identifier, | |
| 350 | .warning, | |
| 351 | .type, | |
| 352 | .helpers_macro, | |
| 353 | .import_c_builtin, | |
| 354 | => Payload.Value, | |
| 355 | .discard => Payload.Discard, | |
| 356 | .@"if" => Payload.If, | |
| 357 | .@"while" => Payload.While, | |
| 358 | .@"switch", .array_init, .switch_prong => Payload.Switch, | |
| 359 | .break_val => Payload.BreakVal, | |
| 360 | .call => Payload.Call, | |
| 361 | .var_decl => Payload.VarDecl, | |
| 362 | .func => Payload.Func, | |
| 363 | .@"struct", .@"union" => Payload.Record, | |
| 364 | .tuple => Payload.TupleInit, | |
| 365 | .container_init => Payload.ContainerInit, | |
| 366 | .container_init_dot => Payload.ContainerInitDot, | |
| 367 | .helpers_promoteIntLiteral => Payload.PromoteIntLiteral, | |
| 368 | .block => Payload.Block, | |
| 369 | .c_pointer, .single_pointer => Payload.Pointer, | |
| 370 | .array_type, .null_sentinel_array_type => Payload.Array, | |
| 371 | .arg_redecl, .alias, .fail_decl => Payload.ArgRedecl, | |
| 372 | .var_simple, | |
| 373 | .pub_var_simple, | |
| 374 | .static_local_var, | |
| 375 | .extern_local_var, | |
| 376 | .extern_local_fn, | |
| 377 | .mut_str, | |
| 378 | => Payload.SimpleVarDecl, | |
| 379 | .enum_constant => Payload.EnumConstant, | |
| 380 | .array_filler => Payload.ArrayFiller, | |
| 381 | .pub_inline_fn => Payload.PubInlineFn, | |
| 382 | .field_access => Payload.FieldAccess, | |
| 383 | .string_slice => Payload.StringSlice, | |
| 384 | .shuffle => Payload.Shuffle, | |
| 385 | .builtin_extern => Payload.Extern, | |
| 386 | .macro_arithmetic => Payload.MacroArithmetic, | |
| 387 | }; | |
| 388 | } | |
| 389 | ||
| 390 | pub fn init(comptime t: Tag) Node { | |
| 391 | comptime std.debug.assert(@intFromEnum(t) < Tag.no_payload_count); | |
| 392 | return .{ .tag_if_small_enough = @intFromEnum(t) }; | |
| 393 | } | |
| 394 | ||
| 395 | pub fn create(comptime t: Tag, ally: Allocator, data: Data(t)) error{OutOfMemory}!Node { | |
| 396 | const ptr = try ally.create(t.Type()); | |
| 397 | ptr.* = .{ | |
| 398 | .base = .{ .tag = t }, | |
| 399 | .data = data, | |
| 400 | }; | |
| 401 | return Node{ .ptr_otherwise = &ptr.base }; | |
| 402 | } | |
| 403 | ||
| 404 | pub fn Data(comptime t: Tag) type { | |
| 405 | return @FieldType(t.Type(), "data"); | |
| 406 | } | |
| 407 | }; | |
| 408 | ||
| 409 | pub fn tag(self: Node) Tag { | |
| 410 | if (self.tag_if_small_enough < Tag.no_payload_count) { | |
| 411 | return @as(Tag, @enumFromInt(@as(std.meta.Tag(Tag), @intCast(self.tag_if_small_enough)))); | |
| 412 | } else { | |
| 413 | return self.ptr_otherwise.tag; | |
| 414 | } | |
| 415 | } | |
| 416 | ||
| 417 | pub fn castTag(self: Node, comptime t: Tag) ?*t.Type() { | |
| 418 | if (self.tag_if_small_enough < Tag.no_payload_count) | |
| 419 | return null; | |
| 420 | ||
| 421 | if (self.ptr_otherwise.tag == t) | |
| 422 | return @alignCast(@fieldParentPtr("base", self.ptr_otherwise)); | |
| 423 | ||
| 424 | return null; | |
| 425 | } | |
| 426 | ||
| 427 | pub fn initPayload(payload: *Payload) Node { | |
| 428 | std.debug.assert(@intFromEnum(payload.tag) >= Tag.no_payload_count); | |
| 429 | return .{ .ptr_otherwise = payload }; | |
| 430 | } | |
| 431 | ||
| 432 | pub fn isNoreturn(node: Node, break_counts: bool) bool { | |
| 433 | switch (node.tag()) { | |
| 434 | .block => { | |
| 435 | const block_node = node.castTag(.block).?; | |
| 436 | if (block_node.data.stmts.len == 0) return false; | |
| 437 | ||
| 438 | const last = block_node.data.stmts[block_node.data.stmts.len - 1]; | |
| 439 | return last.isNoreturn(break_counts); | |
| 440 | }, | |
| 441 | .@"switch" => { | |
| 442 | const switch_node = node.castTag(.@"switch").?; | |
| 443 | ||
| 444 | for (switch_node.data.cases) |case| { | |
| 445 | const body = if (case.castTag(.switch_else)) |some| | |
| 446 | some.data | |
| 447 | else if (case.castTag(.switch_prong)) |some| | |
| 448 | some.data.cond | |
| 449 | else | |
| 450 | unreachable; | |
| 451 | ||
| 452 | if (!body.isNoreturn(break_counts)) return false; | |
| 453 | } | |
| 454 | return true; | |
| 455 | }, | |
| 456 | .@"return", .return_void => return true, | |
| 457 | .@"break" => if (break_counts) return true, | |
| 458 | else => {}, | |
| 459 | } | |
| 460 | return false; | |
| 461 | } | |
| 462 | }; | |
| 463 | ||
| 464 | pub const Payload = struct { | |
| 465 | tag: Node.Tag, | |
| 466 | ||
| 467 | pub const Value = struct { | |
| 468 | base: Payload, | |
| 469 | data: []const u8, | |
| 470 | }; | |
| 471 | ||
| 472 | pub const UnOp = struct { | |
| 473 | base: Payload, | |
| 474 | data: Node, | |
| 475 | }; | |
| 476 | ||
| 477 | pub const BinOp = struct { | |
| 478 | base: Payload, | |
| 479 | data: struct { | |
| 480 | lhs: Node, | |
| 481 | rhs: Node, | |
| 482 | }, | |
| 483 | }; | |
| 484 | ||
| 485 | pub const Discard = struct { | |
| 486 | base: Payload, | |
| 487 | data: struct { | |
| 488 | should_skip: bool, | |
| 489 | value: Node, | |
| 490 | }, | |
| 491 | }; | |
| 492 | ||
| 493 | pub const If = struct { | |
| 494 | base: Payload, | |
| 495 | data: struct { | |
| 496 | cond: Node, | |
| 497 | then: Node, | |
| 498 | @"else": ?Node, | |
| 499 | }, | |
| 500 | }; | |
| 501 | ||
| 502 | pub const While = struct { | |
| 503 | base: Payload, | |
| 504 | data: struct { | |
| 505 | cond: Node, | |
| 506 | body: Node, | |
| 507 | cont_expr: ?Node, | |
| 508 | }, | |
| 509 | }; | |
| 510 | ||
| 511 | pub const Switch = struct { | |
| 512 | base: Payload, | |
| 513 | data: struct { | |
| 514 | cond: Node, | |
| 515 | cases: []Node, | |
| 516 | }, | |
| 517 | }; | |
| 518 | ||
| 519 | pub const BreakVal = struct { | |
| 520 | base: Payload, | |
| 521 | data: struct { | |
| 522 | label: ?[]const u8, | |
| 523 | val: Node, | |
| 524 | }, | |
| 525 | }; | |
| 526 | ||
| 527 | pub const Call = struct { | |
| 528 | base: Payload, | |
| 529 | data: struct { | |
| 530 | lhs: Node, | |
| 531 | args: []Node, | |
| 532 | }, | |
| 533 | }; | |
| 534 | ||
| 535 | pub const VarDecl = struct { | |
| 536 | base: Payload, | |
| 537 | data: struct { | |
| 538 | is_pub: bool, | |
| 539 | is_const: bool, | |
| 540 | is_extern: bool, | |
| 541 | is_export: bool, | |
| 542 | is_threadlocal: bool, | |
| 543 | alignment: ?c_uint, | |
| 544 | linksection_string: ?[]const u8, | |
| 545 | name: []const u8, | |
| 546 | type: Node, | |
| 547 | init: ?Node, | |
| 548 | }, | |
| 549 | }; | |
| 550 | ||
| 551 | pub const Func = struct { | |
| 552 | base: Payload, | |
| 553 | data: struct { | |
| 554 | is_pub: bool, | |
| 555 | is_extern: bool, | |
| 556 | is_export: bool, | |
| 557 | is_inline: bool, | |
| 558 | is_var_args: bool, | |
| 559 | name: ?[]const u8, | |
| 560 | linksection_string: ?[]const u8, | |
| 561 | explicit_callconv: ?CallingConvention, | |
| 562 | params: []Param, | |
| 563 | return_type: Node, | |
| 564 | body: ?Node, | |
| 565 | alignment: ?c_uint, | |
| 566 | }, | |
| 567 | ||
| 568 | pub const CallingConvention = enum { | |
| 569 | c, | |
| 570 | x86_64_sysv, | |
| 571 | x86_64_win, | |
| 572 | x86_stdcall, | |
| 573 | x86_fastcall, | |
| 574 | x86_thiscall, | |
| 575 | x86_vectorcall, | |
| 576 | aarch64_vfabi, | |
| 577 | arm_aapcs, | |
| 578 | arm_aapcs_vfp, | |
| 579 | m68k_rtd, | |
| 580 | }; | |
| 581 | }; | |
| 582 | ||
| 583 | pub const Param = struct { | |
| 584 | is_noalias: bool, | |
| 585 | name: ?[]const u8, | |
| 586 | type: Node, | |
| 587 | }; | |
| 588 | ||
| 589 | pub const Record = struct { | |
| 590 | base: Payload, | |
| 591 | data: struct { | |
| 592 | layout: enum { @"packed", @"extern", none }, | |
| 593 | fields: []Field, | |
| 594 | functions: []Node, | |
| 595 | variables: []Node, | |
| 596 | }, | |
| 597 | ||
| 598 | pub const Field = struct { | |
| 599 | name: []const u8, | |
| 600 | type: Node, | |
| 601 | alignment: ?c_uint, | |
| 602 | default_value: ?Node, | |
| 603 | }; | |
| 604 | }; | |
| 605 | ||
| 606 | pub const TupleInit = struct { | |
| 607 | base: Payload, | |
| 608 | data: []Node, | |
| 609 | }; | |
| 610 | ||
| 611 | pub const ContainerInit = struct { | |
| 612 | base: Payload, | |
| 613 | data: struct { | |
| 614 | lhs: Node, | |
| 615 | inits: []Initializer, | |
| 616 | }, | |
| 617 | ||
| 618 | pub const Initializer = struct { | |
| 619 | name: []const u8, | |
| 620 | value: Node, | |
| 621 | }; | |
| 622 | }; | |
| 623 | ||
| 624 | pub const ContainerInitDot = struct { | |
| 625 | base: Payload, | |
| 626 | data: []Initializer, | |
| 627 | ||
| 628 | pub const Initializer = struct { | |
| 629 | name: []const u8, | |
| 630 | value: Node, | |
| 631 | }; | |
| 632 | }; | |
| 633 | ||
| 634 | pub const Block = struct { | |
| 635 | base: Payload, | |
| 636 | data: struct { | |
| 637 | label: ?[]const u8, | |
| 638 | stmts: []Node, | |
| 639 | }, | |
| 640 | }; | |
| 641 | ||
| 642 | pub const Array = struct { | |
| 643 | base: Payload, | |
| 644 | data: ArrayTypeInfo, | |
| 645 | ||
| 646 | pub const ArrayTypeInfo = struct { | |
| 647 | elem_type: Node, | |
| 648 | len: usize, | |
| 649 | }; | |
| 650 | }; | |
| 651 | ||
| 652 | pub const Pointer = struct { | |
| 653 | base: Payload, | |
| 654 | data: struct { | |
| 655 | elem_type: Node, | |
| 656 | is_const: bool, | |
| 657 | is_volatile: bool, | |
| 658 | }, | |
| 659 | }; | |
| 660 | ||
| 661 | pub const ArgRedecl = struct { | |
| 662 | base: Payload, | |
| 663 | data: struct { | |
| 664 | actual: []const u8, | |
| 665 | mangled: []const u8, | |
| 666 | }, | |
| 667 | }; | |
| 668 | ||
| 669 | pub const SimpleVarDecl = struct { | |
| 670 | base: Payload, | |
| 671 | data: struct { | |
| 672 | name: []const u8, | |
| 673 | init: Node, | |
| 674 | }, | |
| 675 | }; | |
| 676 | ||
| 677 | pub const EnumConstant = struct { | |
| 678 | base: Payload, | |
| 679 | data: struct { | |
| 680 | name: []const u8, | |
| 681 | is_public: bool, | |
| 682 | type: ?Node, | |
| 683 | value: Node, | |
| 684 | }, | |
| 685 | }; | |
| 686 | ||
| 687 | pub const ArrayFiller = struct { | |
| 688 | base: Payload, | |
| 689 | data: struct { | |
| 690 | type: Node, | |
| 691 | filler: Node, | |
| 692 | count: usize, | |
| 693 | }, | |
| 694 | }; | |
| 695 | ||
| 696 | pub const PubInlineFn = struct { | |
| 697 | base: Payload, | |
| 698 | data: struct { | |
| 699 | name: []const u8, | |
| 700 | params: []Param, | |
| 701 | return_type: Node, | |
| 702 | body: Node, | |
| 703 | }, | |
| 704 | }; | |
| 705 | ||
| 706 | pub const FieldAccess = struct { | |
| 707 | base: Payload, | |
| 708 | data: struct { | |
| 709 | lhs: Node, | |
| 710 | field_name: []const u8, | |
| 711 | }, | |
| 712 | }; | |
| 713 | ||
| 714 | pub const PromoteIntLiteral = struct { | |
| 715 | base: Payload, | |
| 716 | data: struct { | |
| 717 | value: Node, | |
| 718 | type: Node, | |
| 719 | base: Node, | |
| 720 | }, | |
| 721 | }; | |
| 722 | ||
| 723 | pub const StringSlice = struct { | |
| 724 | base: Payload, | |
| 725 | data: struct { | |
| 726 | string: Node, | |
| 727 | end: usize, | |
| 728 | }, | |
| 729 | }; | |
| 730 | ||
| 731 | pub const Shuffle = struct { | |
| 732 | base: Payload, | |
| 733 | data: struct { | |
| 734 | element_type: Node, | |
| 735 | a: Node, | |
| 736 | b: Node, | |
| 737 | mask_vector: Node, | |
| 738 | }, | |
| 739 | }; | |
| 740 | ||
| 741 | pub const Extern = struct { | |
| 742 | base: Payload, | |
| 743 | data: struct { | |
| 744 | type: Node, | |
| 745 | name: Node, | |
| 746 | }, | |
| 747 | }; | |
| 748 | ||
| 749 | pub const MacroArithmetic = struct { | |
| 750 | base: Payload, | |
| 751 | data: struct { | |
| 752 | op: Operator, | |
| 753 | lhs: Node, | |
| 754 | rhs: Node, | |
| 755 | }, | |
| 756 | ||
| 757 | pub const Operator = enum { div, rem }; | |
| 758 | }; | |
| 759 | }; | |
| 760 | ||
| 761 | /// Converts the nodes into a Zig Ast. | |
| 762 | /// Caller must free the source slice. | |
| 763 | pub fn render(gpa: Allocator, nodes: []const Node) !std.zig.Ast { | |
| 764 | var ctx = Context{ | |
| 765 | .gpa = gpa, | |
| 766 | .buf = std.array_list.Managed(u8).init(gpa), | |
| 767 | }; | |
| 768 | defer ctx.buf.deinit(); | |
| 769 | defer ctx.nodes.deinit(gpa); | |
| 770 | defer ctx.extra_data.deinit(gpa); | |
| 771 | defer ctx.tokens.deinit(gpa); | |
| 772 | ||
| 773 | // Estimate that each top level node has 10 child nodes. | |
| 774 | const estimated_node_count = nodes.len * 10; | |
| 775 | try ctx.nodes.ensureTotalCapacity(gpa, estimated_node_count); | |
| 776 | // Estimate that each each node has 2 tokens. | |
| 777 | const estimated_tokens_count = estimated_node_count * 2; | |
| 778 | try ctx.tokens.ensureTotalCapacity(gpa, estimated_tokens_count); | |
| 779 | // Estimate that each each token is 3 bytes long. | |
| 780 | const estimated_buf_len = estimated_tokens_count * 3; | |
| 781 | try ctx.buf.ensureTotalCapacity(estimated_buf_len); | |
| 782 | ||
| 783 | ctx.nodes.appendAssumeCapacity(.{ | |
| 784 | .tag = .root, | |
| 785 | .main_token = 0, | |
| 786 | .data = undefined, | |
| 787 | }); | |
| 788 | ||
| 789 | const root_members = blk: { | |
| 790 | var result = std.array_list.Managed(NodeIndex).init(gpa); | |
| 791 | defer result.deinit(); | |
| 792 | ||
| 793 | for (nodes) |node| { | |
| 794 | const res = try renderNode(&ctx, node); | |
| 795 | if (node.tag() == .warning) continue; | |
| 796 | try result.append(res); | |
| 797 | } | |
| 798 | break :blk try ctx.listToSpan(result.items); | |
| 799 | }; | |
| 800 | ||
| 801 | ctx.nodes.items(.data)[0] = .{ .extra_range = root_members }; | |
| 802 | ||
| 803 | try ctx.tokens.append(gpa, .{ | |
| 804 | .tag = .eof, | |
| 805 | .start = @as(u32, @intCast(ctx.buf.items.len)), | |
| 806 | }); | |
| 807 | ||
| 808 | return std.zig.Ast{ | |
| 809 | .source = try ctx.buf.toOwnedSliceSentinel(0), | |
| 810 | .tokens = ctx.tokens.toOwnedSlice(), | |
| 811 | .nodes = ctx.nodes.toOwnedSlice(), | |
| 812 | .extra_data = try ctx.extra_data.toOwnedSlice(gpa), | |
| 813 | .errors = &.{}, | |
| 814 | .mode = .zig, | |
| 815 | }; | |
| 816 | } | |
| 817 | ||
| 818 | const NodeIndex = std.zig.Ast.Node.Index; | |
| 819 | const NodeOptionalIndex = std.zig.Ast.Node.OptionalIndex; | |
| 820 | const NodeSubRange = std.zig.Ast.Node.SubRange; | |
| 821 | const TokenIndex = std.zig.Ast.TokenIndex; | |
| 822 | const TokenOptionalIndex = std.zig.Ast.OptionalTokenIndex; | |
| 823 | const TokenTag = std.zig.Token.Tag; | |
| 824 | const ExtraIndex = std.zig.Ast.ExtraIndex; | |
| 825 | ||
| 826 | const Context = struct { | |
| 827 | gpa: Allocator, | |
| 828 | buf: std.array_list.Managed(u8), | |
| 829 | nodes: std.zig.Ast.NodeList = .{}, | |
| 830 | extra_data: std.ArrayListUnmanaged(u32) = .empty, | |
| 831 | tokens: std.zig.Ast.TokenList = .{}, | |
| 832 | ||
| 833 | fn addTokenFmt(c: *Context, tag: TokenTag, comptime format: []const u8, args: anytype) Allocator.Error!TokenIndex { | |
| 834 | const start_index = c.buf.items.len; | |
| 835 | try c.buf.print(format ++ " ", args); | |
| 836 | ||
| 837 | try c.tokens.append(c.gpa, .{ | |
| 838 | .tag = tag, | |
| 839 | .start = @as(u32, @intCast(start_index)), | |
| 840 | }); | |
| 841 | ||
| 842 | return @intCast(c.tokens.len - 1); | |
| 843 | } | |
| 844 | ||
| 845 | fn addToken(c: *Context, tag: TokenTag, bytes: []const u8) Allocator.Error!TokenIndex { | |
| 846 | return c.addTokenFmt(tag, "{s}", .{bytes}); | |
| 847 | } | |
| 848 | ||
| 849 | fn addIdentifier(c: *Context, bytes: []const u8) Allocator.Error!TokenIndex { | |
| 850 | if (std.zig.primitives.isPrimitive(bytes)) | |
| 851 | return c.addTokenFmt(.identifier, "@\"{s}\"", .{bytes}); | |
| 852 | return c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(bytes, .{ .allow_primitive = true })}); | |
| 853 | } | |
| 854 | ||
| 855 | fn listToSpan(c: *Context, list: []const NodeIndex) Allocator.Error!NodeSubRange { | |
| 856 | try c.extra_data.appendSlice(c.gpa, @ptrCast(list)); | |
| 857 | return NodeSubRange{ | |
| 858 | .start = @enumFromInt(c.extra_data.items.len - list.len), | |
| 859 | .end = @enumFromInt(c.extra_data.items.len), | |
| 860 | }; | |
| 861 | } | |
| 862 | ||
| 863 | fn addNode(c: *Context, elem: std.zig.Ast.Node) Allocator.Error!NodeIndex { | |
| 864 | const result: NodeIndex = @enumFromInt(c.nodes.len); | |
| 865 | try c.nodes.append(c.gpa, elem); | |
| 866 | return result; | |
| 867 | } | |
| 868 | ||
| 869 | fn addExtra(c: *Context, extra: anytype) Allocator.Error!std.zig.Ast.ExtraIndex { | |
| 870 | const fields = std.meta.fields(@TypeOf(extra)); | |
| 871 | try c.extra_data.ensureUnusedCapacity(c.gpa, fields.len); | |
| 872 | const result: ExtraIndex = @enumFromInt(c.extra_data.items.len); | |
| 873 | inline for (fields) |field| { | |
| 874 | switch (field.type) { | |
| 875 | NodeIndex, | |
| 876 | NodeOptionalIndex, | |
| 877 | TokenIndex, | |
| 878 | TokenOptionalIndex, | |
| 879 | ExtraIndex, | |
| 880 | => c.extra_data.appendAssumeCapacity(@intFromEnum(@field(extra, field.name))), | |
| 881 | else => @compileError("unexpected field type"), | |
| 882 | } | |
| 883 | } | |
| 884 | return result; | |
| 885 | } | |
| 886 | }; | |
| 887 | ||
| 888 | fn renderNodes(c: *Context, nodes: []const Node) Allocator.Error!NodeSubRange { | |
| 889 | var result = std.array_list.Managed(NodeIndex).init(c.gpa); | |
| 890 | defer result.deinit(); | |
| 891 | ||
| 892 | for (nodes) |node| { | |
| 893 | const res = try renderNode(c, node); | |
| 894 | if (node.tag() == .warning) continue; | |
| 895 | try result.append(res); | |
| 896 | } | |
| 897 | ||
| 898 | return try c.listToSpan(result.items); | |
| 899 | } | |
| 900 | ||
| 901 | fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { | |
| 902 | switch (node.tag()) { | |
| 903 | .declaration => unreachable, | |
| 904 | .warning => { | |
| 905 | const payload = node.castTag(.warning).?.data; | |
| 906 | try c.buf.append('\n'); | |
| 907 | try c.buf.appendSlice(payload); | |
| 908 | try c.buf.append('\n'); | |
| 909 | return @enumFromInt(0); | |
| 910 | }, | |
| 911 | .helpers_cast => { | |
| 912 | const payload = node.castTag(.helpers_cast).?.data; | |
| 913 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "cast" }); | |
| 914 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 915 | }, | |
| 916 | .helpers_promoteIntLiteral => { | |
| 917 | const payload = node.castTag(.helpers_promoteIntLiteral).?.data; | |
| 918 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "promoteIntLiteral" }); | |
| 919 | return renderCall(c, import_node, &.{ payload.type, payload.value, payload.base }); | |
| 920 | }, | |
| 921 | .helpers_sizeof => { | |
| 922 | const payload = node.castTag(.helpers_sizeof).?.data; | |
| 923 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "sizeof" }); | |
| 924 | return renderCall(c, import_node, &.{payload}); | |
| 925 | }, | |
| 926 | .std_mem_zeroes => { | |
| 927 | const payload = node.castTag(.std_mem_zeroes).?.data; | |
| 928 | const import_node = try renderStdImport(c, &.{ "mem", "zeroes" }); | |
| 929 | return renderCall(c, import_node, &.{payload}); | |
| 930 | }, | |
| 931 | .std_mem_zeroinit => { | |
| 932 | const payload = node.castTag(.std_mem_zeroinit).?.data; | |
| 933 | const import_node = try renderStdImport(c, &.{ "mem", "zeroInit" }); | |
| 934 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 935 | }, | |
| 936 | .helpers_flexible_array_type => { | |
| 937 | const payload = node.castTag(.helpers_flexible_array_type).?.data; | |
| 938 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "FlexibleArrayType" }); | |
| 939 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 940 | }, | |
| 941 | .helpers_shuffle_vector_index => { | |
| 942 | const payload = node.castTag(.helpers_shuffle_vector_index).?.data; | |
| 943 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "shuffleVectorIndex" }); | |
| 944 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 945 | }, | |
| 946 | .vector => { | |
| 947 | const payload = node.castTag(.vector).?.data; | |
| 948 | return renderBuiltinCall(c, "@Vector", &.{ payload.lhs, payload.rhs }); | |
| 949 | }, | |
| 950 | .call => { | |
| 951 | const payload = node.castTag(.call).?.data; | |
| 952 | // Cosmetic: avoids an unnecesary address_of on most function calls. | |
| 953 | const lhs = if (payload.lhs.tag() == .fn_identifier) | |
| 954 | try c.addNode(.{ | |
| 955 | .tag = .identifier, | |
| 956 | .main_token = try c.addIdentifier(payload.lhs.castTag(.fn_identifier).?.data), | |
| 957 | .data = undefined, | |
| 958 | }) | |
| 959 | else | |
| 960 | try renderNodeGrouped(c, payload.lhs); | |
| 961 | return renderCall(c, lhs, payload.args); | |
| 962 | }, | |
| 963 | .null_literal => return c.addNode(.{ | |
| 964 | .tag = .identifier, | |
| 965 | .main_token = try c.addToken(.identifier, "null"), | |
| 966 | .data = undefined, | |
| 967 | }), | |
| 968 | .undefined_literal => return c.addNode(.{ | |
| 969 | .tag = .identifier, | |
| 970 | .main_token = try c.addToken(.identifier, "undefined"), | |
| 971 | .data = undefined, | |
| 972 | }), | |
| 973 | .true_literal => return c.addNode(.{ | |
| 974 | .tag = .identifier, | |
| 975 | .main_token = try c.addToken(.identifier, "true"), | |
| 976 | .data = undefined, | |
| 977 | }), | |
| 978 | .false_literal => return c.addNode(.{ | |
| 979 | .tag = .identifier, | |
| 980 | .main_token = try c.addToken(.identifier, "false"), | |
| 981 | .data = undefined, | |
| 982 | }), | |
| 983 | .zero_literal => return c.addNode(.{ | |
| 984 | .tag = .number_literal, | |
| 985 | .main_token = try c.addToken(.number_literal, "0"), | |
| 986 | .data = undefined, | |
| 987 | }), | |
| 988 | .one_literal => return c.addNode(.{ | |
| 989 | .tag = .number_literal, | |
| 990 | .main_token = try c.addToken(.number_literal, "1"), | |
| 991 | .data = undefined, | |
| 992 | }), | |
| 993 | .void_type => return c.addNode(.{ | |
| 994 | .tag = .identifier, | |
| 995 | .main_token = try c.addToken(.identifier, "void"), | |
| 996 | .data = undefined, | |
| 997 | }), | |
| 998 | .noreturn_type => return c.addNode(.{ | |
| 999 | .tag = .identifier, | |
| 1000 | .main_token = try c.addToken(.identifier, "noreturn"), | |
| 1001 | .data = undefined, | |
| 1002 | }), | |
| 1003 | .@"continue" => return c.addNode(.{ | |
| 1004 | .tag = .@"continue", | |
| 1005 | .main_token = try c.addToken(.keyword_continue, "continue"), | |
| 1006 | .data = .{ .opt_token_and_opt_node = .{ .none, .none } }, | |
| 1007 | }), | |
| 1008 | .return_void => return c.addNode(.{ | |
| 1009 | .tag = .@"return", | |
| 1010 | .main_token = try c.addToken(.keyword_return, "return"), | |
| 1011 | .data = .{ .opt_node = .none }, | |
| 1012 | }), | |
| 1013 | .@"break" => return c.addNode(.{ | |
| 1014 | .tag = .@"break", | |
| 1015 | .main_token = try c.addToken(.keyword_break, "break"), | |
| 1016 | .data = .{ .opt_token_and_opt_node = .{ .none, .none } }, | |
| 1017 | }), | |
| 1018 | .break_val => { | |
| 1019 | const payload = node.castTag(.break_val).?.data; | |
| 1020 | const tok = try c.addToken(.keyword_break, "break"); | |
| 1021 | const break_label = if (payload.label) |some| blk: { | |
| 1022 | _ = try c.addToken(.colon, ":"); | |
| 1023 | break :blk try c.addIdentifier(some); | |
| 1024 | } else null; | |
| 1025 | return c.addNode(.{ | |
| 1026 | .tag = .@"break", | |
| 1027 | .main_token = tok, | |
| 1028 | .data = .{ .opt_token_and_opt_node = .{ | |
| 1029 | .fromOptional(break_label), | |
| 1030 | (try renderNode(c, payload.val)).toOptional(), | |
| 1031 | } }, | |
| 1032 | }); | |
| 1033 | }, | |
| 1034 | .@"return" => { | |
| 1035 | const payload = node.castTag(.@"return").?.data; | |
| 1036 | return c.addNode(.{ | |
| 1037 | .tag = .@"return", | |
| 1038 | .main_token = try c.addToken(.keyword_return, "return"), | |
| 1039 | .data = .{ .opt_node = (try renderNode(c, payload)).toOptional() }, | |
| 1040 | }); | |
| 1041 | }, | |
| 1042 | .@"comptime" => { | |
| 1043 | const payload = node.castTag(.@"comptime").?.data; | |
| 1044 | return c.addNode(.{ | |
| 1045 | .tag = .@"comptime", | |
| 1046 | .main_token = try c.addToken(.keyword_comptime, "comptime"), | |
| 1047 | .data = .{ .node = try renderNode(c, payload) }, | |
| 1048 | }); | |
| 1049 | }, | |
| 1050 | .@"defer" => { | |
| 1051 | const payload = node.castTag(.@"defer").?.data; | |
| 1052 | return c.addNode(.{ | |
| 1053 | .tag = .@"defer", | |
| 1054 | .main_token = try c.addToken(.keyword_defer, "defer"), | |
| 1055 | .data = .{ .node = try renderNode(c, payload) }, | |
| 1056 | }); | |
| 1057 | }, | |
| 1058 | .asm_simple => { | |
| 1059 | const payload = node.castTag(.asm_simple).?.data; | |
| 1060 | const asm_token = try c.addToken(.keyword_asm, "asm"); | |
| 1061 | _ = try c.addToken(.l_paren, "("); | |
| 1062 | return c.addNode(.{ | |
| 1063 | .tag = .asm_simple, | |
| 1064 | .main_token = asm_token, | |
| 1065 | .data = .{ .node_and_token = .{ | |
| 1066 | try renderNode(c, payload), | |
| 1067 | try c.addToken(.r_paren, ")"), | |
| 1068 | } }, | |
| 1069 | }); | |
| 1070 | }, | |
| 1071 | .type => { | |
| 1072 | const payload = node.castTag(.type).?.data; | |
| 1073 | return c.addNode(.{ | |
| 1074 | .tag = .identifier, | |
| 1075 | .main_token = try c.addToken(.identifier, payload), | |
| 1076 | .data = undefined, | |
| 1077 | }); | |
| 1078 | }, | |
| 1079 | .identifier => { | |
| 1080 | const payload = node.castTag(.identifier).?.data; | |
| 1081 | return c.addNode(.{ | |
| 1082 | .tag = .identifier, | |
| 1083 | .main_token = try c.addIdentifier(payload), | |
| 1084 | .data = undefined, | |
| 1085 | }); | |
| 1086 | }, | |
| 1087 | .fn_identifier => { | |
| 1088 | // C semantics are that a function identifier has address | |
| 1089 | // value (implicit in stage1, explicit in stage2), except in | |
| 1090 | // the context of an address_of, which is handled there. | |
| 1091 | const payload = node.castTag(.fn_identifier).?.data; | |
| 1092 | const tok = try c.addToken(.ampersand, "&"); | |
| 1093 | const arg = try c.addNode(.{ | |
| 1094 | .tag = .identifier, | |
| 1095 | .main_token = try c.addIdentifier(payload), | |
| 1096 | .data = undefined, | |
| 1097 | }); | |
| 1098 | return c.addNode(.{ | |
| 1099 | .tag = .address_of, | |
| 1100 | .main_token = tok, | |
| 1101 | .data = .{ .node = arg }, | |
| 1102 | }); | |
| 1103 | }, | |
| 1104 | .float_literal => { | |
| 1105 | const payload = node.castTag(.float_literal).?.data; | |
| 1106 | return c.addNode(.{ | |
| 1107 | .tag = .number_literal, | |
| 1108 | .main_token = try c.addToken(.number_literal, payload), | |
| 1109 | .data = undefined, | |
| 1110 | }); | |
| 1111 | }, | |
| 1112 | .integer_literal => { | |
| 1113 | const payload = node.castTag(.integer_literal).?.data; | |
| 1114 | return c.addNode(.{ | |
| 1115 | .tag = .number_literal, | |
| 1116 | .main_token = try c.addToken(.number_literal, payload), | |
| 1117 | .data = undefined, | |
| 1118 | }); | |
| 1119 | }, | |
| 1120 | .string_literal => { | |
| 1121 | const payload = node.castTag(.string_literal).?.data; | |
| 1122 | return c.addNode(.{ | |
| 1123 | .tag = .string_literal, | |
| 1124 | .main_token = try c.addToken(.string_literal, payload), | |
| 1125 | .data = undefined, | |
| 1126 | }); | |
| 1127 | }, | |
| 1128 | .char_literal => { | |
| 1129 | const payload = node.castTag(.char_literal).?.data; | |
| 1130 | return c.addNode(.{ | |
| 1131 | .tag = .char_literal, | |
| 1132 | .main_token = try c.addToken(.char_literal, payload), | |
| 1133 | .data = undefined, | |
| 1134 | }); | |
| 1135 | }, | |
| 1136 | .enum_literal => { | |
| 1137 | const payload = node.castTag(.enum_literal).?.data; | |
| 1138 | _ = try c.addToken(.period, "."); | |
| 1139 | return c.addNode(.{ | |
| 1140 | .tag = .enum_literal, | |
| 1141 | .main_token = try c.addToken(.identifier, payload), | |
| 1142 | .data = undefined, | |
| 1143 | }); | |
| 1144 | }, | |
| 1145 | .helpers_macro => { | |
| 1146 | const payload = node.castTag(.helpers_macro).?.data; | |
| 1147 | const chain = [_][]const u8{ | |
| 1148 | "zig", | |
| 1149 | "c_translation", | |
| 1150 | "Macros", | |
| 1151 | payload, | |
| 1152 | }; | |
| 1153 | return renderStdImport(c, &chain); | |
| 1154 | }, | |
| 1155 | .import_c_builtin => { | |
| 1156 | const payload = node.castTag(.import_c_builtin).?.data; | |
| 1157 | const chain = [_][]const u8{ | |
| 1158 | "zig", | |
| 1159 | "c_builtins", | |
| 1160 | payload, | |
| 1161 | }; | |
| 1162 | return renderStdImport(c, &chain); | |
| 1163 | }, | |
| 1164 | .string_slice => { | |
| 1165 | const payload = node.castTag(.string_slice).?.data; | |
| 1166 | ||
| 1167 | const string = try renderNode(c, payload.string); | |
| 1168 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 1169 | const start = try c.addNode(.{ | |
| 1170 | .tag = .number_literal, | |
| 1171 | .main_token = try c.addToken(.number_literal, "0"), | |
| 1172 | .data = undefined, | |
| 1173 | }); | |
| 1174 | _ = try c.addToken(.ellipsis2, ".."); | |
| 1175 | const end = try c.addNode(.{ | |
| 1176 | .tag = .number_literal, | |
| 1177 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{payload.end}), | |
| 1178 | .data = undefined, | |
| 1179 | }); | |
| 1180 | _ = try c.addToken(.r_bracket, "]"); | |
| 1181 | ||
| 1182 | return c.addNode(.{ | |
| 1183 | .tag = .slice, | |
| 1184 | .main_token = l_bracket, | |
| 1185 | .data = .{ .node_and_extra = .{ | |
| 1186 | string, | |
| 1187 | try c.addExtra(std.zig.Ast.Node.Slice{ | |
| 1188 | .start = start, | |
| 1189 | .end = end, | |
| 1190 | }), | |
| 1191 | } }, | |
| 1192 | }); | |
| 1193 | }, | |
| 1194 | .fail_decl => { | |
| 1195 | const payload = node.castTag(.fail_decl).?.data; | |
| 1196 | // pub const name = @compileError(msg); | |
| 1197 | _ = try c.addToken(.keyword_pub, "pub"); | |
| 1198 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1199 | _ = try c.addIdentifier(payload.actual); | |
| 1200 | _ = try c.addToken(.equal, "="); | |
| 1201 | ||
| 1202 | const compile_error_tok = try c.addToken(.builtin, "@compileError"); | |
| 1203 | _ = try c.addToken(.l_paren, "("); | |
| 1204 | const err_msg_tok = try c.addTokenFmt(.string_literal, "\"{f}\"", .{std.zig.fmtString(payload.mangled)}); | |
| 1205 | const err_msg = try c.addNode(.{ | |
| 1206 | .tag = .string_literal, | |
| 1207 | .main_token = err_msg_tok, | |
| 1208 | .data = undefined, | |
| 1209 | }); | |
| 1210 | _ = try c.addToken(.r_paren, ")"); | |
| 1211 | const compile_error = try c.addNode(.{ | |
| 1212 | .tag = .builtin_call_two, | |
| 1213 | .main_token = compile_error_tok, | |
| 1214 | .data = .{ .opt_node_and_opt_node = .{ err_msg.toOptional(), .none } }, | |
| 1215 | }); | |
| 1216 | _ = try c.addToken(.semicolon, ";"); | |
| 1217 | ||
| 1218 | return c.addNode(.{ | |
| 1219 | .tag = .simple_var_decl, | |
| 1220 | .main_token = const_tok, | |
| 1221 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1222 | .none, | |
| 1223 | compile_error.toOptional(), | |
| 1224 | } }, | |
| 1225 | }); | |
| 1226 | }, | |
| 1227 | .pub_var_simple, .var_simple => { | |
| 1228 | const payload = @as(*Payload.SimpleVarDecl, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 1229 | if (node.tag() == .pub_var_simple) _ = try c.addToken(.keyword_pub, "pub"); | |
| 1230 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1231 | _ = try c.addIdentifier(payload.name); | |
| 1232 | _ = try c.addToken(.equal, "="); | |
| 1233 | ||
| 1234 | const init = try renderNode(c, payload.init); | |
| 1235 | _ = try c.addToken(.semicolon, ";"); | |
| 1236 | ||
| 1237 | return c.addNode(.{ | |
| 1238 | .tag = .simple_var_decl, | |
| 1239 | .main_token = const_tok, | |
| 1240 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1241 | .none, | |
| 1242 | init.toOptional(), | |
| 1243 | } }, | |
| 1244 | }); | |
| 1245 | }, | |
| 1246 | .static_local_var => { | |
| 1247 | const payload = node.castTag(.static_local_var).?.data; | |
| 1248 | ||
| 1249 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1250 | _ = try c.addIdentifier(payload.name); | |
| 1251 | _ = try c.addToken(.equal, "="); | |
| 1252 | ||
| 1253 | const kind_tok = try c.addToken(.keyword_struct, "struct"); | |
| 1254 | _ = try c.addToken(.l_brace, "{"); | |
| 1255 | ||
| 1256 | const container_def = try c.addNode(.{ | |
| 1257 | .tag = .container_decl_two_trailing, | |
| 1258 | .main_token = kind_tok, | |
| 1259 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1260 | (try renderNode(c, payload.init)).toOptional(), | |
| 1261 | .none, | |
| 1262 | } }, | |
| 1263 | }); | |
| 1264 | _ = try c.addToken(.r_brace, "}"); | |
| 1265 | _ = try c.addToken(.semicolon, ";"); | |
| 1266 | ||
| 1267 | return c.addNode(.{ | |
| 1268 | .tag = .simple_var_decl, | |
| 1269 | .main_token = const_tok, | |
| 1270 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1271 | .none, | |
| 1272 | container_def.toOptional(), | |
| 1273 | } }, | |
| 1274 | }); | |
| 1275 | }, | |
| 1276 | .extern_local_var, .extern_local_fn => { | |
| 1277 | const payload = if (node.tag() == .extern_local_var) | |
| 1278 | node.castTag(.extern_local_var).?.data | |
| 1279 | else | |
| 1280 | node.castTag(.extern_local_fn).?.data; | |
| 1281 | ||
| 1282 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1283 | _ = try c.addIdentifier(payload.name); | |
| 1284 | _ = try c.addToken(.equal, "="); | |
| 1285 | ||
| 1286 | const kind_tok = try c.addToken(.keyword_struct, "struct"); | |
| 1287 | _ = try c.addToken(.l_brace, "{"); | |
| 1288 | ||
| 1289 | const container_def = try c.addNode(.{ | |
| 1290 | .tag = .container_decl_two_trailing, | |
| 1291 | .main_token = kind_tok, | |
| 1292 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1293 | (try renderNode(c, payload.init)).toOptional(), | |
| 1294 | .none, | |
| 1295 | } }, | |
| 1296 | }); | |
| 1297 | _ = try c.addToken(.r_brace, "}"); | |
| 1298 | _ = try c.addToken(.semicolon, ";"); | |
| 1299 | ||
| 1300 | return c.addNode(.{ | |
| 1301 | .tag = .simple_var_decl, | |
| 1302 | .main_token = const_tok, | |
| 1303 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1304 | .none, | |
| 1305 | container_def.toOptional(), | |
| 1306 | } }, | |
| 1307 | }); | |
| 1308 | }, | |
| 1309 | .mut_str => { | |
| 1310 | const payload = node.castTag(.mut_str).?.data; | |
| 1311 | ||
| 1312 | const var_tok = try c.addToken(.keyword_var, "var"); | |
| 1313 | _ = try c.addIdentifier(payload.name); | |
| 1314 | _ = try c.addToken(.equal, "="); | |
| 1315 | ||
| 1316 | const deref = try c.addNode(.{ | |
| 1317 | .tag = .deref, | |
| 1318 | .data = .{ .node = try renderNodeGrouped(c, payload.init) }, | |
| 1319 | .main_token = try c.addToken(.period_asterisk, ".*"), | |
| 1320 | }); | |
| 1321 | _ = try c.addToken(.semicolon, ";"); | |
| 1322 | ||
| 1323 | return c.addNode(.{ | |
| 1324 | .tag = .simple_var_decl, | |
| 1325 | .main_token = var_tok, | |
| 1326 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1327 | .none, | |
| 1328 | deref.toOptional(), | |
| 1329 | } }, | |
| 1330 | }); | |
| 1331 | }, | |
| 1332 | .var_decl => return renderVar(c, node), | |
| 1333 | .arg_redecl, .alias => { | |
| 1334 | const payload = @as(*Payload.ArgRedecl, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 1335 | if (node.tag() == .alias) _ = try c.addToken(.keyword_pub, "pub"); | |
| 1336 | const mut_tok = if (node.tag() == .alias) | |
| 1337 | try c.addToken(.keyword_const, "const") | |
| 1338 | else | |
| 1339 | try c.addToken(.keyword_var, "var"); | |
| 1340 | _ = try c.addIdentifier(payload.actual); | |
| 1341 | _ = try c.addToken(.equal, "="); | |
| 1342 | ||
| 1343 | const init = try c.addNode(.{ | |
| 1344 | .tag = .identifier, | |
| 1345 | .main_token = try c.addIdentifier(payload.mangled), | |
| 1346 | .data = undefined, | |
| 1347 | }); | |
| 1348 | _ = try c.addToken(.semicolon, ";"); | |
| 1349 | ||
| 1350 | return c.addNode(.{ | |
| 1351 | .tag = .simple_var_decl, | |
| 1352 | .main_token = mut_tok, | |
| 1353 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1354 | .none, | |
| 1355 | init.toOptional(), | |
| 1356 | } }, | |
| 1357 | }); | |
| 1358 | }, | |
| 1359 | .int_cast => { | |
| 1360 | const payload = node.castTag(.int_cast).?.data; | |
| 1361 | return renderBuiltinCall(c, "@intCast", &.{payload}); | |
| 1362 | }, | |
| 1363 | .const_cast => { | |
| 1364 | const payload = node.castTag(.const_cast).?.data; | |
| 1365 | return renderBuiltinCall(c, "@constCast", &.{payload}); | |
| 1366 | }, | |
| 1367 | .volatile_cast => { | |
| 1368 | const payload = node.castTag(.volatile_cast).?.data; | |
| 1369 | return renderBuiltinCall(c, "@volatileCast", &.{payload}); | |
| 1370 | }, | |
| 1371 | .signed_remainder => { | |
| 1372 | const payload = node.castTag(.signed_remainder).?.data; | |
| 1373 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "signedRemainder" }); | |
| 1374 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 1375 | }, | |
| 1376 | .div_trunc => { | |
| 1377 | const payload = node.castTag(.div_trunc).?.data; | |
| 1378 | return renderBuiltinCall(c, "@divTrunc", &.{ payload.lhs, payload.rhs }); | |
| 1379 | }, | |
| 1380 | .int_from_bool => { | |
| 1381 | const payload = node.castTag(.int_from_bool).?.data; | |
| 1382 | return renderBuiltinCall(c, "@intFromBool", &.{payload}); | |
| 1383 | }, | |
| 1384 | .as => { | |
| 1385 | const payload = node.castTag(.as).?.data; | |
| 1386 | return renderBuiltinCall(c, "@as", &.{ payload.lhs, payload.rhs }); | |
| 1387 | }, | |
| 1388 | .truncate => { | |
| 1389 | const payload = node.castTag(.truncate).?.data; | |
| 1390 | return renderBuiltinCall(c, "@truncate", &.{payload}); | |
| 1391 | }, | |
| 1392 | .bit_cast => { | |
| 1393 | const payload = node.castTag(.bit_cast).?.data; | |
| 1394 | return renderBuiltinCall(c, "@bitCast", &.{payload}); | |
| 1395 | }, | |
| 1396 | .float_cast => { | |
| 1397 | const payload = node.castTag(.float_cast).?.data; | |
| 1398 | return renderBuiltinCall(c, "@floatCast", &.{payload}); | |
| 1399 | }, | |
| 1400 | .int_from_float => { | |
| 1401 | const payload = node.castTag(.int_from_float).?.data; | |
| 1402 | return renderBuiltinCall(c, "@intFromFloat", &.{payload}); | |
| 1403 | }, | |
| 1404 | .float_from_int => { | |
| 1405 | const payload = node.castTag(.float_from_int).?.data; | |
| 1406 | return renderBuiltinCall(c, "@floatFromInt", &.{payload}); | |
| 1407 | }, | |
| 1408 | .ptr_from_int => { | |
| 1409 | const payload = node.castTag(.ptr_from_int).?.data; | |
| 1410 | return renderBuiltinCall(c, "@ptrFromInt", &.{payload}); | |
| 1411 | }, | |
| 1412 | .int_from_ptr => { | |
| 1413 | const payload = node.castTag(.int_from_ptr).?.data; | |
| 1414 | return renderBuiltinCall(c, "@intFromPtr", &.{payload}); | |
| 1415 | }, | |
| 1416 | .align_cast => { | |
| 1417 | const payload = node.castTag(.align_cast).?.data; | |
| 1418 | return renderBuiltinCall(c, "@alignCast", &.{payload}); | |
| 1419 | }, | |
| 1420 | .ptr_cast => { | |
| 1421 | const payload = node.castTag(.ptr_cast).?.data; | |
| 1422 | return renderBuiltinCall(c, "@ptrCast", &.{payload}); | |
| 1423 | }, | |
| 1424 | .div_exact => { | |
| 1425 | const payload = node.castTag(.div_exact).?.data; | |
| 1426 | return renderBuiltinCall(c, "@divExact", &.{ payload.lhs, payload.rhs }); | |
| 1427 | }, | |
| 1428 | .offset_of => { | |
| 1429 | const payload = node.castTag(.offset_of).?.data; | |
| 1430 | return renderBuiltinCall(c, "@offsetOf", &.{ payload.lhs, payload.rhs }); | |
| 1431 | }, | |
| 1432 | .sizeof => { | |
| 1433 | const payload = node.castTag(.sizeof).?.data; | |
| 1434 | return renderBuiltinCall(c, "@sizeOf", &.{payload}); | |
| 1435 | }, | |
| 1436 | .shuffle => { | |
| 1437 | const payload = node.castTag(.shuffle).?.data; | |
| 1438 | return renderBuiltinCall(c, "@shuffle", &.{ | |
| 1439 | payload.element_type, | |
| 1440 | payload.a, | |
| 1441 | payload.b, | |
| 1442 | payload.mask_vector, | |
| 1443 | }); | |
| 1444 | }, | |
| 1445 | .builtin_extern => { | |
| 1446 | const payload = node.castTag(.builtin_extern).?.data; | |
| 1447 | ||
| 1448 | var info_inits: [1]Payload.ContainerInitDot.Initializer = .{ | |
| 1449 | .{ .name = "name", .value = payload.name }, | |
| 1450 | }; | |
| 1451 | var info_payload: Payload.ContainerInitDot = .{ | |
| 1452 | .base = .{ .tag = .container_init_dot }, | |
| 1453 | .data = &info_inits, | |
| 1454 | }; | |
| 1455 | ||
| 1456 | return renderBuiltinCall(c, "@extern", &.{ | |
| 1457 | payload.type, | |
| 1458 | .{ .ptr_otherwise = &info_payload.base }, | |
| 1459 | }); | |
| 1460 | }, | |
| 1461 | .macro_arithmetic => { | |
| 1462 | const payload = node.castTag(.macro_arithmetic).?.data; | |
| 1463 | const op = @tagName(payload.op); | |
| 1464 | const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "MacroArithmetic", op }); | |
| 1465 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 1466 | }, | |
| 1467 | .alignof => { | |
| 1468 | const payload = node.castTag(.alignof).?.data; | |
| 1469 | return renderBuiltinCall(c, "@alignOf", &.{payload}); | |
| 1470 | }, | |
| 1471 | .typeof => { | |
| 1472 | const payload = node.castTag(.typeof).?.data; | |
| 1473 | return renderBuiltinCall(c, "@TypeOf", &.{payload}); | |
| 1474 | }, | |
| 1475 | .typeinfo => { | |
| 1476 | const payload = node.castTag(.typeinfo).?.data; | |
| 1477 | return renderBuiltinCall(c, "@typeInfo", &.{payload}); | |
| 1478 | }, | |
| 1479 | .negate => return renderPrefixOp(c, node, .negation, .minus, "-"), | |
| 1480 | .negate_wrap => return renderPrefixOp(c, node, .negation_wrap, .minus_percent, "-%"), | |
| 1481 | .bit_not => return renderPrefixOp(c, node, .bit_not, .tilde, "~"), | |
| 1482 | .not => return renderPrefixOp(c, node, .bool_not, .bang, "!"), | |
| 1483 | .optional_type => return renderPrefixOp(c, node, .optional_type, .question_mark, "?"), | |
| 1484 | .address_of => { | |
| 1485 | const payload = node.castTag(.address_of).?.data; | |
| 1486 | ||
| 1487 | const ampersand = try c.addToken(.ampersand, "&"); | |
| 1488 | const base = if (payload.tag() == .fn_identifier) | |
| 1489 | try c.addNode(.{ | |
| 1490 | .tag = .identifier, | |
| 1491 | .main_token = try c.addIdentifier(payload.castTag(.fn_identifier).?.data), | |
| 1492 | .data = undefined, | |
| 1493 | }) | |
| 1494 | else | |
| 1495 | try renderNodeGrouped(c, payload); | |
| 1496 | return c.addNode(.{ | |
| 1497 | .tag = .address_of, | |
| 1498 | .main_token = ampersand, | |
| 1499 | .data = .{ .node = base }, | |
| 1500 | }); | |
| 1501 | }, | |
| 1502 | .deref => { | |
| 1503 | const payload = node.castTag(.deref).?.data; | |
| 1504 | const operand = try renderNodeGrouped(c, payload); | |
| 1505 | const deref_tok = try c.addToken(.period_asterisk, ".*"); | |
| 1506 | return c.addNode(.{ | |
| 1507 | .tag = .deref, | |
| 1508 | .main_token = deref_tok, | |
| 1509 | .data = .{ .node = operand }, | |
| 1510 | }); | |
| 1511 | }, | |
| 1512 | .unwrap => { | |
| 1513 | const payload = node.castTag(.unwrap).?.data; | |
| 1514 | const operand = try renderNodeGrouped(c, payload); | |
| 1515 | const period = try c.addToken(.period, "."); | |
| 1516 | const question_mark = try c.addToken(.question_mark, "?"); | |
| 1517 | return c.addNode(.{ | |
| 1518 | .tag = .unwrap_optional, | |
| 1519 | .main_token = period, | |
| 1520 | .data = .{ .node_and_token = .{ | |
| 1521 | operand, | |
| 1522 | question_mark, | |
| 1523 | } }, | |
| 1524 | }); | |
| 1525 | }, | |
| 1526 | .c_pointer, .single_pointer => { | |
| 1527 | const payload = @as(*Payload.Pointer, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 1528 | ||
| 1529 | const main_token = if (node.tag() == .single_pointer) | |
| 1530 | try c.addToken(.asterisk, "*") | |
| 1531 | else blk: { | |
| 1532 | const res = try c.addToken(.l_bracket, "["); | |
| 1533 | _ = try c.addToken(.asterisk, "*"); | |
| 1534 | _ = try c.addIdentifier("c"); | |
| 1535 | _ = try c.addToken(.r_bracket, "]"); | |
| 1536 | break :blk res; | |
| 1537 | }; | |
| 1538 | if (payload.is_const) _ = try c.addToken(.keyword_const, "const"); | |
| 1539 | if (payload.is_volatile) _ = try c.addToken(.keyword_volatile, "volatile"); | |
| 1540 | const elem_type = try renderNodeGrouped(c, payload.elem_type); | |
| 1541 | ||
| 1542 | return c.addNode(.{ | |
| 1543 | .tag = .ptr_type_aligned, | |
| 1544 | .main_token = main_token, | |
| 1545 | .data = .{ .opt_node_and_node = .{ | |
| 1546 | .none, | |
| 1547 | elem_type, | |
| 1548 | } }, | |
| 1549 | }); | |
| 1550 | }, | |
| 1551 | .add => return renderBinOpGrouped(c, node, .add, .plus, "+"), | |
| 1552 | .add_assign => return renderBinOp(c, node, .assign_add, .plus_equal, "+="), | |
| 1553 | .add_wrap => return renderBinOpGrouped(c, node, .add_wrap, .plus_percent, "+%"), | |
| 1554 | .add_wrap_assign => return renderBinOp(c, node, .assign_add_wrap, .plus_percent_equal, "+%="), | |
| 1555 | .sub => return renderBinOpGrouped(c, node, .sub, .minus, "-"), | |
| 1556 | .sub_assign => return renderBinOp(c, node, .assign_sub, .minus_equal, "-="), | |
| 1557 | .sub_wrap => return renderBinOpGrouped(c, node, .sub_wrap, .minus_percent, "-%"), | |
| 1558 | .sub_wrap_assign => return renderBinOp(c, node, .assign_sub_wrap, .minus_percent_equal, "-%="), | |
| 1559 | .mul => return renderBinOpGrouped(c, node, .mul, .asterisk, "*"), | |
| 1560 | .mul_assign => return renderBinOp(c, node, .assign_mul, .asterisk_equal, "*="), | |
| 1561 | .mul_wrap => return renderBinOpGrouped(c, node, .mul_wrap, .asterisk_percent, "*%"), | |
| 1562 | .mul_wrap_assign => return renderBinOp(c, node, .assign_mul_wrap, .asterisk_percent_equal, "*%="), | |
| 1563 | .div => return renderBinOpGrouped(c, node, .div, .slash, "/"), | |
| 1564 | .div_assign => return renderBinOp(c, node, .assign_div, .slash_equal, "/="), | |
| 1565 | .shl => return renderBinOpGrouped(c, node, .shl, .angle_bracket_angle_bracket_left, "<<"), | |
| 1566 | .shl_assign => return renderBinOp(c, node, .assign_shl, .angle_bracket_angle_bracket_left_equal, "<<="), | |
| 1567 | .shr => return renderBinOpGrouped(c, node, .shr, .angle_bracket_angle_bracket_right, ">>"), | |
| 1568 | .shr_assign => return renderBinOp(c, node, .assign_shr, .angle_bracket_angle_bracket_right_equal, ">>="), | |
| 1569 | .mod => return renderBinOpGrouped(c, node, .mod, .percent, "%"), | |
| 1570 | .mod_assign => return renderBinOp(c, node, .assign_mod, .percent_equal, "%="), | |
| 1571 | .@"and" => return renderBinOpGrouped(c, node, .bool_and, .keyword_and, "and"), | |
| 1572 | .@"or" => return renderBinOpGrouped(c, node, .bool_or, .keyword_or, "or"), | |
| 1573 | .less_than => return renderBinOpGrouped(c, node, .less_than, .angle_bracket_left, "<"), | |
| 1574 | .less_than_equal => return renderBinOpGrouped(c, node, .less_or_equal, .angle_bracket_left_equal, "<="), | |
| 1575 | .greater_than => return renderBinOpGrouped(c, node, .greater_than, .angle_bracket_right, ">="), | |
| 1576 | .greater_than_equal => return renderBinOpGrouped(c, node, .greater_or_equal, .angle_bracket_right_equal, ">="), | |
| 1577 | .equal => return renderBinOpGrouped(c, node, .equal_equal, .equal_equal, "=="), | |
| 1578 | .not_equal => return renderBinOpGrouped(c, node, .bang_equal, .bang_equal, "!="), | |
| 1579 | .bit_and => return renderBinOpGrouped(c, node, .bit_and, .ampersand, "&"), | |
| 1580 | .bit_and_assign => return renderBinOp(c, node, .assign_bit_and, .ampersand_equal, "&="), | |
| 1581 | .bit_or => return renderBinOpGrouped(c, node, .bit_or, .pipe, "|"), | |
| 1582 | .bit_or_assign => return renderBinOp(c, node, .assign_bit_or, .pipe_equal, "|="), | |
| 1583 | .bit_xor => return renderBinOpGrouped(c, node, .bit_xor, .caret, "^"), | |
| 1584 | .bit_xor_assign => return renderBinOp(c, node, .assign_bit_xor, .caret_equal, "^="), | |
| 1585 | .array_cat => return renderBinOp(c, node, .array_cat, .plus_plus, "++"), | |
| 1586 | .ellipsis3 => return renderBinOpGrouped(c, node, .switch_range, .ellipsis3, "..."), | |
| 1587 | .assign => return renderBinOp(c, node, .assign, .equal, "="), | |
| 1588 | .empty_block => { | |
| 1589 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1590 | _ = try c.addToken(.r_brace, "}"); | |
| 1591 | return c.addNode(.{ | |
| 1592 | .tag = .block_two, | |
| 1593 | .main_token = l_brace, | |
| 1594 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1595 | .none, | |
| 1596 | .none, | |
| 1597 | } }, | |
| 1598 | }); | |
| 1599 | }, | |
| 1600 | .block_single => { | |
| 1601 | const payload = node.castTag(.block_single).?.data; | |
| 1602 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1603 | ||
| 1604 | const stmt = try renderNode(c, payload); | |
| 1605 | try addSemicolonIfNeeded(c, payload); | |
| 1606 | ||
| 1607 | _ = try c.addToken(.r_brace, "}"); | |
| 1608 | return c.addNode(.{ | |
| 1609 | .tag = .block_two_semicolon, | |
| 1610 | .main_token = l_brace, | |
| 1611 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1612 | stmt.toOptional(), | |
| 1613 | .none, | |
| 1614 | } }, | |
| 1615 | }); | |
| 1616 | }, | |
| 1617 | .block => { | |
| 1618 | const payload = node.castTag(.block).?.data; | |
| 1619 | if (payload.label) |some| { | |
| 1620 | _ = try c.addIdentifier(some); | |
| 1621 | _ = try c.addToken(.colon, ":"); | |
| 1622 | } | |
| 1623 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1624 | ||
| 1625 | var stmts = std.array_list.Managed(NodeIndex).init(c.gpa); | |
| 1626 | defer stmts.deinit(); | |
| 1627 | for (payload.stmts) |stmt| { | |
| 1628 | const res = try renderNode(c, stmt); | |
| 1629 | if (@intFromEnum(res) == 0) continue; | |
| 1630 | try addSemicolonIfNeeded(c, stmt); | |
| 1631 | try stmts.append(res); | |
| 1632 | } | |
| 1633 | const span = try c.listToSpan(stmts.items); | |
| 1634 | _ = try c.addToken(.r_brace, "}"); | |
| 1635 | ||
| 1636 | const semicolon = c.tokens.items(.tag)[c.tokens.len - 2] == .semicolon; | |
| 1637 | return c.addNode(.{ | |
| 1638 | .tag = if (semicolon) .block_semicolon else .block, | |
| 1639 | .main_token = l_brace, | |
| 1640 | .data = .{ .extra_range = span }, | |
| 1641 | }); | |
| 1642 | }, | |
| 1643 | .func => return renderFunc(c, node), | |
| 1644 | .pub_inline_fn => return renderMacroFunc(c, node), | |
| 1645 | .discard => { | |
| 1646 | const payload = node.castTag(.discard).?.data; | |
| 1647 | if (payload.should_skip) return @enumFromInt(0); | |
| 1648 | ||
| 1649 | const lhs = try c.addNode(.{ | |
| 1650 | .tag = .identifier, | |
| 1651 | .main_token = try c.addToken(.identifier, "_"), | |
| 1652 | .data = undefined, | |
| 1653 | }); | |
| 1654 | const main_token = try c.addToken(.equal, "="); | |
| 1655 | if (payload.value.tag() == .identifier) { | |
| 1656 | // Render as `_ = &foo;` to avoid tripping "pointless discard" and "local variable never mutated" errors. | |
| 1657 | var addr_of_pl: Payload.UnOp = .{ | |
| 1658 | .base = .{ .tag = .address_of }, | |
| 1659 | .data = payload.value, | |
| 1660 | }; | |
| 1661 | const addr_of: Node = .{ .ptr_otherwise = &addr_of_pl.base }; | |
| 1662 | return c.addNode(.{ | |
| 1663 | .tag = .assign, | |
| 1664 | .main_token = main_token, | |
| 1665 | .data = .{ .node_and_node = .{ | |
| 1666 | lhs, | |
| 1667 | try renderNode(c, addr_of), | |
| 1668 | } }, | |
| 1669 | }); | |
| 1670 | } else { | |
| 1671 | return c.addNode(.{ | |
| 1672 | .tag = .assign, | |
| 1673 | .main_token = main_token, | |
| 1674 | .data = .{ .node_and_node = .{ | |
| 1675 | lhs, | |
| 1676 | try renderNode(c, payload.value), | |
| 1677 | } }, | |
| 1678 | }); | |
| 1679 | } | |
| 1680 | }, | |
| 1681 | .@"while" => { | |
| 1682 | const payload = node.castTag(.@"while").?.data; | |
| 1683 | const while_tok = try c.addToken(.keyword_while, "while"); | |
| 1684 | _ = try c.addToken(.l_paren, "("); | |
| 1685 | const cond = try renderNode(c, payload.cond); | |
| 1686 | _ = try c.addToken(.r_paren, ")"); | |
| 1687 | ||
| 1688 | const cont_expr = if (payload.cont_expr) |some| blk: { | |
| 1689 | _ = try c.addToken(.colon, ":"); | |
| 1690 | _ = try c.addToken(.l_paren, "("); | |
| 1691 | const res = try renderNode(c, some); | |
| 1692 | _ = try c.addToken(.r_paren, ")"); | |
| 1693 | break :blk res; | |
| 1694 | } else null; | |
| 1695 | const body = try renderNode(c, payload.body); | |
| 1696 | ||
| 1697 | if (cont_expr == null) { | |
| 1698 | return c.addNode(.{ | |
| 1699 | .tag = .while_simple, | |
| 1700 | .main_token = while_tok, | |
| 1701 | .data = .{ .node_and_node = .{ | |
| 1702 | cond, | |
| 1703 | body, | |
| 1704 | } }, | |
| 1705 | }); | |
| 1706 | } else { | |
| 1707 | return c.addNode(.{ | |
| 1708 | .tag = .while_cont, | |
| 1709 | .main_token = while_tok, | |
| 1710 | .data = .{ .node_and_extra = .{ | |
| 1711 | cond, | |
| 1712 | try c.addExtra(std.zig.Ast.Node.WhileCont{ | |
| 1713 | .cont_expr = cont_expr.?, | |
| 1714 | .then_expr = body, | |
| 1715 | }), | |
| 1716 | } }, | |
| 1717 | }); | |
| 1718 | } | |
| 1719 | }, | |
| 1720 | .while_true => { | |
| 1721 | const payload = node.castTag(.while_true).?.data; | |
| 1722 | const while_tok = try c.addToken(.keyword_while, "while"); | |
| 1723 | _ = try c.addToken(.l_paren, "("); | |
| 1724 | const cond = try c.addNode(.{ | |
| 1725 | .tag = .identifier, | |
| 1726 | .main_token = try c.addToken(.identifier, "true"), | |
| 1727 | .data = undefined, | |
| 1728 | }); | |
| 1729 | _ = try c.addToken(.r_paren, ")"); | |
| 1730 | const body = try renderNode(c, payload); | |
| 1731 | ||
| 1732 | return c.addNode(.{ | |
| 1733 | .tag = .while_simple, | |
| 1734 | .main_token = while_tok, | |
| 1735 | .data = .{ .node_and_node = .{ | |
| 1736 | cond, | |
| 1737 | body, | |
| 1738 | } }, | |
| 1739 | }); | |
| 1740 | }, | |
| 1741 | .@"if" => { | |
| 1742 | const payload = node.castTag(.@"if").?.data; | |
| 1743 | const if_tok = try c.addToken(.keyword_if, "if"); | |
| 1744 | _ = try c.addToken(.l_paren, "("); | |
| 1745 | const cond = try renderNode(c, payload.cond); | |
| 1746 | _ = try c.addToken(.r_paren, ")"); | |
| 1747 | ||
| 1748 | const then_expr = try renderNode(c, payload.then); | |
| 1749 | const else_node = payload.@"else" orelse return c.addNode(.{ | |
| 1750 | .tag = .if_simple, | |
| 1751 | .main_token = if_tok, | |
| 1752 | .data = .{ .node_and_node = .{ | |
| 1753 | cond, | |
| 1754 | then_expr, | |
| 1755 | } }, | |
| 1756 | }); | |
| 1757 | _ = try c.addToken(.keyword_else, "else"); | |
| 1758 | const else_expr = try renderNode(c, else_node); | |
| 1759 | ||
| 1760 | return c.addNode(.{ | |
| 1761 | .tag = .@"if", | |
| 1762 | .main_token = if_tok, | |
| 1763 | .data = .{ .node_and_extra = .{ | |
| 1764 | cond, | |
| 1765 | try c.addExtra(std.zig.Ast.Node.If{ | |
| 1766 | .then_expr = then_expr, | |
| 1767 | .else_expr = else_expr, | |
| 1768 | }), | |
| 1769 | } }, | |
| 1770 | }); | |
| 1771 | }, | |
| 1772 | .if_not_break => { | |
| 1773 | const payload = node.castTag(.if_not_break).?.data; | |
| 1774 | const if_tok = try c.addToken(.keyword_if, "if"); | |
| 1775 | _ = try c.addToken(.l_paren, "("); | |
| 1776 | const cond = try c.addNode(.{ | |
| 1777 | .tag = .bool_not, | |
| 1778 | .main_token = try c.addToken(.bang, "!"), | |
| 1779 | .data = .{ .node = try renderNodeGrouped(c, payload) }, | |
| 1780 | }); | |
| 1781 | _ = try c.addToken(.r_paren, ")"); | |
| 1782 | const then_expr = try c.addNode(.{ | |
| 1783 | .tag = .@"break", | |
| 1784 | .main_token = try c.addToken(.keyword_break, "break"), | |
| 1785 | .data = .{ .opt_token_and_opt_node = .{ | |
| 1786 | .none, | |
| 1787 | .none, | |
| 1788 | } }, | |
| 1789 | }); | |
| 1790 | ||
| 1791 | return c.addNode(.{ | |
| 1792 | .tag = .if_simple, | |
| 1793 | .main_token = if_tok, | |
| 1794 | .data = .{ .node_and_node = .{ | |
| 1795 | cond, | |
| 1796 | then_expr, | |
| 1797 | } }, | |
| 1798 | }); | |
| 1799 | }, | |
| 1800 | .@"switch" => { | |
| 1801 | const payload = node.castTag(.@"switch").?.data; | |
| 1802 | const switch_tok = try c.addToken(.keyword_switch, "switch"); | |
| 1803 | _ = try c.addToken(.l_paren, "("); | |
| 1804 | const cond = try renderNode(c, payload.cond); | |
| 1805 | _ = try c.addToken(.r_paren, ")"); | |
| 1806 | ||
| 1807 | _ = try c.addToken(.l_brace, "{"); | |
| 1808 | var cases = try c.gpa.alloc(NodeIndex, payload.cases.len); | |
| 1809 | defer c.gpa.free(cases); | |
| 1810 | for (payload.cases, 0..) |case, i| { | |
| 1811 | cases[i] = try renderNode(c, case); | |
| 1812 | _ = try c.addToken(.comma, ","); | |
| 1813 | } | |
| 1814 | const span = try c.listToSpan(cases); | |
| 1815 | _ = try c.addToken(.r_brace, "}"); | |
| 1816 | return c.addNode(.{ | |
| 1817 | .tag = .switch_comma, | |
| 1818 | .main_token = switch_tok, | |
| 1819 | .data = .{ .node_and_extra = .{ | |
| 1820 | cond, try c.addExtra(NodeSubRange{ | |
| 1821 | .start = span.start, | |
| 1822 | .end = span.end, | |
| 1823 | }), | |
| 1824 | } }, | |
| 1825 | }); | |
| 1826 | }, | |
| 1827 | .switch_else => { | |
| 1828 | const payload = node.castTag(.switch_else).?.data; | |
| 1829 | _ = try c.addToken(.keyword_else, "else"); | |
| 1830 | return c.addNode(.{ | |
| 1831 | .tag = .switch_case_one, | |
| 1832 | .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), | |
| 1833 | .data = .{ .opt_node_and_node = .{ | |
| 1834 | .none, | |
| 1835 | try renderNode(c, payload), | |
| 1836 | } }, | |
| 1837 | }); | |
| 1838 | }, | |
| 1839 | .switch_prong => { | |
| 1840 | const payload = node.castTag(.switch_prong).?.data; | |
| 1841 | var items = try c.gpa.alloc(NodeIndex, payload.cases.len); | |
| 1842 | defer c.gpa.free(items); | |
| 1843 | for (payload.cases, items, 0..) |case, *item, i| { | |
| 1844 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 1845 | item.* = try renderNode(c, case); | |
| 1846 | } | |
| 1847 | _ = try c.addToken(.r_brace, "}"); | |
| 1848 | if (items.len < 2) { | |
| 1849 | return c.addNode(.{ | |
| 1850 | .tag = .switch_case_one, | |
| 1851 | .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), | |
| 1852 | .data = .{ .opt_node_and_node = .{ | |
| 1853 | if (items.len == 0) .none else items[0].toOptional(), | |
| 1854 | try renderNode(c, payload.cond), | |
| 1855 | } }, | |
| 1856 | }); | |
| 1857 | } else { | |
| 1858 | const span = try c.listToSpan(items); | |
| 1859 | return c.addNode(.{ | |
| 1860 | .tag = .switch_case, | |
| 1861 | .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), | |
| 1862 | .data = .{ .extra_and_node = .{ | |
| 1863 | try c.addExtra(NodeSubRange{ | |
| 1864 | .start = span.start, | |
| 1865 | .end = span.end, | |
| 1866 | }), | |
| 1867 | try renderNode(c, payload.cond), | |
| 1868 | } }, | |
| 1869 | }); | |
| 1870 | } | |
| 1871 | }, | |
| 1872 | .opaque_literal => { | |
| 1873 | const opaque_tok = try c.addToken(.keyword_opaque, "opaque"); | |
| 1874 | _ = try c.addToken(.l_brace, "{"); | |
| 1875 | _ = try c.addToken(.r_brace, "}"); | |
| 1876 | ||
| 1877 | return c.addNode(.{ | |
| 1878 | .tag = .container_decl_two, | |
| 1879 | .main_token = opaque_tok, | |
| 1880 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1881 | .none, | |
| 1882 | .none, | |
| 1883 | } }, | |
| 1884 | }); | |
| 1885 | }, | |
| 1886 | .array_access => { | |
| 1887 | const payload = node.castTag(.array_access).?.data; | |
| 1888 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 1889 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 1890 | const index_expr = try renderNode(c, payload.rhs); | |
| 1891 | _ = try c.addToken(.r_bracket, "]"); | |
| 1892 | return c.addNode(.{ | |
| 1893 | .tag = .array_access, | |
| 1894 | .main_token = l_bracket, | |
| 1895 | .data = .{ .node_and_node = .{ | |
| 1896 | lhs, | |
| 1897 | index_expr, | |
| 1898 | } }, | |
| 1899 | }); | |
| 1900 | }, | |
| 1901 | .array_type => { | |
| 1902 | const payload = node.castTag(.array_type).?.data; | |
| 1903 | return renderArrayType(c, payload.len, payload.elem_type); | |
| 1904 | }, | |
| 1905 | .null_sentinel_array_type => { | |
| 1906 | const payload = node.castTag(.null_sentinel_array_type).?.data; | |
| 1907 | return renderNullSentinelArrayType(c, payload.len, payload.elem_type); | |
| 1908 | }, | |
| 1909 | .array_filler => { | |
| 1910 | const payload = node.castTag(.array_filler).?.data; | |
| 1911 | ||
| 1912 | const type_expr = try renderArrayType(c, 1, payload.type); | |
| 1913 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1914 | const val = try renderNode(c, payload.filler); | |
| 1915 | _ = try c.addToken(.r_brace, "}"); | |
| 1916 | ||
| 1917 | const init = try c.addNode(.{ | |
| 1918 | .tag = .array_init_one, | |
| 1919 | .main_token = l_brace, | |
| 1920 | .data = .{ .node_and_node = .{ | |
| 1921 | type_expr, | |
| 1922 | val, | |
| 1923 | } }, | |
| 1924 | }); | |
| 1925 | return c.addNode(.{ | |
| 1926 | .tag = .array_cat, | |
| 1927 | .main_token = try c.addToken(.asterisk_asterisk, "**"), | |
| 1928 | .data = .{ .node_and_node = .{ | |
| 1929 | init, | |
| 1930 | try c.addNode(.{ | |
| 1931 | .tag = .number_literal, | |
| 1932 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{payload.count}), | |
| 1933 | .data = undefined, | |
| 1934 | }), | |
| 1935 | } }, | |
| 1936 | }); | |
| 1937 | }, | |
| 1938 | .empty_array => { | |
| 1939 | const payload = node.castTag(.empty_array).?.data; | |
| 1940 | ||
| 1941 | const type_expr = try renderArrayType(c, 0, payload); | |
| 1942 | return renderArrayInit(c, type_expr, &.{}); | |
| 1943 | }, | |
| 1944 | .array_init => { | |
| 1945 | const payload = node.castTag(.array_init).?.data; | |
| 1946 | const type_expr = try renderNode(c, payload.cond); | |
| 1947 | return renderArrayInit(c, type_expr, payload.cases); | |
| 1948 | }, | |
| 1949 | .vector_zero_init => { | |
| 1950 | const payload = node.castTag(.vector_zero_init).?.data; | |
| 1951 | return renderBuiltinCall(c, "@splat", &.{payload}); | |
| 1952 | }, | |
| 1953 | .field_access => { | |
| 1954 | const payload = node.castTag(.field_access).?.data; | |
| 1955 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 1956 | return renderFieldAccess(c, lhs, payload.field_name); | |
| 1957 | }, | |
| 1958 | .@"struct", .@"union" => return renderRecord(c, node), | |
| 1959 | .enum_constant => { | |
| 1960 | const payload = node.castTag(.enum_constant).?.data; | |
| 1961 | ||
| 1962 | if (payload.is_public) _ = try c.addToken(.keyword_pub, "pub"); | |
| 1963 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1964 | _ = try c.addIdentifier(payload.name); | |
| 1965 | ||
| 1966 | const type_node = if (payload.type) |enum_const_type| blk: { | |
| 1967 | _ = try c.addToken(.colon, ":"); | |
| 1968 | break :blk try renderNode(c, enum_const_type); | |
| 1969 | } else null; | |
| 1970 | ||
| 1971 | _ = try c.addToken(.equal, "="); | |
| 1972 | ||
| 1973 | const init_node = try renderNode(c, payload.value); | |
| 1974 | _ = try c.addToken(.semicolon, ";"); | |
| 1975 | ||
| 1976 | return c.addNode(.{ | |
| 1977 | .tag = .simple_var_decl, | |
| 1978 | .main_token = const_tok, | |
| 1979 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1980 | .fromOptional(type_node), | |
| 1981 | init_node.toOptional(), | |
| 1982 | } }, | |
| 1983 | }); | |
| 1984 | }, | |
| 1985 | .tuple => { | |
| 1986 | const payload = node.castTag(.tuple).?.data; | |
| 1987 | _ = try c.addToken(.period, "."); | |
| 1988 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1989 | var inits = try c.gpa.alloc(NodeIndex, payload.len); | |
| 1990 | defer c.gpa.free(inits); | |
| 1991 | for (payload, 0..) |init, i| { | |
| 1992 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 1993 | inits[i] = try renderNode(c, init); | |
| 1994 | } | |
| 1995 | _ = try c.addToken(.r_brace, "}"); | |
| 1996 | if (payload.len < 3) { | |
| 1997 | return c.addNode(.{ | |
| 1998 | .tag = .array_init_dot_two, | |
| 1999 | .main_token = l_brace, | |
| 2000 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2001 | if (inits.len < 1) .none else inits[0].toOptional(), | |
| 2002 | if (inits.len < 2) .none else inits[1].toOptional(), | |
| 2003 | } }, | |
| 2004 | }); | |
| 2005 | } else { | |
| 2006 | const span = try c.listToSpan(inits); | |
| 2007 | return c.addNode(.{ | |
| 2008 | .tag = .array_init_dot, | |
| 2009 | .main_token = l_brace, | |
| 2010 | .data = .{ .extra_range = span }, | |
| 2011 | }); | |
| 2012 | } | |
| 2013 | }, | |
| 2014 | .container_init_dot => { | |
| 2015 | const payload = node.castTag(.container_init_dot).?.data; | |
| 2016 | _ = try c.addToken(.period, "."); | |
| 2017 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2018 | var inits = try c.gpa.alloc(NodeIndex, payload.len); | |
| 2019 | defer c.gpa.free(inits); | |
| 2020 | for (payload, 0..) |init, i| { | |
| 2021 | _ = try c.addToken(.period, "."); | |
| 2022 | _ = try c.addIdentifier(init.name); | |
| 2023 | _ = try c.addToken(.equal, "="); | |
| 2024 | inits[i] = try renderNode(c, init.value); | |
| 2025 | _ = try c.addToken(.comma, ","); | |
| 2026 | } | |
| 2027 | _ = try c.addToken(.r_brace, "}"); | |
| 2028 | ||
| 2029 | if (payload.len < 3) { | |
| 2030 | return c.addNode(.{ | |
| 2031 | .tag = .struct_init_dot_two_comma, | |
| 2032 | .main_token = l_brace, | |
| 2033 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2034 | if (inits.len < 1) .none else inits[0].toOptional(), | |
| 2035 | if (inits.len < 2) .none else inits[1].toOptional(), | |
| 2036 | } }, | |
| 2037 | }); | |
| 2038 | } else { | |
| 2039 | const span = try c.listToSpan(inits); | |
| 2040 | return c.addNode(.{ | |
| 2041 | .tag = .struct_init_dot_comma, | |
| 2042 | .main_token = l_brace, | |
| 2043 | .data = .{ .extra_range = span }, | |
| 2044 | }); | |
| 2045 | } | |
| 2046 | }, | |
| 2047 | .container_init => { | |
| 2048 | const payload = node.castTag(.container_init).?.data; | |
| 2049 | const lhs = try renderNode(c, payload.lhs); | |
| 2050 | ||
| 2051 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2052 | var inits = try c.gpa.alloc(NodeIndex, payload.inits.len); | |
| 2053 | defer c.gpa.free(inits); | |
| 2054 | for (payload.inits, 0..) |init, i| { | |
| 2055 | _ = try c.addToken(.period, "."); | |
| 2056 | _ = try c.addIdentifier(init.name); | |
| 2057 | _ = try c.addToken(.equal, "="); | |
| 2058 | inits[i] = try renderNode(c, init.value); | |
| 2059 | _ = try c.addToken(.comma, ","); | |
| 2060 | } | |
| 2061 | _ = try c.addToken(.r_brace, "}"); | |
| 2062 | ||
| 2063 | return switch (payload.inits.len) { | |
| 2064 | 0 => c.addNode(.{ | |
| 2065 | .tag = .struct_init_one, | |
| 2066 | .main_token = l_brace, | |
| 2067 | .data = .{ .node_and_opt_node = .{ | |
| 2068 | lhs, | |
| 2069 | .none, | |
| 2070 | } }, | |
| 2071 | }), | |
| 2072 | 1 => c.addNode(.{ | |
| 2073 | .tag = .struct_init_one_comma, | |
| 2074 | .main_token = l_brace, | |
| 2075 | .data = .{ .node_and_opt_node = .{ | |
| 2076 | lhs, | |
| 2077 | inits[0].toOptional(), | |
| 2078 | } }, | |
| 2079 | }), | |
| 2080 | else => blk: { | |
| 2081 | const span = try c.listToSpan(inits); | |
| 2082 | break :blk c.addNode(.{ | |
| 2083 | .tag = .struct_init_comma, | |
| 2084 | .main_token = l_brace, | |
| 2085 | .data = .{ .node_and_extra = .{ | |
| 2086 | lhs, try c.addExtra(NodeSubRange{ | |
| 2087 | .start = span.start, | |
| 2088 | .end = span.end, | |
| 2089 | }), | |
| 2090 | } }, | |
| 2091 | }); | |
| 2092 | }, | |
| 2093 | }; | |
| 2094 | }, | |
| 2095 | .@"anytype" => unreachable, // Handled in renderParams | |
| 2096 | } | |
| 2097 | } | |
| 2098 | ||
| 2099 | fn renderRecord(c: *Context, node: Node) !NodeIndex { | |
| 2100 | const payload = @as(*Payload.Record, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2101 | if (payload.layout == .@"packed") | |
| 2102 | _ = try c.addToken(.keyword_packed, "packed") | |
| 2103 | else if (payload.layout == .@"extern") | |
| 2104 | _ = try c.addToken(.keyword_extern, "extern"); | |
| 2105 | const kind_tok = if (node.tag() == .@"struct") | |
| 2106 | try c.addToken(.keyword_struct, "struct") | |
| 2107 | else | |
| 2108 | try c.addToken(.keyword_union, "union"); | |
| 2109 | ||
| 2110 | _ = try c.addToken(.l_brace, "{"); | |
| 2111 | ||
| 2112 | const num_vars = payload.variables.len; | |
| 2113 | const num_funcs = payload.functions.len; | |
| 2114 | const total_members = payload.fields.len + num_vars + num_funcs; | |
| 2115 | const members = try c.gpa.alloc(NodeIndex, total_members); | |
| 2116 | defer c.gpa.free(members); | |
| 2117 | ||
| 2118 | for (payload.fields, 0..) |field, i| { | |
| 2119 | const name_tok = try c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(field.name, .{ .allow_primitive = true })}); | |
| 2120 | _ = try c.addToken(.colon, ":"); | |
| 2121 | const type_expr = try renderNode(c, field.type); | |
| 2122 | ||
| 2123 | const align_expr = if (field.alignment) |alignment| blk: { | |
| 2124 | _ = try c.addToken(.keyword_align, "align"); | |
| 2125 | _ = try c.addToken(.l_paren, "("); | |
| 2126 | const align_expr = try c.addNode(.{ | |
| 2127 | .tag = .number_literal, | |
| 2128 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{alignment}), | |
| 2129 | .data = undefined, | |
| 2130 | }); | |
| 2131 | _ = try c.addToken(.r_paren, ")"); | |
| 2132 | break :blk align_expr; | |
| 2133 | } else null; | |
| 2134 | ||
| 2135 | const value_expr = if (field.default_value) |value| blk: { | |
| 2136 | _ = try c.addToken(.equal, "="); | |
| 2137 | break :blk try renderNode(c, value); | |
| 2138 | } else null; | |
| 2139 | ||
| 2140 | members[i] = try c.addNode(if (align_expr == null) .{ | |
| 2141 | .tag = .container_field_init, | |
| 2142 | .main_token = name_tok, | |
| 2143 | .data = .{ .node_and_opt_node = .{ | |
| 2144 | type_expr, | |
| 2145 | .fromOptional(value_expr), | |
| 2146 | } }, | |
| 2147 | } else if (value_expr == null) .{ | |
| 2148 | .tag = .container_field_align, | |
| 2149 | .main_token = name_tok, | |
| 2150 | .data = .{ .node_and_node = .{ | |
| 2151 | type_expr, | |
| 2152 | align_expr.?, | |
| 2153 | } }, | |
| 2154 | } else .{ | |
| 2155 | .tag = .container_field, | |
| 2156 | .main_token = name_tok, | |
| 2157 | .data = .{ .node_and_extra = .{ | |
| 2158 | type_expr, try c.addExtra(std.zig.Ast.Node.ContainerField{ | |
| 2159 | .align_expr = align_expr.?, | |
| 2160 | .value_expr = value_expr.?, | |
| 2161 | }), | |
| 2162 | } }, | |
| 2163 | }); | |
| 2164 | _ = try c.addToken(.comma, ","); | |
| 2165 | } | |
| 2166 | for (payload.variables, 0..) |variable, i| { | |
| 2167 | members[payload.fields.len + i] = try renderNode(c, variable); | |
| 2168 | } | |
| 2169 | for (payload.functions, 0..) |function, i| { | |
| 2170 | members[payload.fields.len + num_vars + i] = try renderNode(c, function); | |
| 2171 | } | |
| 2172 | _ = try c.addToken(.r_brace, "}"); | |
| 2173 | ||
| 2174 | if (total_members == 0) { | |
| 2175 | return c.addNode(.{ | |
| 2176 | .tag = .container_decl_two, | |
| 2177 | .main_token = kind_tok, | |
| 2178 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2179 | .none, | |
| 2180 | .none, | |
| 2181 | } }, | |
| 2182 | }); | |
| 2183 | } else if (total_members <= 2) { | |
| 2184 | return c.addNode(.{ | |
| 2185 | .tag = if (num_funcs == 0) .container_decl_two_trailing else .container_decl_two, | |
| 2186 | .main_token = kind_tok, | |
| 2187 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2188 | if (members.len < 1) .none else members[0].toOptional(), | |
| 2189 | if (members.len < 2) .none else members[1].toOptional(), | |
| 2190 | } }, | |
| 2191 | }); | |
| 2192 | } else { | |
| 2193 | const span = try c.listToSpan(members); | |
| 2194 | return c.addNode(.{ | |
| 2195 | .tag = if (num_funcs == 0) .container_decl_trailing else .container_decl, | |
| 2196 | .main_token = kind_tok, | |
| 2197 | .data = .{ .extra_range = span }, | |
| 2198 | }); | |
| 2199 | } | |
| 2200 | } | |
| 2201 | ||
| 2202 | fn renderFieldAccess(c: *Context, lhs: NodeIndex, field_name: []const u8) !NodeIndex { | |
| 2203 | return c.addNode(.{ | |
| 2204 | .tag = .field_access, | |
| 2205 | .main_token = try c.addToken(.period, "."), | |
| 2206 | .data = .{ .node_and_token = .{ | |
| 2207 | lhs, | |
| 2208 | try c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(field_name, .{ .allow_primitive = true })}), | |
| 2209 | } }, | |
| 2210 | }); | |
| 2211 | } | |
| 2212 | ||
| 2213 | fn renderArrayInit(c: *Context, lhs: NodeIndex, inits: []const Node) !NodeIndex { | |
| 2214 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2215 | var rendered = try c.gpa.alloc(NodeIndex, inits.len); | |
| 2216 | defer c.gpa.free(rendered); | |
| 2217 | for (inits, 0..) |init, i| { | |
| 2218 | rendered[i] = try renderNode(c, init); | |
| 2219 | _ = try c.addToken(.comma, ","); | |
| 2220 | } | |
| 2221 | _ = try c.addToken(.r_brace, "}"); | |
| 2222 | switch (inits.len) { | |
| 2223 | 0 => return c.addNode(.{ | |
| 2224 | .tag = .struct_init_one, | |
| 2225 | .main_token = l_brace, | |
| 2226 | .data = .{ .node_and_opt_node = .{ | |
| 2227 | lhs, | |
| 2228 | .none, | |
| 2229 | } }, | |
| 2230 | }), | |
| 2231 | 1 => return c.addNode(.{ | |
| 2232 | .tag = .array_init_one_comma, | |
| 2233 | .main_token = l_brace, | |
| 2234 | .data = .{ .node_and_node = .{ | |
| 2235 | lhs, | |
| 2236 | rendered[0], | |
| 2237 | } }, | |
| 2238 | }), | |
| 2239 | else => { | |
| 2240 | const span = try c.listToSpan(rendered); | |
| 2241 | return c.addNode(.{ | |
| 2242 | .tag = .array_init_comma, | |
| 2243 | .main_token = l_brace, | |
| 2244 | .data = .{ .node_and_extra = .{ | |
| 2245 | lhs, try c.addExtra(NodeSubRange{ | |
| 2246 | .start = span.start, | |
| 2247 | .end = span.end, | |
| 2248 | }), | |
| 2249 | } }, | |
| 2250 | }); | |
| 2251 | }, | |
| 2252 | } | |
| 2253 | } | |
| 2254 | ||
| 2255 | fn renderArrayType(c: *Context, len: usize, elem_type: Node) !NodeIndex { | |
| 2256 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 2257 | const len_expr = try c.addNode(.{ | |
| 2258 | .tag = .number_literal, | |
| 2259 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{len}), | |
| 2260 | .data = undefined, | |
| 2261 | }); | |
| 2262 | _ = try c.addToken(.r_bracket, "]"); | |
| 2263 | const elem_type_expr = try renderNode(c, elem_type); | |
| 2264 | return c.addNode(.{ | |
| 2265 | .tag = .array_type, | |
| 2266 | .main_token = l_bracket, | |
| 2267 | .data = .{ .node_and_node = .{ | |
| 2268 | len_expr, | |
| 2269 | elem_type_expr, | |
| 2270 | } }, | |
| 2271 | }); | |
| 2272 | } | |
| 2273 | ||
| 2274 | fn renderNullSentinelArrayType(c: *Context, len: usize, elem_type: Node) !NodeIndex { | |
| 2275 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 2276 | const len_expr = try c.addNode(.{ | |
| 2277 | .tag = .number_literal, | |
| 2278 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{len}), | |
| 2279 | .data = undefined, | |
| 2280 | }); | |
| 2281 | _ = try c.addToken(.colon, ":"); | |
| 2282 | ||
| 2283 | const sentinel_expr = try c.addNode(.{ | |
| 2284 | .tag = .number_literal, | |
| 2285 | .main_token = try c.addToken(.number_literal, "0"), | |
| 2286 | .data = undefined, | |
| 2287 | }); | |
| 2288 | ||
| 2289 | _ = try c.addToken(.r_bracket, "]"); | |
| 2290 | const elem_type_expr = try renderNode(c, elem_type); | |
| 2291 | return c.addNode(.{ | |
| 2292 | .tag = .array_type_sentinel, | |
| 2293 | .main_token = l_bracket, | |
| 2294 | .data = .{ .node_and_extra = .{ | |
| 2295 | len_expr, | |
| 2296 | try c.addExtra(std.zig.Ast.Node.ArrayTypeSentinel{ | |
| 2297 | .sentinel = sentinel_expr, | |
| 2298 | .elem_type = elem_type_expr, | |
| 2299 | }), | |
| 2300 | } }, | |
| 2301 | }); | |
| 2302 | } | |
| 2303 | ||
| 2304 | fn addSemicolonIfNeeded(c: *Context, node: Node) !void { | |
| 2305 | switch (node.tag()) { | |
| 2306 | .warning => unreachable, | |
| 2307 | .var_decl, .var_simple, .arg_redecl, .alias, .block, .empty_block, .block_single, .@"switch", .static_local_var, .extern_local_var, .extern_local_fn, .mut_str => {}, | |
| 2308 | .while_true => { | |
| 2309 | const payload = node.castTag(.while_true).?.data; | |
| 2310 | return addSemicolonIfNotBlock(c, payload); | |
| 2311 | }, | |
| 2312 | .@"while" => { | |
| 2313 | const payload = node.castTag(.@"while").?.data; | |
| 2314 | return addSemicolonIfNotBlock(c, payload.body); | |
| 2315 | }, | |
| 2316 | .@"if" => { | |
| 2317 | const payload = node.castTag(.@"if").?.data; | |
| 2318 | if (payload.@"else") |some| | |
| 2319 | return addSemicolonIfNeeded(c, some); | |
| 2320 | return addSemicolonIfNotBlock(c, payload.then); | |
| 2321 | }, | |
| 2322 | else => _ = try c.addToken(.semicolon, ";"), | |
| 2323 | } | |
| 2324 | } | |
| 2325 | ||
| 2326 | fn addSemicolonIfNotBlock(c: *Context, node: Node) !void { | |
| 2327 | switch (node.tag()) { | |
| 2328 | .block, .empty_block, .block_single => {}, | |
| 2329 | else => _ = try c.addToken(.semicolon, ";"), | |
| 2330 | } | |
| 2331 | } | |
| 2332 | ||
| 2333 | fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { | |
| 2334 | switch (node.tag()) { | |
| 2335 | .declaration => unreachable, | |
| 2336 | .null_literal, | |
| 2337 | .undefined_literal, | |
| 2338 | .true_literal, | |
| 2339 | .false_literal, | |
| 2340 | .return_void, | |
| 2341 | .zero_literal, | |
| 2342 | .one_literal, | |
| 2343 | .void_type, | |
| 2344 | .noreturn_type, | |
| 2345 | .@"anytype", | |
| 2346 | .div_trunc, | |
| 2347 | .signed_remainder, | |
| 2348 | .int_cast, | |
| 2349 | .const_cast, | |
| 2350 | .volatile_cast, | |
| 2351 | .as, | |
| 2352 | .truncate, | |
| 2353 | .bit_cast, | |
| 2354 | .float_cast, | |
| 2355 | .int_from_float, | |
| 2356 | .float_from_int, | |
| 2357 | .ptr_from_int, | |
| 2358 | .std_mem_zeroes, | |
| 2359 | .int_from_ptr, | |
| 2360 | .sizeof, | |
| 2361 | .alignof, | |
| 2362 | .typeof, | |
| 2363 | .typeinfo, | |
| 2364 | .vector, | |
| 2365 | .helpers_sizeof, | |
| 2366 | .helpers_cast, | |
| 2367 | .helpers_promoteIntLiteral, | |
| 2368 | .helpers_shuffle_vector_index, | |
| 2369 | .helpers_flexible_array_type, | |
| 2370 | .std_mem_zeroinit, | |
| 2371 | .integer_literal, | |
| 2372 | .float_literal, | |
| 2373 | .string_literal, | |
| 2374 | .string_slice, | |
| 2375 | .char_literal, | |
| 2376 | .enum_literal, | |
| 2377 | .identifier, | |
| 2378 | .fn_identifier, | |
| 2379 | .field_access, | |
| 2380 | .ptr_cast, | |
| 2381 | .type, | |
| 2382 | .array_access, | |
| 2383 | .align_cast, | |
| 2384 | .optional_type, | |
| 2385 | .c_pointer, | |
| 2386 | .single_pointer, | |
| 2387 | .unwrap, | |
| 2388 | .deref, | |
| 2389 | .not, | |
| 2390 | .negate, | |
| 2391 | .negate_wrap, | |
| 2392 | .bit_not, | |
| 2393 | .func, | |
| 2394 | .call, | |
| 2395 | .array_type, | |
| 2396 | .null_sentinel_array_type, | |
| 2397 | .int_from_bool, | |
| 2398 | .div_exact, | |
| 2399 | .offset_of, | |
| 2400 | .shuffle, | |
| 2401 | .builtin_extern, | |
| 2402 | .static_local_var, | |
| 2403 | .extern_local_var, | |
| 2404 | .extern_local_fn, | |
| 2405 | .mut_str, | |
| 2406 | .macro_arithmetic, | |
| 2407 | => { | |
| 2408 | // no grouping needed | |
| 2409 | return renderNode(c, node); | |
| 2410 | }, | |
| 2411 | ||
| 2412 | .opaque_literal, | |
| 2413 | .empty_array, | |
| 2414 | .block_single, | |
| 2415 | .add, | |
| 2416 | .add_wrap, | |
| 2417 | .sub, | |
| 2418 | .sub_wrap, | |
| 2419 | .mul, | |
| 2420 | .mul_wrap, | |
| 2421 | .div, | |
| 2422 | .shl, | |
| 2423 | .shr, | |
| 2424 | .mod, | |
| 2425 | .@"and", | |
| 2426 | .@"or", | |
| 2427 | .less_than, | |
| 2428 | .less_than_equal, | |
| 2429 | .greater_than, | |
| 2430 | .greater_than_equal, | |
| 2431 | .equal, | |
| 2432 | .not_equal, | |
| 2433 | .bit_and, | |
| 2434 | .bit_or, | |
| 2435 | .bit_xor, | |
| 2436 | .empty_block, | |
| 2437 | .array_cat, | |
| 2438 | .array_filler, | |
| 2439 | .@"if", | |
| 2440 | .@"struct", | |
| 2441 | .@"union", | |
| 2442 | .array_init, | |
| 2443 | .vector_zero_init, | |
| 2444 | .tuple, | |
| 2445 | .container_init, | |
| 2446 | .container_init_dot, | |
| 2447 | .block, | |
| 2448 | .address_of, | |
| 2449 | => return c.addNode(.{ | |
| 2450 | .tag = .grouped_expression, | |
| 2451 | .main_token = try c.addToken(.l_paren, "("), | |
| 2452 | .data = .{ .node_and_token = .{ | |
| 2453 | try renderNode(c, node), | |
| 2454 | try c.addToken(.r_paren, ")"), | |
| 2455 | } }, | |
| 2456 | }), | |
| 2457 | .ellipsis3, | |
| 2458 | .switch_prong, | |
| 2459 | .warning, | |
| 2460 | .var_decl, | |
| 2461 | .fail_decl, | |
| 2462 | .arg_redecl, | |
| 2463 | .alias, | |
| 2464 | .var_simple, | |
| 2465 | .pub_var_simple, | |
| 2466 | .enum_constant, | |
| 2467 | .@"while", | |
| 2468 | .@"switch", | |
| 2469 | .@"break", | |
| 2470 | .break_val, | |
| 2471 | .pub_inline_fn, | |
| 2472 | .discard, | |
| 2473 | .@"continue", | |
| 2474 | .@"return", | |
| 2475 | .@"comptime", | |
| 2476 | .@"defer", | |
| 2477 | .asm_simple, | |
| 2478 | .while_true, | |
| 2479 | .if_not_break, | |
| 2480 | .switch_else, | |
| 2481 | .add_assign, | |
| 2482 | .add_wrap_assign, | |
| 2483 | .sub_assign, | |
| 2484 | .sub_wrap_assign, | |
| 2485 | .mul_assign, | |
| 2486 | .mul_wrap_assign, | |
| 2487 | .div_assign, | |
| 2488 | .shl_assign, | |
| 2489 | .shr_assign, | |
| 2490 | .mod_assign, | |
| 2491 | .bit_and_assign, | |
| 2492 | .bit_or_assign, | |
| 2493 | .bit_xor_assign, | |
| 2494 | .assign, | |
| 2495 | .helpers_macro, | |
| 2496 | .import_c_builtin, | |
| 2497 | => { | |
| 2498 | // these should never appear in places where grouping might be needed. | |
| 2499 | unreachable; | |
| 2500 | }, | |
| 2501 | } | |
| 2502 | } | |
| 2503 | ||
| 2504 | fn renderPrefixOp(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: TokenTag, bytes: []const u8) !NodeIndex { | |
| 2505 | const payload = @as(*Payload.UnOp, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2506 | return c.addNode(.{ | |
| 2507 | .tag = tag, | |
| 2508 | .main_token = try c.addToken(tok_tag, bytes), | |
| 2509 | .data = .{ .node = try renderNodeGrouped(c, payload) }, | |
| 2510 | }); | |
| 2511 | } | |
| 2512 | ||
| 2513 | fn renderBinOpGrouped(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: TokenTag, bytes: []const u8) !NodeIndex { | |
| 2514 | const payload = @as(*Payload.BinOp, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2515 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 2516 | return c.addNode(.{ | |
| 2517 | .tag = tag, | |
| 2518 | .main_token = try c.addToken(tok_tag, bytes), | |
| 2519 | .data = .{ .node_and_node = .{ | |
| 2520 | lhs, | |
| 2521 | try renderNodeGrouped(c, payload.rhs), | |
| 2522 | } }, | |
| 2523 | }); | |
| 2524 | } | |
| 2525 | ||
| 2526 | fn renderBinOp(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: TokenTag, bytes: []const u8) !NodeIndex { | |
| 2527 | const payload = @as(*Payload.BinOp, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2528 | const lhs = try renderNode(c, payload.lhs); | |
| 2529 | return c.addNode(.{ | |
| 2530 | .tag = tag, | |
| 2531 | .main_token = try c.addToken(tok_tag, bytes), | |
| 2532 | .data = .{ .node_and_node = .{ | |
| 2533 | lhs, | |
| 2534 | try renderNode(c, payload.rhs), | |
| 2535 | } }, | |
| 2536 | }); | |
| 2537 | } | |
| 2538 | ||
| 2539 | fn renderStdImport(c: *Context, parts: []const []const u8) !NodeIndex { | |
| 2540 | const import_tok = try c.addToken(.builtin, "@import"); | |
| 2541 | _ = try c.addToken(.l_paren, "("); | |
| 2542 | const std_tok = try c.addToken(.string_literal, "\"std\""); | |
| 2543 | const std_node = try c.addNode(.{ | |
| 2544 | .tag = .string_literal, | |
| 2545 | .main_token = std_tok, | |
| 2546 | .data = undefined, | |
| 2547 | }); | |
| 2548 | _ = try c.addToken(.r_paren, ")"); | |
| 2549 | ||
| 2550 | const import_node = try c.addNode(.{ | |
| 2551 | .tag = .builtin_call_two, | |
| 2552 | .main_token = import_tok, | |
| 2553 | .data = .{ .opt_node_and_opt_node = .{ std_node.toOptional(), .none } }, | |
| 2554 | }); | |
| 2555 | ||
| 2556 | var access_chain = import_node; | |
| 2557 | for (parts) |part| { | |
| 2558 | access_chain = try renderFieldAccess(c, access_chain, part); | |
| 2559 | } | |
| 2560 | return access_chain; | |
| 2561 | } | |
| 2562 | ||
| 2563 | fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex { | |
| 2564 | const lparen = try c.addToken(.l_paren, "("); | |
| 2565 | const res = switch (args.len) { | |
| 2566 | 0 => try c.addNode(.{ | |
| 2567 | .tag = .call_one, | |
| 2568 | .main_token = lparen, | |
| 2569 | .data = .{ .node_and_opt_node = .{ lhs, .none } }, | |
| 2570 | }), | |
| 2571 | 1 => blk: { | |
| 2572 | const arg = try renderNode(c, args[0]); | |
| 2573 | break :blk try c.addNode(.{ | |
| 2574 | .tag = .call_one, | |
| 2575 | .main_token = lparen, | |
| 2576 | .data = .{ .node_and_opt_node = .{ lhs, arg.toOptional() } }, | |
| 2577 | }); | |
| 2578 | }, | |
| 2579 | else => blk: { | |
| 2580 | var rendered = try c.gpa.alloc(NodeIndex, args.len); | |
| 2581 | defer c.gpa.free(rendered); | |
| 2582 | ||
| 2583 | for (args, 0..) |arg, i| { | |
| 2584 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 2585 | rendered[i] = try renderNode(c, arg); | |
| 2586 | } | |
| 2587 | const span = try c.listToSpan(rendered); | |
| 2588 | break :blk try c.addNode(.{ | |
| 2589 | .tag = .call, | |
| 2590 | .main_token = lparen, | |
| 2591 | .data = .{ .node_and_extra = .{ | |
| 2592 | lhs, | |
| 2593 | try c.addExtra(NodeSubRange{ .start = span.start, .end = span.end }), | |
| 2594 | } }, | |
| 2595 | }); | |
| 2596 | }, | |
| 2597 | }; | |
| 2598 | _ = try c.addToken(.r_paren, ")"); | |
| 2599 | return res; | |
| 2600 | } | |
| 2601 | ||
| 2602 | fn renderBuiltinCall(c: *Context, builtin: []const u8, args: []const Node) !NodeIndex { | |
| 2603 | const builtin_tok = try c.addToken(.builtin, builtin); | |
| 2604 | _ = try c.addToken(.l_paren, "("); | |
| 2605 | var arg_1: NodeIndex = undefined; | |
| 2606 | var arg_2: NodeIndex = undefined; | |
| 2607 | var arg_3: NodeIndex = undefined; | |
| 2608 | var arg_4: NodeIndex = undefined; | |
| 2609 | switch (args.len) { | |
| 2610 | 0 => {}, | |
| 2611 | 1 => { | |
| 2612 | arg_1 = try renderNode(c, args[0]); | |
| 2613 | }, | |
| 2614 | 2 => { | |
| 2615 | arg_1 = try renderNode(c, args[0]); | |
| 2616 | _ = try c.addToken(.comma, ","); | |
| 2617 | arg_2 = try renderNode(c, args[1]); | |
| 2618 | }, | |
| 2619 | 4 => { | |
| 2620 | arg_1 = try renderNode(c, args[0]); | |
| 2621 | _ = try c.addToken(.comma, ","); | |
| 2622 | arg_2 = try renderNode(c, args[1]); | |
| 2623 | _ = try c.addToken(.comma, ","); | |
| 2624 | arg_3 = try renderNode(c, args[2]); | |
| 2625 | _ = try c.addToken(.comma, ","); | |
| 2626 | arg_4 = try renderNode(c, args[3]); | |
| 2627 | }, | |
| 2628 | else => unreachable, // expand this function as needed. | |
| 2629 | } | |
| 2630 | ||
| 2631 | _ = try c.addToken(.r_paren, ")"); | |
| 2632 | if (args.len <= 2) { | |
| 2633 | return c.addNode(.{ | |
| 2634 | .tag = .builtin_call_two, | |
| 2635 | .main_token = builtin_tok, | |
| 2636 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2637 | if (args.len < 1) .none else arg_1.toOptional(), | |
| 2638 | if (args.len < 2) .none else arg_2.toOptional(), | |
| 2639 | } }, | |
| 2640 | }); | |
| 2641 | } else { | |
| 2642 | std.debug.assert(args.len == 4); | |
| 2643 | ||
| 2644 | const params = try c.listToSpan(&.{ arg_1, arg_2, arg_3, arg_4 }); | |
| 2645 | return c.addNode(.{ | |
| 2646 | .tag = .builtin_call, | |
| 2647 | .main_token = builtin_tok, | |
| 2648 | .data = .{ .extra_range = params }, | |
| 2649 | }); | |
| 2650 | } | |
| 2651 | } | |
| 2652 | ||
| 2653 | fn renderVar(c: *Context, node: Node) !NodeIndex { | |
| 2654 | const payload = node.castTag(.var_decl).?.data; | |
| 2655 | if (payload.is_pub) _ = try c.addToken(.keyword_pub, "pub"); | |
| 2656 | if (payload.is_extern) _ = try c.addToken(.keyword_extern, "extern"); | |
| 2657 | if (payload.is_export) _ = try c.addToken(.keyword_export, "export"); | |
| 2658 | if (payload.is_threadlocal) _ = try c.addToken(.keyword_threadlocal, "threadlocal"); | |
| 2659 | const mut_tok = if (payload.is_const) | |
| 2660 | try c.addToken(.keyword_const, "const") | |
| 2661 | else | |
| 2662 | try c.addToken(.keyword_var, "var"); | |
| 2663 | _ = try c.addIdentifier(payload.name); | |
| 2664 | _ = try c.addToken(.colon, ":"); | |
| 2665 | const type_node = try renderNode(c, payload.type); | |
| 2666 | ||
| 2667 | const align_node = if (payload.alignment) |some| blk: { | |
| 2668 | _ = try c.addToken(.keyword_align, "align"); | |
| 2669 | _ = try c.addToken(.l_paren, "("); | |
| 2670 | const res = try c.addNode(.{ | |
| 2671 | .tag = .number_literal, | |
| 2672 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{some}), | |
| 2673 | .data = undefined, | |
| 2674 | }); | |
| 2675 | _ = try c.addToken(.r_paren, ")"); | |
| 2676 | break :blk res; | |
| 2677 | } else null; | |
| 2678 | ||
| 2679 | const section_node = if (payload.linksection_string) |some| blk: { | |
| 2680 | _ = try c.addToken(.keyword_linksection, "linksection"); | |
| 2681 | _ = try c.addToken(.l_paren, "("); | |
| 2682 | const res = try c.addNode(.{ | |
| 2683 | .tag = .string_literal, | |
| 2684 | .main_token = try c.addTokenFmt(.string_literal, "\"{f}\"", .{std.zig.fmtString(some)}), | |
| 2685 | .data = undefined, | |
| 2686 | }); | |
| 2687 | _ = try c.addToken(.r_paren, ")"); | |
| 2688 | break :blk res; | |
| 2689 | } else null; | |
| 2690 | ||
| 2691 | const init_node = if (payload.init) |some| blk: { | |
| 2692 | _ = try c.addToken(.equal, "="); | |
| 2693 | break :blk try renderNode(c, some); | |
| 2694 | } else null; | |
| 2695 | _ = try c.addToken(.semicolon, ";"); | |
| 2696 | ||
| 2697 | if (section_node == null) { | |
| 2698 | if (align_node == null) { | |
| 2699 | return c.addNode(.{ | |
| 2700 | .tag = .simple_var_decl, | |
| 2701 | .main_token = mut_tok, | |
| 2702 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2703 | type_node.toOptional(), | |
| 2704 | .fromOptional(init_node), | |
| 2705 | } }, | |
| 2706 | }); | |
| 2707 | } else { | |
| 2708 | return c.addNode(.{ | |
| 2709 | .tag = .local_var_decl, | |
| 2710 | .main_token = mut_tok, | |
| 2711 | .data = .{ .extra_and_opt_node = .{ | |
| 2712 | try c.addExtra(std.zig.Ast.Node.LocalVarDecl{ | |
| 2713 | .type_node = type_node, | |
| 2714 | .align_node = align_node.?, | |
| 2715 | }), | |
| 2716 | .fromOptional(init_node), | |
| 2717 | } }, | |
| 2718 | }); | |
| 2719 | } | |
| 2720 | } else { | |
| 2721 | return c.addNode(.{ | |
| 2722 | .tag = .global_var_decl, | |
| 2723 | .main_token = mut_tok, | |
| 2724 | .data = .{ .extra_and_opt_node = .{ | |
| 2725 | try c.addExtra(std.zig.Ast.Node.GlobalVarDecl{ | |
| 2726 | .type_node = type_node.toOptional(), | |
| 2727 | .align_node = .fromOptional(align_node), | |
| 2728 | .section_node = .fromOptional(section_node), | |
| 2729 | .addrspace_node = .none, | |
| 2730 | }), | |
| 2731 | .fromOptional(init_node), | |
| 2732 | } }, | |
| 2733 | }); | |
| 2734 | } | |
| 2735 | } | |
| 2736 | ||
| 2737 | fn renderFunc(c: *Context, node: Node) !NodeIndex { | |
| 2738 | const payload = node.castTag(.func).?.data; | |
| 2739 | if (payload.is_pub) _ = try c.addToken(.keyword_pub, "pub"); | |
| 2740 | if (payload.is_extern) _ = try c.addToken(.keyword_extern, "extern"); | |
| 2741 | if (payload.is_export) _ = try c.addToken(.keyword_export, "export"); | |
| 2742 | if (payload.is_inline) _ = try c.addToken(.keyword_inline, "inline"); | |
| 2743 | const fn_token = try c.addToken(.keyword_fn, "fn"); | |
| 2744 | if (payload.name) |some| _ = try c.addIdentifier(some); | |
| 2745 | ||
| 2746 | const params = try renderParams(c, payload.params, payload.is_var_args); | |
| 2747 | defer params.deinit(); | |
| 2748 | var span: NodeSubRange = undefined; | |
| 2749 | if (params.items.len > 1) span = try c.listToSpan(params.items); | |
| 2750 | ||
| 2751 | const align_expr = if (payload.alignment) |some| blk: { | |
| 2752 | _ = try c.addToken(.keyword_align, "align"); | |
| 2753 | _ = try c.addToken(.l_paren, "("); | |
| 2754 | const res = try c.addNode(.{ | |
| 2755 | .tag = .number_literal, | |
| 2756 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{some}), | |
| 2757 | .data = undefined, | |
| 2758 | }); | |
| 2759 | _ = try c.addToken(.r_paren, ")"); | |
| 2760 | break :blk res; | |
| 2761 | } else null; | |
| 2762 | ||
| 2763 | const section_expr = if (payload.linksection_string) |some| blk: { | |
| 2764 | _ = try c.addToken(.keyword_linksection, "linksection"); | |
| 2765 | _ = try c.addToken(.l_paren, "("); | |
| 2766 | const res = try c.addNode(.{ | |
| 2767 | .tag = .string_literal, | |
| 2768 | .main_token = try c.addTokenFmt(.string_literal, "\"{f}\"", .{std.zig.fmtString(some)}), | |
| 2769 | .data = undefined, | |
| 2770 | }); | |
| 2771 | _ = try c.addToken(.r_paren, ")"); | |
| 2772 | break :blk res; | |
| 2773 | } else null; | |
| 2774 | ||
| 2775 | const callconv_expr = if (payload.explicit_callconv) |some| blk: { | |
| 2776 | _ = try c.addToken(.keyword_callconv, "callconv"); | |
| 2777 | _ = try c.addToken(.l_paren, "("); | |
| 2778 | const cc_node = switch (some) { | |
| 2779 | .c => cc_node: { | |
| 2780 | _ = try c.addToken(.period, "."); | |
| 2781 | break :cc_node try c.addNode(.{ | |
| 2782 | .tag = .enum_literal, | |
| 2783 | .main_token = try c.addToken(.identifier, "c"), | |
| 2784 | .data = undefined, | |
| 2785 | }); | |
| 2786 | }, | |
| 2787 | .x86_64_sysv, | |
| 2788 | .x86_64_win, | |
| 2789 | .x86_stdcall, | |
| 2790 | .x86_fastcall, | |
| 2791 | .x86_thiscall, | |
| 2792 | .x86_vectorcall, | |
| 2793 | .aarch64_vfabi, | |
| 2794 | .arm_aapcs, | |
| 2795 | .arm_aapcs_vfp, | |
| 2796 | .m68k_rtd, | |
| 2797 | => cc_node: { | |
| 2798 | // .{ .foo = .{} } | |
| 2799 | _ = try c.addToken(.period, "."); | |
| 2800 | const outer_lbrace = try c.addToken(.l_brace, "{"); | |
| 2801 | _ = try c.addToken(.period, "."); | |
| 2802 | _ = try c.addToken(.identifier, @tagName(some)); | |
| 2803 | _ = try c.addToken(.equal, "="); | |
| 2804 | _ = try c.addToken(.period, "."); | |
| 2805 | const inner_lbrace = try c.addToken(.l_brace, "{"); | |
| 2806 | _ = try c.addToken(.r_brace, "}"); | |
| 2807 | _ = try c.addToken(.r_brace, "}"); | |
| 2808 | const inner_node = try c.addNode(.{ | |
| 2809 | .tag = .struct_init_dot_two, | |
| 2810 | .main_token = inner_lbrace, | |
| 2811 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2812 | .none, | |
| 2813 | .none, | |
| 2814 | } }, | |
| 2815 | }); | |
| 2816 | break :cc_node try c.addNode(.{ | |
| 2817 | .tag = .struct_init_dot_two, | |
| 2818 | .main_token = outer_lbrace, | |
| 2819 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2820 | inner_node.toOptional(), | |
| 2821 | .none, | |
| 2822 | } }, | |
| 2823 | }); | |
| 2824 | }, | |
| 2825 | }; | |
| 2826 | _ = try c.addToken(.r_paren, ")"); | |
| 2827 | break :blk cc_node; | |
| 2828 | } else null; | |
| 2829 | ||
| 2830 | const return_type_expr = try renderNode(c, payload.return_type); | |
| 2831 | ||
| 2832 | const fn_proto = try blk: { | |
| 2833 | if (align_expr == null and section_expr == null and callconv_expr == null) { | |
| 2834 | if (params.items.len < 2) | |
| 2835 | break :blk c.addNode(.{ | |
| 2836 | .tag = .fn_proto_simple, | |
| 2837 | .main_token = fn_token, | |
| 2838 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2839 | if (params.items.len == 0) .none else params.items[0].toOptional(), | |
| 2840 | return_type_expr.toOptional(), | |
| 2841 | } }, | |
| 2842 | }) | |
| 2843 | else | |
| 2844 | break :blk c.addNode(.{ | |
| 2845 | .tag = .fn_proto_multi, | |
| 2846 | .main_token = fn_token, | |
| 2847 | .data = .{ .extra_and_opt_node = .{ | |
| 2848 | try c.addExtra(NodeSubRange{ | |
| 2849 | .start = span.start, | |
| 2850 | .end = span.end, | |
| 2851 | }), | |
| 2852 | return_type_expr.toOptional(), | |
| 2853 | } }, | |
| 2854 | }); | |
| 2855 | } | |
| 2856 | if (params.items.len < 2) | |
| 2857 | break :blk c.addNode(.{ | |
| 2858 | .tag = .fn_proto_one, | |
| 2859 | .main_token = fn_token, | |
| 2860 | .data = .{ | |
| 2861 | .extra_and_opt_node = .{ | |
| 2862 | try c.addExtra(std.zig.Ast.Node.FnProtoOne{ | |
| 2863 | .param = if (params.items.len == 0) .none else params.items[0].toOptional(), | |
| 2864 | .align_expr = .fromOptional(align_expr), | |
| 2865 | .addrspace_expr = .none, // TODO | |
| 2866 | .section_expr = .fromOptional(section_expr), | |
| 2867 | .callconv_expr = .fromOptional(callconv_expr), | |
| 2868 | }), | |
| 2869 | return_type_expr.toOptional(), | |
| 2870 | }, | |
| 2871 | }, | |
| 2872 | }) | |
| 2873 | else | |
| 2874 | break :blk c.addNode(.{ | |
| 2875 | .tag = .fn_proto, | |
| 2876 | .main_token = fn_token, | |
| 2877 | .data = .{ | |
| 2878 | .extra_and_opt_node = .{ | |
| 2879 | try c.addExtra(std.zig.Ast.Node.FnProto{ | |
| 2880 | .params_start = span.start, | |
| 2881 | .params_end = span.end, | |
| 2882 | .align_expr = .fromOptional(align_expr), | |
| 2883 | .addrspace_expr = .none, // TODO | |
| 2884 | .section_expr = .fromOptional(section_expr), | |
| 2885 | .callconv_expr = .fromOptional(callconv_expr), | |
| 2886 | }), | |
| 2887 | return_type_expr.toOptional(), | |
| 2888 | }, | |
| 2889 | }, | |
| 2890 | }); | |
| 2891 | }; | |
| 2892 | ||
| 2893 | const payload_body = payload.body orelse { | |
| 2894 | if (payload.is_extern) { | |
| 2895 | _ = try c.addToken(.semicolon, ";"); | |
| 2896 | } | |
| 2897 | return fn_proto; | |
| 2898 | }; | |
| 2899 | const body = try renderNode(c, payload_body); | |
| 2900 | return c.addNode(.{ | |
| 2901 | .tag = .fn_decl, | |
| 2902 | .main_token = fn_token, | |
| 2903 | .data = .{ .node_and_node = .{ | |
| 2904 | fn_proto, | |
| 2905 | body, | |
| 2906 | } }, | |
| 2907 | }); | |
| 2908 | } | |
| 2909 | ||
| 2910 | fn renderMacroFunc(c: *Context, node: Node) !NodeIndex { | |
| 2911 | const payload = node.castTag(.pub_inline_fn).?.data; | |
| 2912 | _ = try c.addToken(.keyword_pub, "pub"); | |
| 2913 | _ = try c.addToken(.keyword_inline, "inline"); | |
| 2914 | const fn_token = try c.addToken(.keyword_fn, "fn"); | |
| 2915 | _ = try c.addIdentifier(payload.name); | |
| 2916 | ||
| 2917 | const params = try renderParams(c, payload.params, false); | |
| 2918 | defer params.deinit(); | |
| 2919 | ||
| 2920 | const return_type_expr = try renderNodeGrouped(c, payload.return_type); | |
| 2921 | ||
| 2922 | const fn_proto = blk: { | |
| 2923 | if (params.items.len < 2) { | |
| 2924 | break :blk try c.addNode(.{ | |
| 2925 | .tag = .fn_proto_simple, | |
| 2926 | .main_token = fn_token, | |
| 2927 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2928 | if (params.items.len == 0) .none else params.items[0].toOptional(), | |
| 2929 | return_type_expr.toOptional(), | |
| 2930 | } }, | |
| 2931 | }); | |
| 2932 | } else { | |
| 2933 | const span: NodeSubRange = try c.listToSpan(params.items); | |
| 2934 | break :blk try c.addNode(.{ | |
| 2935 | .tag = .fn_proto_multi, | |
| 2936 | .main_token = fn_token, | |
| 2937 | .data = .{ .extra_and_opt_node = .{ | |
| 2938 | try c.addExtra(std.zig.Ast.Node.SubRange{ | |
| 2939 | .start = span.start, | |
| 2940 | .end = span.end, | |
| 2941 | }), | |
| 2942 | return_type_expr.toOptional(), | |
| 2943 | } }, | |
| 2944 | }); | |
| 2945 | } | |
| 2946 | }; | |
| 2947 | return c.addNode(.{ | |
| 2948 | .tag = .fn_decl, | |
| 2949 | .main_token = fn_token, | |
| 2950 | .data = .{ .node_and_node = .{ | |
| 2951 | fn_proto, | |
| 2952 | try renderNode(c, payload.body), | |
| 2953 | } }, | |
| 2954 | }); | |
| 2955 | } | |
| 2956 | ||
| 2957 | fn renderParams(c: *Context, params: []Payload.Param, is_var_args: bool) !std.array_list.Managed(NodeIndex) { | |
| 2958 | _ = try c.addToken(.l_paren, "("); | |
| 2959 | var rendered = try std.array_list.Managed(NodeIndex).initCapacity(c.gpa, params.len); | |
| 2960 | errdefer rendered.deinit(); | |
| 2961 | ||
| 2962 | for (params, 0..) |param, i| { | |
| 2963 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 2964 | if (param.is_noalias) _ = try c.addToken(.keyword_noalias, "noalias"); | |
| 2965 | if (param.name) |some| { | |
| 2966 | _ = try c.addIdentifier(some); | |
| 2967 | _ = try c.addToken(.colon, ":"); | |
| 2968 | } | |
| 2969 | if (param.type.tag() == .@"anytype") { | |
| 2970 | _ = try c.addToken(.keyword_anytype, "anytype"); | |
| 2971 | continue; | |
| 2972 | } | |
| 2973 | rendered.appendAssumeCapacity(try renderNode(c, param.type)); | |
| 2974 | } | |
| 2975 | if (is_var_args) { | |
| 2976 | if (params.len != 0) _ = try c.addToken(.comma, ","); | |
| 2977 | _ = try c.addToken(.ellipsis3, "..."); | |
| 2978 | } | |
| 2979 | _ = try c.addToken(.r_paren, ")"); | |
| 2980 | ||
| 2981 | return rendered; | |
| 2982 | } |
lib/compiler/resinator/main.zig+37-92| ... | ... | @@ -120,7 +120,20 @@ pub fn main() !void { |
| 120 | 120 | defer aro_arena_state.deinit(); |
| 121 | 121 | const aro_arena = aro_arena_state.allocator(); |
| 122 | 122 | |
| 123 | var comp = aro.Compilation.init(aro_arena, std.fs.cwd()); | |
| 123 | var stderr_buf: [512]u8 = undefined; | |
| 124 | var stderr_writer = stderr.writer(&stderr_buf); | |
| 125 | var diagnostics: aro.Diagnostics = switch (zig_integration) { | |
| 126 | false => .{ .output = .{ .to_writer = .{ | |
| 127 | .writer = &stderr_writer.interface, | |
| 128 | .color = stderr_config, | |
| 129 | } } }, | |
| 130 | true => .{ .output = .{ .to_list = .{ | |
| 131 | .arena = .init(allocator), | |
| 132 | } } }, | |
| 133 | }; | |
| 134 | defer diagnostics.deinit(); | |
| 135 | ||
| 136 | var comp = aro.Compilation.init(aro_arena, aro_arena, &diagnostics, std.fs.cwd()); | |
| 124 | 137 | defer comp.deinit(); |
| 125 | 138 | |
| 126 | 139 | var argv: std.ArrayList([]const u8) = .empty; |
| ... | ... | @@ -145,18 +158,22 @@ pub fn main() !void { |
| 145 | 158 | |
| 146 | 159 | preprocess.preprocess(&comp, &preprocessed_buf.writer, argv.items, maybe_dependencies) catch |err| switch (err) { |
| 147 | 160 | error.GeneratedSourceError => { |
| 148 | try error_handler.emitAroDiagnostics(allocator, "failed during preprocessor setup (this is always a bug):", &comp); | |
| 161 | try error_handler.emitAroDiagnostics(allocator, "failed during preprocessor setup (this is always a bug)", &comp); | |
| 149 | 162 | std.process.exit(1); |
| 150 | 163 | }, |
| 151 | 164 | // ArgError can occur if e.g. the .rc file is not found |
| 152 | 165 | error.ArgError, error.PreprocessError => { |
| 153 | try error_handler.emitAroDiagnostics(allocator, "failed during preprocessing:", &comp); | |
| 166 | try error_handler.emitAroDiagnostics(allocator, "failed during preprocessing", &comp); | |
| 154 | 167 | std.process.exit(1); |
| 155 | 168 | }, |
| 156 | error.StreamTooLong => { | |
| 169 | error.FileTooBig => { | |
| 157 | 170 | try error_handler.emitMessage(allocator, .err, "failed during preprocessing: maximum file size exceeded", .{}); |
| 158 | 171 | std.process.exit(1); |
| 159 | 172 | }, |
| 173 | error.WriteFailed => { | |
| 174 | try error_handler.emitMessage(allocator, .err, "failed during preprocessing: error writing the preprocessed output", .{}); | |
| 175 | std.process.exit(1); | |
| 176 | }, | |
| 160 | 177 | error.OutOfMemory => |e| return e, |
| 161 | 178 | }; |
| 162 | 179 | |
| ... | ... | @@ -660,11 +677,10 @@ const ErrorHandler = union(enum) { |
| 660 | 677 | try server.serveErrorBundle(error_bundle); |
| 661 | 678 | }, |
| 662 | 679 | .tty => { |
| 663 | // extra newline to separate this line from the aro errors | |
| 680 | // aro errors have already been emitted | |
| 664 | 681 | const stderr = std.debug.lockStderrWriter(&.{}); |
| 665 | 682 | defer std.debug.unlockStderrWriter(); |
| 666 | try renderErrorMessage(stderr, self.tty, .err, "{s}\n", .{fail_msg}); | |
| 667 | aro.Diagnostics.render(comp, self.tty); | |
| 683 | try renderErrorMessage(stderr, self.tty, .err, "{s}", .{fail_msg}); | |
| 668 | 684 | }, |
| 669 | 685 | } |
| 670 | 686 | } |
| ... | ... | @@ -883,12 +899,10 @@ fn aroDiagnosticsToErrorBundle( |
| 883 | 899 | .msg = try bundle.addString(fail_msg), |
| 884 | 900 | }); |
| 885 | 901 | |
| 886 | var msg_writer = MsgWriter.init(gpa); | |
| 887 | defer msg_writer.deinit(); | |
| 888 | 902 | var cur_err: ?ErrorBundle.ErrorMessage = null; |
| 889 | 903 | var cur_notes: std.ArrayList(ErrorBundle.ErrorMessage) = .empty; |
| 890 | 904 | defer cur_notes.deinit(gpa); |
| 891 | for (comp.diagnostics.list.items) |msg| { | |
| 905 | for (comp.diagnostics.output.to_list.messages.items) |msg| { | |
| 892 | 906 | switch (msg.kind) { |
| 893 | 907 | // Clear the current error so that notes don't bleed into unassociated errors |
| 894 | 908 | .off, .warning => { |
| ... | ... | @@ -897,28 +911,19 @@ fn aroDiagnosticsToErrorBundle( |
| 897 | 911 | }, |
| 898 | 912 | .note => if (cur_err == null) continue, |
| 899 | 913 | .@"fatal error", .@"error" => {}, |
| 900 | .default => unreachable, | |
| 901 | 914 | } |
| 902 | msg_writer.resetRetainingCapacity(); | |
| 903 | aro.Diagnostics.renderMessage(comp, &msg_writer, msg); | |
| 904 | 915 | |
| 905 | 916 | const src_loc = src_loc: { |
| 906 | if (msg_writer.path) |src_path| { | |
| 907 | var src_loc: ErrorBundle.SourceLocation = .{ | |
| 908 | .src_path = try bundle.addString(src_path), | |
| 909 | .line = msg_writer.line - 1, // 1-based -> 0-based | |
| 910 | .column = msg_writer.col - 1, // 1-based -> 0-based | |
| 911 | .span_start = 0, | |
| 912 | .span_main = 0, | |
| 913 | .span_end = 0, | |
| 914 | }; | |
| 915 | if (msg_writer.source_line) |source_line| { | |
| 916 | src_loc.span_start = msg_writer.span_main; | |
| 917 | src_loc.span_main = msg_writer.span_main; | |
| 918 | src_loc.span_end = msg_writer.span_main; | |
| 919 | src_loc.source_line = try bundle.addString(source_line); | |
| 920 | } | |
| 921 | break :src_loc try bundle.addSourceLocation(src_loc); | |
| 917 | if (msg.location) |location| { | |
| 918 | break :src_loc try bundle.addSourceLocation(.{ | |
| 919 | .src_path = try bundle.addString(location.path), | |
| 920 | .line = location.line_no - 1, // 1-based -> 0-based | |
| 921 | .column = location.col - 1, // 1-based -> 0-based | |
| 922 | .span_start = location.width, | |
| 923 | .span_main = location.width, | |
| 924 | .span_end = location.width, | |
| 925 | .source_line = try bundle.addString(location.line), | |
| 926 | }); | |
| 922 | 927 | } |
| 923 | 928 | break :src_loc ErrorBundle.SourceLocationIndex.none; |
| 924 | 929 | }; |
| ... | ... | @@ -929,7 +934,7 @@ fn aroDiagnosticsToErrorBundle( |
| 929 | 934 | try flushErrorMessageIntoBundle(&bundle, err, cur_notes.items); |
| 930 | 935 | } |
| 931 | 936 | cur_err = .{ |
| 932 | .msg = try bundle.addString(msg_writer.buf.items), | |
| 937 | .msg = try bundle.addString(msg.text), | |
| 933 | 938 | .src_loc = src_loc, |
| 934 | 939 | }; |
| 935 | 940 | cur_notes.clearRetainingCapacity(); |
| ... | ... | @@ -937,11 +942,11 @@ fn aroDiagnosticsToErrorBundle( |
| 937 | 942 | .note => { |
| 938 | 943 | cur_err.?.notes_len += 1; |
| 939 | 944 | try cur_notes.append(gpa, .{ |
| 940 | .msg = try bundle.addString(msg_writer.buf.items), | |
| 945 | .msg = try bundle.addString(msg.text), | |
| 941 | 946 | .src_loc = src_loc, |
| 942 | 947 | }); |
| 943 | 948 | }, |
| 944 | .off, .warning, .default => unreachable, | |
| 949 | .off, .warning => unreachable, | |
| 945 | 950 | } |
| 946 | 951 | } |
| 947 | 952 | if (cur_err) |err| { |
| ... | ... | @@ -950,63 +955,3 @@ fn aroDiagnosticsToErrorBundle( |
| 950 | 955 | |
| 951 | 956 | return try bundle.toOwnedBundle(""); |
| 952 | 957 | } |
| 953 | ||
| 954 | // Similar to aro.Diagnostics.MsgWriter but: | |
| 955 | // - Writers to an ArrayList | |
| 956 | // - Only prints the message itself (no location, source line, error: prefix, etc) | |
| 957 | // - Keeps track of source path/line/col instead | |
| 958 | const MsgWriter = struct { | |
| 959 | buf: std.array_list.Managed(u8), | |
| 960 | path: ?[]const u8 = null, | |
| 961 | // 1-indexed | |
| 962 | line: u32 = undefined, | |
| 963 | col: u32 = undefined, | |
| 964 | source_line: ?[]const u8 = null, | |
| 965 | span_main: u32 = undefined, | |
| 966 | ||
| 967 | fn init(allocator: std.mem.Allocator) MsgWriter { | |
| 968 | return .{ | |
| 969 | .buf = std.array_list.Managed(u8).init(allocator), | |
| 970 | }; | |
| 971 | } | |
| 972 | ||
| 973 | fn deinit(m: *MsgWriter) void { | |
| 974 | m.buf.deinit(); | |
| 975 | } | |
| 976 | ||
| 977 | fn resetRetainingCapacity(m: *MsgWriter) void { | |
| 978 | m.buf.clearRetainingCapacity(); | |
| 979 | m.path = null; | |
| 980 | m.source_line = null; | |
| 981 | } | |
| 982 | ||
| 983 | pub fn print(m: *MsgWriter, comptime fmt: []const u8, args: anytype) void { | |
| 984 | m.buf.print(fmt, args) catch {}; | |
| 985 | } | |
| 986 | ||
| 987 | pub fn write(m: *MsgWriter, msg: []const u8) void { | |
| 988 | m.buf.appendSlice(msg) catch {}; | |
| 989 | } | |
| 990 | ||
| 991 | pub fn setColor(m: *MsgWriter, color: std.Io.tty.Color) void { | |
| 992 | _ = m; | |
| 993 | _ = color; | |
| 994 | } | |
| 995 | ||
| 996 | pub fn location(m: *MsgWriter, path: []const u8, line: u32, col: u32) void { | |
| 997 | m.path = path; | |
| 998 | m.line = line; | |
| 999 | m.col = col; | |
| 1000 | } | |
| 1001 | ||
| 1002 | pub fn start(m: *MsgWriter, kind: aro.Diagnostics.Kind) void { | |
| 1003 | _ = m; | |
| 1004 | _ = kind; | |
| 1005 | } | |
| 1006 | ||
| 1007 | pub fn end(m: *MsgWriter, maybe_line: ?[]const u8, col: u32, end_with_splice: bool) void { | |
| 1008 | _ = end_with_splice; | |
| 1009 | m.source_line = maybe_line; | |
| 1010 | m.span_main = col; | |
| 1011 | } | |
| 1012 | }; |
lib/compiler/resinator/preprocess.zig+15-20| ... | ... | @@ -5,7 +5,7 @@ const cli = @import("cli.zig"); |
| 5 | 5 | const Dependencies = @import("compile.zig").Dependencies; |
| 6 | 6 | const aro = @import("aro"); |
| 7 | 7 | |
| 8 | const PreprocessError = error{ ArgError, GeneratedSourceError, PreprocessError, StreamTooLong, OutOfMemory }; | |
| 8 | const PreprocessError = error{ ArgError, GeneratedSourceError, PreprocessError, FileTooBig, OutOfMemory, WriteFailed }; | |
| 9 | 9 | |
| 10 | 10 | pub fn preprocess( |
| 11 | 11 | comp: *aro.Compilation, |
| ... | ... | @@ -16,18 +16,18 @@ pub fn preprocess( |
| 16 | 16 | ) PreprocessError!void { |
| 17 | 17 | try comp.addDefaultPragmaHandlers(); |
| 18 | 18 | |
| 19 | var driver: aro.Driver = .{ .comp = comp, .aro_name = "arocc" }; | |
| 19 | var driver: aro.Driver = .{ .comp = comp, .diagnostics = comp.diagnostics, .aro_name = "arocc" }; | |
| 20 | 20 | defer driver.deinit(); |
| 21 | 21 | |
| 22 | var macro_buf: std.Io.Writer.Allocating = .init(comp.gpa); | |
| 23 | defer macro_buf.deinit(); | |
| 22 | var macro_buf: std.ArrayListUnmanaged(u8) = .empty; | |
| 23 | defer macro_buf.deinit(comp.gpa); | |
| 24 | 24 | |
| 25 | var trash: [64]u8 = undefined; | |
| 26 | var discarding: std.Io.Writer.Discarding = .init(&trash); | |
| 27 | _ = driver.parseArgs(&discarding.writer, &macro_buf.writer, argv) catch |err| switch (err) { | |
| 25 | var discard_buffer: [64]u8 = undefined; | |
| 26 | var discarding: std.Io.Writer.Discarding = .init(&discard_buffer); | |
| 27 | _ = driver.parseArgs(&discarding.writer, &macro_buf, argv) catch |err| switch (err) { | |
| 28 | 28 | error.FatalError => return error.ArgError, |
| 29 | 29 | error.OutOfMemory => |e| return e, |
| 30 | error.WriteFailed => return error.OutOfMemory, | |
| 30 | error.WriteFailed => unreachable, | |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | 33 | if (hasAnyErrors(comp)) return error.ArgError; |
| ... | ... | @@ -37,7 +37,7 @@ pub fn preprocess( |
| 37 | 37 | error.FatalError => return error.GeneratedSourceError, |
| 38 | 38 | else => |e| return e, |
| 39 | 39 | }; |
| 40 | const user_macros = comp.addSourceFromBuffer("<command line>", macro_buf.written()) catch |err| switch (err) { | |
| 40 | const user_macros = comp.addSourceFromBuffer("<command line>", macro_buf.items) catch |err| switch (err) { | |
| 41 | 41 | error.FatalError => return error.GeneratedSourceError, |
| 42 | 42 | else => |e| return e, |
| 43 | 43 | }; |
| ... | ... | @@ -46,7 +46,10 @@ pub fn preprocess( |
| 46 | 46 | if (hasAnyErrors(comp)) return error.GeneratedSourceError; |
| 47 | 47 | |
| 48 | 48 | comp.generated_buf.items.len = 0; |
| 49 | var pp = try aro.Preprocessor.initDefault(comp); | |
| 49 | var pp = aro.Preprocessor.initDefault(comp) catch |err| switch (err) { | |
| 50 | error.FatalError => return error.GeneratedSourceError, | |
| 51 | error.OutOfMemory => |e| return e, | |
| 52 | }; | |
| 50 | 53 | defer pp.deinit(); |
| 51 | 54 | |
| 52 | 55 | if (comp.langopts.ms_extensions) { |
| ... | ... | @@ -79,16 +82,7 @@ pub fn preprocess( |
| 79 | 82 | } |
| 80 | 83 | |
| 81 | 84 | fn hasAnyErrors(comp: *aro.Compilation) bool { |
| 82 | // In theory we could just check Diagnostics.errors != 0, but that only | |
| 83 | // gets set during rendering of the error messages, see: | |
| 84 | // https://github.com/Vexu/arocc/issues/603 | |
| 85 | for (comp.diagnostics.list.items) |msg| { | |
| 86 | switch (msg.kind) { | |
| 87 | .@"fatal error", .@"error" => return true, | |
| 88 | else => {}, | |
| 89 | } | |
| 90 | } | |
| 91 | return false; | |
| 85 | return comp.diagnostics.errors != 0; | |
| 92 | 86 | } |
| 93 | 87 | |
| 94 | 88 | /// `arena` is used for temporary -D argument strings and the INCLUDE environment variable. |
| ... | ... | @@ -98,6 +92,7 @@ pub fn appendAroArgs(arena: Allocator, argv: *std.ArrayList([]const u8), options |
| 98 | 92 | "-E", |
| 99 | 93 | "--comments", |
| 100 | 94 | "-fuse-line-directives", |
| 95 | "-fgnuc-version=4.2.1", | |
| 101 | 96 | "--target=x86_64-windows-msvc", |
| 102 | 97 | "--emulate=msvc", |
| 103 | 98 | "-nostdinc", |
lib/compiler/translate-c/MacroTranslator.zig created+1314| ... | ... | @@ -0,0 +1,1314 @@ |
| 1 | const std = @import("std"); | |
| 2 | const math = std.math; | |
| 3 | const mem = std.mem; | |
| 4 | const assert = std.debug.assert; | |
| 5 | ||
| 6 | const aro = @import("aro"); | |
| 7 | const CToken = aro.Tokenizer.Token; | |
| 8 | ||
| 9 | const ast = @import("ast.zig"); | |
| 10 | const builtins = @import("builtins.zig"); | |
| 11 | const ZigNode = ast.Node; | |
| 12 | const ZigTag = ZigNode.Tag; | |
| 13 | const Scope = @import("Scope.zig"); | |
| 14 | const Translator = @import("Translator.zig"); | |
| 15 | ||
| 16 | const Error = Translator.Error; | |
| 17 | pub const ParseError = Error || error{ParseError}; | |
| 18 | ||
| 19 | const MacroTranslator = @This(); | |
| 20 | ||
| 21 | t: *Translator, | |
| 22 | macro: aro.Preprocessor.Macro, | |
| 23 | name: []const u8, | |
| 24 | ||
| 25 | tokens: []const CToken, | |
| 26 | source: []const u8, | |
| 27 | i: usize = 0, | |
| 28 | /// If an object macro references a global var it needs to be converted into | |
| 29 | /// an inline function. | |
| 30 | refs_var_decl: bool = false, | |
| 31 | ||
| 32 | fn peek(mt: *MacroTranslator) CToken.Id { | |
| 33 | if (mt.i >= mt.tokens.len) return .eof; | |
| 34 | return mt.tokens[mt.i].id; | |
| 35 | } | |
| 36 | ||
| 37 | fn eat(mt: *MacroTranslator, expected_id: CToken.Id) bool { | |
| 38 | if (mt.peek() == expected_id) { | |
| 39 | mt.i += 1; | |
| 40 | return true; | |
| 41 | } | |
| 42 | return false; | |
| 43 | } | |
| 44 | ||
| 45 | fn expect(mt: *MacroTranslator, expected_id: CToken.Id) ParseError!void { | |
| 46 | const next_id = mt.peek(); | |
| 47 | if (next_id != expected_id and !(expected_id == .identifier and next_id == .extended_identifier)) { | |
| 48 | try mt.fail( | |
| 49 | "unable to translate C expr: expected '{s}' instead got '{s}'", | |
| 50 | .{ expected_id.symbol(), next_id.symbol() }, | |
| 51 | ); | |
| 52 | return error.ParseError; | |
| 53 | } | |
| 54 | mt.i += 1; | |
| 55 | } | |
| 56 | ||
| 57 | fn fail(mt: *MacroTranslator, comptime fmt: []const u8, args: anytype) !void { | |
| 58 | return mt.t.failDeclExtra(&mt.t.global_scope.base, mt.macro.loc, mt.name, fmt, args); | |
| 59 | } | |
| 60 | ||
| 61 | fn tokSlice(mt: *const MacroTranslator) []const u8 { | |
| 62 | const tok = mt.tokens[mt.i]; | |
| 63 | return mt.source[tok.start..tok.end]; | |
| 64 | } | |
| 65 | ||
| 66 | pub fn transFnMacro(mt: *MacroTranslator) ParseError!void { | |
| 67 | var block_scope = try Scope.Block.init(mt.t, &mt.t.global_scope.base, false); | |
| 68 | defer block_scope.deinit(); | |
| 69 | const scope = &block_scope.base; | |
| 70 | ||
| 71 | const fn_params = try mt.t.arena.alloc(ast.Payload.Param, mt.macro.params.len); | |
| 72 | for (fn_params, mt.macro.params) |*param, param_name| { | |
| 73 | const mangled_name = try block_scope.makeMangledName(param_name); | |
| 74 | param.* = .{ | |
| 75 | .is_noalias = false, | |
| 76 | .name = mangled_name, | |
| 77 | .type = ZigTag.@"anytype".init(), | |
| 78 | }; | |
| 79 | try block_scope.discardVariable(mangled_name); | |
| 80 | } | |
| 81 | ||
| 82 | const expr = try mt.parseCExpr(scope); | |
| 83 | const last = mt.peek(); | |
| 84 | if (last != .eof) | |
| 85 | return mt.fail("unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); | |
| 86 | ||
| 87 | const typeof_arg = if (expr.castTag(.block)) |some| blk: { | |
| 88 | const stmts = some.data.stmts; | |
| 89 | const blk_last = stmts[stmts.len - 1]; | |
| 90 | const br = blk_last.castTag(.break_val).?; | |
| 91 | break :blk br.data.val; | |
| 92 | } else expr; | |
| 93 | ||
| 94 | const return_type = ret: { | |
| 95 | if (typeof_arg.castTag(.helper_call)) |some| { | |
| 96 | if (std.mem.eql(u8, some.data.name, "cast")) { | |
| 97 | break :ret some.data.args[0]; | |
| 98 | } | |
| 99 | } | |
| 100 | if (typeof_arg.castTag(.std_mem_zeroinit)) |some| break :ret some.data.lhs; | |
| 101 | if (typeof_arg.castTag(.std_mem_zeroes)) |some| break :ret some.data; | |
| 102 | break :ret try ZigTag.typeof.create(mt.t.arena, typeof_arg); | |
| 103 | }; | |
| 104 | ||
| 105 | const return_expr = try ZigTag.@"return".create(mt.t.arena, expr); | |
| 106 | try block_scope.statements.append(mt.t.gpa, return_expr); | |
| 107 | ||
| 108 | const fn_decl = try ZigTag.pub_inline_fn.create(mt.t.arena, .{ | |
| 109 | .name = mt.name, | |
| 110 | .params = fn_params, | |
| 111 | .return_type = return_type, | |
| 112 | .body = try block_scope.complete(), | |
| 113 | }); | |
| 114 | try mt.t.addTopLevelDecl(mt.name, fn_decl); | |
| 115 | } | |
| 116 | ||
| 117 | pub fn transMacro(mt: *MacroTranslator) ParseError!void { | |
| 118 | const scope = &mt.t.global_scope.base; | |
| 119 | ||
| 120 | // Check if the macro only uses other blank macros. | |
| 121 | while (true) { | |
| 122 | switch (mt.peek()) { | |
| 123 | .identifier, .extended_identifier => { | |
| 124 | if (mt.t.global_scope.blank_macros.contains(mt.tokSlice())) { | |
| 125 | mt.i += 1; | |
| 126 | continue; | |
| 127 | } | |
| 128 | }, | |
| 129 | .eof, .nl => { | |
| 130 | try mt.t.global_scope.blank_macros.put(mt.t.gpa, mt.name, {}); | |
| 131 | const init_node = try ZigTag.string_literal.create(mt.t.arena, "\"\""); | |
| 132 | const var_decl = try ZigTag.pub_var_simple.create(mt.t.arena, .{ .name = mt.name, .init = init_node }); | |
| 133 | try mt.t.addTopLevelDecl(mt.name, var_decl); | |
| 134 | return; | |
| 135 | }, | |
| 136 | else => {}, | |
| 137 | } | |
| 138 | break; | |
| 139 | } | |
| 140 | ||
| 141 | const init_node = try mt.parseCExpr(scope); | |
| 142 | const last = mt.peek(); | |
| 143 | if (last != .eof) | |
| 144 | return mt.fail("unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); | |
| 145 | ||
| 146 | const node = node: { | |
| 147 | const var_decl = try ZigTag.pub_var_simple.create(mt.t.arena, .{ .name = mt.name, .init = init_node }); | |
| 148 | ||
| 149 | if (mt.t.getFnProto(var_decl)) |proto_node| { | |
| 150 | // If a macro aliases a global variable which is a function pointer, we conclude that | |
| 151 | // the macro is intended to represent a function that assumes the function pointer | |
| 152 | // variable is non-null and calls it. | |
| 153 | break :node try mt.createMacroFn(mt.name, var_decl, proto_node); | |
| 154 | } else if (mt.refs_var_decl) { | |
| 155 | const return_type = try ZigTag.typeof.create(mt.t.arena, init_node); | |
| 156 | const return_expr = try ZigTag.@"return".create(mt.t.arena, init_node); | |
| 157 | const block = try ZigTag.block_single.create(mt.t.arena, return_expr); | |
| 158 | ||
| 159 | const loc_str = try mt.t.locStr(mt.macro.loc); | |
| 160 | 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 }); | |
| 161 | try scope.appendNode(try ZigTag.warning.create(mt.t.arena, value)); | |
| 162 | ||
| 163 | break :node try ZigTag.pub_inline_fn.create(mt.t.arena, .{ | |
| 164 | .name = mt.name, | |
| 165 | .params = &.{}, | |
| 166 | .return_type = return_type, | |
| 167 | .body = block, | |
| 168 | }); | |
| 169 | } | |
| 170 | ||
| 171 | break :node var_decl; | |
| 172 | }; | |
| 173 | ||
| 174 | try mt.t.addTopLevelDecl(mt.name, node); | |
| 175 | } | |
| 176 | ||
| 177 | fn createMacroFn(mt: *MacroTranslator, name: []const u8, ref: ZigNode, proto_alias: *ast.Payload.Func) !ZigNode { | |
| 178 | const gpa = mt.t.gpa; | |
| 179 | const arena = mt.t.arena; | |
| 180 | var fn_params: std.ArrayList(ast.Payload.Param) = .empty; | |
| 181 | defer fn_params.deinit(gpa); | |
| 182 | ||
| 183 | var block_scope = try Scope.Block.init(mt.t, &mt.t.global_scope.base, false); | |
| 184 | defer block_scope.deinit(); | |
| 185 | ||
| 186 | for (proto_alias.data.params) |param| { | |
| 187 | const param_name = try block_scope.makeMangledName(param.name orelse "arg"); | |
| 188 | ||
| 189 | try fn_params.append(gpa, .{ | |
| 190 | .name = param_name, | |
| 191 | .type = param.type, | |
| 192 | .is_noalias = param.is_noalias, | |
| 193 | }); | |
| 194 | } | |
| 195 | ||
| 196 | const init = if (ref.castTag(.var_decl)) |v| | |
| 197 | v.data.init.? | |
| 198 | else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| | |
| 199 | v.data.init | |
| 200 | else | |
| 201 | unreachable; | |
| 202 | ||
| 203 | const unwrap_expr = try ZigTag.unwrap.create(arena, init); | |
| 204 | const args = try arena.alloc(ZigNode, fn_params.items.len); | |
| 205 | for (fn_params.items, 0..) |param, i| { | |
| 206 | args[i] = try ZigTag.identifier.create(arena, param.name.?); | |
| 207 | } | |
| 208 | const call_expr = try ZigTag.call.create(arena, .{ | |
| 209 | .lhs = unwrap_expr, | |
| 210 | .args = args, | |
| 211 | }); | |
| 212 | const return_expr = try ZigTag.@"return".create(arena, call_expr); | |
| 213 | const block = try ZigTag.block_single.create(arena, return_expr); | |
| 214 | ||
| 215 | return ZigTag.pub_inline_fn.create(arena, .{ | |
| 216 | .name = name, | |
| 217 | .params = try arena.dupe(ast.Payload.Param, fn_params.items), | |
| 218 | .return_type = proto_alias.data.return_type, | |
| 219 | .body = block, | |
| 220 | }); | |
| 221 | } | |
| 222 | ||
| 223 | fn parseCExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 224 | const arena = mt.t.arena; | |
| 225 | // TODO parseCAssignExpr here | |
| 226 | var block_scope = try Scope.Block.init(mt.t, scope, true); | |
| 227 | defer block_scope.deinit(); | |
| 228 | ||
| 229 | const node = try mt.parseCCondExpr(&block_scope.base); | |
| 230 | if (!mt.eat(.comma)) return node; | |
| 231 | ||
| 232 | var last = node; | |
| 233 | while (true) { | |
| 234 | // suppress result | |
| 235 | const ignore = try ZigTag.discard.create(arena, .{ .should_skip = false, .value = last }); | |
| 236 | try block_scope.statements.append(mt.t.gpa, ignore); | |
| 237 | ||
| 238 | last = try mt.parseCCondExpr(&block_scope.base); | |
| 239 | if (!mt.eat(.comma)) break; | |
| 240 | } | |
| 241 | ||
| 242 | const break_node = try ZigTag.break_val.create(arena, .{ | |
| 243 | .label = block_scope.label, | |
| 244 | .val = last, | |
| 245 | }); | |
| 246 | try block_scope.statements.append(mt.t.gpa, break_node); | |
| 247 | return try block_scope.complete(); | |
| 248 | } | |
| 249 | ||
| 250 | fn parseCNumLit(mt: *MacroTranslator) ParseError!ZigNode { | |
| 251 | const arena = mt.t.arena; | |
| 252 | const lit_bytes = mt.tokSlice(); | |
| 253 | mt.i += 1; | |
| 254 | ||
| 255 | var bytes = try std.ArrayListUnmanaged(u8).initCapacity(arena, lit_bytes.len + 3); | |
| 256 | ||
| 257 | const prefix = aro.Tree.Token.NumberPrefix.fromString(lit_bytes); | |
| 258 | switch (prefix) { | |
| 259 | .binary => bytes.appendSliceAssumeCapacity("0b"), | |
| 260 | .octal => bytes.appendSliceAssumeCapacity("0o"), | |
| 261 | .hex => bytes.appendSliceAssumeCapacity("0x"), | |
| 262 | .decimal => {}, | |
| 263 | } | |
| 264 | ||
| 265 | const after_prefix = lit_bytes[prefix.stringLen()..]; | |
| 266 | const after_int = for (after_prefix, 0..) |c, i| switch (c) { | |
| 267 | '.' => { | |
| 268 | if (i == 0) { | |
| 269 | bytes.appendAssumeCapacity('0'); | |
| 270 | } | |
| 271 | break after_prefix[i..]; | |
| 272 | }, | |
| 273 | 'e', 'E' => { | |
| 274 | if (prefix != .hex) break after_prefix[i..]; | |
| 275 | bytes.appendAssumeCapacity(c); | |
| 276 | }, | |
| 277 | 'p', 'P' => break after_prefix[i..], | |
| 278 | '0'...'9', 'a'...'d', 'A'...'D', 'f', 'F' => { | |
| 279 | if (!prefix.digitAllowed(c)) break after_prefix[i..]; | |
| 280 | bytes.appendAssumeCapacity(c); | |
| 281 | }, | |
| 282 | '\'' => { | |
| 283 | bytes.appendAssumeCapacity('_'); | |
| 284 | }, | |
| 285 | else => break after_prefix[i..], | |
| 286 | } else ""; | |
| 287 | ||
| 288 | const after_frac = frac: { | |
| 289 | if (after_int.len == 0 or after_int[0] != '.') break :frac after_int; | |
| 290 | bytes.appendAssumeCapacity('.'); | |
| 291 | for (after_int[1..], 1..) |c, i| { | |
| 292 | if (c == '\'') { | |
| 293 | bytes.appendAssumeCapacity('_'); | |
| 294 | continue; | |
| 295 | } | |
| 296 | if (!prefix.digitAllowed(c)) break :frac after_int[i..]; | |
| 297 | bytes.appendAssumeCapacity(c); | |
| 298 | } | |
| 299 | break :frac ""; | |
| 300 | }; | |
| 301 | ||
| 302 | const suffix_str = exponent: { | |
| 303 | if (after_frac.len == 0) break :exponent after_frac; | |
| 304 | switch (after_frac[0]) { | |
| 305 | 'e', 'E' => {}, | |
| 306 | 'p', 'P' => if (prefix != .hex) break :exponent after_frac, | |
| 307 | else => break :exponent after_frac, | |
| 308 | } | |
| 309 | bytes.appendAssumeCapacity(after_frac[0]); | |
| 310 | for (after_frac[1..], 1..) |c, i| switch (c) { | |
| 311 | '+', '-', '0'...'9' => { | |
| 312 | bytes.appendAssumeCapacity(c); | |
| 313 | }, | |
| 314 | '\'' => { | |
| 315 | bytes.appendAssumeCapacity('_'); | |
| 316 | }, | |
| 317 | else => break :exponent after_frac[i..], | |
| 318 | }; | |
| 319 | break :exponent ""; | |
| 320 | }; | |
| 321 | ||
| 322 | const is_float = after_int.len != suffix_str.len; | |
| 323 | const suffix = aro.Tree.Token.NumberSuffix.fromString(suffix_str, if (is_float) .float else .int) orelse { | |
| 324 | try mt.fail("invalid number suffix: '{s}'", .{suffix_str}); | |
| 325 | return error.ParseError; | |
| 326 | }; | |
| 327 | if (suffix.isImaginary()) { | |
| 328 | try mt.fail("TODO: imaginary literals", .{}); | |
| 329 | return error.ParseError; | |
| 330 | } | |
| 331 | if (suffix.isBitInt()) { | |
| 332 | try mt.fail("TODO: _BitInt literals", .{}); | |
| 333 | return error.ParseError; | |
| 334 | } | |
| 335 | ||
| 336 | if (is_float) { | |
| 337 | const type_node = try ZigTag.type.create(arena, switch (suffix) { | |
| 338 | .F16 => "f16", | |
| 339 | .F => "f32", | |
| 340 | .None => "f64", | |
| 341 | .L => "c_longdouble", | |
| 342 | .W => "f80", | |
| 343 | .Q, .F128 => "f128", | |
| 344 | else => unreachable, | |
| 345 | }); | |
| 346 | const rhs = try ZigTag.float_literal.create(arena, bytes.items); | |
| 347 | return ZigTag.as.create(arena, .{ .lhs = type_node, .rhs = rhs }); | |
| 348 | } else { | |
| 349 | const type_node = try ZigTag.type.create(arena, switch (suffix) { | |
| 350 | .None => "c_int", | |
| 351 | .U => "c_uint", | |
| 352 | .L => "c_long", | |
| 353 | .UL => "c_ulong", | |
| 354 | .LL => "c_longlong", | |
| 355 | .ULL => "c_ulonglong", | |
| 356 | else => unreachable, | |
| 357 | }); | |
| 358 | const value = std.fmt.parseInt(i128, bytes.items, 0) catch math.maxInt(i128); | |
| 359 | ||
| 360 | // make the output less noisy by skipping promoteIntLiteral where | |
| 361 | // it's guaranteed to not be required because of C standard type constraints | |
| 362 | const guaranteed_to_fit = switch (suffix) { | |
| 363 | .None => math.cast(i16, value) != null, | |
| 364 | .U => math.cast(u16, value) != null, | |
| 365 | .L => math.cast(i32, value) != null, | |
| 366 | .UL => math.cast(u32, value) != null, | |
| 367 | .LL => math.cast(i64, value) != null, | |
| 368 | .ULL => math.cast(u64, value) != null, | |
| 369 | else => unreachable, | |
| 370 | }; | |
| 371 | ||
| 372 | const literal_node = try ZigTag.integer_literal.create(arena, bytes.items); | |
| 373 | if (guaranteed_to_fit) { | |
| 374 | return ZigTag.as.create(arena, .{ .lhs = type_node, .rhs = literal_node }); | |
| 375 | } else { | |
| 376 | return mt.t.createHelperCallNode(.promoteIntLiteral, &.{ type_node, literal_node, try ZigTag.enum_literal.create(arena, @tagName(prefix)) }); | |
| 377 | } | |
| 378 | } | |
| 379 | } | |
| 380 | ||
| 381 | fn zigifyEscapeSequences(mt: *MacroTranslator, slice: []const u8) ![]const u8 { | |
| 382 | var source = slice; | |
| 383 | for (source, 0..) |c, i| { | |
| 384 | if (c == '\"' or c == '\'') { | |
| 385 | source = source[i..]; | |
| 386 | break; | |
| 387 | } | |
| 388 | } | |
| 389 | for (source) |c| { | |
| 390 | if (c == '\\' or c == '\t') { | |
| 391 | break; | |
| 392 | } | |
| 393 | } else return source; | |
| 394 | const bytes = try mt.t.arena.alloc(u8, source.len * 2); | |
| 395 | var state: enum { | |
| 396 | start, | |
| 397 | escape, | |
| 398 | hex, | |
| 399 | octal, | |
| 400 | } = .start; | |
| 401 | var i: usize = 0; | |
| 402 | var count: u8 = 0; | |
| 403 | var num: u8 = 0; | |
| 404 | for (source) |c| { | |
| 405 | switch (state) { | |
| 406 | .escape => { | |
| 407 | switch (c) { | |
| 408 | 'n', 'r', 't', '\\', '\'', '\"' => { | |
| 409 | bytes[i] = c; | |
| 410 | }, | |
| 411 | '0'...'7' => { | |
| 412 | count += 1; | |
| 413 | num += c - '0'; | |
| 414 | state = .octal; | |
| 415 | bytes[i] = 'x'; | |
| 416 | }, | |
| 417 | 'x' => { | |
| 418 | state = .hex; | |
| 419 | bytes[i] = 'x'; | |
| 420 | }, | |
| 421 | 'a' => { | |
| 422 | bytes[i] = 'x'; | |
| 423 | i += 1; | |
| 424 | bytes[i] = '0'; | |
| 425 | i += 1; | |
| 426 | bytes[i] = '7'; | |
| 427 | }, | |
| 428 | 'b' => { | |
| 429 | bytes[i] = 'x'; | |
| 430 | i += 1; | |
| 431 | bytes[i] = '0'; | |
| 432 | i += 1; | |
| 433 | bytes[i] = '8'; | |
| 434 | }, | |
| 435 | 'f' => { | |
| 436 | bytes[i] = 'x'; | |
| 437 | i += 1; | |
| 438 | bytes[i] = '0'; | |
| 439 | i += 1; | |
| 440 | bytes[i] = 'C'; | |
| 441 | }, | |
| 442 | 'v' => { | |
| 443 | bytes[i] = 'x'; | |
| 444 | i += 1; | |
| 445 | bytes[i] = '0'; | |
| 446 | i += 1; | |
| 447 | bytes[i] = 'B'; | |
| 448 | }, | |
| 449 | '?' => { | |
| 450 | i -= 1; | |
| 451 | bytes[i] = '?'; | |
| 452 | }, | |
| 453 | 'u', 'U' => { | |
| 454 | try mt.fail("macro tokenizing failed: TODO unicode escape sequences", .{}); | |
| 455 | return error.ParseError; | |
| 456 | }, | |
| 457 | else => { | |
| 458 | try mt.fail("macro tokenizing failed: unknown escape sequence", .{}); | |
| 459 | return error.ParseError; | |
| 460 | }, | |
| 461 | } | |
| 462 | i += 1; | |
| 463 | if (state == .escape) | |
| 464 | state = .start; | |
| 465 | }, | |
| 466 | .start => { | |
| 467 | if (c == '\t') { | |
| 468 | bytes[i] = '\\'; | |
| 469 | i += 1; | |
| 470 | bytes[i] = 't'; | |
| 471 | i += 1; | |
| 472 | continue; | |
| 473 | } | |
| 474 | if (c == '\\') { | |
| 475 | state = .escape; | |
| 476 | } | |
| 477 | bytes[i] = c; | |
| 478 | i += 1; | |
| 479 | }, | |
| 480 | .hex => { | |
| 481 | switch (c) { | |
| 482 | '0'...'9' => { | |
| 483 | num = std.math.mul(u8, num, 16) catch { | |
| 484 | try mt.fail("macro tokenizing failed: hex literal overflowed", .{}); | |
| 485 | return error.ParseError; | |
| 486 | }; | |
| 487 | num += c - '0'; | |
| 488 | }, | |
| 489 | 'a'...'f' => { | |
| 490 | num = std.math.mul(u8, num, 16) catch { | |
| 491 | try mt.fail("macro tokenizing failed: hex literal overflowed", .{}); | |
| 492 | return error.ParseError; | |
| 493 | }; | |
| 494 | num += c - 'a' + 10; | |
| 495 | }, | |
| 496 | 'A'...'F' => { | |
| 497 | num = std.math.mul(u8, num, 16) catch { | |
| 498 | try mt.fail("macro tokenizing failed: hex literal overflowed", .{}); | |
| 499 | return error.ParseError; | |
| 500 | }; | |
| 501 | num += c - 'A' + 10; | |
| 502 | }, | |
| 503 | else => { | |
| 504 | i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); | |
| 505 | num = 0; | |
| 506 | if (c == '\\') | |
| 507 | state = .escape | |
| 508 | else | |
| 509 | state = .start; | |
| 510 | bytes[i] = c; | |
| 511 | i += 1; | |
| 512 | }, | |
| 513 | } | |
| 514 | }, | |
| 515 | .octal => { | |
| 516 | const accept_digit = switch (c) { | |
| 517 | // The maximum length of a octal literal is 3 digits | |
| 518 | '0'...'7' => count < 3, | |
| 519 | else => false, | |
| 520 | }; | |
| 521 | ||
| 522 | if (accept_digit) { | |
| 523 | count += 1; | |
| 524 | num = std.math.mul(u8, num, 8) catch { | |
| 525 | try mt.fail("macro tokenizing failed: octal literal overflowed", .{}); | |
| 526 | return error.ParseError; | |
| 527 | }; | |
| 528 | num += c - '0'; | |
| 529 | } else { | |
| 530 | i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); | |
| 531 | num = 0; | |
| 532 | count = 0; | |
| 533 | if (c == '\\') | |
| 534 | state = .escape | |
| 535 | else | |
| 536 | state = .start; | |
| 537 | bytes[i] = c; | |
| 538 | i += 1; | |
| 539 | } | |
| 540 | }, | |
| 541 | } | |
| 542 | } | |
| 543 | if (state == .hex or state == .octal) { | |
| 544 | i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); | |
| 545 | } | |
| 546 | ||
| 547 | return bytes[0..i]; | |
| 548 | } | |
| 549 | ||
| 550 | /// non-ASCII characters (mt > 127) are also treated as non-printable by fmtSliceEscapeLower. | |
| 551 | /// If a C string literal or char literal in a macro is not valid UTF-8, we need to escape | |
| 552 | /// non-ASCII characters so that the Zig source we output will itself be UTF-8. | |
| 553 | fn escapeUnprintables(mt: *MacroTranslator) ![]const u8 { | |
| 554 | const slice = mt.tokSlice(); | |
| 555 | mt.i += 1; | |
| 556 | ||
| 557 | const zigified = try mt.zigifyEscapeSequences(slice); | |
| 558 | if (std.unicode.utf8ValidateSlice(zigified)) return zigified; | |
| 559 | ||
| 560 | const formatter = std.ascii.hexEscape(zigified, .lower); | |
| 561 | const encoded_size = @as(usize, @intCast(std.fmt.count("{f}", .{formatter}))); | |
| 562 | const output = try mt.t.arena.alloc(u8, encoded_size); | |
| 563 | return std.fmt.bufPrint(output, "{f}", .{formatter}) catch |err| switch (err) { | |
| 564 | error.NoSpaceLeft => unreachable, | |
| 565 | else => |e| return e, | |
| 566 | }; | |
| 567 | } | |
| 568 | ||
| 569 | fn parseCPrimaryExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 570 | const arena = mt.t.arena; | |
| 571 | const tok = mt.peek(); | |
| 572 | switch (tok) { | |
| 573 | .char_literal, | |
| 574 | .char_literal_utf_8, | |
| 575 | .char_literal_utf_16, | |
| 576 | .char_literal_utf_32, | |
| 577 | .char_literal_wide, | |
| 578 | => { | |
| 579 | const slice = mt.tokSlice(); | |
| 580 | if (slice[0] != '\'' or slice[1] == '\\' or slice.len == 3) { | |
| 581 | return ZigTag.char_literal.create(arena, try mt.escapeUnprintables()); | |
| 582 | } else { | |
| 583 | mt.i += 1; | |
| 584 | ||
| 585 | const str = try std.fmt.allocPrint(arena, "0x{x}", .{slice[1 .. slice.len - 1]}); | |
| 586 | return ZigTag.integer_literal.create(arena, str); | |
| 587 | } | |
| 588 | }, | |
| 589 | .string_literal, | |
| 590 | .string_literal_utf_16, | |
| 591 | .string_literal_utf_8, | |
| 592 | .string_literal_utf_32, | |
| 593 | .string_literal_wide, | |
| 594 | => return ZigTag.string_literal.create(arena, try mt.escapeUnprintables()), | |
| 595 | .pp_num => return mt.parseCNumLit(), | |
| 596 | .l_paren => { | |
| 597 | mt.i += 1; | |
| 598 | const inner_node = try mt.parseCExpr(scope); | |
| 599 | ||
| 600 | try mt.expect(.r_paren); | |
| 601 | return inner_node; | |
| 602 | }, | |
| 603 | .macro_param, .macro_param_no_expand => { | |
| 604 | const param = mt.macro.params[mt.tokens[mt.i].end]; | |
| 605 | mt.i += 1; | |
| 606 | ||
| 607 | const mangled_name = scope.getAlias(param) orelse param; | |
| 608 | return try ZigTag.identifier.create(arena, mangled_name); | |
| 609 | }, | |
| 610 | .identifier, .extended_identifier => { | |
| 611 | const slice = mt.tokSlice(); | |
| 612 | mt.i += 1; | |
| 613 | ||
| 614 | const mangled_name = scope.getAlias(slice) orelse slice; | |
| 615 | if (Translator.builtin_typedef_map.get(mangled_name)) |ty| { | |
| 616 | return ZigTag.type.create(arena, ty); | |
| 617 | } | |
| 618 | if (builtins.map.get(mangled_name)) |builtin| { | |
| 619 | const builtin_identifier = try ZigTag.identifier.create(arena, "__builtin"); | |
| 620 | return ZigTag.field_access.create(arena, .{ | |
| 621 | .lhs = builtin_identifier, | |
| 622 | .field_name = builtin.name, | |
| 623 | }); | |
| 624 | } | |
| 625 | ||
| 626 | const identifier = try ZigTag.identifier.create(arena, mangled_name); | |
| 627 | scope.skipVariableDiscard(mangled_name); | |
| 628 | refs_var: { | |
| 629 | const ident_node = mt.t.global_scope.sym_table.get(slice) orelse break :refs_var; | |
| 630 | const var_decl_node = ident_node.castTag(.var_decl) orelse break :refs_var; | |
| 631 | if (!var_decl_node.data.is_const) mt.refs_var_decl = true; | |
| 632 | } | |
| 633 | return identifier; | |
| 634 | }, | |
| 635 | else => {}, | |
| 636 | } | |
| 637 | ||
| 638 | // for handling type macros (EVIL) | |
| 639 | // TODO maybe detect and treat type macros as typedefs in parseCSpecifierQualifierList? | |
| 640 | if (try mt.parseCTypeName(scope, true)) |type_name| { | |
| 641 | return type_name; | |
| 642 | } | |
| 643 | ||
| 644 | try mt.fail("unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); | |
| 645 | return error.ParseError; | |
| 646 | } | |
| 647 | ||
| 648 | fn macroIntFromBool(mt: *MacroTranslator, node: ZigNode) !ZigNode { | |
| 649 | if (!node.isBoolRes()) return node; | |
| 650 | ||
| 651 | return ZigTag.int_from_bool.create(mt.t.arena, node); | |
| 652 | } | |
| 653 | ||
| 654 | fn macroIntToBool(mt: *MacroTranslator, node: ZigNode) !ZigNode { | |
| 655 | if (node.isBoolRes()) return node; | |
| 656 | ||
| 657 | if (node.tag() == .string_literal) { | |
| 658 | // @intFromPtr(node) != 0 | |
| 659 | const int_from_ptr = try ZigTag.int_from_ptr.create(mt.t.arena, node); | |
| 660 | return ZigTag.not_equal.create(mt.t.arena, .{ .lhs = int_from_ptr, .rhs = ZigTag.zero_literal.init() }); | |
| 661 | } | |
| 662 | // node != 0 | |
| 663 | return ZigTag.not_equal.create(mt.t.arena, .{ .lhs = node, .rhs = ZigTag.zero_literal.init() }); | |
| 664 | } | |
| 665 | ||
| 666 | fn parseCCondExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 667 | const node = try mt.parseCOrExpr(scope); | |
| 668 | if (!mt.eat(.question_mark)) return node; | |
| 669 | ||
| 670 | const then_body = try mt.parseCOrExpr(scope); | |
| 671 | try mt.expect(.colon); | |
| 672 | const else_body = try mt.parseCCondExpr(scope); | |
| 673 | return ZigTag.@"if".create(mt.t.arena, .{ .cond = node, .then = then_body, .@"else" = else_body }); | |
| 674 | } | |
| 675 | ||
| 676 | fn parseCOrExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 677 | var node = try mt.parseCAndExpr(scope); | |
| 678 | while (mt.eat(.pipe_pipe)) { | |
| 679 | const lhs = try mt.macroIntToBool(node); | |
| 680 | const rhs = try mt.macroIntToBool(try mt.parseCAndExpr(scope)); | |
| 681 | node = try ZigTag.@"or".create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 682 | } | |
| 683 | return node; | |
| 684 | } | |
| 685 | ||
| 686 | fn parseCAndExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 687 | var node = try mt.parseCBitOrExpr(scope); | |
| 688 | while (mt.eat(.ampersand_ampersand)) { | |
| 689 | const lhs = try mt.macroIntToBool(node); | |
| 690 | const rhs = try mt.macroIntToBool(try mt.parseCBitOrExpr(scope)); | |
| 691 | node = try ZigTag.@"and".create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 692 | } | |
| 693 | return node; | |
| 694 | } | |
| 695 | ||
| 696 | fn parseCBitOrExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 697 | var node = try mt.parseCBitXorExpr(scope); | |
| 698 | while (mt.eat(.pipe)) { | |
| 699 | const lhs = try mt.macroIntFromBool(node); | |
| 700 | const rhs = try mt.macroIntFromBool(try mt.parseCBitXorExpr(scope)); | |
| 701 | node = try ZigTag.bit_or.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 702 | } | |
| 703 | return node; | |
| 704 | } | |
| 705 | ||
| 706 | fn parseCBitXorExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 707 | var node = try mt.parseCBitAndExpr(scope); | |
| 708 | while (mt.eat(.caret)) { | |
| 709 | const lhs = try mt.macroIntFromBool(node); | |
| 710 | const rhs = try mt.macroIntFromBool(try mt.parseCBitAndExpr(scope)); | |
| 711 | node = try ZigTag.bit_xor.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 712 | } | |
| 713 | return node; | |
| 714 | } | |
| 715 | ||
| 716 | fn parseCBitAndExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 717 | var node = try mt.parseCEqExpr(scope); | |
| 718 | while (mt.eat(.ampersand)) { | |
| 719 | const lhs = try mt.macroIntFromBool(node); | |
| 720 | const rhs = try mt.macroIntFromBool(try mt.parseCEqExpr(scope)); | |
| 721 | node = try ZigTag.bit_and.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 722 | } | |
| 723 | return node; | |
| 724 | } | |
| 725 | ||
| 726 | fn parseCEqExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 727 | var node = try mt.parseCRelExpr(scope); | |
| 728 | while (true) { | |
| 729 | switch (mt.peek()) { | |
| 730 | .bang_equal => { | |
| 731 | mt.i += 1; | |
| 732 | const lhs = try mt.macroIntFromBool(node); | |
| 733 | const rhs = try mt.macroIntFromBool(try mt.parseCRelExpr(scope)); | |
| 734 | node = try ZigTag.not_equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 735 | }, | |
| 736 | .equal_equal => { | |
| 737 | mt.i += 1; | |
| 738 | const lhs = try mt.macroIntFromBool(node); | |
| 739 | const rhs = try mt.macroIntFromBool(try mt.parseCRelExpr(scope)); | |
| 740 | node = try ZigTag.equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 741 | }, | |
| 742 | else => return node, | |
| 743 | } | |
| 744 | } | |
| 745 | } | |
| 746 | ||
| 747 | fn parseCRelExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 748 | var node = try mt.parseCShiftExpr(scope); | |
| 749 | while (true) { | |
| 750 | switch (mt.peek()) { | |
| 751 | .angle_bracket_right => { | |
| 752 | mt.i += 1; | |
| 753 | const lhs = try mt.macroIntFromBool(node); | |
| 754 | const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); | |
| 755 | node = try ZigTag.greater_than.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 756 | }, | |
| 757 | .angle_bracket_right_equal => { | |
| 758 | mt.i += 1; | |
| 759 | const lhs = try mt.macroIntFromBool(node); | |
| 760 | const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); | |
| 761 | node = try ZigTag.greater_than_equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 762 | }, | |
| 763 | .angle_bracket_left => { | |
| 764 | mt.i += 1; | |
| 765 | const lhs = try mt.macroIntFromBool(node); | |
| 766 | const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); | |
| 767 | node = try ZigTag.less_than.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 768 | }, | |
| 769 | .angle_bracket_left_equal => { | |
| 770 | mt.i += 1; | |
| 771 | const lhs = try mt.macroIntFromBool(node); | |
| 772 | const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); | |
| 773 | node = try ZigTag.less_than_equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 774 | }, | |
| 775 | else => return node, | |
| 776 | } | |
| 777 | } | |
| 778 | } | |
| 779 | ||
| 780 | fn parseCShiftExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 781 | var node = try mt.parseCAddSubExpr(scope); | |
| 782 | while (true) { | |
| 783 | switch (mt.peek()) { | |
| 784 | .angle_bracket_angle_bracket_left => { | |
| 785 | mt.i += 1; | |
| 786 | const lhs = try mt.macroIntFromBool(node); | |
| 787 | const rhs = try mt.macroIntFromBool(try mt.parseCAddSubExpr(scope)); | |
| 788 | node = try ZigTag.shl.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 789 | }, | |
| 790 | .angle_bracket_angle_bracket_right => { | |
| 791 | mt.i += 1; | |
| 792 | const lhs = try mt.macroIntFromBool(node); | |
| 793 | const rhs = try mt.macroIntFromBool(try mt.parseCAddSubExpr(scope)); | |
| 794 | node = try ZigTag.shr.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 795 | }, | |
| 796 | else => return node, | |
| 797 | } | |
| 798 | } | |
| 799 | } | |
| 800 | ||
| 801 | fn parseCAddSubExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 802 | var node = try mt.parseCMulExpr(scope); | |
| 803 | while (true) { | |
| 804 | switch (mt.peek()) { | |
| 805 | .plus => { | |
| 806 | mt.i += 1; | |
| 807 | const lhs = try mt.macroIntFromBool(node); | |
| 808 | const rhs = try mt.macroIntFromBool(try mt.parseCMulExpr(scope)); | |
| 809 | node = try ZigTag.add.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 810 | }, | |
| 811 | .minus => { | |
| 812 | mt.i += 1; | |
| 813 | const lhs = try mt.macroIntFromBool(node); | |
| 814 | const rhs = try mt.macroIntFromBool(try mt.parseCMulExpr(scope)); | |
| 815 | node = try ZigTag.sub.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 816 | }, | |
| 817 | else => return node, | |
| 818 | } | |
| 819 | } | |
| 820 | } | |
| 821 | ||
| 822 | fn parseCMulExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 823 | var node = try mt.parseCCastExpr(scope); | |
| 824 | while (true) { | |
| 825 | switch (mt.peek()) { | |
| 826 | .asterisk => { | |
| 827 | mt.i += 1; | |
| 828 | const lhs = try mt.macroIntFromBool(node); | |
| 829 | const rhs = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); | |
| 830 | node = try ZigTag.mul.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 831 | }, | |
| 832 | .slash => { | |
| 833 | mt.i += 1; | |
| 834 | const lhs = try mt.macroIntFromBool(node); | |
| 835 | const rhs = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); | |
| 836 | node = try mt.t.createHelperCallNode(.div, &.{ lhs, rhs }); | |
| 837 | }, | |
| 838 | .percent => { | |
| 839 | mt.i += 1; | |
| 840 | const lhs = try mt.macroIntFromBool(node); | |
| 841 | const rhs = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); | |
| 842 | node = try mt.t.createHelperCallNode(.rem, &.{ lhs, rhs }); | |
| 843 | }, | |
| 844 | else => return node, | |
| 845 | } | |
| 846 | } | |
| 847 | } | |
| 848 | ||
| 849 | fn parseCCastExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 850 | if (mt.eat(.l_paren)) { | |
| 851 | if (try mt.parseCTypeName(scope, true)) |type_name| { | |
| 852 | while (true) { | |
| 853 | const next_tok = mt.peek(); | |
| 854 | if (next_tok == .r_paren) { | |
| 855 | mt.i += 1; | |
| 856 | break; | |
| 857 | } | |
| 858 | // Skip trailing blank defined before the RParen. | |
| 859 | if ((next_tok == .identifier or next_tok == .extended_identifier) and | |
| 860 | mt.t.global_scope.blank_macros.contains(mt.tokSlice())) | |
| 861 | { | |
| 862 | mt.i += 1; | |
| 863 | continue; | |
| 864 | } | |
| 865 | ||
| 866 | try mt.fail( | |
| 867 | "unable to translate C expr: expected ')' instead got '{s}'", | |
| 868 | .{next_tok.symbol()}, | |
| 869 | ); | |
| 870 | return error.ParseError; | |
| 871 | } | |
| 872 | if (mt.peek() == .l_brace) { | |
| 873 | // initializer list | |
| 874 | return mt.parseCPostfixExpr(scope, type_name); | |
| 875 | } | |
| 876 | const node_to_cast = try mt.parseCCastExpr(scope); | |
| 877 | return mt.t.createHelperCallNode(.cast, &.{ type_name, node_to_cast }); | |
| 878 | } | |
| 879 | mt.i -= 1; // l_paren | |
| 880 | } | |
| 881 | return mt.parseCUnaryExpr(scope); | |
| 882 | } | |
| 883 | ||
| 884 | // allow_fail is set when unsure if we are parsing a type-name | |
| 885 | fn parseCTypeName(mt: *MacroTranslator, scope: *Scope, allow_fail: bool) ParseError!?ZigNode { | |
| 886 | if (try mt.parseCSpecifierQualifierList(scope, allow_fail)) |node| { | |
| 887 | return try mt.parseCAbstractDeclarator(node); | |
| 888 | } | |
| 889 | return null; | |
| 890 | } | |
| 891 | ||
| 892 | fn parseCSpecifierQualifierList(mt: *MacroTranslator, scope: *Scope, allow_fail: bool) ParseError!?ZigNode { | |
| 893 | const tok = mt.peek(); | |
| 894 | switch (tok) { | |
| 895 | .macro_param, .macro_param_no_expand => { | |
| 896 | const param = mt.macro.params[mt.tokens[mt.i].end]; | |
| 897 | ||
| 898 | // Assume that this is only a cast if the next token is ')' | |
| 899 | // e.g. param)identifier | |
| 900 | if (allow_fail and (mt.macro.tokens.len < mt.i + 3 or | |
| 901 | mt.macro.tokens[mt.i + 1].id != .r_paren or | |
| 902 | mt.macro.tokens[mt.i + 2].id != .identifier)) | |
| 903 | return null; | |
| 904 | ||
| 905 | mt.i += 1; | |
| 906 | const mangled_name = scope.getAlias(param) orelse param; | |
| 907 | return try ZigTag.identifier.create(mt.t.arena, mangled_name); | |
| 908 | }, | |
| 909 | .identifier, .extended_identifier => { | |
| 910 | const slice = mt.tokSlice(); | |
| 911 | const mangled_name = scope.getAlias(slice) orelse slice; | |
| 912 | ||
| 913 | if (mt.t.global_scope.blank_macros.contains(slice)) { | |
| 914 | mt.i += 1; | |
| 915 | return try mt.parseCSpecifierQualifierList(scope, allow_fail); | |
| 916 | } | |
| 917 | ||
| 918 | if (!allow_fail or mt.t.typedefs.contains(mangled_name)) { | |
| 919 | mt.i += 1; | |
| 920 | if (Translator.builtin_typedef_map.get(mangled_name)) |ty| { | |
| 921 | return try ZigTag.type.create(mt.t.arena, ty); | |
| 922 | } | |
| 923 | if (builtins.map.get(mangled_name)) |builtin| { | |
| 924 | const builtin_identifier = try ZigTag.identifier.create(mt.t.arena, "__builtin"); | |
| 925 | return try ZigTag.field_access.create(mt.t.arena, .{ | |
| 926 | .lhs = builtin_identifier, | |
| 927 | .field_name = builtin.name, | |
| 928 | }); | |
| 929 | } | |
| 930 | ||
| 931 | return try ZigTag.identifier.create(mt.t.arena, mangled_name); | |
| 932 | } | |
| 933 | }, | |
| 934 | .keyword_void => { | |
| 935 | mt.i += 1; | |
| 936 | return try ZigTag.type.create(mt.t.arena, "anyopaque"); | |
| 937 | }, | |
| 938 | .keyword_bool => { | |
| 939 | mt.i += 1; | |
| 940 | return try ZigTag.type.create(mt.t.arena, "bool"); | |
| 941 | }, | |
| 942 | .keyword_char, | |
| 943 | .keyword_int, | |
| 944 | .keyword_short, | |
| 945 | .keyword_long, | |
| 946 | .keyword_float, | |
| 947 | .keyword_double, | |
| 948 | .keyword_signed, | |
| 949 | .keyword_unsigned, | |
| 950 | .keyword_complex, | |
| 951 | => return try mt.parseCNumericType(), | |
| 952 | .keyword_enum, .keyword_struct, .keyword_union => { | |
| 953 | const tag_name = mt.tokSlice(); | |
| 954 | mt.i += 1; | |
| 955 | ||
| 956 | // struct Foo will be declared as struct_Foo by transRecordDecl | |
| 957 | const identifier = mt.tokSlice(); | |
| 958 | try mt.expect(.identifier); | |
| 959 | ||
| 960 | const name = try std.fmt.allocPrint(mt.t.arena, "{s}_{s}", .{ tag_name, identifier }); | |
| 961 | return try ZigTag.identifier.create(mt.t.arena, name); | |
| 962 | }, | |
| 963 | else => {}, | |
| 964 | } | |
| 965 | ||
| 966 | if (allow_fail) return null; | |
| 967 | ||
| 968 | try mt.fail("unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); | |
| 969 | return error.ParseError; | |
| 970 | } | |
| 971 | ||
| 972 | fn parseCNumericType(mt: *MacroTranslator) ParseError!ZigNode { | |
| 973 | const KwCounter = struct { | |
| 974 | double: u8 = 0, | |
| 975 | long: u8 = 0, | |
| 976 | int: u8 = 0, | |
| 977 | float: u8 = 0, | |
| 978 | short: u8 = 0, | |
| 979 | char: u8 = 0, | |
| 980 | unsigned: u8 = 0, | |
| 981 | signed: u8 = 0, | |
| 982 | complex: u8 = 0, | |
| 983 | ||
| 984 | fn eql(self: @This(), other: @This()) bool { | |
| 985 | return std.meta.eql(self, other); | |
| 986 | } | |
| 987 | }; | |
| 988 | ||
| 989 | // Yes, these can be in *any* order | |
| 990 | // This still doesn't cover cases where for example volatile is intermixed | |
| 991 | ||
| 992 | var kw = KwCounter{}; | |
| 993 | // prevent overflow | |
| 994 | var i: u8 = 0; | |
| 995 | while (i < math.maxInt(u8)) : (i += 1) { | |
| 996 | switch (mt.peek()) { | |
| 997 | .keyword_double => kw.double += 1, | |
| 998 | .keyword_long => kw.long += 1, | |
| 999 | .keyword_int => kw.int += 1, | |
| 1000 | .keyword_float => kw.float += 1, | |
| 1001 | .keyword_short => kw.short += 1, | |
| 1002 | .keyword_char => kw.char += 1, | |
| 1003 | .keyword_unsigned => kw.unsigned += 1, | |
| 1004 | .keyword_signed => kw.signed += 1, | |
| 1005 | .keyword_complex => kw.complex += 1, | |
| 1006 | else => break, | |
| 1007 | } | |
| 1008 | mt.i += 1; | |
| 1009 | } | |
| 1010 | ||
| 1011 | if (kw.eql(.{ .int = 1 }) or kw.eql(.{ .signed = 1 }) or kw.eql(.{ .signed = 1, .int = 1 })) | |
| 1012 | return ZigTag.type.create(mt.t.arena, "c_int"); | |
| 1013 | ||
| 1014 | if (kw.eql(.{ .unsigned = 1 }) or kw.eql(.{ .unsigned = 1, .int = 1 })) | |
| 1015 | return ZigTag.type.create(mt.t.arena, "c_uint"); | |
| 1016 | ||
| 1017 | 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 })) | |
| 1018 | return ZigTag.type.create(mt.t.arena, "c_long"); | |
| 1019 | ||
| 1020 | if (kw.eql(.{ .unsigned = 1, .long = 1 }) or kw.eql(.{ .unsigned = 1, .long = 1, .int = 1 })) | |
| 1021 | return ZigTag.type.create(mt.t.arena, "c_ulong"); | |
| 1022 | ||
| 1023 | 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 })) | |
| 1024 | return ZigTag.type.create(mt.t.arena, "c_longlong"); | |
| 1025 | ||
| 1026 | if (kw.eql(.{ .unsigned = 1, .long = 2 }) or kw.eql(.{ .unsigned = 1, .long = 2, .int = 1 })) | |
| 1027 | return ZigTag.type.create(mt.t.arena, "c_ulonglong"); | |
| 1028 | ||
| 1029 | if (kw.eql(.{ .signed = 1, .char = 1 })) | |
| 1030 | return ZigTag.type.create(mt.t.arena, "i8"); | |
| 1031 | ||
| 1032 | if (kw.eql(.{ .char = 1 }) or kw.eql(.{ .unsigned = 1, .char = 1 })) | |
| 1033 | return ZigTag.type.create(mt.t.arena, "u8"); | |
| 1034 | ||
| 1035 | 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 })) | |
| 1036 | return ZigTag.type.create(mt.t.arena, "c_short"); | |
| 1037 | ||
| 1038 | if (kw.eql(.{ .unsigned = 1, .short = 1 }) or kw.eql(.{ .unsigned = 1, .short = 1, .int = 1 })) | |
| 1039 | return ZigTag.type.create(mt.t.arena, "c_ushort"); | |
| 1040 | ||
| 1041 | if (kw.eql(.{ .float = 1 })) | |
| 1042 | return ZigTag.type.create(mt.t.arena, "f32"); | |
| 1043 | ||
| 1044 | if (kw.eql(.{ .double = 1 })) | |
| 1045 | return ZigTag.type.create(mt.t.arena, "f64"); | |
| 1046 | ||
| 1047 | if (kw.eql(.{ .long = 1, .double = 1 })) { | |
| 1048 | try mt.fail("unable to translate: TODO long double", .{}); | |
| 1049 | return error.ParseError; | |
| 1050 | } | |
| 1051 | ||
| 1052 | if (kw.eql(.{ .float = 1, .complex = 1 })) { | |
| 1053 | try mt.fail("unable to translate: TODO _Complex", .{}); | |
| 1054 | return error.ParseError; | |
| 1055 | } | |
| 1056 | ||
| 1057 | if (kw.eql(.{ .double = 1, .complex = 1 })) { | |
| 1058 | try mt.fail("unable to translate: TODO _Complex", .{}); | |
| 1059 | return error.ParseError; | |
| 1060 | } | |
| 1061 | ||
| 1062 | if (kw.eql(.{ .long = 1, .double = 1, .complex = 1 })) { | |
| 1063 | try mt.fail("unable to translate: TODO _Complex", .{}); | |
| 1064 | return error.ParseError; | |
| 1065 | } | |
| 1066 | ||
| 1067 | try mt.fail("unable to translate: invalid numeric type", .{}); | |
| 1068 | return error.ParseError; | |
| 1069 | } | |
| 1070 | ||
| 1071 | fn parseCAbstractDeclarator(mt: *MacroTranslator, node: ZigNode) ParseError!ZigNode { | |
| 1072 | if (mt.eat(.asterisk)) { | |
| 1073 | if (node.castTag(.type)) |some| { | |
| 1074 | if (std.mem.eql(u8, some.data, "anyopaque")) { | |
| 1075 | const ptr = try ZigTag.single_pointer.create(mt.t.arena, .{ | |
| 1076 | .is_const = false, | |
| 1077 | .is_volatile = false, | |
| 1078 | .is_allowzero = false, | |
| 1079 | .elem_type = node, | |
| 1080 | }); | |
| 1081 | return ZigTag.optional_type.create(mt.t.arena, ptr); | |
| 1082 | } | |
| 1083 | } | |
| 1084 | return ZigTag.c_pointer.create(mt.t.arena, .{ | |
| 1085 | .is_const = false, | |
| 1086 | .is_volatile = false, | |
| 1087 | .is_allowzero = false, | |
| 1088 | .elem_type = node, | |
| 1089 | }); | |
| 1090 | } | |
| 1091 | return node; | |
| 1092 | } | |
| 1093 | ||
| 1094 | fn parseCPostfixExpr(mt: *MacroTranslator, scope: *Scope, type_name: ?ZigNode) ParseError!ZigNode { | |
| 1095 | var node = try mt.parseCPostfixExprInner(scope, type_name); | |
| 1096 | // In C the preprocessor would handle concatting strings while expanding macros. | |
| 1097 | // This should do approximately the same by concatting any strings and identifiers | |
| 1098 | // after a primary or postfix expression. | |
| 1099 | while (true) { | |
| 1100 | switch (mt.peek()) { | |
| 1101 | .string_literal, | |
| 1102 | .string_literal_utf_16, | |
| 1103 | .string_literal_utf_8, | |
| 1104 | .string_literal_utf_32, | |
| 1105 | .string_literal_wide, | |
| 1106 | => {}, | |
| 1107 | .identifier, .extended_identifier => { | |
| 1108 | if (mt.t.global_scope.blank_macros.contains(mt.tokSlice())) { | |
| 1109 | mt.i += 1; | |
| 1110 | continue; | |
| 1111 | } | |
| 1112 | }, | |
| 1113 | else => break, | |
| 1114 | } | |
| 1115 | const rhs = try mt.parseCPostfixExprInner(scope, type_name); | |
| 1116 | node = try ZigTag.array_cat.create(mt.t.arena, .{ .lhs = node, .rhs = rhs }); | |
| 1117 | } | |
| 1118 | return node; | |
| 1119 | } | |
| 1120 | ||
| 1121 | fn parseCPostfixExprInner(mt: *MacroTranslator, scope: *Scope, type_name: ?ZigNode) ParseError!ZigNode { | |
| 1122 | const gpa = mt.t.gpa; | |
| 1123 | const arena = mt.t.arena; | |
| 1124 | var node = type_name orelse try mt.parseCPrimaryExpr(scope); | |
| 1125 | while (true) { | |
| 1126 | switch (mt.peek()) { | |
| 1127 | .period => { | |
| 1128 | mt.i += 1; | |
| 1129 | const field_name = mt.tokSlice(); | |
| 1130 | try mt.expect(.identifier); | |
| 1131 | ||
| 1132 | node = try ZigTag.field_access.create(arena, .{ .lhs = node, .field_name = field_name }); | |
| 1133 | }, | |
| 1134 | .arrow => { | |
| 1135 | mt.i += 1; | |
| 1136 | const field_name = mt.tokSlice(); | |
| 1137 | try mt.expect(.identifier); | |
| 1138 | ||
| 1139 | const deref = try ZigTag.deref.create(arena, node); | |
| 1140 | node = try ZigTag.field_access.create(arena, .{ .lhs = deref, .field_name = field_name }); | |
| 1141 | }, | |
| 1142 | .l_bracket => { | |
| 1143 | mt.i += 1; | |
| 1144 | ||
| 1145 | const index_val = try mt.macroIntFromBool(try mt.parseCExpr(scope)); | |
| 1146 | const index = try ZigTag.as.create(arena, .{ | |
| 1147 | .lhs = try ZigTag.type.create(arena, "usize"), | |
| 1148 | .rhs = try ZigTag.int_cast.create(arena, index_val), | |
| 1149 | }); | |
| 1150 | node = try ZigTag.array_access.create(arena, .{ .lhs = node, .rhs = index }); | |
| 1151 | try mt.expect(.r_bracket); | |
| 1152 | }, | |
| 1153 | .l_paren => { | |
| 1154 | mt.i += 1; | |
| 1155 | ||
| 1156 | if (mt.eat(.r_paren)) { | |
| 1157 | node = try ZigTag.call.create(arena, .{ .lhs = node, .args = &.{} }); | |
| 1158 | } else { | |
| 1159 | var args: std.ArrayList(ZigNode) = .empty; | |
| 1160 | defer args.deinit(gpa); | |
| 1161 | ||
| 1162 | while (true) { | |
| 1163 | const arg = try mt.parseCCondExpr(scope); | |
| 1164 | try args.append(gpa, arg); | |
| 1165 | ||
| 1166 | const next_id = mt.peek(); | |
| 1167 | switch (next_id) { | |
| 1168 | .comma => { | |
| 1169 | mt.i += 1; | |
| 1170 | }, | |
| 1171 | .r_paren => { | |
| 1172 | mt.i += 1; | |
| 1173 | break; | |
| 1174 | }, | |
| 1175 | else => { | |
| 1176 | try mt.fail("unable to translate C expr: expected ',' or ')' instead got '{s}'", .{next_id.symbol()}); | |
| 1177 | return error.ParseError; | |
| 1178 | }, | |
| 1179 | } | |
| 1180 | } | |
| 1181 | node = try ZigTag.call.create(arena, .{ .lhs = node, .args = try arena.dupe(ZigNode, args.items) }); | |
| 1182 | } | |
| 1183 | }, | |
| 1184 | .l_brace => { | |
| 1185 | mt.i += 1; | |
| 1186 | ||
| 1187 | // Check for designated field initializers | |
| 1188 | if (mt.peek() == .period) { | |
| 1189 | var init_vals: std.ArrayList(ast.Payload.ContainerInitDot.Initializer) = .empty; | |
| 1190 | defer init_vals.deinit(gpa); | |
| 1191 | ||
| 1192 | while (true) { | |
| 1193 | try mt.expect(.period); | |
| 1194 | const name = mt.tokSlice(); | |
| 1195 | try mt.expect(.identifier); | |
| 1196 | try mt.expect(.equal); | |
| 1197 | ||
| 1198 | const val = try mt.parseCCondExpr(scope); | |
| 1199 | try init_vals.append(gpa, .{ .name = name, .value = val }); | |
| 1200 | ||
| 1201 | const next_id = mt.peek(); | |
| 1202 | switch (next_id) { | |
| 1203 | .comma => { | |
| 1204 | mt.i += 1; | |
| 1205 | }, | |
| 1206 | .r_brace => { | |
| 1207 | mt.i += 1; | |
| 1208 | break; | |
| 1209 | }, | |
| 1210 | else => { | |
| 1211 | try mt.fail("unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); | |
| 1212 | return error.ParseError; | |
| 1213 | }, | |
| 1214 | } | |
| 1215 | } | |
| 1216 | const tuple_node = try ZigTag.container_init_dot.create(arena, try arena.dupe(ast.Payload.ContainerInitDot.Initializer, init_vals.items)); | |
| 1217 | node = try ZigTag.std_mem_zeroinit.create(arena, .{ .lhs = node, .rhs = tuple_node }); | |
| 1218 | continue; | |
| 1219 | } | |
| 1220 | ||
| 1221 | var init_vals: std.ArrayList(ZigNode) = .empty; | |
| 1222 | defer init_vals.deinit(gpa); | |
| 1223 | ||
| 1224 | while (true) { | |
| 1225 | const val = try mt.parseCCondExpr(scope); | |
| 1226 | try init_vals.append(gpa, val); | |
| 1227 | ||
| 1228 | const next_id = mt.peek(); | |
| 1229 | switch (next_id) { | |
| 1230 | .comma => { | |
| 1231 | mt.i += 1; | |
| 1232 | }, | |
| 1233 | .r_brace => { | |
| 1234 | mt.i += 1; | |
| 1235 | break; | |
| 1236 | }, | |
| 1237 | else => { | |
| 1238 | try mt.fail("unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); | |
| 1239 | return error.ParseError; | |
| 1240 | }, | |
| 1241 | } | |
| 1242 | } | |
| 1243 | const tuple_node = try ZigTag.tuple.create(arena, try arena.dupe(ZigNode, init_vals.items)); | |
| 1244 | node = try ZigTag.std_mem_zeroinit.create(arena, .{ .lhs = node, .rhs = tuple_node }); | |
| 1245 | }, | |
| 1246 | .plus_plus, .minus_minus => { | |
| 1247 | try mt.fail("TODO postfix inc/dec expr", .{}); | |
| 1248 | return error.ParseError; | |
| 1249 | }, | |
| 1250 | else => return node, | |
| 1251 | } | |
| 1252 | } | |
| 1253 | } | |
| 1254 | ||
| 1255 | fn parseCUnaryExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { | |
| 1256 | switch (mt.peek()) { | |
| 1257 | .bang => { | |
| 1258 | mt.i += 1; | |
| 1259 | const operand = try mt.macroIntToBool(try mt.parseCCastExpr(scope)); | |
| 1260 | return ZigTag.not.create(mt.t.arena, operand); | |
| 1261 | }, | |
| 1262 | .minus => { | |
| 1263 | mt.i += 1; | |
| 1264 | const operand = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); | |
| 1265 | return ZigTag.negate.create(mt.t.arena, operand); | |
| 1266 | }, | |
| 1267 | .plus => { | |
| 1268 | mt.i += 1; | |
| 1269 | return try mt.parseCCastExpr(scope); | |
| 1270 | }, | |
| 1271 | .tilde => { | |
| 1272 | mt.i += 1; | |
| 1273 | const operand = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); | |
| 1274 | return ZigTag.bit_not.create(mt.t.arena, operand); | |
| 1275 | }, | |
| 1276 | .asterisk => { | |
| 1277 | mt.i += 1; | |
| 1278 | const operand = try mt.parseCCastExpr(scope); | |
| 1279 | return ZigTag.deref.create(mt.t.arena, operand); | |
| 1280 | }, | |
| 1281 | .ampersand => { | |
| 1282 | mt.i += 1; | |
| 1283 | const operand = try mt.parseCCastExpr(scope); | |
| 1284 | return ZigTag.address_of.create(mt.t.arena, operand); | |
| 1285 | }, | |
| 1286 | .keyword_sizeof => { | |
| 1287 | mt.i += 1; | |
| 1288 | const operand = if (mt.eat(.l_paren)) blk: { | |
| 1289 | const inner = (try mt.parseCTypeName(scope, false)).?; | |
| 1290 | try mt.expect(.r_paren); | |
| 1291 | break :blk inner; | |
| 1292 | } else try mt.parseCUnaryExpr(scope); | |
| 1293 | ||
| 1294 | return mt.t.createHelperCallNode(.sizeof, &.{operand}); | |
| 1295 | }, | |
| 1296 | .keyword_alignof => { | |
| 1297 | mt.i += 1; | |
| 1298 | // TODO this won't work if using <stdalign.h>'s | |
| 1299 | // #define alignof _Alignof | |
| 1300 | try mt.expect(.l_paren); | |
| 1301 | const operand = (try mt.parseCTypeName(scope, false)).?; | |
| 1302 | try mt.expect(.r_paren); | |
| 1303 | ||
| 1304 | return ZigTag.alignof.create(mt.t.arena, operand); | |
| 1305 | }, | |
| 1306 | .plus_plus, .minus_minus => { | |
| 1307 | try mt.fail("TODO unary inc/dec expr", .{}); | |
| 1308 | return error.ParseError; | |
| 1309 | }, | |
| 1310 | else => {}, | |
| 1311 | } | |
| 1312 | ||
| 1313 | return try mt.parseCPostfixExpr(scope, null); | |
| 1314 | } |
lib/compiler/translate-c/PatternList.zig created+288| ... | ... | @@ -0,0 +1,288 @@ |
| 1 | const std = @import("std"); | |
| 2 | const mem = std.mem; | |
| 3 | const assert = std.debug.assert; | |
| 4 | ||
| 5 | const aro = @import("aro"); | |
| 6 | const CToken = aro.Tokenizer.Token; | |
| 7 | ||
| 8 | const helpers = @import("helpers.zig"); | |
| 9 | const Translator = @import("Translator.zig"); | |
| 10 | const Error = Translator.Error; | |
| 11 | pub const MacroProcessingError = Error || error{UnexpectedMacroToken}; | |
| 12 | ||
| 13 | const Impl = std.meta.DeclEnum(std.zig.c_translation.helpers); | |
| 14 | const Template = struct { []const u8, Impl }; | |
| 15 | ||
| 16 | /// Templates must be function-like macros | |
| 17 | /// first element is macro source, second element is the name of the function | |
| 18 | /// in __helpers which implements it | |
| 19 | const templates = [_]Template{ | |
| 20 | .{ "f_SUFFIX(X) (X ## f)", .F_SUFFIX }, | |
| 21 | .{ "F_SUFFIX(X) (X ## F)", .F_SUFFIX }, | |
| 22 | ||
| 23 | .{ "u_SUFFIX(X) (X ## u)", .U_SUFFIX }, | |
| 24 | .{ "U_SUFFIX(X) (X ## U)", .U_SUFFIX }, | |
| 25 | ||
| 26 | .{ "l_SUFFIX(X) (X ## l)", .L_SUFFIX }, | |
| 27 | .{ "L_SUFFIX(X) (X ## L)", .L_SUFFIX }, | |
| 28 | ||
| 29 | .{ "ul_SUFFIX(X) (X ## ul)", .UL_SUFFIX }, | |
| 30 | .{ "uL_SUFFIX(X) (X ## uL)", .UL_SUFFIX }, | |
| 31 | .{ "Ul_SUFFIX(X) (X ## Ul)", .UL_SUFFIX }, | |
| 32 | .{ "UL_SUFFIX(X) (X ## UL)", .UL_SUFFIX }, | |
| 33 | ||
| 34 | .{ "ll_SUFFIX(X) (X ## ll)", .LL_SUFFIX }, | |
| 35 | .{ "LL_SUFFIX(X) (X ## LL)", .LL_SUFFIX }, | |
| 36 | ||
| 37 | .{ "ull_SUFFIX(X) (X ## ull)", .ULL_SUFFIX }, | |
| 38 | .{ "uLL_SUFFIX(X) (X ## uLL)", .ULL_SUFFIX }, | |
| 39 | .{ "Ull_SUFFIX(X) (X ## Ull)", .ULL_SUFFIX }, | |
| 40 | .{ "ULL_SUFFIX(X) (X ## ULL)", .ULL_SUFFIX }, | |
| 41 | ||
| 42 | .{ "f_SUFFIX(X) X ## f", .F_SUFFIX }, | |
| 43 | .{ "F_SUFFIX(X) X ## F", .F_SUFFIX }, | |
| 44 | ||
| 45 | .{ "u_SUFFIX(X) X ## u", .U_SUFFIX }, | |
| 46 | .{ "U_SUFFIX(X) X ## U", .U_SUFFIX }, | |
| 47 | ||
| 48 | .{ "l_SUFFIX(X) X ## l", .L_SUFFIX }, | |
| 49 | .{ "L_SUFFIX(X) X ## L", .L_SUFFIX }, | |
| 50 | ||
| 51 | .{ "ul_SUFFIX(X) X ## ul", .UL_SUFFIX }, | |
| 52 | .{ "uL_SUFFIX(X) X ## uL", .UL_SUFFIX }, | |
| 53 | .{ "Ul_SUFFIX(X) X ## Ul", .UL_SUFFIX }, | |
| 54 | .{ "UL_SUFFIX(X) X ## UL", .UL_SUFFIX }, | |
| 55 | ||
| 56 | .{ "ll_SUFFIX(X) X ## ll", .LL_SUFFIX }, | |
| 57 | .{ "LL_SUFFIX(X) X ## LL", .LL_SUFFIX }, | |
| 58 | ||
| 59 | .{ "ull_SUFFIX(X) X ## ull", .ULL_SUFFIX }, | |
| 60 | .{ "uLL_SUFFIX(X) X ## uLL", .ULL_SUFFIX }, | |
| 61 | .{ "Ull_SUFFIX(X) X ## Ull", .ULL_SUFFIX }, | |
| 62 | .{ "ULL_SUFFIX(X) X ## ULL", .ULL_SUFFIX }, | |
| 63 | ||
| 64 | .{ "CAST_OR_CALL(X, Y) (X)(Y)", .CAST_OR_CALL }, | |
| 65 | .{ "CAST_OR_CALL(X, Y) ((X)(Y))", .CAST_OR_CALL }, | |
| 66 | ||
| 67 | .{ | |
| 68 | \\wl_container_of(ptr, sample, member) \ | |
| 69 | \\(__typeof__(sample))((char *)(ptr) - \ | |
| 70 | \\ offsetof(__typeof__(*sample), member)) | |
| 71 | , | |
| 72 | .WL_CONTAINER_OF, | |
| 73 | }, | |
| 74 | ||
| 75 | .{ "IGNORE_ME(X) ((void)(X))", .DISCARD }, | |
| 76 | .{ "IGNORE_ME(X) (void)(X)", .DISCARD }, | |
| 77 | .{ "IGNORE_ME(X) ((const void)(X))", .DISCARD }, | |
| 78 | .{ "IGNORE_ME(X) (const void)(X)", .DISCARD }, | |
| 79 | .{ "IGNORE_ME(X) ((volatile void)(X))", .DISCARD }, | |
| 80 | .{ "IGNORE_ME(X) (volatile void)(X)", .DISCARD }, | |
| 81 | .{ "IGNORE_ME(X) ((const volatile void)(X))", .DISCARD }, | |
| 82 | .{ "IGNORE_ME(X) (const volatile void)(X)", .DISCARD }, | |
| 83 | .{ "IGNORE_ME(X) ((volatile const void)(X))", .DISCARD }, | |
| 84 | .{ "IGNORE_ME(X) (volatile const void)(X)", .DISCARD }, | |
| 85 | }; | |
| 86 | ||
| 87 | const Pattern = struct { | |
| 88 | slicer: MacroSlicer, | |
| 89 | impl: Impl, | |
| 90 | ||
| 91 | fn init(pl: *Pattern, allocator: mem.Allocator, template: Template) Error!void { | |
| 92 | const source = template[0]; | |
| 93 | const impl = template[1]; | |
| 94 | var tok_list: std.ArrayList(CToken) = .empty; | |
| 95 | defer tok_list.deinit(allocator); | |
| 96 | ||
| 97 | pl.* = .{ | |
| 98 | .slicer = try tokenizeMacro(allocator, source, &tok_list), | |
| 99 | .impl = impl, | |
| 100 | }; | |
| 101 | } | |
| 102 | ||
| 103 | fn deinit(pl: *Pattern, allocator: mem.Allocator) void { | |
| 104 | allocator.free(pl.slicer.tokens); | |
| 105 | pl.* = undefined; | |
| 106 | } | |
| 107 | ||
| 108 | /// This function assumes that `ms` has already been validated to contain a function-like | |
| 109 | /// macro, and that the parsed template macro in `pl` also contains a function-like | |
| 110 | /// macro. Please review this logic carefully if changing that assumption. Two | |
| 111 | /// function-like macros are considered equivalent if and only if they contain the same | |
| 112 | /// list of tokens, modulo parameter names. | |
| 113 | fn matches(pat: Pattern, ms: MacroSlicer) bool { | |
| 114 | if (ms.params != pat.slicer.params) return false; | |
| 115 | if (ms.tokens.len != pat.slicer.tokens.len) return false; | |
| 116 | ||
| 117 | for (ms.tokens, pat.slicer.tokens) |macro_tok, pat_tok| { | |
| 118 | if (macro_tok.id != pat_tok.id) return false; | |
| 119 | switch (macro_tok.id) { | |
| 120 | .macro_param, .macro_param_no_expand => { | |
| 121 | // `.end` is the parameter index. | |
| 122 | if (macro_tok.end != pat_tok.end) return false; | |
| 123 | }, | |
| 124 | .identifier, .extended_identifier, .string_literal, .char_literal, .pp_num => { | |
| 125 | const macro_bytes = ms.slice(macro_tok); | |
| 126 | const pattern_bytes = pat.slicer.slice(pat_tok); | |
| 127 | ||
| 128 | if (!mem.eql(u8, pattern_bytes, macro_bytes)) return false; | |
| 129 | }, | |
| 130 | else => { | |
| 131 | // other tags correspond to keywords and operators that do not contain a "payload" | |
| 132 | // that can vary | |
| 133 | }, | |
| 134 | } | |
| 135 | } | |
| 136 | return true; | |
| 137 | } | |
| 138 | }; | |
| 139 | ||
| 140 | const PatternList = @This(); | |
| 141 | ||
| 142 | patterns: []Pattern, | |
| 143 | ||
| 144 | pub const MacroSlicer = struct { | |
| 145 | source: []const u8, | |
| 146 | tokens: []const CToken, | |
| 147 | params: u32, | |
| 148 | ||
| 149 | fn slice(pl: MacroSlicer, token: CToken) []const u8 { | |
| 150 | return pl.source[token.start..token.end]; | |
| 151 | } | |
| 152 | }; | |
| 153 | ||
| 154 | pub fn init(allocator: mem.Allocator) Error!PatternList { | |
| 155 | const patterns = try allocator.alloc(Pattern, templates.len); | |
| 156 | for (patterns, templates) |*pattern, template| { | |
| 157 | try pattern.init(allocator, template); | |
| 158 | } | |
| 159 | return .{ .patterns = patterns }; | |
| 160 | } | |
| 161 | ||
| 162 | pub fn deinit(pl: *PatternList, allocator: mem.Allocator) void { | |
| 163 | for (pl.patterns) |*pattern| pattern.deinit(allocator); | |
| 164 | allocator.free(pl.patterns); | |
| 165 | pl.* = undefined; | |
| 166 | } | |
| 167 | ||
| 168 | pub fn match(pl: PatternList, ms: MacroSlicer) Error!?Impl { | |
| 169 | for (pl.patterns) |pattern| if (pattern.matches(ms)) return pattern.impl; | |
| 170 | return null; | |
| 171 | } | |
| 172 | ||
| 173 | fn tokenizeMacro(allocator: mem.Allocator, source: []const u8, tok_list: *std.ArrayList(CToken)) Error!MacroSlicer { | |
| 174 | var param_count: u32 = 0; | |
| 175 | var param_buf: [8][]const u8 = undefined; | |
| 176 | ||
| 177 | var tokenizer: aro.Tokenizer = .{ | |
| 178 | .buf = source, | |
| 179 | .source = .unused, | |
| 180 | .langopts = .{}, | |
| 181 | }; | |
| 182 | { | |
| 183 | const name_tok = tokenizer.nextNoWS(); | |
| 184 | assert(name_tok.id == .identifier); | |
| 185 | const l_paren = tokenizer.nextNoWS(); | |
| 186 | assert(l_paren.id == .l_paren); | |
| 187 | } | |
| 188 | ||
| 189 | while (true) { | |
| 190 | const param = tokenizer.nextNoWS(); | |
| 191 | if (param.id == .r_paren) break; | |
| 192 | assert(param.id == .identifier); | |
| 193 | const slice = source[param.start..param.end]; | |
| 194 | param_buf[param_count] = slice; | |
| 195 | param_count += 1; | |
| 196 | ||
| 197 | const comma = tokenizer.nextNoWS(); | |
| 198 | if (comma.id == .r_paren) break; | |
| 199 | assert(comma.id == .comma); | |
| 200 | } | |
| 201 | ||
| 202 | outer: while (true) { | |
| 203 | const tok = tokenizer.next(); | |
| 204 | switch (tok.id) { | |
| 205 | .whitespace, .comment => continue, | |
| 206 | .identifier => { | |
| 207 | const slice = source[tok.start..tok.end]; | |
| 208 | for (param_buf[0..param_count], 0..) |param, i| { | |
| 209 | if (std.mem.eql(u8, param, slice)) { | |
| 210 | try tok_list.append(allocator, .{ | |
| 211 | .id = .macro_param, | |
| 212 | .source = .unused, | |
| 213 | .end = @intCast(i), | |
| 214 | }); | |
| 215 | continue :outer; | |
| 216 | } | |
| 217 | } | |
| 218 | }, | |
| 219 | .hash_hash => { | |
| 220 | if (tok_list.items[tok_list.items.len - 1].id == .macro_param) { | |
| 221 | tok_list.items[tok_list.items.len - 1].id = .macro_param_no_expand; | |
| 222 | } | |
| 223 | }, | |
| 224 | .nl, .eof => break, | |
| 225 | else => {}, | |
| 226 | } | |
| 227 | try tok_list.append(allocator, tok); | |
| 228 | } | |
| 229 | ||
| 230 | return .{ | |
| 231 | .source = source, | |
| 232 | .tokens = try tok_list.toOwnedSlice(allocator), | |
| 233 | .params = param_count, | |
| 234 | }; | |
| 235 | } | |
| 236 | ||
| 237 | test "Macro matching" { | |
| 238 | const testing = std.testing; | |
| 239 | const helper = struct { | |
| 240 | fn checkMacro( | |
| 241 | allocator: mem.Allocator, | |
| 242 | pattern_list: PatternList, | |
| 243 | source: []const u8, | |
| 244 | comptime expected_match: ?Impl, | |
| 245 | ) !void { | |
| 246 | var tok_list: std.ArrayList(CToken) = .empty; | |
| 247 | defer tok_list.deinit(allocator); | |
| 248 | const ms = try tokenizeMacro(allocator, source, &tok_list); | |
| 249 | defer allocator.free(ms.tokens); | |
| 250 | ||
| 251 | const matched = try pattern_list.match(ms); | |
| 252 | if (expected_match) |expected| { | |
| 253 | try testing.expectEqual(expected, matched); | |
| 254 | } else { | |
| 255 | try testing.expectEqual(@as(@TypeOf(matched), null), matched); | |
| 256 | } | |
| 257 | } | |
| 258 | }; | |
| 259 | const allocator = std.testing.allocator; | |
| 260 | var pattern_list = try PatternList.init(allocator); | |
| 261 | defer pattern_list.deinit(allocator); | |
| 262 | ||
| 263 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## F)", .F_SUFFIX); | |
| 264 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## U)", .U_SUFFIX); | |
| 265 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## L)", .L_SUFFIX); | |
| 266 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## LL)", .LL_SUFFIX); | |
| 267 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## UL)", .UL_SUFFIX); | |
| 268 | try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## ULL)", .ULL_SUFFIX); | |
| 269 | try helper.checkMacro(allocator, pattern_list, | |
| 270 | \\container_of(a, b, c) \ | |
| 271 | \\(__typeof__(b))((char *)(a) - \ | |
| 272 | \\ offsetof(__typeof__(*b), c)) | |
| 273 | , .WL_CONTAINER_OF); | |
| 274 | ||
| 275 | try helper.checkMacro(allocator, pattern_list, "NO_MATCH(X, Y) (X + Y)", null); | |
| 276 | try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) (X)(Y)", .CAST_OR_CALL); | |
| 277 | try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) ((X)(Y))", .CAST_OR_CALL); | |
| 278 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (void)(X)", .DISCARD); | |
| 279 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((void)(X))", .DISCARD); | |
| 280 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const void)(X)", .DISCARD); | |
| 281 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const void)(X))", .DISCARD); | |
| 282 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile void)(X)", .DISCARD); | |
| 283 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile void)(X))", .DISCARD); | |
| 284 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const volatile void)(X)", .DISCARD); | |
| 285 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const volatile void)(X))", .DISCARD); | |
| 286 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile const void)(X)", .DISCARD); | |
| 287 | try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile const void)(X))", .DISCARD); | |
| 288 | } |
lib/compiler/translate-c/Scope.zig created+399| ... | ... | @@ -0,0 +1,399 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | const aro = @import("aro"); | |
| 4 | ||
| 5 | const ast = @import("ast.zig"); | |
| 6 | const Translator = @import("Translator.zig"); | |
| 7 | ||
| 8 | const Scope = @This(); | |
| 9 | ||
| 10 | pub const SymbolTable = std.StringArrayHashMapUnmanaged(ast.Node); | |
| 11 | pub const AliasList = std.ArrayListUnmanaged(struct { | |
| 12 | alias: []const u8, | |
| 13 | name: []const u8, | |
| 14 | }); | |
| 15 | ||
| 16 | /// Associates a container (structure or union) with its relevant member functions. | |
| 17 | pub const ContainerMemberFns = struct { | |
| 18 | container_decl_ptr: *ast.Node, | |
| 19 | member_fns: std.ArrayListUnmanaged(*ast.Payload.Func) = .empty, | |
| 20 | }; | |
| 21 | pub const ContainerMemberFnsHashMap = std.AutoArrayHashMapUnmanaged(aro.QualType, ContainerMemberFns); | |
| 22 | ||
| 23 | id: Id, | |
| 24 | parent: ?*Scope, | |
| 25 | ||
| 26 | pub const Id = enum { | |
| 27 | block, | |
| 28 | root, | |
| 29 | condition, | |
| 30 | loop, | |
| 31 | do_loop, | |
| 32 | }; | |
| 33 | ||
| 34 | /// Used for the scope of condition expressions, for example `if (cond)`. | |
| 35 | /// The block is lazily initialized because it is only needed for rare | |
| 36 | /// cases of comma operators being used. | |
| 37 | pub const Condition = struct { | |
| 38 | base: Scope, | |
| 39 | block: ?Block = null, | |
| 40 | ||
| 41 | fn getBlockScope(cond: *Condition, t: *Translator) !*Block { | |
| 42 | if (cond.block) |*b| return b; | |
| 43 | cond.block = try Block.init(t, &cond.base, true); | |
| 44 | return &cond.block.?; | |
| 45 | } | |
| 46 | ||
| 47 | pub fn deinit(cond: *Condition) void { | |
| 48 | if (cond.block) |*b| b.deinit(); | |
| 49 | } | |
| 50 | }; | |
| 51 | ||
| 52 | /// Represents an in-progress Node.Block. This struct is stack-allocated. | |
| 53 | /// When it is deinitialized, it produces an Node.Block which is allocated | |
| 54 | /// into the main arena. | |
| 55 | pub const Block = struct { | |
| 56 | base: Scope, | |
| 57 | translator: *Translator, | |
| 58 | statements: std.ArrayListUnmanaged(ast.Node), | |
| 59 | variables: AliasList, | |
| 60 | mangle_count: u32 = 0, | |
| 61 | label: ?[]const u8 = null, | |
| 62 | ||
| 63 | /// By default all variables are discarded, since we do not know in advance if they | |
| 64 | /// will be used. This maps the variable's name to the Discard payload, so that if | |
| 65 | /// the variable is subsequently referenced we can indicate that the discard should | |
| 66 | /// be skipped during the intermediate AST -> Zig AST render step. | |
| 67 | variable_discards: std.StringArrayHashMapUnmanaged(*ast.Payload.Discard), | |
| 68 | ||
| 69 | /// When the block corresponds to a function, keep track of the return type | |
| 70 | /// so that the return expression can be cast, if necessary | |
| 71 | return_type: ?aro.QualType = null, | |
| 72 | ||
| 73 | /// C static local variables are wrapped in a block-local struct. The struct | |
| 74 | /// is named `mangle(static_local_ + name)` and the Zig variable within the | |
| 75 | /// struct keeps the name of the C variable. | |
| 76 | pub const static_local_prefix = "static_local"; | |
| 77 | ||
| 78 | /// C extern local variables are wrapped in a block-local struct. The struct | |
| 79 | /// is named `mangle(extern_local + name)` and the Zig variable within the | |
| 80 | /// struct keeps the name of the C variable. | |
| 81 | pub const extern_local_prefix = "extern_local"; | |
| 82 | ||
| 83 | pub fn init(t: *Translator, parent: *Scope, labeled: bool) !Block { | |
| 84 | var blk: Block = .{ | |
| 85 | .base = .{ | |
| 86 | .id = .block, | |
| 87 | .parent = parent, | |
| 88 | }, | |
| 89 | .translator = t, | |
| 90 | .statements = .empty, | |
| 91 | .variables = .empty, | |
| 92 | .variable_discards = .empty, | |
| 93 | }; | |
| 94 | if (labeled) { | |
| 95 | blk.label = try blk.makeMangledName("blk"); | |
| 96 | } | |
| 97 | return blk; | |
| 98 | } | |
| 99 | ||
| 100 | pub fn deinit(block: *Block) void { | |
| 101 | block.statements.deinit(block.translator.gpa); | |
| 102 | block.variables.deinit(block.translator.gpa); | |
| 103 | block.variable_discards.deinit(block.translator.gpa); | |
| 104 | block.* = undefined; | |
| 105 | } | |
| 106 | ||
| 107 | pub fn complete(block: *Block) !ast.Node { | |
| 108 | const arena = block.translator.arena; | |
| 109 | if (block.base.parent.?.id == .do_loop) { | |
| 110 | // We reserve 1 extra statement if the parent is a do_loop. This is in case of | |
| 111 | // do while, we want to put `if (cond) break;` at the end. | |
| 112 | const alloc_len = block.statements.items.len + @intFromBool(block.base.parent.?.id == .do_loop); | |
| 113 | var stmts = try arena.alloc(ast.Node, alloc_len); | |
| 114 | stmts.len = block.statements.items.len; | |
| 115 | @memcpy(stmts[0..block.statements.items.len], block.statements.items); | |
| 116 | return ast.Node.Tag.block.create(arena, .{ | |
| 117 | .label = block.label, | |
| 118 | .stmts = stmts, | |
| 119 | }); | |
| 120 | } | |
| 121 | if (block.statements.items.len == 0) return ast.Node.Tag.empty_block.init(); | |
| 122 | return ast.Node.Tag.block.create(arena, .{ | |
| 123 | .label = block.label, | |
| 124 | .stmts = try arena.dupe(ast.Node, block.statements.items), | |
| 125 | }); | |
| 126 | } | |
| 127 | ||
| 128 | /// Given the desired name, return a name that does not shadow anything from outer scopes. | |
| 129 | /// Inserts the returned name into the scope. | |
| 130 | /// The name will not be visible to callers of getAlias. | |
| 131 | pub fn reserveMangledName(block: *Block, name: []const u8) ![]const u8 { | |
| 132 | return block.createMangledName(name, true, null); | |
| 133 | } | |
| 134 | ||
| 135 | /// Same as reserveMangledName, but enables the alias immediately. | |
| 136 | pub fn makeMangledName(block: *Block, name: []const u8) ![]const u8 { | |
| 137 | return block.createMangledName(name, false, null); | |
| 138 | } | |
| 139 | ||
| 140 | pub fn createMangledName(block: *Block, name: []const u8, reservation: bool, prefix_opt: ?[]const u8) ![]const u8 { | |
| 141 | const arena = block.translator.arena; | |
| 142 | const name_copy = try arena.dupe(u8, name); | |
| 143 | const alias_base = if (prefix_opt) |prefix| | |
| 144 | try std.fmt.allocPrint(arena, "{s}_{s}", .{ prefix, name }) | |
| 145 | else | |
| 146 | name; | |
| 147 | var proposed_name = alias_base; | |
| 148 | while (block.contains(proposed_name)) { | |
| 149 | block.mangle_count += 1; | |
| 150 | proposed_name = try std.fmt.allocPrint(arena, "{s}_{d}", .{ alias_base, block.mangle_count }); | |
| 151 | } | |
| 152 | const new_mangle = try block.variables.addOne(block.translator.gpa); | |
| 153 | if (reservation) { | |
| 154 | new_mangle.* = .{ .name = name_copy, .alias = name_copy }; | |
| 155 | } else { | |
| 156 | new_mangle.* = .{ .name = name_copy, .alias = proposed_name }; | |
| 157 | } | |
| 158 | return proposed_name; | |
| 159 | } | |
| 160 | ||
| 161 | fn getAlias(block: *Block, name: []const u8) ?[]const u8 { | |
| 162 | for (block.variables.items) |p| { | |
| 163 | if (std.mem.eql(u8, p.name, name)) | |
| 164 | return p.alias; | |
| 165 | } | |
| 166 | return block.base.parent.?.getAlias(name); | |
| 167 | } | |
| 168 | ||
| 169 | fn localContains(block: *Block, name: []const u8) bool { | |
| 170 | for (block.variables.items) |p| { | |
| 171 | if (std.mem.eql(u8, p.alias, name)) | |
| 172 | return true; | |
| 173 | } | |
| 174 | return false; | |
| 175 | } | |
| 176 | ||
| 177 | fn contains(block: *Block, name: []const u8) bool { | |
| 178 | if (block.localContains(name)) | |
| 179 | return true; | |
| 180 | return block.base.parent.?.contains(name); | |
| 181 | } | |
| 182 | ||
| 183 | pub fn discardVariable(block: *Block, name: []const u8) Translator.Error!void { | |
| 184 | const gpa = block.translator.gpa; | |
| 185 | const arena = block.translator.arena; | |
| 186 | const name_node = try ast.Node.Tag.identifier.create(arena, name); | |
| 187 | const discard = try ast.Node.Tag.discard.create(arena, .{ .should_skip = false, .value = name_node }); | |
| 188 | try block.statements.append(gpa, discard); | |
| 189 | try block.variable_discards.putNoClobber(gpa, name, discard.castTag(.discard).?); | |
| 190 | } | |
| 191 | }; | |
| 192 | ||
| 193 | pub const Root = struct { | |
| 194 | base: Scope, | |
| 195 | translator: *Translator, | |
| 196 | sym_table: SymbolTable, | |
| 197 | blank_macros: std.StringArrayHashMapUnmanaged(void), | |
| 198 | nodes: std.ArrayListUnmanaged(ast.Node), | |
| 199 | container_member_fns_map: ContainerMemberFnsHashMap, | |
| 200 | ||
| 201 | pub fn init(t: *Translator) Root { | |
| 202 | return .{ | |
| 203 | .base = .{ | |
| 204 | .id = .root, | |
| 205 | .parent = null, | |
| 206 | }, | |
| 207 | .translator = t, | |
| 208 | .sym_table = .empty, | |
| 209 | .blank_macros = .empty, | |
| 210 | .nodes = .empty, | |
| 211 | .container_member_fns_map = .empty, | |
| 212 | }; | |
| 213 | } | |
| 214 | ||
| 215 | pub fn deinit(root: *Root) void { | |
| 216 | root.sym_table.deinit(root.translator.gpa); | |
| 217 | root.blank_macros.deinit(root.translator.gpa); | |
| 218 | root.nodes.deinit(root.translator.gpa); | |
| 219 | for (root.container_member_fns_map.values()) |*members| { | |
| 220 | members.member_fns.deinit(root.translator.gpa); | |
| 221 | } | |
| 222 | root.container_member_fns_map.deinit(root.translator.gpa); | |
| 223 | } | |
| 224 | ||
| 225 | /// Check if the global scope contains this name, without looking into the "future", e.g. | |
| 226 | /// ignore the preprocessed decl and macro names. | |
| 227 | pub fn containsNow(root: *Root, name: []const u8) bool { | |
| 228 | return root.sym_table.contains(name); | |
| 229 | } | |
| 230 | ||
| 231 | /// Check if the global scope contains the name, includes all decls that haven't been translated yet. | |
| 232 | pub fn contains(root: *Root, name: []const u8) bool { | |
| 233 | return root.containsNow(name) or root.translator.global_names.contains(name) or root.translator.weak_global_names.contains(name); | |
| 234 | } | |
| 235 | ||
| 236 | pub fn addMemberFunction(root: *Root, func_ty: aro.Type.Func, func: *ast.Payload.Func) !void { | |
| 237 | std.debug.assert(func.data.name != null); | |
| 238 | if (func_ty.params.len == 0) return; | |
| 239 | ||
| 240 | const param1_base = func_ty.params[0].qt.base(root.translator.comp); | |
| 241 | const container_qt = if (param1_base.type == .pointer) | |
| 242 | param1_base.type.pointer.child.base(root.translator.comp).qt | |
| 243 | else | |
| 244 | param1_base.qt; | |
| 245 | ||
| 246 | if (root.container_member_fns_map.getPtr(container_qt)) |members| { | |
| 247 | try members.member_fns.append(root.translator.gpa, func); | |
| 248 | } | |
| 249 | } | |
| 250 | ||
| 251 | pub fn processContainerMemberFns(root: *Root) !void { | |
| 252 | const gpa = root.translator.gpa; | |
| 253 | const arena = root.translator.arena; | |
| 254 | ||
| 255 | var member_names: std.StringArrayHashMapUnmanaged(u32) = .empty; | |
| 256 | defer member_names.deinit(gpa); | |
| 257 | for (root.container_member_fns_map.values()) |members| { | |
| 258 | member_names.clearRetainingCapacity(); | |
| 259 | const decls_ptr = switch (members.container_decl_ptr.tag()) { | |
| 260 | .@"struct", .@"union" => blk_record: { | |
| 261 | const payload: *ast.Payload.Container = @alignCast(@fieldParentPtr("base", members.container_decl_ptr.ptr_otherwise)); | |
| 262 | // Avoid duplication with field names | |
| 263 | for (payload.data.fields) |field| { | |
| 264 | try member_names.put(gpa, field.name, 0); | |
| 265 | } | |
| 266 | break :blk_record &payload.data.decls; | |
| 267 | }, | |
| 268 | .opaque_literal => blk_opaque: { | |
| 269 | const container_decl = try ast.Node.Tag.@"opaque".create(arena, .{ | |
| 270 | .layout = .none, | |
| 271 | .fields = &.{}, | |
| 272 | .decls = &.{}, | |
| 273 | }); | |
| 274 | members.container_decl_ptr.* = container_decl; | |
| 275 | break :blk_opaque &container_decl.castTag(.@"opaque").?.data.decls; | |
| 276 | }, | |
| 277 | else => return, | |
| 278 | }; | |
| 279 | ||
| 280 | const old_decls = decls_ptr.*; | |
| 281 | const new_decls = try arena.alloc(ast.Node, old_decls.len + members.member_fns.items.len); | |
| 282 | @memcpy(new_decls[0..old_decls.len], old_decls); | |
| 283 | // Assume the allocator of payload.data.decls is arena, | |
| 284 | // so don't add arena.free(old_variables). | |
| 285 | const func_ref_vars = new_decls[old_decls.len..]; | |
| 286 | var count: u32 = 0; | |
| 287 | for (members.member_fns.items) |func| { | |
| 288 | const func_name = func.data.name.?; | |
| 289 | ||
| 290 | const last_index = std.mem.lastIndexOf(u8, func_name, "_"); | |
| 291 | const last_name = if (last_index) |index| func_name[index + 1 ..] else continue; | |
| 292 | var same_count: u32 = 0; | |
| 293 | const gop = try member_names.getOrPutValue(gpa, last_name, same_count); | |
| 294 | if (gop.found_existing) { | |
| 295 | gop.value_ptr.* += 1; | |
| 296 | same_count = gop.value_ptr.*; | |
| 297 | } | |
| 298 | const var_name = if (same_count == 0) | |
| 299 | last_name | |
| 300 | else | |
| 301 | try std.fmt.allocPrint(arena, "{s}{d}", .{ last_name, same_count }); | |
| 302 | ||
| 303 | func_ref_vars[count] = try ast.Node.Tag.pub_var_simple.create(arena, .{ | |
| 304 | .name = var_name, | |
| 305 | .init = try ast.Node.Tag.identifier.create(arena, func_name), | |
| 306 | }); | |
| 307 | count += 1; | |
| 308 | } | |
| 309 | decls_ptr.* = new_decls[0 .. old_decls.len + count]; | |
| 310 | } | |
| 311 | } | |
| 312 | }; | |
| 313 | ||
| 314 | pub fn findBlockScope(inner: *Scope, t: *Translator) !*Block { | |
| 315 | var scope = inner; | |
| 316 | while (true) { | |
| 317 | switch (scope.id) { | |
| 318 | .root => unreachable, | |
| 319 | .block => return @fieldParentPtr("base", scope), | |
| 320 | .condition => return @as(*Condition, @fieldParentPtr("base", scope)).getBlockScope(t), | |
| 321 | else => scope = scope.parent.?, | |
| 322 | } | |
| 323 | } | |
| 324 | } | |
| 325 | ||
| 326 | pub fn findBlockReturnType(inner: *Scope) aro.QualType { | |
| 327 | var scope = inner; | |
| 328 | while (true) { | |
| 329 | switch (scope.id) { | |
| 330 | .root => unreachable, | |
| 331 | .block => { | |
| 332 | const block: *Block = @fieldParentPtr("base", scope); | |
| 333 | if (block.return_type) |qt| return qt; | |
| 334 | scope = scope.parent.?; | |
| 335 | }, | |
| 336 | else => scope = scope.parent.?, | |
| 337 | } | |
| 338 | } | |
| 339 | } | |
| 340 | ||
| 341 | pub fn getAlias(scope: *Scope, name: []const u8) ?[]const u8 { | |
| 342 | return switch (scope.id) { | |
| 343 | .root => null, | |
| 344 | .block => @as(*Block, @fieldParentPtr("base", scope)).getAlias(name), | |
| 345 | .loop, .do_loop, .condition => scope.parent.?.getAlias(name), | |
| 346 | }; | |
| 347 | } | |
| 348 | ||
| 349 | fn contains(scope: *Scope, name: []const u8) bool { | |
| 350 | return switch (scope.id) { | |
| 351 | .root => @as(*Root, @fieldParentPtr("base", scope)).contains(name), | |
| 352 | .block => @as(*Block, @fieldParentPtr("base", scope)).contains(name), | |
| 353 | .loop, .do_loop, .condition => scope.parent.?.contains(name), | |
| 354 | }; | |
| 355 | } | |
| 356 | ||
| 357 | /// Appends a node to the first block scope if inside a function, or to the root tree if not. | |
| 358 | pub fn appendNode(inner: *Scope, node: ast.Node) !void { | |
| 359 | var scope = inner; | |
| 360 | while (true) { | |
| 361 | switch (scope.id) { | |
| 362 | .root => { | |
| 363 | const root: *Root = @fieldParentPtr("base", scope); | |
| 364 | return root.nodes.append(root.translator.gpa, node); | |
| 365 | }, | |
| 366 | .block => { | |
| 367 | const block: *Block = @fieldParentPtr("base", scope); | |
| 368 | return block.statements.append(block.translator.gpa, node); | |
| 369 | }, | |
| 370 | else => scope = scope.parent.?, | |
| 371 | } | |
| 372 | } | |
| 373 | } | |
| 374 | ||
| 375 | pub fn skipVariableDiscard(inner: *Scope, name: []const u8) void { | |
| 376 | if (true) { | |
| 377 | // TODO: due to 'local variable is never mutated' errors, we can | |
| 378 | // only skip discards if a variable is used as an lvalue, which | |
| 379 | // we don't currently have detection for in translate-c. | |
| 380 | // Once #17584 is completed, perhaps we can do away with this | |
| 381 | // logic entirely, and instead rely on render to fixup code. | |
| 382 | return; | |
| 383 | } | |
| 384 | var scope = inner; | |
| 385 | while (true) { | |
| 386 | switch (scope.id) { | |
| 387 | .root => return, | |
| 388 | .block => { | |
| 389 | const block: *Block = @fieldParentPtr("base", scope); | |
| 390 | if (block.variable_discards.get(name)) |discard| { | |
| 391 | discard.data.should_skip = true; | |
| 392 | return; | |
| 393 | } | |
| 394 | }, | |
| 395 | else => {}, | |
| 396 | } | |
| 397 | scope = scope.parent.?; | |
| 398 | } | |
| 399 | } |
lib/compiler/translate-c/Translator.zig created+4174| ... | ... | @@ -0,0 +1,4174 @@ |
| 1 | const std = @import("std"); | |
| 2 | const mem = std.mem; | |
| 3 | const assert = std.debug.assert; | |
| 4 | const CallingConvention = std.builtin.CallingConvention; | |
| 5 | ||
| 6 | const aro = @import("aro"); | |
| 7 | const CToken = aro.Tokenizer.Token; | |
| 8 | const Tree = aro.Tree; | |
| 9 | const Node = Tree.Node; | |
| 10 | const TokenIndex = Tree.TokenIndex; | |
| 11 | const QualType = aro.QualType; | |
| 12 | ||
| 13 | const ast = @import("ast.zig"); | |
| 14 | const ZigNode = ast.Node; | |
| 15 | const ZigTag = ZigNode.Tag; | |
| 16 | const builtins = @import("builtins.zig"); | |
| 17 | const helpers = @import("helpers.zig"); | |
| 18 | const MacroTranslator = @import("MacroTranslator.zig"); | |
| 19 | const PatternList = @import("PatternList.zig"); | |
| 20 | const Scope = @import("Scope.zig"); | |
| 21 | ||
| 22 | pub const Error = std.mem.Allocator.Error; | |
| 23 | pub const MacroProcessingError = Error || error{UnexpectedMacroToken}; | |
| 24 | pub const TypeError = Error || error{UnsupportedType}; | |
| 25 | pub const TransError = TypeError || error{UnsupportedTranslation}; | |
| 26 | ||
| 27 | const Translator = @This(); | |
| 28 | ||
| 29 | /// The C AST to be translated. | |
| 30 | tree: *const Tree, | |
| 31 | /// The compilation corresponding to the AST. | |
| 32 | comp: *aro.Compilation, | |
| 33 | /// The Preprocessor that produced the source for `tree`. | |
| 34 | pp: *const aro.Preprocessor, | |
| 35 | ||
| 36 | gpa: mem.Allocator, | |
| 37 | arena: mem.Allocator, | |
| 38 | ||
| 39 | alias_list: Scope.AliasList, | |
| 40 | global_scope: *Scope.Root, | |
| 41 | /// Running number used for creating new unique identifiers. | |
| 42 | mangle_count: u32 = 0, | |
| 43 | ||
| 44 | /// Table of declarations for enum, struct, union and typedef types. | |
| 45 | type_decls: std.AutoArrayHashMapUnmanaged(Node.Index, []const u8) = .empty, | |
| 46 | /// Table of record decls that have been demoted to opaques. | |
| 47 | opaque_demotes: std.AutoHashMapUnmanaged(QualType, void) = .empty, | |
| 48 | /// Table of unnamed enums and records that are child types of typedefs. | |
| 49 | unnamed_typedefs: std.AutoHashMapUnmanaged(QualType, []const u8) = .empty, | |
| 50 | /// Table of anonymous record to generated field names. | |
| 51 | anonymous_record_field_names: std.AutoHashMapUnmanaged(struct { | |
| 52 | parent: QualType, | |
| 53 | field: QualType, | |
| 54 | }, []const u8) = .empty, | |
| 55 | ||
| 56 | /// This one is different than the root scope's name table. This contains | |
| 57 | /// a list of names that we found by visiting all the top level decls without | |
| 58 | /// translating them. The other maps are updated as we translate; this one is updated | |
| 59 | /// up front in a pre-processing step. | |
| 60 | global_names: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 61 | ||
| 62 | /// This is similar to `global_names`, but contains names which we would | |
| 63 | /// *like* to use, but do not strictly *have* to if they are unavailable. | |
| 64 | /// These are relevant to types, which ideally we would name like | |
| 65 | /// 'struct_foo' with an alias 'foo', but if either of those names is taken, | |
| 66 | /// may be mangled. | |
| 67 | /// This is distinct from `global_names` so we can detect at a type | |
| 68 | /// declaration whether or not the name is available. | |
| 69 | weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 70 | ||
| 71 | /// Set of identifiers known to refer to typedef declarations. | |
| 72 | /// Used when parsing macros. | |
| 73 | typedefs: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 74 | ||
| 75 | /// The lhs lval of a compound assignment expression. | |
| 76 | compound_assign_dummy: ?ZigNode = null, | |
| 77 | ||
| 78 | pub fn getMangle(t: *Translator) u32 { | |
| 79 | t.mangle_count += 1; | |
| 80 | return t.mangle_count; | |
| 81 | } | |
| 82 | ||
| 83 | /// Convert an `aro.Source.Location` to a 'file:line:column' string. | |
| 84 | pub fn locStr(t: *Translator, loc: aro.Source.Location) ![]const u8 { | |
| 85 | const source = t.comp.getSource(loc.id); | |
| 86 | const line_col = source.lineCol(loc); | |
| 87 | const filename = source.path; | |
| 88 | ||
| 89 | const line = source.physicalLine(loc); | |
| 90 | const col = line_col.col; | |
| 91 | ||
| 92 | return std.fmt.allocPrint(t.arena, "{s}:{d}:{d}", .{ filename, line, col }); | |
| 93 | } | |
| 94 | ||
| 95 | fn maybeSuppressResult(t: *Translator, used: ResultUsed, result: ZigNode) TransError!ZigNode { | |
| 96 | if (used == .used) return result; | |
| 97 | return ZigTag.discard.create(t.arena, .{ .should_skip = false, .value = result }); | |
| 98 | } | |
| 99 | ||
| 100 | pub fn addTopLevelDecl(t: *Translator, name: []const u8, decl_node: ZigNode) !void { | |
| 101 | const gop = try t.global_scope.sym_table.getOrPut(t.gpa, name); | |
| 102 | if (!gop.found_existing) { | |
| 103 | gop.value_ptr.* = decl_node; | |
| 104 | try t.global_scope.nodes.append(t.gpa, decl_node); | |
| 105 | } | |
| 106 | } | |
| 107 | ||
| 108 | fn fail( | |
| 109 | t: *Translator, | |
| 110 | err: anytype, | |
| 111 | source_loc: TokenIndex, | |
| 112 | comptime format: []const u8, | |
| 113 | args: anytype, | |
| 114 | ) (@TypeOf(err) || error{OutOfMemory}) { | |
| 115 | try t.warn(&t.global_scope.base, source_loc, format, args); | |
| 116 | return err; | |
| 117 | } | |
| 118 | ||
| 119 | pub fn failDecl( | |
| 120 | t: *Translator, | |
| 121 | scope: *Scope, | |
| 122 | tok_idx: TokenIndex, | |
| 123 | name: []const u8, | |
| 124 | comptime format: []const u8, | |
| 125 | args: anytype, | |
| 126 | ) Error!void { | |
| 127 | const loc = t.tree.tokens.items(.loc)[tok_idx]; | |
| 128 | return t.failDeclExtra(scope, loc, name, format, args); | |
| 129 | } | |
| 130 | ||
| 131 | pub fn failDeclExtra( | |
| 132 | t: *Translator, | |
| 133 | scope: *Scope, | |
| 134 | loc: aro.Source.Location, | |
| 135 | name: []const u8, | |
| 136 | comptime format: []const u8, | |
| 137 | args: anytype, | |
| 138 | ) Error!void { | |
| 139 | // location | |
| 140 | // pub const name = @compileError(msg); | |
| 141 | const fail_msg = try std.fmt.allocPrint(t.arena, format, args); | |
| 142 | const fail_decl = try ZigTag.fail_decl.create(t.arena, .{ .actual = name, .mangled = fail_msg }); | |
| 143 | ||
| 144 | const str = try t.locStr(loc); | |
| 145 | const location_comment = try std.fmt.allocPrint(t.arena, "// {s}", .{str}); | |
| 146 | const loc_node = try ZigTag.warning.create(t.arena, location_comment); | |
| 147 | ||
| 148 | if (scope.id == .root) { | |
| 149 | try t.addTopLevelDecl(name, fail_decl); | |
| 150 | try scope.appendNode(loc_node); | |
| 151 | } else { | |
| 152 | try scope.appendNode(fail_decl); | |
| 153 | try scope.appendNode(loc_node); | |
| 154 | ||
| 155 | const bs = try scope.findBlockScope(t); | |
| 156 | try bs.discardVariable(name); | |
| 157 | } | |
| 158 | } | |
| 159 | ||
| 160 | fn warn(t: *Translator, scope: *Scope, tok_idx: TokenIndex, comptime format: []const u8, args: anytype) !void { | |
| 161 | const loc = t.tree.tokens.items(.loc)[tok_idx]; | |
| 162 | const str = try t.locStr(loc); | |
| 163 | const value = try std.fmt.allocPrint(t.arena, "// {s}: warning: " ++ format, .{str} ++ args); | |
| 164 | try scope.appendNode(try ZigTag.warning.create(t.arena, value)); | |
| 165 | } | |
| 166 | ||
| 167 | pub const Options = struct { | |
| 168 | gpa: mem.Allocator, | |
| 169 | comp: *aro.Compilation, | |
| 170 | pp: *const aro.Preprocessor, | |
| 171 | tree: *const aro.Tree, | |
| 172 | }; | |
| 173 | ||
| 174 | pub fn translate(options: Options) mem.Allocator.Error![]u8 { | |
| 175 | const gpa = options.gpa; | |
| 176 | var arena_allocator = std.heap.ArenaAllocator.init(gpa); | |
| 177 | defer arena_allocator.deinit(); | |
| 178 | const arena = arena_allocator.allocator(); | |
| 179 | ||
| 180 | var translator: Translator = .{ | |
| 181 | .gpa = gpa, | |
| 182 | .arena = arena, | |
| 183 | .alias_list = .empty, | |
| 184 | .global_scope = try arena.create(Scope.Root), | |
| 185 | .comp = options.comp, | |
| 186 | .pp = options.pp, | |
| 187 | .tree = options.tree, | |
| 188 | }; | |
| 189 | translator.global_scope.* = Scope.Root.init(&translator); | |
| 190 | defer { | |
| 191 | translator.type_decls.deinit(gpa); | |
| 192 | translator.alias_list.deinit(gpa); | |
| 193 | translator.global_names.deinit(gpa); | |
| 194 | translator.weak_global_names.deinit(gpa); | |
| 195 | translator.opaque_demotes.deinit(gpa); | |
| 196 | translator.unnamed_typedefs.deinit(gpa); | |
| 197 | translator.anonymous_record_field_names.deinit(gpa); | |
| 198 | translator.typedefs.deinit(gpa); | |
| 199 | translator.global_scope.deinit(); | |
| 200 | } | |
| 201 | ||
| 202 | try translator.prepopulateGlobalNameTable(); | |
| 203 | try translator.transTopLevelDecls(); | |
| 204 | ||
| 205 | // Insert empty line before macros. | |
| 206 | try translator.global_scope.nodes.append(gpa, try ZigTag.warning.create(arena, "\n")); | |
| 207 | ||
| 208 | try translator.transMacros(); | |
| 209 | ||
| 210 | for (translator.alias_list.items) |alias| { | |
| 211 | if (!translator.global_scope.sym_table.contains(alias.alias)) { | |
| 212 | const node = try ZigTag.alias.create(arena, .{ .actual = alias.alias, .mangled = alias.name }); | |
| 213 | try translator.addTopLevelDecl(alias.alias, node); | |
| 214 | } | |
| 215 | } | |
| 216 | ||
| 217 | try translator.global_scope.processContainerMemberFns(); | |
| 218 | ||
| 219 | var allocating: std.Io.Writer.Allocating = .init(gpa); | |
| 220 | defer allocating.deinit(); | |
| 221 | ||
| 222 | allocating.writer.writeAll( | |
| 223 | \\pub const __builtin = @import("std").zig.c_translation.builtins; | |
| 224 | \\pub const __helpers = @import("std").zig.c_translation.helpers; | |
| 225 | \\ | |
| 226 | \\ | |
| 227 | ) catch return error.OutOfMemory; | |
| 228 | ||
| 229 | var zig_ast = try ast.render(gpa, translator.global_scope.nodes.items); | |
| 230 | defer { | |
| 231 | gpa.free(zig_ast.source); | |
| 232 | zig_ast.deinit(gpa); | |
| 233 | } | |
| 234 | zig_ast.render(gpa, &allocating.writer, .{}) catch return error.OutOfMemory; | |
| 235 | return allocating.toOwnedSlice(); | |
| 236 | } | |
| 237 | ||
| 238 | fn prepopulateGlobalNameTable(t: *Translator) !void { | |
| 239 | for (t.tree.root_decls.items) |decl| { | |
| 240 | switch (decl.get(t.tree)) { | |
| 241 | .typedef => |typedef_decl| { | |
| 242 | const decl_name = t.tree.tokSlice(typedef_decl.name_tok); | |
| 243 | try t.global_names.put(t.gpa, decl_name, {}); | |
| 244 | ||
| 245 | // Check for typedefs with unnamed enum/record child types. | |
| 246 | const base = typedef_decl.qt.base(t.comp); | |
| 247 | switch (base.type) { | |
| 248 | .@"enum" => |enum_ty| { | |
| 249 | if (enum_ty.name.lookup(t.comp)[0] != '(') continue; | |
| 250 | }, | |
| 251 | .@"struct", .@"union" => |record_ty| { | |
| 252 | if (record_ty.name.lookup(t.comp)[0] != '(') continue; | |
| 253 | }, | |
| 254 | else => continue, | |
| 255 | } | |
| 256 | ||
| 257 | const gop = try t.unnamed_typedefs.getOrPut(t.gpa, base.qt); | |
| 258 | if (gop.found_existing) { | |
| 259 | // One typedef can declare multiple names. | |
| 260 | // TODO Don't put this one in `decl_table` so it's processed later. | |
| 261 | continue; | |
| 262 | } | |
| 263 | gop.value_ptr.* = decl_name; | |
| 264 | }, | |
| 265 | ||
| 266 | .struct_decl, | |
| 267 | .union_decl, | |
| 268 | .struct_forward_decl, | |
| 269 | .union_forward_decl, | |
| 270 | .enum_decl, | |
| 271 | .enum_forward_decl, | |
| 272 | => { | |
| 273 | const decl_qt = decl.qt(t.tree); | |
| 274 | const prefix, const name = switch (decl_qt.base(t.comp).type) { | |
| 275 | .@"struct" => |struct_ty| .{ "struct", struct_ty.name.lookup(t.comp) }, | |
| 276 | .@"union" => |union_ty| .{ "union", union_ty.name.lookup(t.comp) }, | |
| 277 | .@"enum" => |enum_ty| .{ "enum", enum_ty.name.lookup(t.comp) }, | |
| 278 | else => unreachable, | |
| 279 | }; | |
| 280 | const prefixed_name = try std.fmt.allocPrint(t.arena, "{s}_{s}", .{ prefix, name }); | |
| 281 | // `name` and `prefixed_name` are the preferred names for this type. | |
| 282 | // However, we can name it anything else if necessary, so these are "weak names". | |
| 283 | try t.weak_global_names.ensureUnusedCapacity(t.gpa, 2); | |
| 284 | t.weak_global_names.putAssumeCapacity(name, {}); | |
| 285 | t.weak_global_names.putAssumeCapacity(prefixed_name, {}); | |
| 286 | }, | |
| 287 | ||
| 288 | .function, .variable => { | |
| 289 | const decl_name = t.tree.tokSlice(decl.tok(t.tree)); | |
| 290 | try t.global_names.put(t.gpa, decl_name, {}); | |
| 291 | }, | |
| 292 | .static_assert => {}, | |
| 293 | .empty_decl => {}, | |
| 294 | .global_asm => {}, | |
| 295 | else => unreachable, | |
| 296 | } | |
| 297 | } | |
| 298 | ||
| 299 | for (t.pp.defines.keys(), t.pp.defines.values()) |name, macro| { | |
| 300 | if (macro.is_builtin) continue; | |
| 301 | if (!t.isSelfDefinedMacro(name, macro)) { | |
| 302 | try t.global_names.put(t.gpa, name, {}); | |
| 303 | } | |
| 304 | } | |
| 305 | } | |
| 306 | ||
| 307 | /// Determines whether macro is of the form: `#define FOO FOO` (Possibly with trailing tokens) | |
| 308 | /// Macros of this form will not be translated. | |
| 309 | fn isSelfDefinedMacro(t: *Translator, name: []const u8, macro: aro.Preprocessor.Macro) bool { | |
| 310 | if (macro.is_func) return false; | |
| 311 | ||
| 312 | if (macro.tokens.len < 1) return false; | |
| 313 | const first_tok = macro.tokens[0]; | |
| 314 | ||
| 315 | const source = t.comp.getSource(macro.loc.id); | |
| 316 | const slice = source.buf[first_tok.start..first_tok.end]; | |
| 317 | ||
| 318 | return std.mem.eql(u8, name, slice); | |
| 319 | } | |
| 320 | ||
| 321 | // ======================= | |
| 322 | // Declaration translation | |
| 323 | // ======================= | |
| 324 | ||
| 325 | fn transTopLevelDecls(t: *Translator) !void { | |
| 326 | for (t.tree.root_decls.items) |decl| { | |
| 327 | try t.transDecl(&t.global_scope.base, decl); | |
| 328 | } | |
| 329 | } | |
| 330 | ||
| 331 | fn transDecl(t: *Translator, scope: *Scope, decl: Node.Index) !void { | |
| 332 | switch (decl.get(t.tree)) { | |
| 333 | .typedef => |typedef_decl| { | |
| 334 | // Implicit typedefs are translated only if referenced. | |
| 335 | if (typedef_decl.implicit) return; | |
| 336 | try t.transTypeDef(scope, decl); | |
| 337 | }, | |
| 338 | ||
| 339 | .struct_decl, .union_decl => |record_decl| { | |
| 340 | try t.transRecordDecl(scope, record_decl.container_qt); | |
| 341 | }, | |
| 342 | ||
| 343 | .enum_decl => |enum_decl| { | |
| 344 | try t.transEnumDecl(scope, enum_decl.container_qt); | |
| 345 | }, | |
| 346 | ||
| 347 | .enum_field, | |
| 348 | .record_field, | |
| 349 | .struct_forward_decl, | |
| 350 | .union_forward_decl, | |
| 351 | .enum_forward_decl, | |
| 352 | => return, | |
| 353 | ||
| 354 | .function => |function| { | |
| 355 | if (function.definition) |definition| { | |
| 356 | return t.transFnDecl(scope, definition.get(t.tree).function); | |
| 357 | } | |
| 358 | try t.transFnDecl(scope, function); | |
| 359 | }, | |
| 360 | ||
| 361 | .variable => |variable| { | |
| 362 | if (variable.definition != null) return; | |
| 363 | try t.transVarDecl(scope, variable); | |
| 364 | }, | |
| 365 | .static_assert => |static_assert| { | |
| 366 | try t.transStaticAssert(&t.global_scope.base, static_assert); | |
| 367 | }, | |
| 368 | .global_asm => |global_asm| { | |
| 369 | try t.transGlobalAsm(&t.global_scope.base, global_asm); | |
| 370 | }, | |
| 371 | .empty_decl => {}, | |
| 372 | else => unreachable, | |
| 373 | } | |
| 374 | } | |
| 375 | ||
| 376 | pub const builtin_typedef_map = std.StaticStringMap([]const u8).initComptime(.{ | |
| 377 | .{ "uint8_t", "u8" }, | |
| 378 | .{ "int8_t", "i8" }, | |
| 379 | .{ "uint16_t", "u16" }, | |
| 380 | .{ "int16_t", "i16" }, | |
| 381 | .{ "uint32_t", "u32" }, | |
| 382 | .{ "int32_t", "i32" }, | |
| 383 | .{ "uint64_t", "u64" }, | |
| 384 | .{ "int64_t", "i64" }, | |
| 385 | .{ "intptr_t", "isize" }, | |
| 386 | .{ "uintptr_t", "usize" }, | |
| 387 | .{ "ssize_t", "isize" }, | |
| 388 | .{ "size_t", "usize" }, | |
| 389 | }); | |
| 390 | ||
| 391 | fn transTypeDef(t: *Translator, scope: *Scope, typedef_node: Node.Index) Error!void { | |
| 392 | const typedef_decl = typedef_node.get(t.tree).typedef; | |
| 393 | if (t.type_decls.get(typedef_node)) |_| | |
| 394 | return; // Avoid processing this decl twice | |
| 395 | ||
| 396 | const toplevel = scope.id == .root; | |
| 397 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; | |
| 398 | ||
| 399 | var name: []const u8 = t.tree.tokSlice(typedef_decl.name_tok); | |
| 400 | try t.typedefs.put(t.gpa, name, {}); | |
| 401 | ||
| 402 | if (builtin_typedef_map.get(name)) |builtin| { | |
| 403 | return t.type_decls.putNoClobber(t.gpa, typedef_node, builtin); | |
| 404 | } | |
| 405 | if (!toplevel) name = try bs.makeMangledName(name); | |
| 406 | try t.type_decls.putNoClobber(t.gpa, typedef_node, name); | |
| 407 | ||
| 408 | const typedef_loc = typedef_decl.name_tok; | |
| 409 | const init_node = t.transType(scope, typedef_decl.qt, typedef_loc) catch |err| switch (err) { | |
| 410 | error.UnsupportedType => { | |
| 411 | return t.failDecl(scope, typedef_loc, name, "unable to resolve typedef child type", .{}); | |
| 412 | }, | |
| 413 | error.OutOfMemory => |e| return e, | |
| 414 | }; | |
| 415 | ||
| 416 | const payload = try t.arena.create(ast.Payload.SimpleVarDecl); | |
| 417 | payload.* = .{ | |
| 418 | .base = .{ .tag = if (toplevel) .pub_var_simple else .var_simple }, | |
| 419 | .data = .{ | |
| 420 | .name = name, | |
| 421 | .init = init_node, | |
| 422 | }, | |
| 423 | }; | |
| 424 | const node = ZigNode.initPayload(&payload.base); | |
| 425 | ||
| 426 | if (toplevel) { | |
| 427 | try t.addTopLevelDecl(name, node); | |
| 428 | } else { | |
| 429 | try scope.appendNode(node); | |
| 430 | try bs.discardVariable(name); | |
| 431 | } | |
| 432 | } | |
| 433 | ||
| 434 | fn mangleWeakGlobalName(t: *Translator, want_name: []const u8) Error![]const u8 { | |
| 435 | var cur_name = want_name; | |
| 436 | ||
| 437 | if (!t.weak_global_names.contains(want_name)) { | |
| 438 | // This type wasn't noticed by the name detection pass, so nothing has been treating this as | |
| 439 | // a weak global name. We must mangle it to avoid conflicts with locals. | |
| 440 | cur_name = try std.fmt.allocPrint(t.arena, "{s}_{d}", .{ want_name, t.getMangle() }); | |
| 441 | } | |
| 442 | ||
| 443 | while (t.global_names.contains(cur_name)) { | |
| 444 | cur_name = try std.fmt.allocPrint(t.arena, "{s}_{d}", .{ want_name, t.getMangle() }); | |
| 445 | } | |
| 446 | return cur_name; | |
| 447 | } | |
| 448 | ||
| 449 | fn transRecordDecl(t: *Translator, scope: *Scope, record_qt: QualType) Error!void { | |
| 450 | const base = record_qt.base(t.comp); | |
| 451 | const record_ty = switch (base.type) { | |
| 452 | .@"struct", .@"union" => |record_ty| record_ty, | |
| 453 | else => unreachable, | |
| 454 | }; | |
| 455 | ||
| 456 | if (t.type_decls.get(record_ty.decl_node)) |_| | |
| 457 | return; // Avoid processing this decl twice | |
| 458 | ||
| 459 | const toplevel = scope.id == .root; | |
| 460 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; | |
| 461 | ||
| 462 | const container_kind: ZigTag = if (base.type == .@"union") .@"union" else .@"struct"; | |
| 463 | const container_kind_name = @tagName(container_kind); | |
| 464 | ||
| 465 | var bare_name = record_ty.name.lookup(t.comp); | |
| 466 | var is_unnamed = false; | |
| 467 | var name = bare_name; | |
| 468 | ||
| 469 | if (t.unnamed_typedefs.get(base.qt)) |typedef_name| { | |
| 470 | bare_name = typedef_name; | |
| 471 | name = typedef_name; | |
| 472 | } else { | |
| 473 | if (record_ty.isAnonymous(t.comp)) { | |
| 474 | bare_name = try std.fmt.allocPrint(t.arena, "unnamed_{d}", .{t.getMangle()}); | |
| 475 | is_unnamed = true; | |
| 476 | } | |
| 477 | name = try std.fmt.allocPrint(t.arena, "{s}_{s}", .{ container_kind_name, bare_name }); | |
| 478 | if (toplevel and !is_unnamed) { | |
| 479 | name = try t.mangleWeakGlobalName(name); | |
| 480 | } | |
| 481 | } | |
| 482 | if (!toplevel) name = try bs.makeMangledName(name); | |
| 483 | try t.type_decls.putNoClobber(t.gpa, record_ty.decl_node, name); | |
| 484 | ||
| 485 | const is_pub = toplevel and !is_unnamed; | |
| 486 | const init_node = init: { | |
| 487 | if (record_ty.layout == null) { | |
| 488 | try t.opaque_demotes.put(t.gpa, base.qt, {}); | |
| 489 | break :init ZigTag.opaque_literal.init(); | |
| 490 | } | |
| 491 | ||
| 492 | var fields: std.ArrayList(ast.Payload.Container.Field) = .empty; | |
| 493 | defer fields.deinit(t.gpa); | |
| 494 | try fields.ensureUnusedCapacity(t.gpa, record_ty.fields.len); | |
| 495 | ||
| 496 | var functions: std.ArrayList(ZigNode) = .empty; | |
| 497 | defer functions.deinit(t.gpa); | |
| 498 | ||
| 499 | var unnamed_field_count: u32 = 0; | |
| 500 | ||
| 501 | // If a record doesn't have any attributes that would affect the alignment and | |
| 502 | // layout, then we can just use a simple `extern` type. If it does have attributes, | |
| 503 | // then we need to inspect the layout and assign an `align` value for each field. | |
| 504 | const has_alignment_attributes = aligned: { | |
| 505 | if (record_qt.hasAttribute(t.comp, .@"packed")) break :aligned true; | |
| 506 | if (record_qt.hasAttribute(t.comp, .aligned)) break :aligned true; | |
| 507 | for (record_ty.fields) |field| { | |
| 508 | const field_attrs = field.attributes(t.comp); | |
| 509 | for (field_attrs) |field_attr| { | |
| 510 | switch (field_attr.tag) { | |
| 511 | .@"packed", .aligned => break :aligned true, | |
| 512 | else => {}, | |
| 513 | } | |
| 514 | } | |
| 515 | } | |
| 516 | break :aligned false; | |
| 517 | }; | |
| 518 | const head_field_alignment: ?c_uint = if (has_alignment_attributes) t.headFieldAlignment(record_ty) else null; | |
| 519 | ||
| 520 | for (record_ty.fields, 0..) |field, field_index| { | |
| 521 | const field_loc = field.name_tok; | |
| 522 | ||
| 523 | // Demote record to opaque if it contains a bitfield | |
| 524 | if (field.bit_width != .null) { | |
| 525 | try t.opaque_demotes.put(t.gpa, base.qt, {}); | |
| 526 | try t.warn(scope, field_loc, "{s} demoted to opaque type - has bitfield", .{container_kind_name}); | |
| 527 | break :init ZigTag.opaque_literal.init(); | |
| 528 | } | |
| 529 | ||
| 530 | var field_name = field.name.lookup(t.comp); | |
| 531 | if (field.name_tok == 0) { | |
| 532 | field_name = try std.fmt.allocPrint(t.arena, "unnamed_{d}", .{unnamed_field_count}); | |
| 533 | unnamed_field_count += 1; | |
| 534 | try t.anonymous_record_field_names.put(t.gpa, .{ | |
| 535 | .parent = base.qt, | |
| 536 | .field = field.qt, | |
| 537 | }, field_name); | |
| 538 | } | |
| 539 | ||
| 540 | const field_alignment = if (has_alignment_attributes) | |
| 541 | t.alignmentForField(record_ty, head_field_alignment, field_index) | |
| 542 | else | |
| 543 | null; | |
| 544 | ||
| 545 | const field_type = field_type: { | |
| 546 | // Check if this is a flexible array member. | |
| 547 | flexible: { | |
| 548 | if (field_index != record_ty.fields.len - 1 and container_kind != .@"union") break :flexible; | |
| 549 | const array_ty = field.qt.get(t.comp, .array) orelse break :flexible; | |
| 550 | if (array_ty.len != .incomplete and (array_ty.len != .fixed or array_ty.len.fixed != 0)) break :flexible; | |
| 551 | ||
| 552 | const elem_type = t.transType(scope, array_ty.elem, field_loc) catch |err| switch (err) { | |
| 553 | error.UnsupportedType => break :flexible, | |
| 554 | else => |e| return e, | |
| 555 | }; | |
| 556 | const zero_array = try ZigTag.array_type.create(t.arena, .{ .len = 0, .elem_type = elem_type }); | |
| 557 | ||
| 558 | const member_name = field_name; | |
| 559 | field_name = try std.fmt.allocPrint(t.arena, "_{s}", .{field_name}); | |
| 560 | ||
| 561 | const member = try t.createFlexibleMemberFn(member_name, field_name); | |
| 562 | try functions.append(t.gpa, member); | |
| 563 | ||
| 564 | break :field_type zero_array; | |
| 565 | } | |
| 566 | ||
| 567 | break :field_type t.transType(scope, field.qt, field_loc) catch |err| switch (err) { | |
| 568 | error.UnsupportedType => { | |
| 569 | try t.opaque_demotes.put(t.gpa, base.qt, {}); | |
| 570 | try t.warn(scope, field.name_tok, "{s} demoted to opaque type - unable to translate type of field {s}", .{ | |
| 571 | container_kind_name, | |
| 572 | field_name, | |
| 573 | }); | |
| 574 | break :init ZigTag.opaque_literal.init(); | |
| 575 | }, | |
| 576 | else => |e| return e, | |
| 577 | }; | |
| 578 | }; | |
| 579 | ||
| 580 | // C99 introduced designated initializers for structs. Omitted fields are implicitly | |
| 581 | // initialized to zero. Some C APIs are designed with this in mind. Defaulting to zero | |
| 582 | // values for translated struct fields permits Zig code to comfortably use such an API. | |
| 583 | const default_value = if (container_kind == .@"struct") | |
| 584 | try t.createZeroValueNode(field.qt, field_type, .no_as) | |
| 585 | else | |
| 586 | null; | |
| 587 | ||
| 588 | fields.appendAssumeCapacity(.{ | |
| 589 | .name = field_name, | |
| 590 | .type = field_type, | |
| 591 | .alignment = field_alignment, | |
| 592 | .default_value = default_value, | |
| 593 | }); | |
| 594 | } | |
| 595 | ||
| 596 | // A record is empty if it has no fields or only flexible array fields. | |
| 597 | if (record_ty.fields.len == functions.items.len and | |
| 598 | t.comp.target.os.tag == .windows and t.comp.target.abi == .msvc) | |
| 599 | { | |
| 600 | // In MSVC empty records have the same size as their alignment. | |
| 601 | const padding_bits = record_ty.layout.?.size_bits; | |
| 602 | const alignment_bits = record_ty.layout.?.field_alignment_bits; | |
| 603 | ||
| 604 | try fields.append(t.gpa, .{ | |
| 605 | .name = "_padding", | |
| 606 | .type = try ZigTag.type.create(t.arena, try std.fmt.allocPrint(t.arena, "u{d}", .{padding_bits})), | |
| 607 | .alignment = @divExact(alignment_bits, 8), | |
| 608 | .default_value = if (container_kind == .@"struct") | |
| 609 | ZigTag.zero_literal.init() | |
| 610 | else | |
| 611 | null, | |
| 612 | }); | |
| 613 | } | |
| 614 | ||
| 615 | const container_payload = try t.arena.create(ast.Payload.Container); | |
| 616 | container_payload.* = .{ | |
| 617 | .base = .{ .tag = container_kind }, | |
| 618 | .data = .{ | |
| 619 | .layout = .@"extern", | |
| 620 | .fields = try t.arena.dupe(ast.Payload.Container.Field, fields.items), | |
| 621 | .decls = try t.arena.dupe(ZigNode, functions.items), | |
| 622 | }, | |
| 623 | }; | |
| 624 | break :init ZigNode.initPayload(&container_payload.base); | |
| 625 | }; | |
| 626 | ||
| 627 | const payload = try t.arena.create(ast.Payload.SimpleVarDecl); | |
| 628 | payload.* = .{ | |
| 629 | .base = .{ .tag = if (is_pub) .pub_var_simple else .var_simple }, | |
| 630 | .data = .{ | |
| 631 | .name = name, | |
| 632 | .init = init_node, | |
| 633 | }, | |
| 634 | }; | |
| 635 | const node = ZigNode.initPayload(&payload.base); | |
| 636 | if (toplevel) { | |
| 637 | try t.addTopLevelDecl(name, node); | |
| 638 | // Only add the alias if the name is available *and* it was caught by | |
| 639 | // name detection. Don't bother performing a weak mangle, since a | |
| 640 | // mangled name is of no real use here. | |
| 641 | if (!is_unnamed and !t.global_names.contains(bare_name) and t.weak_global_names.contains(bare_name)) | |
| 642 | try t.alias_list.append(t.gpa, .{ .alias = bare_name, .name = name }); | |
| 643 | try t.global_scope.container_member_fns_map.put(t.gpa, record_qt, .{ | |
| 644 | .container_decl_ptr = &payload.data.init, | |
| 645 | }); | |
| 646 | } else { | |
| 647 | try scope.appendNode(node); | |
| 648 | try bs.discardVariable(name); | |
| 649 | } | |
| 650 | } | |
| 651 | ||
| 652 | fn transFnDecl(t: *Translator, scope: *Scope, function: Node.Function) Error!void { | |
| 653 | const func_ty = function.qt.get(t.comp, .func).?; | |
| 654 | ||
| 655 | const is_pub = scope.id == .root; | |
| 656 | ||
| 657 | const fn_name = t.tree.tokSlice(function.name_tok); | |
| 658 | if (scope.getAlias(fn_name) != null or t.global_scope.containsNow(fn_name)) | |
| 659 | return; // Avoid processing this decl twice | |
| 660 | ||
| 661 | const fn_decl_loc = function.name_tok; | |
| 662 | const has_body = function.body != null and func_ty.kind != .variadic; | |
| 663 | if (function.body != null and func_ty.kind == .variadic) { | |
| 664 | try t.warn(scope, function.name_tok, "TODO unable to translate variadic function, demoted to extern", .{}); | |
| 665 | } | |
| 666 | ||
| 667 | const is_always_inline = has_body and function.qt.getAttribute(t.comp, .always_inline) != null; | |
| 668 | const proto_ctx: FnProtoContext = .{ | |
| 669 | .fn_name = fn_name, | |
| 670 | .is_always_inline = is_always_inline, | |
| 671 | .is_extern = !has_body, | |
| 672 | .is_export = !function.static and has_body and !is_always_inline and !function.@"inline", | |
| 673 | .is_pub = is_pub, | |
| 674 | .has_body = has_body, | |
| 675 | .cc = if (function.qt.getAttribute(t.comp, .calling_convention)) |some| switch (some.cc) { | |
| 676 | .c => .c, | |
| 677 | .stdcall => .x86_stdcall, | |
| 678 | .thiscall => .x86_thiscall, | |
| 679 | .fastcall => .x86_fastcall, | |
| 680 | .regcall => .x86_regcall, | |
| 681 | .riscv_vector => .riscv_vector, | |
| 682 | .aarch64_sve_pcs => .aarch64_sve_pcs, | |
| 683 | .aarch64_vector_pcs => .aarch64_vfabi, | |
| 684 | .arm_aapcs => .arm_aapcs, | |
| 685 | .arm_aapcs_vfp => .arm_aapcs_vfp, | |
| 686 | .vectorcall => switch (t.comp.target.cpu.arch) { | |
| 687 | .x86 => .x86_vectorcall, | |
| 688 | .aarch64, .aarch64_be => .aarch64_vfabi, | |
| 689 | else => .c, | |
| 690 | }, | |
| 691 | .x86_64_sysv => .x86_64_sysv, | |
| 692 | .x86_64_win => .x86_64_win, | |
| 693 | } else .c, | |
| 694 | }; | |
| 695 | ||
| 696 | const proto_node = t.transFnType(&t.global_scope.base, function.qt, func_ty, fn_decl_loc, proto_ctx) catch |err| switch (err) { | |
| 697 | error.UnsupportedType => { | |
| 698 | return t.failDecl(scope, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); | |
| 699 | }, | |
| 700 | error.OutOfMemory => |e| return e, | |
| 701 | }; | |
| 702 | ||
| 703 | const proto_payload = proto_node.castTag(.func).?; | |
| 704 | if (!has_body) { | |
| 705 | if (scope.id != .root) { | |
| 706 | const bs: *Scope.Block = try scope.findBlockScope(t); | |
| 707 | const mangled_name = try bs.createMangledName(fn_name, false, Scope.Block.extern_local_prefix); | |
| 708 | const wrapped = try ZigTag.wrapped_local.create(t.arena, .{ .name = mangled_name, .init = proto_node }); | |
| 709 | try scope.appendNode(wrapped); | |
| 710 | try bs.discardVariable(mangled_name); | |
| 711 | return; | |
| 712 | } | |
| 713 | try t.global_scope.addMemberFunction(func_ty, proto_payload); | |
| 714 | return t.addTopLevelDecl(fn_name, proto_node); | |
| 715 | } | |
| 716 | ||
| 717 | // actual function definition with body | |
| 718 | const body_stmt = function.body.?.get(t.tree).compound_stmt; | |
| 719 | var block_scope = try Scope.Block.init(t, &t.global_scope.base, false); | |
| 720 | block_scope.return_type = func_ty.return_type; | |
| 721 | defer block_scope.deinit(); | |
| 722 | ||
| 723 | var param_id: c_uint = 0; | |
| 724 | for (proto_payload.data.params, func_ty.params) |*param, param_info| { | |
| 725 | const param_name = param.name orelse { | |
| 726 | proto_payload.data.is_extern = true; | |
| 727 | proto_payload.data.is_export = false; | |
| 728 | proto_payload.data.is_inline = false; | |
| 729 | try t.warn(&t.global_scope.base, fn_decl_loc, "function {s} parameter has no name, demoted to extern", .{fn_name}); | |
| 730 | return t.addTopLevelDecl(fn_name, proto_node); | |
| 731 | }; | |
| 732 | ||
| 733 | const is_const = param_info.qt.@"const"; | |
| 734 | ||
| 735 | const mangled_param_name = try block_scope.makeMangledName(param_name); | |
| 736 | param.name = mangled_param_name; | |
| 737 | ||
| 738 | if (!is_const) { | |
| 739 | const bare_arg_name = try std.fmt.allocPrint(t.arena, "arg_{s}", .{mangled_param_name}); | |
| 740 | const arg_name = try block_scope.makeMangledName(bare_arg_name); | |
| 741 | param.name = arg_name; | |
| 742 | ||
| 743 | const redecl_node = try ZigTag.arg_redecl.create(t.arena, .{ .actual = mangled_param_name, .mangled = arg_name }); | |
| 744 | try block_scope.statements.append(t.gpa, redecl_node); | |
| 745 | } | |
| 746 | try block_scope.discardVariable(mangled_param_name); | |
| 747 | ||
| 748 | param_id += 1; | |
| 749 | } | |
| 750 | ||
| 751 | t.transCompoundStmtInline(body_stmt, &block_scope) catch |err| switch (err) { | |
| 752 | error.OutOfMemory => |e| return e, | |
| 753 | error.UnsupportedTranslation, | |
| 754 | error.UnsupportedType, | |
| 755 | => { | |
| 756 | proto_payload.data.is_extern = true; | |
| 757 | proto_payload.data.is_export = false; | |
| 758 | proto_payload.data.is_inline = false; | |
| 759 | try t.warn(&t.global_scope.base, fn_decl_loc, "unable to translate function, demoted to extern", .{}); | |
| 760 | return t.addTopLevelDecl(fn_name, proto_node); | |
| 761 | }, | |
| 762 | }; | |
| 763 | ||
| 764 | try t.global_scope.addMemberFunction(func_ty, proto_payload); | |
| 765 | proto_payload.data.body = try block_scope.complete(); | |
| 766 | return t.addTopLevelDecl(fn_name, proto_node); | |
| 767 | } | |
| 768 | ||
| 769 | fn transVarDecl(t: *Translator, scope: *Scope, variable: Node.Variable) Error!void { | |
| 770 | const base_name = t.tree.tokSlice(variable.name_tok); | |
| 771 | const toplevel = scope.id == .root; | |
| 772 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; | |
| 773 | const name, const use_base_name = blk: { | |
| 774 | if (toplevel) break :blk .{ base_name, false }; | |
| 775 | ||
| 776 | // Local extern and static variables are wrapped in a struct. | |
| 777 | const prefix: ?[]const u8 = switch (variable.storage_class) { | |
| 778 | .@"extern" => Scope.Block.extern_local_prefix, | |
| 779 | .static => Scope.Block.static_local_prefix, | |
| 780 | else => null, | |
| 781 | }; | |
| 782 | break :blk .{ try bs.createMangledName(base_name, false, prefix), prefix != null }; | |
| 783 | }; | |
| 784 | ||
| 785 | if (t.typeWasDemotedToOpaque(variable.qt)) { | |
| 786 | if (variable.storage_class != .@"extern" and scope.id == .root) { | |
| 787 | return t.failDecl(scope, variable.name_tok, name, "non-extern variable has opaque type", .{}); | |
| 788 | } else { | |
| 789 | return t.failDecl(scope, variable.name_tok, name, "local variable has opaque type", .{}); | |
| 790 | } | |
| 791 | } | |
| 792 | ||
| 793 | const type_node = (if (variable.initializer) |init| | |
| 794 | t.transTypeInit(scope, variable.qt, init, variable.name_tok) | |
| 795 | else | |
| 796 | t.transType(scope, variable.qt, variable.name_tok)) catch |err| switch (err) { | |
| 797 | error.UnsupportedType => { | |
| 798 | return t.failDecl(scope, variable.name_tok, name, "unable to translate variable declaration type", .{}); | |
| 799 | }, | |
| 800 | else => |e| return e, | |
| 801 | }; | |
| 802 | ||
| 803 | const array_ty = variable.qt.get(t.comp, .array); | |
| 804 | var is_const = variable.qt.@"const" or (array_ty != null and array_ty.?.elem.@"const"); | |
| 805 | var is_extern = variable.storage_class == .@"extern"; | |
| 806 | ||
| 807 | const init_node = init: { | |
| 808 | if (variable.initializer) |init| { | |
| 809 | const maybe_literal = init.get(t.tree); | |
| 810 | const init_node = (if (maybe_literal == .string_literal_expr) | |
| 811 | t.transStringLiteralInitializer(init, maybe_literal.string_literal_expr, type_node) | |
| 812 | else | |
| 813 | t.transExprCoercing(scope, init, .used)) catch |err| switch (err) { | |
| 814 | error.UnsupportedTranslation, error.UnsupportedType => { | |
| 815 | return t.failDecl(scope, variable.name_tok, name, "unable to resolve var init expr", .{}); | |
| 816 | }, | |
| 817 | else => |e| return e, | |
| 818 | }; | |
| 819 | ||
| 820 | if (!variable.qt.is(t.comp, .bool) and init_node.isBoolRes()) { | |
| 821 | break :init try ZigTag.int_from_bool.create(t.arena, init_node); | |
| 822 | } else { | |
| 823 | break :init init_node; | |
| 824 | } | |
| 825 | } | |
| 826 | if (variable.storage_class == .@"extern") { | |
| 827 | if (array_ty != null and array_ty.?.len == .incomplete) { | |
| 828 | // Oh no, an extern array of unknown size! These are really fun because there's no | |
| 829 | // direct equivalent in Zig. To translate correctly, we'll have to create a C-pointer | |
| 830 | // to the data initialized via @extern. | |
| 831 | ||
| 832 | // Since this is really a pointer to the underlying data, we tweak a few properties. | |
| 833 | is_extern = false; | |
| 834 | is_const = true; | |
| 835 | ||
| 836 | const name_str = try std.fmt.allocPrint(t.arena, "\"{s}\"", .{base_name}); | |
| 837 | break :init try ZigTag.builtin_extern.create(t.arena, .{ | |
| 838 | .type = type_node, | |
| 839 | .name = try ZigTag.string_literal.create(t.arena, name_str), | |
| 840 | }); | |
| 841 | } | |
| 842 | break :init null; | |
| 843 | } | |
| 844 | if (toplevel or variable.storage_class == .static or variable.thread_local) { | |
| 845 | // The C language specification states that variables with static or threadlocal | |
| 846 | // storage without an initializer are initialized to a zero value. | |
| 847 | break :init try t.createZeroValueNode(variable.qt, type_node, .no_as); | |
| 848 | } | |
| 849 | break :init ZigTag.undefined_literal.init(); | |
| 850 | }; | |
| 851 | ||
| 852 | const linksection_string = blk: { | |
| 853 | if (variable.qt.getAttribute(t.comp, .section)) |section| { | |
| 854 | break :blk t.comp.interner.get(section.name.ref()).bytes; | |
| 855 | } | |
| 856 | break :blk null; | |
| 857 | }; | |
| 858 | ||
| 859 | const alignment: ?c_uint = variable.qt.requestedAlignment(t.comp) orelse null; | |
| 860 | var node = try ZigTag.var_decl.create(t.arena, .{ | |
| 861 | .is_pub = toplevel, | |
| 862 | .is_const = is_const, | |
| 863 | .is_extern = is_extern, | |
| 864 | .is_export = toplevel and variable.storage_class == .auto, | |
| 865 | .is_threadlocal = variable.thread_local, | |
| 866 | .linksection_string = linksection_string, | |
| 867 | .alignment = alignment, | |
| 868 | .name = if (use_base_name) base_name else name, | |
| 869 | .type = type_node, | |
| 870 | .init = init_node, | |
| 871 | }); | |
| 872 | ||
| 873 | if (toplevel) { | |
| 874 | try t.addTopLevelDecl(name, node); | |
| 875 | } else { | |
| 876 | if (use_base_name) { | |
| 877 | node = try ZigTag.wrapped_local.create(t.arena, .{ .name = name, .init = node }); | |
| 878 | } | |
| 879 | try scope.appendNode(node); | |
| 880 | try bs.discardVariable(name); | |
| 881 | ||
| 882 | if (variable.qt.getAttribute(t.comp, .cleanup)) |cleanup_attr| { | |
| 883 | const cleanup_fn_name = t.tree.tokSlice(cleanup_attr.function.tok); | |
| 884 | const mangled_fn_name = scope.getAlias(cleanup_fn_name) orelse cleanup_fn_name; | |
| 885 | const fn_id = try ZigTag.identifier.create(t.arena, mangled_fn_name); | |
| 886 | ||
| 887 | const varname = try ZigTag.identifier.create(t.arena, name); | |
| 888 | const args = try t.arena.alloc(ZigNode, 1); | |
| 889 | args[0] = try ZigTag.address_of.create(t.arena, varname); | |
| 890 | ||
| 891 | const cleanup_call = try ZigTag.call.create(t.arena, .{ .lhs = fn_id, .args = args }); | |
| 892 | const discard = try ZigTag.discard.create(t.arena, .{ .should_skip = false, .value = cleanup_call }); | |
| 893 | const deferred_cleanup = try ZigTag.@"defer".create(t.arena, discard); | |
| 894 | ||
| 895 | try bs.statements.append(t.gpa, deferred_cleanup); | |
| 896 | } | |
| 897 | } | |
| 898 | } | |
| 899 | ||
| 900 | fn transEnumDecl(t: *Translator, scope: *Scope, enum_qt: QualType) Error!void { | |
| 901 | const base = enum_qt.base(t.comp); | |
| 902 | const enum_ty = base.type.@"enum"; | |
| 903 | ||
| 904 | if (t.type_decls.get(enum_ty.decl_node)) |_| | |
| 905 | return; // Avoid processing this decl twice | |
| 906 | ||
| 907 | const toplevel = scope.id == .root; | |
| 908 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; | |
| 909 | ||
| 910 | var bare_name = enum_ty.name.lookup(t.comp); | |
| 911 | var is_unnamed = false; | |
| 912 | var name = bare_name; | |
| 913 | if (t.unnamed_typedefs.get(base.qt)) |typedef_name| { | |
| 914 | bare_name = typedef_name; | |
| 915 | name = typedef_name; | |
| 916 | } else { | |
| 917 | if (enum_ty.isAnonymous(t.comp)) { | |
| 918 | bare_name = try std.fmt.allocPrint(t.arena, "unnamed_{d}", .{t.getMangle()}); | |
| 919 | is_unnamed = true; | |
| 920 | } | |
| 921 | name = try std.fmt.allocPrint(t.arena, "enum_{s}", .{bare_name}); | |
| 922 | } | |
| 923 | if (!toplevel) name = try bs.makeMangledName(name); | |
| 924 | try t.type_decls.putNoClobber(t.gpa, enum_ty.decl_node, name); | |
| 925 | ||
| 926 | const enum_type_node = if (!base.qt.hasIncompleteSize(t.comp)) blk: { | |
| 927 | const enum_decl = enum_ty.decl_node.get(t.tree).enum_decl; | |
| 928 | for (enum_ty.fields, enum_decl.fields) |field, field_node| { | |
| 929 | var enum_val_name = field.name.lookup(t.comp); | |
| 930 | if (!toplevel) { | |
| 931 | enum_val_name = try bs.makeMangledName(enum_val_name); | |
| 932 | } | |
| 933 | ||
| 934 | const enum_const_type_node: ?ZigNode = t.transType(scope, field.qt, field.name_tok) catch |err| switch (err) { | |
| 935 | error.UnsupportedType => null, | |
| 936 | else => |e| return e, | |
| 937 | }; | |
| 938 | ||
| 939 | const val = t.tree.value_map.get(field_node).?; | |
| 940 | const enum_const_def = try ZigTag.enum_constant.create(t.arena, .{ | |
| 941 | .name = enum_val_name, | |
| 942 | .is_public = toplevel, | |
| 943 | .type = enum_const_type_node, | |
| 944 | .value = try t.createIntNode(val), | |
| 945 | }); | |
| 946 | if (toplevel) | |
| 947 | try t.addTopLevelDecl(enum_val_name, enum_const_def) | |
| 948 | else { | |
| 949 | try scope.appendNode(enum_const_def); | |
| 950 | try bs.discardVariable(enum_val_name); | |
| 951 | } | |
| 952 | } | |
| 953 | ||
| 954 | break :blk t.transType(scope, enum_ty.tag.?, enum_decl.name_or_kind_tok) catch |err| switch (err) { | |
| 955 | error.UnsupportedType => { | |
| 956 | return t.failDecl(scope, enum_decl.name_or_kind_tok, name, "unable to translate enum integer type", .{}); | |
| 957 | }, | |
| 958 | else => |e| return e, | |
| 959 | }; | |
| 960 | } else blk: { | |
| 961 | try t.opaque_demotes.put(t.gpa, base.qt, {}); | |
| 962 | break :blk ZigTag.opaque_literal.init(); | |
| 963 | }; | |
| 964 | ||
| 965 | const is_pub = toplevel and !is_unnamed; | |
| 966 | const payload = try t.arena.create(ast.Payload.SimpleVarDecl); | |
| 967 | payload.* = .{ | |
| 968 | .base = .{ .tag = if (is_pub) .pub_var_simple else .var_simple }, | |
| 969 | .data = .{ | |
| 970 | .init = enum_type_node, | |
| 971 | .name = name, | |
| 972 | }, | |
| 973 | }; | |
| 974 | const node = ZigNode.initPayload(&payload.base); | |
| 975 | if (toplevel) { | |
| 976 | try t.addTopLevelDecl(name, node); | |
| 977 | if (!is_unnamed) | |
| 978 | try t.alias_list.append(t.gpa, .{ .alias = bare_name, .name = name }); | |
| 979 | } else { | |
| 980 | try scope.appendNode(node); | |
| 981 | try bs.discardVariable(name); | |
| 982 | } | |
| 983 | } | |
| 984 | ||
| 985 | fn transStaticAssert(t: *Translator, scope: *Scope, static_assert: Node.StaticAssert) Error!void { | |
| 986 | const condition = t.transExpr(scope, static_assert.cond, .used) catch |err| switch (err) { | |
| 987 | error.UnsupportedTranslation, error.UnsupportedType => { | |
| 988 | return try t.warn(&t.global_scope.base, static_assert.cond.tok(t.tree), "unable to translate _Static_assert condition", .{}); | |
| 989 | }, | |
| 990 | error.OutOfMemory => |e| return e, | |
| 991 | }; | |
| 992 | ||
| 993 | // generate @compileError message that matches C compiler output | |
| 994 | const diagnostic = if (static_assert.message) |message| str: { | |
| 995 | // Aro guarantees this to be a string literal. | |
| 996 | const str_val = t.tree.value_map.get(message).?; | |
| 997 | const str_qt = message.qt(t.tree); | |
| 998 | ||
| 999 | const bytes = t.comp.interner.get(str_val.ref()).bytes; | |
| 1000 | var allocating: std.Io.Writer.Allocating = .init(t.gpa); | |
| 1001 | defer allocating.deinit(); | |
| 1002 | ||
| 1003 | allocating.writer.writeAll("\"static assertion failed \\") catch return error.OutOfMemory; | |
| 1004 | ||
| 1005 | aro.Value.printString(bytes, str_qt, t.comp, &allocating.writer) catch return error.OutOfMemory; | |
| 1006 | allocating.writer.end -= 1; // printString adds a terminating " so we need to remove it | |
| 1007 | allocating.writer.writeAll("\\\"\"") catch return error.OutOfMemory; | |
| 1008 | ||
| 1009 | break :str try ZigTag.string_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); | |
| 1010 | } else try ZigTag.string_literal.create(t.arena, "\"static assertion failed\""); | |
| 1011 | ||
| 1012 | const assert_node = try ZigTag.static_assert.create(t.arena, .{ .lhs = condition, .rhs = diagnostic }); | |
| 1013 | try scope.appendNode(assert_node); | |
| 1014 | } | |
| 1015 | ||
| 1016 | fn transGlobalAsm(t: *Translator, scope: *Scope, global_asm: Node.SimpleAsm) Error!void { | |
| 1017 | const asm_string = t.tree.value_map.get(global_asm.asm_str).?; | |
| 1018 | const bytes = t.comp.interner.get(asm_string.ref()).bytes; | |
| 1019 | ||
| 1020 | var allocating: std.Io.Writer.Allocating = try .initCapacity(t.gpa, bytes.len); | |
| 1021 | defer allocating.deinit(); | |
| 1022 | aro.Value.printString(bytes, global_asm.asm_str.qt(t.tree), t.comp, &allocating.writer) catch return error.OutOfMemory; | |
| 1023 | ||
| 1024 | const str_node = try ZigTag.string_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); | |
| 1025 | ||
| 1026 | const asm_node = try ZigTag.asm_simple.create(t.arena, str_node); | |
| 1027 | const block = try ZigTag.block_single.create(t.arena, asm_node); | |
| 1028 | const comptime_node = try ZigTag.@"comptime".create(t.arena, block); | |
| 1029 | ||
| 1030 | try scope.appendNode(comptime_node); | |
| 1031 | } | |
| 1032 | ||
| 1033 | // ================ | |
| 1034 | // Type translation | |
| 1035 | // ================ | |
| 1036 | ||
| 1037 | fn getTypeStr(t: *Translator, qt: QualType) ![]const u8 { | |
| 1038 | var allocating: std.Io.Writer.Allocating = .init(t.gpa); | |
| 1039 | defer allocating.deinit(); | |
| 1040 | qt.print(t.comp, &allocating.writer) catch return error.OutOfMemory; | |
| 1041 | return t.arena.dupe(u8, allocating.written()); | |
| 1042 | } | |
| 1043 | ||
| 1044 | fn transType(t: *Translator, scope: *Scope, qt: QualType, source_loc: TokenIndex) TypeError!ZigNode { | |
| 1045 | loop: switch (qt.type(t.comp)) { | |
| 1046 | .atomic => { | |
| 1047 | const type_name = try t.getTypeStr(qt); | |
| 1048 | return t.fail(error.UnsupportedType, source_loc, "TODO support atomic type: '{s}'", .{type_name}); | |
| 1049 | }, | |
| 1050 | .void => return ZigTag.type.create(t.arena, "anyopaque"), | |
| 1051 | .bool => return ZigTag.type.create(t.arena, "bool"), | |
| 1052 | .int => |int_ty| switch (int_ty) { | |
| 1053 | //.char => return ZigTag.type.create(t.arena, "c_char"), // TODO: this is the preferred translation | |
| 1054 | .char => return ZigTag.type.create(t.arena, "u8"), | |
| 1055 | .schar => return ZigTag.type.create(t.arena, "i8"), | |
| 1056 | .uchar => return ZigTag.type.create(t.arena, "u8"), | |
| 1057 | .short => return ZigTag.type.create(t.arena, "c_short"), | |
| 1058 | .ushort => return ZigTag.type.create(t.arena, "c_ushort"), | |
| 1059 | .int => return ZigTag.type.create(t.arena, "c_int"), | |
| 1060 | .uint => return ZigTag.type.create(t.arena, "c_uint"), | |
| 1061 | .long => return ZigTag.type.create(t.arena, "c_long"), | |
| 1062 | .ulong => return ZigTag.type.create(t.arena, "c_ulong"), | |
| 1063 | .long_long => return ZigTag.type.create(t.arena, "c_longlong"), | |
| 1064 | .ulong_long => return ZigTag.type.create(t.arena, "c_ulonglong"), | |
| 1065 | .int128 => return ZigTag.type.create(t.arena, "i128"), | |
| 1066 | .uint128 => return ZigTag.type.create(t.arena, "u128"), | |
| 1067 | }, | |
| 1068 | .float => |float_ty| switch (float_ty) { | |
| 1069 | .fp16, .float16 => return ZigTag.type.create(t.arena, "f16"), | |
| 1070 | .float => return ZigTag.type.create(t.arena, "f32"), | |
| 1071 | .double => return ZigTag.type.create(t.arena, "f64"), | |
| 1072 | .long_double => return ZigTag.type.create(t.arena, "c_longdouble"), | |
| 1073 | .float128 => return ZigTag.type.create(t.arena, "f128"), | |
| 1074 | }, | |
| 1075 | .pointer => |pointer_ty| { | |
| 1076 | const child_qt = pointer_ty.child; | |
| 1077 | ||
| 1078 | const is_fn_proto = child_qt.is(t.comp, .func); | |
| 1079 | const is_const = is_fn_proto or child_qt.@"const"; | |
| 1080 | const is_volatile = child_qt.@"volatile"; | |
| 1081 | const elem_type = try t.transType(scope, child_qt, source_loc); | |
| 1082 | const ptr_info: @FieldType(ast.Payload.Pointer, "data") = .{ | |
| 1083 | .is_const = is_const, | |
| 1084 | .is_volatile = is_volatile, | |
| 1085 | .elem_type = elem_type, | |
| 1086 | .is_allowzero = false, | |
| 1087 | }; | |
| 1088 | if (is_fn_proto or | |
| 1089 | t.typeIsOpaque(child_qt) or | |
| 1090 | t.typeWasDemotedToOpaque(child_qt)) | |
| 1091 | { | |
| 1092 | const ptr = try ZigTag.single_pointer.create(t.arena, ptr_info); | |
| 1093 | return ZigTag.optional_type.create(t.arena, ptr); | |
| 1094 | } | |
| 1095 | ||
| 1096 | return ZigTag.c_pointer.create(t.arena, ptr_info); | |
| 1097 | }, | |
| 1098 | .array => |array_ty| { | |
| 1099 | const elem_qt = array_ty.elem; | |
| 1100 | switch (array_ty.len) { | |
| 1101 | .incomplete, .unspecified_variable => { | |
| 1102 | const elem_type = try t.transType(scope, elem_qt, source_loc); | |
| 1103 | return ZigTag.c_pointer.create(t.arena, .{ | |
| 1104 | .is_const = elem_qt.@"const", | |
| 1105 | .is_volatile = elem_qt.@"volatile", | |
| 1106 | .is_allowzero = false, | |
| 1107 | .elem_type = elem_type, | |
| 1108 | }); | |
| 1109 | }, | |
| 1110 | .fixed, .static => |len| { | |
| 1111 | const elem_type = try t.transType(scope, elem_qt, source_loc); | |
| 1112 | return ZigTag.array_type.create(t.arena, .{ .len = len, .elem_type = elem_type }); | |
| 1113 | }, | |
| 1114 | .variable => return t.fail(error.UnsupportedType, source_loc, "VLA unsupported '{s}'", .{try t.getTypeStr(qt)}), | |
| 1115 | } | |
| 1116 | }, | |
| 1117 | .func => |func_ty| return t.transFnType(scope, qt, func_ty, source_loc, .{}), | |
| 1118 | .@"struct", .@"union" => |record_ty| { | |
| 1119 | var trans_scope = scope; | |
| 1120 | if (!record_ty.isAnonymous(t.comp)) { | |
| 1121 | if (t.weak_global_names.contains(record_ty.name.lookup(t.comp))) trans_scope = &t.global_scope.base; | |
| 1122 | } | |
| 1123 | try t.transRecordDecl(trans_scope, qt); | |
| 1124 | const name = t.type_decls.get(record_ty.decl_node).?; | |
| 1125 | return ZigTag.identifier.create(t.arena, name); | |
| 1126 | }, | |
| 1127 | .@"enum" => |enum_ty| { | |
| 1128 | var trans_scope = scope; | |
| 1129 | const is_anonymous = enum_ty.isAnonymous(t.comp); | |
| 1130 | if (!is_anonymous) { | |
| 1131 | if (t.weak_global_names.contains(enum_ty.name.lookup(t.comp))) trans_scope = &t.global_scope.base; | |
| 1132 | } | |
| 1133 | try t.transEnumDecl(trans_scope, qt); | |
| 1134 | const name = t.type_decls.get(enum_ty.decl_node).?; | |
| 1135 | return ZigTag.identifier.create(t.arena, name); | |
| 1136 | }, | |
| 1137 | .typedef => |typedef_ty| { | |
| 1138 | var trans_scope = scope; | |
| 1139 | const typedef_name = typedef_ty.name.lookup(t.comp); | |
| 1140 | if (builtin_typedef_map.get(typedef_name)) |builtin| return ZigTag.type.create(t.arena, builtin); | |
| 1141 | if (t.global_names.contains(typedef_name)) trans_scope = &t.global_scope.base; | |
| 1142 | ||
| 1143 | try t.transTypeDef(trans_scope, typedef_ty.decl_node); | |
| 1144 | const name = t.type_decls.get(typedef_ty.decl_node).?; | |
| 1145 | return ZigTag.identifier.create(t.arena, name); | |
| 1146 | }, | |
| 1147 | .attributed => |attributed_ty| continue :loop attributed_ty.base.type(t.comp), | |
| 1148 | .typeof => |typeof_ty| continue :loop typeof_ty.base.type(t.comp), | |
| 1149 | .vector => |vector_ty| { | |
| 1150 | const len = try t.createNumberNode(vector_ty.len, .int); | |
| 1151 | const elem_type = try t.transType(scope, vector_ty.elem, source_loc); | |
| 1152 | return ZigTag.vector.create(t.arena, .{ .lhs = len, .rhs = elem_type }); | |
| 1153 | }, | |
| 1154 | else => return t.fail(error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{try t.getTypeStr(qt)}), | |
| 1155 | } | |
| 1156 | } | |
| 1157 | ||
| 1158 | /// Look ahead through the fields of the record to determine what the alignment of the record | |
| 1159 | /// would be without any align/packed/etc. attributes. This helps us determine whether or not | |
| 1160 | /// the fields with 0 offset need an `align` qualifier. Strictly speaking, we could just | |
| 1161 | /// pedantically assign those fields the same alignment as the parent's pointer alignment, | |
| 1162 | /// but this helps the generated code to be a little less verbose. | |
| 1163 | fn headFieldAlignment(t: *Translator, record_decl: aro.Type.Record) ?c_uint { | |
| 1164 | const bits_per_byte = 8; | |
| 1165 | const parent_ptr_alignment_bits = record_decl.layout.?.pointer_alignment_bits; | |
| 1166 | const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; | |
| 1167 | var max_field_alignment_bits: u64 = 0; | |
| 1168 | for (record_decl.fields) |field| { | |
| 1169 | if (field.qt.getRecord(t.comp)) |field_record_decl| { | |
| 1170 | const child_record_alignment = field_record_decl.layout.?.field_alignment_bits; | |
| 1171 | if (child_record_alignment > max_field_alignment_bits) | |
| 1172 | max_field_alignment_bits = child_record_alignment; | |
| 1173 | } else { | |
| 1174 | const field_size = field.layout.size_bits; | |
| 1175 | if (field_size > max_field_alignment_bits) | |
| 1176 | max_field_alignment_bits = field_size; | |
| 1177 | } | |
| 1178 | } | |
| 1179 | if (max_field_alignment_bits != parent_ptr_alignment_bits) { | |
| 1180 | return parent_ptr_alignment; | |
| 1181 | } else { | |
| 1182 | return null; | |
| 1183 | } | |
| 1184 | } | |
| 1185 | ||
| 1186 | /// This function inspects the generated layout of a record to determine the alignment for a | |
| 1187 | /// particular field. This approach is necessary because unlike Zig, a C compiler is not | |
| 1188 | /// required to fulfill the requested alignment, which means we'd risk generating different code | |
| 1189 | /// if we only look at the user-requested alignment. | |
| 1190 | /// | |
| 1191 | /// Returns a ?c_uint to match Clang's behavior of using c_uint. The return type can be changed | |
| 1192 | /// after the Clang frontend for translate-c is removed. A null value indicates that a field is | |
| 1193 | /// 'naturally aligned'. | |
| 1194 | fn alignmentForField( | |
| 1195 | t: *Translator, | |
| 1196 | record_decl: aro.Type.Record, | |
| 1197 | head_field_alignment: ?c_uint, | |
| 1198 | field_index: usize, | |
| 1199 | ) ?c_uint { | |
| 1200 | const fields = record_decl.fields; | |
| 1201 | assert(fields.len != 0); | |
| 1202 | const field = fields[field_index]; | |
| 1203 | ||
| 1204 | const bits_per_byte = 8; | |
| 1205 | const parent_ptr_alignment_bits = record_decl.layout.?.pointer_alignment_bits; | |
| 1206 | const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; | |
| 1207 | ||
| 1208 | // bitfields aren't supported yet. Until support is added, records with bitfields | |
| 1209 | // should be demoted to opaque, and this function shouldn't be called for them. | |
| 1210 | if (field.bit_width != .null) { | |
| 1211 | @panic("TODO: add bitfield support for records"); | |
| 1212 | } | |
| 1213 | ||
| 1214 | const field_offset_bits: u64 = field.layout.offset_bits; | |
| 1215 | const field_size_bits: u64 = field.layout.size_bits; | |
| 1216 | ||
| 1217 | // Fields with zero width always have an alignment of 1 | |
| 1218 | if (field_size_bits == 0) { | |
| 1219 | return 1; | |
| 1220 | } | |
| 1221 | ||
| 1222 | // Fields with 0 offset inherit the parent's pointer alignment. | |
| 1223 | if (field_offset_bits == 0) { | |
| 1224 | return head_field_alignment; | |
| 1225 | } | |
| 1226 | ||
| 1227 | // Records have a natural alignment when used as a field, and their size is | |
| 1228 | // a multiple of this alignment value. For all other types, the natural alignment | |
| 1229 | // is their size. | |
| 1230 | const field_natural_alignment_bits: u64 = if (field.qt.getRecord(t.comp)) |record| | |
| 1231 | record.layout.?.field_alignment_bits | |
| 1232 | else | |
| 1233 | field_size_bits; | |
| 1234 | const rem_bits = field_offset_bits % field_natural_alignment_bits; | |
| 1235 | ||
| 1236 | // If there's a remainder, then the alignment is smaller than the field's | |
| 1237 | // natural alignment | |
| 1238 | if (rem_bits > 0) { | |
| 1239 | const rem_alignment = rem_bits / bits_per_byte; | |
| 1240 | if (rem_alignment > 0 and std.math.isPowerOfTwo(rem_alignment)) { | |
| 1241 | const actual_alignment = @min(rem_alignment, parent_ptr_alignment); | |
| 1242 | return @as(c_uint, @truncate(actual_alignment)); | |
| 1243 | } else { | |
| 1244 | return 1; | |
| 1245 | } | |
| 1246 | } | |
| 1247 | ||
| 1248 | // A field may have an offset which positions it to be naturally aligned, but the | |
| 1249 | // parent's pointer alignment determines if this is actually true, so we take the minimum | |
| 1250 | // value. | |
| 1251 | // For example, a float field (4 bytes wide) with a 4 byte offset is positioned to have natural | |
| 1252 | // alignment, but if the parent pointer alignment is 2, then the actual alignment of the | |
| 1253 | // float is 2. | |
| 1254 | const field_natural_alignment: u64 = field_natural_alignment_bits / bits_per_byte; | |
| 1255 | const offset_alignment = field_offset_bits / bits_per_byte; | |
| 1256 | const possible_alignment = @min(parent_ptr_alignment, offset_alignment); | |
| 1257 | if (possible_alignment == field_natural_alignment) { | |
| 1258 | return null; | |
| 1259 | } else if (possible_alignment < field_natural_alignment) { | |
| 1260 | if (std.math.isPowerOfTwo(possible_alignment)) { | |
| 1261 | return possible_alignment; | |
| 1262 | } else { | |
| 1263 | return 1; | |
| 1264 | } | |
| 1265 | } else { // possible_alignment > field_natural_alignment | |
| 1266 | // Here, the field is positioned be at a higher alignment than it's natural alignment. This means we | |
| 1267 | // need to determine whether it's a specified alignment. We can determine that from the padding preceding | |
| 1268 | // the field. | |
| 1269 | const padding_from_prev_field: u64 = blk: { | |
| 1270 | if (field_offset_bits != 0) { | |
| 1271 | const previous_field = fields[field_index - 1]; | |
| 1272 | break :blk (field_offset_bits - previous_field.layout.offset_bits) - previous_field.layout.size_bits; | |
| 1273 | } else { | |
| 1274 | break :blk 0; | |
| 1275 | } | |
| 1276 | }; | |
| 1277 | if (padding_from_prev_field < field_natural_alignment_bits) { | |
| 1278 | return null; | |
| 1279 | } else { | |
| 1280 | return possible_alignment; | |
| 1281 | } | |
| 1282 | } | |
| 1283 | } | |
| 1284 | ||
| 1285 | const FnProtoContext = struct { | |
| 1286 | is_pub: bool = false, | |
| 1287 | is_export: bool = false, | |
| 1288 | is_extern: bool = false, | |
| 1289 | is_always_inline: bool = false, | |
| 1290 | fn_name: ?[]const u8 = null, | |
| 1291 | has_body: bool = false, | |
| 1292 | cc: ast.Payload.Func.CallingConvention = .c, | |
| 1293 | }; | |
| 1294 | ||
| 1295 | fn transFnType( | |
| 1296 | t: *Translator, | |
| 1297 | scope: *Scope, | |
| 1298 | func_qt: QualType, | |
| 1299 | func_ty: aro.Type.Func, | |
| 1300 | source_loc: TokenIndex, | |
| 1301 | ctx: FnProtoContext, | |
| 1302 | ) !ZigNode { | |
| 1303 | const param_count: usize = func_ty.params.len; | |
| 1304 | const fn_params = try t.arena.alloc(ast.Payload.Param, param_count); | |
| 1305 | ||
| 1306 | for (func_ty.params, fn_params) |param_info, *param_node| { | |
| 1307 | const param_qt = param_info.qt; | |
| 1308 | const is_noalias = param_qt.restrict; | |
| 1309 | ||
| 1310 | const param_name: ?[]const u8 = if (param_info.name == .empty) | |
| 1311 | null | |
| 1312 | else | |
| 1313 | param_info.name.lookup(t.comp); | |
| 1314 | ||
| 1315 | const type_node = try t.transType(scope, param_qt, param_info.name_tok); | |
| 1316 | param_node.* = .{ | |
| 1317 | .is_noalias = is_noalias, | |
| 1318 | .name = param_name, | |
| 1319 | .type = type_node, | |
| 1320 | }; | |
| 1321 | } | |
| 1322 | ||
| 1323 | const linksection_string = blk: { | |
| 1324 | if (func_qt.getAttribute(t.comp, .section)) |section| { | |
| 1325 | break :blk t.comp.interner.get(section.name.ref()).bytes; | |
| 1326 | } | |
| 1327 | break :blk null; | |
| 1328 | }; | |
| 1329 | ||
| 1330 | const alignment: ?c_uint = func_qt.requestedAlignment(t.comp) orelse null; | |
| 1331 | ||
| 1332 | const explicit_callconv = if ((ctx.is_always_inline or ctx.is_export or ctx.is_extern) and ctx.cc == .c) null else ctx.cc; | |
| 1333 | ||
| 1334 | const return_type_node = blk: { | |
| 1335 | if (func_qt.getAttribute(t.comp, .noreturn) != null) { | |
| 1336 | break :blk ZigTag.noreturn_type.init(); | |
| 1337 | } else { | |
| 1338 | const return_qt = func_ty.return_type; | |
| 1339 | if (return_qt.is(t.comp, .void)) { | |
| 1340 | // convert primitive anyopaque to actual void (only for return type) | |
| 1341 | break :blk ZigTag.void_type.init(); | |
| 1342 | } else { | |
| 1343 | break :blk t.transType(scope, return_qt, source_loc) catch |err| switch (err) { | |
| 1344 | error.UnsupportedType => { | |
| 1345 | try t.warn(scope, source_loc, "unsupported function proto return type", .{}); | |
| 1346 | return err; | |
| 1347 | }, | |
| 1348 | error.OutOfMemory => |e| return e, | |
| 1349 | }; | |
| 1350 | } | |
| 1351 | } | |
| 1352 | }; | |
| 1353 | ||
| 1354 | const payload = try t.arena.create(ast.Payload.Func); | |
| 1355 | payload.* = .{ | |
| 1356 | .base = .{ .tag = .func }, | |
| 1357 | .data = .{ | |
| 1358 | .is_pub = ctx.is_pub, | |
| 1359 | .is_extern = ctx.is_extern, | |
| 1360 | .is_export = ctx.is_export, | |
| 1361 | .is_inline = ctx.is_always_inline, | |
| 1362 | .is_var_args = switch (func_ty.kind) { | |
| 1363 | .normal => false, | |
| 1364 | .variadic => true, | |
| 1365 | .old_style => !ctx.is_export and !ctx.is_always_inline and !ctx.has_body, | |
| 1366 | }, | |
| 1367 | .name = ctx.fn_name, | |
| 1368 | .linksection_string = linksection_string, | |
| 1369 | .explicit_callconv = explicit_callconv, | |
| 1370 | .params = fn_params, | |
| 1371 | .return_type = return_type_node, | |
| 1372 | .body = null, | |
| 1373 | .alignment = alignment, | |
| 1374 | }, | |
| 1375 | }; | |
| 1376 | return ZigNode.initPayload(&payload.base); | |
| 1377 | } | |
| 1378 | ||
| 1379 | /// Produces a Zig AST node by translating a Type, respecting the width, but modifying the signed-ness. | |
| 1380 | /// Asserts the type is an integer. | |
| 1381 | fn transTypeIntWidthOf(t: *Translator, qt: QualType, is_signed: bool) TypeError!ZigNode { | |
| 1382 | return ZigTag.type.create(t.arena, loop: switch (qt.base(t.comp).type) { | |
| 1383 | .int => |int_ty| switch (int_ty) { | |
| 1384 | .char, .schar, .uchar => if (is_signed) "i8" else "u8", | |
| 1385 | .short, .ushort => if (is_signed) "c_short" else "c_ushort", | |
| 1386 | .int, .uint => if (is_signed) "c_int" else "c_uint", | |
| 1387 | .long, .ulong => if (is_signed) "c_long" else "c_ulong", | |
| 1388 | .long_long, .ulong_long => if (is_signed) "c_longlong" else "c_ulonglong", | |
| 1389 | .int128, .uint128 => if (is_signed) "i128" else "u128", | |
| 1390 | }, | |
| 1391 | .bit_int => |bit_int_ty| try std.fmt.allocPrint(t.arena, "{s}{d}", .{ | |
| 1392 | if (is_signed) "i" else "u", | |
| 1393 | bit_int_ty.bits, | |
| 1394 | }), | |
| 1395 | .@"enum" => |enum_ty| blk: { | |
| 1396 | const tag_ty = enum_ty.tag orelse | |
| 1397 | break :blk if (is_signed) "c_int" else "c_uint"; | |
| 1398 | ||
| 1399 | continue :loop tag_ty.base(t.comp).type; | |
| 1400 | }, | |
| 1401 | else => unreachable, // only call this function when it has already been determined the type is int | |
| 1402 | }); | |
| 1403 | } | |
| 1404 | ||
| 1405 | fn transTypeInit( | |
| 1406 | t: *Translator, | |
| 1407 | scope: *Scope, | |
| 1408 | qt: QualType, | |
| 1409 | init: Node.Index, | |
| 1410 | source_loc: TokenIndex, | |
| 1411 | ) TypeError!ZigNode { | |
| 1412 | switch (init.get(t.tree)) { | |
| 1413 | .string_literal_expr => |literal| { | |
| 1414 | const elem_ty = try t.transType(scope, qt.childType(t.comp), source_loc); | |
| 1415 | ||
| 1416 | const string_lit_size = literal.qt.arrayLen(t.comp).?; | |
| 1417 | const array_size = qt.arrayLen(t.comp).?; | |
| 1418 | ||
| 1419 | if (array_size == string_lit_size) { | |
| 1420 | return ZigTag.null_sentinel_array_type.create(t.arena, .{ .len = array_size - 1, .elem_type = elem_ty }); | |
| 1421 | } else { | |
| 1422 | return ZigTag.array_type.create(t.arena, .{ .len = array_size, .elem_type = elem_ty }); | |
| 1423 | } | |
| 1424 | }, | |
| 1425 | else => {}, | |
| 1426 | } | |
| 1427 | return t.transType(scope, qt, source_loc); | |
| 1428 | } | |
| 1429 | ||
| 1430 | // ============ | |
| 1431 | // Type helpers | |
| 1432 | // ============ | |
| 1433 | ||
| 1434 | fn typeIsOpaque(t: *Translator, qt: QualType) bool { | |
| 1435 | return switch (qt.base(t.comp).type) { | |
| 1436 | .void => true, | |
| 1437 | .@"struct", .@"union" => |record_ty| { | |
| 1438 | if (record_ty.layout == null) return true; | |
| 1439 | for (record_ty.fields) |field| { | |
| 1440 | if (field.bit_width != .null) return true; | |
| 1441 | } | |
| 1442 | return false; | |
| 1443 | }, | |
| 1444 | else => false, | |
| 1445 | }; | |
| 1446 | } | |
| 1447 | ||
| 1448 | fn typeWasDemotedToOpaque(t: *Translator, qt: QualType) bool { | |
| 1449 | const base = qt.base(t.comp); | |
| 1450 | switch (base.type) { | |
| 1451 | .@"struct", .@"union" => |record_ty| { | |
| 1452 | if (t.opaque_demotes.contains(base.qt)) return true; | |
| 1453 | for (record_ty.fields) |field| { | |
| 1454 | if (t.typeWasDemotedToOpaque(field.qt)) return true; | |
| 1455 | } | |
| 1456 | return false; | |
| 1457 | }, | |
| 1458 | .@"enum" => return t.opaque_demotes.contains(base.qt), | |
| 1459 | else => return false, | |
| 1460 | } | |
| 1461 | } | |
| 1462 | ||
| 1463 | fn typeHasWrappingOverflow(t: *Translator, qt: QualType) bool { | |
| 1464 | if (t.signedness(qt) == .unsigned) { | |
| 1465 | // unsigned integer overflow wraps around. | |
| 1466 | return true; | |
| 1467 | } else { | |
| 1468 | // float, signed integer, and pointer overflow is undefined behavior. | |
| 1469 | return false; | |
| 1470 | } | |
| 1471 | } | |
| 1472 | ||
| 1473 | /// Signedness of type when translated to Zig. | |
| 1474 | /// Different from `QualType.signedness()` for `char` and enums. | |
| 1475 | /// Returns null for non-int types. | |
| 1476 | fn signedness(t: *Translator, qt: QualType) ?std.builtin.Signedness { | |
| 1477 | return loop: switch (qt.base(t.comp).type) { | |
| 1478 | .bool => .unsigned, | |
| 1479 | .bit_int => |bit_int| bit_int.signedness, | |
| 1480 | .int => |int_ty| switch (int_ty) { | |
| 1481 | .char => .unsigned, // Always translated as u8 | |
| 1482 | .schar, .short, .int, .long, .long_long, .int128 => .signed, | |
| 1483 | .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128 => .unsigned, | |
| 1484 | }, | |
| 1485 | .@"enum" => |enum_ty| { | |
| 1486 | const tag_qt = enum_ty.tag orelse return .signed; | |
| 1487 | continue :loop tag_qt.base(t.comp).type; | |
| 1488 | }, | |
| 1489 | else => return null, | |
| 1490 | }; | |
| 1491 | } | |
| 1492 | ||
| 1493 | // ===================== | |
| 1494 | // Statement translation | |
| 1495 | // ===================== | |
| 1496 | ||
| 1497 | fn transStmt(t: *Translator, scope: *Scope, stmt: Node.Index) TransError!ZigNode { | |
| 1498 | switch (stmt.get(t.tree)) { | |
| 1499 | .compound_stmt => |compound| { | |
| 1500 | return t.transCompoundStmt(scope, compound); | |
| 1501 | }, | |
| 1502 | .static_assert => |static_assert| { | |
| 1503 | try t.transStaticAssert(scope, static_assert); | |
| 1504 | return ZigTag.declaration.init(); | |
| 1505 | }, | |
| 1506 | .return_stmt => |return_stmt| return t.transReturnStmt(scope, return_stmt), | |
| 1507 | .null_stmt => return ZigTag.empty_block.init(), | |
| 1508 | .if_stmt => |if_stmt| return t.transIfStmt(scope, if_stmt), | |
| 1509 | .while_stmt => |while_stmt| return t.transWhileStmt(scope, while_stmt), | |
| 1510 | .do_while_stmt => |do_while_stmt| return t.transDoWhileStmt(scope, do_while_stmt), | |
| 1511 | .for_stmt => |for_stmt| return t.transForStmt(scope, for_stmt), | |
| 1512 | .continue_stmt => return ZigTag.@"continue".init(), | |
| 1513 | .break_stmt => return ZigTag.@"break".init(), | |
| 1514 | .typedef => |typedef_decl| { | |
| 1515 | assert(!typedef_decl.implicit); | |
| 1516 | try t.transTypeDef(scope, stmt); | |
| 1517 | return ZigTag.declaration.init(); | |
| 1518 | }, | |
| 1519 | .struct_decl, .union_decl => |record_decl| { | |
| 1520 | try t.transRecordDecl(scope, record_decl.container_qt); | |
| 1521 | return ZigTag.declaration.init(); | |
| 1522 | }, | |
| 1523 | .enum_decl => |enum_decl| { | |
| 1524 | try t.transEnumDecl(scope, enum_decl.container_qt); | |
| 1525 | return ZigTag.declaration.init(); | |
| 1526 | }, | |
| 1527 | .function => |function| { | |
| 1528 | try t.transFnDecl(scope, function); | |
| 1529 | return ZigTag.declaration.init(); | |
| 1530 | }, | |
| 1531 | .variable => |variable| { | |
| 1532 | try t.transVarDecl(scope, variable); | |
| 1533 | return ZigTag.declaration.init(); | |
| 1534 | }, | |
| 1535 | .switch_stmt => |switch_stmt| return t.transSwitch(scope, switch_stmt), | |
| 1536 | .case_stmt, .default_stmt => { | |
| 1537 | return t.fail(error.UnsupportedTranslation, stmt.tok(t.tree), "TODO complex switch", .{}); | |
| 1538 | }, | |
| 1539 | .goto_stmt, .computed_goto_stmt, .labeled_stmt => { | |
| 1540 | return t.fail(error.UnsupportedTranslation, stmt.tok(t.tree), "TODO goto", .{}); | |
| 1541 | }, | |
| 1542 | else => return t.transExprCoercing(scope, stmt, .unused), | |
| 1543 | } | |
| 1544 | } | |
| 1545 | ||
| 1546 | fn transCompoundStmtInline(t: *Translator, compound: Node.CompoundStmt, block: *Scope.Block) TransError!void { | |
| 1547 | for (compound.body) |stmt| { | |
| 1548 | const result = try t.transStmt(&block.base, stmt); | |
| 1549 | switch (result.tag()) { | |
| 1550 | .declaration, .empty_block => {}, | |
| 1551 | else => try block.statements.append(t.gpa, result), | |
| 1552 | } | |
| 1553 | } | |
| 1554 | } | |
| 1555 | ||
| 1556 | fn transCompoundStmt(t: *Translator, scope: *Scope, compound: Node.CompoundStmt) TransError!ZigNode { | |
| 1557 | var block_scope = try Scope.Block.init(t, scope, false); | |
| 1558 | defer block_scope.deinit(); | |
| 1559 | try t.transCompoundStmtInline(compound, &block_scope); | |
| 1560 | return try block_scope.complete(); | |
| 1561 | } | |
| 1562 | ||
| 1563 | fn transReturnStmt(t: *Translator, scope: *Scope, return_stmt: Node.ReturnStmt) TransError!ZigNode { | |
| 1564 | switch (return_stmt.operand) { | |
| 1565 | .none => return ZigTag.return_void.init(), | |
| 1566 | .expr => |operand| { | |
| 1567 | var rhs = try t.transExprCoercing(scope, operand, .used); | |
| 1568 | const return_qt = scope.findBlockReturnType(); | |
| 1569 | if (rhs.isBoolRes() and !return_qt.is(t.comp, .bool)) { | |
| 1570 | rhs = try ZigTag.int_from_bool.create(t.arena, rhs); | |
| 1571 | } | |
| 1572 | return ZigTag.@"return".create(t.arena, rhs); | |
| 1573 | }, | |
| 1574 | .implicit => |zero| { | |
| 1575 | if (zero) return ZigTag.@"return".create(t.arena, ZigTag.zero_literal.init()); | |
| 1576 | ||
| 1577 | const return_qt = scope.findBlockReturnType(); | |
| 1578 | if (return_qt.is(t.comp, .void)) return ZigTag.empty_block.init(); | |
| 1579 | ||
| 1580 | return ZigTag.@"return".create(t.arena, ZigTag.undefined_literal.init()); | |
| 1581 | }, | |
| 1582 | } | |
| 1583 | } | |
| 1584 | ||
| 1585 | /// If a statement can possibly translate to a Zig assignment (either directly because it's | |
| 1586 | /// an assignment in C or indirectly via result assignment to `_`) AND it's the sole statement | |
| 1587 | /// in the body of an if statement or loop, then we need to put the statement into its own block. | |
| 1588 | /// The `else` case here corresponds to statements that could result in an assignment. If a statement | |
| 1589 | /// class never needs a block, add its enum to the top prong. | |
| 1590 | fn maybeBlockify(t: *Translator, scope: *Scope, stmt: Node.Index) TransError!ZigNode { | |
| 1591 | switch (stmt.get(t.tree)) { | |
| 1592 | .break_stmt, | |
| 1593 | .continue_stmt, | |
| 1594 | .compound_stmt, | |
| 1595 | .decl_ref_expr, | |
| 1596 | .enumeration_ref, | |
| 1597 | .do_while_stmt, | |
| 1598 | .for_stmt, | |
| 1599 | .if_stmt, | |
| 1600 | .return_stmt, | |
| 1601 | .null_stmt, | |
| 1602 | .while_stmt, | |
| 1603 | => return t.transStmt(scope, stmt), | |
| 1604 | else => return t.blockify(scope, stmt), | |
| 1605 | } | |
| 1606 | } | |
| 1607 | ||
| 1608 | /// Translate statement and place it in its own block. | |
| 1609 | fn blockify(t: *Translator, scope: *Scope, stmt: Node.Index) TransError!ZigNode { | |
| 1610 | var block_scope = try Scope.Block.init(t, scope, false); | |
| 1611 | defer block_scope.deinit(); | |
| 1612 | const result = try t.transStmt(&block_scope.base, stmt); | |
| 1613 | try block_scope.statements.append(t.gpa, result); | |
| 1614 | return block_scope.complete(); | |
| 1615 | } | |
| 1616 | ||
| 1617 | fn transIfStmt(t: *Translator, scope: *Scope, if_stmt: Node.IfStmt) TransError!ZigNode { | |
| 1618 | var cond_scope: Scope.Condition = .{ | |
| 1619 | .base = .{ | |
| 1620 | .parent = scope, | |
| 1621 | .id = .condition, | |
| 1622 | }, | |
| 1623 | }; | |
| 1624 | defer cond_scope.deinit(); | |
| 1625 | const cond = try t.transBoolExpr(&cond_scope.base, if_stmt.cond); | |
| 1626 | ||
| 1627 | // block needed to keep else statement from attaching to inner while | |
| 1628 | const must_blockify = (if_stmt.else_body != null) and switch (if_stmt.then_body.get(t.tree)) { | |
| 1629 | .while_stmt, .do_while_stmt, .for_stmt => true, | |
| 1630 | else => false, | |
| 1631 | }; | |
| 1632 | ||
| 1633 | const then_node = if (must_blockify) | |
| 1634 | try t.blockify(scope, if_stmt.then_body) | |
| 1635 | else | |
| 1636 | try t.maybeBlockify(scope, if_stmt.then_body); | |
| 1637 | ||
| 1638 | const else_node = if (if_stmt.else_body) |stmt| | |
| 1639 | try t.maybeBlockify(scope, stmt) | |
| 1640 | else | |
| 1641 | null; | |
| 1642 | return ZigTag.@"if".create(t.arena, .{ .cond = cond, .then = then_node, .@"else" = else_node }); | |
| 1643 | } | |
| 1644 | ||
| 1645 | fn transWhileStmt(t: *Translator, scope: *Scope, while_stmt: Node.WhileStmt) TransError!ZigNode { | |
| 1646 | var cond_scope: Scope.Condition = .{ | |
| 1647 | .base = .{ | |
| 1648 | .parent = scope, | |
| 1649 | .id = .condition, | |
| 1650 | }, | |
| 1651 | }; | |
| 1652 | defer cond_scope.deinit(); | |
| 1653 | const cond = try t.transBoolExpr(&cond_scope.base, while_stmt.cond); | |
| 1654 | ||
| 1655 | var loop_scope: Scope = .{ | |
| 1656 | .parent = scope, | |
| 1657 | .id = .loop, | |
| 1658 | }; | |
| 1659 | const body = try t.maybeBlockify(&loop_scope, while_stmt.body); | |
| 1660 | return ZigTag.@"while".create(t.arena, .{ .cond = cond, .body = body, .cont_expr = null }); | |
| 1661 | } | |
| 1662 | ||
| 1663 | fn transDoWhileStmt(t: *Translator, scope: *Scope, do_stmt: Node.DoWhileStmt) TransError!ZigNode { | |
| 1664 | var loop_scope: Scope = .{ | |
| 1665 | .parent = scope, | |
| 1666 | .id = .do_loop, | |
| 1667 | }; | |
| 1668 | ||
| 1669 | // if (!cond) break; | |
| 1670 | var cond_scope: Scope.Condition = .{ | |
| 1671 | .base = .{ | |
| 1672 | .parent = scope, | |
| 1673 | .id = .condition, | |
| 1674 | }, | |
| 1675 | }; | |
| 1676 | defer cond_scope.deinit(); | |
| 1677 | const cond = try t.transBoolExpr(&cond_scope.base, do_stmt.cond); | |
| 1678 | const if_not_break = switch (cond.tag()) { | |
| 1679 | .true_literal => { | |
| 1680 | const body_node = try t.maybeBlockify(scope, do_stmt.body); | |
| 1681 | return ZigTag.while_true.create(t.arena, body_node); | |
| 1682 | }, | |
| 1683 | else => try ZigTag.if_not_break.create(t.arena, cond), | |
| 1684 | }; | |
| 1685 | ||
| 1686 | var body_node = try t.transStmt(&loop_scope, do_stmt.body); | |
| 1687 | if (body_node.isNoreturn(true)) { | |
| 1688 | // The body node ends in a noreturn statement. Simply put it in a while (true) | |
| 1689 | // in case it contains breaks or continues. | |
| 1690 | } else if (do_stmt.body.get(t.tree) == .compound_stmt) { | |
| 1691 | // there's already a block in C, so we'll append our condition to it. | |
| 1692 | // c: do { | |
| 1693 | // c: a; | |
| 1694 | // c: b; | |
| 1695 | // c: } while(c); | |
| 1696 | // zig: while (true) { | |
| 1697 | // zig: a; | |
| 1698 | // zig: b; | |
| 1699 | // zig: if (!cond) break; | |
| 1700 | // zig: } | |
| 1701 | const block = body_node.castTag(.block).?; | |
| 1702 | block.data.stmts.len += 1; // This is safe since we reserve one extra space in Scope.Block.complete. | |
| 1703 | block.data.stmts[block.data.stmts.len - 1] = if_not_break; | |
| 1704 | } else { | |
| 1705 | // the C statement is without a block, so we need to create a block to contain it. | |
| 1706 | // c: do | |
| 1707 | // c: a; | |
| 1708 | // c: while(c); | |
| 1709 | // zig: while (true) { | |
| 1710 | // zig: a; | |
| 1711 | // zig: if (!cond) break; | |
| 1712 | // zig: } | |
| 1713 | const statements = try t.arena.alloc(ZigNode, 2); | |
| 1714 | statements[0] = body_node; | |
| 1715 | statements[1] = if_not_break; | |
| 1716 | body_node = try ZigTag.block.create(t.arena, .{ .label = null, .stmts = statements }); | |
| 1717 | } | |
| 1718 | return ZigTag.while_true.create(t.arena, body_node); | |
| 1719 | } | |
| 1720 | ||
| 1721 | fn transForStmt(t: *Translator, scope: *Scope, for_stmt: Node.ForStmt) TransError!ZigNode { | |
| 1722 | var loop_scope: Scope = .{ | |
| 1723 | .parent = scope, | |
| 1724 | .id = .loop, | |
| 1725 | }; | |
| 1726 | ||
| 1727 | var block_scope: ?Scope.Block = null; | |
| 1728 | defer if (block_scope) |*bs| bs.deinit(); | |
| 1729 | ||
| 1730 | switch (for_stmt.init) { | |
| 1731 | .decls => |decls| { | |
| 1732 | block_scope = try Scope.Block.init(t, scope, false); | |
| 1733 | loop_scope.parent = &block_scope.?.base; | |
| 1734 | for (decls) |decl| { | |
| 1735 | try t.transDecl(&block_scope.?.base, decl); | |
| 1736 | } | |
| 1737 | }, | |
| 1738 | .expr => |maybe_init| if (maybe_init) |init| { | |
| 1739 | block_scope = try Scope.Block.init(t, scope, false); | |
| 1740 | loop_scope.parent = &block_scope.?.base; | |
| 1741 | const init_node = try t.transStmt(&block_scope.?.base, init); | |
| 1742 | try loop_scope.appendNode(init_node); | |
| 1743 | }, | |
| 1744 | } | |
| 1745 | var cond_scope: Scope.Condition = .{ | |
| 1746 | .base = .{ | |
| 1747 | .parent = &loop_scope, | |
| 1748 | .id = .condition, | |
| 1749 | }, | |
| 1750 | }; | |
| 1751 | defer cond_scope.deinit(); | |
| 1752 | ||
| 1753 | const cond = if (for_stmt.cond) |cond| | |
| 1754 | try t.transBoolExpr(&cond_scope.base, cond) | |
| 1755 | else | |
| 1756 | ZigTag.true_literal.init(); | |
| 1757 | ||
| 1758 | const cont_expr = if (for_stmt.incr) |incr| | |
| 1759 | try t.transExpr(&cond_scope.base, incr, .unused) | |
| 1760 | else | |
| 1761 | null; | |
| 1762 | ||
| 1763 | const body = try t.maybeBlockify(&loop_scope, for_stmt.body); | |
| 1764 | const while_node = try ZigTag.@"while".create(t.arena, .{ .cond = cond, .body = body, .cont_expr = cont_expr }); | |
| 1765 | if (block_scope) |*bs| { | |
| 1766 | try bs.statements.append(t.gpa, while_node); | |
| 1767 | return try bs.complete(); | |
| 1768 | } else { | |
| 1769 | return while_node; | |
| 1770 | } | |
| 1771 | } | |
| 1772 | ||
| 1773 | fn transSwitch(t: *Translator, scope: *Scope, switch_stmt: Node.SwitchStmt) TransError!ZigNode { | |
| 1774 | var loop_scope: Scope = .{ | |
| 1775 | .parent = scope, | |
| 1776 | .id = .loop, | |
| 1777 | }; | |
| 1778 | ||
| 1779 | var block_scope = try Scope.Block.init(t, &loop_scope, false); | |
| 1780 | defer block_scope.deinit(); | |
| 1781 | ||
| 1782 | const base_scope = &block_scope.base; | |
| 1783 | ||
| 1784 | var cond_scope: Scope.Condition = .{ | |
| 1785 | .base = .{ | |
| 1786 | .parent = base_scope, | |
| 1787 | .id = .condition, | |
| 1788 | }, | |
| 1789 | }; | |
| 1790 | defer cond_scope.deinit(); | |
| 1791 | const switch_expr = try t.transExpr(&cond_scope.base, switch_stmt.cond, .used); | |
| 1792 | ||
| 1793 | var cases: std.ArrayList(ZigNode) = .empty; | |
| 1794 | defer cases.deinit(t.gpa); | |
| 1795 | var has_default = false; | |
| 1796 | ||
| 1797 | const body_node = switch_stmt.body.get(t.tree); | |
| 1798 | if (body_node != .compound_stmt) { | |
| 1799 | return t.fail(error.UnsupportedTranslation, switch_stmt.switch_tok, "TODO complex switch", .{}); | |
| 1800 | } | |
| 1801 | const body = body_node.compound_stmt.body; | |
| 1802 | // Iterate over switch body and collect all cases. | |
| 1803 | // Fallthrough is handled by duplicating statements. | |
| 1804 | for (body, 0..) |stmt, i| { | |
| 1805 | switch (stmt.get(t.tree)) { | |
| 1806 | .case_stmt => { | |
| 1807 | var items: std.ArrayList(ZigNode) = .empty; | |
| 1808 | defer items.deinit(t.gpa); | |
| 1809 | const sub = try t.transCaseStmt(base_scope, stmt, &items); | |
| 1810 | const res = try t.transSwitchProngStmt(base_scope, sub, body[i..]); | |
| 1811 | ||
| 1812 | if (items.items.len == 0) { | |
| 1813 | has_default = true; | |
| 1814 | const switch_else = try ZigTag.switch_else.create(t.arena, res); | |
| 1815 | try cases.append(t.gpa, switch_else); | |
| 1816 | } else { | |
| 1817 | const switch_prong = try ZigTag.switch_prong.create(t.arena, .{ | |
| 1818 | .cases = try t.arena.dupe(ZigNode, items.items), | |
| 1819 | .cond = res, | |
| 1820 | }); | |
| 1821 | try cases.append(t.gpa, switch_prong); | |
| 1822 | } | |
| 1823 | }, | |
| 1824 | .default_stmt => |default_stmt| { | |
| 1825 | has_default = true; | |
| 1826 | ||
| 1827 | var sub = default_stmt.body; | |
| 1828 | while (true) switch (sub.get(t.tree)) { | |
| 1829 | .case_stmt => |sub_case| sub = sub_case.body, | |
| 1830 | .default_stmt => |sub_default| sub = sub_default.body, | |
| 1831 | else => break, | |
| 1832 | }; | |
| 1833 | ||
| 1834 | const res = try t.transSwitchProngStmt(base_scope, sub, body[i..]); | |
| 1835 | ||
| 1836 | const switch_else = try ZigTag.switch_else.create(t.arena, res); | |
| 1837 | try cases.append(t.gpa, switch_else); | |
| 1838 | }, | |
| 1839 | else => {}, // collected in transSwitchProngStmt | |
| 1840 | } | |
| 1841 | } | |
| 1842 | ||
| 1843 | if (!has_default) { | |
| 1844 | const else_prong = try ZigTag.switch_else.create(t.arena, ZigTag.empty_block.init()); | |
| 1845 | try cases.append(t.gpa, else_prong); | |
| 1846 | } | |
| 1847 | ||
| 1848 | const switch_node = try ZigTag.@"switch".create(t.arena, .{ | |
| 1849 | .cond = switch_expr, | |
| 1850 | .cases = try t.arena.dupe(ZigNode, cases.items), | |
| 1851 | }); | |
| 1852 | try block_scope.statements.append(t.gpa, switch_node); | |
| 1853 | try block_scope.statements.append(t.gpa, ZigTag.@"break".init()); | |
| 1854 | const while_body = try block_scope.complete(); | |
| 1855 | ||
| 1856 | return ZigTag.while_true.create(t.arena, while_body); | |
| 1857 | } | |
| 1858 | ||
| 1859 | /// Collects all items for this case, returns the first statement after the labels. | |
| 1860 | /// If items ends up empty, the prong should be translated as an else. | |
| 1861 | fn transCaseStmt( | |
| 1862 | t: *Translator, | |
| 1863 | scope: *Scope, | |
| 1864 | stmt: Node.Index, | |
| 1865 | items: *std.ArrayList(ZigNode), | |
| 1866 | ) TransError!Node.Index { | |
| 1867 | var sub = stmt; | |
| 1868 | var seen_default = false; | |
| 1869 | while (true) { | |
| 1870 | switch (sub.get(t.tree)) { | |
| 1871 | .default_stmt => |default_stmt| { | |
| 1872 | seen_default = true; | |
| 1873 | items.items.len = 0; | |
| 1874 | sub = default_stmt.body; | |
| 1875 | }, | |
| 1876 | .case_stmt => |case_stmt| { | |
| 1877 | if (seen_default) { | |
| 1878 | items.items.len = 0; | |
| 1879 | sub = case_stmt.body; | |
| 1880 | continue; | |
| 1881 | } | |
| 1882 | ||
| 1883 | const expr = if (case_stmt.end) |end| blk: { | |
| 1884 | const start_node = try t.transExpr(scope, case_stmt.start, .used); | |
| 1885 | const end_node = try t.transExpr(scope, end, .used); | |
| 1886 | ||
| 1887 | break :blk try ZigTag.ellipsis3.create(t.arena, .{ .lhs = start_node, .rhs = end_node }); | |
| 1888 | } else try t.transExpr(scope, case_stmt.start, .used); | |
| 1889 | ||
| 1890 | try items.append(t.gpa, expr); | |
| 1891 | sub = case_stmt.body; | |
| 1892 | }, | |
| 1893 | else => return sub, | |
| 1894 | } | |
| 1895 | } | |
| 1896 | } | |
| 1897 | ||
| 1898 | /// Collects all statements seen by this case into a block. | |
| 1899 | /// Avoids creating a block if the first statement is a break or return. | |
| 1900 | fn transSwitchProngStmt( | |
| 1901 | t: *Translator, | |
| 1902 | scope: *Scope, | |
| 1903 | stmt: Node.Index, | |
| 1904 | body: []const Node.Index, | |
| 1905 | ) TransError!ZigNode { | |
| 1906 | switch (stmt.get(t.tree)) { | |
| 1907 | .break_stmt => return ZigTag.@"break".init(), | |
| 1908 | .return_stmt => return t.transStmt(scope, stmt), | |
| 1909 | .case_stmt, .default_stmt => unreachable, | |
| 1910 | else => { | |
| 1911 | var block_scope = try Scope.Block.init(t, scope, false); | |
| 1912 | defer block_scope.deinit(); | |
| 1913 | ||
| 1914 | // we do not need to translate `stmt` since it is the first stmt of `body` | |
| 1915 | try t.transSwitchProngStmtInline(&block_scope, body); | |
| 1916 | return try block_scope.complete(); | |
| 1917 | }, | |
| 1918 | } | |
| 1919 | } | |
| 1920 | ||
| 1921 | /// Collects all statements seen by this case into a block. | |
| 1922 | fn transSwitchProngStmtInline( | |
| 1923 | t: *Translator, | |
| 1924 | block: *Scope.Block, | |
| 1925 | body: []const Node.Index, | |
| 1926 | ) TransError!void { | |
| 1927 | for (body) |stmt| { | |
| 1928 | switch (stmt.get(t.tree)) { | |
| 1929 | .return_stmt => { | |
| 1930 | const result = try t.transStmt(&block.base, stmt); | |
| 1931 | try block.statements.append(t.gpa, result); | |
| 1932 | return; | |
| 1933 | }, | |
| 1934 | .break_stmt => { | |
| 1935 | try block.statements.append(t.gpa, ZigTag.@"break".init()); | |
| 1936 | return; | |
| 1937 | }, | |
| 1938 | .case_stmt => |case_stmt| { | |
| 1939 | var sub = case_stmt.body; | |
| 1940 | while (true) switch (sub.get(t.tree)) { | |
| 1941 | .case_stmt => |sub_case| sub = sub_case.body, | |
| 1942 | .default_stmt => |sub_default| sub = sub_default.body, | |
| 1943 | else => break, | |
| 1944 | }; | |
| 1945 | const result = try t.transStmt(&block.base, sub); | |
| 1946 | assert(result.tag() != .declaration); | |
| 1947 | try block.statements.append(t.gpa, result); | |
| 1948 | if (result.isNoreturn(true)) return; | |
| 1949 | }, | |
| 1950 | .default_stmt => |default_stmt| { | |
| 1951 | var sub = default_stmt.body; | |
| 1952 | while (true) switch (sub.get(t.tree)) { | |
| 1953 | .case_stmt => |sub_case| sub = sub_case.body, | |
| 1954 | .default_stmt => |sub_default| sub = sub_default.body, | |
| 1955 | else => break, | |
| 1956 | }; | |
| 1957 | const result = try t.transStmt(&block.base, sub); | |
| 1958 | assert(result.tag() != .declaration); | |
| 1959 | try block.statements.append(t.gpa, result); | |
| 1960 | if (result.isNoreturn(true)) return; | |
| 1961 | }, | |
| 1962 | .compound_stmt => |compound_stmt| { | |
| 1963 | const result = try t.transCompoundStmt(&block.base, compound_stmt); | |
| 1964 | try block.statements.append(t.gpa, result); | |
| 1965 | if (result.isNoreturn(true)) return; | |
| 1966 | }, | |
| 1967 | else => { | |
| 1968 | const result = try t.transStmt(&block.base, stmt); | |
| 1969 | switch (result.tag()) { | |
| 1970 | .declaration, .empty_block => {}, | |
| 1971 | else => try block.statements.append(t.gpa, result), | |
| 1972 | } | |
| 1973 | }, | |
| 1974 | } | |
| 1975 | } | |
| 1976 | } | |
| 1977 | ||
| 1978 | // ====================== | |
| 1979 | // Expression translation | |
| 1980 | // ====================== | |
| 1981 | ||
| 1982 | const ResultUsed = enum { used, unused }; | |
| 1983 | ||
| 1984 | fn transExpr(t: *Translator, scope: *Scope, expr: Node.Index, used: ResultUsed) TransError!ZigNode { | |
| 1985 | const qt = expr.qt(t.tree); | |
| 1986 | return t.maybeSuppressResult(used, switch (expr.get(t.tree)) { | |
| 1987 | .paren_expr => |paren_expr| { | |
| 1988 | return t.transExpr(scope, paren_expr.operand, used); | |
| 1989 | }, | |
| 1990 | .cast => |cast| return t.transCastExpr(scope, cast, cast.qt, used, .with_as), | |
| 1991 | .decl_ref_expr => |decl_ref| try t.transDeclRefExpr(scope, decl_ref), | |
| 1992 | .enumeration_ref => |enum_ref| try t.transDeclRefExpr(scope, enum_ref), | |
| 1993 | .addr_of_expr => |addr_of_expr| try ZigTag.address_of.create(t.arena, try t.transExpr(scope, addr_of_expr.operand, .used)), | |
| 1994 | .deref_expr => |deref_expr| res: { | |
| 1995 | if (t.typeWasDemotedToOpaque(qt)) | |
| 1996 | return t.fail(error.UnsupportedTranslation, deref_expr.op_tok, "cannot dereference opaque type", .{}); | |
| 1997 | ||
| 1998 | // Dereferencing a function pointer is a no-op. | |
| 1999 | if (qt.is(t.comp, .func)) return t.transExpr(scope, deref_expr.operand, used); | |
| 2000 | ||
| 2001 | break :res try ZigTag.deref.create(t.arena, try t.transExpr(scope, deref_expr.operand, .used)); | |
| 2002 | }, | |
| 2003 | .bool_not_expr => |bool_not_expr| try ZigTag.not.create(t.arena, try t.transBoolExpr(scope, bool_not_expr.operand)), | |
| 2004 | .bit_not_expr => |bit_not_expr| try ZigTag.bit_not.create(t.arena, try t.transExpr(scope, bit_not_expr.operand, .used)), | |
| 2005 | .plus_expr => |plus_expr| return t.transExpr(scope, plus_expr.operand, used), | |
| 2006 | .negate_expr => |negate_expr| res: { | |
| 2007 | const operand_qt = negate_expr.operand.qt(t.tree); | |
| 2008 | if (!t.typeHasWrappingOverflow(operand_qt)) { | |
| 2009 | const sub_expr_node = try t.transExpr(scope, negate_expr.operand, .used); | |
| 2010 | const to_negate = if (sub_expr_node.isBoolRes()) blk: { | |
| 2011 | const ty_node = try ZigTag.type.create(t.arena, "c_int"); | |
| 2012 | const int_node = try ZigTag.int_from_bool.create(t.arena, sub_expr_node); | |
| 2013 | break :blk try ZigTag.as.create(t.arena, .{ .lhs = ty_node, .rhs = int_node }); | |
| 2014 | } else sub_expr_node; | |
| 2015 | ||
| 2016 | break :res try ZigTag.negate.create(t.arena, to_negate); | |
| 2017 | } else if (t.signedness(operand_qt) == .unsigned) { | |
| 2018 | // use -% x for unsigned integers | |
| 2019 | break :res try ZigTag.negate_wrap.create(t.arena, try t.transExpr(scope, negate_expr.operand, .used)); | |
| 2020 | } else return t.fail(error.UnsupportedTranslation, negate_expr.op_tok, "C negation with non float non integer", .{}); | |
| 2021 | }, | |
| 2022 | .div_expr => |div_expr| res: { | |
| 2023 | if (qt.isInt(t.comp) and t.signedness(qt) == .signed) { | |
| 2024 | // signed integer division uses @divTrunc | |
| 2025 | const lhs = try t.transExpr(scope, div_expr.lhs, .used); | |
| 2026 | const rhs = try t.transExpr(scope, div_expr.rhs, .used); | |
| 2027 | break :res try ZigTag.div_trunc.create(t.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 2028 | } | |
| 2029 | // unsigned/float division uses the operator | |
| 2030 | break :res try t.transBinExpr(scope, div_expr, .div); | |
| 2031 | }, | |
| 2032 | .mod_expr => |mod_expr| res: { | |
| 2033 | if (qt.isInt(t.comp) and t.signedness(qt) == .signed) { | |
| 2034 | // signed integer remainder uses __helpers.signedRemainder | |
| 2035 | const lhs = try t.transExpr(scope, mod_expr.lhs, .used); | |
| 2036 | const rhs = try t.transExpr(scope, mod_expr.rhs, .used); | |
| 2037 | break :res try t.createHelperCallNode(.signedRemainder, &.{ lhs, rhs }); | |
| 2038 | } | |
| 2039 | // unsigned/float division uses the operator | |
| 2040 | break :res try t.transBinExpr(scope, mod_expr, .mod); | |
| 2041 | }, | |
| 2042 | .add_expr => |add_expr| res: { | |
| 2043 | // `ptr + idx` and `idx + ptr` -> ptr + @as(usize, @bitCast(@as(isize, @intCast(idx)))) | |
| 2044 | const lhs_qt = add_expr.lhs.qt(t.tree); | |
| 2045 | const rhs_qt = add_expr.rhs.qt(t.tree); | |
| 2046 | if (qt.isPointer(t.comp) and (t.signedness(lhs_qt) == .signed or | |
| 2047 | t.signedness(rhs_qt) == .signed)) | |
| 2048 | { | |
| 2049 | break :res try t.transPointerArithmeticSignedOp(scope, add_expr, .add); | |
| 2050 | } | |
| 2051 | ||
| 2052 | if (t.signedness(qt) == .unsigned) { | |
| 2053 | break :res try t.transBinExpr(scope, add_expr, .add_wrap); | |
| 2054 | } else { | |
| 2055 | break :res try t.transBinExpr(scope, add_expr, .add); | |
| 2056 | } | |
| 2057 | }, | |
| 2058 | .sub_expr => |sub_expr| res: { | |
| 2059 | // `ptr - idx` -> ptr - @as(usize, @bitCast(@as(isize, @intCast(idx)))) | |
| 2060 | const lhs_qt = sub_expr.lhs.qt(t.tree); | |
| 2061 | const rhs_qt = sub_expr.rhs.qt(t.tree); | |
| 2062 | if (qt.isPointer(t.comp) and (t.signedness(lhs_qt) == .signed or | |
| 2063 | t.signedness(rhs_qt) == .signed)) | |
| 2064 | { | |
| 2065 | break :res try t.transPointerArithmeticSignedOp(scope, sub_expr, .sub); | |
| 2066 | } | |
| 2067 | ||
| 2068 | if (sub_expr.lhs.qt(t.tree).isPointer(t.comp) and sub_expr.rhs.qt(t.tree).isPointer(t.comp)) { | |
| 2069 | break :res try t.transPtrDiffExpr(scope, sub_expr); | |
| 2070 | } else if (t.signedness(qt) == .unsigned) { | |
| 2071 | break :res try t.transBinExpr(scope, sub_expr, .sub_wrap); | |
| 2072 | } else { | |
| 2073 | break :res try t.transBinExpr(scope, sub_expr, .sub); | |
| 2074 | } | |
| 2075 | }, | |
| 2076 | .mul_expr => |mul_expr| if (t.signedness(qt) == .unsigned) | |
| 2077 | try t.transBinExpr(scope, mul_expr, .mul_wrap) | |
| 2078 | else | |
| 2079 | try t.transBinExpr(scope, mul_expr, .mul), | |
| 2080 | ||
| 2081 | .less_than_expr => |lt| try t.transBinExpr(scope, lt, .less_than), | |
| 2082 | .greater_than_expr => |gt| try t.transBinExpr(scope, gt, .greater_than), | |
| 2083 | .less_than_equal_expr => |lte| try t.transBinExpr(scope, lte, .less_than_equal), | |
| 2084 | .greater_than_equal_expr => |gte| try t.transBinExpr(scope, gte, .greater_than_equal), | |
| 2085 | .equal_expr => |equal_expr| try t.transBinExpr(scope, equal_expr, .equal), | |
| 2086 | .not_equal_expr => |not_equal_expr| try t.transBinExpr(scope, not_equal_expr, .not_equal), | |
| 2087 | ||
| 2088 | .bool_and_expr => |bool_and_expr| try t.transBoolBinExpr(scope, bool_and_expr, .@"and"), | |
| 2089 | .bool_or_expr => |bool_or_expr| try t.transBoolBinExpr(scope, bool_or_expr, .@"or"), | |
| 2090 | ||
| 2091 | .bit_and_expr => |bit_and_expr| try t.transBinExpr(scope, bit_and_expr, .bit_and), | |
| 2092 | .bit_or_expr => |bit_or_expr| try t.transBinExpr(scope, bit_or_expr, .bit_or), | |
| 2093 | .bit_xor_expr => |bit_xor_expr| try t.transBinExpr(scope, bit_xor_expr, .bit_xor), | |
| 2094 | ||
| 2095 | .shl_expr => |shl_expr| try t.transShiftExpr(scope, shl_expr, .shl), | |
| 2096 | .shr_expr => |shr_expr| try t.transShiftExpr(scope, shr_expr, .shr), | |
| 2097 | ||
| 2098 | .member_access_expr => |member_access| try t.transMemberAccess(scope, .normal, member_access, null), | |
| 2099 | .member_access_ptr_expr => |member_access| try t.transMemberAccess(scope, .ptr, member_access, null), | |
| 2100 | .array_access_expr => |array_access| try t.transArrayAccess(scope, array_access, null), | |
| 2101 | ||
| 2102 | .builtin_ref => unreachable, | |
| 2103 | .builtin_call_expr => |call| return t.transBuiltinCall(scope, call, used), | |
| 2104 | .call_expr => |call| return t.transCall(scope, call, used), | |
| 2105 | ||
| 2106 | .builtin_types_compatible_p => |compatible| blk: { | |
| 2107 | const lhs = try t.transType(scope, compatible.lhs, compatible.builtin_tok); | |
| 2108 | const rhs = try t.transType(scope, compatible.rhs, compatible.builtin_tok); | |
| 2109 | ||
| 2110 | break :blk try ZigTag.equal.create(t.arena, .{ | |
| 2111 | .lhs = lhs, | |
| 2112 | .rhs = rhs, | |
| 2113 | }); | |
| 2114 | }, | |
| 2115 | .builtin_choose_expr => |choose| return t.transCondExpr(scope, choose, used), | |
| 2116 | .cond_expr => |cond_expr| return t.transCondExpr(scope, cond_expr, used), | |
| 2117 | .binary_cond_expr => |conditional| return t.transBinaryCondExpr(scope, conditional, used), | |
| 2118 | .cond_dummy_expr => unreachable, | |
| 2119 | ||
| 2120 | .assign_expr => |assign| return t.transAssignExpr(scope, assign, used), | |
| 2121 | .add_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2122 | .sub_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2123 | .mul_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2124 | .div_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2125 | .mod_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2126 | .shl_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2127 | .shr_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2128 | .bit_and_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2129 | .bit_xor_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2130 | .bit_or_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), | |
| 2131 | .compound_assign_dummy_expr => { | |
| 2132 | assert(used == .used); | |
| 2133 | return t.compound_assign_dummy.?; | |
| 2134 | }, | |
| 2135 | ||
| 2136 | .comma_expr => |comma_expr| return t.transCommaExpr(scope, comma_expr, used), | |
| 2137 | .pre_inc_expr => |un| return t.transIncDecExpr(scope, un, .pre, .inc, used), | |
| 2138 | .pre_dec_expr => |un| return t.transIncDecExpr(scope, un, .pre, .dec, used), | |
| 2139 | .post_inc_expr => |un| return t.transIncDecExpr(scope, un, .post, .inc, used), | |
| 2140 | .post_dec_expr => |un| return t.transIncDecExpr(scope, un, .post, .dec, used), | |
| 2141 | ||
| 2142 | .int_literal => return t.transIntLiteral(scope, expr, used, .with_as), | |
| 2143 | .char_literal => return t.transCharLiteral(scope, expr, used, .with_as), | |
| 2144 | .float_literal => return t.transFloatLiteral(scope, expr, used, .with_as), | |
| 2145 | .string_literal_expr => |literal| try t.transStringLiteral(scope, expr, literal), | |
| 2146 | .bool_literal => res: { | |
| 2147 | const val = t.tree.value_map.get(expr).?; | |
| 2148 | break :res if (val.toBool(t.comp)) | |
| 2149 | ZigTag.true_literal.init() | |
| 2150 | else | |
| 2151 | ZigTag.false_literal.init(); | |
| 2152 | }, | |
| 2153 | .nullptr_literal => ZigTag.null_literal.init(), | |
| 2154 | .imaginary_literal => |literal| { | |
| 2155 | return t.fail(error.UnsupportedTranslation, literal.op_tok, "TODO complex numbers", .{}); | |
| 2156 | }, | |
| 2157 | .compound_literal_expr => |literal| return t.transCompoundLiteral(scope, literal, used), | |
| 2158 | ||
| 2159 | .default_init_expr => |default_init| return t.transDefaultInit(scope, default_init, used, .with_as), | |
| 2160 | .array_init_expr => |array_init| return t.transArrayInit(scope, array_init, used), | |
| 2161 | .union_init_expr => |union_init| return t.transUnionInit(scope, union_init, used), | |
| 2162 | .struct_init_expr => |struct_init| return t.transStructInit(scope, struct_init, used), | |
| 2163 | .array_filler_expr => unreachable, | |
| 2164 | ||
| 2165 | .sizeof_expr => |sizeof| try t.transTypeInfo(scope, .sizeof, sizeof), | |
| 2166 | .alignof_expr => |alignof| try t.transTypeInfo(scope, .alignof, alignof), | |
| 2167 | ||
| 2168 | .imag_expr, .real_expr => |un| { | |
| 2169 | return t.fail(error.UnsupportedTranslation, un.op_tok, "TODO complex numbers", .{}); | |
| 2170 | }, | |
| 2171 | .addr_of_label => |addr_of_label| { | |
| 2172 | return t.fail(error.UnsupportedTranslation, addr_of_label.label_tok, "TODO computed goto", .{}); | |
| 2173 | }, | |
| 2174 | ||
| 2175 | .generic_expr => |generic| return t.transExpr(scope, generic.chosen, used), | |
| 2176 | .generic_association_expr => |generic| return t.transExpr(scope, generic.expr, used), | |
| 2177 | .generic_default_expr => |generic| return t.transExpr(scope, generic.expr, used), | |
| 2178 | ||
| 2179 | .stmt_expr => |stmt_expr| return t.transStmtExpr(scope, stmt_expr, used), | |
| 2180 | ||
| 2181 | .builtin_convertvector => |convertvector| try t.transConvertvectorExpr(scope, convertvector), | |
| 2182 | .builtin_shufflevector => |shufflevector| try t.transShufflevectorExpr(scope, shufflevector), | |
| 2183 | ||
| 2184 | .compound_stmt, | |
| 2185 | .static_assert, | |
| 2186 | .return_stmt, | |
| 2187 | .null_stmt, | |
| 2188 | .if_stmt, | |
| 2189 | .while_stmt, | |
| 2190 | .do_while_stmt, | |
| 2191 | .for_stmt, | |
| 2192 | .continue_stmt, | |
| 2193 | .break_stmt, | |
| 2194 | .labeled_stmt, | |
| 2195 | .switch_stmt, | |
| 2196 | .case_stmt, | |
| 2197 | .default_stmt, | |
| 2198 | .goto_stmt, | |
| 2199 | .computed_goto_stmt, | |
| 2200 | .gnu_asm_simple, | |
| 2201 | .global_asm, | |
| 2202 | .typedef, | |
| 2203 | .struct_decl, | |
| 2204 | .union_decl, | |
| 2205 | .enum_decl, | |
| 2206 | .function, | |
| 2207 | .param, | |
| 2208 | .variable, | |
| 2209 | .enum_field, | |
| 2210 | .record_field, | |
| 2211 | .struct_forward_decl, | |
| 2212 | .union_forward_decl, | |
| 2213 | .enum_forward_decl, | |
| 2214 | .empty_decl, | |
| 2215 | => unreachable, // not an expression | |
| 2216 | }); | |
| 2217 | } | |
| 2218 | ||
| 2219 | /// Same as `transExpr` but with the knowledge that the operand will be type coerced, and therefore | |
| 2220 | /// an `@as` would be redundant. This is used to prevent redundant `@as` in integer literals. | |
| 2221 | fn transExprCoercing(t: *Translator, scope: *Scope, expr: Node.Index, used: ResultUsed) TransError!ZigNode { | |
| 2222 | switch (expr.get(t.tree)) { | |
| 2223 | .int_literal => return t.transIntLiteral(scope, expr, used, .no_as), | |
| 2224 | .char_literal => return t.transCharLiteral(scope, expr, used, .no_as), | |
| 2225 | .float_literal => return t.transFloatLiteral(scope, expr, used, .no_as), | |
| 2226 | .cast => |cast| switch (cast.kind) { | |
| 2227 | .no_op => { | |
| 2228 | const operand = cast.operand.get(t.tree); | |
| 2229 | if (operand == .cast) { | |
| 2230 | return t.transCastExpr(scope, operand.cast, cast.qt, used, .no_as); | |
| 2231 | } | |
| 2232 | return t.transExprCoercing(scope, cast.operand, used); | |
| 2233 | }, | |
| 2234 | .lval_to_rval => return t.transExprCoercing(scope, cast.operand, used), | |
| 2235 | else => return t.transCastExpr(scope, cast, cast.qt, used, .no_as), | |
| 2236 | }, | |
| 2237 | .default_init_expr => |default_init| return try t.transDefaultInit(scope, default_init, used, .no_as), | |
| 2238 | .compound_literal_expr => |literal| { | |
| 2239 | if (!literal.thread_local and literal.storage_class != .static) { | |
| 2240 | return t.transExprCoercing(scope, literal.initializer, used); | |
| 2241 | } | |
| 2242 | }, | |
| 2243 | else => {}, | |
| 2244 | } | |
| 2245 | ||
| 2246 | return t.transExpr(scope, expr, used); | |
| 2247 | } | |
| 2248 | ||
| 2249 | fn transBoolExpr(t: *Translator, scope: *Scope, expr: Node.Index) TransError!ZigNode { | |
| 2250 | switch (expr.get(t.tree)) { | |
| 2251 | .int_literal => { | |
| 2252 | const int_val = t.tree.value_map.get(expr).?; | |
| 2253 | return if (int_val.isZero(t.comp)) | |
| 2254 | ZigTag.false_literal.init() | |
| 2255 | else | |
| 2256 | ZigTag.true_literal.init(); | |
| 2257 | }, | |
| 2258 | .cast => |cast| switch (cast.kind) { | |
| 2259 | .bool_to_int => return t.transExpr(scope, cast.operand, .used), | |
| 2260 | .array_to_pointer => { | |
| 2261 | const operand = cast.operand.get(t.tree); | |
| 2262 | if (operand == .string_literal_expr) { | |
| 2263 | // @intFromPtr("foo") != 0, always true | |
| 2264 | const str = try t.transStringLiteral(scope, cast.operand, operand.string_literal_expr); | |
| 2265 | const int_from_ptr = try ZigTag.int_from_ptr.create(t.arena, str); | |
| 2266 | return ZigTag.not_equal.create(t.arena, .{ .lhs = int_from_ptr, .rhs = ZigTag.zero_literal.init() }); | |
| 2267 | } | |
| 2268 | }, | |
| 2269 | else => {}, | |
| 2270 | }, | |
| 2271 | else => {}, | |
| 2272 | } | |
| 2273 | ||
| 2274 | const maybe_bool_res = try t.transExpr(scope, expr, .used); | |
| 2275 | if (maybe_bool_res.isBoolRes()) { | |
| 2276 | return maybe_bool_res; | |
| 2277 | } | |
| 2278 | ||
| 2279 | return t.finishBoolExpr(expr.qt(t.tree), maybe_bool_res); | |
| 2280 | } | |
| 2281 | ||
| 2282 | fn finishBoolExpr(t: *Translator, qt: QualType, node: ZigNode) TransError!ZigNode { | |
| 2283 | const sk = qt.scalarKind(t.comp); | |
| 2284 | if (sk == .bool) return node; | |
| 2285 | if (sk == .nullptr_t) { | |
| 2286 | // node == null, always true | |
| 2287 | return ZigTag.equal.create(t.arena, .{ .lhs = node, .rhs = ZigTag.null_literal.init() }); | |
| 2288 | } | |
| 2289 | if (sk.isPointer()) { | |
| 2290 | // node != null | |
| 2291 | return ZigTag.not_equal.create(t.arena, .{ .lhs = node, .rhs = ZigTag.null_literal.init() }); | |
| 2292 | } | |
| 2293 | if (sk != .none) { | |
| 2294 | // node != 0 | |
| 2295 | return ZigTag.not_equal.create(t.arena, .{ .lhs = node, .rhs = ZigTag.zero_literal.init() }); | |
| 2296 | } | |
| 2297 | unreachable; // Unexpected bool expression type | |
| 2298 | } | |
| 2299 | ||
| 2300 | fn transCastExpr( | |
| 2301 | t: *Translator, | |
| 2302 | scope: *Scope, | |
| 2303 | cast: Node.Cast, | |
| 2304 | dest_qt: QualType, | |
| 2305 | used: ResultUsed, | |
| 2306 | suppress_as: SuppressCast, | |
| 2307 | ) TransError!ZigNode { | |
| 2308 | const operand = switch (cast.kind) { | |
| 2309 | .no_op => { | |
| 2310 | const operand = cast.operand.get(t.tree); | |
| 2311 | if (operand == .cast) { | |
| 2312 | return t.transCastExpr(scope, operand.cast, cast.qt, used, suppress_as); | |
| 2313 | } | |
| 2314 | return t.transExpr(scope, cast.operand, used); | |
| 2315 | }, | |
| 2316 | .lval_to_rval, .function_to_pointer => { | |
| 2317 | return t.transExpr(scope, cast.operand, used); | |
| 2318 | }, | |
| 2319 | .int_cast => int_cast: { | |
| 2320 | const src_qt = cast.operand.qt(t.tree); | |
| 2321 | ||
| 2322 | if (cast.implicit) { | |
| 2323 | if (t.tree.value_map.get(cast.operand)) |val| { | |
| 2324 | const max_int = try aro.Value.maxInt(dest_qt, t.comp); | |
| 2325 | const min_int = try aro.Value.minInt(dest_qt, t.comp); | |
| 2326 | ||
| 2327 | if (val.compare(.lte, max_int, t.comp) and val.compare(.gte, min_int, t.comp)) { | |
| 2328 | break :int_cast try t.transExprCoercing(scope, cast.operand, .used); | |
| 2329 | } | |
| 2330 | } | |
| 2331 | } | |
| 2332 | const operand = try t.transExpr(scope, cast.operand, .used); | |
| 2333 | break :int_cast try t.transIntCast(operand, src_qt, dest_qt); | |
| 2334 | }, | |
| 2335 | .to_void => { | |
| 2336 | assert(used == .unused); | |
| 2337 | return try t.transExpr(scope, cast.operand, .unused); | |
| 2338 | }, | |
| 2339 | .null_to_pointer => ZigTag.null_literal.init(), | |
| 2340 | .array_to_pointer => array_to_pointer: { | |
| 2341 | const child_qt = dest_qt.childType(t.comp); | |
| 2342 | ||
| 2343 | loop: switch (cast.operand.get(t.tree)) { | |
| 2344 | .string_literal_expr => |literal| { | |
| 2345 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2346 | ||
| 2347 | const ref = if (literal.kind == .utf8 or literal.kind == .ascii) | |
| 2348 | sub_expr_node | |
| 2349 | else | |
| 2350 | try ZigTag.address_of.create(t.arena, sub_expr_node); | |
| 2351 | ||
| 2352 | const casted = if (child_qt.@"const") | |
| 2353 | ref | |
| 2354 | else | |
| 2355 | try ZigTag.const_cast.create(t.arena, sub_expr_node); | |
| 2356 | ||
| 2357 | return t.maybeSuppressResult(used, casted); | |
| 2358 | }, | |
| 2359 | .paren_expr => |paren_expr| { | |
| 2360 | continue :loop paren_expr.operand.get(t.tree); | |
| 2361 | }, | |
| 2362 | .generic_expr => |generic| { | |
| 2363 | continue :loop generic.chosen.get(t.tree); | |
| 2364 | }, | |
| 2365 | .generic_association_expr => |generic| { | |
| 2366 | continue :loop generic.expr.get(t.tree); | |
| 2367 | }, | |
| 2368 | .generic_default_expr => |generic| { | |
| 2369 | continue :loop generic.expr.get(t.tree); | |
| 2370 | }, | |
| 2371 | else => {}, | |
| 2372 | } | |
| 2373 | ||
| 2374 | if (cast.operand.qt(t.tree).arrayLen(t.comp) == null) { | |
| 2375 | return try t.transExpr(scope, cast.operand, used); | |
| 2376 | } | |
| 2377 | ||
| 2378 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2379 | const ref = try ZigTag.address_of.create(t.arena, sub_expr_node); | |
| 2380 | const align_cast = try ZigTag.align_cast.create(t.arena, ref); | |
| 2381 | break :array_to_pointer try ZigTag.ptr_cast.create(t.arena, align_cast); | |
| 2382 | }, | |
| 2383 | .int_to_pointer => int_to_pointer: { | |
| 2384 | var sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2385 | const operand_qt = cast.operand.qt(t.tree); | |
| 2386 | if (t.signedness(operand_qt) == .signed or operand_qt.bitSizeof(t.comp) > t.comp.target.ptrBitWidth()) { | |
| 2387 | sub_expr_node = try ZigTag.as.create(t.arena, .{ | |
| 2388 | .lhs = try ZigTag.type.create(t.arena, "usize"), | |
| 2389 | .rhs = try ZigTag.int_cast.create(t.arena, sub_expr_node), | |
| 2390 | }); | |
| 2391 | } | |
| 2392 | break :int_to_pointer try ZigTag.ptr_from_int.create(t.arena, sub_expr_node); | |
| 2393 | }, | |
| 2394 | .int_to_bool => { | |
| 2395 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2396 | if (sub_expr_node.isBoolRes()) return sub_expr_node; | |
| 2397 | if (cast.operand.qt(t.tree).is(t.comp, .bool)) return sub_expr_node; | |
| 2398 | const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = sub_expr_node, .rhs = ZigTag.zero_literal.init() }); | |
| 2399 | return t.maybeSuppressResult(used, cmp_node); | |
| 2400 | }, | |
| 2401 | .float_to_bool => { | |
| 2402 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2403 | const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = sub_expr_node, .rhs = ZigTag.zero_literal.init() }); | |
| 2404 | return t.maybeSuppressResult(used, cmp_node); | |
| 2405 | }, | |
| 2406 | .pointer_to_bool => { | |
| 2407 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2408 | ||
| 2409 | // Special case function pointers as @intFromPtr(expr) != 0 | |
| 2410 | if (cast.operand.qt(t.tree).get(t.comp, .pointer)) |ptr_ty| if (ptr_ty.child.is(t.comp, .func)) { | |
| 2411 | const ptr_node = if (sub_expr_node.tag() == .identifier) | |
| 2412 | try ZigTag.address_of.create(t.arena, sub_expr_node) | |
| 2413 | else | |
| 2414 | sub_expr_node; | |
| 2415 | const int_from_ptr = try ZigTag.int_from_ptr.create(t.arena, ptr_node); | |
| 2416 | const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = int_from_ptr, .rhs = ZigTag.zero_literal.init() }); | |
| 2417 | return t.maybeSuppressResult(used, cmp_node); | |
| 2418 | }; | |
| 2419 | ||
| 2420 | const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = sub_expr_node, .rhs = ZigTag.null_literal.init() }); | |
| 2421 | return t.maybeSuppressResult(used, cmp_node); | |
| 2422 | }, | |
| 2423 | .bool_to_int => bool_to_int: { | |
| 2424 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2425 | break :bool_to_int try ZigTag.int_from_bool.create(t.arena, sub_expr_node); | |
| 2426 | }, | |
| 2427 | .bool_to_float => bool_to_float: { | |
| 2428 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2429 | const int_from_bool = try ZigTag.int_from_bool.create(t.arena, sub_expr_node); | |
| 2430 | break :bool_to_float try ZigTag.float_from_int.create(t.arena, int_from_bool); | |
| 2431 | }, | |
| 2432 | .bool_to_pointer => bool_to_pointer: { | |
| 2433 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2434 | const int_from_bool = try ZigTag.int_from_bool.create(t.arena, sub_expr_node); | |
| 2435 | break :bool_to_pointer try ZigTag.ptr_from_int.create(t.arena, int_from_bool); | |
| 2436 | }, | |
| 2437 | .float_cast => float_cast: { | |
| 2438 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2439 | break :float_cast try ZigTag.float_cast.create(t.arena, sub_expr_node); | |
| 2440 | }, | |
| 2441 | .int_to_float => int_to_float: { | |
| 2442 | const sub_expr_node = try t.transExpr(scope, cast.operand, used); | |
| 2443 | const int_node = if (sub_expr_node.isBoolRes()) | |
| 2444 | try ZigTag.int_from_bool.create(t.arena, sub_expr_node) | |
| 2445 | else | |
| 2446 | sub_expr_node; | |
| 2447 | break :int_to_float try ZigTag.float_from_int.create(t.arena, int_node); | |
| 2448 | }, | |
| 2449 | .float_to_int => float_to_int: { | |
| 2450 | const sub_expr_node = try t.transExpr(scope, cast.operand, .used); | |
| 2451 | break :float_to_int try ZigTag.int_from_float.create(t.arena, sub_expr_node); | |
| 2452 | }, | |
| 2453 | .pointer_to_int => pointer_to_int: { | |
| 2454 | const sub_expr_node = try t.transPointerCastExpr(scope, cast.operand); | |
| 2455 | const ptr_node = try ZigTag.int_from_ptr.create(t.arena, sub_expr_node); | |
| 2456 | break :pointer_to_int try ZigTag.int_cast.create(t.arena, ptr_node); | |
| 2457 | }, | |
| 2458 | .bitcast => bitcast: { | |
| 2459 | const sub_expr_node = try t.transPointerCastExpr(scope, cast.operand); | |
| 2460 | const operand_qt = cast.operand.qt(t.tree); | |
| 2461 | if (dest_qt.isPointer(t.comp) and operand_qt.isPointer(t.comp)) { | |
| 2462 | var casted = try ZigTag.align_cast.create(t.arena, sub_expr_node); | |
| 2463 | casted = try ZigTag.ptr_cast.create(t.arena, casted); | |
| 2464 | ||
| 2465 | const src_elem = operand_qt.childType(t.comp); | |
| 2466 | const dest_elem = dest_qt.childType(t.comp); | |
| 2467 | if ((src_elem.@"const" or src_elem.is(t.comp, .func)) and !dest_elem.@"const") { | |
| 2468 | casted = try ZigTag.const_cast.create(t.arena, casted); | |
| 2469 | } | |
| 2470 | if (src_elem.@"volatile" and !dest_elem.@"volatile") { | |
| 2471 | casted = try ZigTag.volatile_cast.create(t.arena, casted); | |
| 2472 | } | |
| 2473 | break :bitcast casted; | |
| 2474 | } | |
| 2475 | ||
| 2476 | break :bitcast try ZigTag.bit_cast.create(t.arena, sub_expr_node); | |
| 2477 | }, | |
| 2478 | .union_cast => union_cast: { | |
| 2479 | const union_type = try t.transType(scope, dest_qt, cast.l_paren); | |
| 2480 | ||
| 2481 | const operand_qt = cast.operand.qt(t.tree); | |
| 2482 | const union_base = dest_qt.base(t.comp); | |
| 2483 | const field = for (union_base.type.@"union".fields) |field| { | |
| 2484 | if (field.qt.eql(operand_qt, t.comp)) break field; | |
| 2485 | } else unreachable; | |
| 2486 | const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ | |
| 2487 | .parent = union_base.qt, | |
| 2488 | .field = field.qt, | |
| 2489 | }).? else field.name.lookup(t.comp); | |
| 2490 | ||
| 2491 | const field_init = try t.arena.create(ast.Payload.ContainerInit.Initializer); | |
| 2492 | field_init.* = .{ | |
| 2493 | .name = field_name, | |
| 2494 | .value = try t.transExpr(scope, cast.operand, .used), | |
| 2495 | }; | |
| 2496 | break :union_cast try ZigTag.container_init.create(t.arena, .{ | |
| 2497 | .lhs = union_type, | |
| 2498 | .inits = field_init[0..1], | |
| 2499 | }); | |
| 2500 | }, | |
| 2501 | else => return t.fail(error.UnsupportedTranslation, cast.l_paren, "TODO translate {s} cast", .{@tagName(cast.kind)}), | |
| 2502 | }; | |
| 2503 | if (suppress_as == .no_as) return t.maybeSuppressResult(used, operand); | |
| 2504 | if (used == .unused) return t.maybeSuppressResult(used, operand); | |
| 2505 | const as = try ZigTag.as.create(t.arena, .{ | |
| 2506 | .lhs = try t.transType(scope, dest_qt, cast.l_paren), | |
| 2507 | .rhs = operand, | |
| 2508 | }); | |
| 2509 | return as; | |
| 2510 | } | |
| 2511 | ||
| 2512 | fn transIntCast(t: *Translator, operand: ZigNode, src_qt: QualType, dest_qt: QualType) !ZigNode { | |
| 2513 | const src_dest_order = src_qt.intRankOrder(dest_qt, t.comp); | |
| 2514 | const different_sign = t.signedness(src_qt) != t.signedness(dest_qt); | |
| 2515 | const needs_bitcast = different_sign and !(t.signedness(src_qt) == .unsigned and src_dest_order == .lt); | |
| 2516 | ||
| 2517 | var casted = operand; | |
| 2518 | if (casted.isBoolRes()) { | |
| 2519 | casted = try ZigTag.int_from_bool.create(t.arena, casted); | |
| 2520 | } else if (src_dest_order == .gt) { | |
| 2521 | // No C type is smaller than the 1 bit from @intFromBool | |
| 2522 | casted = try ZigTag.truncate.create(t.arena, casted); | |
| 2523 | } | |
| 2524 | if (needs_bitcast) { | |
| 2525 | if (src_dest_order != .eq) { | |
| 2526 | casted = try ZigTag.as.create(t.arena, .{ | |
| 2527 | .lhs = try t.transTypeIntWidthOf(dest_qt, t.signedness(src_qt) == .signed), | |
| 2528 | .rhs = casted, | |
| 2529 | }); | |
| 2530 | } | |
| 2531 | return ZigTag.bit_cast.create(t.arena, casted); | |
| 2532 | } | |
| 2533 | return casted; | |
| 2534 | } | |
| 2535 | ||
| 2536 | /// Same as `transExpr` but adds a `&` if the expression is an identifier referencing a function type. | |
| 2537 | fn transPointerCastExpr(t: *Translator, scope: *Scope, expr: Node.Index) TransError!ZigNode { | |
| 2538 | const sub_expr_node = try t.transExpr(scope, expr, .used); | |
| 2539 | switch (expr.get(t.tree)) { | |
| 2540 | .cast => |cast| if (cast.kind == .function_to_pointer and sub_expr_node.tag() == .identifier) { | |
| 2541 | return ZigTag.address_of.create(t.arena, sub_expr_node); | |
| 2542 | }, | |
| 2543 | else => {}, | |
| 2544 | } | |
| 2545 | return sub_expr_node; | |
| 2546 | } | |
| 2547 | ||
| 2548 | fn transDeclRefExpr(t: *Translator, scope: *Scope, decl_ref: Node.DeclRef) TransError!ZigNode { | |
| 2549 | const name = t.tree.tokSlice(decl_ref.name_tok); | |
| 2550 | const maybe_alias = scope.getAlias(name); | |
| 2551 | const mangled_name = maybe_alias orelse name; | |
| 2552 | ||
| 2553 | switch (decl_ref.decl.get(t.tree)) { | |
| 2554 | .function => |function| if (function.definition == null and function.body == null) { | |
| 2555 | // Try translating the decl again in case of out of scope declaration. | |
| 2556 | try t.transFnDecl(scope, function); | |
| 2557 | }, | |
| 2558 | else => {}, | |
| 2559 | } | |
| 2560 | ||
| 2561 | const decl = decl_ref.decl.get(t.tree); | |
| 2562 | const ref_expr = blk: { | |
| 2563 | const identifier = try ZigTag.identifier.create(t.arena, mangled_name); | |
| 2564 | if (decl_ref.qt.is(t.comp, .func) and maybe_alias != null) { | |
| 2565 | break :blk try ZigTag.field_access.create(t.arena, .{ | |
| 2566 | .lhs = identifier, | |
| 2567 | .field_name = name, | |
| 2568 | }); | |
| 2569 | } | |
| 2570 | if (decl == .variable and maybe_alias != null) { | |
| 2571 | switch (decl.variable.storage_class) { | |
| 2572 | .@"extern", .static => { | |
| 2573 | break :blk try ZigTag.field_access.create(t.arena, .{ | |
| 2574 | .lhs = identifier, | |
| 2575 | .field_name = name, | |
| 2576 | }); | |
| 2577 | }, | |
| 2578 | else => {}, | |
| 2579 | } | |
| 2580 | } | |
| 2581 | break :blk identifier; | |
| 2582 | }; | |
| 2583 | ||
| 2584 | scope.skipVariableDiscard(mangled_name); | |
| 2585 | return ref_expr; | |
| 2586 | } | |
| 2587 | ||
| 2588 | fn transBinExpr(t: *Translator, scope: *Scope, bin: Node.Binary, op_id: ZigTag) TransError!ZigNode { | |
| 2589 | const lhs_uncasted = try t.transExpr(scope, bin.lhs, .used); | |
| 2590 | const rhs_uncasted = try t.transExpr(scope, bin.rhs, .used); | |
| 2591 | ||
| 2592 | const lhs = if (lhs_uncasted.isBoolRes()) | |
| 2593 | try ZigTag.int_from_bool.create(t.arena, lhs_uncasted) | |
| 2594 | else | |
| 2595 | lhs_uncasted; | |
| 2596 | ||
| 2597 | const rhs = if (rhs_uncasted.isBoolRes()) | |
| 2598 | try ZigTag.int_from_bool.create(t.arena, rhs_uncasted) | |
| 2599 | else | |
| 2600 | rhs_uncasted; | |
| 2601 | ||
| 2602 | return t.createBinOpNode(op_id, lhs, rhs); | |
| 2603 | } | |
| 2604 | ||
| 2605 | fn transBoolBinExpr(t: *Translator, scope: *Scope, bin: Node.Binary, op: ZigTag) !ZigNode { | |
| 2606 | std.debug.assert(op == .@"and" or op == .@"or"); | |
| 2607 | ||
| 2608 | const lhs = try t.transBoolExpr(scope, bin.lhs); | |
| 2609 | const rhs = try t.transBoolExpr(scope, bin.rhs); | |
| 2610 | ||
| 2611 | return t.createBinOpNode(op, lhs, rhs); | |
| 2612 | } | |
| 2613 | ||
| 2614 | fn transShiftExpr(t: *Translator, scope: *Scope, bin: Node.Binary, op_id: ZigTag) !ZigNode { | |
| 2615 | std.debug.assert(op_id == .shl or op_id == .shr); | |
| 2616 | ||
| 2617 | // lhs >> @intCast(rh) | |
| 2618 | const lhs = try t.transExpr(scope, bin.lhs, .used); | |
| 2619 | ||
| 2620 | const rhs = try t.transExprCoercing(scope, bin.rhs, .used); | |
| 2621 | const rhs_casted = try ZigTag.int_cast.create(t.arena, rhs); | |
| 2622 | ||
| 2623 | return t.createBinOpNode(op_id, lhs, rhs_casted); | |
| 2624 | } | |
| 2625 | ||
| 2626 | fn transCondExpr( | |
| 2627 | t: *Translator, | |
| 2628 | scope: *Scope, | |
| 2629 | conditional: Node.Conditional, | |
| 2630 | used: ResultUsed, | |
| 2631 | ) TransError!ZigNode { | |
| 2632 | var cond_scope: Scope.Condition = .{ | |
| 2633 | .base = .{ | |
| 2634 | .parent = scope, | |
| 2635 | .id = .condition, | |
| 2636 | }, | |
| 2637 | }; | |
| 2638 | defer cond_scope.deinit(); | |
| 2639 | ||
| 2640 | const res_is_bool = conditional.qt.is(t.comp, .bool); | |
| 2641 | const cond = try t.transBoolExpr(&cond_scope.base, conditional.cond); | |
| 2642 | ||
| 2643 | var then_body = try t.transExpr(scope, conditional.then_expr, used); | |
| 2644 | if (!res_is_bool and then_body.isBoolRes()) { | |
| 2645 | then_body = try ZigTag.int_from_bool.create(t.arena, then_body); | |
| 2646 | } | |
| 2647 | ||
| 2648 | var else_body = try t.transExpr(scope, conditional.else_expr, used); | |
| 2649 | if (!res_is_bool and else_body.isBoolRes()) { | |
| 2650 | else_body = try ZigTag.int_from_bool.create(t.arena, else_body); | |
| 2651 | } | |
| 2652 | ||
| 2653 | // The `ResultUsed` is forwarded to both branches so no need to suppress the result here. | |
| 2654 | return ZigTag.@"if".create(t.arena, .{ .cond = cond, .then = then_body, .@"else" = else_body }); | |
| 2655 | } | |
| 2656 | ||
| 2657 | fn transBinaryCondExpr( | |
| 2658 | t: *Translator, | |
| 2659 | scope: *Scope, | |
| 2660 | conditional: Node.Conditional, | |
| 2661 | used: ResultUsed, | |
| 2662 | ) TransError!ZigNode { | |
| 2663 | // GNU extension of the ternary operator where the middle expression is | |
| 2664 | // omitted, the condition itself is returned if it evaluates to true. | |
| 2665 | ||
| 2666 | if (used == .unused) { | |
| 2667 | // Result unused so this can be translated as | |
| 2668 | // if (condition) else_expr; | |
| 2669 | var cond_scope: Scope.Condition = .{ | |
| 2670 | .base = .{ | |
| 2671 | .parent = scope, | |
| 2672 | .id = .condition, | |
| 2673 | }, | |
| 2674 | }; | |
| 2675 | defer cond_scope.deinit(); | |
| 2676 | ||
| 2677 | return ZigTag.@"if".create(t.arena, .{ | |
| 2678 | .cond = try t.transBoolExpr(&cond_scope.base, conditional.cond), | |
| 2679 | .then = try t.transExpr(scope, conditional.else_expr, .unused), | |
| 2680 | .@"else" = null, | |
| 2681 | }); | |
| 2682 | } | |
| 2683 | ||
| 2684 | const res_is_bool = conditional.qt.is(t.comp, .bool); | |
| 2685 | // c: (condition)?:(else_expr) | |
| 2686 | // zig: (blk: { | |
| 2687 | // const _cond_temp = (condition); | |
| 2688 | // break :blk if (_cond_temp) _cond_temp else (else_expr); | |
| 2689 | // }) | |
| 2690 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 2691 | defer block_scope.deinit(); | |
| 2692 | ||
| 2693 | const cond_temp = try block_scope.reserveMangledName("cond_temp"); | |
| 2694 | const init_node = try t.transExpr(&block_scope.base, conditional.cond, .used); | |
| 2695 | const temp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = cond_temp, .init = init_node }); | |
| 2696 | try block_scope.statements.append(t.gpa, temp_decl); | |
| 2697 | ||
| 2698 | var cond_scope: Scope.Condition = .{ | |
| 2699 | .base = .{ | |
| 2700 | .parent = &block_scope.base, | |
| 2701 | .id = .condition, | |
| 2702 | }, | |
| 2703 | }; | |
| 2704 | defer cond_scope.deinit(); | |
| 2705 | ||
| 2706 | const cond_ident = try ZigTag.identifier.create(t.arena, cond_temp); | |
| 2707 | const cond_node = try t.finishBoolExpr(conditional.cond.qt(t.tree), cond_ident); | |
| 2708 | var then_body = cond_ident; | |
| 2709 | if (!res_is_bool and init_node.isBoolRes()) { | |
| 2710 | then_body = try ZigTag.int_from_bool.create(t.arena, then_body); | |
| 2711 | } | |
| 2712 | ||
| 2713 | var else_body = try t.transExpr(&block_scope.base, conditional.else_expr, .used); | |
| 2714 | if (!res_is_bool and else_body.isBoolRes()) { | |
| 2715 | else_body = try ZigTag.int_from_bool.create(t.arena, else_body); | |
| 2716 | } | |
| 2717 | const if_node = try ZigTag.@"if".create(t.arena, .{ | |
| 2718 | .cond = cond_node, | |
| 2719 | .then = then_body, | |
| 2720 | .@"else" = else_body, | |
| 2721 | }); | |
| 2722 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 2723 | .label = block_scope.label, | |
| 2724 | .val = if_node, | |
| 2725 | }); | |
| 2726 | try block_scope.statements.append(t.gpa, break_node); | |
| 2727 | return block_scope.complete(); | |
| 2728 | } | |
| 2729 | ||
| 2730 | fn transCommaExpr(t: *Translator, scope: *Scope, bin: Node.Binary, used: ResultUsed) TransError!ZigNode { | |
| 2731 | if (used == .unused) { | |
| 2732 | const lhs = try t.transExprCoercing(scope, bin.lhs, .unused); | |
| 2733 | try scope.appendNode(lhs); | |
| 2734 | const rhs = try t.transExprCoercing(scope, bin.rhs, .unused); | |
| 2735 | return rhs; | |
| 2736 | } | |
| 2737 | ||
| 2738 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 2739 | defer block_scope.deinit(); | |
| 2740 | ||
| 2741 | const lhs = try t.transExprCoercing(&block_scope.base, bin.lhs, .unused); | |
| 2742 | try block_scope.statements.append(t.gpa, lhs); | |
| 2743 | ||
| 2744 | const rhs = try t.transExprCoercing(&block_scope.base, bin.rhs, .used); | |
| 2745 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 2746 | .label = block_scope.label, | |
| 2747 | .val = rhs, | |
| 2748 | }); | |
| 2749 | try block_scope.statements.append(t.gpa, break_node); | |
| 2750 | ||
| 2751 | return try block_scope.complete(); | |
| 2752 | } | |
| 2753 | ||
| 2754 | fn transAssignExpr(t: *Translator, scope: *Scope, bin: Node.Binary, used: ResultUsed) !ZigNode { | |
| 2755 | if (used == .unused) { | |
| 2756 | const lhs = try t.transExpr(scope, bin.lhs, .used); | |
| 2757 | var rhs = try t.transExprCoercing(scope, bin.rhs, .used); | |
| 2758 | ||
| 2759 | const lhs_qt = bin.lhs.qt(t.tree); | |
| 2760 | if (rhs.isBoolRes() and !lhs_qt.is(t.comp, .bool)) { | |
| 2761 | rhs = try ZigTag.int_from_bool.create(t.arena, rhs); | |
| 2762 | } | |
| 2763 | ||
| 2764 | return t.createBinOpNode(.assign, lhs, rhs); | |
| 2765 | } | |
| 2766 | ||
| 2767 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 2768 | defer block_scope.deinit(); | |
| 2769 | ||
| 2770 | const tmp = try block_scope.reserveMangledName("tmp"); | |
| 2771 | ||
| 2772 | var rhs = try t.transExpr(&block_scope.base, bin.rhs, .used); | |
| 2773 | const lhs_qt = bin.lhs.qt(t.tree); | |
| 2774 | if (rhs.isBoolRes() and !lhs_qt.is(t.comp, .bool)) { | |
| 2775 | rhs = try ZigTag.int_from_bool.create(t.arena, rhs); | |
| 2776 | } | |
| 2777 | ||
| 2778 | const tmp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = tmp, .init = rhs }); | |
| 2779 | try block_scope.statements.append(t.gpa, tmp_decl); | |
| 2780 | ||
| 2781 | const lhs = try t.transExprCoercing(&block_scope.base, bin.lhs, .used); | |
| 2782 | const tmp_ident = try ZigTag.identifier.create(t.arena, tmp); | |
| 2783 | ||
| 2784 | const assign = try t.createBinOpNode(.assign, lhs, tmp_ident); | |
| 2785 | try block_scope.statements.append(t.gpa, assign); | |
| 2786 | ||
| 2787 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 2788 | .label = block_scope.label, | |
| 2789 | .val = tmp_ident, | |
| 2790 | }); | |
| 2791 | try block_scope.statements.append(t.gpa, break_node); | |
| 2792 | ||
| 2793 | return try block_scope.complete(); | |
| 2794 | } | |
| 2795 | ||
| 2796 | fn transCompoundAssign( | |
| 2797 | t: *Translator, | |
| 2798 | scope: *Scope, | |
| 2799 | assign: Node.Binary, | |
| 2800 | used: ResultUsed, | |
| 2801 | ) !ZigNode { | |
| 2802 | // If the result is unused we can try using the equivalent Zig operator | |
| 2803 | // without a block | |
| 2804 | if (used == .unused) { | |
| 2805 | if (try t.transCompoundAssignSimple(scope, null, assign)) |some| { | |
| 2806 | return some; | |
| 2807 | } | |
| 2808 | } | |
| 2809 | ||
| 2810 | // Otherwise we need to wrap the the compound assignment in a block. | |
| 2811 | var block_scope = try Scope.Block.init(t, scope, used == .used); | |
| 2812 | defer block_scope.deinit(); | |
| 2813 | const ref = try block_scope.reserveMangledName("ref"); | |
| 2814 | ||
| 2815 | const lhs_expr = try t.transExpr(&block_scope.base, assign.lhs, .used); | |
| 2816 | const addr_of = try ZigTag.address_of.create(t.arena, lhs_expr); | |
| 2817 | const ref_decl = try ZigTag.var_simple.create(t.arena, .{ .name = ref, .init = addr_of }); | |
| 2818 | try block_scope.statements.append(t.gpa, ref_decl); | |
| 2819 | ||
| 2820 | const lhs_node = try ZigTag.identifier.create(t.arena, ref); | |
| 2821 | const ref_node = try ZigTag.deref.create(t.arena, lhs_node); | |
| 2822 | ||
| 2823 | // Use the equivalent Zig operator if possible. | |
| 2824 | if (try t.transCompoundAssignSimple(scope, ref_node, assign)) |some| { | |
| 2825 | try block_scope.statements.append(t.gpa, some); | |
| 2826 | } else { | |
| 2827 | const old_dummy = t.compound_assign_dummy; | |
| 2828 | defer t.compound_assign_dummy = old_dummy; | |
| 2829 | t.compound_assign_dummy = ref_node; | |
| 2830 | ||
| 2831 | // Otherwise do the operation and assignment separately. | |
| 2832 | const rhs_node = try t.transExprCoercing(&block_scope.base, assign.rhs, .used); | |
| 2833 | const assign_node = try t.createBinOpNode(.assign, ref_node, rhs_node); | |
| 2834 | try block_scope.statements.append(t.gpa, assign_node); | |
| 2835 | } | |
| 2836 | ||
| 2837 | if (used == .used) { | |
| 2838 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 2839 | .label = block_scope.label, | |
| 2840 | .val = ref_node, | |
| 2841 | }); | |
| 2842 | try block_scope.statements.append(t.gpa, break_node); | |
| 2843 | } | |
| 2844 | return block_scope.complete(); | |
| 2845 | } | |
| 2846 | ||
| 2847 | /// Translates compound assignment using the equivalent Zig operator if possible. | |
| 2848 | fn transCompoundAssignSimple(t: *Translator, scope: *Scope, lhs_dummy_opt: ?ZigNode, assign: Node.Binary) TransError!?ZigNode { | |
| 2849 | const assign_rhs = assign.rhs.get(t.tree); | |
| 2850 | if (assign_rhs == .cast) return null; | |
| 2851 | ||
| 2852 | const is_signed = t.signedness(assign.qt) == .signed; | |
| 2853 | switch (assign_rhs) { | |
| 2854 | .div_expr, .mod_expr => if (is_signed) return null, | |
| 2855 | else => {}, | |
| 2856 | } | |
| 2857 | const lhs_ptr = assign.qt.isPointer(t.comp); | |
| 2858 | ||
| 2859 | const bin, const op: ZigTag, const cast: enum { none, shift, usize } = switch (assign_rhs) { | |
| 2860 | .add_expr => |bin| .{ | |
| 2861 | bin, | |
| 2862 | if (t.typeHasWrappingOverflow(bin.qt)) .add_wrap_assign else .add_assign, | |
| 2863 | if (lhs_ptr and t.signedness(bin.rhs.qt(t.tree)) == .signed) .usize else .none, | |
| 2864 | }, | |
| 2865 | .sub_expr => |bin| .{ | |
| 2866 | bin, | |
| 2867 | if (t.typeHasWrappingOverflow(bin.qt)) .sub_wrap_assign else .sub_assign, | |
| 2868 | if (lhs_ptr and t.signedness(bin.rhs.qt(t.tree)) == .signed) .usize else .none, | |
| 2869 | }, | |
| 2870 | .mul_expr => |bin| .{ | |
| 2871 | bin, | |
| 2872 | if (t.typeHasWrappingOverflow(bin.qt)) .mul_wrap_assign else .mul_assign, | |
| 2873 | .none, | |
| 2874 | }, | |
| 2875 | .mod_expr => |bin| .{ bin, .mod_assign, .none }, | |
| 2876 | .div_expr => |bin| .{ bin, .div_assign, .none }, | |
| 2877 | .shl_expr => |bin| .{ bin, .shl_assign, .shift }, | |
| 2878 | .shr_expr => |bin| .{ bin, .shr_assign, .shift }, | |
| 2879 | .bit_and_expr => |bin| .{ bin, .bit_and_assign, .none }, | |
| 2880 | .bit_xor_expr => |bin| .{ bin, .bit_xor_assign, .none }, | |
| 2881 | .bit_or_expr => |bin| .{ bin, .bit_or_assign, .none }, | |
| 2882 | else => unreachable, | |
| 2883 | }; | |
| 2884 | ||
| 2885 | const lhs_node = blk: { | |
| 2886 | const old_dummy = t.compound_assign_dummy; | |
| 2887 | defer t.compound_assign_dummy = old_dummy; | |
| 2888 | t.compound_assign_dummy = lhs_dummy_opt orelse try t.transExpr(scope, assign.lhs, .used); | |
| 2889 | ||
| 2890 | break :blk try t.transExpr(scope, bin.lhs, .used); | |
| 2891 | }; | |
| 2892 | ||
| 2893 | const rhs_node = try t.transExprCoercing(scope, bin.rhs, .used); | |
| 2894 | const casted_rhs = switch (cast) { | |
| 2895 | .none => rhs_node, | |
| 2896 | .shift => try ZigTag.int_cast.create(t.arena, rhs_node), | |
| 2897 | .usize => try t.usizeCastForWrappingPtrArithmetic(rhs_node), | |
| 2898 | }; | |
| 2899 | return try t.createBinOpNode(op, lhs_node, casted_rhs); | |
| 2900 | } | |
| 2901 | ||
| 2902 | fn transIncDecExpr( | |
| 2903 | t: *Translator, | |
| 2904 | scope: *Scope, | |
| 2905 | un: Node.Unary, | |
| 2906 | position: enum { pre, post }, | |
| 2907 | kind: enum { inc, dec }, | |
| 2908 | used: ResultUsed, | |
| 2909 | ) !ZigNode { | |
| 2910 | const is_wrapping = t.typeHasWrappingOverflow(un.qt); | |
| 2911 | const op: ZigTag = switch (kind) { | |
| 2912 | .inc => if (is_wrapping) .add_wrap_assign else .add_assign, | |
| 2913 | .dec => if (is_wrapping) .sub_wrap_assign else .sub_assign, | |
| 2914 | }; | |
| 2915 | ||
| 2916 | const one_literal = ZigTag.one_literal.init(); | |
| 2917 | if (used == .unused) { | |
| 2918 | const operand = try t.transExpr(scope, un.operand, .used); | |
| 2919 | return try t.createBinOpNode(op, operand, one_literal); | |
| 2920 | } | |
| 2921 | ||
| 2922 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 2923 | defer block_scope.deinit(); | |
| 2924 | ||
| 2925 | const ref = try block_scope.reserveMangledName("ref"); | |
| 2926 | const operand = try t.transExprCoercing(&block_scope.base, un.operand, .used); | |
| 2927 | const operand_ref = try ZigTag.address_of.create(t.arena, operand); | |
| 2928 | const ref_decl = try ZigTag.var_simple.create(t.arena, .{ .name = ref, .init = operand_ref }); | |
| 2929 | try block_scope.statements.append(t.gpa, ref_decl); | |
| 2930 | ||
| 2931 | const ref_ident = try ZigTag.identifier.create(t.arena, ref); | |
| 2932 | const ref_deref = try ZigTag.deref.create(t.arena, ref_ident); | |
| 2933 | const effect = try t.createBinOpNode(op, ref_deref, one_literal); | |
| 2934 | ||
| 2935 | switch (position) { | |
| 2936 | .pre => { | |
| 2937 | try block_scope.statements.append(t.gpa, effect); | |
| 2938 | ||
| 2939 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 2940 | .label = block_scope.label, | |
| 2941 | .val = ref_deref, | |
| 2942 | }); | |
| 2943 | try block_scope.statements.append(t.gpa, break_node); | |
| 2944 | }, | |
| 2945 | .post => { | |
| 2946 | const tmp = try block_scope.reserveMangledName("tmp"); | |
| 2947 | const tmp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = tmp, .init = ref_deref }); | |
| 2948 | try block_scope.statements.append(t.gpa, tmp_decl); | |
| 2949 | ||
| 2950 | try block_scope.statements.append(t.gpa, effect); | |
| 2951 | ||
| 2952 | const tmp_ident = try ZigTag.identifier.create(t.arena, tmp); | |
| 2953 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 2954 | .label = block_scope.label, | |
| 2955 | .val = tmp_ident, | |
| 2956 | }); | |
| 2957 | try block_scope.statements.append(t.gpa, break_node); | |
| 2958 | }, | |
| 2959 | } | |
| 2960 | ||
| 2961 | return try block_scope.complete(); | |
| 2962 | } | |
| 2963 | ||
| 2964 | fn transPtrDiffExpr(t: *Translator, scope: *Scope, bin: Node.Binary) TransError!ZigNode { | |
| 2965 | const lhs_uncasted = try t.transExpr(scope, bin.lhs, .used); | |
| 2966 | const rhs_uncasted = try t.transExpr(scope, bin.rhs, .used); | |
| 2967 | ||
| 2968 | const lhs = try ZigTag.int_from_ptr.create(t.arena, lhs_uncasted); | |
| 2969 | const rhs = try ZigTag.int_from_ptr.create(t.arena, rhs_uncasted); | |
| 2970 | ||
| 2971 | const sub_res = try t.createBinOpNode(.sub_wrap, lhs, rhs); | |
| 2972 | ||
| 2973 | // @divExact(@as(<platform-ptrdiff_t>, @bitCast(@intFromPtr(lhs)) -% @intFromPtr(rhs)), @sizeOf(<lhs target type>)) | |
| 2974 | const ptrdiff_type = try t.transTypeIntWidthOf(bin.qt, true); | |
| 2975 | ||
| 2976 | const bitcast = try ZigTag.as.create(t.arena, .{ | |
| 2977 | .lhs = ptrdiff_type, | |
| 2978 | .rhs = try ZigTag.bit_cast.create(t.arena, sub_res), | |
| 2979 | }); | |
| 2980 | ||
| 2981 | // C standard requires that pointer subtraction operands are of the same type, | |
| 2982 | // otherwise it is undefined behavior. So we can assume the left and right | |
| 2983 | // sides are the same Type and arbitrarily choose left. | |
| 2984 | const lhs_ty = try t.transType(scope, bin.lhs.qt(t.tree), bin.lhs.tok(t.tree)); | |
| 2985 | const c_pointer = t.getContainer(lhs_ty).?; | |
| 2986 | ||
| 2987 | if (c_pointer.castTag(.c_pointer)) |c_pointer_payload| { | |
| 2988 | const sizeof = try ZigTag.sizeof.create(t.arena, c_pointer_payload.data.elem_type); | |
| 2989 | return ZigTag.div_exact.create(t.arena, .{ | |
| 2990 | .lhs = bitcast, | |
| 2991 | .rhs = sizeof, | |
| 2992 | }); | |
| 2993 | } else { | |
| 2994 | // This is an opaque/incomplete type. This subtraction exhibits Undefined Behavior by the C99 spec. | |
| 2995 | // However, allowing subtraction on `void *` and function pointers is a commonly used extension. | |
| 2996 | // So, just return the value in byte units, mirroring the behavior of this language extension as implemented by GCC and Clang. | |
| 2997 | return bitcast; | |
| 2998 | } | |
| 2999 | } | |
| 3000 | ||
| 3001 | /// Translate an arithmetic expression with a pointer operand and a signed-integer operand. | |
| 3002 | /// Zig requires a usize argument for pointer arithmetic, so we intCast to isize and then | |
| 3003 | /// bitcast to usize; pointer wraparound makes the math work. | |
| 3004 | /// Zig pointer addition is not commutative (unlike C); the pointer operand needs to be on the left. | |
| 3005 | /// The + operator in C is not a sequence point so it should be safe to switch the order if necessary. | |
| 3006 | fn transPointerArithmeticSignedOp(t: *Translator, scope: *Scope, bin: Node.Binary, op_id: ZigTag) TransError!ZigNode { | |
| 3007 | std.debug.assert(op_id == .add or op_id == .sub); | |
| 3008 | ||
| 3009 | const lhs_qt = bin.lhs.qt(t.tree); | |
| 3010 | const swap_operands = op_id == .add and t.signedness(lhs_qt) == .signed; | |
| 3011 | ||
| 3012 | const swizzled_lhs = if (swap_operands) bin.rhs else bin.lhs; | |
| 3013 | const swizzled_rhs = if (swap_operands) bin.lhs else bin.rhs; | |
| 3014 | ||
| 3015 | const lhs_node = try t.transExpr(scope, swizzled_lhs, .used); | |
| 3016 | const rhs_node = try t.transExpr(scope, swizzled_rhs, .used); | |
| 3017 | ||
| 3018 | const bitcast_node = try t.usizeCastForWrappingPtrArithmetic(rhs_node); | |
| 3019 | ||
| 3020 | return t.createBinOpNode(op_id, lhs_node, bitcast_node); | |
| 3021 | } | |
| 3022 | ||
| 3023 | fn transMemberAccess( | |
| 3024 | t: *Translator, | |
| 3025 | scope: *Scope, | |
| 3026 | kind: enum { normal, ptr }, | |
| 3027 | member_access: Node.MemberAccess, | |
| 3028 | opt_base: ?ZigNode, | |
| 3029 | ) TransError!ZigNode { | |
| 3030 | const base_info = switch (kind) { | |
| 3031 | .normal => member_access.base.qt(t.tree), | |
| 3032 | .ptr => member_access.base.qt(t.tree).childType(t.comp), | |
| 3033 | }; | |
| 3034 | const record = base_info.getRecord(t.comp).?; | |
| 3035 | const field = record.fields[member_access.member_index]; | |
| 3036 | const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ | |
| 3037 | .parent = base_info.base(t.comp).qt, | |
| 3038 | .field = field.qt, | |
| 3039 | }).? else field.name.lookup(t.comp); | |
| 3040 | const base_node = opt_base orelse try t.transExpr(scope, member_access.base, .used); | |
| 3041 | const lhs = switch (kind) { | |
| 3042 | .normal => base_node, | |
| 3043 | .ptr => try ZigTag.deref.create(t.arena, base_node), | |
| 3044 | }; | |
| 3045 | const field_access = try ZigTag.field_access.create(t.arena, .{ | |
| 3046 | .lhs = lhs, | |
| 3047 | .field_name = field_name, | |
| 3048 | }); | |
| 3049 | ||
| 3050 | // Flexible array members are translated as member functions. | |
| 3051 | if (member_access.member_index == record.fields.len - 1 or base_info.base(t.comp).type == .@"union") { | |
| 3052 | if (field.qt.get(t.comp, .array)) |array_ty| { | |
| 3053 | if (array_ty.len == .incomplete or (array_ty.len == .fixed and array_ty.len.fixed == 0)) { | |
| 3054 | return ZigTag.call.create(t.arena, .{ .lhs = field_access, .args = &.{} }); | |
| 3055 | } | |
| 3056 | } | |
| 3057 | } | |
| 3058 | ||
| 3059 | return field_access; | |
| 3060 | } | |
| 3061 | ||
| 3062 | fn transArrayAccess(t: *Translator, scope: *Scope, array_access: Node.ArrayAccess, opt_base: ?ZigNode) TransError!ZigNode { | |
| 3063 | // Unwrap the base statement if it's an array decayed to a bare pointer type | |
| 3064 | // so that we index the array itself | |
| 3065 | const base = base: { | |
| 3066 | const base = array_access.base.get(t.tree); | |
| 3067 | if (base != .cast) break :base array_access.base; | |
| 3068 | if (base.cast.kind != .array_to_pointer) break :base array_access.base; | |
| 3069 | break :base base.cast.operand; | |
| 3070 | }; | |
| 3071 | ||
| 3072 | const base_node = opt_base orelse try t.transExpr(scope, base, .used); | |
| 3073 | const index = index: { | |
| 3074 | const index = try t.transExpr(scope, array_access.index, .used); | |
| 3075 | const index_qt = array_access.index.qt(t.tree); | |
| 3076 | const maybe_bigger_than_usize = switch (index_qt.base(t.comp).type) { | |
| 3077 | .bool => { | |
| 3078 | break :index try ZigTag.int_from_bool.create(t.arena, index); | |
| 3079 | }, | |
| 3080 | .int => |int| switch (int) { | |
| 3081 | .long_long, .ulong_long, .int128, .uint128 => true, | |
| 3082 | else => false, | |
| 3083 | }, | |
| 3084 | .bit_int => |bit_int| bit_int.bits > t.comp.target.ptrBitWidth(), | |
| 3085 | else => unreachable, | |
| 3086 | }; | |
| 3087 | ||
| 3088 | const is_nonnegative_int_literal = if (t.tree.value_map.get(array_access.index)) |val| | |
| 3089 | val.compare(.gte, .zero, t.comp) | |
| 3090 | else | |
| 3091 | false; | |
| 3092 | const is_signed = t.signedness(index_qt) == .signed; | |
| 3093 | ||
| 3094 | if (is_signed and !is_nonnegative_int_literal) { | |
| 3095 | // First cast to `isize` to get proper sign extension and | |
| 3096 | // then @bitCast to `usize` to satisfy the compiler. | |
| 3097 | const index_isize = try ZigTag.as.create(t.arena, .{ | |
| 3098 | .lhs = try ZigTag.type.create(t.arena, "isize"), | |
| 3099 | .rhs = try ZigTag.int_cast.create(t.arena, index), | |
| 3100 | }); | |
| 3101 | break :index try ZigTag.bit_cast.create(t.arena, index_isize); | |
| 3102 | } | |
| 3103 | ||
| 3104 | if (maybe_bigger_than_usize) { | |
| 3105 | break :index try ZigTag.int_cast.create(t.arena, index); | |
| 3106 | } | |
| 3107 | break :index index; | |
| 3108 | }; | |
| 3109 | ||
| 3110 | return ZigTag.array_access.create(t.arena, .{ | |
| 3111 | .lhs = base_node, | |
| 3112 | .rhs = index, | |
| 3113 | }); | |
| 3114 | } | |
| 3115 | ||
| 3116 | fn transOffsetof(t: *Translator, scope: *Scope, arg: Node.Index) TransError!ZigNode { | |
| 3117 | // Translate __builtin_offsetof(T, designator) as | |
| 3118 | // @intFromPtr(&(@as(*allowzero T, @ptrFromInt(0)).designator)) | |
| 3119 | const member = try t.transMemberDesignator(scope, arg); | |
| 3120 | const address = try ZigTag.address_of.create(t.arena, member); | |
| 3121 | return ZigTag.int_from_ptr.create(t.arena, address); | |
| 3122 | } | |
| 3123 | ||
| 3124 | fn transMemberDesignator(t: *Translator, scope: *Scope, arg: Node.Index) TransError!ZigNode { | |
| 3125 | switch (arg.get(t.tree)) { | |
| 3126 | .default_init_expr => |default| { | |
| 3127 | const elem_node = try t.transType(scope, default.qt, default.last_tok); | |
| 3128 | const ptr_ty = try ZigTag.single_pointer.create(t.arena, .{ | |
| 3129 | .elem_type = elem_node, | |
| 3130 | .is_allowzero = true, | |
| 3131 | .is_const = false, | |
| 3132 | .is_volatile = false, | |
| 3133 | }); | |
| 3134 | const zero = try ZigTag.ptr_from_int.create(t.arena, ZigTag.zero_literal.init()); | |
| 3135 | return ZigTag.as.create(t.arena, .{ .lhs = ptr_ty, .rhs = zero }); | |
| 3136 | }, | |
| 3137 | .array_access_expr => |access| { | |
| 3138 | const base = try t.transMemberDesignator(scope, access.base); | |
| 3139 | return t.transArrayAccess(scope, access, base); | |
| 3140 | }, | |
| 3141 | .member_access_expr => |access| { | |
| 3142 | const base = try t.transMemberDesignator(scope, access.base); | |
| 3143 | return t.transMemberAccess(scope, .normal, access, base); | |
| 3144 | }, | |
| 3145 | .cast => |cast| { | |
| 3146 | assert(cast.kind == .array_to_pointer); | |
| 3147 | return t.transMemberDesignator(scope, cast.operand); | |
| 3148 | }, | |
| 3149 | else => unreachable, | |
| 3150 | } | |
| 3151 | } | |
| 3152 | ||
| 3153 | fn transBuiltinCall( | |
| 3154 | t: *Translator, | |
| 3155 | scope: *Scope, | |
| 3156 | call: Node.BuiltinCall, | |
| 3157 | used: ResultUsed, | |
| 3158 | ) TransError!ZigNode { | |
| 3159 | const builtin_name = t.tree.tokSlice(call.builtin_tok); | |
| 3160 | if (std.mem.eql(u8, builtin_name, "__builtin_offsetof")) { | |
| 3161 | const res = try t.transOffsetof(scope, call.args[0]); | |
| 3162 | return t.maybeSuppressResult(used, res); | |
| 3163 | } | |
| 3164 | ||
| 3165 | const builtin = builtins.map.get(builtin_name) orelse | |
| 3166 | return t.fail(error.UnsupportedTranslation, call.builtin_tok, "TODO implement function '{s}' in std.zig.c_builtins", .{builtin_name}); | |
| 3167 | ||
| 3168 | if (builtin.tag) |tag| switch (tag) { | |
| 3169 | .byte_swap, .ceil, .cos, .sin, .exp, .exp2, .exp10, .abs, .log, .log2, .log10, .round, .sqrt, .trunc, .floor => { | |
| 3170 | assert(call.args.len == 1); | |
| 3171 | const arg = try t.transExprCoercing(scope, call.args[0], .used); | |
| 3172 | const arg_ty = try t.transType(scope, call.args[0].qt(t.tree), call.args[0].tok(t.tree)); | |
| 3173 | const coerced = try ZigTag.as.create(t.arena, .{ .lhs = arg_ty, .rhs = arg }); | |
| 3174 | ||
| 3175 | const ptr = try t.arena.create(ast.Payload.UnOp); | |
| 3176 | ptr.* = .{ .base = .{ .tag = tag }, .data = coerced }; | |
| 3177 | return t.maybeSuppressResult(used, ZigNode.initPayload(&ptr.base)); | |
| 3178 | }, | |
| 3179 | .@"unreachable" => return ZigTag.@"unreachable".init(), | |
| 3180 | else => unreachable, | |
| 3181 | }; | |
| 3182 | ||
| 3183 | const arg_nodes = try t.arena.alloc(ZigNode, call.args.len); | |
| 3184 | for (call.args, arg_nodes) |c_arg, *zig_arg| { | |
| 3185 | zig_arg.* = try t.transExprCoercing(scope, c_arg, .used); | |
| 3186 | } | |
| 3187 | ||
| 3188 | const builtin_identifier = try ZigTag.identifier.create(t.arena, "__builtin"); | |
| 3189 | const field_access = try ZigTag.field_access.create(t.arena, .{ | |
| 3190 | .lhs = builtin_identifier, | |
| 3191 | .field_name = builtin.name, | |
| 3192 | }); | |
| 3193 | ||
| 3194 | const res = try ZigTag.call.create(t.arena, .{ | |
| 3195 | .lhs = field_access, | |
| 3196 | .args = arg_nodes, | |
| 3197 | }); | |
| 3198 | if (call.qt.is(t.comp, .void)) return res; | |
| 3199 | return t.maybeSuppressResult(used, res); | |
| 3200 | } | |
| 3201 | ||
| 3202 | fn transCall( | |
| 3203 | t: *Translator, | |
| 3204 | scope: *Scope, | |
| 3205 | call: Node.Call, | |
| 3206 | used: ResultUsed, | |
| 3207 | ) TransError!ZigNode { | |
| 3208 | const raw_fn_expr = try t.transExpr(scope, call.callee, .used); | |
| 3209 | const fn_expr = blk: { | |
| 3210 | loop: switch (call.callee.get(t.tree)) { | |
| 3211 | .paren_expr => |paren_expr| { | |
| 3212 | continue :loop paren_expr.operand.get(t.tree); | |
| 3213 | }, | |
| 3214 | .decl_ref_expr => |decl_ref| { | |
| 3215 | if (decl_ref.qt.is(t.comp, .func)) break :blk raw_fn_expr; | |
| 3216 | }, | |
| 3217 | .cast => |cast| { | |
| 3218 | if (cast.kind == .function_to_pointer) { | |
| 3219 | continue :loop cast.operand.get(t.tree); | |
| 3220 | } | |
| 3221 | }, | |
| 3222 | .deref_expr, .addr_of_expr => |un| { | |
| 3223 | continue :loop un.operand.get(t.tree); | |
| 3224 | }, | |
| 3225 | .generic_expr => |generic| { | |
| 3226 | continue :loop generic.chosen.get(t.tree); | |
| 3227 | }, | |
| 3228 | .generic_association_expr => |generic| { | |
| 3229 | continue :loop generic.expr.get(t.tree); | |
| 3230 | }, | |
| 3231 | .generic_default_expr => |generic| { | |
| 3232 | continue :loop generic.expr.get(t.tree); | |
| 3233 | }, | |
| 3234 | else => {}, | |
| 3235 | } | |
| 3236 | break :blk try ZigTag.unwrap.create(t.arena, raw_fn_expr); | |
| 3237 | }; | |
| 3238 | ||
| 3239 | const callee_qt = call.callee.qt(t.tree); | |
| 3240 | const maybe_ptr_ty = callee_qt.get(t.comp, .pointer); | |
| 3241 | const func_qt = if (maybe_ptr_ty) |ptr| ptr.child else callee_qt; | |
| 3242 | const func_ty = func_qt.get(t.comp, .func).?; | |
| 3243 | ||
| 3244 | const arg_nodes = try t.arena.alloc(ZigNode, call.args.len); | |
| 3245 | for (call.args, arg_nodes, 0..) |c_arg, *zig_arg, i| { | |
| 3246 | if (i < func_ty.params.len) { | |
| 3247 | zig_arg.* = try t.transExprCoercing(scope, c_arg, .used); | |
| 3248 | ||
| 3249 | if (zig_arg.isBoolRes() and !func_ty.params[i].qt.is(t.comp, .bool)) { | |
| 3250 | // In C the result type of a boolean expression is int. If this result is passed as | |
| 3251 | // an argument to a function whose parameter is also int, there is no cast. Therefore | |
| 3252 | // in Zig we'll need to cast it from bool to u1 (which will safely coerce to c_int). | |
| 3253 | zig_arg.* = try ZigTag.int_from_bool.create(t.arena, zig_arg.*); | |
| 3254 | } | |
| 3255 | } else { | |
| 3256 | zig_arg.* = try t.transExpr(scope, c_arg, .used); | |
| 3257 | ||
| 3258 | if (zig_arg.isBoolRes()) { | |
| 3259 | // Same as above but now we don't have a result type. | |
| 3260 | const u1_node = try ZigTag.int_from_bool.create(t.arena, zig_arg.*); | |
| 3261 | const c_int_node = try ZigTag.type.create(t.arena, "c_int"); | |
| 3262 | zig_arg.* = try ZigTag.as.create(t.arena, .{ .lhs = c_int_node, .rhs = u1_node }); | |
| 3263 | } | |
| 3264 | } | |
| 3265 | } | |
| 3266 | ||
| 3267 | const res = try ZigTag.call.create(t.arena, .{ | |
| 3268 | .lhs = fn_expr, | |
| 3269 | .args = arg_nodes, | |
| 3270 | }); | |
| 3271 | if (call.qt.is(t.comp, .void)) return res; | |
| 3272 | return t.maybeSuppressResult(used, res); | |
| 3273 | } | |
| 3274 | ||
| 3275 | const SuppressCast = enum { with_as, no_as }; | |
| 3276 | ||
| 3277 | fn transIntLiteral( | |
| 3278 | t: *Translator, | |
| 3279 | scope: *Scope, | |
| 3280 | literal_index: Node.Index, | |
| 3281 | used: ResultUsed, | |
| 3282 | suppress_as: SuppressCast, | |
| 3283 | ) TransError!ZigNode { | |
| 3284 | const val = t.tree.value_map.get(literal_index).?; | |
| 3285 | const int_lit_node = try t.createIntNode(val); | |
| 3286 | if (suppress_as == .no_as) { | |
| 3287 | return t.maybeSuppressResult(used, int_lit_node); | |
| 3288 | } | |
| 3289 | ||
| 3290 | // Integer literals in C have types, and this can matter for several reasons. | |
| 3291 | // For example, this is valid C: | |
| 3292 | // unsigned char y = 256; | |
| 3293 | // How this gets evaluated is the 256 is an integer, which gets truncated to signed char, then bit-casted | |
| 3294 | // to unsigned char, resulting in 0. In order for this to work, we have to emit this zig code: | |
| 3295 | // var y = @as(u8, @bitCast(@as(i8, @truncate(@as(c_int, 256))))); | |
| 3296 | ||
| 3297 | // @as(T, x) | |
| 3298 | const ty_node = try t.transType(scope, literal_index.qt(t.tree), literal_index.tok(t.tree)); | |
| 3299 | const as = try ZigTag.as.create(t.arena, .{ .lhs = ty_node, .rhs = int_lit_node }); | |
| 3300 | return t.maybeSuppressResult(used, as); | |
| 3301 | } | |
| 3302 | ||
| 3303 | fn transCharLiteral( | |
| 3304 | t: *Translator, | |
| 3305 | scope: *Scope, | |
| 3306 | literal_index: Node.Index, | |
| 3307 | used: ResultUsed, | |
| 3308 | suppress_as: SuppressCast, | |
| 3309 | ) TransError!ZigNode { | |
| 3310 | const val = t.tree.value_map.get(literal_index).?; | |
| 3311 | const char_literal = literal_index.get(t.tree).char_literal; | |
| 3312 | const narrow = char_literal.kind == .ascii or char_literal.kind == .utf8; | |
| 3313 | ||
| 3314 | // C has a somewhat obscure feature called multi-character character constant | |
| 3315 | // e.g. 'abcd' | |
| 3316 | const int_value = val.toInt(u32, t.comp).?; | |
| 3317 | const int_lit_node = if (char_literal.kind == .ascii and int_value > 255) | |
| 3318 | try t.createNumberNode(int_value, .int) | |
| 3319 | else | |
| 3320 | try t.createCharLiteralNode(narrow, int_value); | |
| 3321 | ||
| 3322 | if (suppress_as == .no_as) { | |
| 3323 | return t.maybeSuppressResult(used, int_lit_node); | |
| 3324 | } | |
| 3325 | ||
| 3326 | // See comment in `transIntLiteral` for why this code is here. | |
| 3327 | // @as(T, x) | |
| 3328 | const as_node = try ZigTag.as.create(t.arena, .{ | |
| 3329 | .lhs = try t.transType(scope, char_literal.qt, char_literal.literal_tok), | |
| 3330 | .rhs = int_lit_node, | |
| 3331 | }); | |
| 3332 | return t.maybeSuppressResult(used, as_node); | |
| 3333 | } | |
| 3334 | ||
| 3335 | fn transFloatLiteral( | |
| 3336 | t: *Translator, | |
| 3337 | scope: *Scope, | |
| 3338 | literal_index: Node.Index, | |
| 3339 | used: ResultUsed, | |
| 3340 | suppress_as: SuppressCast, | |
| 3341 | ) TransError!ZigNode { | |
| 3342 | const val = t.tree.value_map.get(literal_index).?; | |
| 3343 | const float_literal = literal_index.get(t.tree).float_literal; | |
| 3344 | ||
| 3345 | var allocating: std.Io.Writer.Allocating = .init(t.gpa); | |
| 3346 | defer allocating.deinit(); | |
| 3347 | _ = val.print(float_literal.qt, t.comp, &allocating.writer) catch return error.OutOfMemory; | |
| 3348 | ||
| 3349 | const float_lit_node = try ZigTag.float_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); | |
| 3350 | if (suppress_as == .no_as) { | |
| 3351 | return t.maybeSuppressResult(used, float_lit_node); | |
| 3352 | } | |
| 3353 | ||
| 3354 | const as_node = try ZigTag.as.create(t.arena, .{ | |
| 3355 | .lhs = try t.transType(scope, float_literal.qt, float_literal.literal_tok), | |
| 3356 | .rhs = float_lit_node, | |
| 3357 | }); | |
| 3358 | return t.maybeSuppressResult(used, as_node); | |
| 3359 | } | |
| 3360 | ||
| 3361 | fn transStringLiteral( | |
| 3362 | t: *Translator, | |
| 3363 | scope: *Scope, | |
| 3364 | expr: Node.Index, | |
| 3365 | literal: Node.CharLiteral, | |
| 3366 | ) TransError!ZigNode { | |
| 3367 | switch (literal.kind) { | |
| 3368 | .ascii, .utf8 => return t.transNarrowStringLiteral(expr, literal), | |
| 3369 | .utf16, .utf32, .wide => { | |
| 3370 | const name = try std.fmt.allocPrint(t.arena, "{s}_string_{d}", .{ @tagName(literal.kind), t.getMangle() }); | |
| 3371 | ||
| 3372 | const array_type = try t.transTypeInit(scope, literal.qt, expr, literal.literal_tok); | |
| 3373 | const lit_array = try t.transStringLiteralInitializer(expr, literal, array_type); | |
| 3374 | const decl = try ZigTag.var_simple.create(t.arena, .{ .name = name, .init = lit_array }); | |
| 3375 | try scope.appendNode(decl); | |
| 3376 | return ZigTag.identifier.create(t.arena, name); | |
| 3377 | }, | |
| 3378 | } | |
| 3379 | } | |
| 3380 | ||
| 3381 | fn transNarrowStringLiteral( | |
| 3382 | t: *Translator, | |
| 3383 | expr: Node.Index, | |
| 3384 | literal: Node.CharLiteral, | |
| 3385 | ) TransError!ZigNode { | |
| 3386 | const val = t.tree.value_map.get(expr).?; | |
| 3387 | ||
| 3388 | const bytes = t.comp.interner.get(val.ref()).bytes; | |
| 3389 | var allocating: std.Io.Writer.Allocating = try .initCapacity(t.gpa, bytes.len); | |
| 3390 | defer allocating.deinit(); | |
| 3391 | ||
| 3392 | aro.Value.printString(bytes, literal.qt, t.comp, &allocating.writer) catch return error.OutOfMemory; | |
| 3393 | ||
| 3394 | return ZigTag.string_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); | |
| 3395 | } | |
| 3396 | ||
| 3397 | /// Translate a string literal that is initializing an array. In general narrow string | |
| 3398 | /// literals become `"<string>".*` or `"<string>"[0..<size>].*` if they need truncation. | |
| 3399 | /// Wide string literals become an array of integers. zero-fillers pad out the array to | |
| 3400 | /// the appropriate length, if necessary. | |
| 3401 | fn transStringLiteralInitializer( | |
| 3402 | t: *Translator, | |
| 3403 | expr: Node.Index, | |
| 3404 | literal: Node.CharLiteral, | |
| 3405 | array_type: ZigNode, | |
| 3406 | ) TransError!ZigNode { | |
| 3407 | assert(array_type.tag() == .array_type or array_type.tag() == .null_sentinel_array_type); | |
| 3408 | ||
| 3409 | const is_narrow = literal.kind == .ascii or literal.kind == .utf8; | |
| 3410 | ||
| 3411 | // The length of the string literal excluding the sentinel. | |
| 3412 | const str_length = literal.qt.arrayLen(t.comp).? - 1; | |
| 3413 | ||
| 3414 | const payload = (array_type.castTag(.array_type) orelse array_type.castTag(.null_sentinel_array_type).?).data; | |
| 3415 | const array_size = payload.len; | |
| 3416 | const elem_type = payload.elem_type; | |
| 3417 | ||
| 3418 | if (array_size == 0) return ZigTag.empty_array.create(t.arena, array_type); | |
| 3419 | ||
| 3420 | const num_inits = @min(str_length, array_size); | |
| 3421 | if (num_inits == 0) { | |
| 3422 | return ZigTag.array_filler.create(t.arena, .{ | |
| 3423 | .type = elem_type, | |
| 3424 | .filler = ZigTag.zero_literal.init(), | |
| 3425 | .count = array_size, | |
| 3426 | }); | |
| 3427 | } | |
| 3428 | ||
| 3429 | const init_node = if (is_narrow) blk: { | |
| 3430 | // "string literal".* or string literal"[0..num_inits].* | |
| 3431 | var str = try t.transNarrowStringLiteral(expr, literal); | |
| 3432 | if (str_length != array_size) str = try ZigTag.string_slice.create(t.arena, .{ .string = str, .end = num_inits }); | |
| 3433 | break :blk try ZigTag.deref.create(t.arena, str); | |
| 3434 | } else blk: { | |
| 3435 | const size = literal.qt.childType(t.comp).sizeof(t.comp); | |
| 3436 | ||
| 3437 | const val = t.tree.value_map.get(expr).?; | |
| 3438 | const bytes = t.comp.interner.get(val.ref()).bytes; | |
| 3439 | ||
| 3440 | const init_list = try t.arena.alloc(ZigNode, @intCast(num_inits)); | |
| 3441 | for (init_list, 0..) |*item, i| { | |
| 3442 | const codepoint = switch (size) { | |
| 3443 | 2 => @as(*const u16, @ptrCast(@alignCast(bytes.ptr + i * 2))).*, | |
| 3444 | 4 => @as(*const u32, @ptrCast(@alignCast(bytes.ptr + i * 4))).*, | |
| 3445 | else => unreachable, | |
| 3446 | }; | |
| 3447 | item.* = try t.createCharLiteralNode(false, codepoint); | |
| 3448 | } | |
| 3449 | const init_args: ast.Payload.Array.ArrayTypeInfo = .{ .len = num_inits, .elem_type = elem_type }; | |
| 3450 | const init_array_type = if (array_type.tag() == .array_type) | |
| 3451 | try ZigTag.array_type.create(t.arena, init_args) | |
| 3452 | else | |
| 3453 | try ZigTag.null_sentinel_array_type.create(t.arena, init_args); | |
| 3454 | break :blk try ZigTag.array_init.create(t.arena, .{ | |
| 3455 | .cond = init_array_type, | |
| 3456 | .cases = init_list, | |
| 3457 | }); | |
| 3458 | }; | |
| 3459 | ||
| 3460 | if (num_inits == array_size) return init_node; | |
| 3461 | assert(array_size > str_length); // If array_size <= str_length, `num_inits == array_size` and we've already returned. | |
| 3462 | ||
| 3463 | const filler_node = try ZigTag.array_filler.create(t.arena, .{ | |
| 3464 | .type = elem_type, | |
| 3465 | .filler = ZigTag.zero_literal.init(), | |
| 3466 | .count = array_size - str_length, | |
| 3467 | }); | |
| 3468 | return ZigTag.array_cat.create(t.arena, .{ .lhs = init_node, .rhs = filler_node }); | |
| 3469 | } | |
| 3470 | ||
| 3471 | fn transCompoundLiteral( | |
| 3472 | t: *Translator, | |
| 3473 | scope: *Scope, | |
| 3474 | literal: Node.CompoundLiteral, | |
| 3475 | used: ResultUsed, | |
| 3476 | ) TransError!ZigNode { | |
| 3477 | if (used == .unused) { | |
| 3478 | return t.transExpr(scope, literal.initializer, .unused); | |
| 3479 | } | |
| 3480 | ||
| 3481 | // TODO taking a reference to a compound literal should result in a mutable | |
| 3482 | // pointer (unless the literal is const). | |
| 3483 | ||
| 3484 | const initializer = try t.transExprCoercing(scope, literal.initializer, .used); | |
| 3485 | const ty = try t.transType(scope, literal.qt, literal.l_paren_tok); | |
| 3486 | if (!literal.thread_local and literal.storage_class != .static) { | |
| 3487 | // In the simple case a compound literal can be translated | |
| 3488 | // simply as `@as(type, initializer)`. | |
| 3489 | return ZigTag.as.create(t.arena, .{ .lhs = ty, .rhs = initializer }); | |
| 3490 | } | |
| 3491 | ||
| 3492 | // Otherwise static or thread local compound literals are translated as | |
| 3493 | // a reference to a variable wrapped in a struct. | |
| 3494 | ||
| 3495 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 3496 | defer block_scope.deinit(); | |
| 3497 | ||
| 3498 | const tmp = try block_scope.reserveMangledName("tmp"); | |
| 3499 | const wrapped_name = "compound_literal"; | |
| 3500 | ||
| 3501 | // const tmp = struct { var compound_literal = initializer }; | |
| 3502 | const temp_decl = try ZigTag.var_decl.create(t.arena, .{ | |
| 3503 | .is_pub = false, | |
| 3504 | .is_const = literal.qt.@"const", | |
| 3505 | .is_extern = false, | |
| 3506 | .is_export = false, | |
| 3507 | .is_threadlocal = literal.thread_local, | |
| 3508 | .linksection_string = null, | |
| 3509 | .alignment = null, | |
| 3510 | .name = wrapped_name, | |
| 3511 | .type = ty, | |
| 3512 | .init = initializer, | |
| 3513 | }); | |
| 3514 | const wrapped = try ZigTag.wrapped_local.create(t.arena, .{ .name = tmp, .init = temp_decl }); | |
| 3515 | try block_scope.statements.append(t.gpa, wrapped); | |
| 3516 | ||
| 3517 | // break :blk tmp.compound_literal | |
| 3518 | const static_tmp_ident = try ZigTag.identifier.create(t.arena, tmp); | |
| 3519 | const field_access = try ZigTag.field_access.create(t.arena, .{ | |
| 3520 | .lhs = static_tmp_ident, | |
| 3521 | .field_name = wrapped_name, | |
| 3522 | }); | |
| 3523 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 3524 | .label = block_scope.label, | |
| 3525 | .val = field_access, | |
| 3526 | }); | |
| 3527 | try block_scope.statements.append(t.gpa, break_node); | |
| 3528 | ||
| 3529 | return block_scope.complete(); | |
| 3530 | } | |
| 3531 | ||
| 3532 | fn transDefaultInit( | |
| 3533 | t: *Translator, | |
| 3534 | scope: *Scope, | |
| 3535 | default_init: Node.DefaultInit, | |
| 3536 | used: ResultUsed, | |
| 3537 | suppress_as: SuppressCast, | |
| 3538 | ) TransError!ZigNode { | |
| 3539 | assert(used == .used); | |
| 3540 | const type_node = try t.transType(scope, default_init.qt, default_init.last_tok); | |
| 3541 | return try t.createZeroValueNode(default_init.qt, type_node, suppress_as); | |
| 3542 | } | |
| 3543 | ||
| 3544 | fn transArrayInit( | |
| 3545 | t: *Translator, | |
| 3546 | scope: *Scope, | |
| 3547 | array_init: Node.ContainerInit, | |
| 3548 | used: ResultUsed, | |
| 3549 | ) TransError!ZigNode { | |
| 3550 | assert(used == .used); | |
| 3551 | const array_item_qt = array_init.container_qt.childType(t.comp); | |
| 3552 | const array_item_type = try t.transType(scope, array_item_qt, array_init.l_brace_tok); | |
| 3553 | var maybe_lhs: ?ZigNode = null; | |
| 3554 | var val_list: std.ArrayListUnmanaged(ZigNode) = .empty; | |
| 3555 | defer val_list.deinit(t.gpa); | |
| 3556 | var i: usize = 0; | |
| 3557 | while (i < array_init.items.len) { | |
| 3558 | const rhs = switch (array_init.items[i].get(t.tree)) { | |
| 3559 | .array_filler_expr => |array_filler| blk: { | |
| 3560 | const node = try ZigTag.array_filler.create(t.arena, .{ | |
| 3561 | .type = array_item_type, | |
| 3562 | .filler = try t.createZeroValueNode(array_item_qt, array_item_type, .no_as), | |
| 3563 | .count = @intCast(array_filler.count), | |
| 3564 | }); | |
| 3565 | i += 1; | |
| 3566 | break :blk node; | |
| 3567 | }, | |
| 3568 | else => blk: { | |
| 3569 | defer val_list.clearRetainingCapacity(); | |
| 3570 | while (i < array_init.items.len) : (i += 1) { | |
| 3571 | if (array_init.items[i].get(t.tree) == .array_filler_expr) break; | |
| 3572 | const expr = try t.transExprCoercing(scope, array_init.items[i], .used); | |
| 3573 | try val_list.append(t.gpa, expr); | |
| 3574 | } | |
| 3575 | const array_type = try ZigTag.array_type.create(t.arena, .{ | |
| 3576 | .elem_type = array_item_type, | |
| 3577 | .len = val_list.items.len, | |
| 3578 | }); | |
| 3579 | const array_init_node = try ZigTag.array_init.create(t.arena, .{ | |
| 3580 | .cond = array_type, | |
| 3581 | .cases = try t.arena.dupe(ZigNode, val_list.items), | |
| 3582 | }); | |
| 3583 | break :blk array_init_node; | |
| 3584 | }, | |
| 3585 | }; | |
| 3586 | maybe_lhs = if (maybe_lhs) |lhs| blk: { | |
| 3587 | const cat = try ZigTag.array_cat.create(t.arena, .{ | |
| 3588 | .lhs = lhs, | |
| 3589 | .rhs = rhs, | |
| 3590 | }); | |
| 3591 | break :blk cat; | |
| 3592 | } else rhs; | |
| 3593 | } | |
| 3594 | return maybe_lhs orelse try ZigTag.container_init_dot.create(t.arena, &.{}); | |
| 3595 | } | |
| 3596 | ||
| 3597 | fn transUnionInit( | |
| 3598 | t: *Translator, | |
| 3599 | scope: *Scope, | |
| 3600 | union_init: Node.UnionInit, | |
| 3601 | used: ResultUsed, | |
| 3602 | ) TransError!ZigNode { | |
| 3603 | assert(used == .used); | |
| 3604 | const init_expr = union_init.initializer orelse | |
| 3605 | return ZigTag.undefined_literal.init(); | |
| 3606 | ||
| 3607 | if (init_expr.get(t.tree) == .default_init_expr) { | |
| 3608 | return try t.transExpr(scope, init_expr, used); | |
| 3609 | } | |
| 3610 | ||
| 3611 | const union_type = try t.transType(scope, union_init.union_qt, union_init.l_brace_tok); | |
| 3612 | ||
| 3613 | const union_base = union_init.union_qt.base(t.comp); | |
| 3614 | const field = union_base.type.@"union".fields[union_init.field_index]; | |
| 3615 | const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ | |
| 3616 | .parent = union_base.qt, | |
| 3617 | .field = field.qt, | |
| 3618 | }).? else field.name.lookup(t.comp); | |
| 3619 | ||
| 3620 | const field_init = try t.arena.create(ast.Payload.ContainerInit.Initializer); | |
| 3621 | field_init.* = .{ | |
| 3622 | .name = field_name, | |
| 3623 | .value = try t.transExprCoercing(scope, init_expr, .used), | |
| 3624 | }; | |
| 3625 | const container_init = try ZigTag.container_init.create(t.arena, .{ | |
| 3626 | .lhs = union_type, | |
| 3627 | .inits = field_init[0..1], | |
| 3628 | }); | |
| 3629 | return container_init; | |
| 3630 | } | |
| 3631 | ||
| 3632 | fn transStructInit( | |
| 3633 | t: *Translator, | |
| 3634 | scope: *Scope, | |
| 3635 | struct_init: Node.ContainerInit, | |
| 3636 | used: ResultUsed, | |
| 3637 | ) TransError!ZigNode { | |
| 3638 | assert(used == .used); | |
| 3639 | const struct_type = try t.transType(scope, struct_init.container_qt, struct_init.l_brace_tok); | |
| 3640 | const field_inits = try t.arena.alloc(ast.Payload.ContainerInit.Initializer, struct_init.items.len); | |
| 3641 | ||
| 3642 | const struct_base = struct_init.container_qt.base(t.comp); | |
| 3643 | for ( | |
| 3644 | field_inits, | |
| 3645 | struct_init.items, | |
| 3646 | struct_base.type.@"struct".fields, | |
| 3647 | ) |*init, field_expr, field| { | |
| 3648 | const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ | |
| 3649 | .parent = struct_base.qt, | |
| 3650 | .field = field.qt, | |
| 3651 | }).? else field.name.lookup(t.comp); | |
| 3652 | init.* = .{ | |
| 3653 | .name = field_name, | |
| 3654 | .value = try t.transExprCoercing(scope, field_expr, .used), | |
| 3655 | }; | |
| 3656 | } | |
| 3657 | ||
| 3658 | const container_init = try ZigTag.container_init.create(t.arena, .{ | |
| 3659 | .lhs = struct_type, | |
| 3660 | .inits = field_inits, | |
| 3661 | }); | |
| 3662 | return container_init; | |
| 3663 | } | |
| 3664 | ||
| 3665 | fn transTypeInfo( | |
| 3666 | t: *Translator, | |
| 3667 | scope: *Scope, | |
| 3668 | op: ZigTag, | |
| 3669 | typeinfo: Node.TypeInfo, | |
| 3670 | ) TransError!ZigNode { | |
| 3671 | const operand = operand: { | |
| 3672 | if (typeinfo.expr) |expr| { | |
| 3673 | const operand = try t.transExpr(scope, expr, .used); | |
| 3674 | break :operand try ZigTag.typeof.create(t.arena, operand); | |
| 3675 | } | |
| 3676 | break :operand try t.transType(scope, typeinfo.operand_qt, typeinfo.op_tok); | |
| 3677 | }; | |
| 3678 | ||
| 3679 | const payload = try t.arena.create(ast.Payload.UnOp); | |
| 3680 | payload.* = .{ | |
| 3681 | .base = .{ .tag = op }, | |
| 3682 | .data = operand, | |
| 3683 | }; | |
| 3684 | return ZigNode.initPayload(&payload.base); | |
| 3685 | } | |
| 3686 | ||
| 3687 | fn transStmtExpr( | |
| 3688 | t: *Translator, | |
| 3689 | scope: *Scope, | |
| 3690 | stmt_expr: Node.Unary, | |
| 3691 | used: ResultUsed, | |
| 3692 | ) TransError!ZigNode { | |
| 3693 | const compound_stmt = stmt_expr.operand.get(t.tree).compound_stmt; | |
| 3694 | if (used == .unused) { | |
| 3695 | return t.transCompoundStmt(scope, compound_stmt); | |
| 3696 | } | |
| 3697 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 3698 | defer block_scope.deinit(); | |
| 3699 | ||
| 3700 | for (compound_stmt.body[0 .. compound_stmt.body.len - 1]) |stmt| { | |
| 3701 | const result = try t.transStmt(&block_scope.base, stmt); | |
| 3702 | switch (result.tag()) { | |
| 3703 | .declaration, .empty_block => {}, | |
| 3704 | else => try block_scope.statements.append(t.gpa, result), | |
| 3705 | } | |
| 3706 | } | |
| 3707 | ||
| 3708 | const last_result = try t.transExpr(&block_scope.base, compound_stmt.body[compound_stmt.body.len - 1], .used); | |
| 3709 | switch (last_result.tag()) { | |
| 3710 | .declaration, .empty_block => {}, | |
| 3711 | else => { | |
| 3712 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 3713 | .label = block_scope.label, | |
| 3714 | .val = last_result, | |
| 3715 | }); | |
| 3716 | try block_scope.statements.append(t.gpa, break_node); | |
| 3717 | }, | |
| 3718 | } | |
| 3719 | return block_scope.complete(); | |
| 3720 | } | |
| 3721 | ||
| 3722 | fn transConvertvectorExpr( | |
| 3723 | t: *Translator, | |
| 3724 | scope: *Scope, | |
| 3725 | convertvector: Node.Convertvector, | |
| 3726 | ) TransError!ZigNode { | |
| 3727 | var block_scope = try Scope.Block.init(t, scope, true); | |
| 3728 | defer block_scope.deinit(); | |
| 3729 | ||
| 3730 | const src_expr_node = try t.transExpr(&block_scope.base, convertvector.operand, .used); | |
| 3731 | const tmp = try block_scope.reserveMangledName("tmp"); | |
| 3732 | const tmp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = tmp, .init = src_expr_node }); | |
| 3733 | try block_scope.statements.append(t.gpa, tmp_decl); | |
| 3734 | const tmp_ident = try ZigTag.identifier.create(t.arena, tmp); | |
| 3735 | ||
| 3736 | const dest_type_node = try t.transType(&block_scope.base, convertvector.dest_qt, convertvector.builtin_tok); | |
| 3737 | const dest_vec_ty = convertvector.dest_qt.get(t.comp, .vector).?; | |
| 3738 | const src_vec_ty = convertvector.operand.qt(t.tree).get(t.comp, .vector).?; | |
| 3739 | ||
| 3740 | const src_elem_sk = src_vec_ty.elem.scalarKind(t.comp); | |
| 3741 | const dest_elem_sk = convertvector.dest_qt.childType(t.comp).scalarKind(t.comp); | |
| 3742 | ||
| 3743 | const items = try t.arena.alloc(ZigNode, dest_vec_ty.len); | |
| 3744 | for (items, 0..dest_vec_ty.len) |*item, i| { | |
| 3745 | const value = try ZigTag.array_access.create(t.arena, .{ | |
| 3746 | .lhs = tmp_ident, | |
| 3747 | .rhs = try t.createNumberNode(i, .int), | |
| 3748 | }); | |
| 3749 | ||
| 3750 | if (src_elem_sk == .float and dest_elem_sk == .float) { | |
| 3751 | item.* = try ZigTag.float_cast.create(t.arena, value); | |
| 3752 | } else if (src_elem_sk == .float) { | |
| 3753 | item.* = try ZigTag.int_from_float.create(t.arena, value); | |
| 3754 | } else if (dest_elem_sk == .float) { | |
| 3755 | item.* = try ZigTag.float_from_int.create(t.arena, value); | |
| 3756 | } else { | |
| 3757 | item.* = try t.transIntCast(value, src_vec_ty.elem, dest_vec_ty.elem); | |
| 3758 | } | |
| 3759 | } | |
| 3760 | ||
| 3761 | const vec_init = try ZigTag.array_init.create(t.arena, .{ | |
| 3762 | .cond = dest_type_node, | |
| 3763 | .cases = items, | |
| 3764 | }); | |
| 3765 | const break_node = try ZigTag.break_val.create(t.arena, .{ | |
| 3766 | .label = block_scope.label, | |
| 3767 | .val = vec_init, | |
| 3768 | }); | |
| 3769 | try block_scope.statements.append(t.gpa, break_node); | |
| 3770 | ||
| 3771 | return block_scope.complete(); | |
| 3772 | } | |
| 3773 | ||
| 3774 | fn transShufflevectorExpr( | |
| 3775 | t: *Translator, | |
| 3776 | scope: *Scope, | |
| 3777 | shufflevector: Node.Shufflevector, | |
| 3778 | ) TransError!ZigNode { | |
| 3779 | if (shufflevector.indexes.len == 0) { | |
| 3780 | return t.fail(error.UnsupportedTranslation, shufflevector.builtin_tok, "@shuffle needs at least 1 index", .{}); | |
| 3781 | } | |
| 3782 | ||
| 3783 | const a = try t.transExpr(scope, shufflevector.lhs, .used); | |
| 3784 | const b = try t.transExpr(scope, shufflevector.rhs, .used); | |
| 3785 | ||
| 3786 | // First two arguments to __builtin_shufflevector must be the same type | |
| 3787 | const vector_child_type = try t.vectorTypeInfo(a, "child"); | |
| 3788 | const vector_len = try t.vectorTypeInfo(a, "len"); | |
| 3789 | const shuffle_mask = blk: { | |
| 3790 | const mask_len = shufflevector.indexes.len; | |
| 3791 | ||
| 3792 | const mask_type = try ZigTag.vector.create(t.arena, .{ | |
| 3793 | .lhs = try t.createNumberNode(mask_len, .int), | |
| 3794 | .rhs = try ZigTag.type.create(t.arena, "i32"), | |
| 3795 | }); | |
| 3796 | ||
| 3797 | const init_list = try t.arena.alloc(ZigNode, mask_len); | |
| 3798 | for (init_list, shufflevector.indexes) |*init, index| { | |
| 3799 | const index_expr = try t.transExprCoercing(scope, index, .used); | |
| 3800 | const converted_index = try t.createHelperCallNode(.shuffleVectorIndex, &.{ index_expr, vector_len }); | |
| 3801 | init.* = converted_index; | |
| 3802 | } | |
| 3803 | ||
| 3804 | break :blk try ZigTag.array_init.create(t.arena, .{ | |
| 3805 | .cond = mask_type, | |
| 3806 | .cases = init_list, | |
| 3807 | }); | |
| 3808 | }; | |
| 3809 | ||
| 3810 | return ZigTag.shuffle.create(t.arena, .{ | |
| 3811 | .element_type = vector_child_type, | |
| 3812 | .a = a, | |
| 3813 | .b = b, | |
| 3814 | .mask_vector = shuffle_mask, | |
| 3815 | }); | |
| 3816 | } | |
| 3817 | ||
| 3818 | // ===================== | |
| 3819 | // Node creation helpers | |
| 3820 | // ===================== | |
| 3821 | ||
| 3822 | fn createZeroValueNode( | |
| 3823 | t: *Translator, | |
| 3824 | qt: QualType, | |
| 3825 | type_node: ZigNode, | |
| 3826 | suppress_as: SuppressCast, | |
| 3827 | ) !ZigNode { | |
| 3828 | switch (qt.base(t.comp).type) { | |
| 3829 | .bool => return ZigTag.false_literal.init(), | |
| 3830 | .int, .bit_int, .float => { | |
| 3831 | const zero_literal = ZigTag.zero_literal.init(); | |
| 3832 | return switch (suppress_as) { | |
| 3833 | .with_as => try t.createBinOpNode(.as, type_node, zero_literal), | |
| 3834 | .no_as => zero_literal, | |
| 3835 | }; | |
| 3836 | }, | |
| 3837 | .pointer => { | |
| 3838 | const null_literal = ZigTag.null_literal.init(); | |
| 3839 | return switch (suppress_as) { | |
| 3840 | .with_as => try t.createBinOpNode(.as, type_node, null_literal), | |
| 3841 | .no_as => null_literal, | |
| 3842 | }; | |
| 3843 | }, | |
| 3844 | else => {}, | |
| 3845 | } | |
| 3846 | return try ZigTag.std_mem_zeroes.create(t.arena, type_node); | |
| 3847 | } | |
| 3848 | ||
| 3849 | fn createIntNode(t: *Translator, int: aro.Value) !ZigNode { | |
| 3850 | var space: aro.Interner.Tag.Int.BigIntSpace = undefined; | |
| 3851 | var big = t.comp.interner.get(int.ref()).toBigInt(&space); | |
| 3852 | const is_negative = !big.positive; | |
| 3853 | big.positive = true; | |
| 3854 | ||
| 3855 | const str = big.toStringAlloc(t.arena, 10, .lower) catch |err| switch (err) { | |
| 3856 | error.OutOfMemory => return error.OutOfMemory, | |
| 3857 | }; | |
| 3858 | const res = try ZigTag.integer_literal.create(t.arena, str); | |
| 3859 | if (is_negative) return ZigTag.negate.create(t.arena, res); | |
| 3860 | return res; | |
| 3861 | } | |
| 3862 | ||
| 3863 | fn createNumberNode(t: *Translator, num: anytype, num_kind: enum { int, float }) !ZigNode { | |
| 3864 | const fmt_s = switch (@typeInfo(@TypeOf(num))) { | |
| 3865 | .int, .comptime_int => "{d}", | |
| 3866 | else => "{s}", | |
| 3867 | }; | |
| 3868 | const str = try std.fmt.allocPrint(t.arena, fmt_s, .{num}); | |
| 3869 | if (num_kind == .float) | |
| 3870 | return ZigTag.float_literal.create(t.arena, str) | |
| 3871 | else | |
| 3872 | return ZigTag.integer_literal.create(t.arena, str); | |
| 3873 | } | |
| 3874 | ||
| 3875 | fn createCharLiteralNode(t: *Translator, narrow: bool, val: u32) TransError!ZigNode { | |
| 3876 | return ZigTag.char_literal.create(t.arena, if (narrow) | |
| 3877 | try std.fmt.allocPrint(t.arena, "'{f}'", .{std.zig.fmtChar(@as(u8, @intCast(val)))}) | |
| 3878 | else | |
| 3879 | try std.fmt.allocPrint(t.arena, "'\\u{{{x}}}'", .{val})); | |
| 3880 | } | |
| 3881 | ||
| 3882 | fn createBinOpNode( | |
| 3883 | t: *Translator, | |
| 3884 | op: ZigTag, | |
| 3885 | lhs: ZigNode, | |
| 3886 | rhs: ZigNode, | |
| 3887 | ) !ZigNode { | |
| 3888 | const payload = try t.arena.create(ast.Payload.BinOp); | |
| 3889 | payload.* = .{ | |
| 3890 | .base = .{ .tag = op }, | |
| 3891 | .data = .{ | |
| 3892 | .lhs = lhs, | |
| 3893 | .rhs = rhs, | |
| 3894 | }, | |
| 3895 | }; | |
| 3896 | return ZigNode.initPayload(&payload.base); | |
| 3897 | } | |
| 3898 | ||
| 3899 | pub fn createHelperCallNode(t: *Translator, name: std.meta.DeclEnum(std.zig.c_translation.helpers), args_opt: ?[]const ZigNode) !ZigNode { | |
| 3900 | if (args_opt) |args| { | |
| 3901 | return ZigTag.helper_call.create(t.arena, .{ | |
| 3902 | .name = @tagName(name), | |
| 3903 | .args = try t.arena.dupe(ZigNode, args), | |
| 3904 | }); | |
| 3905 | } else { | |
| 3906 | return ZigTag.helper_ref.create(t.arena, @tagName(name)); | |
| 3907 | } | |
| 3908 | } | |
| 3909 | ||
| 3910 | /// Cast a signed integer node to a usize, for use in pointer arithmetic. Negative numbers | |
| 3911 | /// will become very large positive numbers but that is ok since we only use this in | |
| 3912 | /// pointer arithmetic expressions, where wraparound will ensure we get the correct value. | |
| 3913 | /// node -> @as(usize, @bitCast(@as(isize, @intCast(node)))) | |
| 3914 | fn usizeCastForWrappingPtrArithmetic(t: *Translator, node: ZigNode) TransError!ZigNode { | |
| 3915 | const intcast_node = try ZigTag.as.create(t.arena, .{ | |
| 3916 | .lhs = try ZigTag.type.create(t.arena, "isize"), | |
| 3917 | .rhs = try ZigTag.int_cast.create(t.arena, node), | |
| 3918 | }); | |
| 3919 | ||
| 3920 | return ZigTag.as.create(t.arena, .{ | |
| 3921 | .lhs = try ZigTag.type.create(t.arena, "usize"), | |
| 3922 | .rhs = try ZigTag.bit_cast.create(t.arena, intcast_node), | |
| 3923 | }); | |
| 3924 | } | |
| 3925 | ||
| 3926 | /// @typeInfo(@TypeOf(vec_node)).vector.<field> | |
| 3927 | fn vectorTypeInfo(t: *Translator, vec_node: ZigNode, field: []const u8) TransError!ZigNode { | |
| 3928 | const typeof_call = try ZigTag.typeof.create(t.arena, vec_node); | |
| 3929 | const typeinfo_call = try ZigTag.typeinfo.create(t.arena, typeof_call); | |
| 3930 | const vector_type_info = try ZigTag.field_access.create(t.arena, .{ .lhs = typeinfo_call, .field_name = "vector" }); | |
| 3931 | return ZigTag.field_access.create(t.arena, .{ .lhs = vector_type_info, .field_name = field }); | |
| 3932 | } | |
| 3933 | ||
| 3934 | /// Build a getter function for a flexible array field in a C record | |
| 3935 | /// e.g. `T items[]` or `T items[0]`. The generated function returns a [*c] pointer | |
| 3936 | /// to the flexible array with the correct const and volatile qualifiers | |
| 3937 | fn createFlexibleMemberFn( | |
| 3938 | t: *Translator, | |
| 3939 | member_name: []const u8, | |
| 3940 | field_name: []const u8, | |
| 3941 | ) Error!ZigNode { | |
| 3942 | const self_param_name = "self"; | |
| 3943 | const self_param = try ZigTag.identifier.create(t.arena, self_param_name); | |
| 3944 | const self_type = try ZigTag.typeof.create(t.arena, self_param); | |
| 3945 | ||
| 3946 | const fn_params = try t.arena.alloc(ast.Payload.Param, 1); | |
| 3947 | fn_params[0] = .{ | |
| 3948 | .name = self_param_name, | |
| 3949 | .type = ZigTag.@"anytype".init(), | |
| 3950 | .is_noalias = false, | |
| 3951 | }; | |
| 3952 | ||
| 3953 | // @typeInfo(@TypeOf(self.*.<field_name>)).pointer.child | |
| 3954 | const dereffed = try ZigTag.deref.create(t.arena, self_param); | |
| 3955 | const field_access = try ZigTag.field_access.create(t.arena, .{ .lhs = dereffed, .field_name = field_name }); | |
| 3956 | const type_of = try ZigTag.typeof.create(t.arena, field_access); | |
| 3957 | const type_info = try ZigTag.typeinfo.create(t.arena, type_of); | |
| 3958 | const array_info = try ZigTag.field_access.create(t.arena, .{ .lhs = type_info, .field_name = "array" }); | |
| 3959 | const child_info = try ZigTag.field_access.create(t.arena, .{ .lhs = array_info, .field_name = "child" }); | |
| 3960 | ||
| 3961 | const return_type = try t.createHelperCallNode(.FlexibleArrayType, &.{ self_type, child_info }); | |
| 3962 | ||
| 3963 | // return @ptrCast(&self.*.<field_name>); | |
| 3964 | const address_of = try ZigTag.address_of.create(t.arena, field_access); | |
| 3965 | const casted = try ZigTag.ptr_cast.create(t.arena, address_of); | |
| 3966 | const return_stmt = try ZigTag.@"return".create(t.arena, casted); | |
| 3967 | const body = try ZigTag.block_single.create(t.arena, return_stmt); | |
| 3968 | ||
| 3969 | return ZigTag.func.create(t.arena, .{ | |
| 3970 | .is_pub = true, | |
| 3971 | .is_extern = false, | |
| 3972 | .is_export = false, | |
| 3973 | .is_inline = false, | |
| 3974 | .is_var_args = false, | |
| 3975 | .name = member_name, | |
| 3976 | .linksection_string = null, | |
| 3977 | .explicit_callconv = null, | |
| 3978 | .params = fn_params, | |
| 3979 | .return_type = return_type, | |
| 3980 | .body = body, | |
| 3981 | .alignment = null, | |
| 3982 | }); | |
| 3983 | } | |
| 3984 | ||
| 3985 | // ================= | |
| 3986 | // Macro translation | |
| 3987 | // ================= | |
| 3988 | ||
| 3989 | fn transMacros(t: *Translator) !void { | |
| 3990 | var tok_list: std.ArrayList(CToken) = .empty; | |
| 3991 | defer tok_list.deinit(t.gpa); | |
| 3992 | ||
| 3993 | var pattern_list = try PatternList.init(t.gpa); | |
| 3994 | defer pattern_list.deinit(t.gpa); | |
| 3995 | ||
| 3996 | for (t.pp.defines.keys(), t.pp.defines.values()) |name, macro| { | |
| 3997 | if (macro.is_builtin) continue; | |
| 3998 | if (t.global_scope.containsNow(name)) { | |
| 3999 | continue; | |
| 4000 | } | |
| 4001 | ||
| 4002 | tok_list.items.len = 0; | |
| 4003 | try tok_list.ensureUnusedCapacity(t.gpa, macro.tokens.len); | |
| 4004 | for (macro.tokens) |tok| { | |
| 4005 | switch (tok.id) { | |
| 4006 | .invalid => continue, | |
| 4007 | .whitespace => continue, | |
| 4008 | .comment => continue, | |
| 4009 | .macro_ws => continue, | |
| 4010 | else => {}, | |
| 4011 | } | |
| 4012 | tok_list.appendAssumeCapacity(tok); | |
| 4013 | } | |
| 4014 | ||
| 4015 | if (macro.is_func) { | |
| 4016 | const ms: PatternList.MacroSlicer = .{ | |
| 4017 | .tokens = tok_list.items, | |
| 4018 | .source = t.comp.getSource(macro.loc.id).buf, | |
| 4019 | .params = @intCast(macro.params.len), | |
| 4020 | }; | |
| 4021 | if (try pattern_list.match(ms)) |impl| { | |
| 4022 | const decl = try ZigTag.pub_var_simple.create(t.arena, .{ | |
| 4023 | .name = name, | |
| 4024 | .init = try t.createHelperCallNode(impl, null), | |
| 4025 | }); | |
| 4026 | try t.addTopLevelDecl(name, decl); | |
| 4027 | continue; | |
| 4028 | } | |
| 4029 | } | |
| 4030 | ||
| 4031 | if (t.checkTranslatableMacro(tok_list.items, macro.params)) |err| { | |
| 4032 | switch (err) { | |
| 4033 | .undefined_identifier => |ident| try t.failDeclExtra(&t.global_scope.base, macro.loc, name, "unable to translate macro: undefined identifier `{s}`", .{ident}), | |
| 4034 | .invalid_arg_usage => |ident| try t.failDeclExtra(&t.global_scope.base, macro.loc, name, "unable to translate macro: untranslatable usage of arg `{s}`", .{ident}), | |
| 4035 | } | |
| 4036 | continue; | |
| 4037 | } | |
| 4038 | ||
| 4039 | var macro_translator: MacroTranslator = .{ | |
| 4040 | .t = t, | |
| 4041 | .tokens = tok_list.items, | |
| 4042 | .source = t.comp.getSource(macro.loc.id).buf, | |
| 4043 | .name = name, | |
| 4044 | .macro = macro, | |
| 4045 | }; | |
| 4046 | ||
| 4047 | const res = if (macro.is_func) | |
| 4048 | macro_translator.transFnMacro() | |
| 4049 | else | |
| 4050 | macro_translator.transMacro(); | |
| 4051 | res catch |err| switch (err) { | |
| 4052 | error.ParseError => continue, | |
| 4053 | error.OutOfMemory => |e| return e, | |
| 4054 | }; | |
| 4055 | } | |
| 4056 | } | |
| 4057 | ||
| 4058 | const MacroTranslateError = union(enum) { | |
| 4059 | undefined_identifier: []const u8, | |
| 4060 | invalid_arg_usage: []const u8, | |
| 4061 | }; | |
| 4062 | ||
| 4063 | fn checkTranslatableMacro(t: *Translator, tokens: []const CToken, params: []const []const u8) ?MacroTranslateError { | |
| 4064 | var last_is_type_kw = false; | |
| 4065 | var i: usize = 0; | |
| 4066 | while (i < tokens.len) : (i += 1) { | |
| 4067 | const token = tokens[i]; | |
| 4068 | switch (token.id) { | |
| 4069 | .period, .arrow => i += 1, // skip next token since field identifiers can be unknown | |
| 4070 | .keyword_struct, .keyword_union, .keyword_enum => if (!last_is_type_kw) { | |
| 4071 | last_is_type_kw = true; | |
| 4072 | continue; | |
| 4073 | }, | |
| 4074 | .macro_param, .macro_param_no_expand => { | |
| 4075 | if (last_is_type_kw) { | |
| 4076 | return .{ .invalid_arg_usage = params[token.end] }; | |
| 4077 | } | |
| 4078 | }, | |
| 4079 | .identifier, .extended_identifier => { | |
| 4080 | const identifier = t.pp.tokSlice(token); | |
| 4081 | if (!t.global_scope.contains(identifier) and !builtins.map.has(identifier)) { | |
| 4082 | return .{ .undefined_identifier = identifier }; | |
| 4083 | } | |
| 4084 | }, | |
| 4085 | else => {}, | |
| 4086 | } | |
| 4087 | last_is_type_kw = false; | |
| 4088 | } | |
| 4089 | return null; | |
| 4090 | } | |
| 4091 | ||
| 4092 | fn getContainer(t: *Translator, node: ZigNode) ?ZigNode { | |
| 4093 | switch (node.tag()) { | |
| 4094 | .@"union", | |
| 4095 | .@"struct", | |
| 4096 | .address_of, | |
| 4097 | .bit_not, | |
| 4098 | .not, | |
| 4099 | .optional_type, | |
| 4100 | .negate, | |
| 4101 | .negate_wrap, | |
| 4102 | .array_type, | |
| 4103 | .c_pointer, | |
| 4104 | .single_pointer, | |
| 4105 | => return node, | |
| 4106 | ||
| 4107 | .identifier => { | |
| 4108 | const ident = node.castTag(.identifier).?; | |
| 4109 | if (t.global_scope.sym_table.get(ident.data)) |value| { | |
| 4110 | if (value.castTag(.var_decl)) |var_decl| | |
| 4111 | return t.getContainer(var_decl.data.init.?); | |
| 4112 | if (value.castTag(.var_simple) orelse value.castTag(.pub_var_simple)) |var_decl| | |
| 4113 | return t.getContainer(var_decl.data.init); | |
| 4114 | } | |
| 4115 | }, | |
| 4116 | ||
| 4117 | .field_access => { | |
| 4118 | const field_access = node.castTag(.field_access).?; | |
| 4119 | ||
| 4120 | if (t.getContainerTypeOf(field_access.data.lhs)) |ty_node| { | |
| 4121 | if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { | |
| 4122 | for (container.data.fields) |field| { | |
| 4123 | if (mem.eql(u8, field.name, field_access.data.field_name)) { | |
| 4124 | return t.getContainer(field.type); | |
| 4125 | } | |
| 4126 | } | |
| 4127 | } | |
| 4128 | } | |
| 4129 | }, | |
| 4130 | ||
| 4131 | else => {}, | |
| 4132 | } | |
| 4133 | return null; | |
| 4134 | } | |
| 4135 | ||
| 4136 | fn getContainerTypeOf(t: *Translator, ref: ZigNode) ?ZigNode { | |
| 4137 | if (ref.castTag(.identifier)) |ident| { | |
| 4138 | if (t.global_scope.sym_table.get(ident.data)) |value| { | |
| 4139 | if (value.castTag(.var_decl)) |var_decl| { | |
| 4140 | return t.getContainer(var_decl.data.type); | |
| 4141 | } | |
| 4142 | } | |
| 4143 | } else if (ref.castTag(.field_access)) |field_access| { | |
| 4144 | if (t.getContainerTypeOf(field_access.data.lhs)) |ty_node| { | |
| 4145 | if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { | |
| 4146 | for (container.data.fields) |field| { | |
| 4147 | if (mem.eql(u8, field.name, field_access.data.field_name)) { | |
| 4148 | return t.getContainer(field.type); | |
| 4149 | } | |
| 4150 | } | |
| 4151 | } else return ty_node; | |
| 4152 | } | |
| 4153 | } | |
| 4154 | return null; | |
| 4155 | } | |
| 4156 | ||
| 4157 | pub fn getFnProto(t: *Translator, ref: ZigNode) ?*ast.Payload.Func { | |
| 4158 | const init = if (ref.castTag(.var_decl)) |v| | |
| 4159 | v.data.init orelse return null | |
| 4160 | else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| | |
| 4161 | v.data.init | |
| 4162 | else | |
| 4163 | return null; | |
| 4164 | if (t.getContainerTypeOf(init)) |ty_node| { | |
| 4165 | if (ty_node.castTag(.optional_type)) |prefix| { | |
| 4166 | if (prefix.data.castTag(.single_pointer)) |sp| { | |
| 4167 | if (sp.data.elem_type.castTag(.func)) |fn_proto| { | |
| 4168 | return fn_proto; | |
| 4169 | } | |
| 4170 | } | |
| 4171 | } | |
| 4172 | } | |
| 4173 | return null; | |
| 4174 | } |
lib/compiler/translate-c/ast.zig created+3063| ... | ... | @@ -0,0 +1,3063 @@ |
| 1 | const std = @import("std"); | |
| 2 | const Allocator = std.mem.Allocator; | |
| 3 | ||
| 4 | pub const Node = extern union { | |
| 5 | /// If the tag value is less than Tag.no_payload_count, then no pointer | |
| 6 | /// dereference is needed. | |
| 7 | tag_if_small_enough: usize, | |
| 8 | ptr_otherwise: *Payload, | |
| 9 | ||
| 10 | pub const Tag = enum { | |
| 11 | /// Declarations add themselves to the correct scopes and should not be emitted as this tag. | |
| 12 | declaration, | |
| 13 | null_literal, | |
| 14 | undefined_literal, | |
| 15 | /// opaque {} | |
| 16 | opaque_literal, | |
| 17 | true_literal, | |
| 18 | false_literal, | |
| 19 | empty_block, | |
| 20 | return_void, | |
| 21 | zero_literal, | |
| 22 | one_literal, | |
| 23 | @"unreachable", | |
| 24 | void_type, | |
| 25 | noreturn_type, | |
| 26 | @"anytype", | |
| 27 | @"continue", | |
| 28 | @"break", | |
| 29 | // After this, the tag requires a payload. | |
| 30 | ||
| 31 | integer_literal, | |
| 32 | float_literal, | |
| 33 | string_literal, | |
| 34 | char_literal, | |
| 35 | enum_literal, | |
| 36 | /// "string"[0..end] | |
| 37 | string_slice, | |
| 38 | identifier, | |
| 39 | @"if", | |
| 40 | /// if (!operand) break; | |
| 41 | if_not_break, | |
| 42 | @"while", | |
| 43 | /// while (true) operand | |
| 44 | while_true, | |
| 45 | @"switch", | |
| 46 | /// else => operand, | |
| 47 | switch_else, | |
| 48 | /// items => body, | |
| 49 | switch_prong, | |
| 50 | break_val, | |
| 51 | @"return", | |
| 52 | field_access, | |
| 53 | array_access, | |
| 54 | call, | |
| 55 | var_decl, | |
| 56 | /// const name = struct { init } | |
| 57 | wrapped_local, | |
| 58 | /// var name = init.* | |
| 59 | mut_str, | |
| 60 | func, | |
| 61 | warning, | |
| 62 | @"struct", | |
| 63 | @"union", | |
| 64 | @"opaque", | |
| 65 | @"comptime", | |
| 66 | @"defer", | |
| 67 | array_init, | |
| 68 | tuple, | |
| 69 | container_init, | |
| 70 | container_init_dot, | |
| 71 | /// _ = operand; | |
| 72 | discard, | |
| 73 | ||
| 74 | // a + b | |
| 75 | add, | |
| 76 | // a = b | |
| 77 | add_assign, | |
| 78 | // c = (a = b) | |
| 79 | add_wrap, | |
| 80 | add_wrap_assign, | |
| 81 | sub, | |
| 82 | sub_assign, | |
| 83 | sub_wrap, | |
| 84 | sub_wrap_assign, | |
| 85 | mul, | |
| 86 | mul_assign, | |
| 87 | mul_wrap, | |
| 88 | mul_wrap_assign, | |
| 89 | div, | |
| 90 | div_assign, | |
| 91 | shl, | |
| 92 | shl_assign, | |
| 93 | shr, | |
| 94 | shr_assign, | |
| 95 | mod, | |
| 96 | mod_assign, | |
| 97 | @"and", | |
| 98 | @"or", | |
| 99 | less_than, | |
| 100 | less_than_equal, | |
| 101 | greater_than, | |
| 102 | greater_than_equal, | |
| 103 | equal, | |
| 104 | not_equal, | |
| 105 | bit_and, | |
| 106 | bit_and_assign, | |
| 107 | bit_or, | |
| 108 | bit_or_assign, | |
| 109 | bit_xor, | |
| 110 | bit_xor_assign, | |
| 111 | array_cat, | |
| 112 | ellipsis3, | |
| 113 | assign, | |
| 114 | ||
| 115 | /// @intCast(operand) | |
| 116 | int_cast, | |
| 117 | /// @constCast(operand) | |
| 118 | const_cast, | |
| 119 | /// @volatileCast(operand) | |
| 120 | volatile_cast, | |
| 121 | /// @divTrunc(lhs, rhs) | |
| 122 | div_trunc, | |
| 123 | /// @intFromBool(operand) | |
| 124 | int_from_bool, | |
| 125 | /// @as(lhs, rhs) | |
| 126 | as, | |
| 127 | /// @truncate(operand) | |
| 128 | truncate, | |
| 129 | /// @bitCast(operand) | |
| 130 | bit_cast, | |
| 131 | /// @floatCast(operand) | |
| 132 | float_cast, | |
| 133 | /// @intFromFloat(operand) | |
| 134 | int_from_float, | |
| 135 | /// @floatFromInt(operand) | |
| 136 | float_from_int, | |
| 137 | /// @ptrFromInt(operand) | |
| 138 | ptr_from_int, | |
| 139 | /// @intFromPtr(operand) | |
| 140 | int_from_ptr, | |
| 141 | /// @alignCast(operand) | |
| 142 | align_cast, | |
| 143 | /// @ptrCast(operand) | |
| 144 | ptr_cast, | |
| 145 | /// @divExact(lhs, rhs) | |
| 146 | div_exact, | |
| 147 | /// @offsetOf(lhs, rhs) | |
| 148 | offset_of, | |
| 149 | /// @splat(operand) | |
| 150 | vector_zero_init, | |
| 151 | /// @shuffle(type, a, b, mask) | |
| 152 | shuffle, | |
| 153 | /// @extern(ty, .{ .name = n }) | |
| 154 | builtin_extern, | |
| 155 | ||
| 156 | /// @byteSwap(operand) | |
| 157 | byte_swap, | |
| 158 | /// @ceil(operand) | |
| 159 | ceil, | |
| 160 | /// @cos(operand) | |
| 161 | cos, | |
| 162 | /// @sin(operand) | |
| 163 | sin, | |
| 164 | /// @exp(operand) | |
| 165 | exp, | |
| 166 | /// @exp2(operand) | |
| 167 | exp2, | |
| 168 | /// @exp10(operand) | |
| 169 | exp10, | |
| 170 | /// @abs(operand) | |
| 171 | abs, | |
| 172 | /// @log(operand) | |
| 173 | log, | |
| 174 | /// @log2(operand) | |
| 175 | log2, | |
| 176 | /// @log10(operand) | |
| 177 | log10, | |
| 178 | /// @round(operand) | |
| 179 | round, | |
| 180 | /// @sqrt(operand) | |
| 181 | sqrt, | |
| 182 | /// @trunc(operand) | |
| 183 | trunc, | |
| 184 | /// @floor(operand) | |
| 185 | floor, | |
| 186 | ||
| 187 | /// __helpers.<name>(argshelper_call) | |
| 188 | helper_call, | |
| 189 | /// __helpers.<name> | |
| 190 | helper_ref, | |
| 191 | ||
| 192 | asm_simple, | |
| 193 | ||
| 194 | negate, | |
| 195 | negate_wrap, | |
| 196 | bit_not, | |
| 197 | not, | |
| 198 | address_of, | |
| 199 | /// .? | |
| 200 | unwrap, | |
| 201 | /// .* | |
| 202 | deref, | |
| 203 | ||
| 204 | block, | |
| 205 | /// { operand } | |
| 206 | block_single, | |
| 207 | ||
| 208 | sizeof, | |
| 209 | alignof, | |
| 210 | typeof, | |
| 211 | typeinfo, | |
| 212 | type, | |
| 213 | ||
| 214 | optional_type, | |
| 215 | c_pointer, | |
| 216 | single_pointer, | |
| 217 | array_type, | |
| 218 | null_sentinel_array_type, | |
| 219 | ||
| 220 | /// @Vector(lhs, rhs) | |
| 221 | vector, | |
| 222 | /// @import("std").mem.zeroes(operand) | |
| 223 | std_mem_zeroes, | |
| 224 | /// @import("std").mem.zeroInit(lhs, rhs) | |
| 225 | std_mem_zeroinit, | |
| 226 | // pub const name = @compileError(msg); | |
| 227 | fail_decl, | |
| 228 | // var actual = mangled; | |
| 229 | arg_redecl, | |
| 230 | /// pub const alias = actual; | |
| 231 | alias, | |
| 232 | /// const name = init; | |
| 233 | var_simple, | |
| 234 | /// pub const name = init; | |
| 235 | pub_var_simple, | |
| 236 | /// pub? const name (: type)? = value | |
| 237 | enum_constant, | |
| 238 | ||
| 239 | /// pub inline fn name(params) return_type body | |
| 240 | pub_inline_fn, | |
| 241 | ||
| 242 | /// array_type{} | |
| 243 | empty_array, | |
| 244 | /// [1]type{val} ** count | |
| 245 | array_filler, | |
| 246 | ||
| 247 | /// comptime { if (!(lhs)) @compileError(rhs); } | |
| 248 | static_assert, | |
| 249 | ||
| 250 | pub const last_no_payload_tag = Tag.@"break"; | |
| 251 | pub const no_payload_count = @intFromEnum(last_no_payload_tag) + 1; | |
| 252 | ||
| 253 | pub fn Type(comptime t: Tag) type { | |
| 254 | return switch (t) { | |
| 255 | .declaration, | |
| 256 | .null_literal, | |
| 257 | .undefined_literal, | |
| 258 | .opaque_literal, | |
| 259 | .true_literal, | |
| 260 | .false_literal, | |
| 261 | .empty_block, | |
| 262 | .return_void, | |
| 263 | .zero_literal, | |
| 264 | .one_literal, | |
| 265 | .void_type, | |
| 266 | .noreturn_type, | |
| 267 | .@"anytype", | |
| 268 | .@"continue", | |
| 269 | .@"break", | |
| 270 | .@"unreachable", | |
| 271 | => @compileError("Type Tag " ++ @tagName(t) ++ " has no payload"), | |
| 272 | ||
| 273 | .std_mem_zeroes, | |
| 274 | .@"return", | |
| 275 | .@"comptime", | |
| 276 | .@"defer", | |
| 277 | .asm_simple, | |
| 278 | .negate, | |
| 279 | .negate_wrap, | |
| 280 | .bit_not, | |
| 281 | .not, | |
| 282 | .optional_type, | |
| 283 | .address_of, | |
| 284 | .unwrap, | |
| 285 | .deref, | |
| 286 | .int_from_ptr, | |
| 287 | .empty_array, | |
| 288 | .while_true, | |
| 289 | .if_not_break, | |
| 290 | .switch_else, | |
| 291 | .block_single, | |
| 292 | .int_from_bool, | |
| 293 | .sizeof, | |
| 294 | .alignof, | |
| 295 | .typeof, | |
| 296 | .typeinfo, | |
| 297 | .align_cast, | |
| 298 | .truncate, | |
| 299 | .bit_cast, | |
| 300 | .float_cast, | |
| 301 | .int_from_float, | |
| 302 | .float_from_int, | |
| 303 | .ptr_from_int, | |
| 304 | .ptr_cast, | |
| 305 | .int_cast, | |
| 306 | .const_cast, | |
| 307 | .volatile_cast, | |
| 308 | .vector_zero_init, | |
| 309 | .byte_swap, | |
| 310 | .ceil, | |
| 311 | .cos, | |
| 312 | .sin, | |
| 313 | .exp, | |
| 314 | .exp2, | |
| 315 | .exp10, | |
| 316 | .abs, | |
| 317 | .log, | |
| 318 | .log2, | |
| 319 | .log10, | |
| 320 | .round, | |
| 321 | .sqrt, | |
| 322 | .trunc, | |
| 323 | .floor, | |
| 324 | => Payload.UnOp, | |
| 325 | ||
| 326 | .add, | |
| 327 | .add_assign, | |
| 328 | .add_wrap, | |
| 329 | .add_wrap_assign, | |
| 330 | .sub, | |
| 331 | .sub_assign, | |
| 332 | .sub_wrap, | |
| 333 | .sub_wrap_assign, | |
| 334 | .mul, | |
| 335 | .mul_assign, | |
| 336 | .mul_wrap, | |
| 337 | .mul_wrap_assign, | |
| 338 | .div, | |
| 339 | .div_assign, | |
| 340 | .shl, | |
| 341 | .shl_assign, | |
| 342 | .shr, | |
| 343 | .shr_assign, | |
| 344 | .mod, | |
| 345 | .mod_assign, | |
| 346 | .@"and", | |
| 347 | .@"or", | |
| 348 | .less_than, | |
| 349 | .less_than_equal, | |
| 350 | .greater_than, | |
| 351 | .greater_than_equal, | |
| 352 | .equal, | |
| 353 | .not_equal, | |
| 354 | .bit_and, | |
| 355 | .bit_and_assign, | |
| 356 | .bit_or, | |
| 357 | .bit_or_assign, | |
| 358 | .bit_xor, | |
| 359 | .bit_xor_assign, | |
| 360 | .div_trunc, | |
| 361 | .as, | |
| 362 | .array_cat, | |
| 363 | .ellipsis3, | |
| 364 | .assign, | |
| 365 | .array_access, | |
| 366 | .std_mem_zeroinit, | |
| 367 | .vector, | |
| 368 | .div_exact, | |
| 369 | .offset_of, | |
| 370 | .static_assert, | |
| 371 | => Payload.BinOp, | |
| 372 | ||
| 373 | .integer_literal, | |
| 374 | .float_literal, | |
| 375 | .string_literal, | |
| 376 | .char_literal, | |
| 377 | .enum_literal, | |
| 378 | .identifier, | |
| 379 | .warning, | |
| 380 | .type, | |
| 381 | => Payload.Value, | |
| 382 | .discard => Payload.Discard, | |
| 383 | .@"if" => Payload.If, | |
| 384 | .@"while" => Payload.While, | |
| 385 | .@"switch", .array_init, .switch_prong => Payload.Switch, | |
| 386 | .break_val => Payload.BreakVal, | |
| 387 | .call => Payload.Call, | |
| 388 | .var_decl => Payload.VarDecl, | |
| 389 | .func => Payload.Func, | |
| 390 | .@"struct", .@"union", .@"opaque" => Payload.Container, | |
| 391 | .tuple => Payload.TupleInit, | |
| 392 | .container_init => Payload.ContainerInit, | |
| 393 | .container_init_dot => Payload.ContainerInitDot, | |
| 394 | .block => Payload.Block, | |
| 395 | .c_pointer, .single_pointer => Payload.Pointer, | |
| 396 | .array_type, .null_sentinel_array_type => Payload.Array, | |
| 397 | .arg_redecl, .alias, .fail_decl => Payload.ArgRedecl, | |
| 398 | .var_simple, .pub_var_simple, .wrapped_local, .mut_str => Payload.SimpleVarDecl, | |
| 399 | .enum_constant => Payload.EnumConstant, | |
| 400 | .array_filler => Payload.ArrayFiller, | |
| 401 | .pub_inline_fn => Payload.PubInlineFn, | |
| 402 | .field_access => Payload.FieldAccess, | |
| 403 | .string_slice => Payload.StringSlice, | |
| 404 | .shuffle => Payload.Shuffle, | |
| 405 | .builtin_extern => Payload.Extern, | |
| 406 | .helper_call => Payload.HelperCall, | |
| 407 | .helper_ref => Payload.HelperRef, | |
| 408 | }; | |
| 409 | } | |
| 410 | ||
| 411 | pub fn init(comptime t: Tag) Node { | |
| 412 | comptime std.debug.assert(@intFromEnum(t) < Tag.no_payload_count); | |
| 413 | return .{ .tag_if_small_enough = @intFromEnum(t) }; | |
| 414 | } | |
| 415 | ||
| 416 | pub fn create(comptime t: Tag, ally: Allocator, data: Data(t)) error{OutOfMemory}!Node { | |
| 417 | const ptr = try ally.create(t.Type()); | |
| 418 | ptr.* = .{ | |
| 419 | .base = .{ .tag = t }, | |
| 420 | .data = data, | |
| 421 | }; | |
| 422 | return Node{ .ptr_otherwise = &ptr.base }; | |
| 423 | } | |
| 424 | ||
| 425 | pub fn Data(comptime t: Tag) type { | |
| 426 | return std.meta.fieldInfo(t.Type(), .data).type; | |
| 427 | } | |
| 428 | }; | |
| 429 | ||
| 430 | pub fn tag(self: Node) Tag { | |
| 431 | if (self.tag_if_small_enough < Tag.no_payload_count) { | |
| 432 | return @enumFromInt(@as(std.meta.Tag(Tag), @intCast(self.tag_if_small_enough))); | |
| 433 | } else { | |
| 434 | return self.ptr_otherwise.tag; | |
| 435 | } | |
| 436 | } | |
| 437 | ||
| 438 | pub fn castTag(self: Node, comptime t: Tag) ?*t.Type() { | |
| 439 | if (self.tag_if_small_enough < Tag.no_payload_count) | |
| 440 | return null; | |
| 441 | ||
| 442 | if (self.ptr_otherwise.tag == t) | |
| 443 | return @alignCast(@fieldParentPtr("base", self.ptr_otherwise)); | |
| 444 | ||
| 445 | return null; | |
| 446 | } | |
| 447 | ||
| 448 | pub fn initPayload(payload: *Payload) Node { | |
| 449 | std.debug.assert(@intFromEnum(payload.tag) >= Tag.no_payload_count); | |
| 450 | return .{ .ptr_otherwise = payload }; | |
| 451 | } | |
| 452 | ||
| 453 | pub fn isNoreturn(node: Node, break_counts: bool) bool { | |
| 454 | switch (node.tag()) { | |
| 455 | .block => { | |
| 456 | const block_node = node.castTag(.block).?; | |
| 457 | if (block_node.data.stmts.len == 0) return false; | |
| 458 | ||
| 459 | const last = block_node.data.stmts[block_node.data.stmts.len - 1]; | |
| 460 | return last.isNoreturn(break_counts); | |
| 461 | }, | |
| 462 | .@"switch" => { | |
| 463 | const switch_node = node.castTag(.@"switch").?; | |
| 464 | ||
| 465 | for (switch_node.data.cases) |case| { | |
| 466 | const body = if (case.castTag(.switch_else)) |some| | |
| 467 | some.data | |
| 468 | else if (case.castTag(.switch_prong)) |some| | |
| 469 | some.data.cond | |
| 470 | else | |
| 471 | unreachable; | |
| 472 | ||
| 473 | if (!body.isNoreturn(break_counts)) return false; | |
| 474 | } | |
| 475 | return true; | |
| 476 | }, | |
| 477 | .@"return", .return_void => return true, | |
| 478 | .@"break" => if (break_counts) return true, | |
| 479 | else => {}, | |
| 480 | } | |
| 481 | return false; | |
| 482 | } | |
| 483 | ||
| 484 | pub fn isBoolRes(res: Node) bool { | |
| 485 | switch (res.tag()) { | |
| 486 | .@"or", | |
| 487 | .@"and", | |
| 488 | .equal, | |
| 489 | .not_equal, | |
| 490 | .less_than, | |
| 491 | .less_than_equal, | |
| 492 | .greater_than, | |
| 493 | .greater_than_equal, | |
| 494 | .not, | |
| 495 | .false_literal, | |
| 496 | .true_literal, | |
| 497 | => return true, | |
| 498 | else => return false, | |
| 499 | } | |
| 500 | } | |
| 501 | }; | |
| 502 | ||
| 503 | pub const Payload = struct { | |
| 504 | tag: Node.Tag, | |
| 505 | ||
| 506 | pub const Value = struct { | |
| 507 | base: Payload, | |
| 508 | data: []const u8, | |
| 509 | }; | |
| 510 | ||
| 511 | pub const UnOp = struct { | |
| 512 | base: Payload, | |
| 513 | data: Node, | |
| 514 | }; | |
| 515 | ||
| 516 | pub const BinOp = struct { | |
| 517 | base: Payload, | |
| 518 | data: struct { | |
| 519 | lhs: Node, | |
| 520 | rhs: Node, | |
| 521 | }, | |
| 522 | }; | |
| 523 | ||
| 524 | pub const Discard = struct { | |
| 525 | base: Payload, | |
| 526 | data: struct { | |
| 527 | should_skip: bool, | |
| 528 | value: Node, | |
| 529 | }, | |
| 530 | }; | |
| 531 | ||
| 532 | pub const If = struct { | |
| 533 | base: Payload, | |
| 534 | data: struct { | |
| 535 | cond: Node, | |
| 536 | then: Node, | |
| 537 | @"else": ?Node, | |
| 538 | }, | |
| 539 | }; | |
| 540 | ||
| 541 | pub const While = struct { | |
| 542 | base: Payload, | |
| 543 | data: struct { | |
| 544 | cond: Node, | |
| 545 | body: Node, | |
| 546 | cont_expr: ?Node, | |
| 547 | }, | |
| 548 | }; | |
| 549 | ||
| 550 | pub const Switch = struct { | |
| 551 | base: Payload, | |
| 552 | data: struct { | |
| 553 | cond: Node, | |
| 554 | cases: []Node, | |
| 555 | }, | |
| 556 | }; | |
| 557 | ||
| 558 | pub const BreakVal = struct { | |
| 559 | base: Payload, | |
| 560 | data: struct { | |
| 561 | label: ?[]const u8, | |
| 562 | val: Node, | |
| 563 | }, | |
| 564 | }; | |
| 565 | ||
| 566 | pub const Call = struct { | |
| 567 | base: Payload, | |
| 568 | data: struct { | |
| 569 | lhs: Node, | |
| 570 | args: []Node, | |
| 571 | }, | |
| 572 | }; | |
| 573 | ||
| 574 | pub const VarDecl = struct { | |
| 575 | base: Payload, | |
| 576 | data: struct { | |
| 577 | is_pub: bool, | |
| 578 | is_const: bool, | |
| 579 | is_extern: bool, | |
| 580 | is_export: bool, | |
| 581 | is_threadlocal: bool, | |
| 582 | alignment: ?c_uint, | |
| 583 | linksection_string: ?[]const u8, | |
| 584 | name: []const u8, | |
| 585 | type: Node, | |
| 586 | init: ?Node, | |
| 587 | }, | |
| 588 | }; | |
| 589 | ||
| 590 | pub const Func = struct { | |
| 591 | base: Payload, | |
| 592 | data: struct { | |
| 593 | is_pub: bool, | |
| 594 | is_extern: bool, | |
| 595 | is_export: bool, | |
| 596 | is_inline: bool, | |
| 597 | is_var_args: bool, | |
| 598 | name: ?[]const u8, | |
| 599 | linksection_string: ?[]const u8, | |
| 600 | explicit_callconv: ?CallingConvention, | |
| 601 | params: []Param, | |
| 602 | return_type: Node, | |
| 603 | body: ?Node, | |
| 604 | alignment: ?c_uint, | |
| 605 | }, | |
| 606 | ||
| 607 | pub const CallingConvention = enum { | |
| 608 | c, | |
| 609 | x86_64_sysv, | |
| 610 | x86_64_win, | |
| 611 | x86_stdcall, | |
| 612 | x86_fastcall, | |
| 613 | x86_thiscall, | |
| 614 | x86_vectorcall, | |
| 615 | x86_regcall, | |
| 616 | aarch64_vfabi, | |
| 617 | aarch64_sve_pcs, | |
| 618 | arm_aapcs, | |
| 619 | arm_aapcs_vfp, | |
| 620 | m68k_rtd, | |
| 621 | riscv_vector, | |
| 622 | }; | |
| 623 | }; | |
| 624 | ||
| 625 | pub const Param = struct { | |
| 626 | is_noalias: bool, | |
| 627 | name: ?[]const u8, | |
| 628 | type: Node, | |
| 629 | }; | |
| 630 | ||
| 631 | pub const Container = struct { | |
| 632 | base: Payload, | |
| 633 | data: struct { | |
| 634 | layout: enum { @"packed", @"extern", none }, | |
| 635 | fields: []Field, | |
| 636 | decls: []Node, | |
| 637 | }, | |
| 638 | ||
| 639 | pub const Field = struct { | |
| 640 | name: []const u8, | |
| 641 | type: Node, | |
| 642 | alignment: ?c_uint, | |
| 643 | default_value: ?Node, | |
| 644 | }; | |
| 645 | }; | |
| 646 | ||
| 647 | pub const TupleInit = struct { | |
| 648 | base: Payload, | |
| 649 | data: []Node, | |
| 650 | }; | |
| 651 | ||
| 652 | pub const ContainerInit = struct { | |
| 653 | base: Payload, | |
| 654 | data: struct { | |
| 655 | lhs: Node, | |
| 656 | inits: []Initializer, | |
| 657 | }, | |
| 658 | ||
| 659 | pub const Initializer = struct { | |
| 660 | name: []const u8, | |
| 661 | value: Node, | |
| 662 | }; | |
| 663 | }; | |
| 664 | ||
| 665 | pub const ContainerInitDot = struct { | |
| 666 | base: Payload, | |
| 667 | data: []Initializer, | |
| 668 | ||
| 669 | pub const Initializer = struct { | |
| 670 | name: []const u8, | |
| 671 | value: Node, | |
| 672 | }; | |
| 673 | }; | |
| 674 | ||
| 675 | pub const Block = struct { | |
| 676 | base: Payload, | |
| 677 | data: struct { | |
| 678 | label: ?[]const u8, | |
| 679 | stmts: []Node, | |
| 680 | }, | |
| 681 | }; | |
| 682 | ||
| 683 | pub const Array = struct { | |
| 684 | base: Payload, | |
| 685 | data: ArrayTypeInfo, | |
| 686 | ||
| 687 | pub const ArrayTypeInfo = struct { | |
| 688 | elem_type: Node, | |
| 689 | len: u64, | |
| 690 | }; | |
| 691 | }; | |
| 692 | ||
| 693 | pub const Pointer = struct { | |
| 694 | base: Payload, | |
| 695 | data: struct { | |
| 696 | elem_type: Node, | |
| 697 | is_const: bool, | |
| 698 | is_volatile: bool, | |
| 699 | is_allowzero: bool, | |
| 700 | }, | |
| 701 | }; | |
| 702 | ||
| 703 | pub const ArgRedecl = struct { | |
| 704 | base: Payload, | |
| 705 | data: struct { | |
| 706 | actual: []const u8, | |
| 707 | mangled: []const u8, | |
| 708 | }, | |
| 709 | }; | |
| 710 | ||
| 711 | pub const SimpleVarDecl = struct { | |
| 712 | base: Payload, | |
| 713 | data: struct { | |
| 714 | name: []const u8, | |
| 715 | init: Node, | |
| 716 | }, | |
| 717 | }; | |
| 718 | ||
| 719 | pub const EnumConstant = struct { | |
| 720 | base: Payload, | |
| 721 | data: struct { | |
| 722 | name: []const u8, | |
| 723 | is_public: bool, | |
| 724 | type: ?Node, | |
| 725 | value: Node, | |
| 726 | }, | |
| 727 | }; | |
| 728 | ||
| 729 | pub const ArrayFiller = struct { | |
| 730 | base: Payload, | |
| 731 | data: struct { | |
| 732 | type: Node, | |
| 733 | filler: Node, | |
| 734 | count: u64, | |
| 735 | }, | |
| 736 | }; | |
| 737 | ||
| 738 | pub const PubInlineFn = struct { | |
| 739 | base: Payload, | |
| 740 | data: struct { | |
| 741 | name: []const u8, | |
| 742 | params: []Param, | |
| 743 | return_type: Node, | |
| 744 | body: Node, | |
| 745 | }, | |
| 746 | }; | |
| 747 | ||
| 748 | pub const FieldAccess = struct { | |
| 749 | base: Payload, | |
| 750 | data: struct { | |
| 751 | lhs: Node, | |
| 752 | field_name: []const u8, | |
| 753 | }, | |
| 754 | }; | |
| 755 | ||
| 756 | pub const StringSlice = struct { | |
| 757 | base: Payload, | |
| 758 | data: struct { | |
| 759 | string: Node, | |
| 760 | end: u64, | |
| 761 | }, | |
| 762 | }; | |
| 763 | ||
| 764 | pub const Shuffle = struct { | |
| 765 | base: Payload, | |
| 766 | data: struct { | |
| 767 | element_type: Node, | |
| 768 | a: Node, | |
| 769 | b: Node, | |
| 770 | mask_vector: Node, | |
| 771 | }, | |
| 772 | }; | |
| 773 | ||
| 774 | pub const Extern = struct { | |
| 775 | base: Payload, | |
| 776 | data: struct { | |
| 777 | type: Node, | |
| 778 | name: Node, | |
| 779 | }, | |
| 780 | }; | |
| 781 | ||
| 782 | pub const HelperCall = struct { | |
| 783 | base: Payload, | |
| 784 | data: struct { | |
| 785 | name: []const u8, | |
| 786 | args: []const Node, | |
| 787 | }, | |
| 788 | }; | |
| 789 | ||
| 790 | pub const HelperRef = struct { | |
| 791 | base: Payload, | |
| 792 | data: []const u8, | |
| 793 | }; | |
| 794 | }; | |
| 795 | ||
| 796 | /// Converts the nodes into a Zig Ast. | |
| 797 | /// Caller must free the source slice. | |
| 798 | pub fn render(gpa: Allocator, nodes: []const Node) !std.zig.Ast { | |
| 799 | var ctx: Context = .{ | |
| 800 | .gpa = gpa, | |
| 801 | }; | |
| 802 | defer ctx.buf.deinit(gpa); | |
| 803 | defer ctx.nodes.deinit(gpa); | |
| 804 | defer ctx.extra_data.deinit(gpa); | |
| 805 | defer ctx.tokens.deinit(gpa); | |
| 806 | ||
| 807 | // Estimate that each top level node has 10 child nodes. | |
| 808 | const estimated_node_count = nodes.len * 10 + 1; // +1 for the .root node | |
| 809 | try ctx.nodes.ensureTotalCapacity(gpa, estimated_node_count); | |
| 810 | // Estimate that each each node has 2 tokens. | |
| 811 | const estimated_tokens_count = estimated_node_count * 2; | |
| 812 | try ctx.tokens.ensureTotalCapacity(gpa, estimated_tokens_count); | |
| 813 | // Estimate that each each token is 3 bytes long. | |
| 814 | const estimated_buf_len = estimated_tokens_count * 3; | |
| 815 | try ctx.buf.ensureTotalCapacity(gpa, estimated_buf_len); | |
| 816 | ||
| 817 | ctx.nodes.appendAssumeCapacity(.{ | |
| 818 | .tag = .root, | |
| 819 | .main_token = 0, | |
| 820 | .data = undefined, | |
| 821 | }); | |
| 822 | ||
| 823 | const root_members = blk: { | |
| 824 | var result: std.ArrayList(NodeIndex) = .empty; | |
| 825 | defer result.deinit(gpa); | |
| 826 | ||
| 827 | for (nodes) |node| { | |
| 828 | const res = (try renderNodeOpt(&ctx, node)) orelse continue; | |
| 829 | try result.append(gpa, res); | |
| 830 | } | |
| 831 | break :blk try ctx.listToSpan(result.items); | |
| 832 | }; | |
| 833 | ||
| 834 | ctx.nodes.items(.data)[0] = .{ .extra_range = .{ | |
| 835 | .start = root_members.start, | |
| 836 | .end = root_members.end, | |
| 837 | } }; | |
| 838 | ||
| 839 | try ctx.tokens.append(gpa, .{ | |
| 840 | .tag = .eof, | |
| 841 | .start = @as(u32, @intCast(ctx.buf.items.len)), | |
| 842 | }); | |
| 843 | ||
| 844 | return .{ | |
| 845 | .source = try ctx.buf.toOwnedSliceSentinel(gpa, 0), | |
| 846 | .tokens = ctx.tokens.toOwnedSlice(), | |
| 847 | .nodes = ctx.nodes.toOwnedSlice(), | |
| 848 | .extra_data = try ctx.extra_data.toOwnedSlice(gpa), | |
| 849 | .errors = &.{}, | |
| 850 | .mode = .zig, | |
| 851 | }; | |
| 852 | } | |
| 853 | ||
| 854 | const NodeIndex = std.zig.Ast.Node.Index; | |
| 855 | const NodeSubRange = std.zig.Ast.Node.SubRange; | |
| 856 | const TokenIndex = std.zig.Ast.TokenIndex; | |
| 857 | const TokenTag = std.zig.Token.Tag; | |
| 858 | ||
| 859 | const Context = struct { | |
| 860 | gpa: Allocator, | |
| 861 | buf: std.ArrayList(u8) = .empty, | |
| 862 | nodes: std.zig.Ast.NodeList = .empty, | |
| 863 | extra_data: std.ArrayListUnmanaged(u32) = .empty, | |
| 864 | tokens: std.zig.Ast.TokenList = .empty, | |
| 865 | ||
| 866 | fn addTokenFmt(c: *Context, tag: TokenTag, comptime format: []const u8, args: anytype) Allocator.Error!TokenIndex { | |
| 867 | const start_index = c.buf.items.len; | |
| 868 | try c.buf.print(c.gpa, format ++ " ", args); | |
| 869 | ||
| 870 | try c.tokens.append(c.gpa, .{ | |
| 871 | .tag = tag, | |
| 872 | .start = @intCast(start_index), | |
| 873 | }); | |
| 874 | ||
| 875 | return @intCast(c.tokens.len - 1); | |
| 876 | } | |
| 877 | ||
| 878 | fn addToken(c: *Context, tag: TokenTag, bytes: []const u8) Allocator.Error!TokenIndex { | |
| 879 | return c.addTokenFmt(tag, "{s}", .{bytes}); | |
| 880 | } | |
| 881 | ||
| 882 | fn addIdentifier(c: *Context, bytes: []const u8) Allocator.Error!TokenIndex { | |
| 883 | if (std.zig.primitives.isPrimitive(bytes)) | |
| 884 | return c.addTokenFmt(.identifier, "@\"{s}\"", .{bytes}); | |
| 885 | return c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtId(bytes)}); | |
| 886 | } | |
| 887 | ||
| 888 | fn listToSpan(c: *Context, list: []const NodeIndex) Allocator.Error!NodeSubRange { | |
| 889 | try c.extra_data.appendSlice(c.gpa, @ptrCast(list)); | |
| 890 | return .{ | |
| 891 | .start = @enumFromInt(c.extra_data.items.len - list.len), | |
| 892 | .end = @enumFromInt(c.extra_data.items.len), | |
| 893 | }; | |
| 894 | } | |
| 895 | ||
| 896 | fn addNode(c: *Context, elem: std.zig.Ast.Node) Allocator.Error!NodeIndex { | |
| 897 | const result: NodeIndex = @enumFromInt(c.nodes.len); | |
| 898 | try c.nodes.append(c.gpa, elem); | |
| 899 | return result; | |
| 900 | } | |
| 901 | ||
| 902 | fn addExtra(c: *Context, extra: anytype) Allocator.Error!std.zig.Ast.ExtraIndex { | |
| 903 | const fields = std.meta.fields(@TypeOf(extra)); | |
| 904 | try c.extra_data.ensureUnusedCapacity(c.gpa, fields.len); | |
| 905 | const result: std.zig.Ast.ExtraIndex = @enumFromInt(c.extra_data.items.len); | |
| 906 | inline for (fields) |field| { | |
| 907 | const data: u32 = switch (field.type) { | |
| 908 | NodeIndex, | |
| 909 | std.zig.Ast.Node.OptionalIndex, | |
| 910 | std.zig.Ast.OptionalTokenIndex, | |
| 911 | std.zig.Ast.ExtraIndex, | |
| 912 | => @intFromEnum(@field(extra, field.name)), | |
| 913 | TokenIndex, | |
| 914 | => @field(extra, field.name), | |
| 915 | else => @compileError("unexpected field type"), | |
| 916 | }; | |
| 917 | c.extra_data.appendAssumeCapacity(data); | |
| 918 | } | |
| 919 | return result; | |
| 920 | } | |
| 921 | }; | |
| 922 | ||
| 923 | fn renderNodeOpt(c: *Context, node: Node) Allocator.Error!?NodeIndex { | |
| 924 | switch (node.tag()) { | |
| 925 | .warning => { | |
| 926 | const payload = node.castTag(.warning).?.data; | |
| 927 | try c.buf.appendSlice(c.gpa, payload); | |
| 928 | try c.buf.append(c.gpa, '\n'); | |
| 929 | return null; | |
| 930 | }, | |
| 931 | .discard => { | |
| 932 | const payload = node.castTag(.discard).?.data; | |
| 933 | if (payload.should_skip) return null; | |
| 934 | ||
| 935 | return try renderNode(c, node); | |
| 936 | }, | |
| 937 | else => return try renderNode(c, node), | |
| 938 | } | |
| 939 | } | |
| 940 | ||
| 941 | fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { | |
| 942 | switch (node.tag()) { | |
| 943 | .declaration => unreachable, | |
| 944 | .warning => unreachable, | |
| 945 | .discard => { | |
| 946 | const payload = node.castTag(.discard).?.data; | |
| 947 | std.debug.assert(!payload.should_skip); | |
| 948 | ||
| 949 | const lhs = try c.addNode(.{ | |
| 950 | .tag = .identifier, | |
| 951 | .main_token = try c.addToken(.identifier, "_"), | |
| 952 | .data = undefined, | |
| 953 | }); | |
| 954 | const main_token = try c.addToken(.equal, "="); | |
| 955 | if (payload.value.tag() == .identifier) { | |
| 956 | // Render as `_ = &foo;` to avoid tripping "pointless discard" and "local variable never mutated" errors. | |
| 957 | var addr_of_pl: Payload.UnOp = .{ | |
| 958 | .base = .{ .tag = .address_of }, | |
| 959 | .data = payload.value, | |
| 960 | }; | |
| 961 | const addr_of: Node = .{ .ptr_otherwise = &addr_of_pl.base }; | |
| 962 | return try c.addNode(.{ | |
| 963 | .tag = .assign, | |
| 964 | .main_token = main_token, | |
| 965 | .data = .{ .node_and_node = .{ | |
| 966 | lhs, try renderNode(c, addr_of), | |
| 967 | } }, | |
| 968 | }); | |
| 969 | } else { | |
| 970 | return try c.addNode(.{ | |
| 971 | .tag = .assign, | |
| 972 | .main_token = main_token, | |
| 973 | .data = .{ .node_and_node = .{ | |
| 974 | lhs, try renderNode(c, payload.value), | |
| 975 | } }, | |
| 976 | }); | |
| 977 | } | |
| 978 | }, | |
| 979 | .std_mem_zeroes => { | |
| 980 | const payload = node.castTag(.std_mem_zeroes).?.data; | |
| 981 | const import_node = try renderStdImport(c, &.{ "mem", "zeroes" }); | |
| 982 | return renderCall(c, import_node, &.{payload}); | |
| 983 | }, | |
| 984 | .std_mem_zeroinit => { | |
| 985 | const payload = node.castTag(.std_mem_zeroinit).?.data; | |
| 986 | const import_node = try renderStdImport(c, &.{ "mem", "zeroInit" }); | |
| 987 | return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); | |
| 988 | }, | |
| 989 | .vector => { | |
| 990 | const payload = node.castTag(.vector).?.data; | |
| 991 | return renderBuiltinCall(c, "@Vector", &.{ payload.lhs, payload.rhs }); | |
| 992 | }, | |
| 993 | .call => { | |
| 994 | const payload = node.castTag(.call).?.data; | |
| 995 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 996 | return renderCall(c, lhs, payload.args); | |
| 997 | }, | |
| 998 | .null_literal => return c.addNode(.{ | |
| 999 | .tag = .identifier, | |
| 1000 | .main_token = try c.addToken(.identifier, "null"), | |
| 1001 | .data = undefined, | |
| 1002 | }), | |
| 1003 | .undefined_literal => return c.addNode(.{ | |
| 1004 | .tag = .identifier, | |
| 1005 | .main_token = try c.addToken(.identifier, "undefined"), | |
| 1006 | .data = undefined, | |
| 1007 | }), | |
| 1008 | .true_literal => return c.addNode(.{ | |
| 1009 | .tag = .identifier, | |
| 1010 | .main_token = try c.addToken(.identifier, "true"), | |
| 1011 | .data = undefined, | |
| 1012 | }), | |
| 1013 | .false_literal => return c.addNode(.{ | |
| 1014 | .tag = .identifier, | |
| 1015 | .main_token = try c.addToken(.identifier, "false"), | |
| 1016 | .data = undefined, | |
| 1017 | }), | |
| 1018 | .zero_literal => return c.addNode(.{ | |
| 1019 | .tag = .number_literal, | |
| 1020 | .main_token = try c.addToken(.number_literal, "0"), | |
| 1021 | .data = undefined, | |
| 1022 | }), | |
| 1023 | .one_literal => return c.addNode(.{ | |
| 1024 | .tag = .number_literal, | |
| 1025 | .main_token = try c.addToken(.number_literal, "1"), | |
| 1026 | .data = undefined, | |
| 1027 | }), | |
| 1028 | .@"unreachable" => return c.addNode(.{ | |
| 1029 | .tag = .unreachable_literal, | |
| 1030 | .main_token = try c.addToken(.keyword_unreachable, "unreachable"), | |
| 1031 | .data = undefined, | |
| 1032 | }), | |
| 1033 | .void_type => return c.addNode(.{ | |
| 1034 | .tag = .identifier, | |
| 1035 | .main_token = try c.addToken(.identifier, "void"), | |
| 1036 | .data = undefined, | |
| 1037 | }), | |
| 1038 | .noreturn_type => return c.addNode(.{ | |
| 1039 | .tag = .identifier, | |
| 1040 | .main_token = try c.addToken(.identifier, "noreturn"), | |
| 1041 | .data = undefined, | |
| 1042 | }), | |
| 1043 | .@"continue" => return c.addNode(.{ | |
| 1044 | .tag = .@"continue", | |
| 1045 | .main_token = try c.addToken(.keyword_continue, "continue"), | |
| 1046 | .data = .{ .opt_token_and_opt_node = .{ | |
| 1047 | .none, .none, | |
| 1048 | } }, | |
| 1049 | }), | |
| 1050 | .return_void => return c.addNode(.{ | |
| 1051 | .tag = .@"return", | |
| 1052 | .main_token = try c.addToken(.keyword_return, "return"), | |
| 1053 | .data = .{ .opt_node = .none }, | |
| 1054 | }), | |
| 1055 | .@"break" => return c.addNode(.{ | |
| 1056 | .tag = .@"break", | |
| 1057 | .main_token = try c.addToken(.keyword_break, "break"), | |
| 1058 | .data = .{ .opt_token_and_opt_node = .{ | |
| 1059 | .none, .none, | |
| 1060 | } }, | |
| 1061 | }), | |
| 1062 | .break_val => { | |
| 1063 | const payload = node.castTag(.break_val).?.data; | |
| 1064 | const tok = try c.addToken(.keyword_break, "break"); | |
| 1065 | const break_label = if (payload.label) |some| blk: { | |
| 1066 | _ = try c.addToken(.colon, ":"); | |
| 1067 | break :blk try c.addIdentifier(some); | |
| 1068 | } else 0; | |
| 1069 | return c.addNode(.{ | |
| 1070 | .tag = .@"break", | |
| 1071 | .main_token = tok, | |
| 1072 | .data = .{ .opt_token_and_opt_node = .{ | |
| 1073 | .fromToken(break_label), (try renderNode(c, payload.val)).toOptional(), | |
| 1074 | } }, | |
| 1075 | }); | |
| 1076 | }, | |
| 1077 | .@"return" => { | |
| 1078 | const payload = node.castTag(.@"return").?.data; | |
| 1079 | return c.addNode(.{ | |
| 1080 | .tag = .@"return", | |
| 1081 | .main_token = try c.addToken(.keyword_return, "return"), | |
| 1082 | .data = .{ .opt_node = (try renderNode(c, payload)).toOptional() }, | |
| 1083 | }); | |
| 1084 | }, | |
| 1085 | .@"comptime" => { | |
| 1086 | const payload = node.castTag(.@"comptime").?.data; | |
| 1087 | return c.addNode(.{ | |
| 1088 | .tag = .@"comptime", | |
| 1089 | .main_token = try c.addToken(.keyword_comptime, "comptime"), | |
| 1090 | .data = .{ | |
| 1091 | .node = try renderNode(c, payload), | |
| 1092 | }, | |
| 1093 | }); | |
| 1094 | }, | |
| 1095 | .@"defer" => { | |
| 1096 | const payload = node.castTag(.@"defer").?.data; | |
| 1097 | return c.addNode(.{ | |
| 1098 | .tag = .@"defer", | |
| 1099 | .main_token = try c.addToken(.keyword_defer, "defer"), | |
| 1100 | .data = .{ | |
| 1101 | .node = try renderNode(c, payload), | |
| 1102 | }, | |
| 1103 | }); | |
| 1104 | }, | |
| 1105 | .asm_simple => { | |
| 1106 | const payload = node.castTag(.asm_simple).?.data; | |
| 1107 | const asm_token = try c.addToken(.keyword_asm, "asm"); | |
| 1108 | _ = try c.addToken(.l_paren, "("); | |
| 1109 | return c.addNode(.{ | |
| 1110 | .tag = .asm_simple, | |
| 1111 | .main_token = asm_token, | |
| 1112 | .data = .{ .node_and_token = .{ | |
| 1113 | try renderNode(c, payload), | |
| 1114 | try c.addToken(.r_paren, ")"), | |
| 1115 | } }, | |
| 1116 | }); | |
| 1117 | }, | |
| 1118 | .type => { | |
| 1119 | const payload = node.castTag(.type).?.data; | |
| 1120 | return c.addNode(.{ | |
| 1121 | .tag = .identifier, | |
| 1122 | .main_token = try c.addToken(.identifier, payload), | |
| 1123 | .data = undefined, | |
| 1124 | }); | |
| 1125 | }, | |
| 1126 | .identifier => { | |
| 1127 | const payload = node.castTag(.identifier).?.data; | |
| 1128 | return c.addNode(.{ | |
| 1129 | .tag = .identifier, | |
| 1130 | .main_token = try c.addIdentifier(payload), | |
| 1131 | .data = undefined, | |
| 1132 | }); | |
| 1133 | }, | |
| 1134 | .float_literal => { | |
| 1135 | const payload = node.castTag(.float_literal).?.data; | |
| 1136 | return c.addNode(.{ | |
| 1137 | .tag = .number_literal, | |
| 1138 | .main_token = try c.addToken(.number_literal, payload), | |
| 1139 | .data = undefined, | |
| 1140 | }); | |
| 1141 | }, | |
| 1142 | .integer_literal => { | |
| 1143 | const payload = node.castTag(.integer_literal).?.data; | |
| 1144 | return c.addNode(.{ | |
| 1145 | .tag = .number_literal, | |
| 1146 | .main_token = try c.addToken(.number_literal, payload), | |
| 1147 | .data = undefined, | |
| 1148 | }); | |
| 1149 | }, | |
| 1150 | .string_literal => { | |
| 1151 | const payload = node.castTag(.string_literal).?.data; | |
| 1152 | return c.addNode(.{ | |
| 1153 | .tag = .string_literal, | |
| 1154 | .main_token = try c.addToken(.string_literal, payload), | |
| 1155 | .data = undefined, | |
| 1156 | }); | |
| 1157 | }, | |
| 1158 | .char_literal => { | |
| 1159 | const payload = node.castTag(.char_literal).?.data; | |
| 1160 | return c.addNode(.{ | |
| 1161 | .tag = .char_literal, | |
| 1162 | .main_token = try c.addToken(.char_literal, payload), | |
| 1163 | .data = undefined, | |
| 1164 | }); | |
| 1165 | }, | |
| 1166 | .enum_literal => { | |
| 1167 | const payload = node.castTag(.enum_literal).?.data; | |
| 1168 | _ = try c.addToken(.period, "."); | |
| 1169 | return c.addNode(.{ | |
| 1170 | .tag = .enum_literal, | |
| 1171 | .main_token = try c.addToken(.identifier, payload), | |
| 1172 | .data = undefined, | |
| 1173 | }); | |
| 1174 | }, | |
| 1175 | .string_slice => { | |
| 1176 | const payload = node.castTag(.string_slice).?.data; | |
| 1177 | ||
| 1178 | const string = try renderNode(c, payload.string); | |
| 1179 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 1180 | const start = try c.addNode(.{ | |
| 1181 | .tag = .number_literal, | |
| 1182 | .main_token = try c.addToken(.number_literal, "0"), | |
| 1183 | .data = undefined, | |
| 1184 | }); | |
| 1185 | _ = try c.addToken(.ellipsis2, ".."); | |
| 1186 | const end = try c.addNode(.{ | |
| 1187 | .tag = .number_literal, | |
| 1188 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{payload.end}), | |
| 1189 | .data = undefined, | |
| 1190 | }); | |
| 1191 | _ = try c.addToken(.r_bracket, "]"); | |
| 1192 | ||
| 1193 | return c.addNode(.{ | |
| 1194 | .tag = .slice, | |
| 1195 | .main_token = l_bracket, | |
| 1196 | .data = .{ .node_and_extra = .{ | |
| 1197 | string, try c.addExtra(std.zig.Ast.Node.Slice{ | |
| 1198 | .start = start, | |
| 1199 | .end = end, | |
| 1200 | }), | |
| 1201 | } }, | |
| 1202 | }); | |
| 1203 | }, | |
| 1204 | .fail_decl => { | |
| 1205 | const payload = node.castTag(.fail_decl).?.data; | |
| 1206 | // pub const name = @compileError(msg); | |
| 1207 | _ = try c.addToken(.keyword_pub, "pub"); | |
| 1208 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1209 | _ = try c.addIdentifier(payload.actual); | |
| 1210 | _ = try c.addToken(.equal, "="); | |
| 1211 | ||
| 1212 | const compile_error_tok = try c.addToken(.builtin, "@compileError"); | |
| 1213 | _ = try c.addToken(.l_paren, "("); | |
| 1214 | const err_msg_tok = try c.addTokenFmt(.string_literal, "\"{f}\"", .{std.zig.fmtString(payload.mangled)}); | |
| 1215 | const err_msg = try c.addNode(.{ | |
| 1216 | .tag = .string_literal, | |
| 1217 | .main_token = err_msg_tok, | |
| 1218 | .data = undefined, | |
| 1219 | }); | |
| 1220 | _ = try c.addToken(.r_paren, ")"); | |
| 1221 | const compile_error = try c.addNode(.{ | |
| 1222 | .tag = .builtin_call_two, | |
| 1223 | .main_token = compile_error_tok, | |
| 1224 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1225 | err_msg.toOptional(), .none, | |
| 1226 | } }, | |
| 1227 | }); | |
| 1228 | _ = try c.addToken(.semicolon, ";"); | |
| 1229 | ||
| 1230 | return c.addNode(.{ | |
| 1231 | .tag = .simple_var_decl, | |
| 1232 | .main_token = const_tok, | |
| 1233 | .data = .{ | |
| 1234 | .opt_node_and_opt_node = .{ | |
| 1235 | .none, // Type expression | |
| 1236 | compile_error.toOptional(), // Init expression | |
| 1237 | }, | |
| 1238 | }, | |
| 1239 | }); | |
| 1240 | }, | |
| 1241 | .pub_var_simple, .var_simple => { | |
| 1242 | const payload = @as(*Payload.SimpleVarDecl, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 1243 | if (node.tag() == .pub_var_simple) _ = try c.addToken(.keyword_pub, "pub"); | |
| 1244 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1245 | _ = try c.addIdentifier(payload.name); | |
| 1246 | _ = try c.addToken(.equal, "="); | |
| 1247 | ||
| 1248 | const init = try renderNode(c, payload.init); | |
| 1249 | _ = try c.addToken(.semicolon, ";"); | |
| 1250 | ||
| 1251 | return c.addNode(.{ | |
| 1252 | .tag = .simple_var_decl, | |
| 1253 | .main_token = const_tok, | |
| 1254 | .data = .{ | |
| 1255 | .opt_node_and_opt_node = .{ | |
| 1256 | .none, // Type expression | |
| 1257 | init.toOptional(), // Init expression | |
| 1258 | }, | |
| 1259 | }, | |
| 1260 | }); | |
| 1261 | }, | |
| 1262 | .wrapped_local => { | |
| 1263 | const payload = node.castTag(.wrapped_local).?.data; | |
| 1264 | ||
| 1265 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1266 | _ = try c.addIdentifier(payload.name); | |
| 1267 | _ = try c.addToken(.equal, "="); | |
| 1268 | ||
| 1269 | const kind_tok = try c.addToken(.keyword_struct, "struct"); | |
| 1270 | _ = try c.addToken(.l_brace, "{"); | |
| 1271 | ||
| 1272 | const container_def = try c.addNode(.{ | |
| 1273 | .tag = .container_decl_two_trailing, | |
| 1274 | .main_token = kind_tok, | |
| 1275 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1276 | (try renderNode(c, payload.init)).toOptional(), .none, | |
| 1277 | } }, | |
| 1278 | }); | |
| 1279 | _ = try c.addToken(.r_brace, "}"); | |
| 1280 | _ = try c.addToken(.semicolon, ";"); | |
| 1281 | ||
| 1282 | return c.addNode(.{ | |
| 1283 | .tag = .simple_var_decl, | |
| 1284 | .main_token = const_tok, | |
| 1285 | .data = .{ | |
| 1286 | .opt_node_and_opt_node = .{ | |
| 1287 | .none, // Type expression | |
| 1288 | container_def.toOptional(), // Init expression | |
| 1289 | }, | |
| 1290 | }, | |
| 1291 | }); | |
| 1292 | }, | |
| 1293 | .mut_str => { | |
| 1294 | const payload = node.castTag(.mut_str).?.data; | |
| 1295 | ||
| 1296 | const var_tok = try c.addToken(.keyword_var, "var"); | |
| 1297 | _ = try c.addIdentifier(payload.name); | |
| 1298 | _ = try c.addToken(.equal, "="); | |
| 1299 | ||
| 1300 | const deref = try c.addNode(.{ | |
| 1301 | .tag = .deref, | |
| 1302 | .data = .{ | |
| 1303 | .node = try renderNodeGrouped(c, payload.init), | |
| 1304 | }, | |
| 1305 | .main_token = try c.addToken(.period_asterisk, ".*"), | |
| 1306 | }); | |
| 1307 | _ = try c.addToken(.semicolon, ";"); | |
| 1308 | ||
| 1309 | return c.addNode(.{ | |
| 1310 | .tag = .simple_var_decl, | |
| 1311 | .main_token = var_tok, | |
| 1312 | .data = .{ | |
| 1313 | .opt_node_and_opt_node = .{ | |
| 1314 | .none, // Type expression | |
| 1315 | deref.toOptional(), // Init expression | |
| 1316 | }, | |
| 1317 | }, | |
| 1318 | }); | |
| 1319 | }, | |
| 1320 | .var_decl => return renderVar(c, node), | |
| 1321 | .arg_redecl, .alias => { | |
| 1322 | const payload = @as(*Payload.ArgRedecl, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 1323 | if (node.tag() == .alias) _ = try c.addToken(.keyword_pub, "pub"); | |
| 1324 | const mut_tok = if (node.tag() == .alias) | |
| 1325 | try c.addToken(.keyword_const, "const") | |
| 1326 | else | |
| 1327 | try c.addToken(.keyword_var, "var"); | |
| 1328 | _ = try c.addIdentifier(payload.actual); | |
| 1329 | _ = try c.addToken(.equal, "="); | |
| 1330 | ||
| 1331 | const init = try c.addNode(.{ | |
| 1332 | .tag = .identifier, | |
| 1333 | .main_token = try c.addIdentifier(payload.mangled), | |
| 1334 | .data = undefined, | |
| 1335 | }); | |
| 1336 | _ = try c.addToken(.semicolon, ";"); | |
| 1337 | ||
| 1338 | return c.addNode(.{ | |
| 1339 | .tag = .simple_var_decl, | |
| 1340 | .main_token = mut_tok, | |
| 1341 | .data = .{ | |
| 1342 | .opt_node_and_opt_node = .{ | |
| 1343 | .none, // Type expression | |
| 1344 | init.toOptional(), // Init expression | |
| 1345 | }, | |
| 1346 | }, | |
| 1347 | }); | |
| 1348 | }, | |
| 1349 | .int_cast => { | |
| 1350 | const payload = node.castTag(.int_cast).?.data; | |
| 1351 | return renderBuiltinCall(c, "@intCast", &.{payload}); | |
| 1352 | }, | |
| 1353 | .const_cast => { | |
| 1354 | const payload = node.castTag(.const_cast).?.data; | |
| 1355 | return renderBuiltinCall(c, "@constCast", &.{payload}); | |
| 1356 | }, | |
| 1357 | .volatile_cast => { | |
| 1358 | const payload = node.castTag(.volatile_cast).?.data; | |
| 1359 | return renderBuiltinCall(c, "@volatileCast", &.{payload}); | |
| 1360 | }, | |
| 1361 | .div_trunc => { | |
| 1362 | const payload = node.castTag(.div_trunc).?.data; | |
| 1363 | return renderBuiltinCall(c, "@divTrunc", &.{ payload.lhs, payload.rhs }); | |
| 1364 | }, | |
| 1365 | .int_from_bool => { | |
| 1366 | const payload = node.castTag(.int_from_bool).?.data; | |
| 1367 | return renderBuiltinCall(c, "@intFromBool", &.{payload}); | |
| 1368 | }, | |
| 1369 | .as => { | |
| 1370 | const payload = node.castTag(.as).?.data; | |
| 1371 | return renderBuiltinCall(c, "@as", &.{ payload.lhs, payload.rhs }); | |
| 1372 | }, | |
| 1373 | .truncate => { | |
| 1374 | const payload = node.castTag(.truncate).?.data; | |
| 1375 | return renderBuiltinCall(c, "@truncate", &.{payload}); | |
| 1376 | }, | |
| 1377 | .bit_cast => { | |
| 1378 | const payload = node.castTag(.bit_cast).?.data; | |
| 1379 | return renderBuiltinCall(c, "@bitCast", &.{payload}); | |
| 1380 | }, | |
| 1381 | .float_cast => { | |
| 1382 | const payload = node.castTag(.float_cast).?.data; | |
| 1383 | return renderBuiltinCall(c, "@floatCast", &.{payload}); | |
| 1384 | }, | |
| 1385 | .int_from_float => { | |
| 1386 | const payload = node.castTag(.int_from_float).?.data; | |
| 1387 | return renderBuiltinCall(c, "@intFromFloat", &.{payload}); | |
| 1388 | }, | |
| 1389 | .float_from_int => { | |
| 1390 | const payload = node.castTag(.float_from_int).?.data; | |
| 1391 | return renderBuiltinCall(c, "@floatFromInt", &.{payload}); | |
| 1392 | }, | |
| 1393 | .ptr_from_int => { | |
| 1394 | const payload = node.castTag(.ptr_from_int).?.data; | |
| 1395 | return renderBuiltinCall(c, "@ptrFromInt", &.{payload}); | |
| 1396 | }, | |
| 1397 | .int_from_ptr => { | |
| 1398 | const payload = node.castTag(.int_from_ptr).?.data; | |
| 1399 | return renderBuiltinCall(c, "@intFromPtr", &.{payload}); | |
| 1400 | }, | |
| 1401 | .align_cast => { | |
| 1402 | const payload = node.castTag(.align_cast).?.data; | |
| 1403 | return renderBuiltinCall(c, "@alignCast", &.{payload}); | |
| 1404 | }, | |
| 1405 | .ptr_cast => { | |
| 1406 | const payload = node.castTag(.ptr_cast).?.data; | |
| 1407 | return renderBuiltinCall(c, "@ptrCast", &.{payload}); | |
| 1408 | }, | |
| 1409 | .div_exact => { | |
| 1410 | const payload = node.castTag(.div_exact).?.data; | |
| 1411 | return renderBuiltinCall(c, "@divExact", &.{ payload.lhs, payload.rhs }); | |
| 1412 | }, | |
| 1413 | .offset_of => { | |
| 1414 | const payload = node.castTag(.offset_of).?.data; | |
| 1415 | return renderBuiltinCall(c, "@offsetOf", &.{ payload.lhs, payload.rhs }); | |
| 1416 | }, | |
| 1417 | .sizeof => { | |
| 1418 | const payload = node.castTag(.sizeof).?.data; | |
| 1419 | return renderBuiltinCall(c, "@sizeOf", &.{payload}); | |
| 1420 | }, | |
| 1421 | .shuffle => { | |
| 1422 | const payload = node.castTag(.shuffle).?.data; | |
| 1423 | return renderBuiltinCall(c, "@shuffle", &.{ | |
| 1424 | payload.element_type, | |
| 1425 | payload.a, | |
| 1426 | payload.b, | |
| 1427 | payload.mask_vector, | |
| 1428 | }); | |
| 1429 | }, | |
| 1430 | .builtin_extern => { | |
| 1431 | const payload = node.castTag(.builtin_extern).?.data; | |
| 1432 | ||
| 1433 | var info_inits: [1]Payload.ContainerInitDot.Initializer = .{ | |
| 1434 | .{ .name = "name", .value = payload.name }, | |
| 1435 | }; | |
| 1436 | var info_payload: Payload.ContainerInitDot = .{ | |
| 1437 | .base = .{ .tag = .container_init_dot }, | |
| 1438 | .data = &info_inits, | |
| 1439 | }; | |
| 1440 | ||
| 1441 | return renderBuiltinCall(c, "@extern", &.{ | |
| 1442 | payload.type, | |
| 1443 | .{ .ptr_otherwise = &info_payload.base }, | |
| 1444 | }); | |
| 1445 | }, | |
| 1446 | .helper_call => { | |
| 1447 | const payload = node.castTag(.helper_call).?.data; | |
| 1448 | const helpers_tok = try c.addNode(.{ | |
| 1449 | .tag = .identifier, | |
| 1450 | .main_token = try c.addIdentifier("__helpers"), | |
| 1451 | .data = undefined, | |
| 1452 | }); | |
| 1453 | const func = try renderFieldAccess(c, helpers_tok, payload.name); | |
| 1454 | return renderCall(c, func, payload.args); | |
| 1455 | }, | |
| 1456 | .helper_ref => { | |
| 1457 | const payload = node.castTag(.helper_ref).?.data; | |
| 1458 | const helpers_tok = try c.addNode(.{ | |
| 1459 | .tag = .identifier, | |
| 1460 | .main_token = try c.addIdentifier("__helpers"), | |
| 1461 | .data = undefined, | |
| 1462 | }); | |
| 1463 | return renderFieldAccess(c, helpers_tok, payload); | |
| 1464 | }, | |
| 1465 | .alignof => { | |
| 1466 | const payload = node.castTag(.alignof).?.data; | |
| 1467 | return renderBuiltinCall(c, "@alignOf", &.{payload}); | |
| 1468 | }, | |
| 1469 | .typeof => { | |
| 1470 | const payload = node.castTag(.typeof).?.data; | |
| 1471 | return renderBuiltinCall(c, "@TypeOf", &.{payload}); | |
| 1472 | }, | |
| 1473 | .typeinfo => { | |
| 1474 | const payload = node.castTag(.typeinfo).?.data; | |
| 1475 | return renderBuiltinCall(c, "@typeInfo", &.{payload}); | |
| 1476 | }, | |
| 1477 | .byte_swap => { | |
| 1478 | const payload = node.castTag(.byte_swap).?.data; | |
| 1479 | return renderBuiltinCall(c, "@byteSwap", &.{payload}); | |
| 1480 | }, | |
| 1481 | .ceil => { | |
| 1482 | const payload = node.castTag(.ceil).?.data; | |
| 1483 | return renderBuiltinCall(c, "@ceil", &.{payload}); | |
| 1484 | }, | |
| 1485 | .cos => { | |
| 1486 | const payload = node.castTag(.cos).?.data; | |
| 1487 | return renderBuiltinCall(c, "@cos", &.{payload}); | |
| 1488 | }, | |
| 1489 | .sin => { | |
| 1490 | const payload = node.castTag(.sin).?.data; | |
| 1491 | return renderBuiltinCall(c, "@sin", &.{payload}); | |
| 1492 | }, | |
| 1493 | .exp => { | |
| 1494 | const payload = node.castTag(.exp).?.data; | |
| 1495 | return renderBuiltinCall(c, "@exp", &.{payload}); | |
| 1496 | }, | |
| 1497 | .exp2 => { | |
| 1498 | const payload = node.castTag(.exp2).?.data; | |
| 1499 | return renderBuiltinCall(c, "@exp2", &.{payload}); | |
| 1500 | }, | |
| 1501 | .exp10 => { | |
| 1502 | const payload = node.castTag(.exp10).?.data; | |
| 1503 | return renderBuiltinCall(c, "@exp10", &.{payload}); | |
| 1504 | }, | |
| 1505 | .abs => { | |
| 1506 | const payload = node.castTag(.abs).?.data; | |
| 1507 | return renderBuiltinCall(c, "@abs", &.{payload}); | |
| 1508 | }, | |
| 1509 | .log => { | |
| 1510 | const payload = node.castTag(.log).?.data; | |
| 1511 | return renderBuiltinCall(c, "@log", &.{payload}); | |
| 1512 | }, | |
| 1513 | .log2 => { | |
| 1514 | const payload = node.castTag(.log2).?.data; | |
| 1515 | return renderBuiltinCall(c, "@log2", &.{payload}); | |
| 1516 | }, | |
| 1517 | .log10 => { | |
| 1518 | const payload = node.castTag(.log10).?.data; | |
| 1519 | return renderBuiltinCall(c, "@log10", &.{payload}); | |
| 1520 | }, | |
| 1521 | .round => { | |
| 1522 | const payload = node.castTag(.round).?.data; | |
| 1523 | return renderBuiltinCall(c, "@round", &.{payload}); | |
| 1524 | }, | |
| 1525 | .sqrt => { | |
| 1526 | const payload = node.castTag(.sqrt).?.data; | |
| 1527 | return renderBuiltinCall(c, "@sqrt", &.{payload}); | |
| 1528 | }, | |
| 1529 | .trunc => { | |
| 1530 | const payload = node.castTag(.trunc).?.data; | |
| 1531 | return renderBuiltinCall(c, "@trunc", &.{payload}); | |
| 1532 | }, | |
| 1533 | .floor => { | |
| 1534 | const payload = node.castTag(.floor).?.data; | |
| 1535 | return renderBuiltinCall(c, "@floor", &.{payload}); | |
| 1536 | }, | |
| 1537 | .negate => return renderPrefixOp(c, node, .negation, .minus, "-"), | |
| 1538 | .negate_wrap => return renderPrefixOp(c, node, .negation_wrap, .minus_percent, "-%"), | |
| 1539 | .bit_not => return renderPrefixOp(c, node, .bit_not, .tilde, "~"), | |
| 1540 | .not => return renderPrefixOp(c, node, .bool_not, .bang, "!"), | |
| 1541 | .optional_type => return renderPrefixOp(c, node, .optional_type, .question_mark, "?"), | |
| 1542 | .address_of => { | |
| 1543 | const payload = node.castTag(.address_of).?.data; | |
| 1544 | ||
| 1545 | const ampersand = try c.addToken(.ampersand, "&"); | |
| 1546 | const base = try renderNodeGrouped(c, payload); | |
| 1547 | return c.addNode(.{ | |
| 1548 | .tag = .address_of, | |
| 1549 | .main_token = ampersand, | |
| 1550 | .data = .{ | |
| 1551 | .node = base, | |
| 1552 | }, | |
| 1553 | }); | |
| 1554 | }, | |
| 1555 | .deref => { | |
| 1556 | const payload = node.castTag(.deref).?.data; | |
| 1557 | const operand = try renderNodeGrouped(c, payload); | |
| 1558 | const deref_tok = try c.addToken(.period_asterisk, ".*"); | |
| 1559 | return c.addNode(.{ | |
| 1560 | .tag = .deref, | |
| 1561 | .main_token = deref_tok, | |
| 1562 | .data = .{ | |
| 1563 | .node = operand, | |
| 1564 | }, | |
| 1565 | }); | |
| 1566 | }, | |
| 1567 | .unwrap => { | |
| 1568 | const payload = node.castTag(.unwrap).?.data; | |
| 1569 | const operand = try renderNodeGrouped(c, payload); | |
| 1570 | const period = try c.addToken(.period, "."); | |
| 1571 | const question_mark = try c.addToken(.question_mark, "?"); | |
| 1572 | return c.addNode(.{ | |
| 1573 | .tag = .unwrap_optional, | |
| 1574 | .main_token = period, | |
| 1575 | .data = .{ .node_and_token = .{ | |
| 1576 | operand, question_mark, | |
| 1577 | } }, | |
| 1578 | }); | |
| 1579 | }, | |
| 1580 | .c_pointer, .single_pointer => { | |
| 1581 | const payload = @as(*Payload.Pointer, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 1582 | ||
| 1583 | const main_token = if (node.tag() == .single_pointer) | |
| 1584 | try c.addToken(.asterisk, "*") | |
| 1585 | else blk: { | |
| 1586 | const res = try c.addToken(.l_bracket, "["); | |
| 1587 | _ = try c.addToken(.asterisk, "*"); | |
| 1588 | _ = try c.addIdentifier("c"); | |
| 1589 | _ = try c.addToken(.r_bracket, "]"); | |
| 1590 | break :blk res; | |
| 1591 | }; | |
| 1592 | if (payload.is_const) _ = try c.addToken(.keyword_const, "const"); | |
| 1593 | if (payload.is_volatile) _ = try c.addToken(.keyword_volatile, "volatile"); | |
| 1594 | if (payload.is_allowzero) _ = try c.addToken(.keyword_allowzero, "allowzero"); | |
| 1595 | const elem_type = try renderNodeGrouped(c, payload.elem_type); | |
| 1596 | ||
| 1597 | return c.addNode(.{ | |
| 1598 | .tag = .ptr_type_aligned, | |
| 1599 | .main_token = main_token, | |
| 1600 | .data = .{ | |
| 1601 | .opt_node_and_node = .{ | |
| 1602 | .none, // Align node | |
| 1603 | elem_type, | |
| 1604 | }, | |
| 1605 | }, | |
| 1606 | }); | |
| 1607 | }, | |
| 1608 | .add => return renderBinOpGrouped(c, node, .add, .plus, "+"), | |
| 1609 | .add_assign => return renderBinOp(c, node, .assign_add, .plus_equal, "+="), | |
| 1610 | .add_wrap => return renderBinOpGrouped(c, node, .add_wrap, .plus_percent, "+%"), | |
| 1611 | .add_wrap_assign => return renderBinOp(c, node, .assign_add_wrap, .plus_percent_equal, "+%="), | |
| 1612 | .sub => return renderBinOpGrouped(c, node, .sub, .minus, "-"), | |
| 1613 | .sub_assign => return renderBinOp(c, node, .assign_sub, .minus_equal, "-="), | |
| 1614 | .sub_wrap => return renderBinOpGrouped(c, node, .sub_wrap, .minus_percent, "-%"), | |
| 1615 | .sub_wrap_assign => return renderBinOp(c, node, .assign_sub_wrap, .minus_percent_equal, "-%="), | |
| 1616 | .mul => return renderBinOpGrouped(c, node, .mul, .asterisk, "*"), | |
| 1617 | .mul_assign => return renderBinOp(c, node, .assign_mul, .asterisk_equal, "*="), | |
| 1618 | .mul_wrap => return renderBinOpGrouped(c, node, .mul_wrap, .asterisk_percent, "*%"), | |
| 1619 | .mul_wrap_assign => return renderBinOp(c, node, .assign_mul_wrap, .asterisk_percent_equal, "*%="), | |
| 1620 | .div => return renderBinOpGrouped(c, node, .div, .slash, "/"), | |
| 1621 | .div_assign => return renderBinOp(c, node, .assign_div, .slash_equal, "/="), | |
| 1622 | .shl => return renderBinOpGrouped(c, node, .shl, .angle_bracket_angle_bracket_left, "<<"), | |
| 1623 | .shl_assign => return renderBinOp(c, node, .assign_shl, .angle_bracket_angle_bracket_left_equal, "<<="), | |
| 1624 | .shr => return renderBinOpGrouped(c, node, .shr, .angle_bracket_angle_bracket_right, ">>"), | |
| 1625 | .shr_assign => return renderBinOp(c, node, .assign_shr, .angle_bracket_angle_bracket_right_equal, ">>="), | |
| 1626 | .mod => return renderBinOpGrouped(c, node, .mod, .percent, "%"), | |
| 1627 | .mod_assign => return renderBinOp(c, node, .assign_mod, .percent_equal, "%="), | |
| 1628 | .@"and" => return renderBinOpGrouped(c, node, .bool_and, .keyword_and, "and"), | |
| 1629 | .@"or" => return renderBinOpGrouped(c, node, .bool_or, .keyword_or, "or"), | |
| 1630 | .less_than => return renderBinOpGrouped(c, node, .less_than, .angle_bracket_left, "<"), | |
| 1631 | .less_than_equal => return renderBinOpGrouped(c, node, .less_or_equal, .angle_bracket_left_equal, "<="), | |
| 1632 | .greater_than => return renderBinOpGrouped(c, node, .greater_than, .angle_bracket_right, ">="), | |
| 1633 | .greater_than_equal => return renderBinOpGrouped(c, node, .greater_or_equal, .angle_bracket_right_equal, ">="), | |
| 1634 | .equal => return renderBinOpGrouped(c, node, .equal_equal, .equal_equal, "=="), | |
| 1635 | .not_equal => return renderBinOpGrouped(c, node, .bang_equal, .bang_equal, "!="), | |
| 1636 | .bit_and => return renderBinOpGrouped(c, node, .bit_and, .ampersand, "&"), | |
| 1637 | .bit_and_assign => return renderBinOp(c, node, .assign_bit_and, .ampersand_equal, "&="), | |
| 1638 | .bit_or => return renderBinOpGrouped(c, node, .bit_or, .pipe, "|"), | |
| 1639 | .bit_or_assign => return renderBinOp(c, node, .assign_bit_or, .pipe_equal, "|="), | |
| 1640 | .bit_xor => return renderBinOpGrouped(c, node, .bit_xor, .caret, "^"), | |
| 1641 | .bit_xor_assign => return renderBinOp(c, node, .assign_bit_xor, .caret_equal, "^="), | |
| 1642 | .array_cat => return renderBinOp(c, node, .array_cat, .plus_plus, "++"), | |
| 1643 | .ellipsis3 => return renderBinOpGrouped(c, node, .switch_range, .ellipsis3, "..."), | |
| 1644 | .assign => return renderBinOp(c, node, .assign, .equal, "="), | |
| 1645 | .empty_block => { | |
| 1646 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1647 | _ = try c.addToken(.r_brace, "}"); | |
| 1648 | return c.addNode(.{ | |
| 1649 | .tag = .block_two, | |
| 1650 | .main_token = l_brace, | |
| 1651 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1652 | .none, .none, | |
| 1653 | } }, | |
| 1654 | }); | |
| 1655 | }, | |
| 1656 | .block_single => { | |
| 1657 | const payload = node.castTag(.block_single).?.data; | |
| 1658 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1659 | ||
| 1660 | const stmt = (try renderNodeOpt(c, payload)) orelse { | |
| 1661 | _ = try c.addToken(.r_brace, "}"); | |
| 1662 | return c.addNode(.{ | |
| 1663 | .tag = .block_two, | |
| 1664 | .main_token = l_brace, | |
| 1665 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1666 | .none, .none, | |
| 1667 | } }, | |
| 1668 | }); | |
| 1669 | }; | |
| 1670 | try addSemicolonIfNeeded(c, payload); | |
| 1671 | ||
| 1672 | _ = try c.addToken(.r_brace, "}"); | |
| 1673 | return c.addNode(.{ | |
| 1674 | .tag = .block_two_semicolon, | |
| 1675 | .main_token = l_brace, | |
| 1676 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1677 | stmt.toOptional(), .none, | |
| 1678 | } }, | |
| 1679 | }); | |
| 1680 | }, | |
| 1681 | .block => { | |
| 1682 | const payload = node.castTag(.block).?.data; | |
| 1683 | if (payload.label) |some| { | |
| 1684 | _ = try c.addIdentifier(some); | |
| 1685 | _ = try c.addToken(.colon, ":"); | |
| 1686 | } | |
| 1687 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1688 | ||
| 1689 | var stmts: std.ArrayList(NodeIndex) = .empty; | |
| 1690 | defer stmts.deinit(c.gpa); | |
| 1691 | for (payload.stmts) |stmt| { | |
| 1692 | const res = (try renderNodeOpt(c, stmt)) orelse continue; | |
| 1693 | try addSemicolonIfNeeded(c, stmt); | |
| 1694 | try stmts.append(c.gpa, res); | |
| 1695 | } | |
| 1696 | const span = try c.listToSpan(stmts.items); | |
| 1697 | _ = try c.addToken(.r_brace, "}"); | |
| 1698 | ||
| 1699 | const semicolon = c.tokens.items(.tag)[c.tokens.len - 2] == .semicolon; | |
| 1700 | return c.addNode(.{ | |
| 1701 | .tag = if (semicolon) .block_semicolon else .block, | |
| 1702 | .main_token = l_brace, | |
| 1703 | .data = .{ .extra_range = span }, | |
| 1704 | }); | |
| 1705 | }, | |
| 1706 | .func => return renderFunc(c, node), | |
| 1707 | .pub_inline_fn => return renderMacroFunc(c, node), | |
| 1708 | .@"while" => { | |
| 1709 | const payload = node.castTag(.@"while").?.data; | |
| 1710 | const while_tok = try c.addToken(.keyword_while, "while"); | |
| 1711 | _ = try c.addToken(.l_paren, "("); | |
| 1712 | const cond = try renderNode(c, payload.cond); | |
| 1713 | _ = try c.addToken(.r_paren, ")"); | |
| 1714 | ||
| 1715 | const cont_expr_opt = if (payload.cont_expr) |some| blk: { | |
| 1716 | _ = try c.addToken(.colon, ":"); | |
| 1717 | _ = try c.addToken(.l_paren, "("); | |
| 1718 | const res = try renderNode(c, some); | |
| 1719 | _ = try c.addToken(.r_paren, ")"); | |
| 1720 | break :blk res; | |
| 1721 | } else null; | |
| 1722 | const body = try renderNode(c, payload.body); | |
| 1723 | ||
| 1724 | if (cont_expr_opt) |cont_expr| { | |
| 1725 | return c.addNode(.{ | |
| 1726 | .tag = .while_cont, | |
| 1727 | .main_token = while_tok, | |
| 1728 | .data = .{ .node_and_extra = .{ | |
| 1729 | cond, | |
| 1730 | try c.addExtra(std.zig.Ast.Node.WhileCont{ | |
| 1731 | .cont_expr = cont_expr, | |
| 1732 | .then_expr = body, | |
| 1733 | }), | |
| 1734 | } }, | |
| 1735 | }); | |
| 1736 | } else { | |
| 1737 | return c.addNode(.{ | |
| 1738 | .tag = .while_simple, | |
| 1739 | .main_token = while_tok, | |
| 1740 | .data = .{ .node_and_node = .{ | |
| 1741 | cond, body, | |
| 1742 | } }, | |
| 1743 | }); | |
| 1744 | } | |
| 1745 | }, | |
| 1746 | .while_true => { | |
| 1747 | const payload = node.castTag(.while_true).?.data; | |
| 1748 | const while_tok = try c.addToken(.keyword_while, "while"); | |
| 1749 | _ = try c.addToken(.l_paren, "("); | |
| 1750 | const cond = try c.addNode(.{ | |
| 1751 | .tag = .identifier, | |
| 1752 | .main_token = try c.addToken(.identifier, "true"), | |
| 1753 | .data = undefined, | |
| 1754 | }); | |
| 1755 | _ = try c.addToken(.r_paren, ")"); | |
| 1756 | const body = try renderNode(c, payload); | |
| 1757 | ||
| 1758 | return c.addNode(.{ | |
| 1759 | .tag = .while_simple, | |
| 1760 | .main_token = while_tok, | |
| 1761 | .data = .{ .node_and_node = .{ | |
| 1762 | cond, body, | |
| 1763 | } }, | |
| 1764 | }); | |
| 1765 | }, | |
| 1766 | .@"if" => { | |
| 1767 | const payload = node.castTag(.@"if").?.data; | |
| 1768 | const if_tok = try c.addToken(.keyword_if, "if"); | |
| 1769 | _ = try c.addToken(.l_paren, "("); | |
| 1770 | const cond = try renderNode(c, payload.cond); | |
| 1771 | _ = try c.addToken(.r_paren, ")"); | |
| 1772 | ||
| 1773 | const then_expr = try renderNode(c, payload.then); | |
| 1774 | const else_node = payload.@"else" orelse return c.addNode(.{ | |
| 1775 | .tag = .if_simple, | |
| 1776 | .main_token = if_tok, | |
| 1777 | .data = .{ .node_and_node = .{ | |
| 1778 | cond, then_expr, | |
| 1779 | } }, | |
| 1780 | }); | |
| 1781 | _ = try c.addToken(.keyword_else, "else"); | |
| 1782 | const else_expr = try renderNode(c, else_node); | |
| 1783 | ||
| 1784 | return c.addNode(.{ | |
| 1785 | .tag = .@"if", | |
| 1786 | .main_token = if_tok, | |
| 1787 | .data = .{ .node_and_extra = .{ | |
| 1788 | cond, | |
| 1789 | try c.addExtra(std.zig.Ast.Node.If{ | |
| 1790 | .then_expr = then_expr, | |
| 1791 | .else_expr = else_expr, | |
| 1792 | }), | |
| 1793 | } }, | |
| 1794 | }); | |
| 1795 | }, | |
| 1796 | .if_not_break => { | |
| 1797 | const payload = node.castTag(.if_not_break).?.data; | |
| 1798 | const if_tok = try c.addToken(.keyword_if, "if"); | |
| 1799 | _ = try c.addToken(.l_paren, "("); | |
| 1800 | const cond = try c.addNode(.{ | |
| 1801 | .tag = .bool_not, | |
| 1802 | .main_token = try c.addToken(.bang, "!"), | |
| 1803 | .data = .{ | |
| 1804 | .node = try renderNodeGrouped(c, payload), | |
| 1805 | }, | |
| 1806 | }); | |
| 1807 | _ = try c.addToken(.r_paren, ")"); | |
| 1808 | const then_expr = try c.addNode(.{ | |
| 1809 | .tag = .@"break", | |
| 1810 | .main_token = try c.addToken(.keyword_break, "break"), | |
| 1811 | .data = .{ .opt_token_and_opt_node = .{ | |
| 1812 | .none, .none, | |
| 1813 | } }, | |
| 1814 | }); | |
| 1815 | ||
| 1816 | return c.addNode(.{ | |
| 1817 | .tag = .if_simple, | |
| 1818 | .main_token = if_tok, | |
| 1819 | .data = .{ .node_and_node = .{ | |
| 1820 | cond, then_expr, | |
| 1821 | } }, | |
| 1822 | }); | |
| 1823 | }, | |
| 1824 | .@"switch" => { | |
| 1825 | const payload = node.castTag(.@"switch").?.data; | |
| 1826 | const switch_tok = try c.addToken(.keyword_switch, "switch"); | |
| 1827 | _ = try c.addToken(.l_paren, "("); | |
| 1828 | const cond = try renderNode(c, payload.cond); | |
| 1829 | _ = try c.addToken(.r_paren, ")"); | |
| 1830 | ||
| 1831 | _ = try c.addToken(.l_brace, "{"); | |
| 1832 | var cases = try c.gpa.alloc(NodeIndex, payload.cases.len); | |
| 1833 | defer c.gpa.free(cases); | |
| 1834 | for (payload.cases, 0..) |case, i| { | |
| 1835 | cases[i] = try renderNode(c, case); | |
| 1836 | _ = try c.addToken(.comma, ","); | |
| 1837 | } | |
| 1838 | const span = try c.listToSpan(cases); | |
| 1839 | _ = try c.addToken(.r_brace, "}"); | |
| 1840 | return c.addNode(.{ | |
| 1841 | .tag = .switch_comma, | |
| 1842 | .main_token = switch_tok, | |
| 1843 | .data = .{ .node_and_extra = .{ | |
| 1844 | cond, | |
| 1845 | try c.addExtra(NodeSubRange{ | |
| 1846 | .start = span.start, | |
| 1847 | .end = span.end, | |
| 1848 | }), | |
| 1849 | } }, | |
| 1850 | }); | |
| 1851 | }, | |
| 1852 | .switch_else => { | |
| 1853 | const payload = node.castTag(.switch_else).?.data; | |
| 1854 | _ = try c.addToken(.keyword_else, "else"); | |
| 1855 | return c.addNode(.{ | |
| 1856 | .tag = .switch_case_one, | |
| 1857 | .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), | |
| 1858 | .data = .{ .opt_node_and_node = .{ | |
| 1859 | .none, try renderNode(c, payload), | |
| 1860 | } }, | |
| 1861 | }); | |
| 1862 | }, | |
| 1863 | .switch_prong => { | |
| 1864 | const payload = node.castTag(.switch_prong).?.data; | |
| 1865 | var items = try c.gpa.alloc(NodeIndex, payload.cases.len); | |
| 1866 | defer c.gpa.free(items); | |
| 1867 | ||
| 1868 | for (payload.cases, 0..) |item, i| { | |
| 1869 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 1870 | items[i] = try renderNode(c, item); | |
| 1871 | } | |
| 1872 | _ = try c.addToken(.r_brace, "}"); | |
| 1873 | if (items.len < 2) { | |
| 1874 | return c.addNode(.{ | |
| 1875 | .tag = .switch_case_one, | |
| 1876 | .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), | |
| 1877 | .data = .{ .opt_node_and_node = .{ | |
| 1878 | if (payload.cases.len == 1) items[0].toOptional() else .none, | |
| 1879 | try renderNode(c, payload.cond), | |
| 1880 | } }, | |
| 1881 | }); | |
| 1882 | } else { | |
| 1883 | return c.addNode(.{ | |
| 1884 | .tag = .switch_case, | |
| 1885 | .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), | |
| 1886 | .data = .{ .extra_and_node = .{ | |
| 1887 | try c.addExtra(try c.listToSpan(items)), | |
| 1888 | try renderNode(c, payload.cond), | |
| 1889 | } }, | |
| 1890 | }); | |
| 1891 | } | |
| 1892 | }, | |
| 1893 | .opaque_literal => { | |
| 1894 | const opaque_tok = try c.addToken(.keyword_opaque, "opaque"); | |
| 1895 | _ = try c.addToken(.l_brace, "{"); | |
| 1896 | _ = try c.addToken(.r_brace, "}"); | |
| 1897 | ||
| 1898 | return c.addNode(.{ | |
| 1899 | .tag = .container_decl_two, | |
| 1900 | .main_token = opaque_tok, | |
| 1901 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1902 | .none, .none, | |
| 1903 | } }, | |
| 1904 | }); | |
| 1905 | }, | |
| 1906 | .array_access => { | |
| 1907 | const payload = node.castTag(.array_access).?.data; | |
| 1908 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 1909 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 1910 | const index_expr = try renderNode(c, payload.rhs); | |
| 1911 | _ = try c.addToken(.r_bracket, "]"); | |
| 1912 | return c.addNode(.{ | |
| 1913 | .tag = .array_access, | |
| 1914 | .main_token = l_bracket, | |
| 1915 | .data = .{ .node_and_node = .{ | |
| 1916 | lhs, index_expr, | |
| 1917 | } }, | |
| 1918 | }); | |
| 1919 | }, | |
| 1920 | .array_type => { | |
| 1921 | const payload = node.castTag(.array_type).?.data; | |
| 1922 | return renderArrayType(c, payload.len, payload.elem_type); | |
| 1923 | }, | |
| 1924 | .null_sentinel_array_type => { | |
| 1925 | const payload = node.castTag(.null_sentinel_array_type).?.data; | |
| 1926 | return renderNullSentinelArrayType(c, payload.len, payload.elem_type); | |
| 1927 | }, | |
| 1928 | .array_filler => { | |
| 1929 | const payload = node.castTag(.array_filler).?.data; | |
| 1930 | ||
| 1931 | const type_expr = try renderArrayType(c, 1, payload.type); | |
| 1932 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 1933 | const val = try renderNode(c, payload.filler); | |
| 1934 | _ = try c.addToken(.r_brace, "}"); | |
| 1935 | ||
| 1936 | const init = try c.addNode(.{ | |
| 1937 | .tag = .array_init_one, | |
| 1938 | .main_token = l_brace, | |
| 1939 | .data = .{ .node_and_node = .{ | |
| 1940 | type_expr, val, | |
| 1941 | } }, | |
| 1942 | }); | |
| 1943 | return c.addNode(.{ | |
| 1944 | .tag = .array_cat, | |
| 1945 | .main_token = try c.addToken(.asterisk_asterisk, "**"), | |
| 1946 | .data = .{ .node_and_node = .{ | |
| 1947 | init, | |
| 1948 | try c.addNode(.{ | |
| 1949 | .tag = .number_literal, | |
| 1950 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{payload.count}), | |
| 1951 | .data = undefined, | |
| 1952 | }), | |
| 1953 | } }, | |
| 1954 | }); | |
| 1955 | }, | |
| 1956 | .empty_array => { | |
| 1957 | const payload = node.castTag(.empty_array).?.data; | |
| 1958 | ||
| 1959 | const type_expr = try renderNode(c, payload); | |
| 1960 | return renderArrayInit(c, type_expr, &.{}); | |
| 1961 | }, | |
| 1962 | .array_init => { | |
| 1963 | const payload = node.castTag(.array_init).?.data; | |
| 1964 | const type_expr = try renderNode(c, payload.cond); | |
| 1965 | return renderArrayInit(c, type_expr, payload.cases); | |
| 1966 | }, | |
| 1967 | .vector_zero_init => { | |
| 1968 | const payload = node.castTag(.vector_zero_init).?.data; | |
| 1969 | return renderBuiltinCall(c, "@splat", &.{payload}); | |
| 1970 | }, | |
| 1971 | .field_access => { | |
| 1972 | const payload = node.castTag(.field_access).?.data; | |
| 1973 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 1974 | return renderFieldAccess(c, lhs, payload.field_name); | |
| 1975 | }, | |
| 1976 | .@"struct", .@"union", .@"opaque" => return renderContainer(c, node), | |
| 1977 | .enum_constant => { | |
| 1978 | const payload = node.castTag(.enum_constant).?.data; | |
| 1979 | ||
| 1980 | if (payload.is_public) _ = try c.addToken(.keyword_pub, "pub"); | |
| 1981 | const const_tok = try c.addToken(.keyword_const, "const"); | |
| 1982 | _ = try c.addIdentifier(payload.name); | |
| 1983 | ||
| 1984 | const type_node_opt = if (payload.type) |enum_const_type| blk: { | |
| 1985 | _ = try c.addToken(.colon, ":"); | |
| 1986 | break :blk try renderNode(c, enum_const_type); | |
| 1987 | } else null; | |
| 1988 | ||
| 1989 | _ = try c.addToken(.equal, "="); | |
| 1990 | ||
| 1991 | const init_node = try renderNode(c, payload.value); | |
| 1992 | _ = try c.addToken(.semicolon, ";"); | |
| 1993 | ||
| 1994 | return c.addNode(.{ | |
| 1995 | .tag = .simple_var_decl, | |
| 1996 | .main_token = const_tok, | |
| 1997 | .data = .{ .opt_node_and_opt_node = .{ | |
| 1998 | .fromOptional(type_node_opt), | |
| 1999 | init_node.toOptional(), | |
| 2000 | } }, | |
| 2001 | }); | |
| 2002 | }, | |
| 2003 | .tuple => { | |
| 2004 | const payload = node.castTag(.tuple).?.data; | |
| 2005 | _ = try c.addToken(.period, "."); | |
| 2006 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2007 | var inits = try c.gpa.alloc(NodeIndex, payload.len); | |
| 2008 | defer c.gpa.free(inits); | |
| 2009 | ||
| 2010 | for (payload, 0..) |init, i| { | |
| 2011 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 2012 | inits[i] = try renderNode(c, init); | |
| 2013 | } | |
| 2014 | _ = try c.addToken(.r_brace, "}"); | |
| 2015 | if (payload.len < 3) { | |
| 2016 | return c.addNode(.{ | |
| 2017 | .tag = .array_init_dot_two, | |
| 2018 | .main_token = l_brace, | |
| 2019 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2020 | if (inits.len >= 1) inits[0].toOptional() else .none, | |
| 2021 | if (inits.len >= 2) inits[1].toOptional() else .none, | |
| 2022 | } }, | |
| 2023 | }); | |
| 2024 | } else { | |
| 2025 | return c.addNode(.{ | |
| 2026 | .tag = .array_init_dot, | |
| 2027 | .main_token = l_brace, | |
| 2028 | .data = .{ .extra_range = try c.listToSpan(inits) }, | |
| 2029 | }); | |
| 2030 | } | |
| 2031 | }, | |
| 2032 | .container_init_dot => { | |
| 2033 | const payload = node.castTag(.container_init_dot).?.data; | |
| 2034 | _ = try c.addToken(.period, "."); | |
| 2035 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2036 | var inits = try c.gpa.alloc(NodeIndex, payload.len); | |
| 2037 | defer c.gpa.free(inits); | |
| 2038 | ||
| 2039 | for (payload, 0..) |init, i| { | |
| 2040 | _ = try c.addToken(.period, "."); | |
| 2041 | _ = try c.addIdentifier(init.name); | |
| 2042 | _ = try c.addToken(.equal, "="); | |
| 2043 | inits[i] = try renderNode(c, init.value); | |
| 2044 | _ = try c.addToken(.comma, ","); | |
| 2045 | } | |
| 2046 | _ = try c.addToken(.r_brace, "}"); | |
| 2047 | ||
| 2048 | if (payload.len < 3) { | |
| 2049 | return c.addNode(.{ | |
| 2050 | .tag = .struct_init_dot_two_comma, | |
| 2051 | .main_token = l_brace, | |
| 2052 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2053 | if (inits.len >= 1) inits[0].toOptional() else .none, | |
| 2054 | if (inits.len >= 2) inits[1].toOptional() else .none, | |
| 2055 | } }, | |
| 2056 | }); | |
| 2057 | } else { | |
| 2058 | return c.addNode(.{ | |
| 2059 | .tag = .struct_init_dot_comma, | |
| 2060 | .main_token = l_brace, | |
| 2061 | .data = .{ .extra_range = try c.listToSpan(inits) }, | |
| 2062 | }); | |
| 2063 | } | |
| 2064 | }, | |
| 2065 | .container_init => { | |
| 2066 | const payload = node.castTag(.container_init).?.data; | |
| 2067 | const lhs = try renderNode(c, payload.lhs); | |
| 2068 | ||
| 2069 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2070 | var inits = try c.gpa.alloc(NodeIndex, payload.inits.len); | |
| 2071 | defer c.gpa.free(inits); | |
| 2072 | ||
| 2073 | for (payload.inits, 0..) |init, i| { | |
| 2074 | _ = try c.addToken(.period, "."); | |
| 2075 | _ = try c.addIdentifier(init.name); | |
| 2076 | _ = try c.addToken(.equal, "="); | |
| 2077 | inits[i] = try renderNode(c, init.value); | |
| 2078 | _ = try c.addToken(.comma, ","); | |
| 2079 | } | |
| 2080 | _ = try c.addToken(.r_brace, "}"); | |
| 2081 | ||
| 2082 | switch (inits.len) { | |
| 2083 | 0 => return c.addNode(.{ | |
| 2084 | .tag = .struct_init_one, | |
| 2085 | .main_token = l_brace, | |
| 2086 | .data = .{ .node_and_opt_node = .{ | |
| 2087 | lhs, .none, | |
| 2088 | } }, | |
| 2089 | }), | |
| 2090 | 1 => return c.addNode(.{ | |
| 2091 | .tag = .struct_init_one_comma, | |
| 2092 | .main_token = l_brace, | |
| 2093 | .data = .{ .node_and_opt_node = .{ | |
| 2094 | lhs, inits[0].toOptional(), | |
| 2095 | } }, | |
| 2096 | }), | |
| 2097 | else => return c.addNode(.{ | |
| 2098 | .tag = .struct_init_comma, | |
| 2099 | .main_token = l_brace, | |
| 2100 | .data = .{ .node_and_extra = .{ | |
| 2101 | lhs, | |
| 2102 | try c.addExtra(try c.listToSpan(inits)), | |
| 2103 | } }, | |
| 2104 | }), | |
| 2105 | } | |
| 2106 | }, | |
| 2107 | .static_assert => { | |
| 2108 | const payload = node.castTag(.static_assert).?.data; | |
| 2109 | const comptime_tok = try c.addToken(.keyword_comptime, "comptime"); | |
| 2110 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2111 | ||
| 2112 | const if_tok = try c.addToken(.keyword_if, "if"); | |
| 2113 | _ = try c.addToken(.l_paren, "("); | |
| 2114 | const cond = try c.addNode(.{ | |
| 2115 | .tag = .bool_not, | |
| 2116 | .main_token = try c.addToken(.bang, "!"), | |
| 2117 | .data = .{ | |
| 2118 | .node = try renderNodeGrouped(c, payload.lhs), | |
| 2119 | }, | |
| 2120 | }); | |
| 2121 | _ = try c.addToken(.r_paren, ")"); | |
| 2122 | ||
| 2123 | const compile_error_tok = try c.addToken(.builtin, "@compileError"); | |
| 2124 | _ = try c.addToken(.l_paren, "("); | |
| 2125 | const err_msg = try renderNode(c, payload.rhs); | |
| 2126 | _ = try c.addToken(.r_paren, ")"); | |
| 2127 | const compile_error = try c.addNode(.{ | |
| 2128 | .tag = .builtin_call_two, | |
| 2129 | .main_token = compile_error_tok, | |
| 2130 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2131 | err_msg.toOptional(), .none, | |
| 2132 | } }, | |
| 2133 | }); | |
| 2134 | ||
| 2135 | const if_node = try c.addNode(.{ | |
| 2136 | .tag = .if_simple, | |
| 2137 | .main_token = if_tok, | |
| 2138 | .data = .{ .node_and_node = .{ | |
| 2139 | cond, compile_error, | |
| 2140 | } }, | |
| 2141 | }); | |
| 2142 | _ = try c.addToken(.semicolon, ";"); | |
| 2143 | _ = try c.addToken(.r_brace, "}"); | |
| 2144 | const block_node = try c.addNode(.{ | |
| 2145 | .tag = .block_two_semicolon, | |
| 2146 | .main_token = l_brace, | |
| 2147 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2148 | if_node.toOptional(), .none, | |
| 2149 | } }, | |
| 2150 | }); | |
| 2151 | ||
| 2152 | return c.addNode(.{ | |
| 2153 | .tag = .@"comptime", | |
| 2154 | .main_token = comptime_tok, | |
| 2155 | .data = .{ | |
| 2156 | .node = block_node, | |
| 2157 | }, | |
| 2158 | }); | |
| 2159 | }, | |
| 2160 | .@"anytype" => unreachable, // Handled in renderParams | |
| 2161 | } | |
| 2162 | } | |
| 2163 | ||
| 2164 | fn renderContainer(c: *Context, node: Node) !NodeIndex { | |
| 2165 | const payload = @as(*Payload.Container, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2166 | if (payload.layout == .@"packed") | |
| 2167 | _ = try c.addToken(.keyword_packed, "packed") | |
| 2168 | else if (payload.layout == .@"extern") | |
| 2169 | _ = try c.addToken(.keyword_extern, "extern"); | |
| 2170 | const kind_tok = if (node.tag() == .@"struct") | |
| 2171 | try c.addToken(.keyword_struct, "struct") | |
| 2172 | else if (node.tag() == .@"union") | |
| 2173 | try c.addToken(.keyword_union, "union") | |
| 2174 | else if (node.tag() == .@"opaque") | |
| 2175 | try c.addToken(.keyword_opaque, "opaque") | |
| 2176 | else | |
| 2177 | unreachable; | |
| 2178 | ||
| 2179 | _ = try c.addToken(.l_brace, "{"); | |
| 2180 | ||
| 2181 | const num_decls = payload.decls.len; | |
| 2182 | const total_members = payload.fields.len + num_decls; | |
| 2183 | const members = try c.gpa.alloc(NodeIndex, total_members); | |
| 2184 | defer c.gpa.free(members); | |
| 2185 | ||
| 2186 | for (payload.fields, 0..) |field, i| { | |
| 2187 | const name_tok = try c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(field.name, .{ .allow_primitive = true })}); | |
| 2188 | _ = try c.addToken(.colon, ":"); | |
| 2189 | const type_expr = try renderNode(c, field.type); | |
| 2190 | ||
| 2191 | const align_expr_opt = if (field.alignment) |alignment| blk: { | |
| 2192 | _ = try c.addToken(.keyword_align, "align"); | |
| 2193 | _ = try c.addToken(.l_paren, "("); | |
| 2194 | const align_expr = try c.addNode(.{ | |
| 2195 | .tag = .number_literal, | |
| 2196 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{alignment}), | |
| 2197 | .data = undefined, | |
| 2198 | }); | |
| 2199 | _ = try c.addToken(.r_paren, ")"); | |
| 2200 | break :blk align_expr; | |
| 2201 | } else null; | |
| 2202 | ||
| 2203 | const value_expr_opt = if (field.default_value) |value| blk: { | |
| 2204 | _ = try c.addToken(.equal, "="); | |
| 2205 | break :blk try renderNode(c, value); | |
| 2206 | } else null; | |
| 2207 | ||
| 2208 | if (align_expr_opt) |align_expr| { | |
| 2209 | if (value_expr_opt) |value_expr| { | |
| 2210 | members[i] = try c.addNode(.{ | |
| 2211 | .tag = .container_field, | |
| 2212 | .main_token = name_tok, | |
| 2213 | .data = .{ .node_and_extra = .{ | |
| 2214 | type_expr, | |
| 2215 | try c.addExtra(std.zig.Ast.Node.ContainerField{ | |
| 2216 | .align_expr = align_expr, | |
| 2217 | .value_expr = value_expr, | |
| 2218 | }), | |
| 2219 | } }, | |
| 2220 | }); | |
| 2221 | } else { | |
| 2222 | members[i] = try c.addNode(.{ | |
| 2223 | .tag = .container_field_align, | |
| 2224 | .main_token = name_tok, | |
| 2225 | .data = .{ .node_and_node = .{ | |
| 2226 | type_expr, | |
| 2227 | align_expr, | |
| 2228 | } }, | |
| 2229 | }); | |
| 2230 | } | |
| 2231 | } else { | |
| 2232 | members[i] = try c.addNode(.{ | |
| 2233 | .tag = .container_field_init, | |
| 2234 | .main_token = name_tok, | |
| 2235 | .data = .{ .node_and_opt_node = .{ | |
| 2236 | type_expr, | |
| 2237 | .fromOptional(value_expr_opt), | |
| 2238 | } }, | |
| 2239 | }); | |
| 2240 | } | |
| 2241 | _ = try c.addToken(.comma, ","); | |
| 2242 | } | |
| 2243 | for (members[payload.fields.len..], payload.decls) |*member, decl| { | |
| 2244 | member.* = try renderNode(c, decl); | |
| 2245 | } | |
| 2246 | const trailing = switch (c.tokens.items(.tag)[c.tokens.len - 1]) { | |
| 2247 | .comma, .semicolon => true, | |
| 2248 | else => false, | |
| 2249 | }; | |
| 2250 | _ = try c.addToken(.r_brace, "}"); | |
| 2251 | ||
| 2252 | if (total_members == 0) { | |
| 2253 | return c.addNode(.{ | |
| 2254 | .tag = .container_decl_two, | |
| 2255 | .main_token = kind_tok, | |
| 2256 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2257 | .none, .none, | |
| 2258 | } }, | |
| 2259 | }); | |
| 2260 | } else if (total_members <= 2) { | |
| 2261 | return c.addNode(.{ | |
| 2262 | .tag = if (trailing) .container_decl_two_trailing else .container_decl_two, | |
| 2263 | .main_token = kind_tok, | |
| 2264 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2265 | if (members.len >= 1) members[0].toOptional() else .none, | |
| 2266 | if (members.len >= 2) members[1].toOptional() else .none, | |
| 2267 | } }, | |
| 2268 | }); | |
| 2269 | } else { | |
| 2270 | const span = try c.listToSpan(members); | |
| 2271 | return c.addNode(.{ | |
| 2272 | .tag = if (trailing) .container_decl_trailing else .container_decl, | |
| 2273 | .main_token = kind_tok, | |
| 2274 | .data = .{ .extra_range = span }, | |
| 2275 | }); | |
| 2276 | } | |
| 2277 | } | |
| 2278 | ||
| 2279 | fn renderFieldAccess(c: *Context, lhs: NodeIndex, field_name: []const u8) !NodeIndex { | |
| 2280 | return c.addNode(.{ | |
| 2281 | .tag = .field_access, | |
| 2282 | .main_token = try c.addToken(.period, "."), | |
| 2283 | .data = .{ .node_and_token = .{ | |
| 2284 | lhs, try c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(field_name, .{ .allow_primitive = true })}), | |
| 2285 | } }, | |
| 2286 | }); | |
| 2287 | } | |
| 2288 | ||
| 2289 | fn renderArrayInit(c: *Context, lhs: NodeIndex, inits: []const Node) !NodeIndex { | |
| 2290 | const l_brace = try c.addToken(.l_brace, "{"); | |
| 2291 | var rendered = try c.gpa.alloc(NodeIndex, inits.len); | |
| 2292 | defer c.gpa.free(rendered); | |
| 2293 | ||
| 2294 | for (inits, 0..) |init, i| { | |
| 2295 | rendered[i] = try renderNode(c, init); | |
| 2296 | _ = try c.addToken(.comma, ","); | |
| 2297 | } | |
| 2298 | _ = try c.addToken(.r_brace, "}"); | |
| 2299 | switch (inits.len) { | |
| 2300 | 0 => return c.addNode(.{ | |
| 2301 | .tag = .struct_init_one, | |
| 2302 | .main_token = l_brace, | |
| 2303 | .data = .{ .node_and_opt_node = .{ | |
| 2304 | lhs, .none, | |
| 2305 | } }, | |
| 2306 | }), | |
| 2307 | 1 => return c.addNode(.{ | |
| 2308 | .tag = .array_init_one_comma, | |
| 2309 | .main_token = l_brace, | |
| 2310 | .data = .{ .node_and_node = .{ | |
| 2311 | lhs, rendered[0], | |
| 2312 | } }, | |
| 2313 | }), | |
| 2314 | else => return c.addNode(.{ | |
| 2315 | .tag = .array_init_comma, | |
| 2316 | .main_token = l_brace, | |
| 2317 | .data = .{ .node_and_extra = .{ | |
| 2318 | lhs, | |
| 2319 | try c.addExtra(try c.listToSpan(rendered)), | |
| 2320 | } }, | |
| 2321 | }), | |
| 2322 | } | |
| 2323 | } | |
| 2324 | ||
| 2325 | fn renderArrayType(c: *Context, len: u64, elem_type: Node) !NodeIndex { | |
| 2326 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 2327 | const len_expr = try c.addNode(.{ | |
| 2328 | .tag = .number_literal, | |
| 2329 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{len}), | |
| 2330 | .data = undefined, | |
| 2331 | }); | |
| 2332 | _ = try c.addToken(.r_bracket, "]"); | |
| 2333 | const elem_type_expr = try renderNode(c, elem_type); | |
| 2334 | return c.addNode(.{ | |
| 2335 | .tag = .array_type, | |
| 2336 | .main_token = l_bracket, | |
| 2337 | .data = .{ .node_and_node = .{ | |
| 2338 | len_expr, elem_type_expr, | |
| 2339 | } }, | |
| 2340 | }); | |
| 2341 | } | |
| 2342 | ||
| 2343 | fn renderNullSentinelArrayType(c: *Context, len: u64, elem_type: Node) !NodeIndex { | |
| 2344 | const l_bracket = try c.addToken(.l_bracket, "["); | |
| 2345 | const len_expr = try c.addNode(.{ | |
| 2346 | .tag = .number_literal, | |
| 2347 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{len}), | |
| 2348 | .data = undefined, | |
| 2349 | }); | |
| 2350 | _ = try c.addToken(.colon, ":"); | |
| 2351 | ||
| 2352 | const sentinel_expr = try c.addNode(.{ | |
| 2353 | .tag = .number_literal, | |
| 2354 | .main_token = try c.addToken(.number_literal, "0"), | |
| 2355 | .data = undefined, | |
| 2356 | }); | |
| 2357 | ||
| 2358 | _ = try c.addToken(.r_bracket, "]"); | |
| 2359 | const elem_type_expr = try renderNode(c, elem_type); | |
| 2360 | return c.addNode(.{ | |
| 2361 | .tag = .array_type_sentinel, | |
| 2362 | .main_token = l_bracket, | |
| 2363 | .data = .{ .node_and_extra = .{ | |
| 2364 | len_expr, | |
| 2365 | try c.addExtra(std.zig.Ast.Node.ArrayTypeSentinel{ | |
| 2366 | .sentinel = sentinel_expr, | |
| 2367 | .elem_type = elem_type_expr, | |
| 2368 | }), | |
| 2369 | } }, | |
| 2370 | }); | |
| 2371 | } | |
| 2372 | ||
| 2373 | fn addSemicolonIfNeeded(c: *Context, node: Node) !void { | |
| 2374 | switch (node.tag()) { | |
| 2375 | .warning => unreachable, | |
| 2376 | .var_decl, .var_simple, .arg_redecl, .alias, .block, .empty_block, .block_single, .@"switch", .wrapped_local, .mut_str => {}, | |
| 2377 | .while_true => { | |
| 2378 | const payload = node.castTag(.while_true).?.data; | |
| 2379 | return addSemicolonIfNotBlock(c, payload); | |
| 2380 | }, | |
| 2381 | .@"while" => { | |
| 2382 | const payload = node.castTag(.@"while").?.data; | |
| 2383 | return addSemicolonIfNotBlock(c, payload.body); | |
| 2384 | }, | |
| 2385 | .@"if" => { | |
| 2386 | const payload = node.castTag(.@"if").?.data; | |
| 2387 | if (payload.@"else") |some| | |
| 2388 | return addSemicolonIfNeeded(c, some); | |
| 2389 | return addSemicolonIfNotBlock(c, payload.then); | |
| 2390 | }, | |
| 2391 | else => _ = try c.addToken(.semicolon, ";"), | |
| 2392 | } | |
| 2393 | } | |
| 2394 | ||
| 2395 | fn addSemicolonIfNotBlock(c: *Context, node: Node) !void { | |
| 2396 | switch (node.tag()) { | |
| 2397 | .block, .empty_block, .block_single => {}, | |
| 2398 | else => _ = try c.addToken(.semicolon, ";"), | |
| 2399 | } | |
| 2400 | } | |
| 2401 | ||
| 2402 | fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { | |
| 2403 | switch (node.tag()) { | |
| 2404 | .declaration => unreachable, | |
| 2405 | .null_literal, | |
| 2406 | .undefined_literal, | |
| 2407 | .true_literal, | |
| 2408 | .false_literal, | |
| 2409 | .return_void, | |
| 2410 | .zero_literal, | |
| 2411 | .one_literal, | |
| 2412 | .void_type, | |
| 2413 | .noreturn_type, | |
| 2414 | .@"anytype", | |
| 2415 | .div_trunc, | |
| 2416 | .int_cast, | |
| 2417 | .const_cast, | |
| 2418 | .volatile_cast, | |
| 2419 | .as, | |
| 2420 | .truncate, | |
| 2421 | .bit_cast, | |
| 2422 | .float_cast, | |
| 2423 | .int_from_float, | |
| 2424 | .float_from_int, | |
| 2425 | .ptr_from_int, | |
| 2426 | .std_mem_zeroes, | |
| 2427 | .int_from_ptr, | |
| 2428 | .sizeof, | |
| 2429 | .alignof, | |
| 2430 | .typeof, | |
| 2431 | .typeinfo, | |
| 2432 | .vector, | |
| 2433 | .std_mem_zeroinit, | |
| 2434 | .integer_literal, | |
| 2435 | .float_literal, | |
| 2436 | .string_literal, | |
| 2437 | .string_slice, | |
| 2438 | .char_literal, | |
| 2439 | .enum_literal, | |
| 2440 | .identifier, | |
| 2441 | .field_access, | |
| 2442 | .ptr_cast, | |
| 2443 | .type, | |
| 2444 | .array_access, | |
| 2445 | .align_cast, | |
| 2446 | .optional_type, | |
| 2447 | .c_pointer, | |
| 2448 | .single_pointer, | |
| 2449 | .unwrap, | |
| 2450 | .deref, | |
| 2451 | .not, | |
| 2452 | .negate, | |
| 2453 | .negate_wrap, | |
| 2454 | .bit_not, | |
| 2455 | .func, | |
| 2456 | .call, | |
| 2457 | .array_type, | |
| 2458 | .null_sentinel_array_type, | |
| 2459 | .int_from_bool, | |
| 2460 | .div_exact, | |
| 2461 | .offset_of, | |
| 2462 | .shuffle, | |
| 2463 | .builtin_extern, | |
| 2464 | .wrapped_local, | |
| 2465 | .mut_str, | |
| 2466 | .helper_call, | |
| 2467 | .helper_ref, | |
| 2468 | .byte_swap, | |
| 2469 | .ceil, | |
| 2470 | .cos, | |
| 2471 | .sin, | |
| 2472 | .exp, | |
| 2473 | .exp2, | |
| 2474 | .exp10, | |
| 2475 | .abs, | |
| 2476 | .log, | |
| 2477 | .log2, | |
| 2478 | .log10, | |
| 2479 | .round, | |
| 2480 | .sqrt, | |
| 2481 | .trunc, | |
| 2482 | .floor, | |
| 2483 | => { | |
| 2484 | // no grouping needed | |
| 2485 | return renderNode(c, node); | |
| 2486 | }, | |
| 2487 | ||
| 2488 | .opaque_literal, | |
| 2489 | .@"opaque", | |
| 2490 | .empty_array, | |
| 2491 | .block_single, | |
| 2492 | .add, | |
| 2493 | .add_wrap, | |
| 2494 | .sub, | |
| 2495 | .sub_wrap, | |
| 2496 | .mul, | |
| 2497 | .mul_wrap, | |
| 2498 | .div, | |
| 2499 | .shl, | |
| 2500 | .shr, | |
| 2501 | .mod, | |
| 2502 | .@"and", | |
| 2503 | .@"or", | |
| 2504 | .less_than, | |
| 2505 | .less_than_equal, | |
| 2506 | .greater_than, | |
| 2507 | .greater_than_equal, | |
| 2508 | .equal, | |
| 2509 | .not_equal, | |
| 2510 | .bit_and, | |
| 2511 | .bit_or, | |
| 2512 | .bit_xor, | |
| 2513 | .empty_block, | |
| 2514 | .array_cat, | |
| 2515 | .array_filler, | |
| 2516 | .@"if", | |
| 2517 | .@"struct", | |
| 2518 | .@"union", | |
| 2519 | .array_init, | |
| 2520 | .vector_zero_init, | |
| 2521 | .tuple, | |
| 2522 | .container_init, | |
| 2523 | .container_init_dot, | |
| 2524 | .block, | |
| 2525 | .address_of, | |
| 2526 | => return c.addNode(.{ | |
| 2527 | .tag = .grouped_expression, | |
| 2528 | .main_token = try c.addToken(.l_paren, "("), | |
| 2529 | .data = .{ .node_and_token = .{ | |
| 2530 | try renderNode(c, node), | |
| 2531 | try c.addToken(.r_paren, ")"), | |
| 2532 | } }, | |
| 2533 | }), | |
| 2534 | .ellipsis3, | |
| 2535 | .switch_prong, | |
| 2536 | .warning, | |
| 2537 | .var_decl, | |
| 2538 | .fail_decl, | |
| 2539 | .arg_redecl, | |
| 2540 | .alias, | |
| 2541 | .var_simple, | |
| 2542 | .pub_var_simple, | |
| 2543 | .enum_constant, | |
| 2544 | .@"while", | |
| 2545 | .@"switch", | |
| 2546 | .@"break", | |
| 2547 | .break_val, | |
| 2548 | .pub_inline_fn, | |
| 2549 | .discard, | |
| 2550 | .@"continue", | |
| 2551 | .@"return", | |
| 2552 | .@"comptime", | |
| 2553 | .@"defer", | |
| 2554 | .asm_simple, | |
| 2555 | .while_true, | |
| 2556 | .if_not_break, | |
| 2557 | .switch_else, | |
| 2558 | .add_assign, | |
| 2559 | .add_wrap_assign, | |
| 2560 | .sub_assign, | |
| 2561 | .sub_wrap_assign, | |
| 2562 | .mul_assign, | |
| 2563 | .mul_wrap_assign, | |
| 2564 | .div_assign, | |
| 2565 | .shl_assign, | |
| 2566 | .shr_assign, | |
| 2567 | .mod_assign, | |
| 2568 | .bit_and_assign, | |
| 2569 | .bit_or_assign, | |
| 2570 | .bit_xor_assign, | |
| 2571 | .assign, | |
| 2572 | .static_assert, | |
| 2573 | .@"unreachable", | |
| 2574 | => { | |
| 2575 | // these should never appear in places where grouping might be needed. | |
| 2576 | unreachable; | |
| 2577 | }, | |
| 2578 | } | |
| 2579 | } | |
| 2580 | ||
| 2581 | fn renderPrefixOp(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: TokenTag, bytes: []const u8) !NodeIndex { | |
| 2582 | const payload = @as(*Payload.UnOp, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2583 | return c.addNode(.{ | |
| 2584 | .tag = tag, | |
| 2585 | .main_token = try c.addToken(tok_tag, bytes), | |
| 2586 | .data = .{ | |
| 2587 | .node = try renderNodeGrouped(c, payload), | |
| 2588 | }, | |
| 2589 | }); | |
| 2590 | } | |
| 2591 | ||
| 2592 | fn renderBinOpGrouped(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: TokenTag, bytes: []const u8) !NodeIndex { | |
| 2593 | const payload = @as(*Payload.BinOp, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2594 | const lhs = try renderNodeGrouped(c, payload.lhs); | |
| 2595 | return c.addNode(.{ | |
| 2596 | .tag = tag, | |
| 2597 | .main_token = try c.addToken(tok_tag, bytes), | |
| 2598 | .data = .{ .node_and_node = .{ | |
| 2599 | lhs, try renderNodeGrouped(c, payload.rhs), | |
| 2600 | } }, | |
| 2601 | }); | |
| 2602 | } | |
| 2603 | ||
| 2604 | fn renderBinOp(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: TokenTag, bytes: []const u8) !NodeIndex { | |
| 2605 | const payload = @as(*Payload.BinOp, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; | |
| 2606 | const lhs = try renderNode(c, payload.lhs); | |
| 2607 | return c.addNode(.{ | |
| 2608 | .tag = tag, | |
| 2609 | .main_token = try c.addToken(tok_tag, bytes), | |
| 2610 | .data = .{ .node_and_node = .{ | |
| 2611 | lhs, try renderNode(c, payload.rhs), | |
| 2612 | } }, | |
| 2613 | }); | |
| 2614 | } | |
| 2615 | ||
| 2616 | fn renderStdImport(c: *Context, parts: []const []const u8) !NodeIndex { | |
| 2617 | const import_tok = try c.addToken(.builtin, "@import"); | |
| 2618 | _ = try c.addToken(.l_paren, "("); | |
| 2619 | const std_tok = try c.addToken(.string_literal, "\"std\""); | |
| 2620 | const std_node = try c.addNode(.{ | |
| 2621 | .tag = .string_literal, | |
| 2622 | .main_token = std_tok, | |
| 2623 | .data = undefined, | |
| 2624 | }); | |
| 2625 | _ = try c.addToken(.r_paren, ")"); | |
| 2626 | ||
| 2627 | const import_node = try c.addNode(.{ | |
| 2628 | .tag = .builtin_call_two, | |
| 2629 | .main_token = import_tok, | |
| 2630 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2631 | std_node.toOptional(), .none, | |
| 2632 | } }, | |
| 2633 | }); | |
| 2634 | ||
| 2635 | var access_chain = import_node; | |
| 2636 | for (parts) |part| { | |
| 2637 | access_chain = try renderFieldAccess(c, access_chain, part); | |
| 2638 | } | |
| 2639 | return access_chain; | |
| 2640 | } | |
| 2641 | ||
| 2642 | fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex { | |
| 2643 | const lparen = try c.addToken(.l_paren, "("); | |
| 2644 | const res = switch (args.len) { | |
| 2645 | 0 => try c.addNode(.{ | |
| 2646 | .tag = .call_one, | |
| 2647 | .main_token = lparen, | |
| 2648 | .data = .{ .node_and_opt_node = .{ | |
| 2649 | lhs, .none, | |
| 2650 | } }, | |
| 2651 | }), | |
| 2652 | 1 => try c.addNode(.{ | |
| 2653 | .tag = .call_one, | |
| 2654 | .main_token = lparen, | |
| 2655 | .data = .{ .node_and_opt_node = .{ | |
| 2656 | lhs, (try renderNode(c, args[0])).toOptional(), | |
| 2657 | } }, | |
| 2658 | }), | |
| 2659 | else => blk: { | |
| 2660 | var rendered = try c.gpa.alloc(NodeIndex, args.len); | |
| 2661 | defer c.gpa.free(rendered); | |
| 2662 | ||
| 2663 | for (args, 0..) |arg, i| { | |
| 2664 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 2665 | rendered[i] = try renderNode(c, arg); | |
| 2666 | } | |
| 2667 | const span = try c.listToSpan(rendered); | |
| 2668 | break :blk try c.addNode(.{ | |
| 2669 | .tag = .call, | |
| 2670 | .main_token = lparen, | |
| 2671 | .data = .{ .node_and_extra = .{ | |
| 2672 | lhs, try c.addExtra(NodeSubRange{ | |
| 2673 | .start = span.start, | |
| 2674 | .end = span.end, | |
| 2675 | }), | |
| 2676 | } }, | |
| 2677 | }); | |
| 2678 | }, | |
| 2679 | }; | |
| 2680 | _ = try c.addToken(.r_paren, ")"); | |
| 2681 | return res; | |
| 2682 | } | |
| 2683 | ||
| 2684 | fn renderBuiltinCall(c: *Context, builtin: []const u8, args: []const Node) !NodeIndex { | |
| 2685 | const builtin_tok = try c.addToken(.builtin, builtin); | |
| 2686 | _ = try c.addToken(.l_paren, "("); | |
| 2687 | var arg_1: ?NodeIndex = null; | |
| 2688 | var arg_2: ?NodeIndex = null; | |
| 2689 | var arg_3: ?NodeIndex = null; | |
| 2690 | var arg_4: ?NodeIndex = null; | |
| 2691 | switch (args.len) { | |
| 2692 | 0 => {}, | |
| 2693 | 1 => { | |
| 2694 | arg_1 = try renderNode(c, args[0]); | |
| 2695 | }, | |
| 2696 | 2 => { | |
| 2697 | arg_1 = try renderNode(c, args[0]); | |
| 2698 | _ = try c.addToken(.comma, ","); | |
| 2699 | arg_2 = try renderNode(c, args[1]); | |
| 2700 | }, | |
| 2701 | 4 => { | |
| 2702 | arg_1 = try renderNode(c, args[0]); | |
| 2703 | _ = try c.addToken(.comma, ","); | |
| 2704 | arg_2 = try renderNode(c, args[1]); | |
| 2705 | _ = try c.addToken(.comma, ","); | |
| 2706 | arg_3 = try renderNode(c, args[2]); | |
| 2707 | _ = try c.addToken(.comma, ","); | |
| 2708 | arg_4 = try renderNode(c, args[3]); | |
| 2709 | }, | |
| 2710 | else => unreachable, // expand this function as needed. | |
| 2711 | } | |
| 2712 | ||
| 2713 | _ = try c.addToken(.r_paren, ")"); | |
| 2714 | if (args.len <= 2) { | |
| 2715 | return c.addNode(.{ | |
| 2716 | .tag = .builtin_call_two, | |
| 2717 | .main_token = builtin_tok, | |
| 2718 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2719 | .fromOptional(arg_1), .fromOptional(arg_2), | |
| 2720 | } }, | |
| 2721 | }); | |
| 2722 | } else { | |
| 2723 | std.debug.assert(args.len == 4); | |
| 2724 | ||
| 2725 | const params = try c.listToSpan(&.{ arg_1.?, arg_2.?, arg_3.?, arg_4.? }); | |
| 2726 | return c.addNode(.{ | |
| 2727 | .tag = .builtin_call, | |
| 2728 | .main_token = builtin_tok, | |
| 2729 | .data = .{ .extra_range = .{ | |
| 2730 | .start = params.start, | |
| 2731 | .end = params.end, | |
| 2732 | } }, | |
| 2733 | }); | |
| 2734 | } | |
| 2735 | } | |
| 2736 | ||
| 2737 | fn renderVar(c: *Context, node: Node) !NodeIndex { | |
| 2738 | const payload = node.castTag(.var_decl).?.data; | |
| 2739 | if (payload.is_pub) _ = try c.addToken(.keyword_pub, "pub"); | |
| 2740 | if (payload.is_extern) _ = try c.addToken(.keyword_extern, "extern"); | |
| 2741 | if (payload.is_export) _ = try c.addToken(.keyword_export, "export"); | |
| 2742 | if (payload.is_threadlocal) _ = try c.addToken(.keyword_threadlocal, "threadlocal"); | |
| 2743 | const mut_tok = if (payload.is_const) | |
| 2744 | try c.addToken(.keyword_const, "const") | |
| 2745 | else | |
| 2746 | try c.addToken(.keyword_var, "var"); | |
| 2747 | _ = try c.addIdentifier(payload.name); | |
| 2748 | _ = try c.addToken(.colon, ":"); | |
| 2749 | const type_node = try renderNode(c, payload.type); | |
| 2750 | ||
| 2751 | const align_node_opt = if (payload.alignment) |some| blk: { | |
| 2752 | _ = try c.addToken(.keyword_align, "align"); | |
| 2753 | _ = try c.addToken(.l_paren, "("); | |
| 2754 | const res = try c.addNode(.{ | |
| 2755 | .tag = .number_literal, | |
| 2756 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{some}), | |
| 2757 | .data = undefined, | |
| 2758 | }); | |
| 2759 | _ = try c.addToken(.r_paren, ")"); | |
| 2760 | break :blk res; | |
| 2761 | } else null; | |
| 2762 | ||
| 2763 | const section_node_opt = if (payload.linksection_string) |some| blk: { | |
| 2764 | _ = try c.addToken(.keyword_linksection, "linksection"); | |
| 2765 | _ = try c.addToken(.l_paren, "("); | |
| 2766 | const res = try c.addNode(.{ | |
| 2767 | .tag = .string_literal, | |
| 2768 | .main_token = try c.addTokenFmt(.string_literal, "\"{f}\"", .{std.zig.fmtString(some)}), | |
| 2769 | .data = undefined, | |
| 2770 | }); | |
| 2771 | _ = try c.addToken(.r_paren, ")"); | |
| 2772 | break :blk res; | |
| 2773 | } else null; | |
| 2774 | ||
| 2775 | const init_node_opt = if (payload.init) |some| blk: { | |
| 2776 | _ = try c.addToken(.equal, "="); | |
| 2777 | break :blk try renderNode(c, some); | |
| 2778 | } else null; | |
| 2779 | _ = try c.addToken(.semicolon, ";"); | |
| 2780 | ||
| 2781 | if (section_node_opt) |section_node| { | |
| 2782 | return c.addNode(.{ | |
| 2783 | .tag = .global_var_decl, | |
| 2784 | .main_token = mut_tok, | |
| 2785 | .data = .{ .extra_and_opt_node = .{ | |
| 2786 | try c.addExtra(std.zig.Ast.Node.GlobalVarDecl{ | |
| 2787 | .type_node = type_node.toOptional(), | |
| 2788 | .align_node = .fromOptional(align_node_opt), | |
| 2789 | .section_node = section_node.toOptional(), | |
| 2790 | .addrspace_node = .none, | |
| 2791 | }), | |
| 2792 | .fromOptional(init_node_opt), | |
| 2793 | } }, | |
| 2794 | }); | |
| 2795 | } else { | |
| 2796 | if (align_node_opt) |align_node| { | |
| 2797 | return c.addNode(.{ | |
| 2798 | .tag = .local_var_decl, | |
| 2799 | .main_token = mut_tok, | |
| 2800 | .data = .{ .extra_and_opt_node = .{ | |
| 2801 | try c.addExtra(std.zig.Ast.Node.LocalVarDecl{ | |
| 2802 | .type_node = type_node, | |
| 2803 | .align_node = align_node, | |
| 2804 | }), | |
| 2805 | .fromOptional(init_node_opt), | |
| 2806 | } }, | |
| 2807 | }); | |
| 2808 | } else { | |
| 2809 | return c.addNode(.{ | |
| 2810 | .tag = .simple_var_decl, | |
| 2811 | .main_token = mut_tok, | |
| 2812 | .data = .{ | |
| 2813 | .opt_node_and_opt_node = .{ | |
| 2814 | type_node.toOptional(), // Type expression | |
| 2815 | .fromOptional(init_node_opt), // Init expression | |
| 2816 | }, | |
| 2817 | }, | |
| 2818 | }); | |
| 2819 | } | |
| 2820 | } | |
| 2821 | } | |
| 2822 | ||
| 2823 | fn renderFunc(c: *Context, node: Node) !NodeIndex { | |
| 2824 | const payload = node.castTag(.func).?.data; | |
| 2825 | if (payload.is_pub) _ = try c.addToken(.keyword_pub, "pub"); | |
| 2826 | if (payload.is_extern) _ = try c.addToken(.keyword_extern, "extern"); | |
| 2827 | if (payload.is_export) _ = try c.addToken(.keyword_export, "export"); | |
| 2828 | if (payload.is_inline) _ = try c.addToken(.keyword_inline, "inline"); | |
| 2829 | const fn_token = try c.addToken(.keyword_fn, "fn"); | |
| 2830 | if (payload.name) |some| _ = try c.addIdentifier(some); | |
| 2831 | ||
| 2832 | var params = try renderParams(c, payload.params, payload.is_var_args); | |
| 2833 | defer params.deinit(c.gpa); | |
| 2834 | var span: NodeSubRange = undefined; | |
| 2835 | if (params.items.len > 1) span = try c.listToSpan(params.items); | |
| 2836 | ||
| 2837 | const align_expr_opt = if (payload.alignment) |some| blk: { | |
| 2838 | _ = try c.addToken(.keyword_align, "align"); | |
| 2839 | _ = try c.addToken(.l_paren, "("); | |
| 2840 | const res = try c.addNode(.{ | |
| 2841 | .tag = .number_literal, | |
| 2842 | .main_token = try c.addTokenFmt(.number_literal, "{d}", .{some}), | |
| 2843 | .data = undefined, | |
| 2844 | }); | |
| 2845 | _ = try c.addToken(.r_paren, ")"); | |
| 2846 | break :blk res; | |
| 2847 | } else null; | |
| 2848 | ||
| 2849 | const section_expr_opt = if (payload.linksection_string) |some| blk: { | |
| 2850 | _ = try c.addToken(.keyword_linksection, "linksection"); | |
| 2851 | _ = try c.addToken(.l_paren, "("); | |
| 2852 | const res = try c.addNode(.{ | |
| 2853 | .tag = .string_literal, | |
| 2854 | .main_token = try c.addTokenFmt(.string_literal, "\"{f}\"", .{std.zig.fmtString(some)}), | |
| 2855 | .data = undefined, | |
| 2856 | }); | |
| 2857 | _ = try c.addToken(.r_paren, ")"); | |
| 2858 | break :blk res; | |
| 2859 | } else null; | |
| 2860 | ||
| 2861 | const callconv_expr_opt = if (payload.explicit_callconv) |some| blk: { | |
| 2862 | _ = try c.addToken(.keyword_callconv, "callconv"); | |
| 2863 | _ = try c.addToken(.l_paren, "("); | |
| 2864 | const cc_node = switch (some) { | |
| 2865 | .c => cc_node: { | |
| 2866 | _ = try c.addToken(.period, "."); | |
| 2867 | break :cc_node try c.addNode(.{ | |
| 2868 | .tag = .enum_literal, | |
| 2869 | .main_token = try c.addToken(.identifier, "c"), | |
| 2870 | .data = undefined, | |
| 2871 | }); | |
| 2872 | }, | |
| 2873 | .x86_64_sysv, | |
| 2874 | .x86_64_win, | |
| 2875 | .x86_stdcall, | |
| 2876 | .x86_fastcall, | |
| 2877 | .x86_thiscall, | |
| 2878 | .x86_vectorcall, | |
| 2879 | .x86_regcall, | |
| 2880 | .aarch64_vfabi, | |
| 2881 | .aarch64_sve_pcs, | |
| 2882 | .arm_aapcs, | |
| 2883 | .arm_aapcs_vfp, | |
| 2884 | .m68k_rtd, | |
| 2885 | .riscv_vector, | |
| 2886 | => cc_node: { | |
| 2887 | // .{ .foo = .{} } | |
| 2888 | _ = try c.addToken(.period, "."); | |
| 2889 | const outer_lbrace = try c.addToken(.l_brace, "{"); | |
| 2890 | _ = try c.addToken(.period, "."); | |
| 2891 | _ = try c.addToken(.identifier, @tagName(some)); | |
| 2892 | _ = try c.addToken(.equal, "="); | |
| 2893 | _ = try c.addToken(.period, "."); | |
| 2894 | const inner_lbrace = try c.addToken(.l_brace, "{"); | |
| 2895 | _ = try c.addToken(.r_brace, "}"); | |
| 2896 | _ = try c.addToken(.r_brace, "}"); | |
| 2897 | break :cc_node try c.addNode(.{ | |
| 2898 | .tag = .struct_init_dot_two, | |
| 2899 | .main_token = outer_lbrace, | |
| 2900 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2901 | (try c.addNode(.{ | |
| 2902 | .tag = .struct_init_dot_two, | |
| 2903 | .main_token = inner_lbrace, | |
| 2904 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2905 | .none, .none, | |
| 2906 | } }, | |
| 2907 | })).toOptional(), | |
| 2908 | .none, | |
| 2909 | } }, | |
| 2910 | }); | |
| 2911 | }, | |
| 2912 | }; | |
| 2913 | _ = try c.addToken(.r_paren, ")"); | |
| 2914 | break :blk cc_node; | |
| 2915 | } else null; | |
| 2916 | ||
| 2917 | const return_type_expr = try renderNode(c, payload.return_type); | |
| 2918 | ||
| 2919 | const fn_proto = try blk: { | |
| 2920 | if (align_expr_opt == null and section_expr_opt == null and callconv_expr_opt == null) { | |
| 2921 | if (params.items.len < 2) | |
| 2922 | break :blk c.addNode(.{ | |
| 2923 | .tag = .fn_proto_simple, | |
| 2924 | .main_token = fn_token, | |
| 2925 | .data = .{ .opt_node_and_opt_node = .{ | |
| 2926 | if (params.items.len == 1) params.items[0].toOptional() else .none, | |
| 2927 | return_type_expr.toOptional(), | |
| 2928 | } }, | |
| 2929 | }) | |
| 2930 | else | |
| 2931 | break :blk c.addNode(.{ | |
| 2932 | .tag = .fn_proto_multi, | |
| 2933 | .main_token = fn_token, | |
| 2934 | .data = .{ .extra_and_opt_node = .{ | |
| 2935 | try c.addExtra(span), | |
| 2936 | return_type_expr.toOptional(), | |
| 2937 | } }, | |
| 2938 | }); | |
| 2939 | } | |
| 2940 | if (params.items.len < 2) | |
| 2941 | break :blk c.addNode(.{ | |
| 2942 | .tag = .fn_proto_one, | |
| 2943 | .main_token = fn_token, | |
| 2944 | .data = .{ | |
| 2945 | .extra_and_opt_node = .{ | |
| 2946 | try c.addExtra(std.zig.Ast.Node.FnProtoOne{ | |
| 2947 | .param = if (params.items.len == 1) params.items[0].toOptional() else .none, | |
| 2948 | .align_expr = .fromOptional(align_expr_opt), | |
| 2949 | .addrspace_expr = .none, // TODO | |
| 2950 | .section_expr = .fromOptional(section_expr_opt), | |
| 2951 | .callconv_expr = .fromOptional(callconv_expr_opt), | |
| 2952 | }), | |
| 2953 | return_type_expr.toOptional(), | |
| 2954 | }, | |
| 2955 | }, | |
| 2956 | }) | |
| 2957 | else | |
| 2958 | break :blk c.addNode(.{ | |
| 2959 | .tag = .fn_proto, | |
| 2960 | .main_token = fn_token, | |
| 2961 | .data = .{ | |
| 2962 | .extra_and_opt_node = .{ | |
| 2963 | try c.addExtra(std.zig.Ast.Node.FnProto{ | |
| 2964 | .params_start = span.start, | |
| 2965 | .params_end = span.end, | |
| 2966 | .align_expr = .fromOptional(align_expr_opt), | |
| 2967 | .addrspace_expr = .none, // TODO | |
| 2968 | .section_expr = .fromOptional(section_expr_opt), | |
| 2969 | .callconv_expr = .fromOptional(callconv_expr_opt), | |
| 2970 | }), | |
| 2971 | return_type_expr.toOptional(), | |
| 2972 | }, | |
| 2973 | }, | |
| 2974 | }); | |
| 2975 | }; | |
| 2976 | ||
| 2977 | const payload_body = payload.body orelse { | |
| 2978 | if (payload.is_extern) { | |
| 2979 | _ = try c.addToken(.semicolon, ";"); | |
| 2980 | } | |
| 2981 | return fn_proto; | |
| 2982 | }; | |
| 2983 | const body = try renderNode(c, payload_body); | |
| 2984 | return c.addNode(.{ | |
| 2985 | .tag = .fn_decl, | |
| 2986 | .main_token = fn_token, | |
| 2987 | .data = .{ .node_and_node = .{ | |
| 2988 | fn_proto, body, | |
| 2989 | } }, | |
| 2990 | }); | |
| 2991 | } | |
| 2992 | ||
| 2993 | fn renderMacroFunc(c: *Context, node: Node) !NodeIndex { | |
| 2994 | const payload = node.castTag(.pub_inline_fn).?.data; | |
| 2995 | _ = try c.addToken(.keyword_pub, "pub"); | |
| 2996 | _ = try c.addToken(.keyword_inline, "inline"); | |
| 2997 | const fn_token = try c.addToken(.keyword_fn, "fn"); | |
| 2998 | _ = try c.addIdentifier(payload.name); | |
| 2999 | ||
| 3000 | var params = try renderParams(c, payload.params, false); | |
| 3001 | defer params.deinit(c.gpa); | |
| 3002 | var span: NodeSubRange = undefined; | |
| 3003 | if (params.items.len > 1) span = try c.listToSpan(params.items); | |
| 3004 | ||
| 3005 | const return_type_expr = try renderNodeGrouped(c, payload.return_type); | |
| 3006 | ||
| 3007 | const fn_proto = blk: { | |
| 3008 | if (params.items.len < 2) { | |
| 3009 | break :blk try c.addNode(.{ | |
| 3010 | .tag = .fn_proto_simple, | |
| 3011 | .main_token = fn_token, | |
| 3012 | .data = .{ .opt_node_and_opt_node = .{ | |
| 3013 | if (params.items.len == 1) params.items[0].toOptional() else .none, | |
| 3014 | return_type_expr.toOptional(), | |
| 3015 | } }, | |
| 3016 | }); | |
| 3017 | } else { | |
| 3018 | break :blk try c.addNode(.{ | |
| 3019 | .tag = .fn_proto_multi, | |
| 3020 | .main_token = fn_token, | |
| 3021 | .data = .{ .extra_and_opt_node = .{ | |
| 3022 | try c.addExtra(span), | |
| 3023 | return_type_expr.toOptional(), | |
| 3024 | } }, | |
| 3025 | }); | |
| 3026 | } | |
| 3027 | }; | |
| 3028 | return c.addNode(.{ | |
| 3029 | .tag = .fn_decl, | |
| 3030 | .main_token = fn_token, | |
| 3031 | .data = .{ .node_and_node = .{ | |
| 3032 | fn_proto, try renderNode(c, payload.body), | |
| 3033 | } }, | |
| 3034 | }); | |
| 3035 | } | |
| 3036 | ||
| 3037 | fn renderParams(c: *Context, params: []Payload.Param, is_var_args: bool) !std.ArrayList(NodeIndex) { | |
| 3038 | _ = try c.addToken(.l_paren, "("); | |
| 3039 | var rendered: std.ArrayList(NodeIndex) = .empty; | |
| 3040 | errdefer rendered.deinit(c.gpa); | |
| 3041 | try rendered.ensureUnusedCapacity(c.gpa, @max(params.len, 1)); | |
| 3042 | ||
| 3043 | for (params, 0..) |param, i| { | |
| 3044 | if (i != 0) _ = try c.addToken(.comma, ","); | |
| 3045 | if (param.is_noalias) _ = try c.addToken(.keyword_noalias, "noalias"); | |
| 3046 | if (param.name) |some| { | |
| 3047 | _ = try c.addIdentifier(some); | |
| 3048 | _ = try c.addToken(.colon, ":"); | |
| 3049 | } | |
| 3050 | if (param.type.tag() == .@"anytype") { | |
| 3051 | _ = try c.addToken(.keyword_anytype, "anytype"); | |
| 3052 | continue; | |
| 3053 | } | |
| 3054 | rendered.appendAssumeCapacity(try renderNode(c, param.type)); | |
| 3055 | } | |
| 3056 | if (is_var_args) { | |
| 3057 | if (params.len != 0) _ = try c.addToken(.comma, ","); | |
| 3058 | _ = try c.addToken(.ellipsis3, "..."); | |
| 3059 | } | |
| 3060 | _ = try c.addToken(.r_paren, ")"); | |
| 3061 | ||
| 3062 | return rendered; | |
| 3063 | } |
lib/compiler/translate-c/builtins.zig created+76| ... | ... | @@ -0,0 +1,76 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | const ast = @import("ast.zig"); | |
| 4 | ||
| 5 | /// All builtins need to have a source so that macros can reference them | |
| 6 | /// but for some it is possible to directly call an equivalent Zig builtin | |
| 7 | /// which is preferrable. | |
| 8 | pub const Builtin = struct { | |
| 9 | /// The name of the builtin in `c_builtins.zig`. | |
| 10 | name: []const u8, | |
| 11 | tag: ?ast.Node.Tag = null, | |
| 12 | }; | |
| 13 | ||
| 14 | pub const map = std.StaticStringMap(Builtin).initComptime([_]struct { []const u8, Builtin }{ | |
| 15 | .{ "__builtin_abs", .{ .name = "abs" } }, | |
| 16 | .{ "__builtin_assume", .{ .name = "assume" } }, | |
| 17 | .{ "__builtin_bswap16", .{ .name = "bswap16", .tag = .byte_swap } }, | |
| 18 | .{ "__builtin_bswap32", .{ .name = "bswap32", .tag = .byte_swap } }, | |
| 19 | .{ "__builtin_bswap64", .{ .name = "bswap64", .tag = .byte_swap } }, | |
| 20 | .{ "__builtin_ceilf", .{ .name = "ceilf", .tag = .ceil } }, | |
| 21 | .{ "__builtin_ceil", .{ .name = "ceil", .tag = .ceil } }, | |
| 22 | .{ "__builtin_clz", .{ .name = "clz" } }, | |
| 23 | .{ "__builtin_constant_p", .{ .name = "constant_p" } }, | |
| 24 | .{ "__builtin_cosf", .{ .name = "cosf", .tag = .cos } }, | |
| 25 | .{ "__builtin_cos", .{ .name = "cos", .tag = .cos } }, | |
| 26 | .{ "__builtin_ctz", .{ .name = "ctz" } }, | |
| 27 | .{ "__builtin_exp2f", .{ .name = "exp2f", .tag = .exp2 } }, | |
| 28 | .{ "__builtin_exp2", .{ .name = "exp2", .tag = .exp2 } }, | |
| 29 | .{ "__builtin_expf", .{ .name = "expf", .tag = .exp } }, | |
| 30 | .{ "__builtin_exp", .{ .name = "exp", .tag = .exp } }, | |
| 31 | .{ "__builtin_expect", .{ .name = "expect" } }, | |
| 32 | .{ "__builtin_fabsf", .{ .name = "fabsf", .tag = .abs } }, | |
| 33 | .{ "__builtin_fabs", .{ .name = "fabs", .tag = .abs } }, | |
| 34 | .{ "__builtin_floorf", .{ .name = "floorf", .tag = .floor } }, | |
| 35 | .{ "__builtin_floor", .{ .name = "floor", .tag = .floor } }, | |
| 36 | .{ "__builtin_huge_valf", .{ .name = "huge_valf" } }, | |
| 37 | .{ "__builtin_inff", .{ .name = "inff" } }, | |
| 38 | .{ "__builtin_isinf_sign", .{ .name = "isinf_sign" } }, | |
| 39 | .{ "__builtin_isinf", .{ .name = "isinf" } }, | |
| 40 | .{ "__builtin_isnan", .{ .name = "isnan" } }, | |
| 41 | .{ "__builtin_labs", .{ .name = "labs" } }, | |
| 42 | .{ "__builtin_llabs", .{ .name = "llabs" } }, | |
| 43 | .{ "__builtin_log10f", .{ .name = "log10f", .tag = .log10 } }, | |
| 44 | .{ "__builtin_log10", .{ .name = "log10", .tag = .log10 } }, | |
| 45 | .{ "__builtin_log2f", .{ .name = "log2f", .tag = .log2 } }, | |
| 46 | .{ "__builtin_log2", .{ .name = "log2", .tag = .log2 } }, | |
| 47 | .{ "__builtin_logf", .{ .name = "logf", .tag = .log } }, | |
| 48 | .{ "__builtin_log", .{ .name = "log", .tag = .log } }, | |
| 49 | .{ "__builtin___memcpy_chk", .{ .name = "memcpy_chk" } }, | |
| 50 | .{ "__builtin_memcpy", .{ .name = "memcpy" } }, | |
| 51 | .{ "__builtin___memset_chk", .{ .name = "memset_chk" } }, | |
| 52 | .{ "__builtin_memset", .{ .name = "memset" } }, | |
| 53 | .{ "__builtin_mul_overflow", .{ .name = "mul_overflow" } }, | |
| 54 | .{ "__builtin_nanf", .{ .name = "nanf" } }, | |
| 55 | .{ "__builtin_object_size", .{ .name = "object_size" } }, | |
| 56 | .{ "__builtin_popcount", .{ .name = "popcount" } }, | |
| 57 | .{ "__builtin_roundf", .{ .name = "roundf", .tag = .round } }, | |
| 58 | .{ "__builtin_round", .{ .name = "round", .tag = .round } }, | |
| 59 | .{ "__builtin_signbitf", .{ .name = "signbitf" } }, | |
| 60 | .{ "__builtin_signbit", .{ .name = "signbit" } }, | |
| 61 | .{ "__builtin_sinf", .{ .name = "sinf", .tag = .sin } }, | |
| 62 | .{ "__builtin_sin", .{ .name = "sin", .tag = .sin } }, | |
| 63 | .{ "__builtin_sqrtf", .{ .name = "sqrtf", .tag = .sqrt } }, | |
| 64 | .{ "__builtin_sqrt", .{ .name = "sqrt", .tag = .sqrt } }, | |
| 65 | .{ "__builtin_strcmp", .{ .name = "strcmp" } }, | |
| 66 | .{ "__builtin_strlen", .{ .name = "strlen" } }, | |
| 67 | .{ "__builtin_truncf", .{ .name = "truncf", .tag = .trunc } }, | |
| 68 | .{ "__builtin_trunc", .{ .name = "trunc", .tag = .trunc } }, | |
| 69 | .{ "__builtin_unreachable", .{ .name = "unreachable", .tag = .@"unreachable" } }, | |
| 70 | .{ "__has_builtin", .{ .name = "has_builtin" } }, | |
| 71 | ||
| 72 | // __builtin_alloca_with_align is not currently implemented. | |
| 73 | // It is used in a run and a translate test to ensure that non-implemented | |
| 74 | // builtins are correctly demoted. If you implement __builtin_alloca_with_align, | |
| 75 | // please update the tests to use a different non-implemented builtin. | |
| 76 | }); |
lib/compiler/translate-c/helpers.zig created+327| ... | ... | @@ -0,0 +1,327 @@ |
| 1 | const std = @import("std"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | const testing = std.testing; | |
| 4 | const math = std.math; | |
| 5 | ||
| 6 | const helpers = @import("helpers"); | |
| 7 | ||
| 8 | const cast = helpers.cast; | |
| 9 | ||
| 10 | test cast { | |
| 11 | var i = @as(i64, 10); | |
| 12 | ||
| 13 | try testing.expect(cast(*u8, 16) == @as(*u8, @ptrFromInt(16))); | |
| 14 | try testing.expect(cast(*u64, &i).* == @as(u64, 10)); | |
| 15 | try testing.expect(cast(*i64, @as(?*align(1) i64, &i)) == &i); | |
| 16 | ||
| 17 | try testing.expect(cast(?*u8, 2) == @as(*u8, @ptrFromInt(2))); | |
| 18 | try testing.expect(cast(?*i64, @as(*align(1) i64, &i)) == &i); | |
| 19 | try testing.expect(cast(?*i64, @as(?*align(1) i64, &i)) == &i); | |
| 20 | ||
| 21 | try testing.expectEqual(@as(u32, 4), cast(u32, @as(*u32, @ptrFromInt(4)))); | |
| 22 | try testing.expectEqual(@as(u32, 4), cast(u32, @as(?*u32, @ptrFromInt(4)))); | |
| 23 | try testing.expectEqual(@as(u32, 10), cast(u32, @as(u64, 10))); | |
| 24 | ||
| 25 | try testing.expectEqual(@as(i32, @bitCast(@as(u32, 0x8000_0000))), cast(i32, @as(u32, 0x8000_0000))); | |
| 26 | ||
| 27 | try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*const u8, @ptrFromInt(2)))); | |
| 28 | try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*volatile u8, @ptrFromInt(2)))); | |
| 29 | ||
| 30 | try testing.expectEqual(@as(?*anyopaque, @ptrFromInt(2)), cast(?*anyopaque, @as(*u8, @ptrFromInt(2)))); | |
| 31 | ||
| 32 | var foo: c_int = -1; | |
| 33 | _ = &foo; | |
| 34 | try testing.expect(cast(*anyopaque, -1) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 35 | try testing.expect(cast(*anyopaque, foo) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 36 | try testing.expect(cast(?*anyopaque, -1) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 37 | try testing.expect(cast(?*anyopaque, foo) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 38 | ||
| 39 | const FnPtr = ?*align(1) const fn (*anyopaque) void; | |
| 40 | try testing.expect(cast(FnPtr, 0) == @as(FnPtr, @ptrFromInt(@as(usize, 0)))); | |
| 41 | try testing.expect(cast(FnPtr, foo) == @as(FnPtr, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 42 | ||
| 43 | const complexFunction = struct { | |
| 44 | fn f(_: ?*anyopaque, _: c_uint, _: ?*const fn (?*anyopaque) callconv(.c) c_uint, _: ?*anyopaque, _: c_uint, _: [*c]c_uint) callconv(.c) usize { | |
| 45 | return 0; | |
| 46 | } | |
| 47 | }.f; | |
| 48 | ||
| 49 | const SDL_FunctionPointer = ?*const fn () callconv(.c) void; | |
| 50 | const fn_ptr = cast(SDL_FunctionPointer, complexFunction); | |
| 51 | try testing.expect(fn_ptr != null); | |
| 52 | } | |
| 53 | ||
| 54 | const sizeof = helpers.sizeof; | |
| 55 | ||
| 56 | test sizeof { | |
| 57 | const S = extern struct { a: u32 }; | |
| 58 | ||
| 59 | const ptr_size = @sizeOf(*anyopaque); | |
| 60 | ||
| 61 | try testing.expect(sizeof(u32) == 4); | |
| 62 | try testing.expect(sizeof(@as(u32, 2)) == 4); | |
| 63 | try testing.expect(sizeof(2) == @sizeOf(c_int)); | |
| 64 | ||
| 65 | try testing.expect(sizeof(2.0) == @sizeOf(f64)); | |
| 66 | ||
| 67 | try testing.expect(sizeof(S) == 4); | |
| 68 | ||
| 69 | try testing.expect(sizeof([_]u32{ 4, 5, 6 }) == 12); | |
| 70 | try testing.expect(sizeof([3]u32) == 12); | |
| 71 | try testing.expect(sizeof([3:0]u32) == 16); | |
| 72 | try testing.expect(sizeof(&[_]u32{ 4, 5, 6 }) == ptr_size); | |
| 73 | ||
| 74 | try testing.expect(sizeof(*u32) == ptr_size); | |
| 75 | try testing.expect(sizeof([*]u32) == ptr_size); | |
| 76 | try testing.expect(sizeof([*c]u32) == ptr_size); | |
| 77 | try testing.expect(sizeof(?*u32) == ptr_size); | |
| 78 | try testing.expect(sizeof(?[*]u32) == ptr_size); | |
| 79 | try testing.expect(sizeof(*anyopaque) == ptr_size); | |
| 80 | try testing.expect(sizeof(*void) == ptr_size); | |
| 81 | try testing.expect(sizeof(null) == ptr_size); | |
| 82 | ||
| 83 | try testing.expect(sizeof("foobar") == 7); | |
| 84 | try testing.expect(sizeof(&[_:0]u16{ 'f', 'o', 'o', 'b', 'a', 'r' }) == 14); | |
| 85 | try testing.expect(sizeof(*const [4:0]u8) == 5); | |
| 86 | try testing.expect(sizeof(*[4:0]u8) == ptr_size); | |
| 87 | try testing.expect(sizeof([*]const [4:0]u8) == ptr_size); | |
| 88 | try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size); | |
| 89 | try testing.expect(sizeof(*const [4]u8) == ptr_size); | |
| 90 | ||
| 91 | if (false) { // TODO | |
| 92 | try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof))); | |
| 93 | try testing.expect(sizeof(sizeof) == 1); | |
| 94 | } | |
| 95 | ||
| 96 | try testing.expect(sizeof(void) == 1); | |
| 97 | try testing.expect(sizeof(anyopaque) == 1); | |
| 98 | } | |
| 99 | ||
| 100 | const promoteIntLiteral = helpers.promoteIntLiteral; | |
| 101 | ||
| 102 | test promoteIntLiteral { | |
| 103 | const signed_hex = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .hex); | |
| 104 | try testing.expectEqual(c_uint, @TypeOf(signed_hex)); | |
| 105 | ||
| 106 | if (math.maxInt(c_longlong) == math.maxInt(c_int)) return; | |
| 107 | ||
| 108 | const signed_decimal = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .decimal); | |
| 109 | const unsigned = promoteIntLiteral(c_uint, math.maxInt(c_uint) + 1, .hex); | |
| 110 | ||
| 111 | if (math.maxInt(c_long) > math.maxInt(c_int)) { | |
| 112 | try testing.expectEqual(c_long, @TypeOf(signed_decimal)); | |
| 113 | try testing.expectEqual(c_ulong, @TypeOf(unsigned)); | |
| 114 | } else { | |
| 115 | try testing.expectEqual(c_longlong, @TypeOf(signed_decimal)); | |
| 116 | try testing.expectEqual(c_ulonglong, @TypeOf(unsigned)); | |
| 117 | } | |
| 118 | } | |
| 119 | ||
| 120 | const shuffleVectorIndex = helpers.shuffleVectorIndex; | |
| 121 | ||
| 122 | test shuffleVectorIndex { | |
| 123 | const vector_len: usize = 4; | |
| 124 | ||
| 125 | _ = shuffleVectorIndex(-1, vector_len); | |
| 126 | ||
| 127 | try testing.expect(shuffleVectorIndex(0, vector_len) == 0); | |
| 128 | try testing.expect(shuffleVectorIndex(1, vector_len) == 1); | |
| 129 | try testing.expect(shuffleVectorIndex(2, vector_len) == 2); | |
| 130 | try testing.expect(shuffleVectorIndex(3, vector_len) == 3); | |
| 131 | ||
| 132 | try testing.expect(shuffleVectorIndex(4, vector_len) == -1); | |
| 133 | try testing.expect(shuffleVectorIndex(5, vector_len) == -2); | |
| 134 | try testing.expect(shuffleVectorIndex(6, vector_len) == -3); | |
| 135 | try testing.expect(shuffleVectorIndex(7, vector_len) == -4); | |
| 136 | } | |
| 137 | ||
| 138 | const FlexibleArrayType = helpers.FlexibleArrayType; | |
| 139 | ||
| 140 | test FlexibleArrayType { | |
| 141 | const Container = extern struct { | |
| 142 | size: usize, | |
| 143 | }; | |
| 144 | ||
| 145 | try testing.expectEqual(FlexibleArrayType(*Container, c_int), [*c]c_int); | |
| 146 | try testing.expectEqual(FlexibleArrayType(*const Container, c_int), [*c]const c_int); | |
| 147 | try testing.expectEqual(FlexibleArrayType(*volatile Container, c_int), [*c]volatile c_int); | |
| 148 | try testing.expectEqual(FlexibleArrayType(*const volatile Container, c_int), [*c]const volatile c_int); | |
| 149 | } | |
| 150 | ||
| 151 | const signedRemainder = helpers.signedRemainder; | |
| 152 | ||
| 153 | test signedRemainder { | |
| 154 | // TODO add test | |
| 155 | return error.SkipZigTest; | |
| 156 | } | |
| 157 | ||
| 158 | const ArithmeticConversion = helpers.ArithmeticConversion; | |
| 159 | ||
| 160 | test ArithmeticConversion { | |
| 161 | // Promotions not necessarily the same for other platforms | |
| 162 | if (builtin.target.cpu.arch != .x86_64 or builtin.target.os.tag != .linux) return error.SkipZigTest; | |
| 163 | ||
| 164 | const Test = struct { | |
| 165 | /// Order of operands should not matter for arithmetic conversions | |
| 166 | fn checkPromotion(comptime A: type, comptime B: type, comptime Expected: type) !void { | |
| 167 | try std.testing.expect(ArithmeticConversion(A, B) == Expected); | |
| 168 | try std.testing.expect(ArithmeticConversion(B, A) == Expected); | |
| 169 | } | |
| 170 | }; | |
| 171 | ||
| 172 | try Test.checkPromotion(c_longdouble, c_int, c_longdouble); | |
| 173 | try Test.checkPromotion(c_int, f64, f64); | |
| 174 | try Test.checkPromotion(f32, bool, f32); | |
| 175 | ||
| 176 | try Test.checkPromotion(bool, c_short, c_int); | |
| 177 | try Test.checkPromotion(c_int, c_int, c_int); | |
| 178 | try Test.checkPromotion(c_short, c_int, c_int); | |
| 179 | ||
| 180 | try Test.checkPromotion(c_int, c_long, c_long); | |
| 181 | ||
| 182 | try Test.checkPromotion(c_ulonglong, c_uint, c_ulonglong); | |
| 183 | ||
| 184 | try Test.checkPromotion(c_uint, c_int, c_uint); | |
| 185 | ||
| 186 | try Test.checkPromotion(c_uint, c_long, c_long); | |
| 187 | ||
| 188 | try Test.checkPromotion(c_ulong, c_longlong, c_ulonglong); | |
| 189 | ||
| 190 | // stdint.h | |
| 191 | try Test.checkPromotion(u8, i8, c_int); | |
| 192 | try Test.checkPromotion(u16, i16, c_int); | |
| 193 | try Test.checkPromotion(i32, c_int, c_int); | |
| 194 | try Test.checkPromotion(u32, c_int, c_uint); | |
| 195 | try Test.checkPromotion(i64, c_int, c_long); | |
| 196 | try Test.checkPromotion(u64, c_int, c_ulong); | |
| 197 | try Test.checkPromotion(isize, c_int, c_long); | |
| 198 | try Test.checkPromotion(usize, c_int, c_ulong); | |
| 199 | } | |
| 200 | ||
| 201 | const F_SUFFIX = helpers.F_SUFFIX; | |
| 202 | ||
| 203 | test F_SUFFIX { | |
| 204 | try testing.expect(@TypeOf(F_SUFFIX(1)) == f32); | |
| 205 | } | |
| 206 | ||
| 207 | const U_SUFFIX = helpers.U_SUFFIX; | |
| 208 | ||
| 209 | test U_SUFFIX { | |
| 210 | try testing.expect(@TypeOf(U_SUFFIX(1)) == c_uint); | |
| 211 | if (math.maxInt(c_ulong) > math.maxInt(c_uint)) { | |
| 212 | try testing.expect(@TypeOf(U_SUFFIX(math.maxInt(c_uint) + 1)) == c_ulong); | |
| 213 | } | |
| 214 | if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { | |
| 215 | try testing.expect(@TypeOf(U_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); | |
| 216 | } | |
| 217 | } | |
| 218 | ||
| 219 | const L_SUFFIX = helpers.L_SUFFIX; | |
| 220 | ||
| 221 | test L_SUFFIX { | |
| 222 | try testing.expect(@TypeOf(L_SUFFIX(1)) == c_long); | |
| 223 | if (math.maxInt(c_long) > math.maxInt(c_int)) { | |
| 224 | try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_int) + 1)) == c_long); | |
| 225 | } | |
| 226 | if (math.maxInt(c_longlong) > math.maxInt(c_long)) { | |
| 227 | try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); | |
| 228 | } | |
| 229 | } | |
| 230 | const UL_SUFFIX = helpers.UL_SUFFIX; | |
| 231 | ||
| 232 | test UL_SUFFIX { | |
| 233 | try testing.expect(@TypeOf(UL_SUFFIX(1)) == c_ulong); | |
| 234 | if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { | |
| 235 | try testing.expect(@TypeOf(UL_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); | |
| 236 | } | |
| 237 | } | |
| 238 | const LL_SUFFIX = helpers.LL_SUFFIX; | |
| 239 | ||
| 240 | test LL_SUFFIX { | |
| 241 | try testing.expect(@TypeOf(LL_SUFFIX(1)) == c_longlong); | |
| 242 | } | |
| 243 | const ULL_SUFFIX = helpers.ULL_SUFFIX; | |
| 244 | ||
| 245 | test ULL_SUFFIX { | |
| 246 | try testing.expect(@TypeOf(ULL_SUFFIX(1)) == c_ulonglong); | |
| 247 | } | |
| 248 | ||
| 249 | test "Extended C ABI casting" { | |
| 250 | if (math.maxInt(c_long) > math.maxInt(c_char)) { | |
| 251 | try testing.expect(@TypeOf(L_SUFFIX(@as(c_char, math.maxInt(c_char) - 1))) == c_long); // c_char | |
| 252 | } | |
| 253 | if (math.maxInt(c_long) > math.maxInt(c_short)) { | |
| 254 | try testing.expect(@TypeOf(L_SUFFIX(@as(c_short, math.maxInt(c_short) - 1))) == c_long); // c_short | |
| 255 | } | |
| 256 | ||
| 257 | if (math.maxInt(c_long) > math.maxInt(c_ushort)) { | |
| 258 | try testing.expect(@TypeOf(L_SUFFIX(@as(c_ushort, math.maxInt(c_ushort) - 1))) == c_long); //c_ushort | |
| 259 | } | |
| 260 | ||
| 261 | if (math.maxInt(c_long) > math.maxInt(c_int)) { | |
| 262 | try testing.expect(@TypeOf(L_SUFFIX(@as(c_int, math.maxInt(c_int) - 1))) == c_long); // c_int | |
| 263 | } | |
| 264 | ||
| 265 | if (math.maxInt(c_long) > math.maxInt(c_uint)) { | |
| 266 | try testing.expect(@TypeOf(L_SUFFIX(@as(c_uint, math.maxInt(c_uint) - 1))) == c_long); // c_uint | |
| 267 | try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_uint) + 1)) == c_long); // comptime_int -> c_long | |
| 268 | } | |
| 269 | ||
| 270 | if (math.maxInt(c_longlong) > math.maxInt(c_long)) { | |
| 271 | try testing.expect(@TypeOf(L_SUFFIX(@as(c_long, math.maxInt(c_long) - 1))) == c_long); // c_long | |
| 272 | try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); // comptime_int -> c_longlong | |
| 273 | } | |
| 274 | } | |
| 275 | ||
| 276 | const WL_CONTAINER_OF = helpers.WL_CONTAINER_OF; | |
| 277 | ||
| 278 | test WL_CONTAINER_OF { | |
| 279 | const S = struct { | |
| 280 | a: u32 = 0, | |
| 281 | b: u32 = 0, | |
| 282 | }; | |
| 283 | const x = S{}; | |
| 284 | const y = S{}; | |
| 285 | const ptr = WL_CONTAINER_OF(&x.b, &y, "b"); | |
| 286 | try testing.expectEqual(&x, ptr); | |
| 287 | } | |
| 288 | ||
| 289 | const CAST_OR_CALL = helpers.CAST_OR_CALL; | |
| 290 | ||
| 291 | test "CAST_OR_CALL casting" { | |
| 292 | const arg: c_int = 1000; | |
| 293 | const casted = CAST_OR_CALL(u8, arg); | |
| 294 | try testing.expectEqual(cast(u8, arg), casted); | |
| 295 | ||
| 296 | const S = struct { | |
| 297 | x: u32 = 0, | |
| 298 | }; | |
| 299 | var s: S = .{}; | |
| 300 | const casted_ptr = CAST_OR_CALL(*u8, &s); | |
| 301 | try testing.expectEqual(cast(*u8, &s), casted_ptr); | |
| 302 | } | |
| 303 | ||
| 304 | test "CAST_OR_CALL calling" { | |
| 305 | const Helper = struct { | |
| 306 | var last_val: bool = false; | |
| 307 | fn returnsVoid(val: bool) void { | |
| 308 | last_val = val; | |
| 309 | } | |
| 310 | fn returnsBool(f: f32) bool { | |
| 311 | return f > 0; | |
| 312 | } | |
| 313 | fn identity(self: c_uint) c_uint { | |
| 314 | return self; | |
| 315 | } | |
| 316 | }; | |
| 317 | ||
| 318 | CAST_OR_CALL(Helper.returnsVoid, true); | |
| 319 | try testing.expectEqual(true, Helper.last_val); | |
| 320 | CAST_OR_CALL(Helper.returnsVoid, false); | |
| 321 | try testing.expectEqual(false, Helper.last_val); | |
| 322 | ||
| 323 | try testing.expectEqual(Helper.returnsBool(1), CAST_OR_CALL(Helper.returnsBool, @as(f32, 1))); | |
| 324 | try testing.expectEqual(Helper.returnsBool(-1), CAST_OR_CALL(Helper.returnsBool, @as(f32, -1))); | |
| 325 | ||
| 326 | try testing.expectEqual(Helper.identity(@as(c_uint, 100)), CAST_OR_CALL(Helper.identity, @as(c_uint, 100))); | |
| 327 | } |
lib/compiler/translate-c/main.zig created+222| ... | ... | @@ -0,0 +1,222 @@ |
| 1 | const std = @import("std"); | |
| 2 | const assert = std.debug.assert; | |
| 3 | const mem = std.mem; | |
| 4 | const process = std.process; | |
| 5 | const aro = @import("aro"); | |
| 6 | const Translator = @import("Translator.zig"); | |
| 7 | ||
| 8 | const fast_exit = @import("builtin").mode != .Debug; | |
| 9 | ||
| 10 | var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init; | |
| 11 | ||
| 12 | pub fn main() u8 { | |
| 13 | const gpa = general_purpose_allocator.allocator(); | |
| 14 | defer _ = general_purpose_allocator.deinit(); | |
| 15 | ||
| 16 | var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator); | |
| 17 | defer arena_instance.deinit(); | |
| 18 | const arena = arena_instance.allocator(); | |
| 19 | ||
| 20 | const args = process.argsAlloc(arena) catch { | |
| 21 | std.debug.print("ran out of memory allocating arguments\n", .{}); | |
| 22 | if (fast_exit) process.exit(1); | |
| 23 | return 1; | |
| 24 | }; | |
| 25 | ||
| 26 | var stderr_buf: [1024]u8 = undefined; | |
| 27 | var stderr = std.fs.File.stderr().writer(&stderr_buf); | |
| 28 | var diagnostics: aro.Diagnostics = .{ | |
| 29 | .output = .{ .to_writer = .{ | |
| 30 | .color = .detect(stderr.file), | |
| 31 | .writer = &stderr.interface, | |
| 32 | } }, | |
| 33 | }; | |
| 34 | ||
| 35 | var comp = aro.Compilation.initDefault(gpa, arena, &diagnostics, std.fs.cwd()) catch |err| switch (err) { | |
| 36 | error.OutOfMemory => { | |
| 37 | std.debug.print("ran out of memory initializing C compilation\n", .{}); | |
| 38 | if (fast_exit) process.exit(1); | |
| 39 | return 1; | |
| 40 | }, | |
| 41 | }; | |
| 42 | defer comp.deinit(); | |
| 43 | ||
| 44 | var driver: aro.Driver = .{ .comp = &comp, .diagnostics = &diagnostics, .aro_name = "aro" }; | |
| 45 | defer driver.deinit(); | |
| 46 | ||
| 47 | var toolchain: aro.Toolchain = .{ .driver = &driver, .filesystem = .{ .real = comp.cwd } }; | |
| 48 | defer toolchain.deinit(); | |
| 49 | ||
| 50 | translate(&driver, &toolchain, args) catch |err| switch (err) { | |
| 51 | error.OutOfMemory => { | |
| 52 | std.debug.print("ran out of memory translating\n", .{}); | |
| 53 | if (fast_exit) process.exit(1); | |
| 54 | return 1; | |
| 55 | }, | |
| 56 | error.FatalError => { | |
| 57 | if (fast_exit) process.exit(1); | |
| 58 | return 1; | |
| 59 | }, | |
| 60 | error.WriteFailed => { | |
| 61 | std.debug.print("unable to write to stdout\n", .{}); | |
| 62 | if (fast_exit) process.exit(1); | |
| 63 | return 1; | |
| 64 | }, | |
| 65 | }; | |
| 66 | if (fast_exit) process.exit(@intFromBool(comp.diagnostics.errors != 0)); | |
| 67 | return @intFromBool(comp.diagnostics.errors != 0); | |
| 68 | } | |
| 69 | ||
| 70 | pub const usage = | |
| 71 | \\Usage {s}: [options] file [CC options] | |
| 72 | \\ | |
| 73 | \\Options: | |
| 74 | \\ --help Print this message | |
| 75 | \\ --version Print translate-c version | |
| 76 | \\ -fmodule-libs Import libraries as modules | |
| 77 | \\ -fno-module-libs (default) Install libraries next to output file | |
| 78 | \\ | |
| 79 | \\ | |
| 80 | ; | |
| 81 | ||
| 82 | fn translate(d: *aro.Driver, tc: *aro.Toolchain, args: [][:0]u8) !void { | |
| 83 | const gpa = d.comp.gpa; | |
| 84 | ||
| 85 | const aro_args = args: { | |
| 86 | var i: usize = 0; | |
| 87 | for (args) |arg| { | |
| 88 | args[i] = arg; | |
| 89 | if (mem.eql(u8, arg, "--help")) { | |
| 90 | var stdout_buf: [512]u8 = undefined; | |
| 91 | var stdout = std.fs.File.stdout().writer(&stdout_buf); | |
| 92 | try stdout.interface.print(usage, .{args[0]}); | |
| 93 | try stdout.interface.flush(); | |
| 94 | return; | |
| 95 | } else if (mem.eql(u8, arg, "--version")) { | |
| 96 | var stdout_buf: [512]u8 = undefined; | |
| 97 | var stdout = std.fs.File.stdout().writer(&stdout_buf); | |
| 98 | // TODO add version | |
| 99 | try stdout.interface.writeAll("0.0.0-dev\n"); | |
| 100 | try stdout.interface.flush(); | |
| 101 | return; | |
| 102 | } else { | |
| 103 | i += 1; | |
| 104 | } | |
| 105 | } | |
| 106 | break :args args[0..i]; | |
| 107 | }; | |
| 108 | const user_macros = macros: { | |
| 109 | var macro_buf: std.ArrayListUnmanaged(u8) = .empty; | |
| 110 | defer macro_buf.deinit(gpa); | |
| 111 | ||
| 112 | var discard_buf: [256]u8 = undefined; | |
| 113 | var discarding: std.Io.Writer.Discarding = .init(&discard_buf); | |
| 114 | assert(!try d.parseArgs(&discarding.writer, &macro_buf, aro_args)); | |
| 115 | if (macro_buf.items.len > std.math.maxInt(u32)) { | |
| 116 | return d.fatal("user provided macro source exceeded max size", .{}); | |
| 117 | } | |
| 118 | ||
| 119 | const content = try macro_buf.toOwnedSlice(gpa); | |
| 120 | errdefer gpa.free(content); | |
| 121 | ||
| 122 | break :macros try d.comp.addSourceFromOwnedBuffer("<command line>", content, .user); | |
| 123 | }; | |
| 124 | ||
| 125 | if (d.inputs.items.len != 1) { | |
| 126 | return d.fatal("expected exactly one input file", .{}); | |
| 127 | } | |
| 128 | const source = d.inputs.items[0]; | |
| 129 | ||
| 130 | tc.discover() catch |er| switch (er) { | |
| 131 | error.OutOfMemory => return error.OutOfMemory, | |
| 132 | error.TooManyMultilibs => return d.fatal("found more than one multilib with the same priority", .{}), | |
| 133 | }; | |
| 134 | tc.defineSystemIncludes() catch |er| switch (er) { | |
| 135 | error.OutOfMemory => return error.OutOfMemory, | |
| 136 | error.AroIncludeNotFound => return d.fatal("unable to find Aro builtin headers", .{}), | |
| 137 | }; | |
| 138 | ||
| 139 | const builtin_macros = d.comp.generateBuiltinMacros(.include_system_defines) catch |err| switch (err) { | |
| 140 | error.FileTooBig => return d.fatal("builtin macro source exceeded max size", .{}), | |
| 141 | else => |e| return e, | |
| 142 | }; | |
| 143 | ||
| 144 | var pp = try aro.Preprocessor.initDefault(d.comp); | |
| 145 | defer pp.deinit(); | |
| 146 | ||
| 147 | var name_buf: [std.fs.max_name_bytes]u8 = undefined; | |
| 148 | // Omit the source file from the dep file so that it can be tracked separately. | |
| 149 | // In the Zig compiler we want to omit it from the cache hash since it will | |
| 150 | // be written to a tmp file then renamed into place, meaning the path will be | |
| 151 | // wrong as soon as the work is done. | |
| 152 | var opt_dep_file = try d.initDepFile(source, &name_buf, true); | |
| 153 | defer if (opt_dep_file) |*dep_file| dep_file.deinit(gpa); | |
| 154 | ||
| 155 | if (opt_dep_file) |*dep_file| pp.dep_file = dep_file; | |
| 156 | ||
| 157 | try pp.preprocessSources(&.{ source, builtin_macros, user_macros }); | |
| 158 | ||
| 159 | var c_tree = try pp.parse(); | |
| 160 | defer c_tree.deinit(); | |
| 161 | ||
| 162 | if (d.diagnostics.errors != 0) { | |
| 163 | if (fast_exit) process.exit(1); | |
| 164 | return error.FatalError; | |
| 165 | } | |
| 166 | ||
| 167 | var out_buf: [4096]u8 = undefined; | |
| 168 | if (opt_dep_file) |dep_file| { | |
| 169 | const dep_file_name = try d.getDepFileName(source, out_buf[0..std.fs.max_name_bytes]); | |
| 170 | ||
| 171 | const file = if (dep_file_name) |path| | |
| 172 | d.comp.cwd.createFile(path, .{}) catch |er| | |
| 173 | return d.fatal("unable to create dependency file '{s}': {s}", .{ path, aro.Driver.errorDescription(er) }) | |
| 174 | else | |
| 175 | std.fs.File.stdout(); | |
| 176 | defer if (dep_file_name != null) file.close(); | |
| 177 | ||
| 178 | var file_writer = file.writer(&out_buf); | |
| 179 | dep_file.write(&file_writer.interface) catch | |
| 180 | return d.fatal("unable to write dependency file: {s}", .{aro.Driver.errorDescription(file_writer.err.?)}); | |
| 181 | } | |
| 182 | ||
| 183 | const rendered_zig = try Translator.translate(.{ | |
| 184 | .gpa = gpa, | |
| 185 | .comp = d.comp, | |
| 186 | .pp = &pp, | |
| 187 | .tree = &c_tree, | |
| 188 | }); | |
| 189 | defer gpa.free(rendered_zig); | |
| 190 | ||
| 191 | var close_out_file = false; | |
| 192 | var out_file_path: []const u8 = "<stdout>"; | |
| 193 | var out_file: std.fs.File = .stdout(); | |
| 194 | defer if (close_out_file) out_file.close(); | |
| 195 | ||
| 196 | if (d.output_name) |path| blk: { | |
| 197 | if (std.mem.eql(u8, path, "-")) break :blk; | |
| 198 | if (std.fs.path.dirname(path)) |dirname| { | |
| 199 | std.fs.cwd().makePath(dirname) catch |err| | |
| 200 | return d.fatal("failed to create path to '{s}': {s}", .{ path, aro.Driver.errorDescription(err) }); | |
| 201 | } | |
| 202 | out_file = std.fs.cwd().createFile(path, .{}) catch |err| { | |
| 203 | return d.fatal("failed to create output file '{s}': {s}", .{ path, aro.Driver.errorDescription(err) }); | |
| 204 | }; | |
| 205 | close_out_file = true; | |
| 206 | out_file_path = path; | |
| 207 | } | |
| 208 | ||
| 209 | var out_writer = out_file.writer(&out_buf); | |
| 210 | out_writer.interface.writeAll(rendered_zig) catch {}; | |
| 211 | out_writer.interface.flush() catch {}; | |
| 212 | if (out_writer.err) |write_err| | |
| 213 | return d.fatal("failed to write result to '{s}': {s}", .{ out_file_path, aro.Driver.errorDescription(write_err) }); | |
| 214 | ||
| 215 | if (fast_exit) process.exit(0); | |
| 216 | } | |
| 217 | ||
| 218 | test { | |
| 219 | _ = Translator; | |
| 220 | _ = @import("helpers.zig"); | |
| 221 | _ = @import("PatternList.zig"); | |
| 222 | } |
lib/std/Build/Cache.zig+7-7| ... | ... | @@ -459,9 +459,9 @@ pub const Manifest = struct { |
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | pub fn addDepFile(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void { | |
| 462 | pub fn addDepFile(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void { | |
| 463 | 463 | assert(self.manifest_file == null); |
| 464 | return self.addDepFileMaybePost(dir, dep_file_basename); | |
| 464 | return self.addDepFileMaybePost(dir, dep_file_sub_path); | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | pub const HitError = error{ |
| ... | ... | @@ -1049,14 +1049,14 @@ pub const Manifest = struct { |
| 1049 | 1049 | self.hash.hasher.update(&new_file.bin_digest); |
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | pub fn addDepFilePost(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void { | |
| 1052 | pub fn addDepFilePost(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void { | |
| 1053 | 1053 | assert(self.manifest_file != null); |
| 1054 | return self.addDepFileMaybePost(dir, dep_file_basename); | |
| 1054 | return self.addDepFileMaybePost(dir, dep_file_sub_path); | |
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | fn addDepFileMaybePost(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void { | |
| 1057 | fn addDepFileMaybePost(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void { | |
| 1058 | 1058 | const gpa = self.cache.gpa; |
| 1059 | const dep_file_contents = try dir.readFileAlloc(dep_file_basename, gpa, .limited(manifest_file_size_max)); | |
| 1059 | const dep_file_contents = try dir.readFileAlloc(dep_file_sub_path, gpa, .limited(manifest_file_size_max)); | |
| 1060 | 1060 | defer gpa.free(dep_file_contents); |
| 1061 | 1061 | |
| 1062 | 1062 | var error_buf: std.ArrayListUnmanaged(u8) = .empty; |
| ... | ... | @@ -1083,7 +1083,7 @@ pub const Manifest = struct { |
| 1083 | 1083 | }, |
| 1084 | 1084 | else => |err| { |
| 1085 | 1085 | try err.printError(gpa, &error_buf); |
| 1086 | log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); | |
| 1086 | log.err("failed parsing {s}: {s}", .{ dep_file_sub_path, error_buf.items }); | |
| 1087 | 1087 | return error.InvalidDepFile; |
| 1088 | 1088 | }, |
| 1089 | 1089 | } |
lib/std/zig.zig+4-3| ... | ... | @@ -36,9 +36,10 @@ pub const ParsedCharLiteral = string_literal.ParsedCharLiteral; |
| 36 | 36 | pub const parseCharLiteral = string_literal.parseCharLiteral; |
| 37 | 37 | pub const parseNumberLiteral = number_literal.parseNumberLiteral; |
| 38 | 38 | |
| 39 | // Files needed by translate-c. | |
| 40 | pub const c_builtins = @import("zig/c_builtins.zig"); | |
| 41 | pub const c_translation = @import("zig/c_translation.zig"); | |
| 39 | pub const c_translation = struct { | |
| 40 | pub const builtins = @import("zig/c_translation/builtins.zig"); | |
| 41 | pub const helpers = @import("zig/c_translation/helpers.zig"); | |
| 42 | }; | |
| 42 | 43 | |
| 43 | 44 | pub const SrcHasher = std.crypto.hash.Blake3; |
| 44 | 45 | pub const SrcHash = [16]u8; |
lib/std/zig/c_builtins.zig deleted-268| ... | ... | @@ -1,268 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | pub inline fn __builtin_bswap16(val: u16) u16 { | |
| 4 | return @byteSwap(val); | |
| 5 | } | |
| 6 | pub inline fn __builtin_bswap32(val: u32) u32 { | |
| 7 | return @byteSwap(val); | |
| 8 | } | |
| 9 | pub inline fn __builtin_bswap64(val: u64) u64 { | |
| 10 | return @byteSwap(val); | |
| 11 | } | |
| 12 | ||
| 13 | pub inline fn __builtin_signbit(val: f64) c_int { | |
| 14 | return @intFromBool(std.math.signbit(val)); | |
| 15 | } | |
| 16 | pub inline fn __builtin_signbitf(val: f32) c_int { | |
| 17 | return @intFromBool(std.math.signbit(val)); | |
| 18 | } | |
| 19 | ||
| 20 | pub inline fn __builtin_popcount(val: c_uint) c_int { | |
| 21 | // popcount of a c_uint will never exceed the capacity of a c_int | |
| 22 | @setRuntimeSafety(false); | |
| 23 | return @as(c_int, @bitCast(@as(c_uint, @popCount(val)))); | |
| 24 | } | |
| 25 | pub inline fn __builtin_ctz(val: c_uint) c_int { | |
| 26 | // Returns the number of trailing 0-bits in val, starting at the least significant bit position. | |
| 27 | // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint | |
| 28 | @setRuntimeSafety(false); | |
| 29 | return @as(c_int, @bitCast(@as(c_uint, @ctz(val)))); | |
| 30 | } | |
| 31 | pub inline fn __builtin_clz(val: c_uint) c_int { | |
| 32 | // Returns the number of leading 0-bits in x, starting at the most significant bit position. | |
| 33 | // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint | |
| 34 | @setRuntimeSafety(false); | |
| 35 | return @as(c_int, @bitCast(@as(c_uint, @clz(val)))); | |
| 36 | } | |
| 37 | ||
| 38 | pub inline fn __builtin_sqrt(val: f64) f64 { | |
| 39 | return @sqrt(val); | |
| 40 | } | |
| 41 | pub inline fn __builtin_sqrtf(val: f32) f32 { | |
| 42 | return @sqrt(val); | |
| 43 | } | |
| 44 | ||
| 45 | pub inline fn __builtin_sin(val: f64) f64 { | |
| 46 | return @sin(val); | |
| 47 | } | |
| 48 | pub inline fn __builtin_sinf(val: f32) f32 { | |
| 49 | return @sin(val); | |
| 50 | } | |
| 51 | pub inline fn __builtin_cos(val: f64) f64 { | |
| 52 | return @cos(val); | |
| 53 | } | |
| 54 | pub inline fn __builtin_cosf(val: f32) f32 { | |
| 55 | return @cos(val); | |
| 56 | } | |
| 57 | ||
| 58 | pub inline fn __builtin_exp(val: f64) f64 { | |
| 59 | return @exp(val); | |
| 60 | } | |
| 61 | pub inline fn __builtin_expf(val: f32) f32 { | |
| 62 | return @exp(val); | |
| 63 | } | |
| 64 | pub inline fn __builtin_exp2(val: f64) f64 { | |
| 65 | return @exp2(val); | |
| 66 | } | |
| 67 | pub inline fn __builtin_exp2f(val: f32) f32 { | |
| 68 | return @exp2(val); | |
| 69 | } | |
| 70 | pub inline fn __builtin_log(val: f64) f64 { | |
| 71 | return @log(val); | |
| 72 | } | |
| 73 | pub inline fn __builtin_logf(val: f32) f32 { | |
| 74 | return @log(val); | |
| 75 | } | |
| 76 | pub inline fn __builtin_log2(val: f64) f64 { | |
| 77 | return @log2(val); | |
| 78 | } | |
| 79 | pub inline fn __builtin_log2f(val: f32) f32 { | |
| 80 | return @log2(val); | |
| 81 | } | |
| 82 | pub inline fn __builtin_log10(val: f64) f64 { | |
| 83 | return @log10(val); | |
| 84 | } | |
| 85 | pub inline fn __builtin_log10f(val: f32) f32 { | |
| 86 | return @log10(val); | |
| 87 | } | |
| 88 | ||
| 89 | // Standard C Library bug: The absolute value of the most negative integer remains negative. | |
| 90 | pub inline fn __builtin_abs(val: c_int) c_int { | |
| 91 | return if (val == std.math.minInt(c_int)) val else @intCast(@abs(val)); | |
| 92 | } | |
| 93 | pub inline fn __builtin_labs(val: c_long) c_long { | |
| 94 | return if (val == std.math.minInt(c_long)) val else @intCast(@abs(val)); | |
| 95 | } | |
| 96 | pub inline fn __builtin_llabs(val: c_longlong) c_longlong { | |
| 97 | return if (val == std.math.minInt(c_longlong)) val else @intCast(@abs(val)); | |
| 98 | } | |
| 99 | pub inline fn __builtin_fabs(val: f64) f64 { | |
| 100 | return @abs(val); | |
| 101 | } | |
| 102 | pub inline fn __builtin_fabsf(val: f32) f32 { | |
| 103 | return @abs(val); | |
| 104 | } | |
| 105 | ||
| 106 | pub inline fn __builtin_floor(val: f64) f64 { | |
| 107 | return @floor(val); | |
| 108 | } | |
| 109 | pub inline fn __builtin_floorf(val: f32) f32 { | |
| 110 | return @floor(val); | |
| 111 | } | |
| 112 | pub inline fn __builtin_ceil(val: f64) f64 { | |
| 113 | return @ceil(val); | |
| 114 | } | |
| 115 | pub inline fn __builtin_ceilf(val: f32) f32 { | |
| 116 | return @ceil(val); | |
| 117 | } | |
| 118 | pub inline fn __builtin_trunc(val: f64) f64 { | |
| 119 | return @trunc(val); | |
| 120 | } | |
| 121 | pub inline fn __builtin_truncf(val: f32) f32 { | |
| 122 | return @trunc(val); | |
| 123 | } | |
| 124 | pub inline fn __builtin_round(val: f64) f64 { | |
| 125 | return @round(val); | |
| 126 | } | |
| 127 | pub inline fn __builtin_roundf(val: f32) f32 { | |
| 128 | return @round(val); | |
| 129 | } | |
| 130 | ||
| 131 | pub inline fn __builtin_strlen(s: [*c]const u8) usize { | |
| 132 | return std.mem.sliceTo(s, 0).len; | |
| 133 | } | |
| 134 | pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { | |
| 135 | return switch (std.mem.orderZ(u8, s1, s2)) { | |
| 136 | .lt => -1, | |
| 137 | .eq => 0, | |
| 138 | .gt => 1, | |
| 139 | }; | |
| 140 | } | |
| 141 | ||
| 142 | pub inline fn __builtin_object_size(ptr: ?*const anyopaque, ty: c_int) usize { | |
| 143 | _ = ptr; | |
| 144 | // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html | |
| 145 | // If it is not possible to determine which objects ptr points to at compile time, | |
| 146 | // __builtin_object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0 | |
| 147 | // for type 2 or 3. | |
| 148 | if (ty == 0 or ty == 1) return @as(usize, @bitCast(-@as(isize, 1))); | |
| 149 | if (ty == 2 or ty == 3) return 0; | |
| 150 | unreachable; | |
| 151 | } | |
| 152 | ||
| 153 | pub inline fn __builtin___memset_chk( | |
| 154 | dst: ?*anyopaque, | |
| 155 | val: c_int, | |
| 156 | len: usize, | |
| 157 | remaining: usize, | |
| 158 | ) ?*anyopaque { | |
| 159 | if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining"); | |
| 160 | return __builtin_memset(dst, val, len); | |
| 161 | } | |
| 162 | ||
| 163 | pub inline fn __builtin_memset(dst: ?*anyopaque, val: c_int, len: usize) ?*anyopaque { | |
| 164 | const dst_cast = @as([*c]u8, @ptrCast(dst)); | |
| 165 | @memset(dst_cast[0..len], @as(u8, @bitCast(@as(i8, @truncate(val))))); | |
| 166 | return dst; | |
| 167 | } | |
| 168 | ||
| 169 | pub inline fn __builtin___memcpy_chk( | |
| 170 | noalias dst: ?*anyopaque, | |
| 171 | noalias src: ?*const anyopaque, | |
| 172 | len: usize, | |
| 173 | remaining: usize, | |
| 174 | ) ?*anyopaque { | |
| 175 | if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining"); | |
| 176 | return __builtin_memcpy(dst, src, len); | |
| 177 | } | |
| 178 | ||
| 179 | pub inline fn __builtin_memcpy( | |
| 180 | noalias dst: ?*anyopaque, | |
| 181 | noalias src: ?*const anyopaque, | |
| 182 | len: usize, | |
| 183 | ) ?*anyopaque { | |
| 184 | if (len > 0) @memcpy( | |
| 185 | @as([*]u8, @ptrCast(dst.?))[0..len], | |
| 186 | @as([*]const u8, @ptrCast(src.?)), | |
| 187 | ); | |
| 188 | return dst; | |
| 189 | } | |
| 190 | ||
| 191 | /// The return value of __builtin_expect is `expr`. `c` is the expected value | |
| 192 | /// of `expr` and is used as a hint to the compiler in C. Here it is unused. | |
| 193 | pub inline fn __builtin_expect(expr: c_long, c: c_long) c_long { | |
| 194 | _ = c; | |
| 195 | return expr; | |
| 196 | } | |
| 197 | ||
| 198 | /// returns a quiet NaN. Quiet NaNs have many representations; tagp is used to select one in an | |
| 199 | /// implementation-defined way. | |
| 200 | /// This implementation is based on the description for __builtin_nan provided in the GCC docs at | |
| 201 | /// https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fnan | |
| 202 | /// Comment is reproduced below: | |
| 203 | /// Since ISO C99 defines this function in terms of strtod, which we do not implement, a description | |
| 204 | /// of the parsing is in order. | |
| 205 | /// The string is parsed as by strtol; that is, the base is recognized by leading ‘0’ or ‘0x’ prefixes. | |
| 206 | /// The number parsed is placed in the significand such that the least significant bit of the number is | |
| 207 | /// at the least significant bit of the significand. | |
| 208 | /// The number is truncated to fit the significand field provided. | |
| 209 | /// The significand is forced to be a quiet NaN. | |
| 210 | /// | |
| 211 | /// If tagp contains any non-numeric characters, the function returns a NaN whose significand is zero. | |
| 212 | /// If tagp is empty, the function returns a NaN whose significand is zero. | |
| 213 | pub inline fn __builtin_nanf(tagp: []const u8) f32 { | |
| 214 | const parsed = std.fmt.parseUnsigned(c_ulong, tagp, 0) catch 0; | |
| 215 | const bits: u23 = @truncate(parsed); // single-precision float trailing significand is 23 bits | |
| 216 | return @bitCast(@as(u32, bits) | @as(u32, @bitCast(std.math.nan(f32)))); | |
| 217 | } | |
| 218 | ||
| 219 | pub inline fn __builtin_huge_valf() f32 { | |
| 220 | return std.math.inf(f32); | |
| 221 | } | |
| 222 | ||
| 223 | pub inline fn __builtin_inff() f32 { | |
| 224 | return std.math.inf(f32); | |
| 225 | } | |
| 226 | ||
| 227 | pub inline fn __builtin_isnan(x: anytype) c_int { | |
| 228 | return @intFromBool(std.math.isNan(x)); | |
| 229 | } | |
| 230 | ||
| 231 | pub inline fn __builtin_isinf(x: anytype) c_int { | |
| 232 | return @intFromBool(std.math.isInf(x)); | |
| 233 | } | |
| 234 | ||
| 235 | /// Similar to isinf, except the return value is -1 for an argument of -Inf and 1 for an argument of +Inf. | |
| 236 | pub inline fn __builtin_isinf_sign(x: anytype) c_int { | |
| 237 | if (!std.math.isInf(x)) return 0; | |
| 238 | return if (std.math.isPositiveInf(x)) 1 else -1; | |
| 239 | } | |
| 240 | ||
| 241 | pub inline fn __has_builtin(func: anytype) c_int { | |
| 242 | _ = func; | |
| 243 | return @intFromBool(true); | |
| 244 | } | |
| 245 | ||
| 246 | pub inline fn __builtin_assume(cond: bool) void { | |
| 247 | if (!cond) unreachable; | |
| 248 | } | |
| 249 | ||
| 250 | pub inline fn __builtin_unreachable() noreturn { | |
| 251 | unreachable; | |
| 252 | } | |
| 253 | ||
| 254 | pub inline fn __builtin_constant_p(expr: anytype) c_int { | |
| 255 | _ = expr; | |
| 256 | return @intFromBool(false); | |
| 257 | } | |
| 258 | pub fn __builtin_mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_int { | |
| 259 | const res = @mulWithOverflow(a, b); | |
| 260 | result.* = res[0]; | |
| 261 | return res[1]; | |
| 262 | } | |
| 263 | ||
| 264 | // __builtin_alloca_with_align is not currently implemented. | |
| 265 | // It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented | |
| 266 | // builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the | |
| 267 | // run-translated-c test and the test-translate-c test to use a different non-implemented builtin. | |
| 268 | // pub inline fn __builtin_alloca_with_align(size: usize, alignment: usize) *anyopaque {} |
lib/std/zig/c_translation.zig deleted-699| ... | ... | @@ -1,699 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | const testing = std.testing; | |
| 4 | const math = std.math; | |
| 5 | const mem = std.mem; | |
| 6 | ||
| 7 | /// Given a type and value, cast the value to the type as c would. | |
| 8 | pub fn cast(comptime DestType: type, target: anytype) DestType { | |
| 9 | // this function should behave like transCCast in translate-c, except it's for macros | |
| 10 | const SourceType = @TypeOf(target); | |
| 11 | switch (@typeInfo(DestType)) { | |
| 12 | .@"fn" => return castToPtr(*const DestType, SourceType, target), | |
| 13 | .pointer => return castToPtr(DestType, SourceType, target), | |
| 14 | .optional => |dest_opt| { | |
| 15 | if (@typeInfo(dest_opt.child) == .pointer) { | |
| 16 | return castToPtr(DestType, SourceType, target); | |
| 17 | } else if (@typeInfo(dest_opt.child) == .@"fn") { | |
| 18 | return castToPtr(?*const dest_opt.child, SourceType, target); | |
| 19 | } | |
| 20 | }, | |
| 21 | .int => { | |
| 22 | switch (@typeInfo(SourceType)) { | |
| 23 | .pointer => { | |
| 24 | return castInt(DestType, @intFromPtr(target)); | |
| 25 | }, | |
| 26 | .optional => |opt| { | |
| 27 | if (@typeInfo(opt.child) == .pointer) { | |
| 28 | return castInt(DestType, @intFromPtr(target)); | |
| 29 | } | |
| 30 | }, | |
| 31 | .int => { | |
| 32 | return castInt(DestType, target); | |
| 33 | }, | |
| 34 | .@"fn" => { | |
| 35 | return castInt(DestType, @intFromPtr(&target)); | |
| 36 | }, | |
| 37 | .bool => { | |
| 38 | return @intFromBool(target); | |
| 39 | }, | |
| 40 | else => {}, | |
| 41 | } | |
| 42 | }, | |
| 43 | .float => { | |
| 44 | switch (@typeInfo(SourceType)) { | |
| 45 | .int => return @as(DestType, @floatFromInt(target)), | |
| 46 | .float => return @as(DestType, @floatCast(target)), | |
| 47 | .bool => return @as(DestType, @floatFromInt(@intFromBool(target))), | |
| 48 | else => {}, | |
| 49 | } | |
| 50 | }, | |
| 51 | .@"union" => |info| { | |
| 52 | inline for (info.fields) |field| { | |
| 53 | if (field.type == SourceType) return @unionInit(DestType, field.name, target); | |
| 54 | } | |
| 55 | @compileError("cast to union type '" ++ @typeName(DestType) ++ "' from type '" ++ @typeName(SourceType) ++ "' which is not present in union"); | |
| 56 | }, | |
| 57 | .bool => return cast(usize, target) != 0, | |
| 58 | else => {}, | |
| 59 | } | |
| 60 | return @as(DestType, target); | |
| 61 | } | |
| 62 | ||
| 63 | fn castInt(comptime DestType: type, target: anytype) DestType { | |
| 64 | const dest = @typeInfo(DestType).int; | |
| 65 | const source = @typeInfo(@TypeOf(target)).int; | |
| 66 | ||
| 67 | if (dest.bits < source.bits) | |
| 68 | return @as(DestType, @bitCast(@as(std.meta.Int(source.signedness, dest.bits), @truncate(target)))) | |
| 69 | else | |
| 70 | return @as(DestType, @bitCast(@as(std.meta.Int(source.signedness, dest.bits), target))); | |
| 71 | } | |
| 72 | ||
| 73 | fn castPtr(comptime DestType: type, target: anytype) DestType { | |
| 74 | return @ptrCast(@alignCast(@constCast(@volatileCast(target)))); | |
| 75 | } | |
| 76 | ||
| 77 | fn castToPtr(comptime DestType: type, comptime SourceType: type, target: anytype) DestType { | |
| 78 | switch (@typeInfo(SourceType)) { | |
| 79 | .int => { | |
| 80 | return @as(DestType, @ptrFromInt(castInt(usize, target))); | |
| 81 | }, | |
| 82 | .comptime_int => { | |
| 83 | if (target < 0) | |
| 84 | return @as(DestType, @ptrFromInt(@as(usize, @bitCast(@as(isize, @intCast(target)))))) | |
| 85 | else | |
| 86 | return @as(DestType, @ptrFromInt(@as(usize, @intCast(target)))); | |
| 87 | }, | |
| 88 | .pointer => { | |
| 89 | return castPtr(DestType, target); | |
| 90 | }, | |
| 91 | .@"fn" => { | |
| 92 | return castPtr(DestType, &target); | |
| 93 | }, | |
| 94 | .optional => |target_opt| { | |
| 95 | if (@typeInfo(target_opt.child) == .pointer) { | |
| 96 | return castPtr(DestType, target); | |
| 97 | } | |
| 98 | }, | |
| 99 | else => {}, | |
| 100 | } | |
| 101 | return @as(DestType, target); | |
| 102 | } | |
| 103 | ||
| 104 | fn ptrInfo(comptime PtrType: type) std.builtin.Type.Pointer { | |
| 105 | return switch (@typeInfo(PtrType)) { | |
| 106 | .optional => |opt_info| @typeInfo(opt_info.child).pointer, | |
| 107 | .pointer => |ptr_info| ptr_info, | |
| 108 | else => unreachable, | |
| 109 | }; | |
| 110 | } | |
| 111 | ||
| 112 | test "cast" { | |
| 113 | var i = @as(i64, 10); | |
| 114 | ||
| 115 | try testing.expect(cast(*u8, 16) == @as(*u8, @ptrFromInt(16))); | |
| 116 | try testing.expect(cast(*u64, &i).* == @as(u64, 10)); | |
| 117 | try testing.expect(cast(*i64, @as(?*align(1) i64, &i)) == &i); | |
| 118 | ||
| 119 | try testing.expect(cast(?*u8, 2) == @as(*u8, @ptrFromInt(2))); | |
| 120 | try testing.expect(cast(?*i64, @as(*align(1) i64, &i)) == &i); | |
| 121 | try testing.expect(cast(?*i64, @as(?*align(1) i64, &i)) == &i); | |
| 122 | ||
| 123 | try testing.expectEqual(@as(u32, 4), cast(u32, @as(*u32, @ptrFromInt(4)))); | |
| 124 | try testing.expectEqual(@as(u32, 4), cast(u32, @as(?*u32, @ptrFromInt(4)))); | |
| 125 | try testing.expectEqual(@as(u32, 10), cast(u32, @as(u64, 10))); | |
| 126 | ||
| 127 | try testing.expectEqual(@as(i32, @bitCast(@as(u32, 0x8000_0000))), cast(i32, @as(u32, 0x8000_0000))); | |
| 128 | ||
| 129 | try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*const u8, @ptrFromInt(2)))); | |
| 130 | try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*volatile u8, @ptrFromInt(2)))); | |
| 131 | ||
| 132 | try testing.expectEqual(@as(?*anyopaque, @ptrFromInt(2)), cast(?*anyopaque, @as(*u8, @ptrFromInt(2)))); | |
| 133 | ||
| 134 | var foo: c_int = -1; | |
| 135 | _ = &foo; | |
| 136 | try testing.expect(cast(*anyopaque, -1) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 137 | try testing.expect(cast(*anyopaque, foo) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 138 | try testing.expect(cast(?*anyopaque, -1) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 139 | try testing.expect(cast(?*anyopaque, foo) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 140 | ||
| 141 | const FnPtr = ?*align(1) const fn (*anyopaque) void; | |
| 142 | try testing.expect(cast(FnPtr, 0) == @as(FnPtr, @ptrFromInt(@as(usize, 0)))); | |
| 143 | try testing.expect(cast(FnPtr, foo) == @as(FnPtr, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); | |
| 144 | } | |
| 145 | ||
| 146 | /// Given a value returns its size as C's sizeof operator would. | |
| 147 | pub fn sizeof(target: anytype) usize { | |
| 148 | const T: type = if (@TypeOf(target) == type) target else @TypeOf(target); | |
| 149 | switch (@typeInfo(T)) { | |
| 150 | .float, .int, .@"struct", .@"union", .array, .bool, .vector => return @sizeOf(T), | |
| 151 | .@"fn" => { | |
| 152 | // sizeof(main) in C returns 1 | |
| 153 | return 1; | |
| 154 | }, | |
| 155 | .null => return @sizeOf(*anyopaque), | |
| 156 | .void => { | |
| 157 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. | |
| 158 | return 1; | |
| 159 | }, | |
| 160 | .@"opaque" => { | |
| 161 | if (T == anyopaque) { | |
| 162 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. | |
| 163 | return 1; | |
| 164 | } else { | |
| 165 | @compileError("Cannot use C sizeof on opaque type " ++ @typeName(T)); | |
| 166 | } | |
| 167 | }, | |
| 168 | .optional => |opt| { | |
| 169 | if (@typeInfo(opt.child) == .pointer) { | |
| 170 | return sizeof(opt.child); | |
| 171 | } else { | |
| 172 | @compileError("Cannot use C sizeof on non-pointer optional " ++ @typeName(T)); | |
| 173 | } | |
| 174 | }, | |
| 175 | .pointer => |ptr| { | |
| 176 | if (ptr.size == .slice) { | |
| 177 | @compileError("Cannot use C sizeof on slice type " ++ @typeName(T)); | |
| 178 | } | |
| 179 | // for strings, sizeof("a") returns 2. | |
| 180 | // normal pointer decay scenarios from C are handled | |
| 181 | // in the .array case above, but strings remain literals | |
| 182 | // and are therefore always pointers, so they need to be | |
| 183 | // specially handled here. | |
| 184 | if (ptr.size == .one and ptr.is_const and @typeInfo(ptr.child) == .array) { | |
| 185 | const array_info = @typeInfo(ptr.child).array; | |
| 186 | if ((array_info.child == u8 or array_info.child == u16) and array_info.sentinel() == 0) { | |
| 187 | // length of the string plus one for the null terminator. | |
| 188 | return (array_info.len + 1) * @sizeOf(array_info.child); | |
| 189 | } | |
| 190 | } | |
| 191 | // When zero sized pointers are removed, this case will no | |
| 192 | // longer be reachable and can be deleted. | |
| 193 | if (@sizeOf(T) == 0) { | |
| 194 | return @sizeOf(*anyopaque); | |
| 195 | } | |
| 196 | return @sizeOf(T); | |
| 197 | }, | |
| 198 | .comptime_float => return @sizeOf(f64), // TODO c_double #3999 | |
| 199 | .comptime_int => { | |
| 200 | // TODO to get the correct result we have to translate | |
| 201 | // `1073741824 * 4` as `int(1073741824) *% int(4)` since | |
| 202 | // sizeof(1073741824 * 4) != sizeof(4294967296). | |
| 203 | ||
| 204 | // TODO test if target fits in int, long or long long | |
| 205 | return @sizeOf(c_int); | |
| 206 | }, | |
| 207 | else => @compileError("std.meta.sizeof does not support type " ++ @typeName(T)), | |
| 208 | } | |
| 209 | } | |
| 210 | ||
| 211 | test "sizeof" { | |
| 212 | const S = extern struct { a: u32 }; | |
| 213 | ||
| 214 | const ptr_size = @sizeOf(*anyopaque); | |
| 215 | ||
| 216 | try testing.expect(sizeof(u32) == 4); | |
| 217 | try testing.expect(sizeof(@as(u32, 2)) == 4); | |
| 218 | try testing.expect(sizeof(2) == @sizeOf(c_int)); | |
| 219 | ||
| 220 | try testing.expect(sizeof(2.0) == @sizeOf(f64)); | |
| 221 | ||
| 222 | try testing.expect(sizeof(S) == 4); | |
| 223 | ||
| 224 | try testing.expect(sizeof([_]u32{ 4, 5, 6 }) == 12); | |
| 225 | try testing.expect(sizeof([3]u32) == 12); | |
| 226 | try testing.expect(sizeof([3:0]u32) == 16); | |
| 227 | try testing.expect(sizeof(&[_]u32{ 4, 5, 6 }) == ptr_size); | |
| 228 | ||
| 229 | try testing.expect(sizeof(*u32) == ptr_size); | |
| 230 | try testing.expect(sizeof([*]u32) == ptr_size); | |
| 231 | try testing.expect(sizeof([*c]u32) == ptr_size); | |
| 232 | try testing.expect(sizeof(?*u32) == ptr_size); | |
| 233 | try testing.expect(sizeof(?[*]u32) == ptr_size); | |
| 234 | try testing.expect(sizeof(*anyopaque) == ptr_size); | |
| 235 | try testing.expect(sizeof(*void) == ptr_size); | |
| 236 | try testing.expect(sizeof(null) == ptr_size); | |
| 237 | ||
| 238 | try testing.expect(sizeof("foobar") == 7); | |
| 239 | try testing.expect(sizeof(&[_:0]u16{ 'f', 'o', 'o', 'b', 'a', 'r' }) == 14); | |
| 240 | try testing.expect(sizeof(*const [4:0]u8) == 5); | |
| 241 | try testing.expect(sizeof(*[4:0]u8) == ptr_size); | |
| 242 | try testing.expect(sizeof([*]const [4:0]u8) == ptr_size); | |
| 243 | try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size); | |
| 244 | try testing.expect(sizeof(*const [4]u8) == ptr_size); | |
| 245 | ||
| 246 | if (false) { // TODO | |
| 247 | try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof))); | |
| 248 | try testing.expect(sizeof(sizeof) == 1); | |
| 249 | } | |
| 250 | ||
| 251 | try testing.expect(sizeof(void) == 1); | |
| 252 | try testing.expect(sizeof(anyopaque) == 1); | |
| 253 | } | |
| 254 | ||
| 255 | pub const CIntLiteralBase = enum { decimal, octal, hex }; | |
| 256 | ||
| 257 | fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type { | |
| 258 | const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong }; | |
| 259 | const signed_oct_hex = [_]type{ c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong }; | |
| 260 | const unsigned = [_]type{ c_uint, c_ulong, c_ulonglong }; | |
| 261 | ||
| 262 | const list: []const type = if (@typeInfo(SuffixType).int.signedness == .unsigned) | |
| 263 | &unsigned | |
| 264 | else if (base == .decimal) | |
| 265 | &signed_decimal | |
| 266 | else | |
| 267 | &signed_oct_hex; | |
| 268 | ||
| 269 | var pos = mem.indexOfScalar(type, list, SuffixType).?; | |
| 270 | ||
| 271 | while (pos < list.len) : (pos += 1) { | |
| 272 | if (number >= math.minInt(list[pos]) and number <= math.maxInt(list[pos])) { | |
| 273 | return list[pos]; | |
| 274 | } | |
| 275 | } | |
| 276 | @compileError("Integer literal is too large"); | |
| 277 | } | |
| 278 | ||
| 279 | /// Promote the type of an integer literal until it fits as C would. | |
| 280 | pub fn promoteIntLiteral( | |
| 281 | comptime SuffixType: type, | |
| 282 | comptime number: comptime_int, | |
| 283 | comptime base: CIntLiteralBase, | |
| 284 | ) PromoteIntLiteralReturnType(SuffixType, number, base) { | |
| 285 | return number; | |
| 286 | } | |
| 287 | ||
| 288 | test "promoteIntLiteral" { | |
| 289 | const signed_hex = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .hex); | |
| 290 | try testing.expectEqual(c_uint, @TypeOf(signed_hex)); | |
| 291 | ||
| 292 | if (math.maxInt(c_longlong) == math.maxInt(c_int)) return; | |
| 293 | ||
| 294 | const signed_decimal = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .decimal); | |
| 295 | const unsigned = promoteIntLiteral(c_uint, math.maxInt(c_uint) + 1, .hex); | |
| 296 | ||
| 297 | if (math.maxInt(c_long) > math.maxInt(c_int)) { | |
| 298 | try testing.expectEqual(c_long, @TypeOf(signed_decimal)); | |
| 299 | try testing.expectEqual(c_ulong, @TypeOf(unsigned)); | |
| 300 | } else { | |
| 301 | try testing.expectEqual(c_longlong, @TypeOf(signed_decimal)); | |
| 302 | try testing.expectEqual(c_ulonglong, @TypeOf(unsigned)); | |
| 303 | } | |
| 304 | } | |
| 305 | ||
| 306 | /// Convert from clang __builtin_shufflevector index to Zig @shuffle index | |
| 307 | /// clang requires __builtin_shufflevector index arguments to be integer constants. | |
| 308 | /// negative values for `this_index` indicate "don't care". | |
| 309 | /// clang enforces that `this_index` is less than the total number of vector elements | |
| 310 | /// See https://ziglang.org/documentation/master/#shuffle | |
| 311 | /// See https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-shufflevector | |
| 312 | pub fn shuffleVectorIndex(comptime this_index: c_int, comptime source_vector_len: usize) i32 { | |
| 313 | const positive_index = std.math.cast(usize, this_index) orelse return undefined; | |
| 314 | if (positive_index < source_vector_len) return @as(i32, @intCast(this_index)); | |
| 315 | const b_index = positive_index - source_vector_len; | |
| 316 | return ~@as(i32, @intCast(b_index)); | |
| 317 | } | |
| 318 | ||
| 319 | test "shuffleVectorIndex" { | |
| 320 | const vector_len: usize = 4; | |
| 321 | ||
| 322 | _ = shuffleVectorIndex(-1, vector_len); | |
| 323 | ||
| 324 | try testing.expect(shuffleVectorIndex(0, vector_len) == 0); | |
| 325 | try testing.expect(shuffleVectorIndex(1, vector_len) == 1); | |
| 326 | try testing.expect(shuffleVectorIndex(2, vector_len) == 2); | |
| 327 | try testing.expect(shuffleVectorIndex(3, vector_len) == 3); | |
| 328 | ||
| 329 | try testing.expect(shuffleVectorIndex(4, vector_len) == -1); | |
| 330 | try testing.expect(shuffleVectorIndex(5, vector_len) == -2); | |
| 331 | try testing.expect(shuffleVectorIndex(6, vector_len) == -3); | |
| 332 | try testing.expect(shuffleVectorIndex(7, vector_len) == -4); | |
| 333 | } | |
| 334 | ||
| 335 | /// Constructs a [*c] pointer with the const and volatile annotations | |
| 336 | /// from SelfType for pointing to a C flexible array of ElementType. | |
| 337 | pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type { | |
| 338 | switch (@typeInfo(SelfType)) { | |
| 339 | .pointer => |ptr| { | |
| 340 | return @Type(.{ .pointer = .{ | |
| 341 | .size = .c, | |
| 342 | .is_const = ptr.is_const, | |
| 343 | .is_volatile = ptr.is_volatile, | |
| 344 | .alignment = @alignOf(ElementType), | |
| 345 | .address_space = .generic, | |
| 346 | .child = ElementType, | |
| 347 | .is_allowzero = true, | |
| 348 | .sentinel_ptr = null, | |
| 349 | } }); | |
| 350 | }, | |
| 351 | else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)), | |
| 352 | } | |
| 353 | } | |
| 354 | ||
| 355 | test "Flexible Array Type" { | |
| 356 | const Container = extern struct { | |
| 357 | size: usize, | |
| 358 | }; | |
| 359 | ||
| 360 | try testing.expectEqual(FlexibleArrayType(*Container, c_int), [*c]c_int); | |
| 361 | try testing.expectEqual(FlexibleArrayType(*const Container, c_int), [*c]const c_int); | |
| 362 | try testing.expectEqual(FlexibleArrayType(*volatile Container, c_int), [*c]volatile c_int); | |
| 363 | try testing.expectEqual(FlexibleArrayType(*const volatile Container, c_int), [*c]const volatile c_int); | |
| 364 | } | |
| 365 | ||
| 366 | /// C `%` operator for signed integers | |
| 367 | /// C standard states: "If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a" | |
| 368 | /// The quotient is not representable if denominator is zero, or if numerator is the minimum integer for | |
| 369 | /// the type and denominator is -1. C has undefined behavior for those two cases; this function has safety | |
| 370 | /// checked undefined behavior | |
| 371 | pub fn signedRemainder(numerator: anytype, denominator: anytype) @TypeOf(numerator, denominator) { | |
| 372 | std.debug.assert(@typeInfo(@TypeOf(numerator, denominator)).int.signedness == .signed); | |
| 373 | if (denominator > 0) return @rem(numerator, denominator); | |
| 374 | return numerator - @divTrunc(numerator, denominator) * denominator; | |
| 375 | } | |
| 376 | ||
| 377 | pub const Macros = struct { | |
| 378 | pub fn U_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_uint, n, .decimal)) { | |
| 379 | return promoteIntLiteral(c_uint, n, .decimal); | |
| 380 | } | |
| 381 | ||
| 382 | fn L_SUFFIX_ReturnType(comptime number: anytype) type { | |
| 383 | switch (@typeInfo(@TypeOf(number))) { | |
| 384 | .int, .comptime_int => return @TypeOf(promoteIntLiteral(c_long, number, .decimal)), | |
| 385 | .float, .comptime_float => return c_longdouble, | |
| 386 | else => @compileError("Invalid value for L suffix"), | |
| 387 | } | |
| 388 | } | |
| 389 | pub fn L_SUFFIX(comptime number: anytype) L_SUFFIX_ReturnType(number) { | |
| 390 | switch (@typeInfo(@TypeOf(number))) { | |
| 391 | .int, .comptime_int => return promoteIntLiteral(c_long, number, .decimal), | |
| 392 | .float, .comptime_float => @compileError("TODO: c_longdouble initialization from comptime_float not supported"), | |
| 393 | else => @compileError("Invalid value for L suffix"), | |
| 394 | } | |
| 395 | } | |
| 396 | ||
| 397 | pub fn UL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulong, n, .decimal)) { | |
| 398 | return promoteIntLiteral(c_ulong, n, .decimal); | |
| 399 | } | |
| 400 | ||
| 401 | pub fn LL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_longlong, n, .decimal)) { | |
| 402 | return promoteIntLiteral(c_longlong, n, .decimal); | |
| 403 | } | |
| 404 | ||
| 405 | pub fn ULL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulonglong, n, .decimal)) { | |
| 406 | return promoteIntLiteral(c_ulonglong, n, .decimal); | |
| 407 | } | |
| 408 | ||
| 409 | pub fn F_SUFFIX(comptime f: comptime_float) f32 { | |
| 410 | return @as(f32, f); | |
| 411 | } | |
| 412 | ||
| 413 | pub fn WL_CONTAINER_OF(ptr: anytype, sample: anytype, comptime member: []const u8) @TypeOf(sample) { | |
| 414 | return @fieldParentPtr(member, ptr); | |
| 415 | } | |
| 416 | ||
| 417 | /// A 2-argument function-like macro defined as #define FOO(A, B) (A)(B) | |
| 418 | /// could be either: cast B to A, or call A with the value B. | |
| 419 | pub fn CAST_OR_CALL(a: anytype, b: anytype) switch (@typeInfo(@TypeOf(a))) { | |
| 420 | .type => a, | |
| 421 | .@"fn" => |fn_info| fn_info.return_type orelse void, | |
| 422 | else => |info| @compileError("Unexpected argument type: " ++ @tagName(info)), | |
| 423 | } { | |
| 424 | switch (@typeInfo(@TypeOf(a))) { | |
| 425 | .type => return cast(a, b), | |
| 426 | .@"fn" => return a(b), | |
| 427 | else => unreachable, // return type will be a compile error otherwise | |
| 428 | } | |
| 429 | } | |
| 430 | ||
| 431 | pub inline fn DISCARD(x: anytype) void { | |
| 432 | _ = x; | |
| 433 | } | |
| 434 | }; | |
| 435 | ||
| 436 | /// Integer promotion described in C11 6.3.1.1.2 | |
| 437 | fn PromotedIntType(comptime T: type) type { | |
| 438 | return switch (T) { | |
| 439 | bool, c_short => c_int, | |
| 440 | c_ushort => if (@sizeOf(c_ushort) == @sizeOf(c_int)) c_uint else c_int, | |
| 441 | c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong => T, | |
| 442 | else => switch (@typeInfo(T)) { | |
| 443 | .comptime_int => @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a fixed-size number type is required"), | |
| 444 | // promote to c_int if it can represent all values of T | |
| 445 | .int => |int_info| if (int_info.bits < @bitSizeOf(c_int)) | |
| 446 | c_int | |
| 447 | // otherwise, restore the original C type | |
| 448 | else if (int_info.bits == @bitSizeOf(c_int)) | |
| 449 | if (int_info.signedness == .unsigned) c_uint else c_int | |
| 450 | else if (int_info.bits <= @bitSizeOf(c_long)) | |
| 451 | if (int_info.signedness == .unsigned) c_ulong else c_long | |
| 452 | else if (int_info.bits <= @bitSizeOf(c_longlong)) | |
| 453 | if (int_info.signedness == .unsigned) c_ulonglong else c_longlong | |
| 454 | else | |
| 455 | @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a C ABI type is required"), | |
| 456 | else => @compileError("Attempted to promote invalid type `" ++ @typeName(T) ++ "`"), | |
| 457 | }, | |
| 458 | }; | |
| 459 | } | |
| 460 | ||
| 461 | /// C11 6.3.1.1.1 | |
| 462 | fn integerRank(comptime T: type) u8 { | |
| 463 | return switch (T) { | |
| 464 | bool => 0, | |
| 465 | u8, i8 => 1, | |
| 466 | c_short, c_ushort => 2, | |
| 467 | c_int, c_uint => 3, | |
| 468 | c_long, c_ulong => 4, | |
| 469 | c_longlong, c_ulonglong => 5, | |
| 470 | else => @compileError("integer rank not supported for `" ++ @typeName(T) ++ "`"), | |
| 471 | }; | |
| 472 | } | |
| 473 | ||
| 474 | fn ToUnsigned(comptime T: type) type { | |
| 475 | return switch (T) { | |
| 476 | c_int => c_uint, | |
| 477 | c_long => c_ulong, | |
| 478 | c_longlong => c_ulonglong, | |
| 479 | else => @compileError("Cannot convert `" ++ @typeName(T) ++ "` to unsigned"), | |
| 480 | }; | |
| 481 | } | |
| 482 | ||
| 483 | /// "Usual arithmetic conversions" from C11 standard 6.3.1.8 | |
| 484 | fn ArithmeticConversion(comptime A: type, comptime B: type) type { | |
| 485 | if (A == c_longdouble or B == c_longdouble) return c_longdouble; | |
| 486 | if (A == f80 or B == f80) return f80; | |
| 487 | if (A == f64 or B == f64) return f64; | |
| 488 | if (A == f32 or B == f32) return f32; | |
| 489 | ||
| 490 | const A_Promoted = PromotedIntType(A); | |
| 491 | const B_Promoted = PromotedIntType(B); | |
| 492 | comptime { | |
| 493 | std.debug.assert(integerRank(A_Promoted) >= integerRank(c_int)); | |
| 494 | std.debug.assert(integerRank(B_Promoted) >= integerRank(c_int)); | |
| 495 | } | |
| 496 | ||
| 497 | if (A_Promoted == B_Promoted) return A_Promoted; | |
| 498 | ||
| 499 | const a_signed = @typeInfo(A_Promoted).int.signedness == .signed; | |
| 500 | const b_signed = @typeInfo(B_Promoted).int.signedness == .signed; | |
| 501 | ||
| 502 | if (a_signed == b_signed) { | |
| 503 | return if (integerRank(A_Promoted) > integerRank(B_Promoted)) A_Promoted else B_Promoted; | |
| 504 | } | |
| 505 | ||
| 506 | const SignedType = if (a_signed) A_Promoted else B_Promoted; | |
| 507 | const UnsignedType = if (!a_signed) A_Promoted else B_Promoted; | |
| 508 | ||
| 509 | if (integerRank(UnsignedType) >= integerRank(SignedType)) return UnsignedType; | |
| 510 | ||
| 511 | if (std.math.maxInt(SignedType) >= std.math.maxInt(UnsignedType)) return SignedType; | |
| 512 | ||
| 513 | return ToUnsigned(SignedType); | |
| 514 | } | |
| 515 | ||
| 516 | test "ArithmeticConversion" { | |
| 517 | // Promotions not necessarily the same for other platforms | |
| 518 | if (builtin.target.cpu.arch != .x86_64 or builtin.target.os.tag != .linux) return error.SkipZigTest; | |
| 519 | ||
| 520 | const Test = struct { | |
| 521 | /// Order of operands should not matter for arithmetic conversions | |
| 522 | fn checkPromotion(comptime A: type, comptime B: type, comptime Expected: type) !void { | |
| 523 | try std.testing.expect(ArithmeticConversion(A, B) == Expected); | |
| 524 | try std.testing.expect(ArithmeticConversion(B, A) == Expected); | |
| 525 | } | |
| 526 | }; | |
| 527 | ||
| 528 | try Test.checkPromotion(c_longdouble, c_int, c_longdouble); | |
| 529 | try Test.checkPromotion(c_int, f64, f64); | |
| 530 | try Test.checkPromotion(f32, bool, f32); | |
| 531 | ||
| 532 | try Test.checkPromotion(bool, c_short, c_int); | |
| 533 | try Test.checkPromotion(c_int, c_int, c_int); | |
| 534 | try Test.checkPromotion(c_short, c_int, c_int); | |
| 535 | ||
| 536 | try Test.checkPromotion(c_int, c_long, c_long); | |
| 537 | ||
| 538 | try Test.checkPromotion(c_ulonglong, c_uint, c_ulonglong); | |
| 539 | ||
| 540 | try Test.checkPromotion(c_uint, c_int, c_uint); | |
| 541 | ||
| 542 | try Test.checkPromotion(c_uint, c_long, c_long); | |
| 543 | ||
| 544 | try Test.checkPromotion(c_ulong, c_longlong, c_ulonglong); | |
| 545 | ||
| 546 | // stdint.h | |
| 547 | try Test.checkPromotion(u8, i8, c_int); | |
| 548 | try Test.checkPromotion(u16, i16, c_int); | |
| 549 | try Test.checkPromotion(i32, c_int, c_int); | |
| 550 | try Test.checkPromotion(u32, c_int, c_uint); | |
| 551 | try Test.checkPromotion(i64, c_int, c_long); | |
| 552 | try Test.checkPromotion(u64, c_int, c_ulong); | |
| 553 | try Test.checkPromotion(isize, c_int, c_long); | |
| 554 | try Test.checkPromotion(usize, c_int, c_ulong); | |
| 555 | } | |
| 556 | ||
| 557 | pub const MacroArithmetic = struct { | |
| 558 | pub fn div(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { | |
| 559 | const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); | |
| 560 | const a_casted = cast(ResType, a); | |
| 561 | const b_casted = cast(ResType, b); | |
| 562 | switch (@typeInfo(ResType)) { | |
| 563 | .float => return a_casted / b_casted, | |
| 564 | .int => return @divTrunc(a_casted, b_casted), | |
| 565 | else => unreachable, | |
| 566 | } | |
| 567 | } | |
| 568 | ||
| 569 | pub fn rem(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { | |
| 570 | const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); | |
| 571 | const a_casted = cast(ResType, a); | |
| 572 | const b_casted = cast(ResType, b); | |
| 573 | switch (@typeInfo(ResType)) { | |
| 574 | .int => { | |
| 575 | if (@typeInfo(ResType).int.signedness == .signed) { | |
| 576 | return signedRemainder(a_casted, b_casted); | |
| 577 | } else { | |
| 578 | return a_casted % b_casted; | |
| 579 | } | |
| 580 | }, | |
| 581 | else => unreachable, | |
| 582 | } | |
| 583 | } | |
| 584 | }; | |
| 585 | ||
| 586 | test "Macro suffix functions" { | |
| 587 | try testing.expect(@TypeOf(Macros.F_SUFFIX(1)) == f32); | |
| 588 | ||
| 589 | try testing.expect(@TypeOf(Macros.U_SUFFIX(1)) == c_uint); | |
| 590 | if (math.maxInt(c_ulong) > math.maxInt(c_uint)) { | |
| 591 | try testing.expect(@TypeOf(Macros.U_SUFFIX(math.maxInt(c_uint) + 1)) == c_ulong); | |
| 592 | } | |
| 593 | if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { | |
| 594 | try testing.expect(@TypeOf(Macros.U_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); | |
| 595 | } | |
| 596 | ||
| 597 | try testing.expect(@TypeOf(Macros.L_SUFFIX(1)) == c_long); | |
| 598 | if (math.maxInt(c_long) > math.maxInt(c_int)) { | |
| 599 | try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_int) + 1)) == c_long); | |
| 600 | } | |
| 601 | if (math.maxInt(c_longlong) > math.maxInt(c_long)) { | |
| 602 | try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); | |
| 603 | } | |
| 604 | ||
| 605 | try testing.expect(@TypeOf(Macros.UL_SUFFIX(1)) == c_ulong); | |
| 606 | if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { | |
| 607 | try testing.expect(@TypeOf(Macros.UL_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); | |
| 608 | } | |
| 609 | ||
| 610 | try testing.expect(@TypeOf(Macros.LL_SUFFIX(1)) == c_longlong); | |
| 611 | try testing.expect(@TypeOf(Macros.ULL_SUFFIX(1)) == c_ulonglong); | |
| 612 | } | |
| 613 | ||
| 614 | test "WL_CONTAINER_OF" { | |
| 615 | const S = struct { | |
| 616 | a: u32 = 0, | |
| 617 | b: u32 = 0, | |
| 618 | }; | |
| 619 | const x = S{}; | |
| 620 | const y = S{}; | |
| 621 | const ptr = Macros.WL_CONTAINER_OF(&x.b, &y, "b"); | |
| 622 | try testing.expectEqual(&x, ptr); | |
| 623 | } | |
| 624 | ||
| 625 | test "CAST_OR_CALL casting" { | |
| 626 | const arg: c_int = 1000; | |
| 627 | const casted = Macros.CAST_OR_CALL(u8, arg); | |
| 628 | try testing.expectEqual(cast(u8, arg), casted); | |
| 629 | ||
| 630 | const S = struct { | |
| 631 | x: u32 = 0, | |
| 632 | }; | |
| 633 | var s: S = .{}; | |
| 634 | const casted_ptr = Macros.CAST_OR_CALL(*u8, &s); | |
| 635 | try testing.expectEqual(cast(*u8, &s), casted_ptr); | |
| 636 | } | |
| 637 | ||
| 638 | test "CAST_OR_CALL calling" { | |
| 639 | const Helper = struct { | |
| 640 | var last_val: bool = false; | |
| 641 | fn returnsVoid(val: bool) void { | |
| 642 | last_val = val; | |
| 643 | } | |
| 644 | fn returnsBool(f: f32) bool { | |
| 645 | return f > 0; | |
| 646 | } | |
| 647 | fn identity(self: c_uint) c_uint { | |
| 648 | return self; | |
| 649 | } | |
| 650 | }; | |
| 651 | ||
| 652 | Macros.CAST_OR_CALL(Helper.returnsVoid, true); | |
| 653 | try testing.expectEqual(true, Helper.last_val); | |
| 654 | Macros.CAST_OR_CALL(Helper.returnsVoid, false); | |
| 655 | try testing.expectEqual(false, Helper.last_val); | |
| 656 | ||
| 657 | try testing.expectEqual(Helper.returnsBool(1), Macros.CAST_OR_CALL(Helper.returnsBool, @as(f32, 1))); | |
| 658 | try testing.expectEqual(Helper.returnsBool(-1), Macros.CAST_OR_CALL(Helper.returnsBool, @as(f32, -1))); | |
| 659 | ||
| 660 | try testing.expectEqual(Helper.identity(@as(c_uint, 100)), Macros.CAST_OR_CALL(Helper.identity, @as(c_uint, 100))); | |
| 661 | } | |
| 662 | ||
| 663 | test "Extended C ABI casting" { | |
| 664 | if (math.maxInt(c_long) > math.maxInt(c_char)) { | |
| 665 | try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_char, math.maxInt(c_char) - 1))) == c_long); // c_char | |
| 666 | } | |
| 667 | if (math.maxInt(c_long) > math.maxInt(c_short)) { | |
| 668 | try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_short, math.maxInt(c_short) - 1))) == c_long); // c_short | |
| 669 | } | |
| 670 | ||
| 671 | if (math.maxInt(c_long) > math.maxInt(c_ushort)) { | |
| 672 | try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_ushort, math.maxInt(c_ushort) - 1))) == c_long); //c_ushort | |
| 673 | } | |
| 674 | ||
| 675 | if (math.maxInt(c_long) > math.maxInt(c_int)) { | |
| 676 | try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_int, math.maxInt(c_int) - 1))) == c_long); // c_int | |
| 677 | } | |
| 678 | ||
| 679 | if (math.maxInt(c_long) > math.maxInt(c_uint)) { | |
| 680 | try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_uint, math.maxInt(c_uint) - 1))) == c_long); // c_uint | |
| 681 | try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_uint) + 1)) == c_long); // comptime_int -> c_long | |
| 682 | } | |
| 683 | ||
| 684 | if (math.maxInt(c_longlong) > math.maxInt(c_long)) { | |
| 685 | try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_long, math.maxInt(c_long) - 1))) == c_long); // c_long | |
| 686 | try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); // comptime_int -> c_longlong | |
| 687 | } | |
| 688 | } | |
| 689 | ||
| 690 | // Function with complex signature for testing the SDL case | |
| 691 | fn complexFunction(_: ?*anyopaque, _: c_uint, _: ?*const fn (?*anyopaque) callconv(.c) c_uint, _: ?*anyopaque, _: c_uint, _: [*c]c_uint) callconv(.c) usize { | |
| 692 | return 0; | |
| 693 | } | |
| 694 | ||
| 695 | test "function pointer casting" { | |
| 696 | const SDL_FunctionPointer = ?*const fn () callconv(.c) void; | |
| 697 | const fn_ptr = cast(SDL_FunctionPointer, complexFunction); | |
| 698 | try testing.expect(fn_ptr != null); | |
| 699 | } |
lib/std/zig/c_translation/builtins.zig created+301| ... | ... | @@ -0,0 +1,301 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | /// Standard C Library bug: The absolute value of the most negative integer remains negative. | |
| 4 | pub inline fn abs(val: c_int) c_int { | |
| 5 | return if (val == std.math.minInt(c_int)) val else @intCast(@abs(val)); | |
| 6 | } | |
| 7 | ||
| 8 | pub inline fn assume(cond: bool) void { | |
| 9 | if (!cond) unreachable; | |
| 10 | } | |
| 11 | ||
| 12 | pub inline fn bswap16(val: u16) u16 { | |
| 13 | return @byteSwap(val); | |
| 14 | } | |
| 15 | ||
| 16 | pub inline fn bswap32(val: u32) u32 { | |
| 17 | return @byteSwap(val); | |
| 18 | } | |
| 19 | ||
| 20 | pub inline fn bswap64(val: u64) u64 { | |
| 21 | return @byteSwap(val); | |
| 22 | } | |
| 23 | ||
| 24 | pub inline fn ceilf(val: f32) f32 { | |
| 25 | return @ceil(val); | |
| 26 | } | |
| 27 | ||
| 28 | pub inline fn ceil(val: f64) f64 { | |
| 29 | return @ceil(val); | |
| 30 | } | |
| 31 | ||
| 32 | /// Returns the number of leading 0-bits in x, starting at the most significant bit position. | |
| 33 | /// In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint | |
| 34 | pub inline fn clz(val: c_uint) c_int { | |
| 35 | @setRuntimeSafety(false); | |
| 36 | return @as(c_int, @bitCast(@as(c_uint, @clz(val)))); | |
| 37 | } | |
| 38 | ||
| 39 | pub inline fn constant_p(expr: anytype) c_int { | |
| 40 | _ = expr; | |
| 41 | return @intFromBool(false); | |
| 42 | } | |
| 43 | ||
| 44 | pub inline fn cosf(val: f32) f32 { | |
| 45 | return @cos(val); | |
| 46 | } | |
| 47 | ||
| 48 | pub inline fn cos(val: f64) f64 { | |
| 49 | return @cos(val); | |
| 50 | } | |
| 51 | ||
| 52 | /// Returns the number of trailing 0-bits in val, starting at the least significant bit position. | |
| 53 | /// In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint | |
| 54 | pub inline fn ctz(val: c_uint) c_int { | |
| 55 | @setRuntimeSafety(false); | |
| 56 | return @as(c_int, @bitCast(@as(c_uint, @ctz(val)))); | |
| 57 | } | |
| 58 | ||
| 59 | pub inline fn exp2f(val: f32) f32 { | |
| 60 | return @exp2(val); | |
| 61 | } | |
| 62 | ||
| 63 | pub inline fn exp2(val: f64) f64 { | |
| 64 | return @exp2(val); | |
| 65 | } | |
| 66 | ||
| 67 | pub inline fn expf(val: f32) f32 { | |
| 68 | return @exp(val); | |
| 69 | } | |
| 70 | ||
| 71 | pub inline fn exp(val: f64) f64 { | |
| 72 | return @exp(val); | |
| 73 | } | |
| 74 | ||
| 75 | /// The return value of __builtin_expect is `expr`. `c` is the expected value | |
| 76 | /// of `expr` and is used as a hint to the compiler in C. Here it is unused. | |
| 77 | pub inline fn expect(expr: c_long, c: c_long) c_long { | |
| 78 | _ = c; | |
| 79 | return expr; | |
| 80 | } | |
| 81 | ||
| 82 | pub inline fn fabsf(val: f32) f32 { | |
| 83 | return @abs(val); | |
| 84 | } | |
| 85 | ||
| 86 | pub inline fn fabs(val: f64) f64 { | |
| 87 | return @abs(val); | |
| 88 | } | |
| 89 | ||
| 90 | pub inline fn floorf(val: f32) f32 { | |
| 91 | return @floor(val); | |
| 92 | } | |
| 93 | ||
| 94 | pub inline fn floor(val: f64) f64 { | |
| 95 | return @floor(val); | |
| 96 | } | |
| 97 | ||
| 98 | pub inline fn has_builtin(func: anytype) c_int { | |
| 99 | _ = func; | |
| 100 | return @intFromBool(true); | |
| 101 | } | |
| 102 | ||
| 103 | pub inline fn huge_valf() f32 { | |
| 104 | return std.math.inf(f32); | |
| 105 | } | |
| 106 | ||
| 107 | pub inline fn inff() f32 { | |
| 108 | return std.math.inf(f32); | |
| 109 | } | |
| 110 | ||
| 111 | /// Similar to isinf, except the return value is -1 for an argument of -Inf and 1 for an argument of +Inf. | |
| 112 | pub inline fn isinf_sign(x: anytype) c_int { | |
| 113 | if (!std.math.isInf(x)) return 0; | |
| 114 | return if (std.math.isPositiveInf(x)) 1 else -1; | |
| 115 | } | |
| 116 | ||
| 117 | pub inline fn isinf(x: anytype) c_int { | |
| 118 | return @intFromBool(std.math.isInf(x)); | |
| 119 | } | |
| 120 | ||
| 121 | pub inline fn isnan(x: anytype) c_int { | |
| 122 | return @intFromBool(std.math.isNan(x)); | |
| 123 | } | |
| 124 | ||
| 125 | /// Standard C Library bug: The absolute value of the most negative integer remains negative. | |
| 126 | pub inline fn labs(val: c_long) c_long { | |
| 127 | return if (val == std.math.minInt(c_long)) val else @intCast(@abs(val)); | |
| 128 | } | |
| 129 | ||
| 130 | /// Standard C Library bug: The absolute value of the most negative integer remains negative. | |
| 131 | pub inline fn llabs(val: c_longlong) c_longlong { | |
| 132 | return if (val == std.math.minInt(c_longlong)) val else @intCast(@abs(val)); | |
| 133 | } | |
| 134 | ||
| 135 | pub inline fn log10f(val: f32) f32 { | |
| 136 | return @log10(val); | |
| 137 | } | |
| 138 | ||
| 139 | pub inline fn log10(val: f64) f64 { | |
| 140 | return @log10(val); | |
| 141 | } | |
| 142 | ||
| 143 | pub inline fn log2f(val: f32) f32 { | |
| 144 | return @log2(val); | |
| 145 | } | |
| 146 | ||
| 147 | pub inline fn log2(val: f64) f64 { | |
| 148 | return @log2(val); | |
| 149 | } | |
| 150 | ||
| 151 | pub inline fn logf(val: f32) f32 { | |
| 152 | return @log(val); | |
| 153 | } | |
| 154 | ||
| 155 | pub inline fn log(val: f64) f64 { | |
| 156 | return @log(val); | |
| 157 | } | |
| 158 | ||
| 159 | pub inline fn memcpy_chk( | |
| 160 | noalias dst: ?*anyopaque, | |
| 161 | noalias src: ?*const anyopaque, | |
| 162 | len: usize, | |
| 163 | remaining: usize, | |
| 164 | ) ?*anyopaque { | |
| 165 | if (len > remaining) @panic("__builtin___memcpy_chk called with len > remaining"); | |
| 166 | if (len > 0) @memcpy( | |
| 167 | @as([*]u8, @ptrCast(dst.?))[0..len], | |
| 168 | @as([*]const u8, @ptrCast(src.?)), | |
| 169 | ); | |
| 170 | return dst; | |
| 171 | } | |
| 172 | ||
| 173 | pub inline fn memcpy( | |
| 174 | noalias dst: ?*anyopaque, | |
| 175 | noalias src: ?*const anyopaque, | |
| 176 | len: usize, | |
| 177 | ) ?*anyopaque { | |
| 178 | if (len > 0) @memcpy( | |
| 179 | @as([*]u8, @ptrCast(dst.?))[0..len], | |
| 180 | @as([*]const u8, @ptrCast(src.?)), | |
| 181 | ); | |
| 182 | return dst; | |
| 183 | } | |
| 184 | ||
| 185 | pub inline fn memset_chk( | |
| 186 | dst: ?*anyopaque, | |
| 187 | val: c_int, | |
| 188 | len: usize, | |
| 189 | remaining: usize, | |
| 190 | ) ?*anyopaque { | |
| 191 | if (len > remaining) @panic("__builtin___memset_chk called with len > remaining"); | |
| 192 | const dst_cast = @as([*c]u8, @ptrCast(dst)); | |
| 193 | @memset(dst_cast[0..len], @as(u8, @bitCast(@as(i8, @truncate(val))))); | |
| 194 | return dst; | |
| 195 | } | |
| 196 | ||
| 197 | pub inline fn memset(dst: ?*anyopaque, val: c_int, len: usize) ?*anyopaque { | |
| 198 | const dst_cast = @as([*c]u8, @ptrCast(dst)); | |
| 199 | @memset(dst_cast[0..len], @as(u8, @bitCast(@as(i8, @truncate(val))))); | |
| 200 | return dst; | |
| 201 | } | |
| 202 | ||
| 203 | pub fn mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_int { | |
| 204 | const res = @mulWithOverflow(a, b); | |
| 205 | result.* = res[0]; | |
| 206 | return res[1]; | |
| 207 | } | |
| 208 | ||
| 209 | /// returns a quiet NaN. Quiet NaNs have many representations; tagp is used to select one in an | |
| 210 | /// implementation-defined way. | |
| 211 | /// This implementation is based on the description for nan provided in the GCC docs at | |
| 212 | /// https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fnan | |
| 213 | /// Comment is reproduced below: | |
| 214 | /// Since ISO C99 defines this function in terms of strtod, which we do not implement, a description | |
| 215 | /// of the parsing is in order. | |
| 216 | /// The string is parsed as by strtol; that is, the base is recognized by leading ‘0’ or ‘0x’ prefixes. | |
| 217 | /// The number parsed is placed in the significand such that the least significant bit of the number is | |
| 218 | /// at the least significant bit of the significand. | |
| 219 | /// The number is truncated to fit the significand field provided. | |
| 220 | /// The significand is forced to be a quiet NaN. | |
| 221 | /// | |
| 222 | /// If tagp contains any non-numeric characters, the function returns a NaN whose significand is zero. | |
| 223 | /// If tagp is empty, the function returns a NaN whose significand is zero. | |
| 224 | pub inline fn nanf(tagp: []const u8) f32 { | |
| 225 | const parsed = std.fmt.parseUnsigned(c_ulong, tagp, 0) catch 0; | |
| 226 | const bits: u23 = @truncate(parsed); // single-precision float trailing significand is 23 bits | |
| 227 | return @bitCast(@as(u32, bits) | @as(u32, @bitCast(std.math.nan(f32)))); | |
| 228 | } | |
| 229 | ||
| 230 | pub inline fn object_size(ptr: ?*const anyopaque, ty: c_int) usize { | |
| 231 | _ = ptr; | |
| 232 | // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html | |
| 233 | // If it is not possible to determine which objects ptr points to at compile time, | |
| 234 | // object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0 | |
| 235 | // for type 2 or 3. | |
| 236 | if (ty == 0 or ty == 1) return @as(usize, @bitCast(-@as(isize, 1))); | |
| 237 | if (ty == 2 or ty == 3) return 0; | |
| 238 | unreachable; | |
| 239 | } | |
| 240 | ||
| 241 | /// popcount of a c_uint will never exceed the capacity of a c_int | |
| 242 | pub inline fn popcount(val: c_uint) c_int { | |
| 243 | @setRuntimeSafety(false); | |
| 244 | return @as(c_int, @bitCast(@as(c_uint, @popCount(val)))); | |
| 245 | } | |
| 246 | ||
| 247 | pub inline fn roundf(val: f32) f32 { | |
| 248 | return @round(val); | |
| 249 | } | |
| 250 | ||
| 251 | pub inline fn round(val: f64) f64 { | |
| 252 | return @round(val); | |
| 253 | } | |
| 254 | ||
| 255 | pub inline fn signbitf(val: f32) c_int { | |
| 256 | return @intFromBool(std.math.signbit(val)); | |
| 257 | } | |
| 258 | ||
| 259 | pub inline fn signbit(val: f64) c_int { | |
| 260 | return @intFromBool(std.math.signbit(val)); | |
| 261 | } | |
| 262 | ||
| 263 | pub inline fn sinf(val: f32) f32 { | |
| 264 | return @sin(val); | |
| 265 | } | |
| 266 | ||
| 267 | pub inline fn sin(val: f64) f64 { | |
| 268 | return @sin(val); | |
| 269 | } | |
| 270 | ||
| 271 | pub inline fn sqrtf(val: f32) f32 { | |
| 272 | return @sqrt(val); | |
| 273 | } | |
| 274 | ||
| 275 | pub inline fn sqrt(val: f64) f64 { | |
| 276 | return @sqrt(val); | |
| 277 | } | |
| 278 | ||
| 279 | pub inline fn strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { | |
| 280 | return switch (std.mem.orderZ(u8, s1, s2)) { | |
| 281 | .lt => -1, | |
| 282 | .eq => 0, | |
| 283 | .gt => 1, | |
| 284 | }; | |
| 285 | } | |
| 286 | ||
| 287 | pub inline fn strlen(s: [*c]const u8) usize { | |
| 288 | return std.mem.sliceTo(s, 0).len; | |
| 289 | } | |
| 290 | ||
| 291 | pub inline fn truncf(val: f32) f32 { | |
| 292 | return @trunc(val); | |
| 293 | } | |
| 294 | ||
| 295 | pub inline fn trunc(val: f64) f64 { | |
| 296 | return @trunc(val); | |
| 297 | } | |
| 298 | ||
| 299 | pub inline fn @"unreachable"() noreturn { | |
| 300 | unreachable; | |
| 301 | } |
lib/std/zig/c_translation/helpers.zig created+413| ... | ... | @@ -0,0 +1,413 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | /// "Usual arithmetic conversions" from C11 standard 6.3.1.8 | |
| 4 | pub fn ArithmeticConversion(comptime A: type, comptime B: type) type { | |
| 5 | if (A == c_longdouble or B == c_longdouble) return c_longdouble; | |
| 6 | if (A == f80 or B == f80) return f80; | |
| 7 | if (A == f64 or B == f64) return f64; | |
| 8 | if (A == f32 or B == f32) return f32; | |
| 9 | ||
| 10 | const A_Promoted = PromotedIntType(A); | |
| 11 | const B_Promoted = PromotedIntType(B); | |
| 12 | comptime { | |
| 13 | std.debug.assert(integerRank(A_Promoted) >= integerRank(c_int)); | |
| 14 | std.debug.assert(integerRank(B_Promoted) >= integerRank(c_int)); | |
| 15 | } | |
| 16 | ||
| 17 | if (A_Promoted == B_Promoted) return A_Promoted; | |
| 18 | ||
| 19 | const a_signed = @typeInfo(A_Promoted).int.signedness == .signed; | |
| 20 | const b_signed = @typeInfo(B_Promoted).int.signedness == .signed; | |
| 21 | ||
| 22 | if (a_signed == b_signed) { | |
| 23 | return if (integerRank(A_Promoted) > integerRank(B_Promoted)) A_Promoted else B_Promoted; | |
| 24 | } | |
| 25 | ||
| 26 | const SignedType = if (a_signed) A_Promoted else B_Promoted; | |
| 27 | const UnsignedType = if (!a_signed) A_Promoted else B_Promoted; | |
| 28 | ||
| 29 | if (integerRank(UnsignedType) >= integerRank(SignedType)) return UnsignedType; | |
| 30 | ||
| 31 | if (std.math.maxInt(SignedType) >= std.math.maxInt(UnsignedType)) return SignedType; | |
| 32 | ||
| 33 | return ToUnsigned(SignedType); | |
| 34 | } | |
| 35 | ||
| 36 | /// Integer promotion described in C11 6.3.1.1.2 | |
| 37 | fn PromotedIntType(comptime T: type) type { | |
| 38 | return switch (T) { | |
| 39 | bool, c_short => c_int, | |
| 40 | c_ushort => if (@sizeOf(c_ushort) == @sizeOf(c_int)) c_uint else c_int, | |
| 41 | c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong => T, | |
| 42 | else => switch (@typeInfo(T)) { | |
| 43 | .comptime_int => @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a fixed-size number type is required"), | |
| 44 | // promote to c_int if it can represent all values of T | |
| 45 | .int => |int_info| if (int_info.bits < @bitSizeOf(c_int)) | |
| 46 | c_int | |
| 47 | // otherwise, restore the original C type | |
| 48 | else if (int_info.bits == @bitSizeOf(c_int)) | |
| 49 | if (int_info.signedness == .unsigned) c_uint else c_int | |
| 50 | else if (int_info.bits <= @bitSizeOf(c_long)) | |
| 51 | if (int_info.signedness == .unsigned) c_ulong else c_long | |
| 52 | else if (int_info.bits <= @bitSizeOf(c_longlong)) | |
| 53 | if (int_info.signedness == .unsigned) c_ulonglong else c_longlong | |
| 54 | else | |
| 55 | @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a C ABI type is required"), | |
| 56 | else => @compileError("Attempted to promote invalid type `" ++ @typeName(T) ++ "`"), | |
| 57 | }, | |
| 58 | }; | |
| 59 | } | |
| 60 | ||
| 61 | /// C11 6.3.1.1.1 | |
| 62 | fn integerRank(comptime T: type) u8 { | |
| 63 | return switch (T) { | |
| 64 | bool => 0, | |
| 65 | u8, i8 => 1, | |
| 66 | c_short, c_ushort => 2, | |
| 67 | c_int, c_uint => 3, | |
| 68 | c_long, c_ulong => 4, | |
| 69 | c_longlong, c_ulonglong => 5, | |
| 70 | else => @compileError("integer rank not supported for `" ++ @typeName(T) ++ "`"), | |
| 71 | }; | |
| 72 | } | |
| 73 | ||
| 74 | fn ToUnsigned(comptime T: type) type { | |
| 75 | return switch (T) { | |
| 76 | c_int => c_uint, | |
| 77 | c_long => c_ulong, | |
| 78 | c_longlong => c_ulonglong, | |
| 79 | else => @compileError("Cannot convert `" ++ @typeName(T) ++ "` to unsigned"), | |
| 80 | }; | |
| 81 | } | |
| 82 | ||
| 83 | /// Constructs a [*c] pointer with the const and volatile annotations | |
| 84 | /// from SelfType for pointing to a C flexible array of ElementType. | |
| 85 | pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type { | |
| 86 | switch (@typeInfo(SelfType)) { | |
| 87 | .pointer => |ptr| { | |
| 88 | return @Type(.{ .pointer = .{ | |
| 89 | .size = .c, | |
| 90 | .is_const = ptr.is_const, | |
| 91 | .is_volatile = ptr.is_volatile, | |
| 92 | .alignment = @alignOf(ElementType), | |
| 93 | .address_space = .generic, | |
| 94 | .child = ElementType, | |
| 95 | .is_allowzero = true, | |
| 96 | .sentinel_ptr = null, | |
| 97 | } }); | |
| 98 | }, | |
| 99 | else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)), | |
| 100 | } | |
| 101 | } | |
| 102 | ||
| 103 | /// Promote the type of an integer literal until it fits as C would. | |
| 104 | pub fn promoteIntLiteral( | |
| 105 | comptime SuffixType: type, | |
| 106 | comptime number: comptime_int, | |
| 107 | comptime base: CIntLiteralBase, | |
| 108 | ) PromoteIntLiteralReturnType(SuffixType, number, base) { | |
| 109 | return number; | |
| 110 | } | |
| 111 | ||
| 112 | const CIntLiteralBase = enum { decimal, octal, hex }; | |
| 113 | ||
| 114 | fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type { | |
| 115 | const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong }; | |
| 116 | const signed_oct_hex = [_]type{ c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong }; | |
| 117 | const unsigned = [_]type{ c_uint, c_ulong, c_ulonglong }; | |
| 118 | ||
| 119 | const list: []const type = if (@typeInfo(SuffixType).int.signedness == .unsigned) | |
| 120 | &unsigned | |
| 121 | else if (base == .decimal) | |
| 122 | &signed_decimal | |
| 123 | else | |
| 124 | &signed_oct_hex; | |
| 125 | ||
| 126 | var pos = std.mem.indexOfScalar(type, list, SuffixType).?; | |
| 127 | while (pos < list.len) : (pos += 1) { | |
| 128 | if (number >= std.math.minInt(list[pos]) and number <= std.math.maxInt(list[pos])) { | |
| 129 | return list[pos]; | |
| 130 | } | |
| 131 | } | |
| 132 | ||
| 133 | @compileError("Integer literal is too large"); | |
| 134 | } | |
| 135 | ||
| 136 | /// Convert from clang __builtin_shufflevector index to Zig @shuffle index | |
| 137 | /// clang requires __builtin_shufflevector index arguments to be integer constants. | |
| 138 | /// negative values for `this_index` indicate "don't care". | |
| 139 | /// clang enforces that `this_index` is less than the total number of vector elements | |
| 140 | /// See https://ziglang.org/documentation/master/#shuffle | |
| 141 | /// See https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-shufflevector | |
| 142 | pub fn shuffleVectorIndex(comptime this_index: c_int, comptime source_vector_len: usize) i32 { | |
| 143 | const positive_index = std.math.cast(usize, this_index) orelse return undefined; | |
| 144 | if (positive_index < source_vector_len) return @as(i32, @intCast(this_index)); | |
| 145 | const b_index = positive_index - source_vector_len; | |
| 146 | return ~@as(i32, @intCast(b_index)); | |
| 147 | } | |
| 148 | ||
| 149 | /// C `%` operator for signed integers | |
| 150 | /// C standard states: "If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a" | |
| 151 | /// The quotient is not representable if denominator is zero, or if numerator is the minimum integer for | |
| 152 | /// the type and denominator is -1. C has undefined behavior for those two cases; this function has safety | |
| 153 | /// checked undefined behavior | |
| 154 | pub fn signedRemainder(numerator: anytype, denominator: anytype) @TypeOf(numerator, denominator) { | |
| 155 | std.debug.assert(@typeInfo(@TypeOf(numerator, denominator)).int.signedness == .signed); | |
| 156 | if (denominator > 0) return @rem(numerator, denominator); | |
| 157 | return numerator - @divTrunc(numerator, denominator) * denominator; | |
| 158 | } | |
| 159 | ||
| 160 | /// Given a type and value, cast the value to the type as c would. | |
| 161 | pub fn cast(comptime DestType: type, target: anytype) DestType { | |
| 162 | // this function should behave like transCCast in translate-c, except it's for macros | |
| 163 | const SourceType = @TypeOf(target); | |
| 164 | switch (@typeInfo(DestType)) { | |
| 165 | .@"fn" => return castToPtr(*const DestType, SourceType, target), | |
| 166 | .pointer => return castToPtr(DestType, SourceType, target), | |
| 167 | .optional => |dest_opt| { | |
| 168 | if (@typeInfo(dest_opt.child) == .pointer) { | |
| 169 | return castToPtr(DestType, SourceType, target); | |
| 170 | } else if (@typeInfo(dest_opt.child) == .@"fn") { | |
| 171 | return castToPtr(?*const dest_opt.child, SourceType, target); | |
| 172 | } | |
| 173 | }, | |
| 174 | .int => { | |
| 175 | switch (@typeInfo(SourceType)) { | |
| 176 | .pointer => { | |
| 177 | return castInt(DestType, @intFromPtr(target)); | |
| 178 | }, | |
| 179 | .optional => |opt| { | |
| 180 | if (@typeInfo(opt.child) == .pointer) { | |
| 181 | return castInt(DestType, @intFromPtr(target)); | |
| 182 | } | |
| 183 | }, | |
| 184 | .int => { | |
| 185 | return castInt(DestType, target); | |
| 186 | }, | |
| 187 | .@"fn" => { | |
| 188 | return castInt(DestType, @intFromPtr(&target)); | |
| 189 | }, | |
| 190 | .bool => { | |
| 191 | return @intFromBool(target); | |
| 192 | }, | |
| 193 | else => {}, | |
| 194 | } | |
| 195 | }, | |
| 196 | .float => { | |
| 197 | switch (@typeInfo(SourceType)) { | |
| 198 | .int => return @as(DestType, @floatFromInt(target)), | |
| 199 | .float => return @as(DestType, @floatCast(target)), | |
| 200 | .bool => return @as(DestType, @floatFromInt(@intFromBool(target))), | |
| 201 | else => {}, | |
| 202 | } | |
| 203 | }, | |
| 204 | .@"union" => |info| { | |
| 205 | inline for (info.fields) |field| { | |
| 206 | if (field.type == SourceType) return @unionInit(DestType, field.name, target); | |
| 207 | } | |
| 208 | ||
| 209 | @compileError("cast to union type '" ++ @typeName(DestType) ++ "' from type '" ++ @typeName(SourceType) ++ "' which is not present in union"); | |
| 210 | }, | |
| 211 | .bool => return cast(usize, target) != 0, | |
| 212 | else => {}, | |
| 213 | } | |
| 214 | ||
| 215 | return @as(DestType, target); | |
| 216 | } | |
| 217 | ||
| 218 | fn castInt(comptime DestType: type, target: anytype) DestType { | |
| 219 | const dest = @typeInfo(DestType).int; | |
| 220 | const source = @typeInfo(@TypeOf(target)).int; | |
| 221 | ||
| 222 | const Int = @Type(.{ .int = .{ .bits = dest.bits, .signedness = source.signedness } }); | |
| 223 | ||
| 224 | if (dest.bits < source.bits) | |
| 225 | return @as(DestType, @bitCast(@as(Int, @truncate(target)))) | |
| 226 | else | |
| 227 | return @as(DestType, @bitCast(@as(Int, target))); | |
| 228 | } | |
| 229 | ||
| 230 | fn castPtr(comptime DestType: type, target: anytype) DestType { | |
| 231 | return @ptrCast(@alignCast(@constCast(@volatileCast(target)))); | |
| 232 | } | |
| 233 | ||
| 234 | fn castToPtr(comptime DestType: type, comptime SourceType: type, target: anytype) DestType { | |
| 235 | switch (@typeInfo(SourceType)) { | |
| 236 | .int => { | |
| 237 | return @as(DestType, @ptrFromInt(castInt(usize, target))); | |
| 238 | }, | |
| 239 | .comptime_int => { | |
| 240 | if (target < 0) | |
| 241 | return @as(DestType, @ptrFromInt(@as(usize, @bitCast(@as(isize, @intCast(target)))))) | |
| 242 | else | |
| 243 | return @as(DestType, @ptrFromInt(@as(usize, @intCast(target)))); | |
| 244 | }, | |
| 245 | .pointer => { | |
| 246 | return castPtr(DestType, target); | |
| 247 | }, | |
| 248 | .@"fn" => { | |
| 249 | return castPtr(DestType, &target); | |
| 250 | }, | |
| 251 | .optional => |target_opt| { | |
| 252 | if (@typeInfo(target_opt.child) == .pointer) { | |
| 253 | return castPtr(DestType, target); | |
| 254 | } | |
| 255 | }, | |
| 256 | else => {}, | |
| 257 | } | |
| 258 | ||
| 259 | return @as(DestType, target); | |
| 260 | } | |
| 261 | ||
| 262 | /// Given a value returns its size as C's sizeof operator would. | |
| 263 | pub fn sizeof(target: anytype) usize { | |
| 264 | const T: type = if (@TypeOf(target) == type) target else @TypeOf(target); | |
| 265 | switch (@typeInfo(T)) { | |
| 266 | .float, .int, .@"struct", .@"union", .array, .bool, .vector => return @sizeOf(T), | |
| 267 | .@"fn" => { | |
| 268 | // sizeof(main) in C returns 1 | |
| 269 | return 1; | |
| 270 | }, | |
| 271 | .null => return @sizeOf(*anyopaque), | |
| 272 | .void => { | |
| 273 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. | |
| 274 | return 1; | |
| 275 | }, | |
| 276 | .@"opaque" => { | |
| 277 | if (T == anyopaque) { | |
| 278 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. | |
| 279 | return 1; | |
| 280 | } else { | |
| 281 | @compileError("Cannot use C sizeof on opaque type " ++ @typeName(T)); | |
| 282 | } | |
| 283 | }, | |
| 284 | .optional => |opt| { | |
| 285 | if (@typeInfo(opt.child) == .pointer) { | |
| 286 | return sizeof(opt.child); | |
| 287 | } else { | |
| 288 | @compileError("Cannot use C sizeof on non-pointer optional " ++ @typeName(T)); | |
| 289 | } | |
| 290 | }, | |
| 291 | .pointer => |ptr| { | |
| 292 | if (ptr.size == .slice) { | |
| 293 | @compileError("Cannot use C sizeof on slice type " ++ @typeName(T)); | |
| 294 | } | |
| 295 | ||
| 296 | // for strings, sizeof("a") returns 2. | |
| 297 | // normal pointer decay scenarios from C are handled | |
| 298 | // in the .array case above, but strings remain literals | |
| 299 | // and are therefore always pointers, so they need to be | |
| 300 | // specially handled here. | |
| 301 | if (ptr.size == .one and ptr.is_const and @typeInfo(ptr.child) == .array) { | |
| 302 | const array_info = @typeInfo(ptr.child).array; | |
| 303 | if ((array_info.child == u8 or array_info.child == u16) and array_info.sentinel() == 0) { | |
| 304 | // length of the string plus one for the null terminator. | |
| 305 | return (array_info.len + 1) * @sizeOf(array_info.child); | |
| 306 | } | |
| 307 | } | |
| 308 | ||
| 309 | // When zero sized pointers are removed, this case will no | |
| 310 | // longer be reachable and can be deleted. | |
| 311 | if (@sizeOf(T) == 0) { | |
| 312 | return @sizeOf(*anyopaque); | |
| 313 | } | |
| 314 | ||
| 315 | return @sizeOf(T); | |
| 316 | }, | |
| 317 | .comptime_float => return @sizeOf(f64), // TODO c_double #3999 | |
| 318 | .comptime_int => { | |
| 319 | // TODO to get the correct result we have to translate | |
| 320 | // `1073741824 * 4` as `int(1073741824) *% int(4)` since | |
| 321 | // sizeof(1073741824 * 4) != sizeof(4294967296). | |
| 322 | ||
| 323 | // TODO test if target fits in int, long or long long | |
| 324 | return @sizeOf(c_int); | |
| 325 | }, | |
| 326 | else => @compileError("__helpers.sizeof does not support type " ++ @typeName(T)), | |
| 327 | } | |
| 328 | } | |
| 329 | ||
| 330 | pub fn div(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { | |
| 331 | const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); | |
| 332 | const a_casted = cast(ResType, a); | |
| 333 | const b_casted = cast(ResType, b); | |
| 334 | switch (@typeInfo(ResType)) { | |
| 335 | .float => return a_casted / b_casted, | |
| 336 | .int => return @divTrunc(a_casted, b_casted), | |
| 337 | else => unreachable, | |
| 338 | } | |
| 339 | } | |
| 340 | ||
| 341 | pub fn rem(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { | |
| 342 | const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); | |
| 343 | const a_casted = cast(ResType, a); | |
| 344 | const b_casted = cast(ResType, b); | |
| 345 | switch (@typeInfo(ResType)) { | |
| 346 | .int => { | |
| 347 | if (@typeInfo(ResType).int.signedness == .signed) { | |
| 348 | return signedRemainder(a_casted, b_casted); | |
| 349 | } else { | |
| 350 | return a_casted % b_casted; | |
| 351 | } | |
| 352 | }, | |
| 353 | else => unreachable, | |
| 354 | } | |
| 355 | } | |
| 356 | ||
| 357 | /// A 2-argument function-like macro defined as #define FOO(A, B) (A)(B) | |
| 358 | /// could be either: cast B to A, or call A with the value B. | |
| 359 | pub fn CAST_OR_CALL(a: anytype, b: anytype) switch (@typeInfo(@TypeOf(a))) { | |
| 360 | .type => a, | |
| 361 | .@"fn" => |fn_info| fn_info.return_type orelse void, | |
| 362 | else => |info| @compileError("Unexpected argument type: " ++ @tagName(info)), | |
| 363 | } { | |
| 364 | switch (@typeInfo(@TypeOf(a))) { | |
| 365 | .type => return cast(a, b), | |
| 366 | .@"fn" => return a(b), | |
| 367 | else => unreachable, // return type will be a compile error otherwise | |
| 368 | } | |
| 369 | } | |
| 370 | ||
| 371 | pub inline fn DISCARD(x: anytype) void { | |
| 372 | _ = x; | |
| 373 | } | |
| 374 | ||
| 375 | pub fn F_SUFFIX(comptime f: comptime_float) f32 { | |
| 376 | return @as(f32, f); | |
| 377 | } | |
| 378 | ||
| 379 | fn L_SUFFIX_ReturnType(comptime number: anytype) type { | |
| 380 | switch (@typeInfo(@TypeOf(number))) { | |
| 381 | .int, .comptime_int => return @TypeOf(promoteIntLiteral(c_long, number, .decimal)), | |
| 382 | .float, .comptime_float => return c_longdouble, | |
| 383 | else => @compileError("Invalid value for L suffix"), | |
| 384 | } | |
| 385 | } | |
| 386 | ||
| 387 | pub fn L_SUFFIX(comptime number: anytype) L_SUFFIX_ReturnType(number) { | |
| 388 | switch (@typeInfo(@TypeOf(number))) { | |
| 389 | .int, .comptime_int => return promoteIntLiteral(c_long, number, .decimal), | |
| 390 | .float, .comptime_float => @compileError("TODO: c_longdouble initialization from comptime_float not supported"), | |
| 391 | else => @compileError("Invalid value for L suffix"), | |
| 392 | } | |
| 393 | } | |
| 394 | ||
| 395 | pub fn LL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_longlong, n, .decimal)) { | |
| 396 | return promoteIntLiteral(c_longlong, n, .decimal); | |
| 397 | } | |
| 398 | ||
| 399 | pub fn U_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_uint, n, .decimal)) { | |
| 400 | return promoteIntLiteral(c_uint, n, .decimal); | |
| 401 | } | |
| 402 | ||
| 403 | pub fn UL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulong, n, .decimal)) { | |
| 404 | return promoteIntLiteral(c_ulong, n, .decimal); | |
| 405 | } | |
| 406 | ||
| 407 | pub fn ULL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulonglong, n, .decimal)) { | |
| 408 | return promoteIntLiteral(c_ulonglong, n, .decimal); | |
| 409 | } | |
| 410 | ||
| 411 | pub fn WL_CONTAINER_OF(ptr: anytype, sample: anytype, comptime member: []const u8) @TypeOf(sample) { | |
| 412 | return @fieldParentPtr(member, ptr); | |
| 413 | } |
src/Compilation.zig+323-319| ... | ... | @@ -5655,115 +5655,60 @@ pub const CImportResult = struct { |
| 5655 | 5655 | }; |
| 5656 | 5656 | |
| 5657 | 5657 | /// Caller owns returned memory. |
| 5658 | pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module) !CImportResult { | |
| 5658 | pub fn cImport( | |
| 5659 | comp: *Compilation, | |
| 5660 | c_src: []const u8, | |
| 5661 | owner_mod: *Package.Module, | |
| 5662 | prog_node: std.Progress.Node, | |
| 5663 | ) !CImportResult { | |
| 5659 | 5664 | dev.check(.translate_c_command); |
| 5660 | 5665 | |
| 5661 | const tracy_trace = trace(@src()); | |
| 5662 | defer tracy_trace.end(); | |
| 5663 | ||
| 5664 | const cimport_zig_basename = "cimport.zig"; | |
| 5666 | const cimport_basename = "cimport.h"; | |
| 5667 | const translated_basename = "cimport.zig"; | |
| 5665 | 5668 | |
| 5666 | 5669 | var man = comp.obtainCObjectCacheManifest(owner_mod); |
| 5667 | 5670 | defer man.deinit(); |
| 5668 | 5671 | |
| 5669 | man.hash.add(@as(u16, 0xb945)); // Random number to distinguish translate-c from compiling C objects | |
| 5672 | man.hash.add(@as(u16, 0x7dd9)); // Random number to distinguish translate-c from compiling C objects | |
| 5670 | 5673 | man.hash.addBytes(c_src); |
| 5671 | man.hash.add(comp.config.c_frontend); | |
| 5672 | ||
| 5673 | // If the previous invocation resulted in clang errors, we will see a hit | |
| 5674 | // here with 0 files in the manifest, in which case it is actually a miss. | |
| 5675 | // We need to "unhit" in this case, to keep the digests matching. | |
| 5676 | const prev_hash_state = man.hash.peekBin(); | |
| 5677 | const actual_hit = hit: { | |
| 5678 | _ = try man.hit(); | |
| 5679 | if (man.files.entries.len == 0) { | |
| 5680 | man.unhit(prev_hash_state, 0); | |
| 5681 | break :hit false; | |
| 5682 | } | |
| 5683 | break :hit true; | |
| 5684 | }; | |
| 5685 | const digest = if (!actual_hit) digest: { | |
| 5674 | ||
| 5675 | const digest, const is_hit = if (try man.hit()) .{ man.finalBin(), true } else digest: { | |
| 5686 | 5676 | var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); |
| 5687 | 5677 | defer arena_allocator.deinit(); |
| 5688 | 5678 | const arena = arena_allocator.allocator(); |
| 5689 | 5679 | |
| 5690 | const tmp_digest = man.hash.peek(); | |
| 5691 | const tmp_dir_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &tmp_digest }); | |
| 5692 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath(tmp_dir_sub_path, .{}); | |
| 5693 | defer zig_cache_tmp_dir.close(); | |
| 5694 | const cimport_basename = "cimport.h"; | |
| 5695 | const out_h_path = try comp.dirs.local_cache.join(arena, &[_][]const u8{ | |
| 5696 | tmp_dir_sub_path, cimport_basename, | |
| 5697 | }); | |
| 5680 | const tmp_basename = std.fmt.hex(std.crypto.random.int(u64)); | |
| 5681 | const tmp_sub_path = "tmp" ++ fs.path.sep_str ++ tmp_basename; | |
| 5682 | const cache_dir = comp.dirs.local_cache.handle; | |
| 5683 | const out_h_sub_path = tmp_sub_path ++ fs.path.sep_str ++ cimport_basename; | |
| 5684 | ||
| 5685 | try cache_dir.makePath(tmp_sub_path); | |
| 5686 | ||
| 5687 | const out_h_path = try comp.dirs.local_cache.join(arena, &.{out_h_sub_path}); | |
| 5688 | const translated_path = try comp.dirs.local_cache.join(arena, &.{ tmp_sub_path, translated_basename }); | |
| 5698 | 5689 | const out_dep_path = try std.fmt.allocPrint(arena, "{s}.d", .{out_h_path}); |
| 5699 | 5690 | |
| 5700 | try zig_cache_tmp_dir.writeFile(.{ .sub_path = cimport_basename, .data = c_src }); | |
| 5701 | if (comp.verbose_cimport) { | |
| 5702 | log.info("C import source: {s}", .{out_h_path}); | |
| 5703 | } | |
| 5691 | if (comp.verbose_cimport) log.info("writing C import source to {s}", .{out_h_path}); | |
| 5692 | try cache_dir.writeFile(.{ .sub_path = out_h_sub_path, .data = c_src }); | |
| 5704 | 5693 | |
| 5705 | 5694 | var argv = std.array_list.Managed([]const u8).init(comp.gpa); |
| 5706 | 5695 | defer argv.deinit(); |
| 5707 | ||
| 5708 | try argv.append(@tagName(comp.config.c_frontend)); // argv[0] is program name, actual args start at [1] | |
| 5709 | 5696 | try comp.addTranslateCCArgs(arena, &argv, .c, out_dep_path, owner_mod); |
| 5697 | try argv.appendSlice(&.{ out_h_path, "-o", translated_path }); | |
| 5710 | 5698 | |
| 5711 | try argv.append(out_h_path); | |
| 5712 | ||
| 5713 | if (comp.verbose_cc) { | |
| 5714 | dump_argv(argv.items); | |
| 5715 | } | |
| 5716 | var tree = switch (comp.config.c_frontend) { | |
| 5717 | .aro => tree: { | |
| 5718 | if (true) @panic("TODO"); | |
| 5719 | break :tree undefined; | |
| 5720 | }, | |
| 5721 | .clang => tree: { | |
| 5722 | if (!build_options.have_llvm) unreachable; | |
| 5723 | const translate_c = @import("translate_c.zig"); | |
| 5724 | ||
| 5725 | // Convert to null terminated args. | |
| 5726 | const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); | |
| 5727 | new_argv_with_sentinel[argv.items.len] = null; | |
| 5728 | const new_argv = new_argv_with_sentinel[0..argv.items.len :null]; | |
| 5729 | for (argv.items, 0..) |arg, i| { | |
| 5730 | new_argv[i] = try arena.dupeZ(u8, arg); | |
| 5731 | } | |
| 5732 | ||
| 5733 | const c_headers_dir_path_z = try comp.dirs.zig_lib.joinZ(arena, &.{"include"}); | |
| 5734 | var errors = std.zig.ErrorBundle.empty; | |
| 5735 | errdefer errors.deinit(comp.gpa); | |
| 5736 | break :tree translate_c.translate( | |
| 5737 | comp.gpa, | |
| 5738 | new_argv.ptr, | |
| 5739 | new_argv.ptr + new_argv.len, | |
| 5740 | &errors, | |
| 5741 | c_headers_dir_path_z, | |
| 5742 | ) catch |err| switch (err) { | |
| 5743 | error.OutOfMemory => return error.OutOfMemory, | |
| 5744 | error.SemanticAnalyzeFail => { | |
| 5745 | return CImportResult{ | |
| 5746 | .digest = undefined, | |
| 5747 | .cache_hit = actual_hit, | |
| 5748 | .errors = errors, | |
| 5749 | }; | |
| 5750 | }, | |
| 5751 | }; | |
| 5752 | }, | |
| 5753 | }; | |
| 5754 | defer tree.deinit(comp.gpa); | |
| 5755 | ||
| 5756 | if (comp.verbose_cimport) { | |
| 5757 | log.info("C import .d file: {s}", .{out_dep_path}); | |
| 5758 | } | |
| 5699 | if (comp.verbose_cc) dump_argv(argv.items); | |
| 5700 | var stdout: []u8 = undefined; | |
| 5701 | try @import("main.zig").translateC(comp.gpa, arena, argv.items, prog_node, &stdout); | |
| 5702 | if (comp.verbose_cimport and stdout.len != 0) log.info("unexpected stdout: {s}", .{stdout}); | |
| 5759 | 5703 | |
| 5760 | const dep_basename = fs.path.basename(out_dep_path); | |
| 5761 | try man.addDepFilePost(zig_cache_tmp_dir, dep_basename); | |
| 5704 | const dep_sub_path = out_h_sub_path ++ ".d"; | |
| 5705 | if (comp.verbose_cimport) log.info("processing dep file at {s}", .{dep_sub_path}); | |
| 5706 | try man.addDepFilePost(cache_dir, dep_sub_path); | |
| 5762 | 5707 | switch (comp.cache_use) { |
| 5763 | 5708 | .whole => |whole| if (whole.cache_manifest) |whole_cache_manifest| { |
| 5764 | 5709 | whole.cache_manifest_mutex.lock(); |
| 5765 | 5710 | defer whole.cache_manifest_mutex.unlock(); |
| 5766 | try whole_cache_manifest.addDepFilePost(zig_cache_tmp_dir, dep_basename); | |
| 5711 | try whole_cache_manifest.addDepFilePost(cache_dir, dep_sub_path); | |
| 5767 | 5712 | }, |
| 5768 | 5713 | .incremental, .none => {}, |
| 5769 | 5714 | } |
| ... | ... | @@ -5771,19 +5716,12 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module |
| 5771 | 5716 | const bin_digest = man.finalBin(); |
| 5772 | 5717 | const hex_digest = Cache.binToHex(bin_digest); |
| 5773 | 5718 | const o_sub_path = "o" ++ fs.path.sep_str ++ hex_digest; |
| 5774 | var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); | |
| 5775 | defer o_dir.close(); | |
| 5776 | ||
| 5777 | var out_zig_file = try o_dir.createFile(cimport_zig_basename, .{}); | |
| 5778 | defer out_zig_file.close(); | |
| 5779 | ||
| 5780 | const formatted = try tree.renderAlloc(comp.gpa); | |
| 5781 | defer comp.gpa.free(formatted); | |
| 5782 | 5719 | |
| 5783 | try out_zig_file.writeAll(formatted); | |
| 5720 | if (comp.verbose_cimport) log.info("renaming {s} to {s}", .{ tmp_sub_path, o_sub_path }); | |
| 5721 | try renameTmpIntoCache(comp.dirs.local_cache, tmp_sub_path, o_sub_path); | |
| 5784 | 5722 | |
| 5785 | break :digest bin_digest; | |
| 5786 | } else man.finalBin(); | |
| 5723 | break :digest .{ bin_digest, false }; | |
| 5724 | }; | |
| 5787 | 5725 | |
| 5788 | 5726 | if (man.have_exclusive_lock) { |
| 5789 | 5727 | // Write the updated manifest. This is a no-op if the manifest is not dirty. Note that it is |
| ... | ... | @@ -5795,9 +5733,9 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module |
| 5795 | 5733 | }; |
| 5796 | 5734 | } |
| 5797 | 5735 | |
| 5798 | return CImportResult{ | |
| 5736 | return .{ | |
| 5799 | 5737 | .digest = digest, |
| 5800 | .cache_hit = actual_hit, | |
| 5738 | .cache_hit = is_hit, | |
| 5801 | 5739 | .errors = std.zig.ErrorBundle.empty, |
| 5802 | 5740 | }; |
| 5803 | 5741 | } |
| ... | ... | @@ -6747,51 +6685,63 @@ pub fn addTranslateCCArgs( |
| 6747 | 6685 | out_dep_path: ?[]const u8, |
| 6748 | 6686 | owner_mod: *Package.Module, |
| 6749 | 6687 | ) !void { |
| 6688 | const target = &owner_mod.resolved_target.result; | |
| 6689 | ||
| 6750 | 6690 | try argv.appendSlice(&.{ "-x", "c" }); |
| 6751 | try comp.addCCArgs(arena, argv, ext, out_dep_path, owner_mod); | |
| 6752 | // This gives us access to preprocessing entities, presumably at the cost of performance. | |
| 6753 | try argv.appendSlice(&.{ "-Xclang", "-detailed-preprocessing-record" }); | |
| 6691 | ||
| 6692 | const resource_path = try comp.dirs.zig_lib.join(arena, &.{"compiler/aro/include"}); | |
| 6693 | try argv.appendSlice(&.{ "-isystem", resource_path }); | |
| 6694 | ||
| 6695 | try comp.addCommonCCArgs(arena, argv, ext, out_dep_path, owner_mod, .aro); | |
| 6696 | ||
| 6697 | try argv.appendSlice(&[_][]const u8{ "-target", try target.zigTriple(arena) }); | |
| 6698 | ||
| 6699 | const mcpu = mcpu: { | |
| 6700 | var buf: std.ArrayListUnmanaged(u8) = .empty; | |
| 6701 | defer buf.deinit(comp.gpa); | |
| 6702 | ||
| 6703 | try buf.print(comp.gpa, "-mcpu={s}", .{target.cpu.model.name}); | |
| 6704 | ||
| 6705 | // TODO better serialization https://github.com/ziglang/zig/issues/4584 | |
| 6706 | const all_features_list = target.cpu.arch.allFeaturesList(); | |
| 6707 | try argv.ensureUnusedCapacity(all_features_list.len * 4); | |
| 6708 | for (all_features_list, 0..) |feature, index_usize| { | |
| 6709 | const index = @as(std.Target.Cpu.Feature.Set.Index, @intCast(index_usize)); | |
| 6710 | const is_enabled = target.cpu.features.isEnabled(index); | |
| 6711 | ||
| 6712 | const plus_or_minus = "-+"[@intFromBool(is_enabled)]; | |
| 6713 | try buf.print(comp.gpa, "{c}{s}", .{ plus_or_minus, feature.name }); | |
| 6714 | } | |
| 6715 | break :mcpu try buf.toOwnedSlice(arena); | |
| 6716 | }; | |
| 6717 | try argv.append(mcpu); | |
| 6718 | ||
| 6719 | try argv.appendSlice(comp.global_cc_argv); | |
| 6720 | try argv.appendSlice(owner_mod.cc_argv); | |
| 6754 | 6721 | } |
| 6755 | 6722 | |
| 6756 | 6723 | /// Add common C compiler args between translate-c and C object compilation. |
| 6757 | pub fn addCCArgs( | |
| 6724 | fn addCommonCCArgs( | |
| 6758 | 6725 | comp: *const Compilation, |
| 6759 | 6726 | arena: Allocator, |
| 6760 | 6727 | argv: *std.array_list.Managed([]const u8), |
| 6761 | 6728 | ext: FileExt, |
| 6762 | 6729 | out_dep_path: ?[]const u8, |
| 6763 | 6730 | mod: *Package.Module, |
| 6731 | c_frontend: Config.CFrontend, | |
| 6764 | 6732 | ) !void { |
| 6765 | 6733 | const target = &mod.resolved_target.result; |
| 6734 | const is_clang = c_frontend == .clang; | |
| 6766 | 6735 | |
| 6767 | // As of Clang 16.x, it will by default read extra flags from /etc/clang. | |
| 6768 | // I'm sure the person who implemented this means well, but they have a lot | |
| 6769 | // to learn about abstractions and where the appropriate boundaries between | |
| 6770 | // them are. The road to hell is paved with good intentions. Fortunately it | |
| 6771 | // can be disabled. | |
| 6772 | try argv.append("--no-default-config"); | |
| 6773 | ||
| 6774 | // We don't ever put `-fcolor-diagnostics` or `-fno-color-diagnostics` because in passthrough mode | |
| 6775 | // we want Clang to infer it, and in normal mode we always want it off, which will be true since | |
| 6776 | // clang will detect stderr as a pipe rather than a terminal. | |
| 6777 | if (!comp.clang_passthrough_mode and ext.clangSupportsDiagnostics()) { | |
| 6778 | // Make stderr more easily parseable. | |
| 6779 | try argv.append("-fno-caret-diagnostics"); | |
| 6780 | } | |
| 6781 | ||
| 6782 | // We never want clang to invoke the system assembler for anything. So we would want | |
| 6783 | // this option always enabled. However, it only matters for some targets. To avoid | |
| 6784 | // "unused parameter" warnings, and to keep CLI spam to a minimum, we only put this | |
| 6785 | // flag on the command line if it is necessary. | |
| 6786 | if (target_util.clangMightShellOutForAssembly(target)) { | |
| 6787 | try argv.append("-integrated-as"); | |
| 6736 | if (target_util.supports_fpic(target)) { | |
| 6737 | // PIE needs to go before PIC because Clang interprets `-fno-PIE` to imply `-fno-PIC`, which | |
| 6738 | // we don't necessarily want. | |
| 6739 | try argv.append(if (comp.config.pie) "-fPIE" else "-fno-PIE"); | |
| 6740 | try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC"); | |
| 6788 | 6741 | } |
| 6789 | 6742 | |
| 6790 | const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); | |
| 6791 | try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); | |
| 6792 | ||
| 6793 | 6743 | switch (target.os.tag) { |
| 6794 | .ios, .macos, .tvos, .watchos => |os| { | |
| 6744 | .ios, .macos, .tvos, .watchos => |os| if (is_clang) { | |
| 6795 | 6745 | try argv.ensureUnusedCapacity(2); |
| 6796 | 6746 | // Pass the proper -m<os>-version-min argument for darwin. |
| 6797 | 6747 | const ver = target.os.version_range.semver.min; |
| ... | ... | @@ -6815,78 +6765,6 @@ pub fn addCCArgs( |
| 6815 | 6765 | else => {}, |
| 6816 | 6766 | } |
| 6817 | 6767 | |
| 6818 | const xclang_flag = switch (ext) { | |
| 6819 | .assembly, .assembly_with_cpp => "-Xclangas", | |
| 6820 | else => "-Xclang", | |
| 6821 | }; | |
| 6822 | ||
| 6823 | if (target_util.clangSupportsTargetCpuArg(target)) { | |
| 6824 | if (target.cpu.model.llvm_name) |llvm_name| { | |
| 6825 | try argv.appendSlice(&[_][]const u8{ | |
| 6826 | xclang_flag, "-target-cpu", xclang_flag, llvm_name, | |
| 6827 | }); | |
| 6828 | } | |
| 6829 | } | |
| 6830 | ||
| 6831 | // It would be really nice if there was a more compact way to communicate this info to Clang. | |
| 6832 | const all_features_list = target.cpu.arch.allFeaturesList(); | |
| 6833 | try argv.ensureUnusedCapacity(all_features_list.len * 4); | |
| 6834 | for (all_features_list, 0..) |feature, index_usize| { | |
| 6835 | const index = @as(std.Target.Cpu.Feature.Set.Index, @intCast(index_usize)); | |
| 6836 | const is_enabled = target.cpu.features.isEnabled(index); | |
| 6837 | ||
| 6838 | if (feature.llvm_name) |llvm_name| { | |
| 6839 | // We communicate float ABI to Clang through the dedicated options. | |
| 6840 | if (std.mem.startsWith(u8, llvm_name, "soft-float") or | |
| 6841 | std.mem.startsWith(u8, llvm_name, "hard-float")) | |
| 6842 | continue; | |
| 6843 | ||
| 6844 | // Ignore these until we figure out how to handle the concept of omitting features. | |
| 6845 | // See https://github.com/ziglang/zig/issues/23539 | |
| 6846 | if (target_util.isDynamicAMDGCNFeature(target, feature)) continue; | |
| 6847 | ||
| 6848 | argv.appendSliceAssumeCapacity(&[_][]const u8{ xclang_flag, "-target-feature", xclang_flag }); | |
| 6849 | const plus_or_minus = "-+"[@intFromBool(is_enabled)]; | |
| 6850 | const arg = try std.fmt.allocPrint(arena, "{c}{s}", .{ plus_or_minus, llvm_name }); | |
| 6851 | argv.appendAssumeCapacity(arg); | |
| 6852 | } | |
| 6853 | } | |
| 6854 | ||
| 6855 | if (target.cpu.arch.isThumb()) { | |
| 6856 | try argv.append(switch (ext) { | |
| 6857 | .assembly, .assembly_with_cpp => "-Wa,-mthumb", | |
| 6858 | else => "-mthumb", | |
| 6859 | }); | |
| 6860 | } | |
| 6861 | ||
| 6862 | if (target_util.llvmMachineAbi(target)) |mabi| { | |
| 6863 | // Clang's integrated Arm assembler doesn't support `-mabi` yet... | |
| 6864 | // Clang's FreeBSD driver doesn't support `-mabi` on PPC64 (ELFv2 is used anyway). | |
| 6865 | if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp)) and | |
| 6866 | !(target.cpu.arch.isPowerPC64() and target.os.tag == .freebsd)) | |
| 6867 | { | |
| 6868 | try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); | |
| 6869 | } | |
| 6870 | } | |
| 6871 | ||
| 6872 | // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future. | |
| 6873 | if (target_util.clangSupportsFloatAbiArg(target)) { | |
| 6874 | const fabi = @tagName(target.abi.float()); | |
| 6875 | ||
| 6876 | try argv.append(switch (target.cpu.arch) { | |
| 6877 | // For whatever reason, Clang doesn't support `-mfloat-abi` for s390x. | |
| 6878 | .s390x => try std.fmt.allocPrint(arena, "-m{s}-float", .{fabi}), | |
| 6879 | else => try std.fmt.allocPrint(arena, "-mfloat-abi={s}", .{fabi}), | |
| 6880 | }); | |
| 6881 | } | |
| 6882 | ||
| 6883 | if (target_util.supports_fpic(target)) { | |
| 6884 | // PIE needs to go before PIC because Clang interprets `-fno-PIE` to imply `-fno-PIC`, which | |
| 6885 | // we don't necessarily want. | |
| 6886 | try argv.append(if (comp.config.pie) "-fPIE" else "-fno-PIE"); | |
| 6887 | try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC"); | |
| 6888 | } | |
| 6889 | ||
| 6890 | 6768 | if (comp.mingw_unicode_entry_point) { |
| 6891 | 6769 | try argv.append("-municode"); |
| 6892 | 6770 | } |
| ... | ... | @@ -6923,45 +6801,6 @@ pub fn addCCArgs( |
| 6923 | 6801 | if (ext != .assembly) { |
| 6924 | 6802 | try argv.append(if (target.os.tag == .freestanding) "-ffreestanding" else "-fhosted"); |
| 6925 | 6803 | |
| 6926 | if (target_util.clangSupportsNoImplicitFloatArg(target) and target.abi.float() == .soft) { | |
| 6927 | try argv.append("-mno-implicit-float"); | |
| 6928 | } | |
| 6929 | ||
| 6930 | if (target_util.hasRedZone(target)) { | |
| 6931 | try argv.append(if (mod.red_zone) "-mred-zone" else "-mno-red-zone"); | |
| 6932 | } | |
| 6933 | ||
| 6934 | try argv.append(if (mod.omit_frame_pointer) "-fomit-frame-pointer" else "-fno-omit-frame-pointer"); | |
| 6935 | ||
| 6936 | const ssp_buf_size = mod.stack_protector; | |
| 6937 | if (ssp_buf_size != 0) { | |
| 6938 | try argv.appendSlice(&[_][]const u8{ | |
| 6939 | "-fstack-protector-strong", | |
| 6940 | "--param", | |
| 6941 | try std.fmt.allocPrint(arena, "ssp-buffer-size={d}", .{ssp_buf_size}), | |
| 6942 | }); | |
| 6943 | } else { | |
| 6944 | try argv.append("-fno-stack-protector"); | |
| 6945 | } | |
| 6946 | ||
| 6947 | try argv.append(if (mod.no_builtin) "-fno-builtin" else "-fbuiltin"); | |
| 6948 | ||
| 6949 | try argv.append(if (comp.function_sections) "-ffunction-sections" else "-fno-function-sections"); | |
| 6950 | try argv.append(if (comp.data_sections) "-fdata-sections" else "-fno-data-sections"); | |
| 6951 | ||
| 6952 | switch (mod.unwind_tables) { | |
| 6953 | .none => { | |
| 6954 | try argv.append("-fno-unwind-tables"); | |
| 6955 | try argv.append("-fno-asynchronous-unwind-tables"); | |
| 6956 | }, | |
| 6957 | .sync => { | |
| 6958 | // Need to override Clang's convoluted default logic. | |
| 6959 | try argv.append("-fno-asynchronous-unwind-tables"); | |
| 6960 | try argv.append("-funwind-tables"); | |
| 6961 | }, | |
| 6962 | .async => try argv.append("-fasynchronous-unwind-tables"), | |
| 6963 | } | |
| 6964 | ||
| 6965 | 6804 | try argv.append("-nostdinc"); |
| 6966 | 6805 | |
| 6967 | 6806 | if (ext == .cpp or ext == .hpp) { |
| ... | ... | @@ -7085,12 +6924,14 @@ pub fn addCCArgs( |
| 7085 | 6924 | .mm, |
| 7086 | 6925 | .hmm, |
| 7087 | 6926 | => { |
| 7088 | try argv.append("-fno-spell-checking"); | |
| 6927 | if (is_clang) { | |
| 6928 | try argv.append("-fno-spell-checking"); | |
| 7089 | 6929 | |
| 7090 | if (target.os.tag == .windows and target.abi.isGnu()) { | |
| 7091 | // windows.h has files such as pshpack1.h which do #pragma packing, | |
| 7092 | // triggering a clang warning. So for this target, we disable this warning. | |
| 7093 | try argv.append("-Wno-pragma-pack"); | |
| 6930 | if (target.os.tag == .windows and target.abi.isGnu()) { | |
| 6931 | // windows.h has files such as pshpack1.h which do #pragma packing, | |
| 6932 | // triggering a clang warning. So for this target, we disable this warning. | |
| 6933 | try argv.append("-Wno-pragma-pack"); | |
| 6934 | } | |
| 7094 | 6935 | } |
| 7095 | 6936 | |
| 7096 | 6937 | if (mod.optimize_mode != .Debug) { |
| ... | ... | @@ -7100,80 +6941,6 @@ pub fn addCCArgs( |
| 7100 | 6941 | else => {}, |
| 7101 | 6942 | } |
| 7102 | 6943 | |
| 7103 | // Only assembly files support these flags. | |
| 7104 | switch (ext) { | |
| 7105 | .assembly, | |
| 7106 | .assembly_with_cpp, | |
| 7107 | => { | |
| 7108 | // The Clang assembler does not accept the list of CPU features like the | |
| 7109 | // compiler frontend does. Therefore we must hard-code the -m flags for | |
| 7110 | // all CPU features here. | |
| 7111 | switch (target.cpu.arch) { | |
| 7112 | .riscv32, .riscv32be, .riscv64, .riscv64be => { | |
| 7113 | const RvArchFeat = struct { char: u8, feat: std.Target.riscv.Feature }; | |
| 7114 | const letters = [_]RvArchFeat{ | |
| 7115 | .{ .char = 'm', .feat = .m }, | |
| 7116 | .{ .char = 'a', .feat = .a }, | |
| 7117 | .{ .char = 'f', .feat = .f }, | |
| 7118 | .{ .char = 'd', .feat = .d }, | |
| 7119 | .{ .char = 'c', .feat = .c }, | |
| 7120 | }; | |
| 7121 | const prefix: []const u8 = if (target.cpu.arch == .riscv64) "rv64" else "rv32"; | |
| 7122 | const prefix_len = 4; | |
| 7123 | assert(prefix.len == prefix_len); | |
| 7124 | var march_buf: [prefix_len + letters.len + 1]u8 = undefined; | |
| 7125 | var march_index: usize = prefix_len; | |
| 7126 | @memcpy(march_buf[0..prefix.len], prefix); | |
| 7127 | ||
| 7128 | if (target.cpu.has(.riscv, .e)) { | |
| 7129 | march_buf[march_index] = 'e'; | |
| 7130 | } else { | |
| 7131 | march_buf[march_index] = 'i'; | |
| 7132 | } | |
| 7133 | march_index += 1; | |
| 7134 | ||
| 7135 | for (letters) |letter| { | |
| 7136 | if (target.cpu.has(.riscv, letter.feat)) { | |
| 7137 | march_buf[march_index] = letter.char; | |
| 7138 | march_index += 1; | |
| 7139 | } | |
| 7140 | } | |
| 7141 | ||
| 7142 | const march_arg = try std.fmt.allocPrint(arena, "-march={s}", .{ | |
| 7143 | march_buf[0..march_index], | |
| 7144 | }); | |
| 7145 | try argv.append(march_arg); | |
| 7146 | ||
| 7147 | if (target.cpu.has(.riscv, .relax)) { | |
| 7148 | try argv.append("-mrelax"); | |
| 7149 | } else { | |
| 7150 | try argv.append("-mno-relax"); | |
| 7151 | } | |
| 7152 | if (target.cpu.has(.riscv, .save_restore)) { | |
| 7153 | try argv.append("-msave-restore"); | |
| 7154 | } else { | |
| 7155 | try argv.append("-mno-save-restore"); | |
| 7156 | } | |
| 7157 | }, | |
| 7158 | .mips, .mipsel, .mips64, .mips64el => { | |
| 7159 | if (target.cpu.model.llvm_name) |llvm_name| { | |
| 7160 | try argv.append(try std.fmt.allocPrint(arena, "-march={s}", .{llvm_name})); | |
| 7161 | } | |
| 7162 | }, | |
| 7163 | else => { | |
| 7164 | // TODO | |
| 7165 | }, | |
| 7166 | } | |
| 7167 | ||
| 7168 | if (target_util.clangAssemblerSupportsMcpuArg(target)) { | |
| 7169 | if (target.cpu.model.llvm_name) |llvm_name| { | |
| 7170 | try argv.append(try std.fmt.allocPrint(arena, "-mcpu={s}", .{llvm_name})); | |
| 7171 | } | |
| 7172 | } | |
| 7173 | }, | |
| 7174 | else => {}, | |
| 7175 | } | |
| 7176 | ||
| 7177 | 6944 | // Only compiled files support these flags. |
| 7178 | 6945 | switch (ext) { |
| 7179 | 6946 | .c, |
| ... | ... | @@ -7191,7 +6958,7 @@ pub fn addCCArgs( |
| 7191 | 6958 | try argv.append(try std.fmt.allocPrint(arena, "-mcmodel={s}", .{@tagName(mod.code_model)})); |
| 7192 | 6959 | } |
| 7193 | 6960 | |
| 7194 | { | |
| 6961 | if (is_clang) { | |
| 7195 | 6962 | var san_arg: std.ArrayListUnmanaged(u8) = .empty; |
| 7196 | 6963 | const prefix = "-fsanitize="; |
| 7197 | 6964 | if (mod.sanitize_c != .off) { |
| ... | ... | @@ -7272,6 +7039,243 @@ pub fn addCCArgs( |
| 7272 | 7039 | }, |
| 7273 | 7040 | else => {}, |
| 7274 | 7041 | } |
| 7042 | } | |
| 7043 | ||
| 7044 | /// Add common C compiler args and Clang specific args. | |
| 7045 | pub fn addCCArgs( | |
| 7046 | comp: *const Compilation, | |
| 7047 | arena: Allocator, | |
| 7048 | argv: *std.array_list.Managed([]const u8), | |
| 7049 | ext: FileExt, | |
| 7050 | out_dep_path: ?[]const u8, | |
| 7051 | mod: *Package.Module, | |
| 7052 | ) !void { | |
| 7053 | const target = &mod.resolved_target.result; | |
| 7054 | ||
| 7055 | // As of Clang 16.x, it will by default read extra flags from /etc/clang. | |
| 7056 | // I'm sure the person who implemented this means well, but they have a lot | |
| 7057 | // to learn about abstractions and where the appropriate boundaries between | |
| 7058 | // them are. The road to hell is paved with good intentions. Fortunately it | |
| 7059 | // can be disabled. | |
| 7060 | try argv.append("--no-default-config"); | |
| 7061 | ||
| 7062 | // We don't ever put `-fcolor-diagnostics` or `-fno-color-diagnostics` because in passthrough mode | |
| 7063 | // we want Clang to infer it, and in normal mode we always want it off, which will be true since | |
| 7064 | // clang will detect stderr as a pipe rather than a terminal. | |
| 7065 | if (!comp.clang_passthrough_mode and ext.clangSupportsDiagnostics()) { | |
| 7066 | // Make stderr more easily parseable. | |
| 7067 | try argv.append("-fno-caret-diagnostics"); | |
| 7068 | } | |
| 7069 | ||
| 7070 | // We never want clang to invoke the system assembler for anything. So we would want | |
| 7071 | // this option always enabled. However, it only matters for some targets. To avoid | |
| 7072 | // "unused parameter" warnings, and to keep CLI spam to a minimum, we only put this | |
| 7073 | // flag on the command line if it is necessary. | |
| 7074 | if (target_util.clangMightShellOutForAssembly(target)) { | |
| 7075 | try argv.append("-integrated-as"); | |
| 7076 | } | |
| 7077 | ||
| 7078 | const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); | |
| 7079 | try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); | |
| 7080 | ||
| 7081 | if (target.cpu.arch.isThumb()) { | |
| 7082 | try argv.append(switch (ext) { | |
| 7083 | .assembly, .assembly_with_cpp => "-Wa,-mthumb", | |
| 7084 | else => "-mthumb", | |
| 7085 | }); | |
| 7086 | } | |
| 7087 | ||
| 7088 | if (target_util.llvmMachineAbi(target)) |mabi| { | |
| 7089 | // Clang's integrated Arm assembler doesn't support `-mabi` yet... | |
| 7090 | // Clang's FreeBSD driver doesn't support `-mabi` on PPC64 (ELFv2 is used anyway). | |
| 7091 | if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp)) and | |
| 7092 | !(target.cpu.arch.isPowerPC64() and target.os.tag == .freebsd)) | |
| 7093 | { | |
| 7094 | try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); | |
| 7095 | } | |
| 7096 | } | |
| 7097 | ||
| 7098 | // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future. | |
| 7099 | if (target_util.clangSupportsFloatAbiArg(target)) { | |
| 7100 | const fabi = @tagName(target.abi.float()); | |
| 7101 | ||
| 7102 | try argv.append(switch (target.cpu.arch) { | |
| 7103 | // For whatever reason, Clang doesn't support `-mfloat-abi` for s390x. | |
| 7104 | .s390x => try std.fmt.allocPrint(arena, "-m{s}-float", .{fabi}), | |
| 7105 | else => try std.fmt.allocPrint(arena, "-mfloat-abi={s}", .{fabi}), | |
| 7106 | }); | |
| 7107 | } | |
| 7108 | ||
| 7109 | try comp.addCommonCCArgs(arena, argv, ext, out_dep_path, mod, comp.config.c_frontend); | |
| 7110 | ||
| 7111 | // Only assembly files support these flags. | |
| 7112 | switch (ext) { | |
| 7113 | .assembly, | |
| 7114 | .assembly_with_cpp, | |
| 7115 | => { | |
| 7116 | // The Clang assembler does not accept the list of CPU features like the | |
| 7117 | // compiler frontend does. Therefore we must hard-code the -m flags for | |
| 7118 | // all CPU features here. | |
| 7119 | switch (target.cpu.arch) { | |
| 7120 | .riscv32, .riscv32be, .riscv64, .riscv64be => { | |
| 7121 | const RvArchFeat = struct { char: u8, feat: std.Target.riscv.Feature }; | |
| 7122 | const letters = [_]RvArchFeat{ | |
| 7123 | .{ .char = 'm', .feat = .m }, | |
| 7124 | .{ .char = 'a', .feat = .a }, | |
| 7125 | .{ .char = 'f', .feat = .f }, | |
| 7126 | .{ .char = 'd', .feat = .d }, | |
| 7127 | .{ .char = 'c', .feat = .c }, | |
| 7128 | }; | |
| 7129 | const prefix: []const u8 = if (target.cpu.arch == .riscv64) "rv64" else "rv32"; | |
| 7130 | const prefix_len = 4; | |
| 7131 | assert(prefix.len == prefix_len); | |
| 7132 | var march_buf: [prefix_len + letters.len + 1]u8 = undefined; | |
| 7133 | var march_index: usize = prefix_len; | |
| 7134 | @memcpy(march_buf[0..prefix.len], prefix); | |
| 7135 | ||
| 7136 | if (target.cpu.has(.riscv, .e)) { | |
| 7137 | march_buf[march_index] = 'e'; | |
| 7138 | } else { | |
| 7139 | march_buf[march_index] = 'i'; | |
| 7140 | } | |
| 7141 | march_index += 1; | |
| 7142 | ||
| 7143 | for (letters) |letter| { | |
| 7144 | if (target.cpu.has(.riscv, letter.feat)) { | |
| 7145 | march_buf[march_index] = letter.char; | |
| 7146 | march_index += 1; | |
| 7147 | } | |
| 7148 | } | |
| 7149 | ||
| 7150 | const march_arg = try std.fmt.allocPrint(arena, "-march={s}", .{ | |
| 7151 | march_buf[0..march_index], | |
| 7152 | }); | |
| 7153 | try argv.append(march_arg); | |
| 7154 | ||
| 7155 | if (target.cpu.has(.riscv, .relax)) { | |
| 7156 | try argv.append("-mrelax"); | |
| 7157 | } else { | |
| 7158 | try argv.append("-mno-relax"); | |
| 7159 | } | |
| 7160 | if (target.cpu.has(.riscv, .save_restore)) { | |
| 7161 | try argv.append("-msave-restore"); | |
| 7162 | } else { | |
| 7163 | try argv.append("-mno-save-restore"); | |
| 7164 | } | |
| 7165 | }, | |
| 7166 | .mips, .mipsel, .mips64, .mips64el => { | |
| 7167 | if (target.cpu.model.llvm_name) |llvm_name| { | |
| 7168 | try argv.append(try std.fmt.allocPrint(arena, "-march={s}", .{llvm_name})); | |
| 7169 | } | |
| 7170 | }, | |
| 7171 | else => { | |
| 7172 | // TODO | |
| 7173 | }, | |
| 7174 | } | |
| 7175 | ||
| 7176 | if (target_util.clangAssemblerSupportsMcpuArg(target)) { | |
| 7177 | if (target.cpu.model.llvm_name) |llvm_name| { | |
| 7178 | try argv.append(try std.fmt.allocPrint(arena, "-mcpu={s}", .{llvm_name})); | |
| 7179 | } | |
| 7180 | } | |
| 7181 | }, | |
| 7182 | else => {}, | |
| 7183 | } | |
| 7184 | ||
| 7185 | // Non-preprocessed assembly files don't support these flags. | |
| 7186 | if (ext != .assembly) { | |
| 7187 | if (target_util.clangSupportsNoImplicitFloatArg(target) and target.abi.float() == .soft) { | |
| 7188 | try argv.append("-mno-implicit-float"); | |
| 7189 | } | |
| 7190 | ||
| 7191 | if (target_util.hasRedZone(target)) { | |
| 7192 | try argv.append(if (mod.red_zone) "-mred-zone" else "-mno-red-zone"); | |
| 7193 | } | |
| 7194 | ||
| 7195 | try argv.append(if (mod.omit_frame_pointer) "-fomit-frame-pointer" else "-fno-omit-frame-pointer"); | |
| 7196 | ||
| 7197 | const ssp_buf_size = mod.stack_protector; | |
| 7198 | if (ssp_buf_size != 0) { | |
| 7199 | try argv.appendSlice(&[_][]const u8{ | |
| 7200 | "-fstack-protector-strong", | |
| 7201 | "--param", | |
| 7202 | try std.fmt.allocPrint(arena, "ssp-buffer-size={d}", .{ssp_buf_size}), | |
| 7203 | }); | |
| 7204 | } else { | |
| 7205 | try argv.append("-fno-stack-protector"); | |
| 7206 | } | |
| 7207 | ||
| 7208 | try argv.append(if (mod.no_builtin) "-fno-builtin" else "-fbuiltin"); | |
| 7209 | ||
| 7210 | try argv.append(if (comp.function_sections) "-ffunction-sections" else "-fno-function-sections"); | |
| 7211 | try argv.append(if (comp.data_sections) "-fdata-sections" else "-fno-data-sections"); | |
| 7212 | ||
| 7213 | switch (mod.unwind_tables) { | |
| 7214 | .none => { | |
| 7215 | try argv.append("-fno-unwind-tables"); | |
| 7216 | try argv.append("-fno-asynchronous-unwind-tables"); | |
| 7217 | }, | |
| 7218 | .sync => { | |
| 7219 | // Need to override Clang's convoluted default logic. | |
| 7220 | try argv.append("-fno-asynchronous-unwind-tables"); | |
| 7221 | try argv.append("-funwind-tables"); | |
| 7222 | }, | |
| 7223 | .async => try argv.append("-fasynchronous-unwind-tables"), | |
| 7224 | } | |
| 7225 | } | |
| 7226 | ||
| 7227 | // Only compiled files support these flags. | |
| 7228 | switch (ext) { | |
| 7229 | .c, | |
| 7230 | .h, | |
| 7231 | .cpp, | |
| 7232 | .hpp, | |
| 7233 | .m, | |
| 7234 | .hm, | |
| 7235 | .mm, | |
| 7236 | .hmm, | |
| 7237 | .ll, | |
| 7238 | .bc, | |
| 7239 | => { | |
| 7240 | const xclang_flag = switch (ext) { | |
| 7241 | .assembly, .assembly_with_cpp => "-Xclangas", | |
| 7242 | else => "-Xclang", | |
| 7243 | }; | |
| 7244 | ||
| 7245 | if (target_util.clangSupportsTargetCpuArg(target)) { | |
| 7246 | if (target.cpu.model.llvm_name) |llvm_name| { | |
| 7247 | try argv.appendSlice(&[_][]const u8{ | |
| 7248 | xclang_flag, "-target-cpu", xclang_flag, llvm_name, | |
| 7249 | }); | |
| 7250 | } | |
| 7251 | } | |
| 7252 | ||
| 7253 | // It would be really nice if there was a more compact way to communicate this info to Clang. | |
| 7254 | const all_features_list = target.cpu.arch.allFeaturesList(); | |
| 7255 | try argv.ensureUnusedCapacity(all_features_list.len * 4); | |
| 7256 | for (all_features_list, 0..) |feature, index_usize| { | |
| 7257 | const index = @as(std.Target.Cpu.Feature.Set.Index, @intCast(index_usize)); | |
| 7258 | const is_enabled = target.cpu.features.isEnabled(index); | |
| 7259 | ||
| 7260 | if (feature.llvm_name) |llvm_name| { | |
| 7261 | // We communicate float ABI to Clang through the dedicated options. | |
| 7262 | if (std.mem.startsWith(u8, llvm_name, "soft-float") or | |
| 7263 | std.mem.startsWith(u8, llvm_name, "hard-float")) | |
| 7264 | continue; | |
| 7265 | ||
| 7266 | // Ignore these until we figure out how to handle the concept of omitting features. | |
| 7267 | // See https://github.com/ziglang/zig/issues/23539 | |
| 7268 | if (target_util.isDynamicAMDGCNFeature(target, feature)) continue; | |
| 7269 | ||
| 7270 | argv.appendSliceAssumeCapacity(&[_][]const u8{ xclang_flag, "-target-feature", xclang_flag }); | |
| 7271 | const plus_or_minus = "-+"[@intFromBool(is_enabled)]; | |
| 7272 | const arg = try std.fmt.allocPrint(arena, "{c}{s}", .{ plus_or_minus, llvm_name }); | |
| 7273 | argv.appendAssumeCapacity(arg); | |
| 7274 | } | |
| 7275 | } | |
| 7276 | }, | |
| 7277 | else => {}, | |
| 7278 | } | |
| 7275 | 7279 | |
| 7276 | 7280 | try argv.appendSlice(comp.global_cc_argv); |
| 7277 | 7281 | try argv.appendSlice(mod.cc_argv); |
src/InternPool.zig+1-4| ... | ... | @@ -6925,10 +6925,7 @@ pub fn deactivate(ip: *const InternPool) void { |
| 6925 | 6925 | |
| 6926 | 6926 | /// For debugger access only. |
| 6927 | 6927 | const debug_state = struct { |
| 6928 | const enable = switch (builtin.zig_backend) { | |
| 6929 | else => false, | |
| 6930 | .stage2_x86_64 => !builtin.strip_debug_info, | |
| 6931 | }; | |
| 6928 | const enable = false; | |
| 6932 | 6929 | const enable_checks = enable and !builtin.single_threaded; |
| 6933 | 6930 | threadlocal var intern_pool: ?*const InternPool = null; |
| 6934 | 6931 | }; |
src/Sema.zig+5-6| ... | ... | @@ -5713,10 +5713,6 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr |
| 5713 | 5713 | const extra = sema.code.extraData(Zir.Inst.Block, pl_node.payload_index); |
| 5714 | 5714 | const body = sema.code.bodySlice(extra.end, extra.data.body_len); |
| 5715 | 5715 | |
| 5716 | // we check this here to avoid undefined symbols | |
| 5717 | if (!build_options.have_llvm) | |
| 5718 | return sema.fail(parent_block, src, "C import unavailable; Zig compiler built without LLVM extensions", .{}); | |
| 5719 | ||
| 5720 | 5716 | var c_import_buf = std.array_list.Managed(u8).init(gpa); |
| 5721 | 5717 | defer c_import_buf.deinit(); |
| 5722 | 5718 | |
| ... | ... | @@ -5741,8 +5737,11 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr |
| 5741 | 5737 | |
| 5742 | 5738 | _ = try sema.analyzeInlineBody(&child_block, body, inst); |
| 5743 | 5739 | |
| 5744 | var c_import_res = comp.cImport(c_import_buf.items, parent_block.ownerModule()) catch |err| | |
| 5745 | return sema.fail(&child_block, src, "C import failed: {s}", .{@errorName(err)}); | |
| 5740 | const prog_node = zcu.cur_sema_prog_node.start("@cImport", 0); | |
| 5741 | defer prog_node.end(); | |
| 5742 | ||
| 5743 | var c_import_res = comp.cImport(c_import_buf.items, parent_block.ownerModule(), prog_node) catch |err| | |
| 5744 | return sema.fail(&child_block, src, "C import failed: {t}", .{err}); | |
| 5746 | 5745 | defer c_import_res.deinit(gpa); |
| 5747 | 5746 | |
| 5748 | 5747 | if (c_import_res.errors.errorMessageCount() != 0) { |
src/Zcu.zig-1| ... | ... | @@ -32,7 +32,6 @@ const Sema = @import("Sema.zig"); |
| 32 | 32 | const target_util = @import("target.zig"); |
| 33 | 33 | const build_options = @import("build_options"); |
| 34 | 34 | const isUpDir = @import("introspect.zig").isUpDir; |
| 35 | const clang = @import("clang.zig"); | |
| 36 | 35 | const InternPool = @import("InternPool.zig"); |
| 37 | 36 | const Alignment = InternPool.Alignment; |
| 38 | 37 | const AnalUnit = InternPool.AnalUnit; |
src/clang.zig deleted-2277| ... | ... | @@ -1,2277 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | pub const builtin = @import("builtin"); | |
| 3 | ||
| 4 | pub const SourceLocation = extern struct { | |
| 5 | ID: c_uint, | |
| 6 | ||
| 7 | pub const eq = ZigClangSourceLocation_eq; | |
| 8 | extern fn ZigClangSourceLocation_eq(a: SourceLocation, b: SourceLocation) bool; | |
| 9 | }; | |
| 10 | ||
| 11 | pub const QualType = extern struct { | |
| 12 | ptr: ?*anyopaque, | |
| 13 | ||
| 14 | pub const getCanonicalType = ZigClangQualType_getCanonicalType; | |
| 15 | extern fn ZigClangQualType_getCanonicalType(QualType) QualType; | |
| 16 | ||
| 17 | pub const getTypePtr = ZigClangQualType_getTypePtr; | |
| 18 | extern fn ZigClangQualType_getTypePtr(QualType) *const Type; | |
| 19 | ||
| 20 | pub const getTypeClass = ZigClangQualType_getTypeClass; | |
| 21 | extern fn ZigClangQualType_getTypeClass(QualType) TypeClass; | |
| 22 | ||
| 23 | pub const addConst = ZigClangQualType_addConst; | |
| 24 | extern fn ZigClangQualType_addConst(*QualType) void; | |
| 25 | ||
| 26 | pub const eq = ZigClangQualType_eq; | |
| 27 | extern fn ZigClangQualType_eq(QualType, arg1: QualType) bool; | |
| 28 | ||
| 29 | pub const isConstQualified = ZigClangQualType_isConstQualified; | |
| 30 | extern fn ZigClangQualType_isConstQualified(QualType) bool; | |
| 31 | ||
| 32 | pub const isVolatileQualified = ZigClangQualType_isVolatileQualified; | |
| 33 | extern fn ZigClangQualType_isVolatileQualified(QualType) bool; | |
| 34 | ||
| 35 | pub const isRestrictQualified = ZigClangQualType_isRestrictQualified; | |
| 36 | extern fn ZigClangQualType_isRestrictQualified(QualType) bool; | |
| 37 | }; | |
| 38 | ||
| 39 | pub const APValueLValueBase = extern struct { | |
| 40 | Ptr: ?*anyopaque align(@alignOf(u64)), | |
| 41 | State: extern union { | |
| 42 | Local: extern struct { | |
| 43 | CallIndex: c_uint, | |
| 44 | Version: c_uint, | |
| 45 | }, | |
| 46 | TypeInfoType: ?*anyopaque, | |
| 47 | DynamicAllocType: ?*anyopaque, | |
| 48 | }, | |
| 49 | ||
| 50 | pub const dyn_cast_Expr = ZigClangAPValueLValueBase_dyn_cast_Expr; | |
| 51 | extern fn ZigClangAPValueLValueBase_dyn_cast_Expr(APValueLValueBase) ?*const Expr; | |
| 52 | }; | |
| 53 | ||
| 54 | pub const APValueKind = enum(c_int) { | |
| 55 | None, | |
| 56 | Indeterminate, | |
| 57 | Int, | |
| 58 | Float, | |
| 59 | FixedPoint, | |
| 60 | ComplexInt, | |
| 61 | ComplexFloat, | |
| 62 | LValue, | |
| 63 | Vector, | |
| 64 | Array, | |
| 65 | Struct, | |
| 66 | Union, | |
| 67 | MemberPointer, | |
| 68 | AddrLabelDiff, | |
| 69 | }; | |
| 70 | ||
| 71 | pub const APValue = extern struct { | |
| 72 | Kind: APValueKind align(if (builtin.cpu.arch == .x86 and builtin.os.tag != .windows) 4 else 8), | |
| 73 | Data: if (builtin.cpu.arch == .x86 and builtin.os.tag != .windows) [44]u8 else [52]u8, | |
| 74 | ||
| 75 | pub const getKind = ZigClangAPValue_getKind; | |
| 76 | extern fn ZigClangAPValue_getKind(*const APValue) APValueKind; | |
| 77 | ||
| 78 | pub const getInt = ZigClangAPValue_getInt; | |
| 79 | extern fn ZigClangAPValue_getInt(*const APValue) *const APSInt; | |
| 80 | ||
| 81 | pub const getArrayInitializedElts = ZigClangAPValue_getArrayInitializedElts; | |
| 82 | extern fn ZigClangAPValue_getArrayInitializedElts(*const APValue) c_uint; | |
| 83 | ||
| 84 | pub const getArraySize = ZigClangAPValue_getArraySize; | |
| 85 | extern fn ZigClangAPValue_getArraySize(*const APValue) c_uint; | |
| 86 | ||
| 87 | pub const getLValueBase = ZigClangAPValue_getLValueBase; | |
| 88 | extern fn ZigClangAPValue_getLValueBase(*const APValue) APValueLValueBase; | |
| 89 | }; | |
| 90 | ||
| 91 | pub const ExprEvalResult = extern struct { | |
| 92 | HasSideEffects: bool, | |
| 93 | HasUndefinedBehavior: bool, | |
| 94 | SmallVectorImpl: ?*anyopaque, | |
| 95 | Val: APValue, | |
| 96 | }; | |
| 97 | ||
| 98 | pub const AbstractConditionalOperator = opaque { | |
| 99 | pub const getCond = ZigClangAbstractConditionalOperator_getCond; | |
| 100 | extern fn ZigClangAbstractConditionalOperator_getCond(*const AbstractConditionalOperator) *const Expr; | |
| 101 | ||
| 102 | pub const getTrueExpr = ZigClangAbstractConditionalOperator_getTrueExpr; | |
| 103 | extern fn ZigClangAbstractConditionalOperator_getTrueExpr(*const AbstractConditionalOperator) *const Expr; | |
| 104 | ||
| 105 | pub const getFalseExpr = ZigClangAbstractConditionalOperator_getFalseExpr; | |
| 106 | extern fn ZigClangAbstractConditionalOperator_getFalseExpr(*const AbstractConditionalOperator) *const Expr; | |
| 107 | }; | |
| 108 | ||
| 109 | pub const APFloat = opaque { | |
| 110 | pub const toString = ZigClangAPFloat_toString; | |
| 111 | extern fn ZigClangAPFloat_toString(*const APFloat, precision: c_uint, maxPadding: c_uint, truncateZero: bool) [*:0]const u8; | |
| 112 | }; | |
| 113 | ||
| 114 | pub const APFloatBaseSemantics = enum(c_int) { | |
| 115 | IEEEhalf, | |
| 116 | BFloat, | |
| 117 | IEEEsingle, | |
| 118 | IEEEdouble, | |
| 119 | IEEEquad, | |
| 120 | PPCDoubleDouble, | |
| 121 | PPCDoubleDoubleLegacy, | |
| 122 | Float8E5M2, | |
| 123 | Float8E5M2FNUZ, | |
| 124 | Float8E4M3, | |
| 125 | Float8E4M3FN, | |
| 126 | Float8E4M3FNUZ, | |
| 127 | Float8E4M3B11FNUZ, | |
| 128 | Float8E3M4, | |
| 129 | FloatTF32, | |
| 130 | Float8E8M0FNU, | |
| 131 | Float6E3M2FN, | |
| 132 | Float6E2M3FN, | |
| 133 | Float4E2M1FN, | |
| 134 | x87DoubleExtended, | |
| 135 | }; | |
| 136 | ||
| 137 | pub const APInt = opaque { | |
| 138 | pub const free = ZigClangAPInt_free; | |
| 139 | extern fn ZigClangAPInt_free(*const APInt) void; | |
| 140 | ||
| 141 | pub fn getLimitedValue(self: *const APInt, comptime T: type) T { | |
| 142 | return @as(T, @truncate(ZigClangAPInt_getLimitedValue(self, std.math.maxInt(T)))); | |
| 143 | } | |
| 144 | extern fn ZigClangAPInt_getLimitedValue(*const APInt, limit: u64) u64; | |
| 145 | }; | |
| 146 | ||
| 147 | pub const APSInt = opaque { | |
| 148 | pub const isSigned = ZigClangAPSInt_isSigned; | |
| 149 | extern fn ZigClangAPSInt_isSigned(*const APSInt) bool; | |
| 150 | ||
| 151 | pub const isNegative = ZigClangAPSInt_isNegative; | |
| 152 | extern fn ZigClangAPSInt_isNegative(*const APSInt) bool; | |
| 153 | ||
| 154 | pub const negate = ZigClangAPSInt_negate; | |
| 155 | extern fn ZigClangAPSInt_negate(*const APSInt) *const APSInt; | |
| 156 | ||
| 157 | pub const free = ZigClangAPSInt_free; | |
| 158 | extern fn ZigClangAPSInt_free(*const APSInt) void; | |
| 159 | ||
| 160 | pub const getRawData = ZigClangAPSInt_getRawData; | |
| 161 | extern fn ZigClangAPSInt_getRawData(*const APSInt) [*:0]const u64; | |
| 162 | ||
| 163 | pub const getNumWords = ZigClangAPSInt_getNumWords; | |
| 164 | extern fn ZigClangAPSInt_getNumWords(*const APSInt) c_uint; | |
| 165 | ||
| 166 | pub const lessThanEqual = ZigClangAPSInt_lessThanEqual; | |
| 167 | extern fn ZigClangAPSInt_lessThanEqual(*const APSInt, rhs: u64) bool; | |
| 168 | }; | |
| 169 | ||
| 170 | pub const ASTContext = opaque { | |
| 171 | pub const getPointerType = ZigClangASTContext_getPointerType; | |
| 172 | extern fn ZigClangASTContext_getPointerType(*const ASTContext, T: QualType) QualType; | |
| 173 | }; | |
| 174 | ||
| 175 | pub const ASTUnit = opaque { | |
| 176 | pub const delete = ZigClangASTUnit_delete; | |
| 177 | extern fn ZigClangASTUnit_delete(*ASTUnit) void; | |
| 178 | ||
| 179 | pub const getASTContext = ZigClangASTUnit_getASTContext; | |
| 180 | extern fn ZigClangASTUnit_getASTContext(*ASTUnit) *ASTContext; | |
| 181 | ||
| 182 | pub const getSourceManager = ZigClangASTUnit_getSourceManager; | |
| 183 | extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager; | |
| 184 | ||
| 185 | pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls; | |
| 186 | extern fn ZigClangASTUnit_visitLocalTopLevelDecls( | |
| 187 | *ASTUnit, | |
| 188 | context: ?*anyopaque, | |
| 189 | Fn: ?*const fn (?*anyopaque, *const Decl) callconv(.c) bool, | |
| 190 | ) bool; | |
| 191 | ||
| 192 | pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin; | |
| 193 | extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator; | |
| 194 | ||
| 195 | pub const getLocalPreprocessingEntities_end = ZigClangASTUnit_getLocalPreprocessingEntities_end; | |
| 196 | extern fn ZigClangASTUnit_getLocalPreprocessingEntities_end(*ASTUnit) PreprocessingRecord.iterator; | |
| 197 | }; | |
| 198 | ||
| 199 | pub const ArraySubscriptExpr = opaque { | |
| 200 | pub const getBase = ZigClangArraySubscriptExpr_getBase; | |
| 201 | extern fn ZigClangArraySubscriptExpr_getBase(*const ArraySubscriptExpr) *const Expr; | |
| 202 | ||
| 203 | pub const getIdx = ZigClangArraySubscriptExpr_getIdx; | |
| 204 | extern fn ZigClangArraySubscriptExpr_getIdx(*const ArraySubscriptExpr) *const Expr; | |
| 205 | }; | |
| 206 | ||
| 207 | pub const ArrayType = opaque { | |
| 208 | pub const getElementType = ZigClangArrayType_getElementType; | |
| 209 | extern fn ZigClangArrayType_getElementType(*const ArrayType) QualType; | |
| 210 | }; | |
| 211 | ||
| 212 | pub const ASTRecordLayout = opaque { | |
| 213 | pub const getFieldOffset = ZigClangASTRecordLayout_getFieldOffset; | |
| 214 | extern fn ZigClangASTRecordLayout_getFieldOffset(*const ASTRecordLayout, c_uint) u64; | |
| 215 | ||
| 216 | pub const getAlignment = ZigClangASTRecordLayout_getAlignment; | |
| 217 | extern fn ZigClangASTRecordLayout_getAlignment(*const ASTRecordLayout) i64; | |
| 218 | }; | |
| 219 | ||
| 220 | pub const AttributedType = opaque { | |
| 221 | pub const getEquivalentType = ZigClangAttributedType_getEquivalentType; | |
| 222 | extern fn ZigClangAttributedType_getEquivalentType(*const AttributedType) QualType; | |
| 223 | }; | |
| 224 | ||
| 225 | pub const BinaryOperator = opaque { | |
| 226 | pub const getOpcode = ZigClangBinaryOperator_getOpcode; | |
| 227 | extern fn ZigClangBinaryOperator_getOpcode(*const BinaryOperator) BO; | |
| 228 | ||
| 229 | pub const getBeginLoc = ZigClangBinaryOperator_getBeginLoc; | |
| 230 | extern fn ZigClangBinaryOperator_getBeginLoc(*const BinaryOperator) SourceLocation; | |
| 231 | ||
| 232 | pub const getLHS = ZigClangBinaryOperator_getLHS; | |
| 233 | extern fn ZigClangBinaryOperator_getLHS(*const BinaryOperator) *const Expr; | |
| 234 | ||
| 235 | pub const getRHS = ZigClangBinaryOperator_getRHS; | |
| 236 | extern fn ZigClangBinaryOperator_getRHS(*const BinaryOperator) *const Expr; | |
| 237 | ||
| 238 | pub const getType = ZigClangBinaryOperator_getType; | |
| 239 | extern fn ZigClangBinaryOperator_getType(*const BinaryOperator) QualType; | |
| 240 | }; | |
| 241 | ||
| 242 | pub const BinaryConditionalOperator = opaque {}; | |
| 243 | ||
| 244 | pub const BreakStmt = opaque {}; | |
| 245 | ||
| 246 | pub const BuiltinType = opaque { | |
| 247 | pub const getKind = ZigClangBuiltinType_getKind; | |
| 248 | extern fn ZigClangBuiltinType_getKind(*const BuiltinType) BuiltinTypeKind; | |
| 249 | }; | |
| 250 | ||
| 251 | pub const CStyleCastExpr = opaque { | |
| 252 | pub const getBeginLoc = ZigClangCStyleCastExpr_getBeginLoc; | |
| 253 | extern fn ZigClangCStyleCastExpr_getBeginLoc(*const CStyleCastExpr) SourceLocation; | |
| 254 | ||
| 255 | pub const getSubExpr = ZigClangCStyleCastExpr_getSubExpr; | |
| 256 | extern fn ZigClangCStyleCastExpr_getSubExpr(*const CStyleCastExpr) *const Expr; | |
| 257 | ||
| 258 | pub const getType = ZigClangCStyleCastExpr_getType; | |
| 259 | extern fn ZigClangCStyleCastExpr_getType(*const CStyleCastExpr) QualType; | |
| 260 | }; | |
| 261 | ||
| 262 | pub const CallExpr = opaque { | |
| 263 | pub const getCallee = ZigClangCallExpr_getCallee; | |
| 264 | extern fn ZigClangCallExpr_getCallee(*const CallExpr) *const Expr; | |
| 265 | ||
| 266 | pub const getNumArgs = ZigClangCallExpr_getNumArgs; | |
| 267 | extern fn ZigClangCallExpr_getNumArgs(*const CallExpr) c_uint; | |
| 268 | ||
| 269 | pub const getArgs = ZigClangCallExpr_getArgs; | |
| 270 | extern fn ZigClangCallExpr_getArgs(*const CallExpr) [*]const *const Expr; | |
| 271 | }; | |
| 272 | ||
| 273 | pub const CaseStmt = opaque { | |
| 274 | pub const getLHS = ZigClangCaseStmt_getLHS; | |
| 275 | extern fn ZigClangCaseStmt_getLHS(*const CaseStmt) *const Expr; | |
| 276 | ||
| 277 | pub const getRHS = ZigClangCaseStmt_getRHS; | |
| 278 | extern fn ZigClangCaseStmt_getRHS(*const CaseStmt) ?*const Expr; | |
| 279 | ||
| 280 | pub const getBeginLoc = ZigClangCaseStmt_getBeginLoc; | |
| 281 | extern fn ZigClangCaseStmt_getBeginLoc(*const CaseStmt) SourceLocation; | |
| 282 | ||
| 283 | pub const getSubStmt = ZigClangCaseStmt_getSubStmt; | |
| 284 | extern fn ZigClangCaseStmt_getSubStmt(*const CaseStmt) *const Stmt; | |
| 285 | }; | |
| 286 | ||
| 287 | pub const CastExpr = opaque { | |
| 288 | pub const getCastKind = ZigClangCastExpr_getCastKind; | |
| 289 | extern fn ZigClangCastExpr_getCastKind(*const CastExpr) CK; | |
| 290 | ||
| 291 | pub const getTargetFieldForToUnionCast = ZigClangCastExpr_getTargetFieldForToUnionCast; | |
| 292 | extern fn ZigClangCastExpr_getTargetFieldForToUnionCast(*const CastExpr, QualType, QualType) ?*const FieldDecl; | |
| 293 | }; | |
| 294 | ||
| 295 | pub const CharacterLiteral = opaque { | |
| 296 | pub const getBeginLoc = ZigClangCharacterLiteral_getBeginLoc; | |
| 297 | extern fn ZigClangCharacterLiteral_getBeginLoc(*const CharacterLiteral) SourceLocation; | |
| 298 | ||
| 299 | pub const getKind = ZigClangCharacterLiteral_getKind; | |
| 300 | extern fn ZigClangCharacterLiteral_getKind(*const CharacterLiteral) CharacterLiteralKind; | |
| 301 | ||
| 302 | pub const getValue = ZigClangCharacterLiteral_getValue; | |
| 303 | extern fn ZigClangCharacterLiteral_getValue(*const CharacterLiteral) c_uint; | |
| 304 | }; | |
| 305 | ||
| 306 | pub const ChooseExpr = opaque { | |
| 307 | pub const getChosenSubExpr = ZigClangChooseExpr_getChosenSubExpr; | |
| 308 | extern fn ZigClangChooseExpr_getChosenSubExpr(*const ChooseExpr) *const Expr; | |
| 309 | }; | |
| 310 | ||
| 311 | pub const CompoundAssignOperator = opaque { | |
| 312 | pub const getType = ZigClangCompoundAssignOperator_getType; | |
| 313 | extern fn ZigClangCompoundAssignOperator_getType(*const CompoundAssignOperator) QualType; | |
| 314 | ||
| 315 | pub const getComputationLHSType = ZigClangCompoundAssignOperator_getComputationLHSType; | |
| 316 | extern fn ZigClangCompoundAssignOperator_getComputationLHSType(*const CompoundAssignOperator) QualType; | |
| 317 | ||
| 318 | pub const getComputationResultType = ZigClangCompoundAssignOperator_getComputationResultType; | |
| 319 | extern fn ZigClangCompoundAssignOperator_getComputationResultType(*const CompoundAssignOperator) QualType; | |
| 320 | ||
| 321 | pub const getBeginLoc = ZigClangCompoundAssignOperator_getBeginLoc; | |
| 322 | extern fn ZigClangCompoundAssignOperator_getBeginLoc(*const CompoundAssignOperator) SourceLocation; | |
| 323 | ||
| 324 | pub const getOpcode = ZigClangCompoundAssignOperator_getOpcode; | |
| 325 | extern fn ZigClangCompoundAssignOperator_getOpcode(*const CompoundAssignOperator) BO; | |
| 326 | ||
| 327 | pub const getLHS = ZigClangCompoundAssignOperator_getLHS; | |
| 328 | extern fn ZigClangCompoundAssignOperator_getLHS(*const CompoundAssignOperator) *const Expr; | |
| 329 | ||
| 330 | pub const getRHS = ZigClangCompoundAssignOperator_getRHS; | |
| 331 | extern fn ZigClangCompoundAssignOperator_getRHS(*const CompoundAssignOperator) *const Expr; | |
| 332 | }; | |
| 333 | ||
| 334 | pub const CompoundLiteralExpr = opaque { | |
| 335 | pub const getInitializer = ZigClangCompoundLiteralExpr_getInitializer; | |
| 336 | extern fn ZigClangCompoundLiteralExpr_getInitializer(*const CompoundLiteralExpr) *const Expr; | |
| 337 | }; | |
| 338 | ||
| 339 | pub const CompoundStmt = opaque { | |
| 340 | pub const body_begin = ZigClangCompoundStmt_body_begin; | |
| 341 | extern fn ZigClangCompoundStmt_body_begin(*const CompoundStmt) ConstBodyIterator; | |
| 342 | ||
| 343 | pub const body_end = ZigClangCompoundStmt_body_end; | |
| 344 | extern fn ZigClangCompoundStmt_body_end(*const CompoundStmt) ConstBodyIterator; | |
| 345 | ||
| 346 | pub const ConstBodyIterator = [*]const *Stmt; | |
| 347 | }; | |
| 348 | ||
| 349 | pub const ConditionalOperator = opaque {}; | |
| 350 | ||
| 351 | pub const ConstantArrayType = opaque { | |
| 352 | pub const getElementType = ZigClangConstantArrayType_getElementType; | |
| 353 | extern fn ZigClangConstantArrayType_getElementType(*const ConstantArrayType) QualType; | |
| 354 | ||
| 355 | pub const getSize = ZigClangConstantArrayType_getSize; | |
| 356 | extern fn ZigClangConstantArrayType_getSize(*const ConstantArrayType, **const APInt) void; | |
| 357 | }; | |
| 358 | ||
| 359 | pub const ConstantExpr = opaque {}; | |
| 360 | ||
| 361 | pub const ContinueStmt = opaque {}; | |
| 362 | ||
| 363 | pub const ConvertVectorExpr = opaque { | |
| 364 | pub const getSrcExpr = ZigClangConvertVectorExpr_getSrcExpr; | |
| 365 | extern fn ZigClangConvertVectorExpr_getSrcExpr(*const ConvertVectorExpr) *const Expr; | |
| 366 | ||
| 367 | pub const getTypeSourceInfo_getType = ZigClangConvertVectorExpr_getTypeSourceInfo_getType; | |
| 368 | extern fn ZigClangConvertVectorExpr_getTypeSourceInfo_getType(*const ConvertVectorExpr) QualType; | |
| 369 | }; | |
| 370 | ||
| 371 | pub const DecayedType = opaque { | |
| 372 | pub const getDecayedType = ZigClangDecayedType_getDecayedType; | |
| 373 | extern fn ZigClangDecayedType_getDecayedType(*const DecayedType) QualType; | |
| 374 | }; | |
| 375 | ||
| 376 | pub const Decl = opaque { | |
| 377 | pub const getLocation = ZigClangDecl_getLocation; | |
| 378 | extern fn ZigClangDecl_getLocation(*const Decl) SourceLocation; | |
| 379 | ||
| 380 | pub const castToNamedDecl = ZigClangDecl_castToNamedDecl; | |
| 381 | extern fn ZigClangDecl_castToNamedDecl(decl: *const Decl) ?*const NamedDecl; | |
| 382 | ||
| 383 | pub const getKind = ZigClangDecl_getKind; | |
| 384 | extern fn ZigClangDecl_getKind(decl: *const Decl) DeclKind; | |
| 385 | ||
| 386 | pub const getDeclKindName = ZigClangDecl_getDeclKindName; | |
| 387 | extern fn ZigClangDecl_getDeclKindName(decl: *const Decl) [*:0]const u8; | |
| 388 | }; | |
| 389 | ||
| 390 | pub const DeclRefExpr = opaque { | |
| 391 | pub const getDecl = ZigClangDeclRefExpr_getDecl; | |
| 392 | extern fn ZigClangDeclRefExpr_getDecl(*const DeclRefExpr) *const ValueDecl; | |
| 393 | ||
| 394 | pub const getFoundDecl = ZigClangDeclRefExpr_getFoundDecl; | |
| 395 | extern fn ZigClangDeclRefExpr_getFoundDecl(*const DeclRefExpr) *const NamedDecl; | |
| 396 | }; | |
| 397 | ||
| 398 | pub const DeclStmt = opaque { | |
| 399 | pub const decl_begin = ZigClangDeclStmt_decl_begin; | |
| 400 | extern fn ZigClangDeclStmt_decl_begin(*const DeclStmt) const_decl_iterator; | |
| 401 | ||
| 402 | pub const decl_end = ZigClangDeclStmt_decl_end; | |
| 403 | extern fn ZigClangDeclStmt_decl_end(*const DeclStmt) const_decl_iterator; | |
| 404 | ||
| 405 | pub const const_decl_iterator = [*]const *Decl; | |
| 406 | }; | |
| 407 | ||
| 408 | pub const DefaultStmt = opaque { | |
| 409 | pub const getSubStmt = ZigClangDefaultStmt_getSubStmt; | |
| 410 | extern fn ZigClangDefaultStmt_getSubStmt(*const DefaultStmt) *const Stmt; | |
| 411 | }; | |
| 412 | ||
| 413 | pub const DiagnosticOptions = opaque {}; | |
| 414 | ||
| 415 | pub const DiagnosticsEngine = opaque {}; | |
| 416 | ||
| 417 | pub const DoStmt = opaque { | |
| 418 | pub const getCond = ZigClangDoStmt_getCond; | |
| 419 | extern fn ZigClangDoStmt_getCond(*const DoStmt) *const Expr; | |
| 420 | ||
| 421 | pub const getBody = ZigClangDoStmt_getBody; | |
| 422 | extern fn ZigClangDoStmt_getBody(*const DoStmt) *const Stmt; | |
| 423 | }; | |
| 424 | ||
| 425 | pub const ElaboratedType = opaque { | |
| 426 | pub const getNamedType = ZigClangElaboratedType_getNamedType; | |
| 427 | extern fn ZigClangElaboratedType_getNamedType(*const ElaboratedType) QualType; | |
| 428 | }; | |
| 429 | ||
| 430 | pub const EnumConstantDecl = opaque { | |
| 431 | pub const getInitVal = ZigClangEnumConstantDecl_getInitVal; | |
| 432 | extern fn ZigClangEnumConstantDecl_getInitVal(*const EnumConstantDecl) *const APSInt; | |
| 433 | }; | |
| 434 | ||
| 435 | pub const EnumDecl = opaque { | |
| 436 | pub const getCanonicalDecl = ZigClangEnumDecl_getCanonicalDecl; | |
| 437 | extern fn ZigClangEnumDecl_getCanonicalDecl(*const EnumDecl) ?*const TagDecl; | |
| 438 | ||
| 439 | pub const getIntegerType = ZigClangEnumDecl_getIntegerType; | |
| 440 | extern fn ZigClangEnumDecl_getIntegerType(*const EnumDecl) QualType; | |
| 441 | ||
| 442 | pub const getDefinition = ZigClangEnumDecl_getDefinition; | |
| 443 | extern fn ZigClangEnumDecl_getDefinition(*const EnumDecl) ?*const EnumDecl; | |
| 444 | ||
| 445 | pub const getLocation = ZigClangEnumDecl_getLocation; | |
| 446 | extern fn ZigClangEnumDecl_getLocation(*const EnumDecl) SourceLocation; | |
| 447 | ||
| 448 | pub const enumerator_begin = ZigClangEnumDecl_enumerator_begin; | |
| 449 | extern fn ZigClangEnumDecl_enumerator_begin(*const EnumDecl) enumerator_iterator; | |
| 450 | ||
| 451 | pub const enumerator_end = ZigClangEnumDecl_enumerator_end; | |
| 452 | extern fn ZigClangEnumDecl_enumerator_end(*const EnumDecl) enumerator_iterator; | |
| 453 | ||
| 454 | pub const enumerator_iterator = extern struct { | |
| 455 | ptr: *anyopaque, | |
| 456 | ||
| 457 | pub const next = ZigClangEnumDecl_enumerator_iterator_next; | |
| 458 | extern fn ZigClangEnumDecl_enumerator_iterator_next(enumerator_iterator) enumerator_iterator; | |
| 459 | ||
| 460 | pub const deref = ZigClangEnumDecl_enumerator_iterator_deref; | |
| 461 | extern fn ZigClangEnumDecl_enumerator_iterator_deref(enumerator_iterator) *const EnumConstantDecl; | |
| 462 | ||
| 463 | pub const neq = ZigClangEnumDecl_enumerator_iterator_neq; | |
| 464 | extern fn ZigClangEnumDecl_enumerator_iterator_neq(enumerator_iterator, enumerator_iterator) bool; | |
| 465 | }; | |
| 466 | }; | |
| 467 | ||
| 468 | pub const EnumType = opaque { | |
| 469 | pub const getDecl = ZigClangEnumType_getDecl; | |
| 470 | extern fn ZigClangEnumType_getDecl(*const EnumType) *const EnumDecl; | |
| 471 | }; | |
| 472 | ||
| 473 | pub const Expr = opaque { | |
| 474 | pub const getStmtClass = ZigClangExpr_getStmtClass; | |
| 475 | extern fn ZigClangExpr_getStmtClass(*const Expr) StmtClass; | |
| 476 | ||
| 477 | pub const getType = ZigClangExpr_getType; | |
| 478 | extern fn ZigClangExpr_getType(*const Expr) QualType; | |
| 479 | ||
| 480 | pub const getBeginLoc = ZigClangExpr_getBeginLoc; | |
| 481 | extern fn ZigClangExpr_getBeginLoc(*const Expr) SourceLocation; | |
| 482 | ||
| 483 | pub const evaluateAsConstantExpr = ZigClangExpr_EvaluateAsConstantExpr; | |
| 484 | extern fn ZigClangExpr_EvaluateAsConstantExpr(*const Expr, *ExprEvalResult, Expr_ConstantExprKind, *const ASTContext) bool; | |
| 485 | ||
| 486 | pub const castToStringLiteral = ZigClangExpr_castToStringLiteral; | |
| 487 | extern fn ZigClangExpr_castToStringLiteral(*const Expr) ?*const StringLiteral; | |
| 488 | }; | |
| 489 | ||
| 490 | pub const FieldDecl = opaque { | |
| 491 | pub const getCanonicalDecl = ZigClangFieldDecl_getCanonicalDecl; | |
| 492 | extern fn ZigClangFieldDecl_getCanonicalDecl(*const FieldDecl) ?*const FieldDecl; | |
| 493 | ||
| 494 | pub const getAlignedAttribute = ZigClangFieldDecl_getAlignedAttribute; | |
| 495 | extern fn ZigClangFieldDecl_getAlignedAttribute(*const FieldDecl, *const ASTContext) c_uint; | |
| 496 | ||
| 497 | pub const getPackedAttribute = ZigClangFieldDecl_getPackedAttribute; | |
| 498 | extern fn ZigClangFieldDecl_getPackedAttribute(*const FieldDecl) bool; | |
| 499 | ||
| 500 | pub const isAnonymousStructOrUnion = ZigClangFieldDecl_isAnonymousStructOrUnion; | |
| 501 | extern fn ZigClangFieldDecl_isAnonymousStructOrUnion(*const FieldDecl) bool; | |
| 502 | ||
| 503 | pub const isBitField = ZigClangFieldDecl_isBitField; | |
| 504 | extern fn ZigClangFieldDecl_isBitField(*const FieldDecl) bool; | |
| 505 | ||
| 506 | pub const getType = ZigClangFieldDecl_getType; | |
| 507 | extern fn ZigClangFieldDecl_getType(*const FieldDecl) QualType; | |
| 508 | ||
| 509 | pub const getLocation = ZigClangFieldDecl_getLocation; | |
| 510 | extern fn ZigClangFieldDecl_getLocation(*const FieldDecl) SourceLocation; | |
| 511 | ||
| 512 | pub const getParent = ZigClangFieldDecl_getParent; | |
| 513 | extern fn ZigClangFieldDecl_getParent(*const FieldDecl) ?*const RecordDecl; | |
| 514 | ||
| 515 | pub const getFieldIndex = ZigClangFieldDecl_getFieldIndex; | |
| 516 | extern fn ZigClangFieldDecl_getFieldIndex(*const FieldDecl) c_uint; | |
| 517 | }; | |
| 518 | ||
| 519 | pub const FileID = opaque {}; | |
| 520 | ||
| 521 | pub const FloatingLiteral = opaque { | |
| 522 | pub const getValueAsApproximateDouble = ZigClangFloatingLiteral_getValueAsApproximateDouble; | |
| 523 | extern fn ZigClangFloatingLiteral_getValueAsApproximateDouble(*const FloatingLiteral) f64; | |
| 524 | ||
| 525 | pub const getValueAsApproximateQuadBits = ZigClangFloatingLiteral_getValueAsApproximateQuadBits; | |
| 526 | extern fn ZigClangFloatingLiteral_getValueAsApproximateQuadBits(*const FloatingLiteral, low: *u64, high: *u64) void; | |
| 527 | ||
| 528 | pub const getBeginLoc = ZigClangFloatingLiteral_getBeginLoc; | |
| 529 | extern fn ZigClangFloatingLiteral_getBeginLoc(*const FloatingLiteral) SourceLocation; | |
| 530 | ||
| 531 | pub const getRawSemantics = ZigClangFloatingLiteral_getRawSemantics; | |
| 532 | extern fn ZigClangFloatingLiteral_getRawSemantics(*const FloatingLiteral) APFloatBaseSemantics; | |
| 533 | }; | |
| 534 | ||
| 535 | pub const ForStmt = opaque { | |
| 536 | pub const getInit = ZigClangForStmt_getInit; | |
| 537 | extern fn ZigClangForStmt_getInit(*const ForStmt) ?*const Stmt; | |
| 538 | ||
| 539 | pub const getCond = ZigClangForStmt_getCond; | |
| 540 | extern fn ZigClangForStmt_getCond(*const ForStmt) ?*const Expr; | |
| 541 | ||
| 542 | pub const getInc = ZigClangForStmt_getInc; | |
| 543 | extern fn ZigClangForStmt_getInc(*const ForStmt) ?*const Expr; | |
| 544 | ||
| 545 | pub const getBody = ZigClangForStmt_getBody; | |
| 546 | extern fn ZigClangForStmt_getBody(*const ForStmt) *const Stmt; | |
| 547 | }; | |
| 548 | ||
| 549 | pub const FullSourceLoc = opaque {}; | |
| 550 | ||
| 551 | pub const FunctionDecl = opaque { | |
| 552 | pub const getType = ZigClangFunctionDecl_getType; | |
| 553 | extern fn ZigClangFunctionDecl_getType(*const FunctionDecl) QualType; | |
| 554 | ||
| 555 | pub const getLocation = ZigClangFunctionDecl_getLocation; | |
| 556 | extern fn ZigClangFunctionDecl_getLocation(*const FunctionDecl) SourceLocation; | |
| 557 | ||
| 558 | pub const hasBody = ZigClangFunctionDecl_hasBody; | |
| 559 | extern fn ZigClangFunctionDecl_hasBody(*const FunctionDecl) bool; | |
| 560 | ||
| 561 | pub const getStorageClass = ZigClangFunctionDecl_getStorageClass; | |
| 562 | extern fn ZigClangFunctionDecl_getStorageClass(*const FunctionDecl) StorageClass; | |
| 563 | ||
| 564 | pub const getParamDecl = ZigClangFunctionDecl_getParamDecl; | |
| 565 | extern fn ZigClangFunctionDecl_getParamDecl(*const FunctionDecl, i: c_uint) *const ParmVarDecl; | |
| 566 | ||
| 567 | pub const getBody = ZigClangFunctionDecl_getBody; | |
| 568 | extern fn ZigClangFunctionDecl_getBody(*const FunctionDecl) *const Stmt; | |
| 569 | ||
| 570 | pub const doesDeclarationForceExternallyVisibleDefinition = ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition; | |
| 571 | extern fn ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(*const FunctionDecl) bool; | |
| 572 | ||
| 573 | pub const isThisDeclarationADefinition = ZigClangFunctionDecl_isThisDeclarationADefinition; | |
| 574 | extern fn ZigClangFunctionDecl_isThisDeclarationADefinition(*const FunctionDecl) bool; | |
| 575 | ||
| 576 | pub const doesThisDeclarationHaveABody = ZigClangFunctionDecl_doesThisDeclarationHaveABody; | |
| 577 | extern fn ZigClangFunctionDecl_doesThisDeclarationHaveABody(*const FunctionDecl) bool; | |
| 578 | ||
| 579 | pub const isInlineSpecified = ZigClangFunctionDecl_isInlineSpecified; | |
| 580 | extern fn ZigClangFunctionDecl_isInlineSpecified(*const FunctionDecl) bool; | |
| 581 | ||
| 582 | pub const hasAlwaysInlineAttr = ZigClangFunctionDecl_hasAlwaysInlineAttr; | |
| 583 | extern fn ZigClangFunctionDecl_hasAlwaysInlineAttr(*const FunctionDecl) bool; | |
| 584 | ||
| 585 | pub const isDefined = ZigClangFunctionDecl_isDefined; | |
| 586 | extern fn ZigClangFunctionDecl_isDefined(*const FunctionDecl) bool; | |
| 587 | ||
| 588 | pub const getDefinition = ZigClangFunctionDecl_getDefinition; | |
| 589 | extern fn ZigClangFunctionDecl_getDefinition(*const FunctionDecl) ?*const FunctionDecl; | |
| 590 | ||
| 591 | pub const getSectionAttribute = ZigClangFunctionDecl_getSectionAttribute; | |
| 592 | extern fn ZigClangFunctionDecl_getSectionAttribute(*const FunctionDecl, len: *usize) ?[*]const u8; | |
| 593 | ||
| 594 | pub const getCanonicalDecl = ZigClangFunctionDecl_getCanonicalDecl; | |
| 595 | extern fn ZigClangFunctionDecl_getCanonicalDecl(*const FunctionDecl) ?*const FunctionDecl; | |
| 596 | ||
| 597 | pub const getAlignedAttribute = ZigClangFunctionDecl_getAlignedAttribute; | |
| 598 | extern fn ZigClangFunctionDecl_getAlignedAttribute(*const FunctionDecl, *const ASTContext) c_uint; | |
| 599 | }; | |
| 600 | ||
| 601 | pub const FunctionProtoType = opaque { | |
| 602 | pub const isVariadic = ZigClangFunctionProtoType_isVariadic; | |
| 603 | extern fn ZigClangFunctionProtoType_isVariadic(*const FunctionProtoType) bool; | |
| 604 | ||
| 605 | pub const getNumParams = ZigClangFunctionProtoType_getNumParams; | |
| 606 | extern fn ZigClangFunctionProtoType_getNumParams(*const FunctionProtoType) c_uint; | |
| 607 | ||
| 608 | pub const getParamType = ZigClangFunctionProtoType_getParamType; | |
| 609 | extern fn ZigClangFunctionProtoType_getParamType(*const FunctionProtoType, i: c_uint) QualType; | |
| 610 | ||
| 611 | pub const getReturnType = ZigClangFunctionProtoType_getReturnType; | |
| 612 | extern fn ZigClangFunctionProtoType_getReturnType(*const FunctionProtoType) QualType; | |
| 613 | }; | |
| 614 | ||
| 615 | pub const FunctionType = opaque { | |
| 616 | pub const getNoReturnAttr = ZigClangFunctionType_getNoReturnAttr; | |
| 617 | extern fn ZigClangFunctionType_getNoReturnAttr(*const FunctionType) bool; | |
| 618 | ||
| 619 | pub const getCallConv = ZigClangFunctionType_getCallConv; | |
| 620 | extern fn ZigClangFunctionType_getCallConv(*const FunctionType) CallingConv; | |
| 621 | ||
| 622 | pub const getReturnType = ZigClangFunctionType_getReturnType; | |
| 623 | extern fn ZigClangFunctionType_getReturnType(*const FunctionType) QualType; | |
| 624 | }; | |
| 625 | ||
| 626 | pub const GenericSelectionExpr = opaque { | |
| 627 | pub const getResultExpr = ZigClangGenericSelectionExpr_getResultExpr; | |
| 628 | extern fn ZigClangGenericSelectionExpr_getResultExpr(*const GenericSelectionExpr) *const Expr; | |
| 629 | }; | |
| 630 | ||
| 631 | pub const IfStmt = opaque { | |
| 632 | pub const getThen = ZigClangIfStmt_getThen; | |
| 633 | extern fn ZigClangIfStmt_getThen(*const IfStmt) *const Stmt; | |
| 634 | ||
| 635 | pub const getElse = ZigClangIfStmt_getElse; | |
| 636 | extern fn ZigClangIfStmt_getElse(*const IfStmt) ?*const Stmt; | |
| 637 | ||
| 638 | pub const getCond = ZigClangIfStmt_getCond; | |
| 639 | extern fn ZigClangIfStmt_getCond(*const IfStmt) *const Stmt; | |
| 640 | }; | |
| 641 | ||
| 642 | pub const ImplicitCastExpr = opaque { | |
| 643 | pub const getBeginLoc = ZigClangImplicitCastExpr_getBeginLoc; | |
| 644 | extern fn ZigClangImplicitCastExpr_getBeginLoc(*const ImplicitCastExpr) SourceLocation; | |
| 645 | ||
| 646 | pub const getCastKind = ZigClangImplicitCastExpr_getCastKind; | |
| 647 | extern fn ZigClangImplicitCastExpr_getCastKind(*const ImplicitCastExpr) CK; | |
| 648 | ||
| 649 | pub const getSubExpr = ZigClangImplicitCastExpr_getSubExpr; | |
| 650 | extern fn ZigClangImplicitCastExpr_getSubExpr(*const ImplicitCastExpr) *const Expr; | |
| 651 | }; | |
| 652 | ||
| 653 | pub const IncompleteArrayType = opaque { | |
| 654 | pub const getElementType = ZigClangIncompleteArrayType_getElementType; | |
| 655 | extern fn ZigClangIncompleteArrayType_getElementType(*const IncompleteArrayType) QualType; | |
| 656 | }; | |
| 657 | ||
| 658 | pub const IntegerLiteral = opaque { | |
| 659 | pub const EvaluateAsInt = ZigClangIntegerLiteral_EvaluateAsInt; | |
| 660 | extern fn ZigClangIntegerLiteral_EvaluateAsInt(*const IntegerLiteral, *ExprEvalResult, *const ASTContext) bool; | |
| 661 | ||
| 662 | pub const getBeginLoc = ZigClangIntegerLiteral_getBeginLoc; | |
| 663 | extern fn ZigClangIntegerLiteral_getBeginLoc(*const IntegerLiteral) SourceLocation; | |
| 664 | ||
| 665 | pub const getSignum = ZigClangIntegerLiteral_getSignum; | |
| 666 | extern fn ZigClangIntegerLiteral_getSignum(*const IntegerLiteral, *c_int, *const ASTContext) bool; | |
| 667 | }; | |
| 668 | ||
| 669 | /// This is just used as a namespace for a static method on clang's Lexer class; we don't directly | |
| 670 | /// deal with Lexer objects | |
| 671 | pub const Lexer = struct { | |
| 672 | pub const getLocForEndOfToken = ZigClangLexer_getLocForEndOfToken; | |
| 673 | extern fn ZigClangLexer_getLocForEndOfToken(SourceLocation, *const SourceManager, *const ASTUnit) SourceLocation; | |
| 674 | }; | |
| 675 | ||
| 676 | pub const MacroDefinitionRecord = opaque { | |
| 677 | pub const getName_getNameStart = ZigClangMacroDefinitionRecord_getName_getNameStart; | |
| 678 | extern fn ZigClangMacroDefinitionRecord_getName_getNameStart(*const MacroDefinitionRecord) [*:0]const u8; | |
| 679 | ||
| 680 | pub const getSourceRange_getBegin = ZigClangMacroDefinitionRecord_getSourceRange_getBegin; | |
| 681 | extern fn ZigClangMacroDefinitionRecord_getSourceRange_getBegin(*const MacroDefinitionRecord) SourceLocation; | |
| 682 | ||
| 683 | pub const getSourceRange_getEnd = ZigClangMacroDefinitionRecord_getSourceRange_getEnd; | |
| 684 | extern fn ZigClangMacroDefinitionRecord_getSourceRange_getEnd(*const MacroDefinitionRecord) SourceLocation; | |
| 685 | }; | |
| 686 | ||
| 687 | pub const MacroQualifiedType = opaque { | |
| 688 | pub const getModifiedType = ZigClangMacroQualifiedType_getModifiedType; | |
| 689 | extern fn ZigClangMacroQualifiedType_getModifiedType(*const MacroQualifiedType) QualType; | |
| 690 | }; | |
| 691 | ||
| 692 | pub const TypeOfType = opaque { | |
| 693 | pub const getUnmodifiedType = ZigClangTypeOfType_getUnmodifiedType; | |
| 694 | extern fn ZigClangTypeOfType_getUnmodifiedType(*const TypeOfType) QualType; | |
| 695 | }; | |
| 696 | ||
| 697 | pub const TypeOfExprType = opaque { | |
| 698 | pub const getUnderlyingExpr = ZigClangTypeOfExprType_getUnderlyingExpr; | |
| 699 | extern fn ZigClangTypeOfExprType_getUnderlyingExpr(*const TypeOfExprType) *const Expr; | |
| 700 | }; | |
| 701 | ||
| 702 | pub const OffsetOfNode = opaque { | |
| 703 | pub const getKind = ZigClangOffsetOfNode_getKind; | |
| 704 | extern fn ZigClangOffsetOfNode_getKind(*const OffsetOfNode) OffsetOfNode_Kind; | |
| 705 | ||
| 706 | pub const getArrayExprIndex = ZigClangOffsetOfNode_getArrayExprIndex; | |
| 707 | extern fn ZigClangOffsetOfNode_getArrayExprIndex(*const OffsetOfNode) c_uint; | |
| 708 | ||
| 709 | pub const getField = ZigClangOffsetOfNode_getField; | |
| 710 | extern fn ZigClangOffsetOfNode_getField(*const OffsetOfNode) *FieldDecl; | |
| 711 | }; | |
| 712 | ||
| 713 | pub const OffsetOfExpr = opaque { | |
| 714 | pub const getNumComponents = ZigClangOffsetOfExpr_getNumComponents; | |
| 715 | extern fn ZigClangOffsetOfExpr_getNumComponents(*const OffsetOfExpr) c_uint; | |
| 716 | ||
| 717 | pub const getNumExpressions = ZigClangOffsetOfExpr_getNumExpressions; | |
| 718 | extern fn ZigClangOffsetOfExpr_getNumExpressions(*const OffsetOfExpr) c_uint; | |
| 719 | ||
| 720 | pub const getIndexExpr = ZigClangOffsetOfExpr_getIndexExpr; | |
| 721 | extern fn ZigClangOffsetOfExpr_getIndexExpr(*const OffsetOfExpr, idx: c_uint) *const Expr; | |
| 722 | ||
| 723 | pub const getComponent = ZigClangOffsetOfExpr_getComponent; | |
| 724 | extern fn ZigClangOffsetOfExpr_getComponent(*const OffsetOfExpr, idx: c_uint) *const OffsetOfNode; | |
| 725 | ||
| 726 | pub const getBeginLoc = ZigClangOffsetOfExpr_getBeginLoc; | |
| 727 | extern fn ZigClangOffsetOfExpr_getBeginLoc(*const OffsetOfExpr) SourceLocation; | |
| 728 | }; | |
| 729 | ||
| 730 | pub const MemberExpr = opaque { | |
| 731 | pub const getBase = ZigClangMemberExpr_getBase; | |
| 732 | extern fn ZigClangMemberExpr_getBase(*const MemberExpr) *const Expr; | |
| 733 | ||
| 734 | pub const isArrow = ZigClangMemberExpr_isArrow; | |
| 735 | extern fn ZigClangMemberExpr_isArrow(*const MemberExpr) bool; | |
| 736 | ||
| 737 | pub const getMemberDecl = ZigClangMemberExpr_getMemberDecl; | |
| 738 | extern fn ZigClangMemberExpr_getMemberDecl(*const MemberExpr) *const ValueDecl; | |
| 739 | }; | |
| 740 | ||
| 741 | pub const NamedDecl = opaque { | |
| 742 | pub const getName_bytes_begin = ZigClangNamedDecl_getName_bytes_begin; | |
| 743 | extern fn ZigClangNamedDecl_getName_bytes_begin(decl: *const NamedDecl) [*:0]const u8; | |
| 744 | }; | |
| 745 | ||
| 746 | pub const None = opaque {}; | |
| 747 | ||
| 748 | pub const OpaqueValueExpr = opaque { | |
| 749 | pub const getSourceExpr = ZigClangOpaqueValueExpr_getSourceExpr; | |
| 750 | extern fn ZigClangOpaqueValueExpr_getSourceExpr(*const OpaqueValueExpr) ?*const Expr; | |
| 751 | }; | |
| 752 | ||
| 753 | pub const PCHContainerOperations = opaque {}; | |
| 754 | ||
| 755 | pub const ParenExpr = opaque { | |
| 756 | pub const getSubExpr = ZigClangParenExpr_getSubExpr; | |
| 757 | extern fn ZigClangParenExpr_getSubExpr(*const ParenExpr) *const Expr; | |
| 758 | }; | |
| 759 | ||
| 760 | pub const ParenType = opaque { | |
| 761 | pub const getInnerType = ZigClangParenType_getInnerType; | |
| 762 | extern fn ZigClangParenType_getInnerType(*const ParenType) QualType; | |
| 763 | }; | |
| 764 | ||
| 765 | pub const ParmVarDecl = opaque { | |
| 766 | pub const getOriginalType = ZigClangParmVarDecl_getOriginalType; | |
| 767 | extern fn ZigClangParmVarDecl_getOriginalType(*const ParmVarDecl) QualType; | |
| 768 | }; | |
| 769 | ||
| 770 | pub const PointerType = opaque {}; | |
| 771 | ||
| 772 | pub const PredefinedExpr = opaque { | |
| 773 | pub const getFunctionName = ZigClangPredefinedExpr_getFunctionName; | |
| 774 | extern fn ZigClangPredefinedExpr_getFunctionName(*const PredefinedExpr) *const StringLiteral; | |
| 775 | }; | |
| 776 | ||
| 777 | pub const PreprocessedEntity = opaque { | |
| 778 | pub const getKind = ZigClangPreprocessedEntity_getKind; | |
| 779 | extern fn ZigClangPreprocessedEntity_getKind(*const PreprocessedEntity) PreprocessedEntity_EntityKind; | |
| 780 | }; | |
| 781 | ||
| 782 | pub const PreprocessingRecord = opaque { | |
| 783 | pub const iterator = extern struct { | |
| 784 | I: c_int, | |
| 785 | Self: *PreprocessingRecord, | |
| 786 | ||
| 787 | pub const deref = ZigClangPreprocessingRecord_iterator_deref; | |
| 788 | extern fn ZigClangPreprocessingRecord_iterator_deref(iterator) *PreprocessedEntity; | |
| 789 | }; | |
| 790 | }; | |
| 791 | ||
| 792 | pub const RecordDecl = opaque { | |
| 793 | pub const getCanonicalDecl = ZigClangRecordDecl_getCanonicalDecl; | |
| 794 | extern fn ZigClangRecordDecl_getCanonicalDecl(*const RecordDecl) ?*const TagDecl; | |
| 795 | ||
| 796 | pub const isUnion = ZigClangRecordDecl_isUnion; | |
| 797 | extern fn ZigClangRecordDecl_isUnion(*const RecordDecl) bool; | |
| 798 | ||
| 799 | pub const isStruct = ZigClangRecordDecl_isStruct; | |
| 800 | extern fn ZigClangRecordDecl_isStruct(*const RecordDecl) bool; | |
| 801 | ||
| 802 | pub const isAnonymousStructOrUnion = ZigClangRecordDecl_isAnonymousStructOrUnion; | |
| 803 | extern fn ZigClangRecordDecl_isAnonymousStructOrUnion(record_decl: ?*const RecordDecl) bool; | |
| 804 | ||
| 805 | pub const getPackedAttribute = ZigClangRecordDecl_getPackedAttribute; | |
| 806 | extern fn ZigClangRecordDecl_getPackedAttribute(*const RecordDecl) bool; | |
| 807 | ||
| 808 | pub const getDefinition = ZigClangRecordDecl_getDefinition; | |
| 809 | extern fn ZigClangRecordDecl_getDefinition(*const RecordDecl) ?*const RecordDecl; | |
| 810 | ||
| 811 | pub const getLocation = ZigClangRecordDecl_getLocation; | |
| 812 | extern fn ZigClangRecordDecl_getLocation(*const RecordDecl) SourceLocation; | |
| 813 | ||
| 814 | pub const getASTRecordLayout = ZigClangRecordDecl_getASTRecordLayout; | |
| 815 | extern fn ZigClangRecordDecl_getASTRecordLayout(*const RecordDecl, *const ASTContext) *const ASTRecordLayout; | |
| 816 | ||
| 817 | pub const field_begin = ZigClangRecordDecl_field_begin; | |
| 818 | extern fn ZigClangRecordDecl_field_begin(*const RecordDecl) field_iterator; | |
| 819 | ||
| 820 | pub const field_end = ZigClangRecordDecl_field_end; | |
| 821 | extern fn ZigClangRecordDecl_field_end(*const RecordDecl) field_iterator; | |
| 822 | ||
| 823 | pub const field_iterator = extern struct { | |
| 824 | ptr: *anyopaque, | |
| 825 | ||
| 826 | pub const next = ZigClangRecordDecl_field_iterator_next; | |
| 827 | extern fn ZigClangRecordDecl_field_iterator_next(field_iterator) field_iterator; | |
| 828 | ||
| 829 | pub const deref = ZigClangRecordDecl_field_iterator_deref; | |
| 830 | extern fn ZigClangRecordDecl_field_iterator_deref(field_iterator) *const FieldDecl; | |
| 831 | ||
| 832 | pub const neq = ZigClangRecordDecl_field_iterator_neq; | |
| 833 | extern fn ZigClangRecordDecl_field_iterator_neq(field_iterator, field_iterator) bool; | |
| 834 | }; | |
| 835 | }; | |
| 836 | ||
| 837 | pub const RecordType = opaque { | |
| 838 | pub const getDecl = ZigClangRecordType_getDecl; | |
| 839 | extern fn ZigClangRecordType_getDecl(*const RecordType) *const RecordDecl; | |
| 840 | }; | |
| 841 | ||
| 842 | pub const ReturnStmt = opaque { | |
| 843 | pub const getRetValue = ZigClangReturnStmt_getRetValue; | |
| 844 | extern fn ZigClangReturnStmt_getRetValue(*const ReturnStmt) ?*const Expr; | |
| 845 | }; | |
| 846 | ||
| 847 | pub const ShuffleVectorExpr = opaque { | |
| 848 | pub const getNumSubExprs = ZigClangShuffleVectorExpr_getNumSubExprs; | |
| 849 | extern fn ZigClangShuffleVectorExpr_getNumSubExprs(*const ShuffleVectorExpr) c_uint; | |
| 850 | ||
| 851 | pub const getExpr = ZigClangShuffleVectorExpr_getExpr; | |
| 852 | extern fn ZigClangShuffleVectorExpr_getExpr(*const ShuffleVectorExpr, c_uint) *const Expr; | |
| 853 | }; | |
| 854 | ||
| 855 | pub const SourceManager = opaque { | |
| 856 | pub const getSpellingLoc = ZigClangSourceManager_getSpellingLoc; | |
| 857 | extern fn ZigClangSourceManager_getSpellingLoc(*const SourceManager, Loc: SourceLocation) SourceLocation; | |
| 858 | ||
| 859 | pub const getFilename = ZigClangSourceManager_getFilename; | |
| 860 | extern fn ZigClangSourceManager_getFilename(*const SourceManager, SpellingLoc: SourceLocation) ?[*:0]const u8; | |
| 861 | ||
| 862 | pub const getSpellingLineNumber = ZigClangSourceManager_getSpellingLineNumber; | |
| 863 | extern fn ZigClangSourceManager_getSpellingLineNumber(*const SourceManager, Loc: SourceLocation) c_uint; | |
| 864 | ||
| 865 | pub const getSpellingColumnNumber = ZigClangSourceManager_getSpellingColumnNumber; | |
| 866 | extern fn ZigClangSourceManager_getSpellingColumnNumber(*const SourceManager, Loc: SourceLocation) c_uint; | |
| 867 | ||
| 868 | pub const getCharacterData = ZigClangSourceManager_getCharacterData; | |
| 869 | extern fn ZigClangSourceManager_getCharacterData(*const SourceManager, SL: SourceLocation) [*:0]const u8; | |
| 870 | }; | |
| 871 | ||
| 872 | pub const SourceRange = opaque {}; | |
| 873 | ||
| 874 | pub const Stmt = opaque { | |
| 875 | pub const getBeginLoc = ZigClangStmt_getBeginLoc; | |
| 876 | extern fn ZigClangStmt_getBeginLoc(*const Stmt) SourceLocation; | |
| 877 | ||
| 878 | pub const getStmtClass = ZigClangStmt_getStmtClass; | |
| 879 | extern fn ZigClangStmt_getStmtClass(*const Stmt) StmtClass; | |
| 880 | ||
| 881 | pub const classof_Expr = ZigClangStmt_classof_Expr; | |
| 882 | extern fn ZigClangStmt_classof_Expr(*const Stmt) bool; | |
| 883 | }; | |
| 884 | ||
| 885 | pub const StmtExpr = opaque { | |
| 886 | pub const getSubStmt = ZigClangStmtExpr_getSubStmt; | |
| 887 | extern fn ZigClangStmtExpr_getSubStmt(*const StmtExpr) *const CompoundStmt; | |
| 888 | }; | |
| 889 | ||
| 890 | pub const StringLiteral = opaque { | |
| 891 | pub const getKind = ZigClangStringLiteral_getKind; | |
| 892 | extern fn ZigClangStringLiteral_getKind(*const StringLiteral) CharacterLiteralKind; | |
| 893 | ||
| 894 | pub const getCodeUnit = ZigClangStringLiteral_getCodeUnit; | |
| 895 | extern fn ZigClangStringLiteral_getCodeUnit(*const StringLiteral, usize) u32; | |
| 896 | ||
| 897 | pub const getLength = ZigClangStringLiteral_getLength; | |
| 898 | extern fn ZigClangStringLiteral_getLength(*const StringLiteral) c_uint; | |
| 899 | ||
| 900 | pub const getCharByteWidth = ZigClangStringLiteral_getCharByteWidth; | |
| 901 | extern fn ZigClangStringLiteral_getCharByteWidth(*const StringLiteral) c_uint; | |
| 902 | ||
| 903 | pub const getString_bytes_begin_size = ZigClangStringLiteral_getString_bytes_begin_size; | |
| 904 | extern fn ZigClangStringLiteral_getString_bytes_begin_size(*const StringLiteral, *usize) [*]const u8; | |
| 905 | }; | |
| 906 | ||
| 907 | pub const StringRef = opaque {}; | |
| 908 | ||
| 909 | pub const SwitchStmt = opaque { | |
| 910 | pub const getConditionVariableDeclStmt = ZigClangSwitchStmt_getConditionVariableDeclStmt; | |
| 911 | extern fn ZigClangSwitchStmt_getConditionVariableDeclStmt(*const SwitchStmt) ?*const DeclStmt; | |
| 912 | ||
| 913 | pub const getCond = ZigClangSwitchStmt_getCond; | |
| 914 | extern fn ZigClangSwitchStmt_getCond(*const SwitchStmt) *const Expr; | |
| 915 | ||
| 916 | pub const getBody = ZigClangSwitchStmt_getBody; | |
| 917 | extern fn ZigClangSwitchStmt_getBody(*const SwitchStmt) *const Stmt; | |
| 918 | ||
| 919 | pub const isAllEnumCasesCovered = ZigClangSwitchStmt_isAllEnumCasesCovered; | |
| 920 | extern fn ZigClangSwitchStmt_isAllEnumCasesCovered(*const SwitchStmt) bool; | |
| 921 | }; | |
| 922 | ||
| 923 | pub const TagDecl = opaque { | |
| 924 | pub const isThisDeclarationADefinition = ZigClangTagDecl_isThisDeclarationADefinition; | |
| 925 | extern fn ZigClangTagDecl_isThisDeclarationADefinition(*const TagDecl) bool; | |
| 926 | }; | |
| 927 | ||
| 928 | pub const Type = opaque { | |
| 929 | pub const getTypeClass = ZigClangType_getTypeClass; | |
| 930 | extern fn ZigClangType_getTypeClass(*const Type) TypeClass; | |
| 931 | ||
| 932 | pub const getPointeeType = ZigClangType_getPointeeType; | |
| 933 | extern fn ZigClangType_getPointeeType(*const Type) QualType; | |
| 934 | ||
| 935 | pub const isVoidType = ZigClangType_isVoidType; | |
| 936 | extern fn ZigClangType_isVoidType(*const Type) bool; | |
| 937 | ||
| 938 | pub const isConstantArrayType = ZigClangType_isConstantArrayType; | |
| 939 | extern fn ZigClangType_isConstantArrayType(*const Type) bool; | |
| 940 | ||
| 941 | pub const isRecordType = ZigClangType_isRecordType; | |
| 942 | extern fn ZigClangType_isRecordType(*const Type) bool; | |
| 943 | ||
| 944 | pub const isVectorType = ZigClangType_isVectorType; | |
| 945 | extern fn ZigClangType_isVectorType(*const Type) bool; | |
| 946 | ||
| 947 | pub const isIncompleteOrZeroLengthArrayType = ZigClangType_isIncompleteOrZeroLengthArrayType; | |
| 948 | extern fn ZigClangType_isIncompleteOrZeroLengthArrayType(*const Type, *const ASTContext) bool; | |
| 949 | ||
| 950 | pub const isArrayType = ZigClangType_isArrayType; | |
| 951 | extern fn ZigClangType_isArrayType(*const Type) bool; | |
| 952 | ||
| 953 | pub const isBooleanType = ZigClangType_isBooleanType; | |
| 954 | extern fn ZigClangType_isBooleanType(*const Type) bool; | |
| 955 | ||
| 956 | pub const getTypeClassName = ZigClangType_getTypeClassName; | |
| 957 | extern fn ZigClangType_getTypeClassName(*const Type) [*:0]const u8; | |
| 958 | ||
| 959 | pub const getAsArrayTypeUnsafe = ZigClangType_getAsArrayTypeUnsafe; | |
| 960 | extern fn ZigClangType_getAsArrayTypeUnsafe(*const Type) *const ArrayType; | |
| 961 | ||
| 962 | pub const getAsRecordType = ZigClangType_getAsRecordType; | |
| 963 | extern fn ZigClangType_getAsRecordType(*const Type) ?*const RecordType; | |
| 964 | ||
| 965 | pub const getAsUnionType = ZigClangType_getAsUnionType; | |
| 966 | extern fn ZigClangType_getAsUnionType(*const Type) ?*const RecordType; | |
| 967 | }; | |
| 968 | ||
| 969 | pub const TypedefNameDecl = opaque { | |
| 970 | pub const getUnderlyingType = ZigClangTypedefNameDecl_getUnderlyingType; | |
| 971 | extern fn ZigClangTypedefNameDecl_getUnderlyingType(*const TypedefNameDecl) QualType; | |
| 972 | ||
| 973 | pub const getCanonicalDecl = ZigClangTypedefNameDecl_getCanonicalDecl; | |
| 974 | extern fn ZigClangTypedefNameDecl_getCanonicalDecl(*const TypedefNameDecl) ?*const TypedefNameDecl; | |
| 975 | ||
| 976 | pub const getLocation = ZigClangTypedefNameDecl_getLocation; | |
| 977 | extern fn ZigClangTypedefNameDecl_getLocation(*const TypedefNameDecl) SourceLocation; | |
| 978 | }; | |
| 979 | ||
| 980 | pub const FileScopeAsmDecl = opaque { | |
| 981 | pub const getAsmString = ZigClangFileScopeAsmDecl_getAsmString; | |
| 982 | extern fn ZigClangFileScopeAsmDecl_getAsmString(*const FileScopeAsmDecl) [*:0]const u8; | |
| 983 | ||
| 984 | pub const freeAsmString = ZigClangFileScopeAsmDecl_freeAsmString; | |
| 985 | extern fn ZigClangFileScopeAsmDecl_freeAsmString([*:0]const u8) void; | |
| 986 | }; | |
| 987 | ||
| 988 | pub const TypedefType = opaque { | |
| 989 | pub const getDecl = ZigClangTypedefType_getDecl; | |
| 990 | extern fn ZigClangTypedefType_getDecl(*const TypedefType) *const TypedefNameDecl; | |
| 991 | }; | |
| 992 | ||
| 993 | pub const UnaryExprOrTypeTraitExpr = opaque { | |
| 994 | pub const getTypeOfArgument = ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument; | |
| 995 | extern fn ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument(*const UnaryExprOrTypeTraitExpr) QualType; | |
| 996 | ||
| 997 | pub const getBeginLoc = ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc; | |
| 998 | extern fn ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc(*const UnaryExprOrTypeTraitExpr) SourceLocation; | |
| 999 | ||
| 1000 | pub const getKind = ZigClangUnaryExprOrTypeTraitExpr_getKind; | |
| 1001 | extern fn ZigClangUnaryExprOrTypeTraitExpr_getKind(*const UnaryExprOrTypeTraitExpr) UnaryExprOrTypeTrait_Kind; | |
| 1002 | }; | |
| 1003 | ||
| 1004 | pub const UnaryOperator = opaque { | |
| 1005 | pub const getOpcode = ZigClangUnaryOperator_getOpcode; | |
| 1006 | extern fn ZigClangUnaryOperator_getOpcode(*const UnaryOperator) UO; | |
| 1007 | ||
| 1008 | pub const getType = ZigClangUnaryOperator_getType; | |
| 1009 | extern fn ZigClangUnaryOperator_getType(*const UnaryOperator) QualType; | |
| 1010 | ||
| 1011 | pub const getSubExpr = ZigClangUnaryOperator_getSubExpr; | |
| 1012 | extern fn ZigClangUnaryOperator_getSubExpr(*const UnaryOperator) *const Expr; | |
| 1013 | ||
| 1014 | pub const getBeginLoc = ZigClangUnaryOperator_getBeginLoc; | |
| 1015 | extern fn ZigClangUnaryOperator_getBeginLoc(*const UnaryOperator) SourceLocation; | |
| 1016 | }; | |
| 1017 | ||
| 1018 | pub const ValueDecl = opaque { | |
| 1019 | pub const getType = ZigClangValueDecl_getType; | |
| 1020 | extern fn ZigClangValueDecl_getType(*const ValueDecl) QualType; | |
| 1021 | }; | |
| 1022 | ||
| 1023 | pub const VarDecl = opaque { | |
| 1024 | pub const getLocation = ZigClangVarDecl_getLocation; | |
| 1025 | extern fn ZigClangVarDecl_getLocation(*const VarDecl) SourceLocation; | |
| 1026 | ||
| 1027 | pub const hasInit = ZigClangVarDecl_hasInit; | |
| 1028 | extern fn ZigClangVarDecl_hasInit(*const VarDecl) bool; | |
| 1029 | ||
| 1030 | pub const getStorageClass = ZigClangVarDecl_getStorageClass; | |
| 1031 | extern fn ZigClangVarDecl_getStorageClass(*const VarDecl) StorageClass; | |
| 1032 | ||
| 1033 | pub const getType = ZigClangVarDecl_getType; | |
| 1034 | extern fn ZigClangVarDecl_getType(*const VarDecl) QualType; | |
| 1035 | ||
| 1036 | pub const getInit = ZigClangVarDecl_getInit; | |
| 1037 | extern fn ZigClangVarDecl_getInit(*const VarDecl) ?*const Expr; | |
| 1038 | ||
| 1039 | pub const getTLSKind = ZigClangVarDecl_getTLSKind; | |
| 1040 | extern fn ZigClangVarDecl_getTLSKind(*const VarDecl) VarDecl_TLSKind; | |
| 1041 | ||
| 1042 | pub const getCanonicalDecl = ZigClangVarDecl_getCanonicalDecl; | |
| 1043 | extern fn ZigClangVarDecl_getCanonicalDecl(*const VarDecl) ?*const VarDecl; | |
| 1044 | ||
| 1045 | pub const getSectionAttribute = ZigClangVarDecl_getSectionAttribute; | |
| 1046 | extern fn ZigClangVarDecl_getSectionAttribute(*const VarDecl, len: *usize) ?[*]const u8; | |
| 1047 | ||
| 1048 | pub const getAlignedAttribute = ZigClangVarDecl_getAlignedAttribute; | |
| 1049 | extern fn ZigClangVarDecl_getAlignedAttribute(*const VarDecl, *const ASTContext) c_uint; | |
| 1050 | ||
| 1051 | pub const getPackedAttribute = ZigClangVarDecl_getPackedAttribute; | |
| 1052 | extern fn ZigClangVarDecl_getPackedAttribute(*const VarDecl) bool; | |
| 1053 | ||
| 1054 | pub const getCleanupAttribute = ZigClangVarDecl_getCleanupAttribute; | |
| 1055 | extern fn ZigClangVarDecl_getCleanupAttribute(*const VarDecl) ?*const FunctionDecl; | |
| 1056 | ||
| 1057 | pub const getTypeSourceInfo_getType = ZigClangVarDecl_getTypeSourceInfo_getType; | |
| 1058 | extern fn ZigClangVarDecl_getTypeSourceInfo_getType(*const VarDecl) QualType; | |
| 1059 | ||
| 1060 | pub const isStaticLocal = ZigClangVarDecl_isStaticLocal; | |
| 1061 | extern fn ZigClangVarDecl_isStaticLocal(*const VarDecl) bool; | |
| 1062 | }; | |
| 1063 | ||
| 1064 | pub const VectorType = opaque { | |
| 1065 | pub const getElementType = ZigClangVectorType_getElementType; | |
| 1066 | extern fn ZigClangVectorType_getElementType(*const VectorType) QualType; | |
| 1067 | ||
| 1068 | pub const getNumElements = ZigClangVectorType_getNumElements; | |
| 1069 | extern fn ZigClangVectorType_getNumElements(*const VectorType) c_uint; | |
| 1070 | }; | |
| 1071 | ||
| 1072 | pub const WhileStmt = opaque { | |
| 1073 | pub const getCond = ZigClangWhileStmt_getCond; | |
| 1074 | extern fn ZigClangWhileStmt_getCond(*const WhileStmt) *const Expr; | |
| 1075 | ||
| 1076 | pub const getBody = ZigClangWhileStmt_getBody; | |
| 1077 | extern fn ZigClangWhileStmt_getBody(*const WhileStmt) *const Stmt; | |
| 1078 | }; | |
| 1079 | ||
| 1080 | pub const InitListExpr = opaque { | |
| 1081 | pub const getInit = ZigClangInitListExpr_getInit; | |
| 1082 | extern fn ZigClangInitListExpr_getInit(*const InitListExpr, i: c_uint) *const Expr; | |
| 1083 | ||
| 1084 | pub const getArrayFiller = ZigClangInitListExpr_getArrayFiller; | |
| 1085 | extern fn ZigClangInitListExpr_getArrayFiller(*const InitListExpr) *const Expr; | |
| 1086 | ||
| 1087 | pub const hasArrayFiller = ZigClangInitListExpr_hasArrayFiller; | |
| 1088 | extern fn ZigClangInitListExpr_hasArrayFiller(*const InitListExpr) bool; | |
| 1089 | ||
| 1090 | pub const isStringLiteralInit = ZigClangInitListExpr_isStringLiteralInit; | |
| 1091 | extern fn ZigClangInitListExpr_isStringLiteralInit(*const InitListExpr) bool; | |
| 1092 | ||
| 1093 | pub const getNumInits = ZigClangInitListExpr_getNumInits; | |
| 1094 | extern fn ZigClangInitListExpr_getNumInits(*const InitListExpr) c_uint; | |
| 1095 | ||
| 1096 | pub const getInitializedFieldInUnion = ZigClangInitListExpr_getInitializedFieldInUnion; | |
| 1097 | extern fn ZigClangInitListExpr_getInitializedFieldInUnion(*const InitListExpr) ?*FieldDecl; | |
| 1098 | }; | |
| 1099 | ||
| 1100 | pub const BO = enum(c_int) { | |
| 1101 | PtrMemD, | |
| 1102 | PtrMemI, | |
| 1103 | Mul, | |
| 1104 | Div, | |
| 1105 | Rem, | |
| 1106 | Add, | |
| 1107 | Sub, | |
| 1108 | Shl, | |
| 1109 | Shr, | |
| 1110 | Cmp, | |
| 1111 | LT, | |
| 1112 | GT, | |
| 1113 | LE, | |
| 1114 | GE, | |
| 1115 | EQ, | |
| 1116 | NE, | |
| 1117 | And, | |
| 1118 | Xor, | |
| 1119 | Or, | |
| 1120 | LAnd, | |
| 1121 | LOr, | |
| 1122 | Assign, | |
| 1123 | MulAssign, | |
| 1124 | DivAssign, | |
| 1125 | RemAssign, | |
| 1126 | AddAssign, | |
| 1127 | SubAssign, | |
| 1128 | ShlAssign, | |
| 1129 | ShrAssign, | |
| 1130 | AndAssign, | |
| 1131 | XorAssign, | |
| 1132 | OrAssign, | |
| 1133 | Comma, | |
| 1134 | }; | |
| 1135 | ||
| 1136 | pub const UO = enum(c_int) { | |
| 1137 | PostInc, | |
| 1138 | PostDec, | |
| 1139 | PreInc, | |
| 1140 | PreDec, | |
| 1141 | AddrOf, | |
| 1142 | Deref, | |
| 1143 | Plus, | |
| 1144 | Minus, | |
| 1145 | Not, | |
| 1146 | LNot, | |
| 1147 | Real, | |
| 1148 | Imag, | |
| 1149 | Extension, | |
| 1150 | Coawait, | |
| 1151 | }; | |
| 1152 | ||
| 1153 | pub const TypeClass = enum(c_int) { | |
| 1154 | Adjusted, | |
| 1155 | Decayed, | |
| 1156 | ConstantArray, | |
| 1157 | ArrayParameter, | |
| 1158 | DependentSizedArray, | |
| 1159 | IncompleteArray, | |
| 1160 | VariableArray, | |
| 1161 | Atomic, | |
| 1162 | Attributed, | |
| 1163 | BTFTagAttributed, | |
| 1164 | BitInt, | |
| 1165 | BlockPointer, | |
| 1166 | CountAttributed, | |
| 1167 | Builtin, | |
| 1168 | Complex, | |
| 1169 | Decltype, | |
| 1170 | Auto, | |
| 1171 | DeducedTemplateSpecialization, | |
| 1172 | DependentAddressSpace, | |
| 1173 | DependentBitInt, | |
| 1174 | DependentName, | |
| 1175 | DependentSizedExtVector, | |
| 1176 | DependentTemplateSpecialization, | |
| 1177 | DependentVector, | |
| 1178 | Elaborated, | |
| 1179 | FunctionNoProto, | |
| 1180 | FunctionProto, | |
| 1181 | HLSLAttributedResource, | |
| 1182 | HLSLInlineSpirv, | |
| 1183 | InjectedClassName, | |
| 1184 | MacroQualified, | |
| 1185 | ConstantMatrix, | |
| 1186 | DependentSizedMatrix, | |
| 1187 | MemberPointer, | |
| 1188 | ObjCObjectPointer, | |
| 1189 | ObjCObject, | |
| 1190 | ObjCInterface, | |
| 1191 | ObjCTypeParam, | |
| 1192 | PackExpansion, | |
| 1193 | PackIndexing, | |
| 1194 | Paren, | |
| 1195 | Pipe, | |
| 1196 | Pointer, | |
| 1197 | LValueReference, | |
| 1198 | RValueReference, | |
| 1199 | SubstTemplateTypeParmPack, | |
| 1200 | SubstTemplateTypeParm, | |
| 1201 | Enum, | |
| 1202 | Record, | |
| 1203 | TemplateSpecialization, | |
| 1204 | TemplateTypeParm, | |
| 1205 | TypeOfExpr, | |
| 1206 | TypeOf, | |
| 1207 | Typedef, | |
| 1208 | UnaryTransform, | |
| 1209 | UnresolvedUsing, | |
| 1210 | Using, | |
| 1211 | Vector, | |
| 1212 | ExtVector, | |
| 1213 | }; | |
| 1214 | ||
| 1215 | const StmtClass = enum(c_int) { | |
| 1216 | NoStmtClass, | |
| 1217 | WhileStmtClass, | |
| 1218 | LabelStmtClass, | |
| 1219 | VAArgExprClass, | |
| 1220 | UnaryOperatorClass, | |
| 1221 | UnaryExprOrTypeTraitExprClass, | |
| 1222 | TypeTraitExprClass, | |
| 1223 | SubstNonTypeTemplateParmPackExprClass, | |
| 1224 | SubstNonTypeTemplateParmExprClass, | |
| 1225 | StringLiteralClass, | |
| 1226 | StmtExprClass, | |
| 1227 | SourceLocExprClass, | |
| 1228 | SizeOfPackExprClass, | |
| 1229 | ShuffleVectorExprClass, | |
| 1230 | SYCLUniqueStableNameExprClass, | |
| 1231 | RequiresExprClass, | |
| 1232 | RecoveryExprClass, | |
| 1233 | PseudoObjectExprClass, | |
| 1234 | PredefinedExprClass, | |
| 1235 | ParenListExprClass, | |
| 1236 | ParenExprClass, | |
| 1237 | PackIndexingExprClass, | |
| 1238 | PackExpansionExprClass, | |
| 1239 | UnresolvedMemberExprClass, | |
| 1240 | UnresolvedLookupExprClass, | |
| 1241 | OpenACCAsteriskSizeExprClass, | |
| 1242 | OpaqueValueExprClass, | |
| 1243 | OffsetOfExprClass, | |
| 1244 | ObjCSubscriptRefExprClass, | |
| 1245 | ObjCStringLiteralClass, | |
| 1246 | ObjCSelectorExprClass, | |
| 1247 | ObjCProtocolExprClass, | |
| 1248 | ObjCPropertyRefExprClass, | |
| 1249 | ObjCMessageExprClass, | |
| 1250 | ObjCIvarRefExprClass, | |
| 1251 | ObjCIsaExprClass, | |
| 1252 | ObjCIndirectCopyRestoreExprClass, | |
| 1253 | ObjCEncodeExprClass, | |
| 1254 | ObjCDictionaryLiteralClass, | |
| 1255 | ObjCBoxedExprClass, | |
| 1256 | ObjCBoolLiteralExprClass, | |
| 1257 | ObjCAvailabilityCheckExprClass, | |
| 1258 | ObjCArrayLiteralClass, | |
| 1259 | OMPIteratorExprClass, | |
| 1260 | OMPArrayShapingExprClass, | |
| 1261 | NoInitExprClass, | |
| 1262 | MemberExprClass, | |
| 1263 | MatrixSubscriptExprClass, | |
| 1264 | MaterializeTemporaryExprClass, | |
| 1265 | MSPropertySubscriptExprClass, | |
| 1266 | MSPropertyRefExprClass, | |
| 1267 | LambdaExprClass, | |
| 1268 | IntegerLiteralClass, | |
| 1269 | InitListExprClass, | |
| 1270 | ImplicitValueInitExprClass, | |
| 1271 | ImaginaryLiteralClass, | |
| 1272 | HLSLOutArgExprClass, | |
| 1273 | GenericSelectionExprClass, | |
| 1274 | GNUNullExprClass, | |
| 1275 | FunctionParmPackExprClass, | |
| 1276 | ExprWithCleanupsClass, | |
| 1277 | ConstantExprClass, | |
| 1278 | FloatingLiteralClass, | |
| 1279 | FixedPointLiteralClass, | |
| 1280 | ExtVectorElementExprClass, | |
| 1281 | ExpressionTraitExprClass, | |
| 1282 | EmbedExprClass, | |
| 1283 | DesignatedInitUpdateExprClass, | |
| 1284 | DesignatedInitExprClass, | |
| 1285 | DependentScopeDeclRefExprClass, | |
| 1286 | DependentCoawaitExprClass, | |
| 1287 | DeclRefExprClass, | |
| 1288 | CoyieldExprClass, | |
| 1289 | CoawaitExprClass, | |
| 1290 | ConvertVectorExprClass, | |
| 1291 | ConceptSpecializationExprClass, | |
| 1292 | CompoundLiteralExprClass, | |
| 1293 | ChooseExprClass, | |
| 1294 | CharacterLiteralClass, | |
| 1295 | ImplicitCastExprClass, | |
| 1296 | ObjCBridgedCastExprClass, | |
| 1297 | CXXStaticCastExprClass, | |
| 1298 | CXXReinterpretCastExprClass, | |
| 1299 | CXXDynamicCastExprClass, | |
| 1300 | CXXConstCastExprClass, | |
| 1301 | CXXAddrspaceCastExprClass, | |
| 1302 | CXXFunctionalCastExprClass, | |
| 1303 | CStyleCastExprClass, | |
| 1304 | BuiltinBitCastExprClass, | |
| 1305 | CallExprClass, | |
| 1306 | UserDefinedLiteralClass, | |
| 1307 | CXXOperatorCallExprClass, | |
| 1308 | CXXMemberCallExprClass, | |
| 1309 | CUDAKernelCallExprClass, | |
| 1310 | CXXUuidofExprClass, | |
| 1311 | CXXUnresolvedConstructExprClass, | |
| 1312 | CXXTypeidExprClass, | |
| 1313 | CXXThrowExprClass, | |
| 1314 | CXXThisExprClass, | |
| 1315 | CXXStdInitializerListExprClass, | |
| 1316 | CXXScalarValueInitExprClass, | |
| 1317 | CXXRewrittenBinaryOperatorClass, | |
| 1318 | CXXPseudoDestructorExprClass, | |
| 1319 | CXXParenListInitExprClass, | |
| 1320 | CXXNullPtrLiteralExprClass, | |
| 1321 | CXXNoexceptExprClass, | |
| 1322 | CXXNewExprClass, | |
| 1323 | CXXInheritedCtorInitExprClass, | |
| 1324 | CXXFoldExprClass, | |
| 1325 | CXXDependentScopeMemberExprClass, | |
| 1326 | CXXDeleteExprClass, | |
| 1327 | CXXDefaultInitExprClass, | |
| 1328 | CXXDefaultArgExprClass, | |
| 1329 | CXXConstructExprClass, | |
| 1330 | CXXTemporaryObjectExprClass, | |
| 1331 | CXXBoolLiteralExprClass, | |
| 1332 | CXXBindTemporaryExprClass, | |
| 1333 | BlockExprClass, | |
| 1334 | BinaryOperatorClass, | |
| 1335 | CompoundAssignOperatorClass, | |
| 1336 | AtomicExprClass, | |
| 1337 | AsTypeExprClass, | |
| 1338 | ArrayTypeTraitExprClass, | |
| 1339 | ArraySubscriptExprClass, | |
| 1340 | ArraySectionExprClass, | |
| 1341 | ArrayInitLoopExprClass, | |
| 1342 | ArrayInitIndexExprClass, | |
| 1343 | AddrLabelExprClass, | |
| 1344 | ConditionalOperatorClass, | |
| 1345 | BinaryConditionalOperatorClass, | |
| 1346 | AttributedStmtClass, | |
| 1347 | SwitchStmtClass, | |
| 1348 | DefaultStmtClass, | |
| 1349 | CaseStmtClass, | |
| 1350 | SYCLKernelCallStmtClass, | |
| 1351 | SEHTryStmtClass, | |
| 1352 | SEHLeaveStmtClass, | |
| 1353 | SEHFinallyStmtClass, | |
| 1354 | SEHExceptStmtClass, | |
| 1355 | ReturnStmtClass, | |
| 1356 | OpenACCWaitConstructClass, | |
| 1357 | OpenACCUpdateConstructClass, | |
| 1358 | OpenACCShutdownConstructClass, | |
| 1359 | OpenACCSetConstructClass, | |
| 1360 | OpenACCInitConstructClass, | |
| 1361 | OpenACCExitDataConstructClass, | |
| 1362 | OpenACCEnterDataConstructClass, | |
| 1363 | OpenACCCacheConstructClass, | |
| 1364 | OpenACCLoopConstructClass, | |
| 1365 | OpenACCHostDataConstructClass, | |
| 1366 | OpenACCDataConstructClass, | |
| 1367 | OpenACCComputeConstructClass, | |
| 1368 | OpenACCCombinedConstructClass, | |
| 1369 | OpenACCAtomicConstructClass, | |
| 1370 | ObjCForCollectionStmtClass, | |
| 1371 | ObjCAutoreleasePoolStmtClass, | |
| 1372 | ObjCAtTryStmtClass, | |
| 1373 | ObjCAtThrowStmtClass, | |
| 1374 | ObjCAtSynchronizedStmtClass, | |
| 1375 | ObjCAtFinallyStmtClass, | |
| 1376 | ObjCAtCatchStmtClass, | |
| 1377 | OMPTeamsDirectiveClass, | |
| 1378 | OMPTaskyieldDirectiveClass, | |
| 1379 | OMPTaskwaitDirectiveClass, | |
| 1380 | OMPTaskgroupDirectiveClass, | |
| 1381 | OMPTaskDirectiveClass, | |
| 1382 | OMPTargetUpdateDirectiveClass, | |
| 1383 | OMPTargetTeamsDirectiveClass, | |
| 1384 | OMPTargetParallelForDirectiveClass, | |
| 1385 | OMPTargetParallelDirectiveClass, | |
| 1386 | OMPTargetExitDataDirectiveClass, | |
| 1387 | OMPTargetEnterDataDirectiveClass, | |
| 1388 | OMPTargetDirectiveClass, | |
| 1389 | OMPTargetDataDirectiveClass, | |
| 1390 | OMPSingleDirectiveClass, | |
| 1391 | OMPSectionsDirectiveClass, | |
| 1392 | OMPSectionDirectiveClass, | |
| 1393 | OMPScopeDirectiveClass, | |
| 1394 | OMPScanDirectiveClass, | |
| 1395 | OMPParallelSectionsDirectiveClass, | |
| 1396 | OMPParallelMasterDirectiveClass, | |
| 1397 | OMPParallelMaskedDirectiveClass, | |
| 1398 | OMPParallelDirectiveClass, | |
| 1399 | OMPOrderedDirectiveClass, | |
| 1400 | OMPMetaDirectiveClass, | |
| 1401 | OMPMasterDirectiveClass, | |
| 1402 | OMPMaskedDirectiveClass, | |
| 1403 | OMPUnrollDirectiveClass, | |
| 1404 | OMPTileDirectiveClass, | |
| 1405 | OMPStripeDirectiveClass, | |
| 1406 | OMPReverseDirectiveClass, | |
| 1407 | OMPInterchangeDirectiveClass, | |
| 1408 | OMPTeamsGenericLoopDirectiveClass, | |
| 1409 | OMPTeamsDistributeSimdDirectiveClass, | |
| 1410 | OMPTeamsDistributeParallelForSimdDirectiveClass, | |
| 1411 | OMPTeamsDistributeParallelForDirectiveClass, | |
| 1412 | OMPTeamsDistributeDirectiveClass, | |
| 1413 | OMPTaskLoopSimdDirectiveClass, | |
| 1414 | OMPTaskLoopDirectiveClass, | |
| 1415 | OMPTargetTeamsGenericLoopDirectiveClass, | |
| 1416 | OMPTargetTeamsDistributeSimdDirectiveClass, | |
| 1417 | OMPTargetTeamsDistributeParallelForSimdDirectiveClass, | |
| 1418 | OMPTargetTeamsDistributeParallelForDirectiveClass, | |
| 1419 | OMPTargetTeamsDistributeDirectiveClass, | |
| 1420 | OMPTargetSimdDirectiveClass, | |
| 1421 | OMPTargetParallelGenericLoopDirectiveClass, | |
| 1422 | OMPTargetParallelForSimdDirectiveClass, | |
| 1423 | OMPSimdDirectiveClass, | |
| 1424 | OMPParallelMasterTaskLoopSimdDirectiveClass, | |
| 1425 | OMPParallelMasterTaskLoopDirectiveClass, | |
| 1426 | OMPParallelMaskedTaskLoopSimdDirectiveClass, | |
| 1427 | OMPParallelMaskedTaskLoopDirectiveClass, | |
| 1428 | OMPParallelGenericLoopDirectiveClass, | |
| 1429 | OMPParallelForSimdDirectiveClass, | |
| 1430 | OMPParallelForDirectiveClass, | |
| 1431 | OMPMasterTaskLoopSimdDirectiveClass, | |
| 1432 | OMPMasterTaskLoopDirectiveClass, | |
| 1433 | OMPMaskedTaskLoopSimdDirectiveClass, | |
| 1434 | OMPMaskedTaskLoopDirectiveClass, | |
| 1435 | OMPGenericLoopDirectiveClass, | |
| 1436 | OMPForSimdDirectiveClass, | |
| 1437 | OMPForDirectiveClass, | |
| 1438 | OMPDistributeSimdDirectiveClass, | |
| 1439 | OMPDistributeParallelForSimdDirectiveClass, | |
| 1440 | OMPDistributeParallelForDirectiveClass, | |
| 1441 | OMPDistributeDirectiveClass, | |
| 1442 | OMPInteropDirectiveClass, | |
| 1443 | OMPFlushDirectiveClass, | |
| 1444 | OMPErrorDirectiveClass, | |
| 1445 | OMPDispatchDirectiveClass, | |
| 1446 | OMPDepobjDirectiveClass, | |
| 1447 | OMPCriticalDirectiveClass, | |
| 1448 | OMPCancellationPointDirectiveClass, | |
| 1449 | OMPCancelDirectiveClass, | |
| 1450 | OMPBarrierDirectiveClass, | |
| 1451 | OMPAtomicDirectiveClass, | |
| 1452 | OMPAssumeDirectiveClass, | |
| 1453 | OMPCanonicalLoopClass, | |
| 1454 | NullStmtClass, | |
| 1455 | MSDependentExistsStmtClass, | |
| 1456 | IndirectGotoStmtClass, | |
| 1457 | IfStmtClass, | |
| 1458 | GotoStmtClass, | |
| 1459 | ForStmtClass, | |
| 1460 | DoStmtClass, | |
| 1461 | DeclStmtClass, | |
| 1462 | CoroutineBodyStmtClass, | |
| 1463 | CoreturnStmtClass, | |
| 1464 | ContinueStmtClass, | |
| 1465 | CompoundStmtClass, | |
| 1466 | CapturedStmtClass, | |
| 1467 | CXXTryStmtClass, | |
| 1468 | CXXForRangeStmtClass, | |
| 1469 | CXXCatchStmtClass, | |
| 1470 | BreakStmtClass, | |
| 1471 | MSAsmStmtClass, | |
| 1472 | GCCAsmStmtClass, | |
| 1473 | }; | |
| 1474 | ||
| 1475 | pub const CK = enum(c_int) { | |
| 1476 | Dependent, | |
| 1477 | BitCast, | |
| 1478 | LValueBitCast, | |
| 1479 | LValueToRValueBitCast, | |
| 1480 | LValueToRValue, | |
| 1481 | NoOp, | |
| 1482 | BaseToDerived, | |
| 1483 | DerivedToBase, | |
| 1484 | UncheckedDerivedToBase, | |
| 1485 | Dynamic, | |
| 1486 | ToUnion, | |
| 1487 | ArrayToPointerDecay, | |
| 1488 | FunctionToPointerDecay, | |
| 1489 | NullToPointer, | |
| 1490 | NullToMemberPointer, | |
| 1491 | BaseToDerivedMemberPointer, | |
| 1492 | DerivedToBaseMemberPointer, | |
| 1493 | MemberPointerToBoolean, | |
| 1494 | ReinterpretMemberPointer, | |
| 1495 | UserDefinedConversion, | |
| 1496 | ConstructorConversion, | |
| 1497 | IntegralToPointer, | |
| 1498 | PointerToIntegral, | |
| 1499 | PointerToBoolean, | |
| 1500 | ToVoid, | |
| 1501 | MatrixCast, | |
| 1502 | VectorSplat, | |
| 1503 | IntegralCast, | |
| 1504 | IntegralToBoolean, | |
| 1505 | IntegralToFloating, | |
| 1506 | FloatingToFixedPoint, | |
| 1507 | FixedPofloatFromInting, | |
| 1508 | FixedPointCast, | |
| 1509 | FixedPointToIntegral, | |
| 1510 | IntegralToFixedPoint, | |
| 1511 | FixedPointToBoolean, | |
| 1512 | FloatingToIntegral, | |
| 1513 | FloatingToBoolean, | |
| 1514 | BooleanToSignedIntegral, | |
| 1515 | FloatingCast, | |
| 1516 | CPointerToObjCPointerCast, | |
| 1517 | BlockPointerToObjCPointerCast, | |
| 1518 | AnyPointerToBlockPointerCast, | |
| 1519 | ObjCObjectLValueCast, | |
| 1520 | FloatingRealToComplex, | |
| 1521 | FloatingComplexToReal, | |
| 1522 | FloatingComplexToBoolean, | |
| 1523 | FloatingComplexCast, | |
| 1524 | FloatingComplexToIntegralComplex, | |
| 1525 | IntegralRealToComplex, | |
| 1526 | IntegralComplexToReal, | |
| 1527 | IntegralComplexToBoolean, | |
| 1528 | IntegralComplexCast, | |
| 1529 | IntegralComplexToFloatingComplex, | |
| 1530 | ARCProduceObject, | |
| 1531 | ARCConsumeObject, | |
| 1532 | ARCReclaimReturnedObject, | |
| 1533 | ARCExtendBlockObject, | |
| 1534 | AtomicToNonAtomic, | |
| 1535 | NonAtomicToAtomic, | |
| 1536 | CopyAndAutoreleaseBlockObject, | |
| 1537 | BuiltinFnToFnPtr, | |
| 1538 | ZeroToOCLOpaqueType, | |
| 1539 | AddressSpaceConversion, | |
| 1540 | IntToOCLSampler, | |
| 1541 | }; | |
| 1542 | ||
| 1543 | pub const DeclKind = enum(c_int) { | |
| 1544 | TranslationUnit, | |
| 1545 | TopLevelStmt, | |
| 1546 | RequiresExprBody, | |
| 1547 | OutlinedFunction, | |
| 1548 | LinkageSpec, | |
| 1549 | ExternCContext, | |
| 1550 | Export, | |
| 1551 | Captured, | |
| 1552 | Block, | |
| 1553 | StaticAssert, | |
| 1554 | PragmaDetectMismatch, | |
| 1555 | PragmaComment, | |
| 1556 | OpenACCRoutine, | |
| 1557 | OpenACCDeclare, | |
| 1558 | ObjCPropertyImpl, | |
| 1559 | OMPThreadPrivate, | |
| 1560 | OMPRequires, | |
| 1561 | OMPAllocate, | |
| 1562 | ObjCMethod, | |
| 1563 | ObjCProtocol, | |
| 1564 | ObjCInterface, | |
| 1565 | ObjCImplementation, | |
| 1566 | ObjCCategoryImpl, | |
| 1567 | ObjCCategory, | |
| 1568 | Namespace, | |
| 1569 | HLSLBuffer, | |
| 1570 | OMPDeclareReduction, | |
| 1571 | OMPDeclareMapper, | |
| 1572 | UnresolvedUsingValue, | |
| 1573 | UnnamedGlobalConstant, | |
| 1574 | TemplateParamObject, | |
| 1575 | MSGuid, | |
| 1576 | IndirectField, | |
| 1577 | EnumConstant, | |
| 1578 | Function, | |
| 1579 | CXXMethod, | |
| 1580 | CXXDestructor, | |
| 1581 | CXXConversion, | |
| 1582 | CXXConstructor, | |
| 1583 | CXXDeductionGuide, | |
| 1584 | Var, | |
| 1585 | VarTemplateSpecialization, | |
| 1586 | VarTemplatePartialSpecialization, | |
| 1587 | ParmVar, | |
| 1588 | OMPCapturedExpr, | |
| 1589 | ImplicitParam, | |
| 1590 | Decomposition, | |
| 1591 | NonTypeTemplateParm, | |
| 1592 | MSProperty, | |
| 1593 | Field, | |
| 1594 | ObjCIvar, | |
| 1595 | ObjCAtDefsField, | |
| 1596 | Binding, | |
| 1597 | UsingShadow, | |
| 1598 | ConstructorUsingShadow, | |
| 1599 | UsingPack, | |
| 1600 | UsingDirective, | |
| 1601 | UnresolvedUsingIfExists, | |
| 1602 | Record, | |
| 1603 | CXXRecord, | |
| 1604 | ClassTemplateSpecialization, | |
| 1605 | ClassTemplatePartialSpecialization, | |
| 1606 | Enum, | |
| 1607 | UnresolvedUsingTypename, | |
| 1608 | Typedef, | |
| 1609 | TypeAlias, | |
| 1610 | ObjCTypeParam, | |
| 1611 | TemplateTypeParm, | |
| 1612 | TemplateTemplateParm, | |
| 1613 | VarTemplate, | |
| 1614 | TypeAliasTemplate, | |
| 1615 | FunctionTemplate, | |
| 1616 | ClassTemplate, | |
| 1617 | Concept, | |
| 1618 | BuiltinTemplate, | |
| 1619 | ObjCProperty, | |
| 1620 | ObjCCompatibleAlias, | |
| 1621 | NamespaceAlias, | |
| 1622 | Label, | |
| 1623 | HLSLRootSignature, | |
| 1624 | UsingEnum, | |
| 1625 | Using, | |
| 1626 | LifetimeExtendedTemporary, | |
| 1627 | Import, | |
| 1628 | ImplicitConceptSpecialization, | |
| 1629 | FriendTemplate, | |
| 1630 | Friend, | |
| 1631 | FileScopeAsm, | |
| 1632 | Empty, | |
| 1633 | AccessSpec, | |
| 1634 | }; | |
| 1635 | ||
| 1636 | pub const BuiltinTypeKind = enum(c_int) { | |
| 1637 | OCLImage1dRO, | |
| 1638 | OCLImage1dArrayRO, | |
| 1639 | OCLImage1dBufferRO, | |
| 1640 | OCLImage2dRO, | |
| 1641 | OCLImage2dArrayRO, | |
| 1642 | OCLImage2dDepthRO, | |
| 1643 | OCLImage2dArrayDepthRO, | |
| 1644 | OCLImage2dMSAARO, | |
| 1645 | OCLImage2dArrayMSAARO, | |
| 1646 | OCLImage2dMSAADepthRO, | |
| 1647 | OCLImage2dArrayMSAADepthRO, | |
| 1648 | OCLImage3dRO, | |
| 1649 | OCLImage1dWO, | |
| 1650 | OCLImage1dArrayWO, | |
| 1651 | OCLImage1dBufferWO, | |
| 1652 | OCLImage2dWO, | |
| 1653 | OCLImage2dArrayWO, | |
| 1654 | OCLImage2dDepthWO, | |
| 1655 | OCLImage2dArrayDepthWO, | |
| 1656 | OCLImage2dMSAAWO, | |
| 1657 | OCLImage2dArrayMSAAWO, | |
| 1658 | OCLImage2dMSAADepthWO, | |
| 1659 | OCLImage2dArrayMSAADepthWO, | |
| 1660 | OCLImage3dWO, | |
| 1661 | OCLImage1dRW, | |
| 1662 | OCLImage1dArrayRW, | |
| 1663 | OCLImage1dBufferRW, | |
| 1664 | OCLImage2dRW, | |
| 1665 | OCLImage2dArrayRW, | |
| 1666 | OCLImage2dDepthRW, | |
| 1667 | OCLImage2dArrayDepthRW, | |
| 1668 | OCLImage2dMSAARW, | |
| 1669 | OCLImage2dArrayMSAARW, | |
| 1670 | OCLImage2dMSAADepthRW, | |
| 1671 | OCLImage2dArrayMSAADepthRW, | |
| 1672 | OCLImage3dRW, | |
| 1673 | OCLIntelSubgroupAVCMcePayload, | |
| 1674 | OCLIntelSubgroupAVCImePayload, | |
| 1675 | OCLIntelSubgroupAVCRefPayload, | |
| 1676 | OCLIntelSubgroupAVCSicPayload, | |
| 1677 | OCLIntelSubgroupAVCMceResult, | |
| 1678 | OCLIntelSubgroupAVCImeResult, | |
| 1679 | OCLIntelSubgroupAVCRefResult, | |
| 1680 | OCLIntelSubgroupAVCSicResult, | |
| 1681 | OCLIntelSubgroupAVCImeResultSingleReferenceStreamout, | |
| 1682 | OCLIntelSubgroupAVCImeResultDualReferenceStreamout, | |
| 1683 | OCLIntelSubgroupAVCImeSingleReferenceStreamin, | |
| 1684 | OCLIntelSubgroupAVCImeDualReferenceStreamin, | |
| 1685 | SveInt8, | |
| 1686 | SveInt16, | |
| 1687 | SveInt32, | |
| 1688 | SveInt64, | |
| 1689 | SveUint8, | |
| 1690 | SveUint16, | |
| 1691 | SveUint32, | |
| 1692 | SveUint64, | |
| 1693 | SveFloat16, | |
| 1694 | SveFloat32, | |
| 1695 | SveFloat64, | |
| 1696 | SveBFloat16, | |
| 1697 | SveMFloat8, | |
| 1698 | SveInt8x2, | |
| 1699 | SveInt16x2, | |
| 1700 | SveInt32x2, | |
| 1701 | SveInt64x2, | |
| 1702 | SveUint8x2, | |
| 1703 | SveUint16x2, | |
| 1704 | SveUint32x2, | |
| 1705 | SveUint64x2, | |
| 1706 | SveFloat16x2, | |
| 1707 | SveFloat32x2, | |
| 1708 | SveFloat64x2, | |
| 1709 | SveBFloat16x2, | |
| 1710 | SveMFloat8x2, | |
| 1711 | SveInt8x3, | |
| 1712 | SveInt16x3, | |
| 1713 | SveInt32x3, | |
| 1714 | SveInt64x3, | |
| 1715 | SveUint8x3, | |
| 1716 | SveUint16x3, | |
| 1717 | SveUint32x3, | |
| 1718 | SveUint64x3, | |
| 1719 | SveFloat16x3, | |
| 1720 | SveFloat32x3, | |
| 1721 | SveFloat64x3, | |
| 1722 | SveBFloat16x3, | |
| 1723 | SveMFloat8x3, | |
| 1724 | SveInt8x4, | |
| 1725 | SveInt16x4, | |
| 1726 | SveInt32x4, | |
| 1727 | SveInt64x4, | |
| 1728 | SveUint8x4, | |
| 1729 | SveUint16x4, | |
| 1730 | SveUint32x4, | |
| 1731 | SveUint64x4, | |
| 1732 | SveFloat16x4, | |
| 1733 | SveFloat32x4, | |
| 1734 | SveFloat64x4, | |
| 1735 | SveBFloat16x4, | |
| 1736 | SveMFloat8x4, | |
| 1737 | SveBool, | |
| 1738 | SveBoolx2, | |
| 1739 | SveBoolx4, | |
| 1740 | SveCount, | |
| 1741 | MFloat8, | |
| 1742 | DMR1024, | |
| 1743 | VectorQuad, | |
| 1744 | VectorPair, | |
| 1745 | RvvInt8mf8, | |
| 1746 | RvvInt8mf4, | |
| 1747 | RvvInt8mf2, | |
| 1748 | RvvInt8m1, | |
| 1749 | RvvInt8m2, | |
| 1750 | RvvInt8m4, | |
| 1751 | RvvInt8m8, | |
| 1752 | RvvUint8mf8, | |
| 1753 | RvvUint8mf4, | |
| 1754 | RvvUint8mf2, | |
| 1755 | RvvUint8m1, | |
| 1756 | RvvUint8m2, | |
| 1757 | RvvUint8m4, | |
| 1758 | RvvUint8m8, | |
| 1759 | RvvInt16mf4, | |
| 1760 | RvvInt16mf2, | |
| 1761 | RvvInt16m1, | |
| 1762 | RvvInt16m2, | |
| 1763 | RvvInt16m4, | |
| 1764 | RvvInt16m8, | |
| 1765 | RvvUint16mf4, | |
| 1766 | RvvUint16mf2, | |
| 1767 | RvvUint16m1, | |
| 1768 | RvvUint16m2, | |
| 1769 | RvvUint16m4, | |
| 1770 | RvvUint16m8, | |
| 1771 | RvvInt32mf2, | |
| 1772 | RvvInt32m1, | |
| 1773 | RvvInt32m2, | |
| 1774 | RvvInt32m4, | |
| 1775 | RvvInt32m8, | |
| 1776 | RvvUint32mf2, | |
| 1777 | RvvUint32m1, | |
| 1778 | RvvUint32m2, | |
| 1779 | RvvUint32m4, | |
| 1780 | RvvUint32m8, | |
| 1781 | RvvInt64m1, | |
| 1782 | RvvInt64m2, | |
| 1783 | RvvInt64m4, | |
| 1784 | RvvInt64m8, | |
| 1785 | RvvUint64m1, | |
| 1786 | RvvUint64m2, | |
| 1787 | RvvUint64m4, | |
| 1788 | RvvUint64m8, | |
| 1789 | RvvFloat16mf4, | |
| 1790 | RvvFloat16mf2, | |
| 1791 | RvvFloat16m1, | |
| 1792 | RvvFloat16m2, | |
| 1793 | RvvFloat16m4, | |
| 1794 | RvvFloat16m8, | |
| 1795 | RvvBFloat16mf4, | |
| 1796 | RvvBFloat16mf2, | |
| 1797 | RvvBFloat16m1, | |
| 1798 | RvvBFloat16m2, | |
| 1799 | RvvBFloat16m4, | |
| 1800 | RvvBFloat16m8, | |
| 1801 | RvvFloat32mf2, | |
| 1802 | RvvFloat32m1, | |
| 1803 | RvvFloat32m2, | |
| 1804 | RvvFloat32m4, | |
| 1805 | RvvFloat32m8, | |
| 1806 | RvvFloat64m1, | |
| 1807 | RvvFloat64m2, | |
| 1808 | RvvFloat64m4, | |
| 1809 | RvvFloat64m8, | |
| 1810 | RvvBool1, | |
| 1811 | RvvBool2, | |
| 1812 | RvvBool4, | |
| 1813 | RvvBool8, | |
| 1814 | RvvBool16, | |
| 1815 | RvvBool32, | |
| 1816 | RvvBool64, | |
| 1817 | RvvInt8mf8x2, | |
| 1818 | RvvInt8mf8x3, | |
| 1819 | RvvInt8mf8x4, | |
| 1820 | RvvInt8mf8x5, | |
| 1821 | RvvInt8mf8x6, | |
| 1822 | RvvInt8mf8x7, | |
| 1823 | RvvInt8mf8x8, | |
| 1824 | RvvInt8mf4x2, | |
| 1825 | RvvInt8mf4x3, | |
| 1826 | RvvInt8mf4x4, | |
| 1827 | RvvInt8mf4x5, | |
| 1828 | RvvInt8mf4x6, | |
| 1829 | RvvInt8mf4x7, | |
| 1830 | RvvInt8mf4x8, | |
| 1831 | RvvInt8mf2x2, | |
| 1832 | RvvInt8mf2x3, | |
| 1833 | RvvInt8mf2x4, | |
| 1834 | RvvInt8mf2x5, | |
| 1835 | RvvInt8mf2x6, | |
| 1836 | RvvInt8mf2x7, | |
| 1837 | RvvInt8mf2x8, | |
| 1838 | RvvInt8m1x2, | |
| 1839 | RvvInt8m1x3, | |
| 1840 | RvvInt8m1x4, | |
| 1841 | RvvInt8m1x5, | |
| 1842 | RvvInt8m1x6, | |
| 1843 | RvvInt8m1x7, | |
| 1844 | RvvInt8m1x8, | |
| 1845 | RvvInt8m2x2, | |
| 1846 | RvvInt8m2x3, | |
| 1847 | RvvInt8m2x4, | |
| 1848 | RvvInt8m4x2, | |
| 1849 | RvvUint8mf8x2, | |
| 1850 | RvvUint8mf8x3, | |
| 1851 | RvvUint8mf8x4, | |
| 1852 | RvvUint8mf8x5, | |
| 1853 | RvvUint8mf8x6, | |
| 1854 | RvvUint8mf8x7, | |
| 1855 | RvvUint8mf8x8, | |
| 1856 | RvvUint8mf4x2, | |
| 1857 | RvvUint8mf4x3, | |
| 1858 | RvvUint8mf4x4, | |
| 1859 | RvvUint8mf4x5, | |
| 1860 | RvvUint8mf4x6, | |
| 1861 | RvvUint8mf4x7, | |
| 1862 | RvvUint8mf4x8, | |
| 1863 | RvvUint8mf2x2, | |
| 1864 | RvvUint8mf2x3, | |
| 1865 | RvvUint8mf2x4, | |
| 1866 | RvvUint8mf2x5, | |
| 1867 | RvvUint8mf2x6, | |
| 1868 | RvvUint8mf2x7, | |
| 1869 | RvvUint8mf2x8, | |
| 1870 | RvvUint8m1x2, | |
| 1871 | RvvUint8m1x3, | |
| 1872 | RvvUint8m1x4, | |
| 1873 | RvvUint8m1x5, | |
| 1874 | RvvUint8m1x6, | |
| 1875 | RvvUint8m1x7, | |
| 1876 | RvvUint8m1x8, | |
| 1877 | RvvUint8m2x2, | |
| 1878 | RvvUint8m2x3, | |
| 1879 | RvvUint8m2x4, | |
| 1880 | RvvUint8m4x2, | |
| 1881 | RvvInt16mf4x2, | |
| 1882 | RvvInt16mf4x3, | |
| 1883 | RvvInt16mf4x4, | |
| 1884 | RvvInt16mf4x5, | |
| 1885 | RvvInt16mf4x6, | |
| 1886 | RvvInt16mf4x7, | |
| 1887 | RvvInt16mf4x8, | |
| 1888 | RvvInt16mf2x2, | |
| 1889 | RvvInt16mf2x3, | |
| 1890 | RvvInt16mf2x4, | |
| 1891 | RvvInt16mf2x5, | |
| 1892 | RvvInt16mf2x6, | |
| 1893 | RvvInt16mf2x7, | |
| 1894 | RvvInt16mf2x8, | |
| 1895 | RvvInt16m1x2, | |
| 1896 | RvvInt16m1x3, | |
| 1897 | RvvInt16m1x4, | |
| 1898 | RvvInt16m1x5, | |
| 1899 | RvvInt16m1x6, | |
| 1900 | RvvInt16m1x7, | |
| 1901 | RvvInt16m1x8, | |
| 1902 | RvvInt16m2x2, | |
| 1903 | RvvInt16m2x3, | |
| 1904 | RvvInt16m2x4, | |
| 1905 | RvvInt16m4x2, | |
| 1906 | RvvUint16mf4x2, | |
| 1907 | RvvUint16mf4x3, | |
| 1908 | RvvUint16mf4x4, | |
| 1909 | RvvUint16mf4x5, | |
| 1910 | RvvUint16mf4x6, | |
| 1911 | RvvUint16mf4x7, | |
| 1912 | RvvUint16mf4x8, | |
| 1913 | RvvUint16mf2x2, | |
| 1914 | RvvUint16mf2x3, | |
| 1915 | RvvUint16mf2x4, | |
| 1916 | RvvUint16mf2x5, | |
| 1917 | RvvUint16mf2x6, | |
| 1918 | RvvUint16mf2x7, | |
| 1919 | RvvUint16mf2x8, | |
| 1920 | RvvUint16m1x2, | |
| 1921 | RvvUint16m1x3, | |
| 1922 | RvvUint16m1x4, | |
| 1923 | RvvUint16m1x5, | |
| 1924 | RvvUint16m1x6, | |
| 1925 | RvvUint16m1x7, | |
| 1926 | RvvUint16m1x8, | |
| 1927 | RvvUint16m2x2, | |
| 1928 | RvvUint16m2x3, | |
| 1929 | RvvUint16m2x4, | |
| 1930 | RvvUint16m4x2, | |
| 1931 | RvvInt32mf2x2, | |
| 1932 | RvvInt32mf2x3, | |
| 1933 | RvvInt32mf2x4, | |
| 1934 | RvvInt32mf2x5, | |
| 1935 | RvvInt32mf2x6, | |
| 1936 | RvvInt32mf2x7, | |
| 1937 | RvvInt32mf2x8, | |
| 1938 | RvvInt32m1x2, | |
| 1939 | RvvInt32m1x3, | |
| 1940 | RvvInt32m1x4, | |
| 1941 | RvvInt32m1x5, | |
| 1942 | RvvInt32m1x6, | |
| 1943 | RvvInt32m1x7, | |
| 1944 | RvvInt32m1x8, | |
| 1945 | RvvInt32m2x2, | |
| 1946 | RvvInt32m2x3, | |
| 1947 | RvvInt32m2x4, | |
| 1948 | RvvInt32m4x2, | |
| 1949 | RvvUint32mf2x2, | |
| 1950 | RvvUint32mf2x3, | |
| 1951 | RvvUint32mf2x4, | |
| 1952 | RvvUint32mf2x5, | |
| 1953 | RvvUint32mf2x6, | |
| 1954 | RvvUint32mf2x7, | |
| 1955 | RvvUint32mf2x8, | |
| 1956 | RvvUint32m1x2, | |
| 1957 | RvvUint32m1x3, | |
| 1958 | RvvUint32m1x4, | |
| 1959 | RvvUint32m1x5, | |
| 1960 | RvvUint32m1x6, | |
| 1961 | RvvUint32m1x7, | |
| 1962 | RvvUint32m1x8, | |
| 1963 | RvvUint32m2x2, | |
| 1964 | RvvUint32m2x3, | |
| 1965 | RvvUint32m2x4, | |
| 1966 | RvvUint32m4x2, | |
| 1967 | RvvInt64m1x2, | |
| 1968 | RvvInt64m1x3, | |
| 1969 | RvvInt64m1x4, | |
| 1970 | RvvInt64m1x5, | |
| 1971 | RvvInt64m1x6, | |
| 1972 | RvvInt64m1x7, | |
| 1973 | RvvInt64m1x8, | |
| 1974 | RvvInt64m2x2, | |
| 1975 | RvvInt64m2x3, | |
| 1976 | RvvInt64m2x4, | |
| 1977 | RvvInt64m4x2, | |
| 1978 | RvvUint64m1x2, | |
| 1979 | RvvUint64m1x3, | |
| 1980 | RvvUint64m1x4, | |
| 1981 | RvvUint64m1x5, | |
| 1982 | RvvUint64m1x6, | |
| 1983 | RvvUint64m1x7, | |
| 1984 | RvvUint64m1x8, | |
| 1985 | RvvUint64m2x2, | |
| 1986 | RvvUint64m2x3, | |
| 1987 | RvvUint64m2x4, | |
| 1988 | RvvUint64m4x2, | |
| 1989 | RvvFloat16mf4x2, | |
| 1990 | RvvFloat16mf4x3, | |
| 1991 | RvvFloat16mf4x4, | |
| 1992 | RvvFloat16mf4x5, | |
| 1993 | RvvFloat16mf4x6, | |
| 1994 | RvvFloat16mf4x7, | |
| 1995 | RvvFloat16mf4x8, | |
| 1996 | RvvFloat16mf2x2, | |
| 1997 | RvvFloat16mf2x3, | |
| 1998 | RvvFloat16mf2x4, | |
| 1999 | RvvFloat16mf2x5, | |
| 2000 | RvvFloat16mf2x6, | |
| 2001 | RvvFloat16mf2x7, | |
| 2002 | RvvFloat16mf2x8, | |
| 2003 | RvvFloat16m1x2, | |
| 2004 | RvvFloat16m1x3, | |
| 2005 | RvvFloat16m1x4, | |
| 2006 | RvvFloat16m1x5, | |
| 2007 | RvvFloat16m1x6, | |
| 2008 | RvvFloat16m1x7, | |
| 2009 | RvvFloat16m1x8, | |
| 2010 | RvvFloat16m2x2, | |
| 2011 | RvvFloat16m2x3, | |
| 2012 | RvvFloat16m2x4, | |
| 2013 | RvvFloat16m4x2, | |
| 2014 | RvvFloat32mf2x2, | |
| 2015 | RvvFloat32mf2x3, | |
| 2016 | RvvFloat32mf2x4, | |
| 2017 | RvvFloat32mf2x5, | |
| 2018 | RvvFloat32mf2x6, | |
| 2019 | RvvFloat32mf2x7, | |
| 2020 | RvvFloat32mf2x8, | |
| 2021 | RvvFloat32m1x2, | |
| 2022 | RvvFloat32m1x3, | |
| 2023 | RvvFloat32m1x4, | |
| 2024 | RvvFloat32m1x5, | |
| 2025 | RvvFloat32m1x6, | |
| 2026 | RvvFloat32m1x7, | |
| 2027 | RvvFloat32m1x8, | |
| 2028 | RvvFloat32m2x2, | |
| 2029 | RvvFloat32m2x3, | |
| 2030 | RvvFloat32m2x4, | |
| 2031 | RvvFloat32m4x2, | |
| 2032 | RvvFloat64m1x2, | |
| 2033 | RvvFloat64m1x3, | |
| 2034 | RvvFloat64m1x4, | |
| 2035 | RvvFloat64m1x5, | |
| 2036 | RvvFloat64m1x6, | |
| 2037 | RvvFloat64m1x7, | |
| 2038 | RvvFloat64m1x8, | |
| 2039 | RvvFloat64m2x2, | |
| 2040 | RvvFloat64m2x3, | |
| 2041 | RvvFloat64m2x4, | |
| 2042 | RvvFloat64m4x2, | |
| 2043 | RvvBFloat16mf4x2, | |
| 2044 | RvvBFloat16mf4x3, | |
| 2045 | RvvBFloat16mf4x4, | |
| 2046 | RvvBFloat16mf4x5, | |
| 2047 | RvvBFloat16mf4x6, | |
| 2048 | RvvBFloat16mf4x7, | |
| 2049 | RvvBFloat16mf4x8, | |
| 2050 | RvvBFloat16mf2x2, | |
| 2051 | RvvBFloat16mf2x3, | |
| 2052 | RvvBFloat16mf2x4, | |
| 2053 | RvvBFloat16mf2x5, | |
| 2054 | RvvBFloat16mf2x6, | |
| 2055 | RvvBFloat16mf2x7, | |
| 2056 | RvvBFloat16mf2x8, | |
| 2057 | RvvBFloat16m1x2, | |
| 2058 | RvvBFloat16m1x3, | |
| 2059 | RvvBFloat16m1x4, | |
| 2060 | RvvBFloat16m1x5, | |
| 2061 | RvvBFloat16m1x6, | |
| 2062 | RvvBFloat16m1x7, | |
| 2063 | RvvBFloat16m1x8, | |
| 2064 | RvvBFloat16m2x2, | |
| 2065 | RvvBFloat16m2x3, | |
| 2066 | RvvBFloat16m2x4, | |
| 2067 | RvvBFloat16m4x2, | |
| 2068 | WasmExternRef, | |
| 2069 | AMDGPUBufferRsrc, | |
| 2070 | AMDGPUNamedWorkgroupBarrier, | |
| 2071 | HLSLResource, | |
| 2072 | Void, | |
| 2073 | Bool, | |
| 2074 | Char_U, | |
| 2075 | UChar, | |
| 2076 | WChar_U, | |
| 2077 | Char8, | |
| 2078 | Char16, | |
| 2079 | Char32, | |
| 2080 | UShort, | |
| 2081 | UInt, | |
| 2082 | ULong, | |
| 2083 | ULongLong, | |
| 2084 | UInt128, | |
| 2085 | Char_S, | |
| 2086 | SChar, | |
| 2087 | WChar_S, | |
| 2088 | Short, | |
| 2089 | Int, | |
| 2090 | Long, | |
| 2091 | LongLong, | |
| 2092 | Int128, | |
| 2093 | ShortAccum, | |
| 2094 | Accum, | |
| 2095 | LongAccum, | |
| 2096 | UShortAccum, | |
| 2097 | UAccum, | |
| 2098 | ULongAccum, | |
| 2099 | ShortFract, | |
| 2100 | Fract, | |
| 2101 | LongFract, | |
| 2102 | UShortFract, | |
| 2103 | UFract, | |
| 2104 | ULongFract, | |
| 2105 | SatShortAccum, | |
| 2106 | SatAccum, | |
| 2107 | SatLongAccum, | |
| 2108 | SatUShortAccum, | |
| 2109 | SatUAccum, | |
| 2110 | SatULongAccum, | |
| 2111 | SatShortFract, | |
| 2112 | SatFract, | |
| 2113 | SatLongFract, | |
| 2114 | SatUShortFract, | |
| 2115 | SatUFract, | |
| 2116 | SatULongFract, | |
| 2117 | Half, | |
| 2118 | Float, | |
| 2119 | Double, | |
| 2120 | LongDouble, | |
| 2121 | Float16, | |
| 2122 | BFloat16, | |
| 2123 | Float128, | |
| 2124 | Ibm128, | |
| 2125 | NullPtr, | |
| 2126 | ObjCId, | |
| 2127 | ObjCClass, | |
| 2128 | ObjCSel, | |
| 2129 | OCLSampler, | |
| 2130 | OCLEvent, | |
| 2131 | OCLClkEvent, | |
| 2132 | OCLQueue, | |
| 2133 | OCLReserveID, | |
| 2134 | Dependent, | |
| 2135 | Overload, | |
| 2136 | BoundMember, | |
| 2137 | UnresolvedTemplate, | |
| 2138 | PseudoObject, | |
| 2139 | UnknownAny, | |
| 2140 | BuiltinFn, | |
| 2141 | ARCUnbridgedCast, | |
| 2142 | IncompleteMatrixIdx, | |
| 2143 | OMPArraySection, | |
| 2144 | OMPArrayShaping, | |
| 2145 | OMPIterator, | |
| 2146 | }; | |
| 2147 | ||
| 2148 | pub const CallingConv = enum(c_int) { | |
| 2149 | C, | |
| 2150 | X86StdCall, | |
| 2151 | X86FastCall, | |
| 2152 | X86ThisCall, | |
| 2153 | X86VectorCall, | |
| 2154 | X86Pascal, | |
| 2155 | Win64, | |
| 2156 | X86_64SysV, | |
| 2157 | X86RegCall, | |
| 2158 | AAPCS, | |
| 2159 | AAPCS_VFP, | |
| 2160 | IntelOclBicc, | |
| 2161 | SpirFunction, | |
| 2162 | DeviceKernel, | |
| 2163 | Swift, | |
| 2164 | SwiftAsync, | |
| 2165 | PreserveMost, | |
| 2166 | PreserveAll, | |
| 2167 | AArch64VectorCall, | |
| 2168 | AArch64SVEPCS, | |
| 2169 | M68kRTD, | |
| 2170 | PreserveNone, | |
| 2171 | RISCVVectorCall, | |
| 2172 | }; | |
| 2173 | ||
| 2174 | pub const StorageClass = enum(c_int) { | |
| 2175 | None, | |
| 2176 | Extern, | |
| 2177 | Static, | |
| 2178 | PrivateExtern, | |
| 2179 | Auto, | |
| 2180 | Register, | |
| 2181 | }; | |
| 2182 | ||
| 2183 | pub const APFloat_roundingMode = enum(i8) { | |
| 2184 | TowardZero = 0, | |
| 2185 | NearestTiesToEven = 1, | |
| 2186 | TowardPositive = 2, | |
| 2187 | TowardNegative = 3, | |
| 2188 | NearestTiesToAway = 4, | |
| 2189 | Dynamic = 7, | |
| 2190 | Invalid = -1, | |
| 2191 | }; | |
| 2192 | ||
| 2193 | pub const CharacterLiteralKind = enum(c_int) { | |
| 2194 | Ascii, | |
| 2195 | Wide, | |
| 2196 | UTF8, | |
| 2197 | UTF16, | |
| 2198 | UTF32, | |
| 2199 | }; | |
| 2200 | ||
| 2201 | pub const VarDecl_TLSKind = enum(c_int) { | |
| 2202 | None, | |
| 2203 | Static, | |
| 2204 | Dynamic, | |
| 2205 | }; | |
| 2206 | ||
| 2207 | pub const ElaboratedTypeKeyword = enum(c_int) { | |
| 2208 | Struct, | |
| 2209 | Interface, | |
| 2210 | Union, | |
| 2211 | Class, | |
| 2212 | Enum, | |
| 2213 | Typename, | |
| 2214 | None, | |
| 2215 | }; | |
| 2216 | ||
| 2217 | pub const PreprocessedEntity_EntityKind = enum(c_int) { | |
| 2218 | InvalidKind, | |
| 2219 | MacroExpansionKind, | |
| 2220 | MacroDefinitionKind, | |
| 2221 | InclusionDirectiveKind, | |
| 2222 | }; | |
| 2223 | ||
| 2224 | pub const Expr_ConstantExprKind = enum(c_int) { | |
| 2225 | Normal, | |
| 2226 | NonClassTemplateArgument, | |
| 2227 | ClassTemplateArgument, | |
| 2228 | ImmediateInvocation, | |
| 2229 | }; | |
| 2230 | ||
| 2231 | pub const UnaryExprOrTypeTrait_Kind = enum(c_int) { | |
| 2232 | SizeOf, | |
| 2233 | DataSizeOf, | |
| 2234 | CountOf, | |
| 2235 | AlignOf, | |
| 2236 | PreferredAlignOf, | |
| 2237 | PtrAuthTypeDiscriminator, | |
| 2238 | VecStep, | |
| 2239 | OpenMPRequiredSimdAlign, | |
| 2240 | }; | |
| 2241 | ||
| 2242 | pub const OffsetOfNode_Kind = enum(c_int) { | |
| 2243 | Array, | |
| 2244 | Field, | |
| 2245 | Identifier, | |
| 2246 | Base, | |
| 2247 | }; | |
| 2248 | ||
| 2249 | pub const ErrorMsg = extern struct { | |
| 2250 | filename_ptr: ?[*]const u8, | |
| 2251 | filename_len: usize, | |
| 2252 | msg_ptr: [*]const u8, | |
| 2253 | msg_len: usize, | |
| 2254 | // valid until the ASTUnit is freed | |
| 2255 | source: ?[*:0]const u8, | |
| 2256 | // 0 based | |
| 2257 | line: c_uint, | |
| 2258 | // 0 based | |
| 2259 | column: c_uint, | |
| 2260 | // byte offset into source | |
| 2261 | offset: c_uint, | |
| 2262 | ||
| 2263 | pub const delete = ZigClangErrorMsg_delete; | |
| 2264 | extern fn ZigClangErrorMsg_delete(ptr: [*]ErrorMsg, len: usize) void; | |
| 2265 | }; | |
| 2266 | ||
| 2267 | pub const LoadFromCommandLine = ZigClangLoadFromCommandLine; | |
| 2268 | extern fn ZigClangLoadFromCommandLine( | |
| 2269 | args_begin: [*]?[*:0]const u8, | |
| 2270 | args_end: [*]?[*:0]const u8, | |
| 2271 | errors_ptr: *[*]ErrorMsg, | |
| 2272 | errors_len: *usize, | |
| 2273 | resources_path: [*:0]const u8, | |
| 2274 | ) ?*ASTUnit; | |
| 2275 | ||
| 2276 | pub const isLLVMUsingSeparateLibcxx = ZigClangIsLLVMUsingSeparateLibcxx; | |
| 2277 | extern fn ZigClangIsLLVMUsingSeparateLibcxx() bool; |
src/libs/mingw.zig+18-9| ... | ... | @@ -296,7 +296,11 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 296 | 296 | }); |
| 297 | 297 | |
| 298 | 298 | const aro = @import("aro"); |
| 299 | var aro_comp = aro.Compilation.init(gpa, std.fs.cwd()); | |
| 299 | var diagnostics: aro.Diagnostics = .{ | |
| 300 | .output = .{ .to_list = .{ .arena = .init(gpa) } }, | |
| 301 | }; | |
| 302 | defer diagnostics.deinit(); | |
| 303 | var aro_comp = aro.Compilation.init(gpa, arena, &diagnostics, std.fs.cwd()); | |
| 300 | 304 | defer aro_comp.deinit(); |
| 301 | 305 | |
| 302 | 306 | aro_comp.target = target.*; |
| ... | ... | @@ -316,17 +320,22 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 316 | 320 | const builtin_macros = try aro_comp.generateBuiltinMacros(.include_system_defines); |
| 317 | 321 | const def_file_source = try aro_comp.addSourceFromPath(def_file_path); |
| 318 | 322 | |
| 319 | var pp = aro.Preprocessor.init(&aro_comp); | |
| 323 | var pp = aro.Preprocessor.init(&aro_comp, .{ .provided = 0 }); | |
| 320 | 324 | defer pp.deinit(); |
| 321 | 325 | pp.linemarkers = .none; |
| 322 | 326 | pp.preserve_whitespace = true; |
| 323 | 327 | |
| 324 | 328 | try pp.preprocessSources(&.{ def_file_source, builtin_macros }); |
| 325 | 329 | |
| 326 | for (aro_comp.diagnostics.list.items) |diagnostic| { | |
| 327 | if (diagnostic.kind == .@"fatal error" or diagnostic.kind == .@"error") { | |
| 328 | aro.Diagnostics.render(&aro_comp, std.Io.tty.detectConfig(std.fs.File.stderr())); | |
| 329 | return error.AroPreprocessorFailed; | |
| 330 | if (aro_comp.diagnostics.output.to_list.messages.items.len != 0) { | |
| 331 | var buffer: [64]u8 = undefined; | |
| 332 | const w = std.debug.lockStderrWriter(&buffer); | |
| 333 | defer std.debug.unlockStderrWriter(); | |
| 334 | for (aro_comp.diagnostics.output.to_list.messages.items) |msg| { | |
| 335 | if (msg.kind == .@"fatal error" or msg.kind == .@"error") { | |
| 336 | msg.write(w, .detect(std.fs.File.stderr()), true) catch {}; | |
| 337 | return error.AroPreprocessorFailed; | |
| 338 | } | |
| 330 | 339 | } |
| 331 | 340 | } |
| 332 | 341 | |
| ... | ... | @@ -335,9 +344,9 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 335 | 344 | const def_final_file = try o_dir.createFile(final_def_basename, .{ .truncate = true }); |
| 336 | 345 | defer def_final_file.close(); |
| 337 | 346 | var buffer: [1024]u8 = undefined; |
| 338 | var def_final_file_writer = def_final_file.writer(&buffer); | |
| 339 | try pp.prettyPrintTokens(&def_final_file_writer.interface, .result_only); | |
| 340 | try def_final_file_writer.interface.flush(); | |
| 347 | var file_writer = def_final_file.writer(&buffer); | |
| 348 | try pp.prettyPrintTokens(&file_writer.interface, .result_only); | |
| 349 | try file_writer.interface.flush(); | |
| 341 | 350 | } |
| 342 | 351 | |
| 343 | 352 | const lib_final_path = try std.fs.path.join(gpa, &.{ "o", &digest, final_lib_basename }); |
src/main.zig+54-183| ... | ... | @@ -204,17 +204,6 @@ pub fn main() anyerror!void { |
| 204 | 204 | return mainArgs(gpa, arena, args); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | /// Check that LLVM and Clang have been linked properly so that they are using the same | |
| 208 | /// libc++ and can safely share objects with pointers to static variables in libc++ | |
| 209 | fn verifyLibcxxCorrectlyLinked() void { | |
| 210 | if (build_options.have_llvm and ZigClangIsLLVMUsingSeparateLibcxx()) { | |
| 211 | fatal( | |
| 212 | \\Zig was built/linked incorrectly: LLVM and Clang have separate copies of libc++ | |
| 213 | \\ If you are dynamically linking LLVM, make sure you dynamically link libc++ too | |
| 214 | , .{}); | |
| 215 | } | |
| 216 | } | |
| 217 | ||
| 218 | 207 | fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 219 | 208 | const tr = tracy.trace(@src()); |
| 220 | 209 | defer tr.end(); |
| ... | ... | @@ -350,13 +339,9 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 350 | 339 | } else if (mem.eql(u8, cmd, "version")) { |
| 351 | 340 | dev.check(.version_command); |
| 352 | 341 | try fs.File.stdout().writeAll(build_options.version ++ "\n"); |
| 353 | // Check libc++ linkage to make sure Zig was built correctly, but only | |
| 354 | // for "env" and "version" to avoid affecting the startup time for | |
| 355 | // build-critical commands (check takes about ~10 μs) | |
| 356 | return verifyLibcxxCorrectlyLinked(); | |
| 342 | return; | |
| 357 | 343 | } else if (mem.eql(u8, cmd, "env")) { |
| 358 | 344 | dev.check(.env_command); |
| 359 | verifyLibcxxCorrectlyLinked(); | |
| 360 | 345 | var stdout_writer = fs.File.stdout().writer(&stdout_buffer); |
| 361 | 346 | try @import("print_env.zig").cmdEnv( |
| 362 | 347 | arena, |
| ... | ... | @@ -4551,179 +4536,64 @@ fn cmdTranslateC( |
| 4551 | 4536 | prog_node: std.Progress.Node, |
| 4552 | 4537 | ) !void { |
| 4553 | 4538 | dev.check(.translate_c_command); |
| 4539 | _ = file_system_inputs; | |
| 4540 | _ = fancy_output; | |
| 4554 | 4541 | |
| 4555 | const color: Color = .auto; | |
| 4556 | 4542 | assert(comp.c_source_files.len == 1); |
| 4557 | 4543 | const c_source_file = comp.c_source_files[0]; |
| 4558 | 4544 | |
| 4559 | const translated_zig_basename = try std.fmt.allocPrint(arena, "{s}.zig", .{comp.root_name}); | |
| 4560 | ||
| 4561 | var man: Cache.Manifest = comp.obtainCObjectCacheManifest(comp.root_mod); | |
| 4562 | man.want_shared_lock = false; | |
| 4563 | defer man.deinit(); | |
| 4545 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath("tmp", .{}); | |
| 4546 | defer zig_cache_tmp_dir.close(); | |
| 4564 | 4547 | |
| 4565 | man.hash.add(@as(u16, 0xb945)); // Random number to distinguish translate-c from compiling C objects | |
| 4566 | man.hash.add(comp.config.c_frontend); | |
| 4567 | Compilation.cache_helpers.hashCSource(&man, c_source_file) catch |err| { | |
| 4568 | fatal("unable to process '{s}': {s}", .{ c_source_file.src_path, @errorName(err) }); | |
| 4548 | const ext = Compilation.classifyFileExt(c_source_file.src_path); | |
| 4549 | const out_dep_path: ?[]const u8 = blk: { | |
| 4550 | if (comp.disable_c_depfile) break :blk null; | |
| 4551 | const c_src_basename = fs.path.basename(c_source_file.src_path); | |
| 4552 | const dep_basename = try std.fmt.allocPrint(arena, "{s}.d", .{c_src_basename}); | |
| 4553 | const out_dep_path = try comp.tmpFilePath(arena, dep_basename); | |
| 4554 | break :blk out_dep_path; | |
| 4569 | 4555 | }; |
| 4570 | 4556 | |
| 4571 | if (fancy_output) |p| p.cache_hit = true; | |
| 4572 | const bin_digest, const hex_digest = if (try man.hit()) digest: { | |
| 4573 | if (file_system_inputs) |buf| try man.populateFileSystemInputs(buf); | |
| 4574 | const bin_digest = man.finalBin(); | |
| 4575 | const hex_digest = Cache.binToHex(bin_digest); | |
| 4576 | break :digest .{ bin_digest, hex_digest }; | |
| 4577 | } else digest: { | |
| 4578 | if (fancy_output) |p| p.cache_hit = false; | |
| 4579 | var argv = std.array_list.Managed([]const u8).init(arena); | |
| 4580 | switch (comp.config.c_frontend) { | |
| 4581 | .aro => {}, | |
| 4582 | .clang => { | |
| 4583 | // argv[0] is program name, actual args start at [1] | |
| 4584 | try argv.append(@tagName(comp.config.c_frontend)); | |
| 4585 | }, | |
| 4586 | } | |
| 4587 | ||
| 4588 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath("tmp", .{}); | |
| 4589 | defer zig_cache_tmp_dir.close(); | |
| 4590 | ||
| 4591 | const ext = Compilation.classifyFileExt(c_source_file.src_path); | |
| 4592 | const out_dep_path: ?[]const u8 = blk: { | |
| 4593 | if (comp.config.c_frontend == .aro or comp.disable_c_depfile or !ext.clangSupportsDepFile()) | |
| 4594 | break :blk null; | |
| 4595 | ||
| 4596 | const c_src_basename = fs.path.basename(c_source_file.src_path); | |
| 4597 | const dep_basename = try std.fmt.allocPrint(arena, "{s}.d", .{c_src_basename}); | |
| 4598 | const out_dep_path = try comp.tmpFilePath(arena, dep_basename); | |
| 4599 | break :blk out_dep_path; | |
| 4600 | }; | |
| 4601 | ||
| 4602 | // TODO | |
| 4603 | if (comp.config.c_frontend != .aro) | |
| 4604 | try comp.addTranslateCCArgs(arena, &argv, ext, out_dep_path, comp.root_mod); | |
| 4605 | try argv.append(c_source_file.src_path); | |
| 4606 | ||
| 4607 | if (comp.verbose_cc) { | |
| 4608 | Compilation.dump_argv(argv.items); | |
| 4609 | } | |
| 4610 | ||
| 4611 | const Result = union(enum) { | |
| 4612 | success: []const u8, | |
| 4613 | error_bundle: std.zig.ErrorBundle, | |
| 4557 | var argv = std.array_list.Managed([]const u8).init(arena); | |
| 4558 | try comp.addTranslateCCArgs(arena, &argv, ext, out_dep_path, comp.root_mod); | |
| 4559 | try argv.append(c_source_file.src_path); | |
| 4560 | if (comp.verbose_cc) Compilation.dump_argv(argv.items); | |
| 4561 | ||
| 4562 | try translateC(comp.gpa, arena, argv.items, prog_node, null); | |
| 4563 | ||
| 4564 | if (out_dep_path) |dep_file_path| { | |
| 4565 | const dep_basename = fs.path.basename(dep_file_path); | |
| 4566 | // Add the files depended on to the cache system. | |
| 4567 | //man.addDepFilePost(zig_cache_tmp_dir, dep_basename) catch |err| switch (err) { | |
| 4568 | // error.FileNotFound => { | |
| 4569 | // // Clang didn't emit the dep file; nothing to add to the manifest. | |
| 4570 | // break :add_deps; | |
| 4571 | // }, | |
| 4572 | // else => |e| return e, | |
| 4573 | //}; | |
| 4574 | // Just to save disk space, we delete the file because it is never needed again. | |
| 4575 | zig_cache_tmp_dir.deleteFile(dep_basename) catch |err| { | |
| 4576 | warn("failed to delete '{s}': {t}", .{ dep_file_path, err }); | |
| 4614 | 4577 | }; |
| 4578 | } | |
| 4615 | 4579 | |
| 4616 | const result: Result = switch (comp.config.c_frontend) { | |
| 4617 | .aro => f: { | |
| 4618 | var stdout: []u8 = undefined; | |
| 4619 | try jitCmd(comp.gpa, arena, argv.items, .{ | |
| 4620 | .cmd_name = "aro_translate_c", | |
| 4621 | .root_src_path = "aro_translate_c.zig", | |
| 4622 | .depend_on_aro = true, | |
| 4623 | .capture = &stdout, | |
| 4624 | .progress_node = prog_node, | |
| 4625 | }); | |
| 4626 | break :f .{ .success = stdout }; | |
| 4627 | }, | |
| 4628 | .clang => f: { | |
| 4629 | if (!build_options.have_llvm) unreachable; | |
| 4630 | const translate_c = @import("translate_c.zig"); | |
| 4631 | ||
| 4632 | // Convert to null terminated args. | |
| 4633 | const clang_args_len = argv.items.len + c_source_file.extra_flags.len; | |
| 4634 | const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, clang_args_len + 1); | |
| 4635 | new_argv_with_sentinel[clang_args_len] = null; | |
| 4636 | const new_argv = new_argv_with_sentinel[0..clang_args_len :null]; | |
| 4637 | for (argv.items, 0..) |arg, i| { | |
| 4638 | new_argv[i] = try arena.dupeZ(u8, arg); | |
| 4639 | } | |
| 4640 | for (c_source_file.extra_flags, 0..) |arg, i| { | |
| 4641 | new_argv[argv.items.len + i] = try arena.dupeZ(u8, arg); | |
| 4642 | } | |
| 4643 | ||
| 4644 | const c_headers_dir_path_z = try comp.dirs.zig_lib.joinZ(arena, &.{"include"}); | |
| 4645 | var errors = std.zig.ErrorBundle.empty; | |
| 4646 | var tree = translate_c.translate( | |
| 4647 | comp.gpa, | |
| 4648 | new_argv.ptr, | |
| 4649 | new_argv.ptr + new_argv.len, | |
| 4650 | &errors, | |
| 4651 | c_headers_dir_path_z, | |
| 4652 | ) catch |err| switch (err) { | |
| 4653 | error.OutOfMemory => return error.OutOfMemory, | |
| 4654 | error.SemanticAnalyzeFail => break :f .{ .error_bundle = errors }, | |
| 4655 | }; | |
| 4656 | defer tree.deinit(comp.gpa); | |
| 4657 | break :f .{ .success = try tree.renderAlloc(arena) }; | |
| 4658 | }, | |
| 4659 | }; | |
| 4660 | ||
| 4661 | if (out_dep_path) |dep_file_path| add_deps: { | |
| 4662 | const dep_basename = fs.path.basename(dep_file_path); | |
| 4663 | // Add the files depended on to the cache system. | |
| 4664 | man.addDepFilePost(zig_cache_tmp_dir, dep_basename) catch |err| switch (err) { | |
| 4665 | error.FileNotFound => { | |
| 4666 | // Clang didn't emit the dep file; nothing to add to the manifest. | |
| 4667 | break :add_deps; | |
| 4668 | }, | |
| 4669 | else => |e| return e, | |
| 4670 | }; | |
| 4671 | // Just to save disk space, we delete the file because it is never needed again. | |
| 4672 | zig_cache_tmp_dir.deleteFile(dep_basename) catch |err| { | |
| 4673 | warn("failed to delete '{s}': {s}", .{ dep_file_path, @errorName(err) }); | |
| 4674 | }; | |
| 4675 | } | |
| 4676 | ||
| 4677 | const formatted = switch (result) { | |
| 4678 | .success => |formatted| formatted, | |
| 4679 | .error_bundle => |eb| { | |
| 4680 | if (file_system_inputs) |buf| try man.populateFileSystemInputs(buf); | |
| 4681 | if (fancy_output) |p| { | |
| 4682 | p.errors = eb; | |
| 4683 | return; | |
| 4684 | } else { | |
| 4685 | eb.renderToStdErr(color.renderOptions()); | |
| 4686 | process.exit(1); | |
| 4687 | } | |
| 4688 | }, | |
| 4689 | }; | |
| 4690 | ||
| 4691 | const bin_digest = man.finalBin(); | |
| 4692 | const hex_digest = Cache.binToHex(bin_digest); | |
| 4693 | ||
| 4694 | const o_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &hex_digest }); | |
| 4695 | ||
| 4696 | var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); | |
| 4697 | defer o_dir.close(); | |
| 4698 | ||
| 4699 | var zig_file = try o_dir.createFile(translated_zig_basename, .{}); | |
| 4700 | defer zig_file.close(); | |
| 4701 | ||
| 4702 | try zig_file.writeAll(formatted); | |
| 4703 | ||
| 4704 | man.writeManifest() catch |err| warn("failed to write cache manifest: {t}", .{err}); | |
| 4705 | ||
| 4706 | if (file_system_inputs) |buf| try man.populateFileSystemInputs(buf); | |
| 4707 | ||
| 4708 | break :digest .{ bin_digest, hex_digest }; | |
| 4709 | }; | |
| 4580 | return cleanExit(); | |
| 4581 | } | |
| 4710 | 4582 | |
| 4711 | if (fancy_output) |p| { | |
| 4712 | p.digest = bin_digest; | |
| 4713 | p.errors = std.zig.ErrorBundle.empty; | |
| 4714 | } else { | |
| 4715 | const out_zig_path = try fs.path.join(arena, &.{ "o", &hex_digest, translated_zig_basename }); | |
| 4716 | const zig_file = comp.dirs.local_cache.handle.openFile(out_zig_path, .{}) catch |err| { | |
| 4717 | const path = comp.dirs.local_cache.path orelse "."; | |
| 4718 | fatal("unable to open cached translated zig file '{s}{s}{s}': {s}", .{ path, fs.path.sep_str, out_zig_path, @errorName(err) }); | |
| 4719 | }; | |
| 4720 | defer zig_file.close(); | |
| 4721 | var stdout_writer = fs.File.stdout().writer(&stdout_buffer); | |
| 4722 | var file_reader = zig_file.reader(&.{}); | |
| 4723 | _ = try stdout_writer.interface.sendFileAll(&file_reader, .unlimited); | |
| 4724 | try stdout_writer.interface.flush(); | |
| 4725 | return cleanExit(); | |
| 4726 | } | |
| 4583 | pub fn translateC( | |
| 4584 | gpa: Allocator, | |
| 4585 | arena: Allocator, | |
| 4586 | argv: []const []const u8, | |
| 4587 | prog_node: std.Progress.Node, | |
| 4588 | capture: ?*[]u8, | |
| 4589 | ) !void { | |
| 4590 | try jitCmd(gpa, arena, argv, .{ | |
| 4591 | .cmd_name = "translate-c", | |
| 4592 | .root_src_path = "translate-c/main.zig", | |
| 4593 | .depend_on_aro = true, | |
| 4594 | .progress_node = prog_node, | |
| 4595 | .capture = capture, | |
| 4596 | }); | |
| 4727 | 4597 | } |
| 4728 | 4598 | |
| 4729 | 4599 | const usage_init = |
| ... | ... | @@ -5682,12 +5552,13 @@ fn jitCmd( |
| 5682 | 5552 | child_argv.appendSliceAssumeCapacity(args); |
| 5683 | 5553 | |
| 5684 | 5554 | if (process.can_execv and options.capture == null) { |
| 5555 | if (EnvVar.ZIG_DEBUG_CMD.isSet()) { | |
| 5556 | const cmd = try std.mem.join(arena, " ", child_argv.items); | |
| 5557 | std.debug.print("{s}\n", .{cmd}); | |
| 5558 | } | |
| 5685 | 5559 | const err = process.execv(gpa, child_argv.items); |
| 5686 | 5560 | const cmd = try std.mem.join(arena, " ", child_argv.items); |
| 5687 | fatal("the following command failed to execve with '{s}':\n{s}", .{ | |
| 5688 | @errorName(err), | |
| 5689 | cmd, | |
| 5690 | }); | |
| 5561 | fatal("the following command failed to execve with '{t}':\n{s}", .{ err, cmd }); | |
| 5691 | 5562 | } |
| 5692 | 5563 | |
| 5693 | 5564 | if (!process.can_spawn) { |
src/translate_c.zig deleted-6681| ... | ... | @@ -1,6681 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const testing = std.testing; | |
| 3 | const assert = std.debug.assert; | |
| 4 | const mem = std.mem; | |
| 5 | const math = std.math; | |
| 6 | const meta = std.meta; | |
| 7 | const clang = @import("clang.zig"); | |
| 8 | const aro = @import("aro"); | |
| 9 | const CToken = aro.Tokenizer.Token; | |
| 10 | const Node = ast.Node; | |
| 11 | const Tag = Node.Tag; | |
| 12 | const common = @import("aro_translate_c"); | |
| 13 | const ast = common.ast; | |
| 14 | const Error = common.Error; | |
| 15 | const MacroProcessingError = common.MacroProcessingError; | |
| 16 | const TypeError = common.TypeError; | |
| 17 | const TransError = common.TransError; | |
| 18 | const SymbolTable = common.SymbolTable; | |
| 19 | const AliasList = common.AliasList; | |
| 20 | const ResultUsed = common.ResultUsed; | |
| 21 | const Scope = common.ScopeExtra(Context, clang.QualType); | |
| 22 | const PatternList = common.PatternList; | |
| 23 | const MacroSlicer = common.MacroSlicer; | |
| 24 | ||
| 25 | pub const Context = struct { | |
| 26 | gpa: mem.Allocator, | |
| 27 | arena: mem.Allocator, | |
| 28 | source_manager: *clang.SourceManager, | |
| 29 | decl_table: std.AutoArrayHashMapUnmanaged(usize, []const u8) = .empty, | |
| 30 | alias_list: AliasList, | |
| 31 | global_scope: *Scope.Root, | |
| 32 | clang_context: *clang.ASTContext, | |
| 33 | mangle_count: u32 = 0, | |
| 34 | /// Table of record decls that have been demoted to opaques. | |
| 35 | opaque_demotes: std.AutoHashMapUnmanaged(usize, void) = .empty, | |
| 36 | /// Table of unnamed enums and records that are child types of typedefs. | |
| 37 | unnamed_typedefs: std.AutoHashMapUnmanaged(usize, []const u8) = .empty, | |
| 38 | /// Needed to decide if we are parsing a typename | |
| 39 | typedefs: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 40 | ||
| 41 | /// This one is different than the root scope's name table. This contains | |
| 42 | /// a list of names that we found by visiting all the top level decls without | |
| 43 | /// translating them. The other maps are updated as we translate; this one is updated | |
| 44 | /// up front in a pre-processing step. | |
| 45 | global_names: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 46 | ||
| 47 | /// This is similar to `global_names`, but contains names which we would | |
| 48 | /// *like* to use, but do not strictly *have* to if they are unavailable. | |
| 49 | /// These are relevant to types, which ideally we would name like | |
| 50 | /// 'struct_foo' with an alias 'foo', but if either of those names is taken, | |
| 51 | /// may be mangled. | |
| 52 | /// This is distinct from `global_names` so we can detect at a type | |
| 53 | /// declaration whether or not the name is available. | |
| 54 | weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty, | |
| 55 | ||
| 56 | pattern_list: PatternList, | |
| 57 | ||
| 58 | fn getMangle(c: *Context) u32 { | |
| 59 | c.mangle_count += 1; | |
| 60 | return c.mangle_count; | |
| 61 | } | |
| 62 | ||
| 63 | /// Convert a null-terminated C string to a slice allocated in the arena | |
| 64 | fn str(c: *Context, s: [*:0]const u8) ![]u8 { | |
| 65 | return c.arena.dupe(u8, mem.sliceTo(s, 0)); | |
| 66 | } | |
| 67 | ||
| 68 | /// Convert a clang source location to a file:line:column string | |
| 69 | fn locStr(c: *Context, loc: clang.SourceLocation) ![]u8 { | |
| 70 | const spelling_loc = c.source_manager.getSpellingLoc(loc); | |
| 71 | const filename_c = c.source_manager.getFilename(spelling_loc); | |
| 72 | const filename = if (filename_c) |s| try c.str(s) else @as([]const u8, "(no file)"); | |
| 73 | ||
| 74 | const line = c.source_manager.getSpellingLineNumber(spelling_loc); | |
| 75 | const column = c.source_manager.getSpellingColumnNumber(spelling_loc); | |
| 76 | return std.fmt.allocPrint(c.arena, "{s}:{d}:{d}", .{ filename, line, column }); | |
| 77 | } | |
| 78 | }; | |
| 79 | ||
| 80 | pub fn translate( | |
| 81 | gpa: mem.Allocator, | |
| 82 | args_begin: [*]?[*:0]const u8, | |
| 83 | args_end: [*]?[*:0]const u8, | |
| 84 | errors: *std.zig.ErrorBundle, | |
| 85 | resources_path: [*:0]const u8, | |
| 86 | ) !std.zig.Ast { | |
| 87 | var clang_errors: []clang.ErrorMsg = &.{}; | |
| 88 | ||
| 89 | const ast_unit = clang.LoadFromCommandLine( | |
| 90 | args_begin, | |
| 91 | args_end, | |
| 92 | &clang_errors.ptr, | |
| 93 | &clang_errors.len, | |
| 94 | resources_path, | |
| 95 | ) orelse { | |
| 96 | defer clang.ErrorMsg.delete(clang_errors.ptr, clang_errors.len); | |
| 97 | ||
| 98 | var bundle: std.zig.ErrorBundle.Wip = undefined; | |
| 99 | try bundle.init(gpa); | |
| 100 | defer bundle.deinit(); | |
| 101 | ||
| 102 | for (clang_errors) |c_error| { | |
| 103 | const line = line: { | |
| 104 | const source = c_error.source orelse break :line 0; | |
| 105 | var start = c_error.offset; | |
| 106 | while (start > 0) : (start -= 1) { | |
| 107 | if (source[start - 1] == '\n') break; | |
| 108 | } | |
| 109 | var end = c_error.offset; | |
| 110 | while (true) : (end += 1) { | |
| 111 | if (source[end] == 0) break; | |
| 112 | if (source[end] == '\n') break; | |
| 113 | } | |
| 114 | break :line try bundle.addString(source[start..end]); | |
| 115 | }; | |
| 116 | ||
| 117 | try bundle.addRootErrorMessage(.{ | |
| 118 | .msg = try bundle.addString(c_error.msg_ptr[0..c_error.msg_len]), | |
| 119 | .src_loc = if (c_error.filename_ptr) |filename_ptr| try bundle.addSourceLocation(.{ | |
| 120 | .src_path = try bundle.addString(filename_ptr[0..c_error.filename_len]), | |
| 121 | .span_start = c_error.offset, | |
| 122 | .span_main = c_error.offset, | |
| 123 | .span_end = c_error.offset + 1, | |
| 124 | .line = c_error.line, | |
| 125 | .column = c_error.column, | |
| 126 | .source_line = line, | |
| 127 | }) else .none, | |
| 128 | }); | |
| 129 | } | |
| 130 | errors.* = try bundle.toOwnedBundle(""); | |
| 131 | ||
| 132 | return error.SemanticAnalyzeFail; | |
| 133 | }; | |
| 134 | defer ast_unit.delete(); | |
| 135 | ||
| 136 | // For memory that has the same lifetime as the Ast that we return | |
| 137 | // from this function. | |
| 138 | var arena_allocator = std.heap.ArenaAllocator.init(gpa); | |
| 139 | defer arena_allocator.deinit(); | |
| 140 | const arena = arena_allocator.allocator(); | |
| 141 | ||
| 142 | var context = Context{ | |
| 143 | .gpa = gpa, | |
| 144 | .arena = arena, | |
| 145 | .source_manager = ast_unit.getSourceManager(), | |
| 146 | .alias_list = AliasList.init(gpa), | |
| 147 | .global_scope = try arena.create(Scope.Root), | |
| 148 | .clang_context = ast_unit.getASTContext(), | |
| 149 | .pattern_list = try PatternList.init(gpa), | |
| 150 | }; | |
| 151 | context.global_scope.* = Scope.Root.init(&context); | |
| 152 | defer { | |
| 153 | context.decl_table.deinit(gpa); | |
| 154 | context.alias_list.deinit(); | |
| 155 | context.global_names.deinit(gpa); | |
| 156 | context.opaque_demotes.deinit(gpa); | |
| 157 | context.unnamed_typedefs.deinit(gpa); | |
| 158 | context.typedefs.deinit(gpa); | |
| 159 | context.global_scope.deinit(); | |
| 160 | context.pattern_list.deinit(gpa); | |
| 161 | } | |
| 162 | ||
| 163 | @setEvalBranchQuota(2000); | |
| 164 | inline for (@typeInfo(std.zig.c_builtins).@"struct".decls) |decl| { | |
| 165 | const builtin = try Tag.pub_var_simple.create(arena, .{ | |
| 166 | .name = decl.name, | |
| 167 | .init = try Tag.import_c_builtin.create(arena, decl.name), | |
| 168 | }); | |
| 169 | try addTopLevelDecl(&context, decl.name, builtin); | |
| 170 | } | |
| 171 | ||
| 172 | try prepopulateGlobalNameTable(ast_unit, &context); | |
| 173 | ||
| 174 | if (!ast_unit.visitLocalTopLevelDecls(&context, declVisitorC)) { | |
| 175 | return error.OutOfMemory; | |
| 176 | } | |
| 177 | ||
| 178 | try transPreprocessorEntities(&context, ast_unit); | |
| 179 | ||
| 180 | for (context.alias_list.items) |alias| { | |
| 181 | const node = try Tag.alias.create(arena, .{ .actual = alias.alias, .mangled = alias.name }); | |
| 182 | try addTopLevelDecl(&context, alias.alias, node); | |
| 183 | } | |
| 184 | ||
| 185 | return ast.render(gpa, context.global_scope.nodes.items); | |
| 186 | } | |
| 187 | ||
| 188 | /// Determines whether macro is of the form: `#define FOO FOO` (Possibly with trailing tokens) | |
| 189 | /// Macros of this form will not be translated. | |
| 190 | fn isSelfDefinedMacro(unit: *const clang.ASTUnit, c: *const Context, macro: *const clang.MacroDefinitionRecord) !bool { | |
| 191 | const source = try getMacroText(unit, c, macro); | |
| 192 | var tokenizer: aro.Tokenizer = .{ | |
| 193 | .buf = source, | |
| 194 | .source = .unused, | |
| 195 | .langopts = .{}, | |
| 196 | }; | |
| 197 | const name_tok = tokenizer.nextNoWS(); | |
| 198 | const name = source[name_tok.start..name_tok.end]; | |
| 199 | ||
| 200 | const first_tok = tokenizer.nextNoWS(); | |
| 201 | // We do not just check for `.Identifier` below because keyword tokens are preferentially matched first by | |
| 202 | // the tokenizer. | |
| 203 | // In other words we would miss `#define inline inline` (`inline` is a valid c89 identifier) | |
| 204 | if (first_tok.id == .eof) return false; | |
| 205 | return mem.eql(u8, name, source[first_tok.start..first_tok.end]); | |
| 206 | } | |
| 207 | ||
| 208 | fn prepopulateGlobalNameTable(ast_unit: *clang.ASTUnit, c: *Context) !void { | |
| 209 | if (!ast_unit.visitLocalTopLevelDecls(c, declVisitorNamesOnlyC)) { | |
| 210 | return error.OutOfMemory; | |
| 211 | } | |
| 212 | ||
| 213 | // TODO if we see #undef, delete it from the table | |
| 214 | var it = ast_unit.getLocalPreprocessingEntities_begin(); | |
| 215 | const it_end = ast_unit.getLocalPreprocessingEntities_end(); | |
| 216 | ||
| 217 | while (it.I != it_end.I) : (it.I += 1) { | |
| 218 | const entity = it.deref(); | |
| 219 | switch (entity.getKind()) { | |
| 220 | .MacroDefinitionKind => { | |
| 221 | const macro = @as(*clang.MacroDefinitionRecord, @ptrCast(entity)); | |
| 222 | const raw_name = macro.getName_getNameStart(); | |
| 223 | const name = try c.str(raw_name); | |
| 224 | ||
| 225 | if (!try isSelfDefinedMacro(ast_unit, c, macro)) { | |
| 226 | try c.global_names.put(c.gpa, name, {}); | |
| 227 | } | |
| 228 | }, | |
| 229 | else => {}, | |
| 230 | } | |
| 231 | } | |
| 232 | } | |
| 233 | ||
| 234 | fn declVisitorNamesOnlyC(context: ?*anyopaque, decl: *const clang.Decl) callconv(.c) bool { | |
| 235 | const c: *Context = @ptrCast(@alignCast(context)); | |
| 236 | declVisitorNamesOnly(c, decl) catch return false; | |
| 237 | return true; | |
| 238 | } | |
| 239 | ||
| 240 | fn declVisitorC(context: ?*anyopaque, decl: *const clang.Decl) callconv(.c) bool { | |
| 241 | const c: *Context = @ptrCast(@alignCast(context)); | |
| 242 | declVisitor(c, decl) catch return false; | |
| 243 | return true; | |
| 244 | } | |
| 245 | ||
| 246 | fn declVisitorNamesOnly(c: *Context, decl: *const clang.Decl) Error!void { | |
| 247 | if (decl.castToNamedDecl()) |named_decl| { | |
| 248 | const decl_name = try c.str(named_decl.getName_bytes_begin()); | |
| 249 | ||
| 250 | switch (decl.getKind()) { | |
| 251 | .Record, .Enum => { | |
| 252 | // These types are prefixed with the container kind. | |
| 253 | const container_prefix = if (decl.getKind() == .Record) prefix: { | |
| 254 | const record_decl: *const clang.RecordDecl = @ptrCast(decl); | |
| 255 | if (record_decl.isUnion()) { | |
| 256 | break :prefix "union"; | |
| 257 | } else { | |
| 258 | break :prefix "struct"; | |
| 259 | } | |
| 260 | } else "enum"; | |
| 261 | const prefixed_name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_prefix, decl_name }); | |
| 262 | // `decl_name` and `prefixed_name` are the preferred names for this type. | |
| 263 | // However, we can name it anything else if necessary, so these are "weak names". | |
| 264 | try c.weak_global_names.ensureUnusedCapacity(c.gpa, 2); | |
| 265 | c.weak_global_names.putAssumeCapacity(decl_name, {}); | |
| 266 | c.weak_global_names.putAssumeCapacity(prefixed_name, {}); | |
| 267 | }, | |
| 268 | else => { | |
| 269 | try c.global_names.put(c.gpa, decl_name, {}); | |
| 270 | }, | |
| 271 | } | |
| 272 | ||
| 273 | // Check for typedefs with unnamed enum/record child types. | |
| 274 | if (decl.getKind() == .Typedef) { | |
| 275 | const typedef_decl = @as(*const clang.TypedefNameDecl, @ptrCast(decl)); | |
| 276 | var child_ty = typedef_decl.getUnderlyingType().getTypePtr(); | |
| 277 | const addr: usize = while (true) switch (child_ty.getTypeClass()) { | |
| 278 | .Enum => { | |
| 279 | const enum_ty = @as(*const clang.EnumType, @ptrCast(child_ty)); | |
| 280 | const enum_decl = enum_ty.getDecl(); | |
| 281 | // check if this decl is unnamed | |
| 282 | if (@as(*const clang.NamedDecl, @ptrCast(enum_decl)).getName_bytes_begin()[0] != 0) return; | |
| 283 | break @intFromPtr(enum_decl.getCanonicalDecl()); | |
| 284 | }, | |
| 285 | .Record => { | |
| 286 | const record_ty = @as(*const clang.RecordType, @ptrCast(child_ty)); | |
| 287 | const record_decl = record_ty.getDecl(); | |
| 288 | // check if this decl is unnamed | |
| 289 | if (@as(*const clang.NamedDecl, @ptrCast(record_decl)).getName_bytes_begin()[0] != 0) return; | |
| 290 | break @intFromPtr(record_decl.getCanonicalDecl()); | |
| 291 | }, | |
| 292 | .Elaborated => { | |
| 293 | const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(child_ty)); | |
| 294 | child_ty = elaborated_ty.getNamedType().getTypePtr(); | |
| 295 | }, | |
| 296 | .Decayed => { | |
| 297 | const decayed_ty = @as(*const clang.DecayedType, @ptrCast(child_ty)); | |
| 298 | child_ty = decayed_ty.getDecayedType().getTypePtr(); | |
| 299 | }, | |
| 300 | .Attributed => { | |
| 301 | const attributed_ty = @as(*const clang.AttributedType, @ptrCast(child_ty)); | |
| 302 | child_ty = attributed_ty.getEquivalentType().getTypePtr(); | |
| 303 | }, | |
| 304 | .MacroQualified => { | |
| 305 | const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(child_ty)); | |
| 306 | child_ty = macroqualified_ty.getModifiedType().getTypePtr(); | |
| 307 | }, | |
| 308 | else => return, | |
| 309 | }; | |
| 310 | ||
| 311 | const result = try c.unnamed_typedefs.getOrPut(c.gpa, addr); | |
| 312 | if (result.found_existing) { | |
| 313 | // One typedef can declare multiple names. | |
| 314 | // Don't put this one in `decl_table` so it's processed later. | |
| 315 | return; | |
| 316 | } | |
| 317 | result.value_ptr.* = decl_name; | |
| 318 | // Put this typedef in the decl_table to avoid redefinitions. | |
| 319 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(typedef_decl.getCanonicalDecl()), decl_name); | |
| 320 | try c.typedefs.put(c.gpa, decl_name, {}); | |
| 321 | } | |
| 322 | } | |
| 323 | } | |
| 324 | ||
| 325 | fn declVisitor(c: *Context, decl: *const clang.Decl) Error!void { | |
| 326 | switch (decl.getKind()) { | |
| 327 | .Function => { | |
| 328 | return transFnDecl(c, &c.global_scope.base, @as(*const clang.FunctionDecl, @ptrCast(decl))); | |
| 329 | }, | |
| 330 | .Typedef => { | |
| 331 | try transTypeDef(c, &c.global_scope.base, @as(*const clang.TypedefNameDecl, @ptrCast(decl))); | |
| 332 | }, | |
| 333 | .Enum => { | |
| 334 | try transEnumDecl(c, &c.global_scope.base, @as(*const clang.EnumDecl, @ptrCast(decl))); | |
| 335 | }, | |
| 336 | .Record => { | |
| 337 | try transRecordDecl(c, &c.global_scope.base, @as(*const clang.RecordDecl, @ptrCast(decl))); | |
| 338 | }, | |
| 339 | .Var => { | |
| 340 | return visitVarDecl(c, @as(*const clang.VarDecl, @ptrCast(decl)), null); | |
| 341 | }, | |
| 342 | .Empty => { | |
| 343 | // Do nothing | |
| 344 | }, | |
| 345 | .FileScopeAsm => { | |
| 346 | try transFileScopeAsm(c, &c.global_scope.base, @as(*const clang.FileScopeAsmDecl, @ptrCast(decl))); | |
| 347 | }, | |
| 348 | else => { | |
| 349 | const decl_name = try c.str(decl.getDeclKindName()); | |
| 350 | try warn(c, &c.global_scope.base, decl.getLocation(), "ignoring {s} declaration", .{decl_name}); | |
| 351 | }, | |
| 352 | } | |
| 353 | } | |
| 354 | ||
| 355 | fn transFileScopeAsm(c: *Context, scope: *Scope, file_scope_asm: *const clang.FileScopeAsmDecl) Error!void { | |
| 356 | const asm_string = std.mem.span(file_scope_asm.getAsmString()); | |
| 357 | defer clang.FileScopeAsmDecl.freeAsmString(asm_string.ptr); | |
| 358 | ||
| 359 | const str = try std.fmt.allocPrint(c.arena, "\"{f}\"", .{std.zig.fmtString(asm_string)}); | |
| 360 | const str_node = try Tag.string_literal.create(c.arena, str); | |
| 361 | ||
| 362 | const asm_node = try Tag.asm_simple.create(c.arena, str_node); | |
| 363 | const block = try Tag.block_single.create(c.arena, asm_node); | |
| 364 | const comptime_node = try Tag.@"comptime".create(c.arena, block); | |
| 365 | ||
| 366 | try scope.appendNode(comptime_node); | |
| 367 | } | |
| 368 | ||
| 369 | fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) Error!void { | |
| 370 | const fn_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(fn_decl)).getName_bytes_begin()); | |
| 371 | if (c.global_scope.sym_table.contains(fn_name)) | |
| 372 | return; // Avoid processing this decl twice | |
| 373 | ||
| 374 | // Skip this declaration if a proper definition exists | |
| 375 | if (!fn_decl.isThisDeclarationADefinition()) { | |
| 376 | if (fn_decl.getDefinition()) |def| | |
| 377 | return transFnDecl(c, scope, def); | |
| 378 | } | |
| 379 | ||
| 380 | const fn_decl_loc = fn_decl.getLocation(); | |
| 381 | const has_body = fn_decl.hasBody(); | |
| 382 | const storage_class = fn_decl.getStorageClass(); | |
| 383 | const is_always_inline = has_body and fn_decl.hasAlwaysInlineAttr(); | |
| 384 | var decl_ctx = FnDeclContext{ | |
| 385 | .fn_name = fn_name, | |
| 386 | .has_body = has_body, | |
| 387 | .storage_class = storage_class, | |
| 388 | .is_always_inline = is_always_inline, | |
| 389 | .is_export = switch (storage_class) { | |
| 390 | .None => has_body and !is_always_inline and !fn_decl.isInlineSpecified(), | |
| 391 | .Extern, .Static => false, | |
| 392 | .PrivateExtern => return failDecl(c, fn_decl_loc, fn_name, "unsupported storage class: private extern", .{}), | |
| 393 | .Auto => unreachable, // Not legal on functions | |
| 394 | .Register => unreachable, // Not legal on functions | |
| 395 | }, | |
| 396 | }; | |
| 397 | ||
| 398 | var fn_qt = fn_decl.getType(); | |
| 399 | ||
| 400 | const fn_type = while (true) { | |
| 401 | const fn_type = fn_qt.getTypePtr(); | |
| 402 | ||
| 403 | switch (fn_type.getTypeClass()) { | |
| 404 | .Attributed => { | |
| 405 | const attr_type: *const clang.AttributedType = @ptrCast(fn_type); | |
| 406 | fn_qt = attr_type.getEquivalentType(); | |
| 407 | }, | |
| 408 | .Paren => { | |
| 409 | const paren_type: *const clang.ParenType = @ptrCast(fn_type); | |
| 410 | fn_qt = paren_type.getInnerType(); | |
| 411 | }, | |
| 412 | .MacroQualified => { | |
| 413 | const macroqualified_ty: *const clang.MacroQualifiedType = @ptrCast(fn_type); | |
| 414 | fn_qt = macroqualified_ty.getModifiedType(); | |
| 415 | }, | |
| 416 | else => break fn_type, | |
| 417 | } | |
| 418 | }; | |
| 419 | const fn_ty: *const clang.FunctionType = @ptrCast(fn_type); | |
| 420 | const return_qt = fn_ty.getReturnType(); | |
| 421 | ||
| 422 | const proto_node = switch (fn_type.getTypeClass()) { | |
| 423 | .FunctionProto => blk: { | |
| 424 | const fn_proto_type: *const clang.FunctionProtoType = @ptrCast(fn_type); | |
| 425 | if (has_body and fn_proto_type.isVariadic()) { | |
| 426 | decl_ctx.has_body = false; | |
| 427 | decl_ctx.storage_class = .Extern; | |
| 428 | decl_ctx.is_export = false; | |
| 429 | decl_ctx.is_always_inline = false; | |
| 430 | try warn(c, &c.global_scope.base, fn_decl_loc, "TODO unable to translate variadic function, demoted to extern", .{}); | |
| 431 | } | |
| 432 | break :blk transFnProto(c, fn_decl, fn_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { | |
| 433 | error.UnsupportedType => { | |
| 434 | return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); | |
| 435 | }, | |
| 436 | error.OutOfMemory => |e| return e, | |
| 437 | }; | |
| 438 | }, | |
| 439 | .FunctionNoProto => blk: { | |
| 440 | const fn_no_proto_type: *const clang.FunctionType = @ptrCast(fn_type); | |
| 441 | break :blk transFnNoProto(c, fn_no_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { | |
| 442 | error.UnsupportedType => { | |
| 443 | return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); | |
| 444 | }, | |
| 445 | error.OutOfMemory => |e| return e, | |
| 446 | }; | |
| 447 | }, | |
| 448 | else => return failDecl(c, fn_decl_loc, fn_name, "unable to resolve function type {}", .{fn_type.getTypeClass()}), | |
| 449 | }; | |
| 450 | ||
| 451 | if (!decl_ctx.has_body) { | |
| 452 | if (scope.id != .root) { | |
| 453 | return addLocalExternFnDecl(c, scope, fn_name, Node.initPayload(&proto_node.base)); | |
| 454 | } | |
| 455 | return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); | |
| 456 | } | |
| 457 | ||
| 458 | // actual function definition with body | |
| 459 | const body_stmt = fn_decl.getBody(); | |
| 460 | var block_scope = try Scope.Block.init(c, &c.global_scope.base, false); | |
| 461 | block_scope.return_type = return_qt; | |
| 462 | defer block_scope.deinit(); | |
| 463 | ||
| 464 | const top_scope = &block_scope.base; | |
| 465 | ||
| 466 | var param_id: c_uint = 0; | |
| 467 | for (proto_node.data.params) |*param| { | |
| 468 | const param_name = param.name orelse { | |
| 469 | proto_node.data.is_extern = true; | |
| 470 | proto_node.data.is_export = false; | |
| 471 | proto_node.data.is_inline = false; | |
| 472 | try warn(c, &c.global_scope.base, fn_decl_loc, "function {s} parameter has no name, demoted to extern", .{fn_name}); | |
| 473 | return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); | |
| 474 | }; | |
| 475 | ||
| 476 | const c_param = fn_decl.getParamDecl(param_id); | |
| 477 | const qual_type = c_param.getOriginalType(); | |
| 478 | const is_const = qual_type.isConstQualified(); | |
| 479 | ||
| 480 | const mangled_param_name = try block_scope.makeMangledName(c, param_name); | |
| 481 | param.name = mangled_param_name; | |
| 482 | ||
| 483 | if (!is_const) { | |
| 484 | const bare_arg_name = try std.fmt.allocPrint(c.arena, "arg_{s}", .{mangled_param_name}); | |
| 485 | const arg_name = try block_scope.makeMangledName(c, bare_arg_name); | |
| 486 | param.name = arg_name; | |
| 487 | ||
| 488 | const redecl_node = try Tag.arg_redecl.create(c.arena, .{ .actual = mangled_param_name, .mangled = arg_name }); | |
| 489 | try block_scope.statements.append(redecl_node); | |
| 490 | } | |
| 491 | try block_scope.discardVariable(c, mangled_param_name); | |
| 492 | ||
| 493 | param_id += 1; | |
| 494 | } | |
| 495 | ||
| 496 | const casted_body: *const clang.CompoundStmt = @ptrCast(body_stmt); | |
| 497 | transCompoundStmtInline(c, casted_body, &block_scope) catch |err| switch (err) { | |
| 498 | error.OutOfMemory => |e| return e, | |
| 499 | error.UnsupportedTranslation, | |
| 500 | error.UnsupportedType, | |
| 501 | => { | |
| 502 | proto_node.data.is_extern = true; | |
| 503 | proto_node.data.is_export = false; | |
| 504 | proto_node.data.is_inline = false; | |
| 505 | try warn(c, &c.global_scope.base, fn_decl_loc, "unable to translate function, demoted to extern", .{}); | |
| 506 | return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); | |
| 507 | }, | |
| 508 | }; | |
| 509 | // add return statement if the function didn't have one | |
| 510 | blk: { | |
| 511 | const maybe_body = try block_scope.complete(c); | |
| 512 | if (fn_ty.getNoReturnAttr() or isAnyopaque(return_qt) or maybe_body.isNoreturn(false)) { | |
| 513 | proto_node.data.body = maybe_body; | |
| 514 | break :blk; | |
| 515 | } | |
| 516 | ||
| 517 | const rhs = transZeroInitExpr(c, top_scope, fn_decl_loc, return_qt.getTypePtr()) catch |err| switch (err) { | |
| 518 | error.OutOfMemory => |e| return e, | |
| 519 | error.UnsupportedTranslation, | |
| 520 | error.UnsupportedType, | |
| 521 | => { | |
| 522 | proto_node.data.is_extern = true; | |
| 523 | proto_node.data.is_export = false; | |
| 524 | proto_node.data.is_inline = false; | |
| 525 | try warn(c, &c.global_scope.base, fn_decl_loc, "unable to create a return value for function, demoted to extern", .{}); | |
| 526 | return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); | |
| 527 | }, | |
| 528 | }; | |
| 529 | const ret = try Tag.@"return".create(c.arena, rhs); | |
| 530 | try block_scope.statements.append(ret); | |
| 531 | proto_node.data.body = try block_scope.complete(c); | |
| 532 | } | |
| 533 | ||
| 534 | return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); | |
| 535 | } | |
| 536 | ||
| 537 | fn transQualTypeMaybeInitialized(c: *Context, scope: *Scope, qt: clang.QualType, decl_init: ?*const clang.Expr, loc: clang.SourceLocation) TransError!Node { | |
| 538 | return if (decl_init) |init_expr| | |
| 539 | transQualTypeInitialized(c, scope, qt, init_expr, loc) | |
| 540 | else | |
| 541 | transQualType(c, scope, qt, loc); | |
| 542 | } | |
| 543 | ||
| 544 | /// This is used in global scope to convert a string literal `S` to [*c]u8: | |
| 545 | /// &(struct { | |
| 546 | /// var static = S.*; | |
| 547 | /// }).static; | |
| 548 | fn stringLiteralToCharStar(c: *Context, str: Node) Error!Node { | |
| 549 | const var_name = Scope.Block.static_inner_name; | |
| 550 | ||
| 551 | const variables = try c.arena.alloc(Node, 1); | |
| 552 | variables[0] = try Tag.mut_str.create(c.arena, .{ .name = var_name, .init = str }); | |
| 553 | ||
| 554 | const anon_struct = try Tag.@"struct".create(c.arena, .{ | |
| 555 | .layout = .none, | |
| 556 | .fields = &.{}, | |
| 557 | .functions = &.{}, | |
| 558 | .variables = variables, | |
| 559 | }); | |
| 560 | ||
| 561 | const member_access = try Tag.field_access.create(c.arena, .{ | |
| 562 | .lhs = anon_struct, | |
| 563 | .field_name = var_name, | |
| 564 | }); | |
| 565 | return Tag.address_of.create(c.arena, member_access); | |
| 566 | } | |
| 567 | ||
| 568 | /// if mangled_name is not null, this var decl was declared in a block scope. | |
| 569 | fn visitVarDecl(c: *Context, var_decl: *const clang.VarDecl, mangled_name: ?[]const u8) Error!void { | |
| 570 | const var_name = mangled_name orelse try c.str(@as(*const clang.NamedDecl, @ptrCast(var_decl)).getName_bytes_begin()); | |
| 571 | if (c.global_scope.sym_table.contains(var_name)) | |
| 572 | return; // Avoid processing this decl twice | |
| 573 | ||
| 574 | const is_pub = mangled_name == null; | |
| 575 | const is_threadlocal = var_decl.getTLSKind() != .None; | |
| 576 | const scope = &c.global_scope.base; | |
| 577 | const var_decl_loc = var_decl.getLocation(); | |
| 578 | ||
| 579 | const qual_type = var_decl.getTypeSourceInfo_getType(); | |
| 580 | const storage_class = var_decl.getStorageClass(); | |
| 581 | const has_init = var_decl.hasInit(); | |
| 582 | const decl_init = var_decl.getInit(); | |
| 583 | var is_const = qual_type.isConstQualified(); | |
| 584 | ||
| 585 | // In C extern variables with initializers behave like Zig exports. | |
| 586 | // extern int foo = 2; | |
| 587 | // does the same as: | |
| 588 | // extern int foo; | |
| 589 | // int foo = 2; | |
| 590 | var is_extern = storage_class == .Extern and !has_init; | |
| 591 | var is_export = !is_extern and storage_class != .Static; | |
| 592 | ||
| 593 | if (!is_extern and qualTypeWasDemotedToOpaque(c, qual_type)) { | |
| 594 | return failDecl(c, var_decl_loc, var_name, "non-extern variable has opaque type", .{}); | |
| 595 | } | |
| 596 | ||
| 597 | const type_node = transQualTypeMaybeInitialized(c, scope, qual_type, decl_init, var_decl_loc) catch |err| switch (err) { | |
| 598 | error.UnsupportedTranslation, error.UnsupportedType => { | |
| 599 | return failDecl(c, var_decl_loc, var_name, "unable to resolve variable type", .{}); | |
| 600 | }, | |
| 601 | error.OutOfMemory => |e| return e, | |
| 602 | }; | |
| 603 | ||
| 604 | var init_node: ?Node = null; | |
| 605 | ||
| 606 | // If the initialization expression is not present, initialize with undefined. | |
| 607 | // If it is an integer literal, we can skip the @as since it will be redundant | |
| 608 | // with the variable type. | |
| 609 | if (has_init) trans_init: { | |
| 610 | if (decl_init) |expr| { | |
| 611 | const node_or_error = if (expr.getStmtClass() == .StringLiteralClass) | |
| 612 | transStringLiteralInitializer(c, @as(*const clang.StringLiteral, @ptrCast(expr)), type_node) | |
| 613 | else | |
| 614 | transExprCoercing(c, scope, expr, .used); | |
| 615 | init_node = node_or_error catch |err| switch (err) { | |
| 616 | error.UnsupportedTranslation, | |
| 617 | error.UnsupportedType, | |
| 618 | => { | |
| 619 | is_extern = true; | |
| 620 | is_export = false; | |
| 621 | try warn(c, scope, var_decl_loc, "unable to translate variable initializer, demoted to extern", .{}); | |
| 622 | break :trans_init; | |
| 623 | }, | |
| 624 | error.OutOfMemory => |e| return e, | |
| 625 | }; | |
| 626 | if (!qualTypeIsBoolean(qual_type) and isBoolRes(init_node.?)) { | |
| 627 | init_node = try Tag.int_from_bool.create(c.arena, init_node.?); | |
| 628 | } else if (init_node.?.tag() == .string_literal and qualTypeIsCharStar(qual_type)) { | |
| 629 | init_node = try stringLiteralToCharStar(c, init_node.?); | |
| 630 | } | |
| 631 | } else { | |
| 632 | init_node = Tag.undefined_literal.init(); | |
| 633 | } | |
| 634 | } else if (storage_class != .Extern) { | |
| 635 | // The C language specification states that variables with static or threadlocal | |
| 636 | // storage without an initializer are initialized to a zero value. | |
| 637 | ||
| 638 | // std.mem.zeroes(T) | |
| 639 | init_node = try Tag.std_mem_zeroes.create(c.arena, type_node); | |
| 640 | } else if (qual_type.getTypeClass() == .IncompleteArray) { | |
| 641 | // Oh no, an extern array of unknown size! These are really fun because there's no | |
| 642 | // direct equivalent in Zig. To translate correctly, we'll have to create a C-pointer | |
| 643 | // to the data initialized via @extern. | |
| 644 | ||
| 645 | const name_str = try std.fmt.allocPrint(c.arena, "\"{s}\"", .{var_name}); | |
| 646 | init_node = try Tag.builtin_extern.create(c.arena, .{ | |
| 647 | .type = type_node, | |
| 648 | .name = try Tag.string_literal.create(c.arena, name_str), | |
| 649 | }); | |
| 650 | ||
| 651 | // Since this is really a pointer to the underlying data, we tweak a few properties. | |
| 652 | is_extern = false; | |
| 653 | is_const = true; | |
| 654 | } | |
| 655 | ||
| 656 | const linksection_string = blk: { | |
| 657 | var str_len: usize = undefined; | |
| 658 | if (var_decl.getSectionAttribute(&str_len)) |str_ptr| { | |
| 659 | break :blk str_ptr[0..str_len]; | |
| 660 | } | |
| 661 | break :blk null; | |
| 662 | }; | |
| 663 | ||
| 664 | const node = try Tag.var_decl.create(c.arena, .{ | |
| 665 | .is_pub = is_pub, | |
| 666 | .is_const = is_const, | |
| 667 | .is_extern = is_extern, | |
| 668 | .is_export = is_export, | |
| 669 | .is_threadlocal = is_threadlocal, | |
| 670 | .linksection_string = linksection_string, | |
| 671 | .alignment = ClangAlignment.forVar(c, var_decl).zigAlignment(), | |
| 672 | .name = var_name, | |
| 673 | .type = type_node, | |
| 674 | .init = init_node, | |
| 675 | }); | |
| 676 | return addTopLevelDecl(c, var_name, node); | |
| 677 | } | |
| 678 | ||
| 679 | const builtin_typedef_map = std.StaticStringMap([]const u8).initComptime(.{ | |
| 680 | .{ "uint8_t", "u8" }, | |
| 681 | .{ "int8_t", "i8" }, | |
| 682 | .{ "uint16_t", "u16" }, | |
| 683 | .{ "int16_t", "i16" }, | |
| 684 | .{ "uint32_t", "u32" }, | |
| 685 | .{ "int32_t", "i32" }, | |
| 686 | .{ "uint64_t", "u64" }, | |
| 687 | .{ "int64_t", "i64" }, | |
| 688 | .{ "intptr_t", "isize" }, | |
| 689 | .{ "uintptr_t", "usize" }, | |
| 690 | .{ "ssize_t", "isize" }, | |
| 691 | .{ "size_t", "usize" }, | |
| 692 | }); | |
| 693 | ||
| 694 | fn transTypeDef(c: *Context, scope: *Scope, typedef_decl: *const clang.TypedefNameDecl) Error!void { | |
| 695 | if (c.decl_table.get(@intFromPtr(typedef_decl.getCanonicalDecl()))) |_| | |
| 696 | return; // Avoid processing this decl twice | |
| 697 | const toplevel = scope.id == .root; | |
| 698 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; | |
| 699 | ||
| 700 | var name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(typedef_decl)).getName_bytes_begin()); | |
| 701 | try c.typedefs.put(c.gpa, name, {}); | |
| 702 | ||
| 703 | if (builtin_typedef_map.get(name)) |builtin| { | |
| 704 | return c.decl_table.putNoClobber(c.gpa, @intFromPtr(typedef_decl.getCanonicalDecl()), builtin); | |
| 705 | } | |
| 706 | if (!toplevel) name = try bs.makeMangledName(c, name); | |
| 707 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(typedef_decl.getCanonicalDecl()), name); | |
| 708 | ||
| 709 | const child_qt = typedef_decl.getUnderlyingType(); | |
| 710 | const typedef_loc = typedef_decl.getLocation(); | |
| 711 | const init_node = transQualType(c, scope, child_qt, typedef_loc) catch |err| switch (err) { | |
| 712 | error.UnsupportedType => { | |
| 713 | return failDecl(c, typedef_loc, name, "unable to resolve typedef child type", .{}); | |
| 714 | }, | |
| 715 | error.OutOfMemory => |e| return e, | |
| 716 | }; | |
| 717 | ||
| 718 | const payload = try c.arena.create(ast.Payload.SimpleVarDecl); | |
| 719 | payload.* = .{ | |
| 720 | .base = .{ .tag = ([2]Tag{ .var_simple, .pub_var_simple })[@intFromBool(toplevel)] }, | |
| 721 | .data = .{ | |
| 722 | .name = name, | |
| 723 | .init = init_node, | |
| 724 | }, | |
| 725 | }; | |
| 726 | const node = Node.initPayload(&payload.base); | |
| 727 | ||
| 728 | if (toplevel) { | |
| 729 | try addTopLevelDecl(c, name, node); | |
| 730 | } else { | |
| 731 | try scope.appendNode(node); | |
| 732 | if (node.tag() != .pub_var_simple) { | |
| 733 | try bs.discardVariable(c, name); | |
| 734 | } | |
| 735 | } | |
| 736 | } | |
| 737 | ||
| 738 | /// Build a getter function for a flexible array member at the end of a C struct | |
| 739 | /// e.g. `T items[]` or `T items[0]`. The generated function returns a [*c] pointer | |
| 740 | /// to the flexible array with the correct const and volatile qualifiers | |
| 741 | fn buildFlexibleArrayFn( | |
| 742 | c: *Context, | |
| 743 | scope: *Scope, | |
| 744 | layout: *const clang.ASTRecordLayout, | |
| 745 | field_name: []const u8, | |
| 746 | field_decl: *const clang.FieldDecl, | |
| 747 | ) TypeError!Node { | |
| 748 | const field_qt = field_decl.getType(); | |
| 749 | const field_qt_canon = qualTypeCanon(field_qt); | |
| 750 | ||
| 751 | const u8_type = try Tag.type.create(c.arena, "u8"); | |
| 752 | const self_param_name = "self"; | |
| 753 | const self_param = try Tag.identifier.create(c.arena, self_param_name); | |
| 754 | const self_type = try Tag.typeof.create(c.arena, self_param); | |
| 755 | ||
| 756 | const fn_params = try c.arena.alloc(ast.Payload.Param, 1); | |
| 757 | ||
| 758 | fn_params[0] = .{ | |
| 759 | .name = self_param_name, | |
| 760 | .type = Tag.@"anytype".init(), | |
| 761 | .is_noalias = false, | |
| 762 | }; | |
| 763 | ||
| 764 | const array_type = @as(*const clang.ArrayType, @ptrCast(field_qt_canon)); | |
| 765 | const element_qt = array_type.getElementType(); | |
| 766 | const element_type = try transQualType(c, scope, element_qt, field_decl.getLocation()); | |
| 767 | ||
| 768 | var block_scope = try Scope.Block.init(c, scope, false); | |
| 769 | defer block_scope.deinit(); | |
| 770 | ||
| 771 | const intermediate_type_name = try block_scope.makeMangledName(c, "Intermediate"); | |
| 772 | const intermediate_type = try Tag.helpers_flexible_array_type.create(c.arena, .{ .lhs = self_type, .rhs = u8_type }); | |
| 773 | const intermediate_type_decl = try Tag.var_simple.create(c.arena, .{ | |
| 774 | .name = intermediate_type_name, | |
| 775 | .init = intermediate_type, | |
| 776 | }); | |
| 777 | try block_scope.statements.append(intermediate_type_decl); | |
| 778 | const intermediate_type_ident = try Tag.identifier.create(c.arena, intermediate_type_name); | |
| 779 | ||
| 780 | const return_type_name = try block_scope.makeMangledName(c, "ReturnType"); | |
| 781 | const return_type = try Tag.helpers_flexible_array_type.create(c.arena, .{ .lhs = self_type, .rhs = element_type }); | |
| 782 | const return_type_decl = try Tag.var_simple.create(c.arena, .{ | |
| 783 | .name = return_type_name, | |
| 784 | .init = return_type, | |
| 785 | }); | |
| 786 | try block_scope.statements.append(return_type_decl); | |
| 787 | const return_type_ident = try Tag.identifier.create(c.arena, return_type_name); | |
| 788 | ||
| 789 | const field_index = field_decl.getFieldIndex(); | |
| 790 | const bit_offset = layout.getFieldOffset(field_index); // this is a target-specific constant based on the struct layout | |
| 791 | const byte_offset = bit_offset / 8; | |
| 792 | ||
| 793 | const casted_self = try Tag.as.create(c.arena, .{ | |
| 794 | .lhs = intermediate_type_ident, | |
| 795 | .rhs = try Tag.ptr_cast.create(c.arena, self_param), | |
| 796 | }); | |
| 797 | const field_offset = try transCreateNodeNumber(c, byte_offset, .int); | |
| 798 | const field_ptr = try Tag.add.create(c.arena, .{ .lhs = casted_self, .rhs = field_offset }); | |
| 799 | ||
| 800 | const ptr_cast = try Tag.as.create(c.arena, .{ | |
| 801 | .lhs = return_type_ident, | |
| 802 | .rhs = try Tag.ptr_cast.create( | |
| 803 | c.arena, | |
| 804 | try Tag.align_cast.create( | |
| 805 | c.arena, | |
| 806 | field_ptr, | |
| 807 | ), | |
| 808 | ), | |
| 809 | }); | |
| 810 | const return_stmt = try Tag.@"return".create(c.arena, ptr_cast); | |
| 811 | try block_scope.statements.append(return_stmt); | |
| 812 | ||
| 813 | const payload = try c.arena.create(ast.Payload.Func); | |
| 814 | payload.* = .{ | |
| 815 | .base = .{ .tag = .func }, | |
| 816 | .data = .{ | |
| 817 | .is_pub = true, | |
| 818 | .is_extern = false, | |
| 819 | .is_export = false, | |
| 820 | .is_inline = false, | |
| 821 | .is_var_args = false, | |
| 822 | .name = field_name, | |
| 823 | .linksection_string = null, | |
| 824 | .explicit_callconv = null, | |
| 825 | .params = fn_params, | |
| 826 | .return_type = return_type, | |
| 827 | .body = try block_scope.complete(c), | |
| 828 | .alignment = null, | |
| 829 | }, | |
| 830 | }; | |
| 831 | return Node.initPayload(&payload.base); | |
| 832 | } | |
| 833 | ||
| 834 | /// Return true if `field_decl` is the flexible array field for its parent record | |
| 835 | fn isFlexibleArrayFieldDecl(c: *Context, field_decl: *const clang.FieldDecl) bool { | |
| 836 | const record_decl = field_decl.getParent() orelse return false; | |
| 837 | const record_flexible_field = flexibleArrayField(c, record_decl) orelse return false; | |
| 838 | return field_decl == record_flexible_field; | |
| 839 | } | |
| 840 | ||
| 841 | /// Find the flexible array field for a record if any. A flexible array field is an | |
| 842 | /// incomplete or zero-length array that occurs as the last field of a record. | |
| 843 | /// clang's RecordDecl::hasFlexibleArrayMember is not suitable for determining | |
| 844 | /// this because it returns false for a record that ends with a zero-length | |
| 845 | /// array, but we consider those to be flexible arrays | |
| 846 | fn flexibleArrayField(c: *Context, record_def: *const clang.RecordDecl) ?*const clang.FieldDecl { | |
| 847 | var it = record_def.field_begin(); | |
| 848 | const end_it = record_def.field_end(); | |
| 849 | var flexible_field: ?*const clang.FieldDecl = null; | |
| 850 | while (it.neq(end_it)) : (it = it.next()) { | |
| 851 | const field_decl = it.deref(); | |
| 852 | const ty = qualTypeCanon(field_decl.getType()); | |
| 853 | const incomplete_or_zero_size = ty.isIncompleteOrZeroLengthArrayType(c.clang_context); | |
| 854 | if (incomplete_or_zero_size) { | |
| 855 | flexible_field = field_decl; | |
| 856 | } else { | |
| 857 | flexible_field = null; | |
| 858 | } | |
| 859 | } | |
| 860 | return flexible_field; | |
| 861 | } | |
| 862 | ||
| 863 | fn mangleWeakGlobalName(c: *Context, want_name: []const u8) ![]const u8 { | |
| 864 | var cur_name = want_name; | |
| 865 | ||
| 866 | if (!c.weak_global_names.contains(want_name)) { | |
| 867 | // This type wasn't noticed by the name detection pass, so nothing has been treating this as | |
| 868 | // a weak global name. We must mangle it to avoid conflicts with locals. | |
| 869 | cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); | |
| 870 | } | |
| 871 | ||
| 872 | while (c.global_names.contains(cur_name)) { | |
| 873 | cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); | |
| 874 | } | |
| 875 | return cur_name; | |
| 876 | } | |
| 877 | ||
| 878 | fn transRecordDecl(c: *Context, scope: *Scope, record_decl: *const clang.RecordDecl) Error!void { | |
| 879 | if (c.decl_table.get(@intFromPtr(record_decl.getCanonicalDecl()))) |_| | |
| 880 | return; // Avoid processing this decl twice | |
| 881 | const record_loc = record_decl.getLocation(); | |
| 882 | const toplevel = scope.id == .root; | |
| 883 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; | |
| 884 | ||
| 885 | var is_union = false; | |
| 886 | var container_kind_name: []const u8 = undefined; | |
| 887 | var bare_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(record_decl)).getName_bytes_begin()); | |
| 888 | ||
| 889 | if (record_decl.isUnion()) { | |
| 890 | container_kind_name = "union"; | |
| 891 | is_union = true; | |
| 892 | } else if (record_decl.isStruct()) { | |
| 893 | container_kind_name = "struct"; | |
| 894 | } else { | |
| 895 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), bare_name); | |
| 896 | return failDecl(c, record_loc, bare_name, "record {s} is not a struct or union", .{bare_name}); | |
| 897 | } | |
| 898 | ||
| 899 | var is_unnamed = false; | |
| 900 | var name = bare_name; | |
| 901 | if (c.unnamed_typedefs.get(@intFromPtr(record_decl.getCanonicalDecl()))) |typedef_name| { | |
| 902 | bare_name = typedef_name; | |
| 903 | name = typedef_name; | |
| 904 | } else { | |
| 905 | // Record declarations such as `struct {...} x` have no name but they're not | |
| 906 | // anonymous hence here isAnonymousStructOrUnion is not needed | |
| 907 | if (bare_name.len == 0) { | |
| 908 | bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); | |
| 909 | is_unnamed = true; | |
| 910 | } | |
| 911 | name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_kind_name, bare_name }); | |
| 912 | if (toplevel and !is_unnamed) { | |
| 913 | name = try mangleWeakGlobalName(c, name); | |
| 914 | } | |
| 915 | } | |
| 916 | if (!toplevel) name = try bs.makeMangledName(c, name); | |
| 917 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), name); | |
| 918 | ||
| 919 | const is_pub = toplevel and !is_unnamed; | |
| 920 | const init_node = blk: { | |
| 921 | const record_def = record_decl.getDefinition() orelse { | |
| 922 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); | |
| 923 | break :blk Tag.opaque_literal.init(); | |
| 924 | }; | |
| 925 | ||
| 926 | var fields = std.array_list.Managed(ast.Payload.Record.Field).init(c.gpa); | |
| 927 | defer fields.deinit(); | |
| 928 | ||
| 929 | var functions = std.array_list.Managed(Node).init(c.gpa); | |
| 930 | defer functions.deinit(); | |
| 931 | ||
| 932 | const flexible_field = flexibleArrayField(c, record_def); | |
| 933 | var unnamed_field_count: u32 = 0; | |
| 934 | var it = record_def.field_begin(); | |
| 935 | const end_it = record_def.field_end(); | |
| 936 | const layout = record_def.getASTRecordLayout(c.clang_context); | |
| 937 | const record_alignment = layout.getAlignment(); | |
| 938 | ||
| 939 | while (it.neq(end_it)) : (it = it.next()) { | |
| 940 | const field_decl = it.deref(); | |
| 941 | const field_loc = field_decl.getLocation(); | |
| 942 | const field_qt = field_decl.getType(); | |
| 943 | ||
| 944 | if (field_decl.isBitField()) { | |
| 945 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); | |
| 946 | try warn(c, scope, field_loc, "{s} demoted to opaque type - has bitfield", .{container_kind_name}); | |
| 947 | break :blk Tag.opaque_literal.init(); | |
| 948 | } | |
| 949 | ||
| 950 | var is_anon = false; | |
| 951 | var field_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); | |
| 952 | if (field_decl.isAnonymousStructOrUnion() or field_name.len == 0) { | |
| 953 | // Context.getMangle() is not used here because doing so causes unpredictable field names for anonymous fields. | |
| 954 | field_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{unnamed_field_count}); | |
| 955 | unnamed_field_count += 1; | |
| 956 | is_anon = true; | |
| 957 | } | |
| 958 | if (flexible_field == field_decl) { | |
| 959 | const flexible_array_fn = buildFlexibleArrayFn(c, scope, layout, field_name, field_decl) catch |err| switch (err) { | |
| 960 | error.UnsupportedType => { | |
| 961 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); | |
| 962 | 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 }); | |
| 963 | break :blk Tag.opaque_literal.init(); | |
| 964 | }, | |
| 965 | else => |e| return e, | |
| 966 | }; | |
| 967 | try functions.append(flexible_array_fn); | |
| 968 | continue; | |
| 969 | } | |
| 970 | const field_type = transQualType(c, scope, field_qt, field_loc) catch |err| switch (err) { | |
| 971 | error.UnsupportedType => { | |
| 972 | try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); | |
| 973 | try warn(c, scope, record_loc, "{s} demoted to opaque type - unable to translate type of field {s}", .{ container_kind_name, field_name }); | |
| 974 | break :blk Tag.opaque_literal.init(); | |
| 975 | }, | |
| 976 | else => |e| return e, | |
| 977 | }; | |
| 978 | ||
| 979 | const alignment = if (flexible_field != null and field_decl.getFieldIndex() == 0) | |
| 980 | @as(c_uint, @intCast(record_alignment)) | |
| 981 | else | |
| 982 | ClangAlignment.forField(c, field_decl, record_def).zigAlignment(); | |
| 983 | ||
| 984 | // C99 introduced designated initializers for structs. Omitted fields are implicitly | |
| 985 | // initialized to zero. Some C APIs are designed with this in mind. Defaulting to zero | |
| 986 | // values for translated struct fields permits Zig code to comfortably use such an API. | |
| 987 | const default_value = if (record_decl.isStruct()) | |
| 988 | try Tag.std_mem_zeroes.create(c.arena, field_type) | |
| 989 | else | |
| 990 | null; | |
| 991 | ||
| 992 | if (is_anon) { | |
| 993 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(field_decl.getCanonicalDecl()), field_name); | |
| 994 | } | |
| 995 | ||
| 996 | try fields.append(.{ | |
| 997 | .name = field_name, | |
| 998 | .type = field_type, | |
| 999 | .alignment = alignment, | |
| 1000 | .default_value = default_value, | |
| 1001 | }); | |
| 1002 | } | |
| 1003 | ||
| 1004 | const record_payload = try c.arena.create(ast.Payload.Record); | |
| 1005 | record_payload.* = .{ | |
| 1006 | .base = .{ .tag = ([2]Tag{ .@"struct", .@"union" })[@intFromBool(is_union)] }, | |
| 1007 | .data = .{ | |
| 1008 | .layout = .@"extern", | |
| 1009 | .fields = try c.arena.dupe(ast.Payload.Record.Field, fields.items), | |
| 1010 | .functions = try c.arena.dupe(Node, functions.items), | |
| 1011 | .variables = &.{}, | |
| 1012 | }, | |
| 1013 | }; | |
| 1014 | break :blk Node.initPayload(&record_payload.base); | |
| 1015 | }; | |
| 1016 | ||
| 1017 | const payload = try c.arena.create(ast.Payload.SimpleVarDecl); | |
| 1018 | payload.* = .{ | |
| 1019 | .base = .{ .tag = ([2]Tag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, | |
| 1020 | .data = .{ | |
| 1021 | .name = name, | |
| 1022 | .init = init_node, | |
| 1023 | }, | |
| 1024 | }; | |
| 1025 | const node = Node.initPayload(&payload.base); | |
| 1026 | if (toplevel) { | |
| 1027 | try addTopLevelDecl(c, name, node); | |
| 1028 | // Only add the alias if the name is available *and* it was caught by | |
| 1029 | // name detection. Don't bother performing a weak mangle, since a | |
| 1030 | // mangled name is of no real use here. | |
| 1031 | if (!is_unnamed and !c.global_names.contains(bare_name) and c.weak_global_names.contains(bare_name)) | |
| 1032 | try c.alias_list.append(.{ .alias = bare_name, .name = name }); | |
| 1033 | } else { | |
| 1034 | try scope.appendNode(node); | |
| 1035 | if (node.tag() != .pub_var_simple) { | |
| 1036 | try bs.discardVariable(c, name); | |
| 1037 | } | |
| 1038 | } | |
| 1039 | } | |
| 1040 | ||
| 1041 | fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: *const clang.EnumDecl) Error!void { | |
| 1042 | if (c.decl_table.get(@intFromPtr(enum_decl.getCanonicalDecl()))) |_| | |
| 1043 | return; // Avoid processing this decl twice | |
| 1044 | const enum_loc = enum_decl.getLocation(); | |
| 1045 | const toplevel = scope.id == .root; | |
| 1046 | const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; | |
| 1047 | ||
| 1048 | var is_unnamed = false; | |
| 1049 | var bare_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(enum_decl)).getName_bytes_begin()); | |
| 1050 | var name = bare_name; | |
| 1051 | if (c.unnamed_typedefs.get(@intFromPtr(enum_decl.getCanonicalDecl()))) |typedef_name| { | |
| 1052 | bare_name = typedef_name; | |
| 1053 | name = typedef_name; | |
| 1054 | } else { | |
| 1055 | if (bare_name.len == 0) { | |
| 1056 | bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); | |
| 1057 | is_unnamed = true; | |
| 1058 | } | |
| 1059 | name = try std.fmt.allocPrint(c.arena, "enum_{s}", .{bare_name}); | |
| 1060 | if (toplevel and !is_unnamed) { | |
| 1061 | name = try mangleWeakGlobalName(c, name); | |
| 1062 | } | |
| 1063 | } | |
| 1064 | if (!toplevel) name = try bs.makeMangledName(c, name); | |
| 1065 | try c.decl_table.putNoClobber(c.gpa, @intFromPtr(enum_decl.getCanonicalDecl()), name); | |
| 1066 | ||
| 1067 | const enum_type_node = if (enum_decl.getDefinition()) |enum_def| blk: { | |
| 1068 | var it = enum_def.enumerator_begin(); | |
| 1069 | const end_it = enum_def.enumerator_end(); | |
| 1070 | while (it.neq(end_it)) : (it = it.next()) { | |
| 1071 | const enum_const = it.deref(); | |
| 1072 | var enum_val_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(enum_const)).getName_bytes_begin()); | |
| 1073 | if (!toplevel) { | |
| 1074 | enum_val_name = try bs.makeMangledName(c, enum_val_name); | |
| 1075 | } | |
| 1076 | ||
| 1077 | const enum_const_qt = @as(*const clang.ValueDecl, @ptrCast(enum_const)).getType(); | |
| 1078 | const enum_const_loc = @as(*const clang.Decl, @ptrCast(enum_const)).getLocation(); | |
| 1079 | const enum_const_type_node: ?Node = transQualType(c, scope, enum_const_qt, enum_const_loc) catch |err| switch (err) { | |
| 1080 | error.UnsupportedType => null, | |
| 1081 | else => |e| return e, | |
| 1082 | }; | |
| 1083 | ||
| 1084 | const enum_const_def = try Tag.enum_constant.create(c.arena, .{ | |
| 1085 | .name = enum_val_name, | |
| 1086 | .is_public = toplevel, | |
| 1087 | .type = enum_const_type_node, | |
| 1088 | // TODO: as of LLVM 18, the return value from `enum_const.getInitVal` here needs | |
| 1089 | // to be freed with a call to its free() method. | |
| 1090 | .value = try transCreateNodeAPInt(c, enum_const.getInitVal()), | |
| 1091 | }); | |
| 1092 | if (toplevel) | |
| 1093 | try addTopLevelDecl(c, enum_val_name, enum_const_def) | |
| 1094 | else { | |
| 1095 | try scope.appendNode(enum_const_def); | |
| 1096 | try bs.discardVariable(c, enum_val_name); | |
| 1097 | } | |
| 1098 | } | |
| 1099 | ||
| 1100 | const int_type = enum_decl.getIntegerType(); | |
| 1101 | // The underlying type may be null in case of forward-declared enum | |
| 1102 | // types, while that's not ISO-C compliant many compilers allow this and | |
| 1103 | // default to the usual integer type used for all the enums. | |
| 1104 | ||
| 1105 | // default to c_int since msvc and gcc default to different types | |
| 1106 | break :blk if (int_type.ptr != null) | |
| 1107 | transQualType(c, scope, int_type, enum_loc) catch |err| switch (err) { | |
| 1108 | error.UnsupportedType => { | |
| 1109 | return failDecl(c, enum_loc, name, "unable to translate enum integer type", .{}); | |
| 1110 | }, | |
| 1111 | else => |e| return e, | |
| 1112 | } | |
| 1113 | else | |
| 1114 | try Tag.type.create(c.arena, "c_int"); | |
| 1115 | } else blk: { | |
| 1116 | try c.opaque_demotes.put(c.gpa, @intFromPtr(enum_decl.getCanonicalDecl()), {}); | |
| 1117 | break :blk Tag.opaque_literal.init(); | |
| 1118 | }; | |
| 1119 | ||
| 1120 | const is_pub = toplevel and !is_unnamed; | |
| 1121 | const payload = try c.arena.create(ast.Payload.SimpleVarDecl); | |
| 1122 | payload.* = .{ | |
| 1123 | .base = .{ .tag = ([2]Tag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, | |
| 1124 | .data = .{ | |
| 1125 | .init = enum_type_node, | |
| 1126 | .name = name, | |
| 1127 | }, | |
| 1128 | }; | |
| 1129 | const node = Node.initPayload(&payload.base); | |
| 1130 | if (toplevel) { | |
| 1131 | try addTopLevelDecl(c, name, node); | |
| 1132 | // Only add the alias if the name is available *and* it was caught by | |
| 1133 | // name detection. Don't bother performing a weak mangle, since a | |
| 1134 | // mangled name is of no real use here. | |
| 1135 | if (!is_unnamed and !c.global_names.contains(bare_name) and c.weak_global_names.contains(bare_name)) | |
| 1136 | try c.alias_list.append(.{ .alias = bare_name, .name = name }); | |
| 1137 | } else { | |
| 1138 | try scope.appendNode(node); | |
| 1139 | if (node.tag() != .pub_var_simple) { | |
| 1140 | try bs.discardVariable(c, name); | |
| 1141 | } | |
| 1142 | } | |
| 1143 | } | |
| 1144 | ||
| 1145 | fn transStmt( | |
| 1146 | c: *Context, | |
| 1147 | scope: *Scope, | |
| 1148 | stmt: *const clang.Stmt, | |
| 1149 | result_used: ResultUsed, | |
| 1150 | ) TransError!Node { | |
| 1151 | const sc = stmt.getStmtClass(); | |
| 1152 | switch (sc) { | |
| 1153 | .BinaryOperatorClass => return transBinaryOperator(c, scope, @as(*const clang.BinaryOperator, @ptrCast(stmt)), result_used), | |
| 1154 | .CompoundStmtClass => return transCompoundStmt(c, scope, @as(*const clang.CompoundStmt, @ptrCast(stmt))), | |
| 1155 | .CStyleCastExprClass => return transCStyleCastExprClass(c, scope, @as(*const clang.CStyleCastExpr, @ptrCast(stmt)), result_used), | |
| 1156 | .DeclStmtClass => return transDeclStmt(c, scope, @as(*const clang.DeclStmt, @ptrCast(stmt))), | |
| 1157 | .DeclRefExprClass => return transDeclRefExpr(c, scope, @as(*const clang.DeclRefExpr, @ptrCast(stmt))), | |
| 1158 | .ImplicitCastExprClass => return transImplicitCastExpr(c, scope, @as(*const clang.ImplicitCastExpr, @ptrCast(stmt)), result_used), | |
| 1159 | .IntegerLiteralClass => return transIntegerLiteral(c, scope, @as(*const clang.IntegerLiteral, @ptrCast(stmt)), result_used, .with_as), | |
| 1160 | .ReturnStmtClass => return transReturnStmt(c, scope, @as(*const clang.ReturnStmt, @ptrCast(stmt))), | |
| 1161 | .StringLiteralClass => return transStringLiteral(c, scope, @as(*const clang.StringLiteral, @ptrCast(stmt)), result_used), | |
| 1162 | .ParenExprClass => { | |
| 1163 | const expr = try transExpr(c, scope, @as(*const clang.ParenExpr, @ptrCast(stmt)).getSubExpr(), .used); | |
| 1164 | return maybeSuppressResult(c, result_used, expr); | |
| 1165 | }, | |
| 1166 | .InitListExprClass => return transInitListExpr(c, scope, @as(*const clang.InitListExpr, @ptrCast(stmt)), result_used), | |
| 1167 | .ImplicitValueInitExprClass => return transImplicitValueInitExpr(c, scope, @as(*const clang.Expr, @ptrCast(stmt))), | |
| 1168 | .IfStmtClass => return transIfStmt(c, scope, @as(*const clang.IfStmt, @ptrCast(stmt))), | |
| 1169 | .WhileStmtClass => return transWhileLoop(c, scope, @as(*const clang.WhileStmt, @ptrCast(stmt))), | |
| 1170 | .DoStmtClass => return transDoWhileLoop(c, scope, @as(*const clang.DoStmt, @ptrCast(stmt))), | |
| 1171 | .NullStmtClass => { | |
| 1172 | return Tag.empty_block.init(); | |
| 1173 | }, | |
| 1174 | .ContinueStmtClass => return Tag.@"continue".init(), | |
| 1175 | .BreakStmtClass => return Tag.@"break".init(), | |
| 1176 | .ForStmtClass => return transForLoop(c, scope, @as(*const clang.ForStmt, @ptrCast(stmt))), | |
| 1177 | .FloatingLiteralClass => return transFloatingLiteral(c, @as(*const clang.FloatingLiteral, @ptrCast(stmt)), result_used), | |
| 1178 | .ConditionalOperatorClass => { | |
| 1179 | return transConditionalOperator(c, scope, @as(*const clang.ConditionalOperator, @ptrCast(stmt)), result_used); | |
| 1180 | }, | |
| 1181 | .BinaryConditionalOperatorClass => { | |
| 1182 | return transBinaryConditionalOperator(c, scope, @as(*const clang.BinaryConditionalOperator, @ptrCast(stmt)), result_used); | |
| 1183 | }, | |
| 1184 | .SwitchStmtClass => return transSwitch(c, scope, @as(*const clang.SwitchStmt, @ptrCast(stmt))), | |
| 1185 | .CaseStmtClass, .DefaultStmtClass => { | |
| 1186 | return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "TODO complex switch", .{}); | |
| 1187 | }, | |
| 1188 | .ConstantExprClass => return transConstantExpr(c, scope, @as(*const clang.Expr, @ptrCast(stmt)), result_used), | |
| 1189 | .PredefinedExprClass => return transPredefinedExpr(c, scope, @as(*const clang.PredefinedExpr, @ptrCast(stmt)), result_used), | |
| 1190 | .CharacterLiteralClass => return transCharLiteral(c, scope, @as(*const clang.CharacterLiteral, @ptrCast(stmt)), result_used, .with_as), | |
| 1191 | .StmtExprClass => return transStmtExpr(c, scope, @as(*const clang.StmtExpr, @ptrCast(stmt)), result_used), | |
| 1192 | .MemberExprClass => return transMemberExpr(c, scope, @as(*const clang.MemberExpr, @ptrCast(stmt)), result_used), | |
| 1193 | .ArraySubscriptExprClass => return transArrayAccess(c, scope, @as(*const clang.ArraySubscriptExpr, @ptrCast(stmt)), result_used), | |
| 1194 | .CallExprClass => return transCallExpr(c, scope, @as(*const clang.CallExpr, @ptrCast(stmt)), result_used), | |
| 1195 | .UnaryExprOrTypeTraitExprClass => return transUnaryExprOrTypeTraitExpr(c, scope, @as(*const clang.UnaryExprOrTypeTraitExpr, @ptrCast(stmt)), result_used), | |
| 1196 | .UnaryOperatorClass => return transUnaryOperator(c, scope, @as(*const clang.UnaryOperator, @ptrCast(stmt)), result_used), | |
| 1197 | .CompoundAssignOperatorClass => return transCompoundAssignOperator(c, scope, @as(*const clang.CompoundAssignOperator, @ptrCast(stmt)), result_used), | |
| 1198 | .OpaqueValueExprClass => { | |
| 1199 | const source_expr = @as(*const clang.OpaqueValueExpr, @ptrCast(stmt)).getSourceExpr().?; | |
| 1200 | const expr = try transExpr(c, scope, source_expr, .used); | |
| 1201 | return maybeSuppressResult(c, result_used, expr); | |
| 1202 | }, | |
| 1203 | .OffsetOfExprClass => return transOffsetOfExpr(c, @as(*const clang.OffsetOfExpr, @ptrCast(stmt)), result_used), | |
| 1204 | .CompoundLiteralExprClass => { | |
| 1205 | const compound_literal = @as(*const clang.CompoundLiteralExpr, @ptrCast(stmt)); | |
| 1206 | return transExpr(c, scope, compound_literal.getInitializer(), result_used); | |
| 1207 | }, | |
| 1208 | .GenericSelectionExprClass => { | |
| 1209 | const gen_sel = @as(*const clang.GenericSelectionExpr, @ptrCast(stmt)); | |
| 1210 | return transExpr(c, scope, gen_sel.getResultExpr(), result_used); | |
| 1211 | }, | |
| 1212 | .ConvertVectorExprClass => { | |
| 1213 | const conv_vec = @as(*const clang.ConvertVectorExpr, @ptrCast(stmt)); | |
| 1214 | const conv_vec_node = try transConvertVectorExpr(c, scope, conv_vec); | |
| 1215 | return maybeSuppressResult(c, result_used, conv_vec_node); | |
| 1216 | }, | |
| 1217 | .ShuffleVectorExprClass => { | |
| 1218 | const shuffle_vec_expr = @as(*const clang.ShuffleVectorExpr, @ptrCast(stmt)); | |
| 1219 | const shuffle_vec_node = try transShuffleVectorExpr(c, scope, shuffle_vec_expr); | |
| 1220 | return maybeSuppressResult(c, result_used, shuffle_vec_node); | |
| 1221 | }, | |
| 1222 | .ChooseExprClass => { | |
| 1223 | const choose_expr = @as(*const clang.ChooseExpr, @ptrCast(stmt)); | |
| 1224 | return transExpr(c, scope, choose_expr.getChosenSubExpr(), result_used); | |
| 1225 | }, | |
| 1226 | // When adding new cases here, see comment for maybeBlockify() | |
| 1227 | .GCCAsmStmtClass, | |
| 1228 | .GotoStmtClass, | |
| 1229 | .IndirectGotoStmtClass, | |
| 1230 | .AttributedStmtClass, | |
| 1231 | .AddrLabelExprClass, | |
| 1232 | .AtomicExprClass, | |
| 1233 | .BlockExprClass, | |
| 1234 | .UserDefinedLiteralClass, | |
| 1235 | .BuiltinBitCastExprClass, | |
| 1236 | .DesignatedInitExprClass, | |
| 1237 | .LabelStmtClass, | |
| 1238 | => return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "TODO implement translation of stmt class {s}", .{@tagName(sc)}), | |
| 1239 | else => return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "unsupported stmt class {s}", .{@tagName(sc)}), | |
| 1240 | } | |
| 1241 | } | |
| 1242 | ||
| 1243 | /// See https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-convertvector | |
| 1244 | fn transConvertVectorExpr( | |
| 1245 | c: *Context, | |
| 1246 | scope: *Scope, | |
| 1247 | expr: *const clang.ConvertVectorExpr, | |
| 1248 | ) TransError!Node { | |
| 1249 | const base_stmt = @as(*const clang.Stmt, @ptrCast(expr)); | |
| 1250 | ||
| 1251 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 1252 | defer block_scope.deinit(); | |
| 1253 | ||
| 1254 | const src_expr = expr.getSrcExpr(); | |
| 1255 | const src_type = qualTypeCanon(src_expr.getType()); | |
| 1256 | const src_vector_ty = @as(*const clang.VectorType, @ptrCast(src_type)); | |
| 1257 | const src_element_qt = src_vector_ty.getElementType(); | |
| 1258 | ||
| 1259 | const src_expr_node = try transExpr(c, &block_scope.base, src_expr, .used); | |
| 1260 | ||
| 1261 | const dst_qt = expr.getTypeSourceInfo_getType(); | |
| 1262 | const dst_type_node = try transQualType(c, &block_scope.base, dst_qt, base_stmt.getBeginLoc()); | |
| 1263 | const dst_vector_ty = @as(*const clang.VectorType, @ptrCast(qualTypeCanon(dst_qt))); | |
| 1264 | const num_elements = dst_vector_ty.getNumElements(); | |
| 1265 | const dst_element_qt = dst_vector_ty.getElementType(); | |
| 1266 | ||
| 1267 | // workaround for https://github.com/ziglang/zig/issues/8322 | |
| 1268 | // we store the casted results into temp variables and use those | |
| 1269 | // to initialize the vector. Eventually we can just directly | |
| 1270 | // construct the init_list from casted source members | |
| 1271 | var i: usize = 0; | |
| 1272 | while (i < num_elements) : (i += 1) { | |
| 1273 | const mangled_name = try block_scope.makeMangledName(c, "tmp"); | |
| 1274 | const value = try Tag.array_access.create(c.arena, .{ | |
| 1275 | .lhs = src_expr_node, | |
| 1276 | .rhs = try transCreateNodeNumber(c, i, .int), | |
| 1277 | }); | |
| 1278 | const tmp_decl_node = try Tag.var_simple.create(c.arena, .{ | |
| 1279 | .name = mangled_name, | |
| 1280 | .init = try transCCast(c, &block_scope.base, base_stmt.getBeginLoc(), dst_element_qt, src_element_qt, value), | |
| 1281 | }); | |
| 1282 | try block_scope.statements.append(tmp_decl_node); | |
| 1283 | } | |
| 1284 | ||
| 1285 | const init_list = try c.arena.alloc(Node, num_elements); | |
| 1286 | for (init_list, 0..) |*init, init_index| { | |
| 1287 | const tmp_decl = block_scope.statements.items[init_index]; | |
| 1288 | const name = tmp_decl.castTag(.var_simple).?.data.name; | |
| 1289 | init.* = try Tag.identifier.create(c.arena, name); | |
| 1290 | } | |
| 1291 | ||
| 1292 | const vec_init = try Tag.array_init.create(c.arena, .{ | |
| 1293 | .cond = dst_type_node, | |
| 1294 | .cases = init_list, | |
| 1295 | }); | |
| 1296 | ||
| 1297 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 1298 | .label = block_scope.label, | |
| 1299 | .val = vec_init, | |
| 1300 | }); | |
| 1301 | try block_scope.statements.append(break_node); | |
| 1302 | return block_scope.complete(c); | |
| 1303 | } | |
| 1304 | ||
| 1305 | fn makeShuffleMask(c: *Context, scope: *Scope, expr: *const clang.ShuffleVectorExpr, vector_len: Node) TransError!Node { | |
| 1306 | const num_subexprs = expr.getNumSubExprs(); | |
| 1307 | assert(num_subexprs >= 3); // two source vectors + at least 1 index expression | |
| 1308 | const mask_len = num_subexprs - 2; | |
| 1309 | ||
| 1310 | const mask_type = try Tag.vector.create(c.arena, .{ | |
| 1311 | .lhs = try transCreateNodeNumber(c, mask_len, .int), | |
| 1312 | .rhs = try Tag.type.create(c.arena, "i32"), | |
| 1313 | }); | |
| 1314 | ||
| 1315 | const init_list = try c.arena.alloc(Node, mask_len); | |
| 1316 | ||
| 1317 | for (init_list, 0..) |*init, i| { | |
| 1318 | const index_expr = try transExprCoercing(c, scope, expr.getExpr(@as(c_uint, @intCast(i + 2))), .used); | |
| 1319 | const converted_index = try Tag.helpers_shuffle_vector_index.create(c.arena, .{ .lhs = index_expr, .rhs = vector_len }); | |
| 1320 | init.* = converted_index; | |
| 1321 | } | |
| 1322 | ||
| 1323 | return Tag.array_init.create(c.arena, .{ | |
| 1324 | .cond = mask_type, | |
| 1325 | .cases = init_list, | |
| 1326 | }); | |
| 1327 | } | |
| 1328 | ||
| 1329 | /// @typeInfo(@TypeOf(vec_node)).Vector.<field> | |
| 1330 | fn vectorTypeInfo(arena: mem.Allocator, vec_node: Node, field: []const u8) TransError!Node { | |
| 1331 | const typeof_call = try Tag.typeof.create(arena, vec_node); | |
| 1332 | const typeinfo_call = try Tag.typeinfo.create(arena, typeof_call); | |
| 1333 | const vector_type_info = try Tag.field_access.create(arena, .{ .lhs = typeinfo_call, .field_name = "vector" }); | |
| 1334 | return Tag.field_access.create(arena, .{ .lhs = vector_type_info, .field_name = field }); | |
| 1335 | } | |
| 1336 | ||
| 1337 | fn transShuffleVectorExpr( | |
| 1338 | c: *Context, | |
| 1339 | scope: *Scope, | |
| 1340 | expr: *const clang.ShuffleVectorExpr, | |
| 1341 | ) TransError!Node { | |
| 1342 | const base_expr = @as(*const clang.Expr, @ptrCast(expr)); | |
| 1343 | const num_subexprs = expr.getNumSubExprs(); | |
| 1344 | if (num_subexprs < 3) return fail(c, error.UnsupportedTranslation, base_expr.getBeginLoc(), "ShuffleVector needs at least 1 index", .{}); | |
| 1345 | ||
| 1346 | const a = try transExpr(c, scope, expr.getExpr(0), .used); | |
| 1347 | const b = try transExpr(c, scope, expr.getExpr(1), .used); | |
| 1348 | ||
| 1349 | // clang requires first two arguments to __builtin_shufflevector to be same type | |
| 1350 | const vector_child_type = try vectorTypeInfo(c.arena, a, "child"); | |
| 1351 | const vector_len = try vectorTypeInfo(c.arena, a, "len"); | |
| 1352 | const shuffle_mask = try makeShuffleMask(c, scope, expr, vector_len); | |
| 1353 | ||
| 1354 | return Tag.shuffle.create(c.arena, .{ | |
| 1355 | .element_type = vector_child_type, | |
| 1356 | .a = a, | |
| 1357 | .b = b, | |
| 1358 | .mask_vector = shuffle_mask, | |
| 1359 | }); | |
| 1360 | } | |
| 1361 | ||
| 1362 | /// Translate a "simple" offsetof expression containing exactly one component, | |
| 1363 | /// when that component is of kind .Field - e.g. offsetof(mytype, myfield) | |
| 1364 | fn transSimpleOffsetOfExpr(c: *Context, expr: *const clang.OffsetOfExpr) TransError!Node { | |
| 1365 | assert(expr.getNumComponents() == 1); | |
| 1366 | const component = expr.getComponent(0); | |
| 1367 | if (component.getKind() == .Field) { | |
| 1368 | const field_decl = component.getField(); | |
| 1369 | if (field_decl.getParent()) |record_decl| { | |
| 1370 | if (c.decl_table.get(@intFromPtr(record_decl.getCanonicalDecl()))) |type_name| { | |
| 1371 | const type_node = try Tag.type.create(c.arena, type_name); | |
| 1372 | ||
| 1373 | const raw_field_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); | |
| 1374 | const quoted_field_name = try std.fmt.allocPrint(c.arena, "\"{s}\"", .{raw_field_name}); | |
| 1375 | const field_name_node = try Tag.string_literal.create(c.arena, quoted_field_name); | |
| 1376 | ||
| 1377 | return Tag.offset_of.create(c.arena, .{ | |
| 1378 | .lhs = type_node, | |
| 1379 | .rhs = field_name_node, | |
| 1380 | }); | |
| 1381 | } | |
| 1382 | } | |
| 1383 | } | |
| 1384 | return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "failed to translate simple OffsetOfExpr", .{}); | |
| 1385 | } | |
| 1386 | ||
| 1387 | fn transOffsetOfExpr( | |
| 1388 | c: *Context, | |
| 1389 | expr: *const clang.OffsetOfExpr, | |
| 1390 | result_used: ResultUsed, | |
| 1391 | ) TransError!Node { | |
| 1392 | if (expr.getNumComponents() == 1) { | |
| 1393 | const offsetof_expr = try transSimpleOffsetOfExpr(c, expr); | |
| 1394 | return maybeSuppressResult(c, result_used, offsetof_expr); | |
| 1395 | } | |
| 1396 | ||
| 1397 | // TODO implement OffsetOfExpr with more than 1 component | |
| 1398 | // OffsetOfExpr API: | |
| 1399 | // call expr.getComponent(idx) while idx < expr.getNumComponents() | |
| 1400 | // component.getKind() will be either .Array or .Field (other kinds are C++-only) | |
| 1401 | // if .Field, use component.getField() to retrieve *clang.FieldDecl | |
| 1402 | // if .Array, use component.getArrayExprIndex() to get a c_uint which | |
| 1403 | // can be passed to expr.getIndexExpr(expr_index) to get the *clang.Expr for the array index | |
| 1404 | ||
| 1405 | return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO: implement complex OffsetOfExpr translation", .{}); | |
| 1406 | } | |
| 1407 | ||
| 1408 | /// Cast a signed integer node to a usize, for use in pointer arithmetic. Negative numbers | |
| 1409 | /// will become very large positive numbers but that is ok since we only use this in | |
| 1410 | /// pointer arithmetic expressions, where wraparound will ensure we get the correct value. | |
| 1411 | /// node -> @bitCast(usize, @intCast(isize, node)) | |
| 1412 | fn usizeCastForWrappingPtrArithmetic(gpa: mem.Allocator, node: Node) TransError!Node { | |
| 1413 | const intcast_node = try Tag.as.create(gpa, .{ | |
| 1414 | .lhs = try Tag.type.create(gpa, "isize"), | |
| 1415 | .rhs = try Tag.int_cast.create(gpa, node), | |
| 1416 | }); | |
| 1417 | ||
| 1418 | return Tag.as.create(gpa, .{ | |
| 1419 | .lhs = try Tag.type.create(gpa, "usize"), | |
| 1420 | .rhs = try Tag.bit_cast.create(gpa, intcast_node), | |
| 1421 | }); | |
| 1422 | } | |
| 1423 | ||
| 1424 | /// Translate an arithmetic expression with a pointer operand and a signed-integer operand. | |
| 1425 | /// Zig requires a usize argument for pointer arithmetic, so we intCast to isize and then | |
| 1426 | /// bitcast to usize; pointer wraparound make the math work. | |
| 1427 | /// Zig pointer addition is not commutative (unlike C); the pointer operand needs to be on the left. | |
| 1428 | /// The + operator in C is not a sequence point so it should be safe to switch the order if necessary. | |
| 1429 | fn transCreatePointerArithmeticSignedOp( | |
| 1430 | c: *Context, | |
| 1431 | scope: *Scope, | |
| 1432 | stmt: *const clang.BinaryOperator, | |
| 1433 | result_used: ResultUsed, | |
| 1434 | ) TransError!Node { | |
| 1435 | const is_add = stmt.getOpcode() == .Add; | |
| 1436 | const lhs = stmt.getLHS(); | |
| 1437 | const rhs = stmt.getRHS(); | |
| 1438 | const swap_operands = is_add and cIsSignedInteger(getExprQualType(c, lhs)); | |
| 1439 | ||
| 1440 | const swizzled_lhs = if (swap_operands) rhs else lhs; | |
| 1441 | const swizzled_rhs = if (swap_operands) lhs else rhs; | |
| 1442 | ||
| 1443 | const lhs_node = try transExpr(c, scope, swizzled_lhs, .used); | |
| 1444 | const rhs_node = try transExpr(c, scope, swizzled_rhs, .used); | |
| 1445 | ||
| 1446 | const bitcast_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node); | |
| 1447 | ||
| 1448 | return transCreateNodeInfixOp( | |
| 1449 | c, | |
| 1450 | if (is_add) .add else .sub, | |
| 1451 | lhs_node, | |
| 1452 | bitcast_node, | |
| 1453 | result_used, | |
| 1454 | ); | |
| 1455 | } | |
| 1456 | ||
| 1457 | fn transBinaryOperator( | |
| 1458 | c: *Context, | |
| 1459 | scope: *Scope, | |
| 1460 | stmt: *const clang.BinaryOperator, | |
| 1461 | result_used: ResultUsed, | |
| 1462 | ) TransError!Node { | |
| 1463 | const op = stmt.getOpcode(); | |
| 1464 | const qt = stmt.getType(); | |
| 1465 | const isPointerDiffExpr = cIsPointerDiffExpr(stmt); | |
| 1466 | switch (op) { | |
| 1467 | .Assign => return try transCreateNodeAssign(c, scope, result_used, stmt.getLHS(), stmt.getRHS()), | |
| 1468 | .Comma => { | |
| 1469 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 1470 | defer block_scope.deinit(); | |
| 1471 | ||
| 1472 | const lhs = try transExpr(c, &block_scope.base, stmt.getLHS(), .unused); | |
| 1473 | try block_scope.statements.append(lhs); | |
| 1474 | ||
| 1475 | const rhs = try transExpr(c, &block_scope.base, stmt.getRHS(), .used); | |
| 1476 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 1477 | .label = block_scope.label, | |
| 1478 | .val = rhs, | |
| 1479 | }); | |
| 1480 | try block_scope.statements.append(break_node); | |
| 1481 | const block_node = try block_scope.complete(c); | |
| 1482 | return maybeSuppressResult(c, result_used, block_node); | |
| 1483 | }, | |
| 1484 | .Div => { | |
| 1485 | if (cIsSignedInteger(qt)) { | |
| 1486 | // signed integer division uses @divTrunc | |
| 1487 | const lhs = try transExpr(c, scope, stmt.getLHS(), .used); | |
| 1488 | const rhs = try transExpr(c, scope, stmt.getRHS(), .used); | |
| 1489 | const div_trunc = try Tag.div_trunc.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 1490 | return maybeSuppressResult(c, result_used, div_trunc); | |
| 1491 | } | |
| 1492 | }, | |
| 1493 | .Rem => { | |
| 1494 | if (cIsSignedInteger(qt)) { | |
| 1495 | // signed integer remainder uses std.zig.c_translation.signedRemainder | |
| 1496 | const lhs = try transExpr(c, scope, stmt.getLHS(), .used); | |
| 1497 | const rhs = try transExpr(c, scope, stmt.getRHS(), .used); | |
| 1498 | const rem = try Tag.signed_remainder.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 1499 | return maybeSuppressResult(c, result_used, rem); | |
| 1500 | } | |
| 1501 | }, | |
| 1502 | .Shl => { | |
| 1503 | return transCreateNodeShiftOp(c, scope, stmt, .shl, result_used); | |
| 1504 | }, | |
| 1505 | .Shr => { | |
| 1506 | return transCreateNodeShiftOp(c, scope, stmt, .shr, result_used); | |
| 1507 | }, | |
| 1508 | .LAnd => { | |
| 1509 | return transCreateNodeBoolInfixOp(c, scope, stmt, .@"and", result_used); | |
| 1510 | }, | |
| 1511 | .LOr => { | |
| 1512 | return transCreateNodeBoolInfixOp(c, scope, stmt, .@"or", result_used); | |
| 1513 | }, | |
| 1514 | .Add, .Sub => { | |
| 1515 | // `ptr + idx` and `idx + ptr` -> ptr + @bitCast(usize, @intCast(isize, idx)) | |
| 1516 | // `ptr - idx` -> ptr - @bitCast(usize, @intCast(isize, idx)) | |
| 1517 | if (qualTypeIsPtr(qt) and (cIsSignedInteger(getExprQualType(c, stmt.getLHS())) or | |
| 1518 | cIsSignedInteger(getExprQualType(c, stmt.getRHS())))) return transCreatePointerArithmeticSignedOp(c, scope, stmt, result_used); | |
| 1519 | }, | |
| 1520 | else => {}, | |
| 1521 | } | |
| 1522 | var op_id: Tag = undefined; | |
| 1523 | switch (op) { | |
| 1524 | .Add => { | |
| 1525 | if (cIsUnsignedInteger(qt)) { | |
| 1526 | op_id = .add_wrap; | |
| 1527 | } else { | |
| 1528 | op_id = .add; | |
| 1529 | } | |
| 1530 | }, | |
| 1531 | .Sub => { | |
| 1532 | if (cIsUnsignedInteger(qt) or isPointerDiffExpr) { | |
| 1533 | op_id = .sub_wrap; | |
| 1534 | } else { | |
| 1535 | op_id = .sub; | |
| 1536 | } | |
| 1537 | }, | |
| 1538 | .Mul => { | |
| 1539 | if (cIsUnsignedInteger(qt)) { | |
| 1540 | op_id = .mul_wrap; | |
| 1541 | } else { | |
| 1542 | op_id = .mul; | |
| 1543 | } | |
| 1544 | }, | |
| 1545 | .Div => { | |
| 1546 | // unsigned/float division uses the operator | |
| 1547 | op_id = .div; | |
| 1548 | }, | |
| 1549 | .Rem => { | |
| 1550 | // unsigned/float division uses the operator | |
| 1551 | op_id = .mod; | |
| 1552 | }, | |
| 1553 | .LT => { | |
| 1554 | op_id = .less_than; | |
| 1555 | }, | |
| 1556 | .GT => { | |
| 1557 | op_id = .greater_than; | |
| 1558 | }, | |
| 1559 | .LE => { | |
| 1560 | op_id = .less_than_equal; | |
| 1561 | }, | |
| 1562 | .GE => { | |
| 1563 | op_id = .greater_than_equal; | |
| 1564 | }, | |
| 1565 | .EQ => { | |
| 1566 | op_id = .equal; | |
| 1567 | }, | |
| 1568 | .NE => { | |
| 1569 | op_id = .not_equal; | |
| 1570 | }, | |
| 1571 | .And => { | |
| 1572 | op_id = .bit_and; | |
| 1573 | }, | |
| 1574 | .Xor => { | |
| 1575 | op_id = .bit_xor; | |
| 1576 | }, | |
| 1577 | .Or => { | |
| 1578 | op_id = .bit_or; | |
| 1579 | }, | |
| 1580 | else => unreachable, | |
| 1581 | } | |
| 1582 | ||
| 1583 | const lhs_uncasted = try transExpr(c, scope, stmt.getLHS(), .used); | |
| 1584 | const rhs_uncasted = try transExpr(c, scope, stmt.getRHS(), .used); | |
| 1585 | ||
| 1586 | const lhs = if (isBoolRes(lhs_uncasted)) | |
| 1587 | try Tag.int_from_bool.create(c.arena, lhs_uncasted) | |
| 1588 | else if (isPointerDiffExpr) | |
| 1589 | try Tag.int_from_ptr.create(c.arena, lhs_uncasted) | |
| 1590 | else | |
| 1591 | lhs_uncasted; | |
| 1592 | ||
| 1593 | const rhs = if (isBoolRes(rhs_uncasted)) | |
| 1594 | try Tag.int_from_bool.create(c.arena, rhs_uncasted) | |
| 1595 | else if (isPointerDiffExpr) | |
| 1596 | try Tag.int_from_ptr.create(c.arena, rhs_uncasted) | |
| 1597 | else | |
| 1598 | rhs_uncasted; | |
| 1599 | ||
| 1600 | const infixOpNode = try transCreateNodeInfixOp(c, op_id, lhs, rhs, result_used); | |
| 1601 | if (isPointerDiffExpr) { | |
| 1602 | // @divExact(@bitCast(<platform-ptrdiff_t>, @intFromPtr(lhs) -% @intFromPtr(rhs)), @sizeOf(<lhs target type>)) | |
| 1603 | const ptrdiff_type = try transQualTypeIntWidthOf(c, qt, true); | |
| 1604 | ||
| 1605 | const bitcast = try Tag.as.create(c.arena, .{ | |
| 1606 | .lhs = ptrdiff_type, | |
| 1607 | .rhs = try Tag.bit_cast.create(c.arena, infixOpNode), | |
| 1608 | }); | |
| 1609 | ||
| 1610 | // C standard requires that pointer subtraction operands are of the same type, | |
| 1611 | // otherwise it is undefined behavior. So we can assume the left and right | |
| 1612 | // sides are the same QualType and arbitrarily choose left. | |
| 1613 | const lhs_expr = stmt.getLHS(); | |
| 1614 | const lhs_qt = getExprQualType(c, lhs_expr); | |
| 1615 | const lhs_qt_translated = try transQualType(c, scope, lhs_qt, lhs_expr.getBeginLoc()); | |
| 1616 | const c_pointer = getContainer(c, lhs_qt_translated).?; | |
| 1617 | ||
| 1618 | if (c_pointer.castTag(.c_pointer)) |c_pointer_payload| { | |
| 1619 | const sizeof = try Tag.sizeof.create(c.arena, c_pointer_payload.data.elem_type); | |
| 1620 | return Tag.div_exact.create(c.arena, .{ | |
| 1621 | .lhs = bitcast, | |
| 1622 | .rhs = sizeof, | |
| 1623 | }); | |
| 1624 | } else { | |
| 1625 | // This is an opaque/incomplete type. This subtraction exhibits Undefined Behavior by the C99 spec. | |
| 1626 | // However, allowing subtraction on `void *` and function pointers is a commonly used extension. | |
| 1627 | // So, just return the value in byte units, mirroring the behavior of this language extension as implemented by GCC and Clang. | |
| 1628 | return bitcast; | |
| 1629 | } | |
| 1630 | } | |
| 1631 | return infixOpNode; | |
| 1632 | } | |
| 1633 | ||
| 1634 | fn transCompoundStmtInline( | |
| 1635 | c: *Context, | |
| 1636 | stmt: *const clang.CompoundStmt, | |
| 1637 | block: *Scope.Block, | |
| 1638 | ) TransError!void { | |
| 1639 | var it = stmt.body_begin(); | |
| 1640 | const end_it = stmt.body_end(); | |
| 1641 | while (it != end_it) : (it += 1) { | |
| 1642 | const result = try transStmt(c, &block.base, it[0], .unused); | |
| 1643 | switch (result.tag()) { | |
| 1644 | .declaration, .empty_block => {}, | |
| 1645 | else => try block.statements.append(result), | |
| 1646 | } | |
| 1647 | } | |
| 1648 | } | |
| 1649 | ||
| 1650 | fn transCompoundStmt(c: *Context, scope: *Scope, stmt: *const clang.CompoundStmt) TransError!Node { | |
| 1651 | var block_scope = try Scope.Block.init(c, scope, false); | |
| 1652 | defer block_scope.deinit(); | |
| 1653 | try transCompoundStmtInline(c, stmt, &block_scope); | |
| 1654 | return try block_scope.complete(c); | |
| 1655 | } | |
| 1656 | ||
| 1657 | fn transCStyleCastExprClass( | |
| 1658 | c: *Context, | |
| 1659 | scope: *Scope, | |
| 1660 | stmt: *const clang.CStyleCastExpr, | |
| 1661 | result_used: ResultUsed, | |
| 1662 | ) TransError!Node { | |
| 1663 | const cast_expr = @as(*const clang.CastExpr, @ptrCast(stmt)); | |
| 1664 | const sub_expr = stmt.getSubExpr(); | |
| 1665 | const dst_type = stmt.getType(); | |
| 1666 | const src_type = sub_expr.getType(); | |
| 1667 | const sub_expr_node = try transExpr(c, scope, sub_expr, .used); | |
| 1668 | const loc = stmt.getBeginLoc(); | |
| 1669 | ||
| 1670 | const cast_node = if (cast_expr.getCastKind() == .ToUnion) blk: { | |
| 1671 | const field_decl = cast_expr.getTargetFieldForToUnionCast(dst_type, src_type).?; // C syntax error if target field is null | |
| 1672 | const field_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); | |
| 1673 | ||
| 1674 | const union_ty = try transQualType(c, scope, dst_type, loc); | |
| 1675 | ||
| 1676 | const inits = [1]ast.Payload.ContainerInit.Initializer{.{ .name = field_name, .value = sub_expr_node }}; | |
| 1677 | break :blk try Tag.container_init.create(c.arena, .{ | |
| 1678 | .lhs = union_ty, | |
| 1679 | .inits = try c.arena.dupe(ast.Payload.ContainerInit.Initializer, &inits), | |
| 1680 | }); | |
| 1681 | } else (try transCCast( | |
| 1682 | c, | |
| 1683 | scope, | |
| 1684 | loc, | |
| 1685 | dst_type, | |
| 1686 | src_type, | |
| 1687 | sub_expr_node, | |
| 1688 | )); | |
| 1689 | return maybeSuppressResult(c, result_used, cast_node); | |
| 1690 | } | |
| 1691 | ||
| 1692 | /// The alignment of a variable or field | |
| 1693 | const ClangAlignment = struct { | |
| 1694 | /// Clang reports the alignment in bits, we use bytes | |
| 1695 | /// Clang uses 0 for "no alignment specified", we use null | |
| 1696 | bit_alignment: c_uint, | |
| 1697 | /// If the field or variable is marked as 'packed' | |
| 1698 | /// | |
| 1699 | /// According to the GCC variable attribute docs, this impacts alignment | |
| 1700 | /// https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html | |
| 1701 | /// | |
| 1702 | /// > The packed attribute specifies that a structure member | |
| 1703 | /// > should have the smallest possible alignment | |
| 1704 | /// | |
| 1705 | /// Note also that specifying the 'packed' attribute on a structure | |
| 1706 | /// implicitly packs all its fields (making their alignment 1). | |
| 1707 | /// | |
| 1708 | /// This will be null if the AST node doesn't support packing (functions) | |
| 1709 | is_packed: ?bool, | |
| 1710 | ||
| 1711 | /// Get the alignment for a field, optionally taking into account the parent record | |
| 1712 | pub fn forField(c: *const Context, field: *const clang.FieldDecl, parent: ?*const clang.RecordDecl) ClangAlignment { | |
| 1713 | const parent_packed = if (parent) |record| record.getPackedAttribute() else false; | |
| 1714 | // NOTE: According to GCC docs, parent attribute packed implies child attribute packed | |
| 1715 | return ClangAlignment{ | |
| 1716 | .bit_alignment = field.getAlignedAttribute(c.clang_context), | |
| 1717 | .is_packed = field.getPackedAttribute() or parent_packed, | |
| 1718 | }; | |
| 1719 | } | |
| 1720 | ||
| 1721 | pub fn forVar(c: *const Context, var_decl: *const clang.VarDecl) ClangAlignment { | |
| 1722 | return ClangAlignment{ | |
| 1723 | .bit_alignment = var_decl.getAlignedAttribute(c.clang_context), | |
| 1724 | .is_packed = var_decl.getPackedAttribute(), | |
| 1725 | }; | |
| 1726 | } | |
| 1727 | ||
| 1728 | pub fn forFunc(c: *const Context, fun: *const clang.FunctionDecl) ClangAlignment { | |
| 1729 | return ClangAlignment{ | |
| 1730 | .bit_alignment = fun.getAlignedAttribute(c.clang_context), | |
| 1731 | .is_packed = null, // not supported by GCC/clang (or meaningful), | |
| 1732 | }; | |
| 1733 | } | |
| 1734 | ||
| 1735 | /// Translate the clang alignment info into a zig alignment | |
| 1736 | /// | |
| 1737 | /// Returns null if there is no special alignment info | |
| 1738 | pub fn zigAlignment(self: ClangAlignment) ?c_uint { | |
| 1739 | if (self.bit_alignment != 0) { | |
| 1740 | return self.bit_alignment / 8; | |
| 1741 | } else if (self.is_packed orelse false) { | |
| 1742 | return 1; | |
| 1743 | } else { | |
| 1744 | return null; | |
| 1745 | } | |
| 1746 | } | |
| 1747 | }; | |
| 1748 | ||
| 1749 | /// Translate an "extern" variable that's been declared within a scoped block. | |
| 1750 | /// Similar to static local variables, this will be wrapped in a struct to work with Zig's syntax requirements. | |
| 1751 | /// | |
| 1752 | /// Assumptions made: | |
| 1753 | /// - No need to mangle the actual NamedDecl, as by definition this MUST be the same name as the external symbol it's referencing | |
| 1754 | /// - It's not valid C to have an initializer with this type of declaration, so we can safely operate assuming no initializer | |
| 1755 | /// - No need to look for any cleanup attributes with getCleanupAttribute(), not relevant for this type of decl | |
| 1756 | fn transLocalExternStmt(c: *Context, scope: *Scope, var_decl: *const clang.VarDecl, block_scope: *Scope.Block) TransError!void { | |
| 1757 | const extern_var_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(var_decl)).getName_bytes_begin()); | |
| 1758 | ||
| 1759 | // Special naming convention for local extern variable wrapper struct | |
| 1760 | const name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ Scope.Block.extern_inner_prepend, extern_var_name }); | |
| 1761 | ||
| 1762 | // On the off chance there's already a variable in scope named "ExternLocal_[extern_var_name]" | |
| 1763 | const mangled_name = try block_scope.makeMangledName(c, name); | |
| 1764 | ||
| 1765 | const qual_type = var_decl.getTypeSourceInfo_getType(); | |
| 1766 | const is_const = qual_type.isConstQualified(); | |
| 1767 | const loc = var_decl.getLocation(); | |
| 1768 | const type_node = try transQualType(c, scope, qual_type, loc); | |
| 1769 | ||
| 1770 | // Inner Node for the extern variable declaration | |
| 1771 | var node = try Tag.var_decl.create(c.arena, .{ | |
| 1772 | .is_pub = false, | |
| 1773 | .is_const = is_const, | |
| 1774 | .is_extern = true, | |
| 1775 | .is_export = false, | |
| 1776 | .is_threadlocal = var_decl.getTLSKind() != .None, // TODO: Neccessary? | |
| 1777 | .linksection_string = null, // TODO: Neccessary? | |
| 1778 | .alignment = ClangAlignment.forVar(c, var_decl).zigAlignment(), | |
| 1779 | .name = extern_var_name, | |
| 1780 | .type = type_node, | |
| 1781 | .init = null, | |
| 1782 | }); | |
| 1783 | ||
| 1784 | // Outer Node for the wrapper struct | |
| 1785 | node = try Tag.extern_local_var.create(c.arena, .{ .name = mangled_name, .init = node }); | |
| 1786 | ||
| 1787 | try block_scope.statements.append(node); | |
| 1788 | try block_scope.discardVariable(c, mangled_name); | |
| 1789 | } | |
| 1790 | ||
| 1791 | fn transDeclStmtOne( | |
| 1792 | c: *Context, | |
| 1793 | scope: *Scope, | |
| 1794 | decl: *const clang.Decl, | |
| 1795 | block_scope: *Scope.Block, | |
| 1796 | ) TransError!void { | |
| 1797 | switch (decl.getKind()) { | |
| 1798 | .Var => { | |
| 1799 | const var_decl = @as(*const clang.VarDecl, @ptrCast(decl)); | |
| 1800 | ||
| 1801 | // Translation behavior for a block scope declared "extern" variable | |
| 1802 | // is enough of an outlier that it needs it's own function | |
| 1803 | if (var_decl.getStorageClass() == .Extern) { | |
| 1804 | return transLocalExternStmt(c, scope, var_decl, block_scope); | |
| 1805 | } | |
| 1806 | ||
| 1807 | const decl_init = var_decl.getInit(); | |
| 1808 | const loc = decl.getLocation(); | |
| 1809 | ||
| 1810 | const qual_type = var_decl.getTypeSourceInfo_getType(); | |
| 1811 | const name = try c.str(@as(*const clang.NamedDecl, @ptrCast(var_decl)).getName_bytes_begin()); | |
| 1812 | const mangled_name = try block_scope.makeMangledName(c, name); | |
| 1813 | ||
| 1814 | if (qualTypeWasDemotedToOpaque(c, qual_type)) { | |
| 1815 | return fail(c, error.UnsupportedTranslation, loc, "local variable has opaque type", .{}); | |
| 1816 | } | |
| 1817 | ||
| 1818 | const is_static_local = var_decl.isStaticLocal(); | |
| 1819 | const is_const = qual_type.isConstQualified(); | |
| 1820 | const type_node = try transQualTypeMaybeInitialized(c, scope, qual_type, decl_init, loc); | |
| 1821 | ||
| 1822 | var init_node = if (decl_init) |expr| | |
| 1823 | if (expr.getStmtClass() == .StringLiteralClass) | |
| 1824 | try transStringLiteralInitializer(c, @as(*const clang.StringLiteral, @ptrCast(expr)), type_node) | |
| 1825 | else | |
| 1826 | try transExprCoercing(c, scope, expr, .used) | |
| 1827 | else if (is_static_local) | |
| 1828 | try Tag.std_mem_zeroes.create(c.arena, type_node) | |
| 1829 | else | |
| 1830 | Tag.undefined_literal.init(); | |
| 1831 | if (!qualTypeIsBoolean(qual_type) and isBoolRes(init_node)) { | |
| 1832 | init_node = try Tag.int_from_bool.create(c.arena, init_node); | |
| 1833 | } else if (init_node.tag() == .string_literal and qualTypeIsCharStar(qual_type)) { | |
| 1834 | const dst_type_node = try transQualType(c, scope, qual_type, loc); | |
| 1835 | init_node = try removeCVQualifiers(c, dst_type_node, init_node); | |
| 1836 | } | |
| 1837 | ||
| 1838 | const var_name: []const u8 = if (is_static_local) Scope.Block.static_inner_name else mangled_name; | |
| 1839 | var node = try Tag.var_decl.create(c.arena, .{ | |
| 1840 | .is_pub = false, | |
| 1841 | .is_const = is_const, | |
| 1842 | .is_extern = false, | |
| 1843 | .is_export = false, | |
| 1844 | .is_threadlocal = var_decl.getTLSKind() != .None, | |
| 1845 | .linksection_string = null, | |
| 1846 | .alignment = ClangAlignment.forVar(c, var_decl).zigAlignment(), | |
| 1847 | .name = var_name, | |
| 1848 | .type = type_node, | |
| 1849 | .init = init_node, | |
| 1850 | }); | |
| 1851 | if (is_static_local) { | |
| 1852 | node = try Tag.static_local_var.create(c.arena, .{ .name = mangled_name, .init = node }); | |
| 1853 | } | |
| 1854 | try block_scope.statements.append(node); | |
| 1855 | try block_scope.discardVariable(c, mangled_name); | |
| 1856 | ||
| 1857 | const cleanup_attr = var_decl.getCleanupAttribute(); | |
| 1858 | if (cleanup_attr) |fn_decl| { | |
| 1859 | const cleanup_fn_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(fn_decl)).getName_bytes_begin()); | |
| 1860 | const fn_id = try Tag.identifier.create(c.arena, cleanup_fn_name); | |
| 1861 | ||
| 1862 | const varname = try Tag.identifier.create(c.arena, mangled_name); | |
| 1863 | const args = try c.arena.alloc(Node, 1); | |
| 1864 | args[0] = try Tag.address_of.create(c.arena, varname); | |
| 1865 | ||
| 1866 | const cleanup_call = try Tag.call.create(c.arena, .{ .lhs = fn_id, .args = args }); | |
| 1867 | const discard = try Tag.discard.create(c.arena, .{ .should_skip = false, .value = cleanup_call }); | |
| 1868 | const deferred_cleanup = try Tag.@"defer".create(c.arena, discard); | |
| 1869 | ||
| 1870 | try block_scope.statements.append(deferred_cleanup); | |
| 1871 | } | |
| 1872 | }, | |
| 1873 | .Typedef => { | |
| 1874 | try transTypeDef(c, scope, @as(*const clang.TypedefNameDecl, @ptrCast(decl))); | |
| 1875 | }, | |
| 1876 | .Record => { | |
| 1877 | try transRecordDecl(c, scope, @as(*const clang.RecordDecl, @ptrCast(decl))); | |
| 1878 | }, | |
| 1879 | .Enum => { | |
| 1880 | try transEnumDecl(c, scope, @as(*const clang.EnumDecl, @ptrCast(decl))); | |
| 1881 | }, | |
| 1882 | .Function => { | |
| 1883 | try transFnDecl(c, scope, @as(*const clang.FunctionDecl, @ptrCast(decl))); | |
| 1884 | }, | |
| 1885 | else => { | |
| 1886 | const decl_name = try c.str(decl.getDeclKindName()); | |
| 1887 | try warn(c, &c.global_scope.base, decl.getLocation(), "ignoring {s} declaration", .{decl_name}); | |
| 1888 | }, | |
| 1889 | } | |
| 1890 | } | |
| 1891 | ||
| 1892 | fn transDeclStmt(c: *Context, scope: *Scope, stmt: *const clang.DeclStmt) TransError!Node { | |
| 1893 | const block_scope = try scope.findBlockScope(c); | |
| 1894 | ||
| 1895 | var it = stmt.decl_begin(); | |
| 1896 | const end_it = stmt.decl_end(); | |
| 1897 | while (it != end_it) : (it += 1) { | |
| 1898 | try transDeclStmtOne(c, scope, it[0], block_scope); | |
| 1899 | } | |
| 1900 | return Tag.declaration.init(); | |
| 1901 | } | |
| 1902 | ||
| 1903 | fn transDeclRefExpr( | |
| 1904 | c: *Context, | |
| 1905 | scope: *Scope, | |
| 1906 | expr: *const clang.DeclRefExpr, | |
| 1907 | ) TransError!Node { | |
| 1908 | const value_decl = expr.getDecl(); | |
| 1909 | const name = try c.str(@as(*const clang.NamedDecl, @ptrCast(value_decl)).getName_bytes_begin()); | |
| 1910 | const mangled_name = scope.getAlias(name); | |
| 1911 | const decl_is_var = @as(*const clang.Decl, @ptrCast(value_decl)).getKind() == .Var; | |
| 1912 | const storage_class = @as(*const clang.VarDecl, @ptrCast(value_decl)).getStorageClass(); | |
| 1913 | const potential_local_extern = if (decl_is_var) ((storage_class == .Extern) and (scope.id != .root)) else false; | |
| 1914 | ||
| 1915 | var confirmed_local_extern = false; | |
| 1916 | var confirmed_local_extern_fn = false; | |
| 1917 | var ref_expr = val: { | |
| 1918 | if (cIsFunctionDeclRef(@as(*const clang.Expr, @ptrCast(expr)))) { | |
| 1919 | if (scope.id != .root) { | |
| 1920 | if (scope.getLocalExternAlias(name)) |v| { | |
| 1921 | confirmed_local_extern_fn = true; | |
| 1922 | break :val try Tag.identifier.create(c.arena, v); | |
| 1923 | } | |
| 1924 | } | |
| 1925 | break :val try Tag.fn_identifier.create(c.arena, mangled_name); | |
| 1926 | } else if (potential_local_extern) { | |
| 1927 | if (scope.getLocalExternAlias(name)) |v| { | |
| 1928 | confirmed_local_extern = true; | |
| 1929 | break :val try Tag.identifier.create(c.arena, v); | |
| 1930 | } else { | |
| 1931 | break :val try Tag.identifier.create(c.arena, mangled_name); | |
| 1932 | } | |
| 1933 | } else { | |
| 1934 | break :val try Tag.identifier.create(c.arena, mangled_name); | |
| 1935 | } | |
| 1936 | }; | |
| 1937 | ||
| 1938 | if (decl_is_var) { | |
| 1939 | const var_decl = @as(*const clang.VarDecl, @ptrCast(value_decl)); | |
| 1940 | if (var_decl.isStaticLocal()) { | |
| 1941 | ref_expr = try Tag.field_access.create(c.arena, .{ | |
| 1942 | .lhs = ref_expr, | |
| 1943 | .field_name = Scope.Block.static_inner_name, | |
| 1944 | }); | |
| 1945 | } else if (confirmed_local_extern) { | |
| 1946 | ref_expr = try Tag.field_access.create(c.arena, .{ | |
| 1947 | .lhs = ref_expr, | |
| 1948 | .field_name = name, // by necessity, name will always == mangled_name | |
| 1949 | }); | |
| 1950 | } | |
| 1951 | } else if (confirmed_local_extern_fn) { | |
| 1952 | ref_expr = try Tag.field_access.create(c.arena, .{ | |
| 1953 | .lhs = ref_expr, | |
| 1954 | .field_name = name, // by necessity, name will always == mangled_name | |
| 1955 | }); | |
| 1956 | } | |
| 1957 | scope.skipVariableDiscard(mangled_name); | |
| 1958 | return ref_expr; | |
| 1959 | } | |
| 1960 | ||
| 1961 | fn transImplicitCastExpr( | |
| 1962 | c: *Context, | |
| 1963 | scope: *Scope, | |
| 1964 | expr: *const clang.ImplicitCastExpr, | |
| 1965 | result_used: ResultUsed, | |
| 1966 | ) TransError!Node { | |
| 1967 | const sub_expr = expr.getSubExpr(); | |
| 1968 | const dest_type = getExprQualType(c, @as(*const clang.Expr, @ptrCast(expr))); | |
| 1969 | const src_type = getExprQualType(c, sub_expr); | |
| 1970 | switch (expr.getCastKind()) { | |
| 1971 | .BitCast, .FloatingCast, .FloatingToIntegral, .IntegralToFloating, .IntegralCast, .PointerToIntegral, .IntegralToPointer => { | |
| 1972 | const sub_expr_node = try transExpr(c, scope, sub_expr, .used); | |
| 1973 | const casted = try transCCast(c, scope, expr.getBeginLoc(), dest_type, src_type, sub_expr_node); | |
| 1974 | return maybeSuppressResult(c, result_used, casted); | |
| 1975 | }, | |
| 1976 | .LValueToRValue, .NoOp, .FunctionToPointerDecay => { | |
| 1977 | const sub_expr_node = try transExpr(c, scope, sub_expr, .used); | |
| 1978 | return maybeSuppressResult(c, result_used, sub_expr_node); | |
| 1979 | }, | |
| 1980 | .ArrayToPointerDecay => { | |
| 1981 | const sub_expr_node = try transExpr(c, scope, sub_expr, .used); | |
| 1982 | if (exprIsNarrowStringLiteral(sub_expr) or exprIsFlexibleArrayRef(c, sub_expr)) { | |
| 1983 | return maybeSuppressResult(c, result_used, sub_expr_node); | |
| 1984 | } | |
| 1985 | ||
| 1986 | const index_val = try Tag.integer_literal.create(c.arena, "0"); | |
| 1987 | const index = try Tag.as.create(c.arena, .{ | |
| 1988 | .lhs = try Tag.type.create(c.arena, "usize"), | |
| 1989 | .rhs = try Tag.int_cast.create(c.arena, index_val), | |
| 1990 | }); | |
| 1991 | const array0_node = try Tag.array_access.create(c.arena, .{ .lhs = sub_expr_node, .rhs = index }); | |
| 1992 | // Convert array to pointer by expression: addr = &sub_expr[0] | |
| 1993 | const addr = try Tag.address_of.create(c.arena, array0_node); | |
| 1994 | const casted = try transCPtrCast(c, scope, expr.getBeginLoc(), dest_type, src_type, addr); | |
| 1995 | return maybeSuppressResult(c, result_used, casted); | |
| 1996 | }, | |
| 1997 | .NullToPointer => { | |
| 1998 | return Tag.null_literal.init(); | |
| 1999 | }, | |
| 2000 | .PointerToBoolean => { | |
| 2001 | // @intFromPtr(val) != 0 | |
| 2002 | const ptr_node = try transExpr(c, scope, sub_expr, .used); | |
| 2003 | const int_from_ptr = try Tag.int_from_ptr.create(c.arena, ptr_node); | |
| 2004 | ||
| 2005 | const ne = try Tag.not_equal.create(c.arena, .{ .lhs = int_from_ptr, .rhs = Tag.zero_literal.init() }); | |
| 2006 | return maybeSuppressResult(c, result_used, ne); | |
| 2007 | }, | |
| 2008 | .IntegralToBoolean, .FloatingToBoolean => { | |
| 2009 | const sub_expr_node = try transExpr(c, scope, sub_expr, .used); | |
| 2010 | ||
| 2011 | // The expression is already a boolean one, return it as-is | |
| 2012 | if (isBoolRes(sub_expr_node)) | |
| 2013 | return maybeSuppressResult(c, result_used, sub_expr_node); | |
| 2014 | ||
| 2015 | // val != 0 | |
| 2016 | const ne = try Tag.not_equal.create(c.arena, .{ .lhs = sub_expr_node, .rhs = Tag.zero_literal.init() }); | |
| 2017 | return maybeSuppressResult(c, result_used, ne); | |
| 2018 | }, | |
| 2019 | .BuiltinFnToFnPtr => { | |
| 2020 | return transBuiltinFnExpr(c, scope, sub_expr, result_used); | |
| 2021 | }, | |
| 2022 | .ToVoid => { | |
| 2023 | // Should only appear in the rhs and lhs of a ConditionalOperator | |
| 2024 | return transExpr(c, scope, sub_expr, .unused); | |
| 2025 | }, | |
| 2026 | else => |kind| return fail( | |
| 2027 | c, | |
| 2028 | error.UnsupportedTranslation, | |
| 2029 | @as(*const clang.Stmt, @ptrCast(expr)).getBeginLoc(), | |
| 2030 | "unsupported CastKind {s}", | |
| 2031 | .{@tagName(kind)}, | |
| 2032 | ), | |
| 2033 | } | |
| 2034 | } | |
| 2035 | ||
| 2036 | fn isBuiltinDefined(name: []const u8) bool { | |
| 2037 | inline for (@typeInfo(std.zig.c_builtins).@"struct".decls) |decl| { | |
| 2038 | if (std.mem.eql(u8, name, decl.name)) return true; | |
| 2039 | } | |
| 2040 | return false; | |
| 2041 | } | |
| 2042 | ||
| 2043 | fn transBuiltinFnExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { | |
| 2044 | const node = try transExpr(c, scope, expr, used); | |
| 2045 | if (node.castTag(.fn_identifier)) |ident| { | |
| 2046 | const name = ident.data; | |
| 2047 | if (!isBuiltinDefined(name)) return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO implement function '{s}' in std.zig.c_builtins", .{name}); | |
| 2048 | } | |
| 2049 | return node; | |
| 2050 | } | |
| 2051 | ||
| 2052 | fn transBoolExpr( | |
| 2053 | c: *Context, | |
| 2054 | scope: *Scope, | |
| 2055 | expr: *const clang.Expr, | |
| 2056 | used: ResultUsed, | |
| 2057 | ) TransError!Node { | |
| 2058 | if (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass() == .IntegerLiteralClass) { | |
| 2059 | var signum: c_int = undefined; | |
| 2060 | if (!(@as(*const clang.IntegerLiteral, @ptrCast(expr)).getSignum(&signum, c.clang_context))) { | |
| 2061 | return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid integer literal", .{}); | |
| 2062 | } | |
| 2063 | const is_zero = signum == 0; | |
| 2064 | return Node{ .tag_if_small_enough = @intFromEnum(([2]Tag{ .true_literal, .false_literal })[@intFromBool(is_zero)]) }; | |
| 2065 | } | |
| 2066 | ||
| 2067 | const res = try transExpr(c, scope, expr, used); | |
| 2068 | if (isBoolRes(res)) { | |
| 2069 | return maybeSuppressResult(c, used, res); | |
| 2070 | } | |
| 2071 | ||
| 2072 | const ty = getExprQualType(c, expr).getTypePtr(); | |
| 2073 | const node = try finishBoolExpr(c, scope, expr.getBeginLoc(), ty, res, used); | |
| 2074 | ||
| 2075 | return maybeSuppressResult(c, used, node); | |
| 2076 | } | |
| 2077 | ||
| 2078 | fn exprIsBooleanType(expr: *const clang.Expr) bool { | |
| 2079 | return qualTypeIsBoolean(expr.getType()); | |
| 2080 | } | |
| 2081 | ||
| 2082 | fn exprIsNarrowStringLiteral(expr: *const clang.Expr) bool { | |
| 2083 | switch (expr.getStmtClass()) { | |
| 2084 | .StringLiteralClass => { | |
| 2085 | const string_lit = @as(*const clang.StringLiteral, @ptrCast(expr)); | |
| 2086 | return string_lit.getCharByteWidth() == 1; | |
| 2087 | }, | |
| 2088 | .PredefinedExprClass => return true, | |
| 2089 | .UnaryOperatorClass => { | |
| 2090 | const op_expr = @as(*const clang.UnaryOperator, @ptrCast(expr)).getSubExpr(); | |
| 2091 | return exprIsNarrowStringLiteral(op_expr); | |
| 2092 | }, | |
| 2093 | .ParenExprClass => { | |
| 2094 | const op_expr = @as(*const clang.ParenExpr, @ptrCast(expr)).getSubExpr(); | |
| 2095 | return exprIsNarrowStringLiteral(op_expr); | |
| 2096 | }, | |
| 2097 | .GenericSelectionExprClass => { | |
| 2098 | const gen_sel = @as(*const clang.GenericSelectionExpr, @ptrCast(expr)); | |
| 2099 | return exprIsNarrowStringLiteral(gen_sel.getResultExpr()); | |
| 2100 | }, | |
| 2101 | else => return false, | |
| 2102 | } | |
| 2103 | } | |
| 2104 | ||
| 2105 | fn exprIsFlexibleArrayRef(c: *Context, expr: *const clang.Expr) bool { | |
| 2106 | if (expr.getStmtClass() == .MemberExprClass) { | |
| 2107 | const member_expr = @as(*const clang.MemberExpr, @ptrCast(expr)); | |
| 2108 | const member_decl = member_expr.getMemberDecl(); | |
| 2109 | const decl_kind = @as(*const clang.Decl, @ptrCast(member_decl)).getKind(); | |
| 2110 | if (decl_kind == .Field) { | |
| 2111 | const field_decl = @as(*const clang.FieldDecl, @ptrCast(member_decl)); | |
| 2112 | return isFlexibleArrayFieldDecl(c, field_decl); | |
| 2113 | } | |
| 2114 | } | |
| 2115 | return false; | |
| 2116 | } | |
| 2117 | ||
| 2118 | fn isBoolRes(res: Node) bool { | |
| 2119 | switch (res.tag()) { | |
| 2120 | .@"or", | |
| 2121 | .@"and", | |
| 2122 | .equal, | |
| 2123 | .not_equal, | |
| 2124 | .less_than, | |
| 2125 | .less_than_equal, | |
| 2126 | .greater_than, | |
| 2127 | .greater_than_equal, | |
| 2128 | .not, | |
| 2129 | .false_literal, | |
| 2130 | .true_literal, | |
| 2131 | => return true, | |
| 2132 | else => return false, | |
| 2133 | } | |
| 2134 | } | |
| 2135 | ||
| 2136 | fn finishBoolExpr( | |
| 2137 | c: *Context, | |
| 2138 | scope: *Scope, | |
| 2139 | loc: clang.SourceLocation, | |
| 2140 | ty: *const clang.Type, | |
| 2141 | node: Node, | |
| 2142 | used: ResultUsed, | |
| 2143 | ) TransError!Node { | |
| 2144 | switch (ty.getTypeClass()) { | |
| 2145 | .Builtin => { | |
| 2146 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 2147 | ||
| 2148 | switch (builtin_ty.getKind()) { | |
| 2149 | .Bool => return node, | |
| 2150 | .Char_U, | |
| 2151 | .UChar, | |
| 2152 | .Char_S, | |
| 2153 | .SChar, | |
| 2154 | .UShort, | |
| 2155 | .UInt, | |
| 2156 | .ULong, | |
| 2157 | .ULongLong, | |
| 2158 | .Short, | |
| 2159 | .Int, | |
| 2160 | .Long, | |
| 2161 | .LongLong, | |
| 2162 | .UInt128, | |
| 2163 | .Int128, | |
| 2164 | .Float, | |
| 2165 | .Double, | |
| 2166 | .Float128, | |
| 2167 | .LongDouble, | |
| 2168 | .WChar_U, | |
| 2169 | .Char8, | |
| 2170 | .Char16, | |
| 2171 | .Char32, | |
| 2172 | .WChar_S, | |
| 2173 | .Float16, | |
| 2174 | => { | |
| 2175 | // node != 0 | |
| 2176 | return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.zero_literal.init() }); | |
| 2177 | }, | |
| 2178 | .NullPtr => { | |
| 2179 | // node == null | |
| 2180 | return Tag.equal.create(c.arena, .{ .lhs = node, .rhs = Tag.null_literal.init() }); | |
| 2181 | }, | |
| 2182 | else => {}, | |
| 2183 | } | |
| 2184 | }, | |
| 2185 | .Pointer => { | |
| 2186 | if (node.tag() == .string_literal) { | |
| 2187 | // @intFromPtr(node) != 0 | |
| 2188 | const int_from_ptr = try Tag.int_from_ptr.create(c.arena, node); | |
| 2189 | return Tag.not_equal.create(c.arena, .{ .lhs = int_from_ptr, .rhs = Tag.zero_literal.init() }); | |
| 2190 | } | |
| 2191 | // node != null | |
| 2192 | return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.null_literal.init() }); | |
| 2193 | }, | |
| 2194 | .Typedef => { | |
| 2195 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 2196 | const typedef_decl = typedef_ty.getDecl(); | |
| 2197 | const underlying_type = typedef_decl.getUnderlyingType(); | |
| 2198 | return finishBoolExpr(c, scope, loc, underlying_type.getTypePtr(), node, used); | |
| 2199 | }, | |
| 2200 | .Enum => { | |
| 2201 | // node != 0 | |
| 2202 | return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.zero_literal.init() }); | |
| 2203 | }, | |
| 2204 | .Elaborated => { | |
| 2205 | const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); | |
| 2206 | const named_type = elaborated_ty.getNamedType(); | |
| 2207 | return finishBoolExpr(c, scope, loc, named_type.getTypePtr(), node, used); | |
| 2208 | }, | |
| 2209 | else => {}, | |
| 2210 | } | |
| 2211 | return fail(c, error.UnsupportedType, loc, "unsupported bool expression type", .{}); | |
| 2212 | } | |
| 2213 | ||
| 2214 | const SuppressCast = enum { | |
| 2215 | with_as, | |
| 2216 | no_as, | |
| 2217 | }; | |
| 2218 | fn transIntegerLiteral( | |
| 2219 | c: *Context, | |
| 2220 | scope: *Scope, | |
| 2221 | expr: *const clang.IntegerLiteral, | |
| 2222 | result_used: ResultUsed, | |
| 2223 | suppress_as: SuppressCast, | |
| 2224 | ) TransError!Node { | |
| 2225 | var eval_result: clang.ExprEvalResult = undefined; | |
| 2226 | if (!expr.EvaluateAsInt(&eval_result, c.clang_context)) { | |
| 2227 | const loc = expr.getBeginLoc(); | |
| 2228 | return fail(c, error.UnsupportedTranslation, loc, "invalid integer literal", .{}); | |
| 2229 | } | |
| 2230 | ||
| 2231 | if (suppress_as == .no_as) { | |
| 2232 | const int_lit_node = try transCreateNodeAPInt(c, eval_result.Val.getInt()); | |
| 2233 | return maybeSuppressResult(c, result_used, int_lit_node); | |
| 2234 | } | |
| 2235 | ||
| 2236 | // Integer literals in C have types, and this can matter for several reasons. | |
| 2237 | // For example, this is valid C: | |
| 2238 | // unsigned char y = 256; | |
| 2239 | // How this gets evaluated is the 256 is an integer, which gets truncated to signed char, then bit-casted | |
| 2240 | // to unsigned char, resulting in 0. In order for this to work, we have to emit this zig code: | |
| 2241 | // var y = @as(u8, @bitCast(@as(i8, @truncate(@as(c_int, 256))))); | |
| 2242 | // Ideally in translate-c we could flatten this out to simply: | |
| 2243 | // var y: u8 = 0; | |
| 2244 | // But the first step is to be correct, and the next step is to make the output more elegant. | |
| 2245 | ||
| 2246 | // @as(T, x) | |
| 2247 | const expr_base = @as(*const clang.Expr, @ptrCast(expr)); | |
| 2248 | const ty_node = try transQualType(c, scope, expr_base.getType(), expr_base.getBeginLoc()); | |
| 2249 | const rhs = try transCreateNodeAPInt(c, eval_result.Val.getInt()); | |
| 2250 | const as = try Tag.as.create(c.arena, .{ .lhs = ty_node, .rhs = rhs }); | |
| 2251 | return maybeSuppressResult(c, result_used, as); | |
| 2252 | } | |
| 2253 | ||
| 2254 | fn transReturnStmt( | |
| 2255 | c: *Context, | |
| 2256 | scope: *Scope, | |
| 2257 | expr: *const clang.ReturnStmt, | |
| 2258 | ) TransError!Node { | |
| 2259 | const val_expr = expr.getRetValue() orelse | |
| 2260 | return Tag.return_void.init(); | |
| 2261 | ||
| 2262 | var rhs = try transExprCoercing(c, scope, val_expr, .used); | |
| 2263 | const return_qt = scope.findBlockReturnType(); | |
| 2264 | if (isBoolRes(rhs) and !qualTypeIsBoolean(return_qt)) { | |
| 2265 | rhs = try Tag.int_from_bool.create(c.arena, rhs); | |
| 2266 | } | |
| 2267 | return Tag.@"return".create(c.arena, rhs); | |
| 2268 | } | |
| 2269 | ||
| 2270 | fn transNarrowStringLiteral( | |
| 2271 | c: *Context, | |
| 2272 | stmt: *const clang.StringLiteral, | |
| 2273 | result_used: ResultUsed, | |
| 2274 | ) TransError!Node { | |
| 2275 | var len: usize = undefined; | |
| 2276 | const bytes_ptr = stmt.getString_bytes_begin_size(&len); | |
| 2277 | ||
| 2278 | const str = try std.fmt.allocPrint(c.arena, "\"{f}\"", .{std.zig.fmtString(bytes_ptr[0..len])}); | |
| 2279 | const node = try Tag.string_literal.create(c.arena, str); | |
| 2280 | return maybeSuppressResult(c, result_used, node); | |
| 2281 | } | |
| 2282 | ||
| 2283 | fn transStringLiteral( | |
| 2284 | c: *Context, | |
| 2285 | scope: *Scope, | |
| 2286 | stmt: *const clang.StringLiteral, | |
| 2287 | result_used: ResultUsed, | |
| 2288 | ) TransError!Node { | |
| 2289 | const kind = stmt.getKind(); | |
| 2290 | switch (kind) { | |
| 2291 | .Ascii, .UTF8 => return transNarrowStringLiteral(c, stmt, result_used), | |
| 2292 | .UTF16, .UTF32, .Wide => { | |
| 2293 | const str_type = @tagName(stmt.getKind()); | |
| 2294 | const name = try std.fmt.allocPrint(c.arena, "zig.{s}_string_{d}", .{ str_type, c.getMangle() }); | |
| 2295 | ||
| 2296 | const expr_base = @as(*const clang.Expr, @ptrCast(stmt)); | |
| 2297 | const array_type = try transQualTypeInitialized(c, scope, expr_base.getType(), expr_base, expr_base.getBeginLoc()); | |
| 2298 | const lit_array = try transStringLiteralInitializer(c, stmt, array_type); | |
| 2299 | const decl = try Tag.var_simple.create(c.arena, .{ .name = name, .init = lit_array }); | |
| 2300 | try scope.appendNode(decl); | |
| 2301 | const node = try Tag.identifier.create(c.arena, name); | |
| 2302 | return maybeSuppressResult(c, result_used, node); | |
| 2303 | }, | |
| 2304 | } | |
| 2305 | } | |
| 2306 | ||
| 2307 | fn getArrayPayload(array_type: Node) ast.Payload.Array.ArrayTypeInfo { | |
| 2308 | return (array_type.castTag(.array_type) orelse array_type.castTag(.null_sentinel_array_type).?).data; | |
| 2309 | } | |
| 2310 | ||
| 2311 | /// Translate a string literal that is initializing an array. In general narrow string | |
| 2312 | /// literals become `"<string>".*` or `"<string>"[0..<size>].*` if they need truncation. | |
| 2313 | /// Wide string literals become an array of integers. zero-fillers pad out the array to | |
| 2314 | /// the appropriate length, if necessary. | |
| 2315 | fn transStringLiteralInitializer( | |
| 2316 | c: *Context, | |
| 2317 | stmt: *const clang.StringLiteral, | |
| 2318 | array_type: Node, | |
| 2319 | ) TransError!Node { | |
| 2320 | assert(array_type.tag() == .array_type or array_type.tag() == .null_sentinel_array_type); | |
| 2321 | ||
| 2322 | const is_narrow = stmt.getKind() == .Ascii or stmt.getKind() == .UTF8; | |
| 2323 | ||
| 2324 | const str_length = stmt.getLength(); | |
| 2325 | const payload = getArrayPayload(array_type); | |
| 2326 | const array_size = payload.len; | |
| 2327 | const elem_type = payload.elem_type; | |
| 2328 | ||
| 2329 | if (array_size == 0) return Tag.empty_array.create(c.arena, elem_type); | |
| 2330 | ||
| 2331 | const num_inits = @min(str_length, array_size); | |
| 2332 | const init_node = if (num_inits > 0) blk: { | |
| 2333 | if (is_narrow) { | |
| 2334 | // "string literal".* or string literal"[0..num_inits].* | |
| 2335 | var str = try transNarrowStringLiteral(c, stmt, .used); | |
| 2336 | if (str_length != array_size) str = try Tag.string_slice.create(c.arena, .{ .string = str, .end = num_inits }); | |
| 2337 | break :blk try Tag.deref.create(c.arena, str); | |
| 2338 | } else { | |
| 2339 | const init_list = try c.arena.alloc(Node, num_inits); | |
| 2340 | var i: c_uint = 0; | |
| 2341 | while (i < num_inits) : (i += 1) { | |
| 2342 | init_list[i] = try transCreateCharLitNode(c, false, stmt.getCodeUnit(i)); | |
| 2343 | } | |
| 2344 | const init_args: ast.Payload.Array.ArrayTypeInfo = .{ .len = num_inits, .elem_type = elem_type }; | |
| 2345 | const init_array_type = if (array_type.tag() == .array_type) | |
| 2346 | try Tag.array_type.create(c.arena, init_args) | |
| 2347 | else | |
| 2348 | try Tag.null_sentinel_array_type.create(c.arena, init_args); | |
| 2349 | break :blk try Tag.array_init.create(c.arena, .{ | |
| 2350 | .cond = init_array_type, | |
| 2351 | .cases = init_list, | |
| 2352 | }); | |
| 2353 | } | |
| 2354 | } else null; | |
| 2355 | ||
| 2356 | 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 | |
| 2357 | assert(array_size > str_length); // If array_size <= str_length, `num_inits == array_size` and we've already returned. | |
| 2358 | ||
| 2359 | const filler_node = try Tag.array_filler.create(c.arena, .{ | |
| 2360 | .type = elem_type, | |
| 2361 | .filler = Tag.zero_literal.init(), | |
| 2362 | .count = array_size - str_length, | |
| 2363 | }); | |
| 2364 | ||
| 2365 | if (init_node) |some| { | |
| 2366 | return Tag.array_cat.create(c.arena, .{ .lhs = some, .rhs = filler_node }); | |
| 2367 | } else { | |
| 2368 | return filler_node; | |
| 2369 | } | |
| 2370 | } | |
| 2371 | ||
| 2372 | /// determine whether `stmt` is a "pointer subtraction expression" - a subtraction where | |
| 2373 | /// both operands resolve to addresses. The C standard requires that both operands | |
| 2374 | /// point to elements of the same array object, but we do not verify that here. | |
| 2375 | fn cIsPointerDiffExpr(stmt: *const clang.BinaryOperator) bool { | |
| 2376 | const lhs = @as(*const clang.Stmt, @ptrCast(stmt.getLHS())); | |
| 2377 | const rhs = @as(*const clang.Stmt, @ptrCast(stmt.getRHS())); | |
| 2378 | return stmt.getOpcode() == .Sub and | |
| 2379 | qualTypeIsPtr(@as(*const clang.Expr, @ptrCast(lhs)).getType()) and | |
| 2380 | qualTypeIsPtr(@as(*const clang.Expr, @ptrCast(rhs)).getType()); | |
| 2381 | } | |
| 2382 | ||
| 2383 | fn cIsEnum(qt: clang.QualType) bool { | |
| 2384 | return qt.getCanonicalType().getTypeClass() == .Enum; | |
| 2385 | } | |
| 2386 | ||
| 2387 | fn cIsVector(qt: clang.QualType) bool { | |
| 2388 | return qt.getCanonicalType().getTypeClass() == .Vector; | |
| 2389 | } | |
| 2390 | ||
| 2391 | /// Get the underlying int type of an enum. The C compiler chooses a signed int | |
| 2392 | /// type that is large enough to hold all of the enum's values. It is not required | |
| 2393 | /// to be the smallest possible type that can hold all the values. | |
| 2394 | fn cIntTypeForEnum(enum_qt: clang.QualType) clang.QualType { | |
| 2395 | assert(cIsEnum(enum_qt)); | |
| 2396 | const ty = enum_qt.getCanonicalType().getTypePtr(); | |
| 2397 | const enum_ty = @as(*const clang.EnumType, @ptrCast(ty)); | |
| 2398 | const enum_decl = enum_ty.getDecl(); | |
| 2399 | return enum_decl.getIntegerType(); | |
| 2400 | } | |
| 2401 | ||
| 2402 | // when modifying this function, make sure to also update std.zig.c_translation.cast | |
| 2403 | fn transCCast( | |
| 2404 | c: *Context, | |
| 2405 | scope: *Scope, | |
| 2406 | loc: clang.SourceLocation, | |
| 2407 | dst_type: clang.QualType, | |
| 2408 | src_type: clang.QualType, | |
| 2409 | expr: Node, | |
| 2410 | ) !Node { | |
| 2411 | if (qualTypeCanon(dst_type).isVoidType()) return expr; | |
| 2412 | if (dst_type.eq(src_type)) return expr; | |
| 2413 | if (qualTypeIsPtr(dst_type) and qualTypeIsPtr(src_type)) | |
| 2414 | return transCPtrCast(c, scope, loc, dst_type, src_type, expr); | |
| 2415 | if (cIsEnum(dst_type)) return transCCast(c, scope, loc, cIntTypeForEnum(dst_type), src_type, expr); | |
| 2416 | if (cIsEnum(src_type)) return transCCast(c, scope, loc, dst_type, cIntTypeForEnum(src_type), expr); | |
| 2417 | ||
| 2418 | const dst_node = try transQualType(c, scope, dst_type, loc); | |
| 2419 | if (cIsInteger(dst_type) and cIsInteger(src_type)) { | |
| 2420 | // 1. If src_type is an enum, determine the underlying signed int type | |
| 2421 | // 2. Extend or truncate without changing signed-ness. | |
| 2422 | // 3. Bit-cast to correct signed-ness | |
| 2423 | const src_type_is_signed = cIsSignedInteger(src_type); | |
| 2424 | var src_int_expr = expr; | |
| 2425 | ||
| 2426 | if (isBoolRes(src_int_expr)) { | |
| 2427 | src_int_expr = try Tag.int_from_bool.create(c.arena, src_int_expr); | |
| 2428 | return Tag.as.create(c.arena, .{ .lhs = dst_node, .rhs = src_int_expr }); | |
| 2429 | } | |
| 2430 | ||
| 2431 | switch (cIntTypeCmp(dst_type, src_type)) { | |
| 2432 | .lt => { | |
| 2433 | // @truncate(SameSignSmallerInt, src_int_expr) | |
| 2434 | const ty_node = try transQualTypeIntWidthOf(c, dst_type, src_type_is_signed); | |
| 2435 | src_int_expr = try Tag.as.create(c.arena, .{ | |
| 2436 | .lhs = ty_node, | |
| 2437 | .rhs = try Tag.truncate.create(c.arena, src_int_expr), | |
| 2438 | }); | |
| 2439 | }, | |
| 2440 | .gt => { | |
| 2441 | // @as(SameSignBiggerInt, src_int_expr) | |
| 2442 | const ty_node = try transQualTypeIntWidthOf(c, dst_type, src_type_is_signed); | |
| 2443 | src_int_expr = try Tag.as.create(c.arena, .{ .lhs = ty_node, .rhs = src_int_expr }); | |
| 2444 | }, | |
| 2445 | .eq => { | |
| 2446 | // src_int_expr = src_int_expr | |
| 2447 | }, | |
| 2448 | } | |
| 2449 | // @as(dest_type, @bitCast(intermediate_value)) | |
| 2450 | return Tag.as.create(c.arena, .{ | |
| 2451 | .lhs = dst_node, | |
| 2452 | .rhs = try Tag.bit_cast.create(c.arena, src_int_expr), | |
| 2453 | }); | |
| 2454 | } | |
| 2455 | if (cIsVector(src_type) or cIsVector(dst_type)) { | |
| 2456 | // C cast where at least 1 operand is a vector requires them to be same size | |
| 2457 | // @as(dest_type, @bitCast(val)) | |
| 2458 | return Tag.as.create(c.arena, .{ | |
| 2459 | .lhs = dst_node, | |
| 2460 | .rhs = try Tag.bit_cast.create(c.arena, expr), | |
| 2461 | }); | |
| 2462 | } | |
| 2463 | if (cIsInteger(dst_type) and qualTypeIsPtr(src_type)) { | |
| 2464 | // @intCast(dest_type, @intFromPtr(val)) | |
| 2465 | const int_from_ptr = try Tag.int_from_ptr.create(c.arena, expr); | |
| 2466 | return Tag.as.create(c.arena, .{ | |
| 2467 | .lhs = dst_node, | |
| 2468 | .rhs = try Tag.int_cast.create(c.arena, int_from_ptr), | |
| 2469 | }); | |
| 2470 | } | |
| 2471 | if (cIsInteger(src_type) and qualTypeIsPtr(dst_type)) { | |
| 2472 | // @as(dest_type, @ptrFromInt(val)) | |
| 2473 | return Tag.as.create(c.arena, .{ | |
| 2474 | .lhs = dst_node, | |
| 2475 | .rhs = try Tag.ptr_from_int.create(c.arena, expr), | |
| 2476 | }); | |
| 2477 | } | |
| 2478 | if (cIsFloating(src_type) and cIsFloating(dst_type)) { | |
| 2479 | // @as(dest_type, @floatCast(val)) | |
| 2480 | return Tag.as.create(c.arena, .{ | |
| 2481 | .lhs = dst_node, | |
| 2482 | .rhs = try Tag.float_cast.create(c.arena, expr), | |
| 2483 | }); | |
| 2484 | } | |
| 2485 | if (cIsFloating(src_type) and !cIsFloating(dst_type)) { | |
| 2486 | // bool expression: floating val != 0 | |
| 2487 | if (qualTypeIsBoolean(dst_type)) { | |
| 2488 | return Tag.not_equal.create(c.arena, .{ | |
| 2489 | .lhs = expr, | |
| 2490 | .rhs = Tag.zero_literal.init(), | |
| 2491 | }); | |
| 2492 | } | |
| 2493 | ||
| 2494 | // @as(dest_type, @intFromFloat(val)) | |
| 2495 | return Tag.as.create(c.arena, .{ | |
| 2496 | .lhs = dst_node, | |
| 2497 | .rhs = try Tag.int_from_float.create(c.arena, expr), | |
| 2498 | }); | |
| 2499 | } | |
| 2500 | if (!cIsFloating(src_type) and cIsFloating(dst_type)) { | |
| 2501 | var rhs = expr; | |
| 2502 | if (qualTypeIsBoolean(src_type) or isBoolRes(rhs)) rhs = try Tag.int_from_bool.create(c.arena, expr); | |
| 2503 | // @as(dest_type, @floatFromInt(val)) | |
| 2504 | return Tag.as.create(c.arena, .{ | |
| 2505 | .lhs = dst_node, | |
| 2506 | .rhs = try Tag.float_from_int.create(c.arena, rhs), | |
| 2507 | }); | |
| 2508 | } | |
| 2509 | if (qualTypeIsBoolean(src_type) and !qualTypeIsBoolean(dst_type)) { | |
| 2510 | // @intFromBool returns a u1 | |
| 2511 | // TODO: if dst_type is 1 bit & signed (bitfield) we need @bitCast | |
| 2512 | // instead of @as | |
| 2513 | const int_from_bool = try Tag.int_from_bool.create(c.arena, expr); | |
| 2514 | return Tag.as.create(c.arena, .{ .lhs = dst_node, .rhs = int_from_bool }); | |
| 2515 | } | |
| 2516 | // @as(dest_type, val) | |
| 2517 | return Tag.as.create(c.arena, .{ .lhs = dst_node, .rhs = expr }); | |
| 2518 | } | |
| 2519 | ||
| 2520 | fn transExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { | |
| 2521 | return transStmt(c, scope, @as(*const clang.Stmt, @ptrCast(expr)), used); | |
| 2522 | } | |
| 2523 | ||
| 2524 | /// Same as `transExpr` but with the knowledge that the operand will be type coerced, and therefore | |
| 2525 | /// an `@as` would be redundant. This is used to prevent redundant `@as` in integer literals. | |
| 2526 | fn transExprCoercing(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { | |
| 2527 | switch (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass()) { | |
| 2528 | .IntegerLiteralClass => { | |
| 2529 | return transIntegerLiteral(c, scope, @as(*const clang.IntegerLiteral, @ptrCast(expr)), .used, .no_as); | |
| 2530 | }, | |
| 2531 | .CharacterLiteralClass => { | |
| 2532 | return transCharLiteral(c, scope, @as(*const clang.CharacterLiteral, @ptrCast(expr)), .used, .no_as); | |
| 2533 | }, | |
| 2534 | .UnaryOperatorClass => { | |
| 2535 | const un_expr = @as(*const clang.UnaryOperator, @ptrCast(expr)); | |
| 2536 | if (un_expr.getOpcode() == .Extension) { | |
| 2537 | return transExprCoercing(c, scope, un_expr.getSubExpr(), used); | |
| 2538 | } | |
| 2539 | }, | |
| 2540 | .ImplicitCastExprClass => { | |
| 2541 | const cast_expr = @as(*const clang.ImplicitCastExpr, @ptrCast(expr)); | |
| 2542 | const sub_expr = cast_expr.getSubExpr(); | |
| 2543 | switch (@as(*const clang.Stmt, @ptrCast(sub_expr)).getStmtClass()) { | |
| 2544 | .IntegerLiteralClass, .CharacterLiteralClass => switch (cast_expr.getCastKind()) { | |
| 2545 | .IntegralToFloating => return transExprCoercing(c, scope, sub_expr, used), | |
| 2546 | .IntegralCast => { | |
| 2547 | const dest_type = getExprQualType(c, expr); | |
| 2548 | if (literalFitsInType(c, sub_expr, dest_type)) | |
| 2549 | return transExprCoercing(c, scope, sub_expr, used); | |
| 2550 | }, | |
| 2551 | else => {}, | |
| 2552 | }, | |
| 2553 | else => {}, | |
| 2554 | } | |
| 2555 | }, | |
| 2556 | else => {}, | |
| 2557 | } | |
| 2558 | return transExpr(c, scope, expr, .used); | |
| 2559 | } | |
| 2560 | ||
| 2561 | fn literalFitsInType(c: *Context, expr: *const clang.Expr, qt: clang.QualType) bool { | |
| 2562 | var width = qualTypeIntBitWidth(c, qt) catch 8; | |
| 2563 | if (width == 0) width = 8; // Byte is the smallest type. | |
| 2564 | const is_signed = cIsSignedInteger(qt); | |
| 2565 | const width_max_int = (@as(u64, 1) << math.lossyCast(u6, width - @intFromBool(is_signed))) - 1; | |
| 2566 | ||
| 2567 | switch (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass()) { | |
| 2568 | .CharacterLiteralClass => { | |
| 2569 | const char_lit = @as(*const clang.CharacterLiteral, @ptrCast(expr)); | |
| 2570 | const val = char_lit.getValue(); | |
| 2571 | // If the val is less than the max int then it fits. | |
| 2572 | return val <= width_max_int; | |
| 2573 | }, | |
| 2574 | .IntegerLiteralClass => { | |
| 2575 | const int_lit = @as(*const clang.IntegerLiteral, @ptrCast(expr)); | |
| 2576 | var eval_result: clang.ExprEvalResult = undefined; | |
| 2577 | if (!int_lit.EvaluateAsInt(&eval_result, c.clang_context)) { | |
| 2578 | return false; | |
| 2579 | } | |
| 2580 | ||
| 2581 | const int = eval_result.Val.getInt(); | |
| 2582 | return int.lessThanEqual(width_max_int); | |
| 2583 | }, | |
| 2584 | else => unreachable, | |
| 2585 | } | |
| 2586 | } | |
| 2587 | ||
| 2588 | fn transInitListExprRecord( | |
| 2589 | c: *Context, | |
| 2590 | scope: *Scope, | |
| 2591 | loc: clang.SourceLocation, | |
| 2592 | expr: *const clang.InitListExpr, | |
| 2593 | ty: *const clang.Type, | |
| 2594 | ) TransError!Node { | |
| 2595 | var is_union_type = false; | |
| 2596 | // Unions and Structs are both represented as RecordDecl | |
| 2597 | const record_ty = ty.getAsRecordType() orelse | |
| 2598 | blk: { | |
| 2599 | is_union_type = true; | |
| 2600 | break :blk ty.getAsUnionType(); | |
| 2601 | } orelse unreachable; | |
| 2602 | const record_decl = record_ty.getDecl(); | |
| 2603 | const record_def = record_decl.getDefinition() orelse | |
| 2604 | unreachable; | |
| 2605 | ||
| 2606 | const ty_node = try transType(c, scope, ty, loc); | |
| 2607 | const init_count = expr.getNumInits(); | |
| 2608 | var field_inits = std.array_list.Managed(ast.Payload.ContainerInit.Initializer).init(c.gpa); | |
| 2609 | defer field_inits.deinit(); | |
| 2610 | ||
| 2611 | if (init_count == 0) { | |
| 2612 | const source_loc = @as(*const clang.Expr, @ptrCast(expr)).getBeginLoc(); | |
| 2613 | return transZeroInitExpr(c, scope, source_loc, ty); | |
| 2614 | } | |
| 2615 | ||
| 2616 | var init_i: c_uint = 0; | |
| 2617 | var it = record_def.field_begin(); | |
| 2618 | const end_it = record_def.field_end(); | |
| 2619 | while (it.neq(end_it)) : (it = it.next()) { | |
| 2620 | const field_decl = it.deref(); | |
| 2621 | ||
| 2622 | // The initializer for a union type has a single entry only | |
| 2623 | if (is_union_type and field_decl != expr.getInitializedFieldInUnion()) { | |
| 2624 | continue; | |
| 2625 | } | |
| 2626 | ||
| 2627 | assert(init_i < init_count); | |
| 2628 | const elem_expr = expr.getInit(init_i); | |
| 2629 | init_i += 1; | |
| 2630 | ||
| 2631 | // Generate the field assignment expression: | |
| 2632 | // .field_name = expr | |
| 2633 | var raw_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); | |
| 2634 | if (field_decl.isAnonymousStructOrUnion()) { | |
| 2635 | const name = c.decl_table.get(@intFromPtr(field_decl.getCanonicalDecl())).?; | |
| 2636 | raw_name = try c.arena.dupe(u8, name); | |
| 2637 | } | |
| 2638 | ||
| 2639 | var init_expr = try transExpr(c, scope, elem_expr, .used); | |
| 2640 | const field_qt = field_decl.getType(); | |
| 2641 | if (init_expr.tag() == .string_literal and qualTypeIsCharStar(field_qt)) { | |
| 2642 | if (scope.id == .root) { | |
| 2643 | init_expr = try stringLiteralToCharStar(c, init_expr); | |
| 2644 | } else { | |
| 2645 | const dst_type_node = try transQualType(c, scope, field_qt, loc); | |
| 2646 | init_expr = try removeCVQualifiers(c, dst_type_node, init_expr); | |
| 2647 | } | |
| 2648 | } | |
| 2649 | try field_inits.append(.{ | |
| 2650 | .name = raw_name, | |
| 2651 | .value = init_expr, | |
| 2652 | }); | |
| 2653 | } | |
| 2654 | if (ty_node.castTag(.identifier)) |ident_node| { | |
| 2655 | scope.skipVariableDiscard(ident_node.data); | |
| 2656 | } | |
| 2657 | return Tag.container_init.create(c.arena, .{ | |
| 2658 | .lhs = ty_node, | |
| 2659 | .inits = try c.arena.dupe(ast.Payload.ContainerInit.Initializer, field_inits.items), | |
| 2660 | }); | |
| 2661 | } | |
| 2662 | ||
| 2663 | fn transInitListExprArray( | |
| 2664 | c: *Context, | |
| 2665 | scope: *Scope, | |
| 2666 | loc: clang.SourceLocation, | |
| 2667 | expr: *const clang.InitListExpr, | |
| 2668 | ty: *const clang.Type, | |
| 2669 | ) TransError!Node { | |
| 2670 | const arr_type = ty.getAsArrayTypeUnsafe(); | |
| 2671 | const child_qt = arr_type.getElementType(); | |
| 2672 | const child_type = try transQualType(c, scope, child_qt, loc); | |
| 2673 | const init_count = expr.getNumInits(); | |
| 2674 | assert(@as(*const clang.Type, @ptrCast(arr_type)).isConstantArrayType()); | |
| 2675 | const const_arr_ty = @as(*const clang.ConstantArrayType, @ptrCast(arr_type)); | |
| 2676 | var size_ap_int: *const clang.APInt = undefined; | |
| 2677 | const_arr_ty.getSize(&size_ap_int); | |
| 2678 | defer size_ap_int.free(); | |
| 2679 | const all_count = size_ap_int.getLimitedValue(usize); | |
| 2680 | const leftover_count = all_count - init_count; | |
| 2681 | ||
| 2682 | if (all_count == 0) { | |
| 2683 | return Tag.empty_array.create(c.arena, child_type); | |
| 2684 | } | |
| 2685 | ||
| 2686 | if (expr.isStringLiteralInit()) { | |
| 2687 | assert(init_count == 1); | |
| 2688 | const init_expr = expr.getInit(0); | |
| 2689 | const string_literal = init_expr.castToStringLiteral().?; | |
| 2690 | return try transStringLiteral(c, scope, string_literal, .used); | |
| 2691 | } | |
| 2692 | ||
| 2693 | const init_node = if (init_count != 0) blk: { | |
| 2694 | const init_list = try c.arena.alloc(Node, init_count); | |
| 2695 | ||
| 2696 | for (init_list, 0..) |*init, i| { | |
| 2697 | const elem_expr = expr.getInit(@as(c_uint, @intCast(i))); | |
| 2698 | init.* = try transExprCoercing(c, scope, elem_expr, .used); | |
| 2699 | } | |
| 2700 | const init_node = try Tag.array_init.create(c.arena, .{ | |
| 2701 | .cond = try Tag.array_type.create(c.arena, .{ .len = init_count, .elem_type = child_type }), | |
| 2702 | .cases = init_list, | |
| 2703 | }); | |
| 2704 | if (leftover_count == 0) { | |
| 2705 | return init_node; | |
| 2706 | } | |
| 2707 | break :blk init_node; | |
| 2708 | } else null; | |
| 2709 | ||
| 2710 | assert(expr.hasArrayFiller()); | |
| 2711 | const filler_val_expr = expr.getArrayFiller(); | |
| 2712 | const filler_node = try Tag.array_filler.create(c.arena, .{ | |
| 2713 | .type = child_type, | |
| 2714 | .filler = try transExprCoercing(c, scope, filler_val_expr, .used), | |
| 2715 | .count = leftover_count, | |
| 2716 | }); | |
| 2717 | ||
| 2718 | if (init_node) |some| { | |
| 2719 | return Tag.array_cat.create(c.arena, .{ .lhs = some, .rhs = filler_node }); | |
| 2720 | } else { | |
| 2721 | return filler_node; | |
| 2722 | } | |
| 2723 | } | |
| 2724 | ||
| 2725 | fn transInitListExprVector( | |
| 2726 | c: *Context, | |
| 2727 | scope: *Scope, | |
| 2728 | loc: clang.SourceLocation, | |
| 2729 | expr: *const clang.InitListExpr, | |
| 2730 | ) TransError!Node { | |
| 2731 | const qt = getExprQualType(c, @as(*const clang.Expr, @ptrCast(expr))); | |
| 2732 | const vector_ty = @as(*const clang.VectorType, @ptrCast(qualTypeCanon(qt))); | |
| 2733 | ||
| 2734 | const init_count = expr.getNumInits(); | |
| 2735 | const num_elements = vector_ty.getNumElements(); | |
| 2736 | const element_qt = vector_ty.getElementType(); | |
| 2737 | ||
| 2738 | if (init_count == 0) { | |
| 2739 | const vec_node = try Tag.vector.create(c.arena, .{ | |
| 2740 | .lhs = try transCreateNodeNumber(c, num_elements, .int), | |
| 2741 | .rhs = try transQualType(c, scope, element_qt, loc), | |
| 2742 | }); | |
| 2743 | ||
| 2744 | return Tag.as.create(c.arena, .{ | |
| 2745 | .lhs = vec_node, | |
| 2746 | .rhs = try Tag.vector_zero_init.create(c.arena, Tag.zero_literal.init()), | |
| 2747 | }); | |
| 2748 | } | |
| 2749 | ||
| 2750 | const vector_type = try transQualType(c, scope, qt, loc); | |
| 2751 | ||
| 2752 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 2753 | defer block_scope.deinit(); | |
| 2754 | ||
| 2755 | // workaround for https://github.com/ziglang/zig/issues/8322 | |
| 2756 | // we store the initializers in temp variables and use those | |
| 2757 | // to initialize the vector. Eventually we can just directly | |
| 2758 | // construct the init_list from casted source members | |
| 2759 | var i: usize = 0; | |
| 2760 | while (i < init_count) : (i += 1) { | |
| 2761 | const mangled_name = try block_scope.makeMangledName(c, "tmp"); | |
| 2762 | const init_expr = expr.getInit(@as(c_uint, @intCast(i))); | |
| 2763 | const tmp_decl_node = try Tag.var_simple.create(c.arena, .{ | |
| 2764 | .name = mangled_name, | |
| 2765 | .init = try transExpr(c, &block_scope.base, init_expr, .used), | |
| 2766 | }); | |
| 2767 | try block_scope.statements.append(tmp_decl_node); | |
| 2768 | } | |
| 2769 | ||
| 2770 | const init_list = try c.arena.alloc(Node, num_elements); | |
| 2771 | for (init_list, 0..) |*init, init_index| { | |
| 2772 | if (init_index < init_count) { | |
| 2773 | const tmp_decl = block_scope.statements.items[init_index]; | |
| 2774 | const name = tmp_decl.castTag(.var_simple).?.data.name; | |
| 2775 | init.* = try Tag.identifier.create(c.arena, name); | |
| 2776 | } else { | |
| 2777 | init.* = Tag.undefined_literal.init(); | |
| 2778 | } | |
| 2779 | } | |
| 2780 | ||
| 2781 | const array_init = try Tag.array_init.create(c.arena, .{ | |
| 2782 | .cond = vector_type, | |
| 2783 | .cases = init_list, | |
| 2784 | }); | |
| 2785 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 2786 | .label = block_scope.label, | |
| 2787 | .val = array_init, | |
| 2788 | }); | |
| 2789 | try block_scope.statements.append(break_node); | |
| 2790 | ||
| 2791 | return block_scope.complete(c); | |
| 2792 | } | |
| 2793 | ||
| 2794 | fn transInitListExpr( | |
| 2795 | c: *Context, | |
| 2796 | scope: *Scope, | |
| 2797 | expr: *const clang.InitListExpr, | |
| 2798 | used: ResultUsed, | |
| 2799 | ) TransError!Node { | |
| 2800 | const qt = getExprQualType(c, @as(*const clang.Expr, @ptrCast(expr))); | |
| 2801 | var qual_type = qt.getTypePtr(); | |
| 2802 | const source_loc = @as(*const clang.Expr, @ptrCast(expr)).getBeginLoc(); | |
| 2803 | ||
| 2804 | if (qualTypeWasDemotedToOpaque(c, qt)) { | |
| 2805 | return fail(c, error.UnsupportedTranslation, source_loc, "cannot initialize opaque type", .{}); | |
| 2806 | } | |
| 2807 | ||
| 2808 | if (qual_type.isRecordType()) { | |
| 2809 | return maybeSuppressResult(c, used, try transInitListExprRecord( | |
| 2810 | c, | |
| 2811 | scope, | |
| 2812 | source_loc, | |
| 2813 | expr, | |
| 2814 | qual_type, | |
| 2815 | )); | |
| 2816 | } else if (qual_type.isArrayType()) { | |
| 2817 | return maybeSuppressResult(c, used, try transInitListExprArray( | |
| 2818 | c, | |
| 2819 | scope, | |
| 2820 | source_loc, | |
| 2821 | expr, | |
| 2822 | qual_type, | |
| 2823 | )); | |
| 2824 | } else if (qual_type.isVectorType()) { | |
| 2825 | return maybeSuppressResult(c, used, try transInitListExprVector(c, scope, source_loc, expr)); | |
| 2826 | } else { | |
| 2827 | const type_name = try c.str(qual_type.getTypeClassName()); | |
| 2828 | return fail(c, error.UnsupportedType, source_loc, "unsupported initlist type: '{s}'", .{type_name}); | |
| 2829 | } | |
| 2830 | } | |
| 2831 | ||
| 2832 | fn transZeroInitExpr( | |
| 2833 | c: *Context, | |
| 2834 | scope: *Scope, | |
| 2835 | source_loc: clang.SourceLocation, | |
| 2836 | ty: *const clang.Type, | |
| 2837 | ) TransError!Node { | |
| 2838 | switch (ty.getTypeClass()) { | |
| 2839 | .Builtin => { | |
| 2840 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 2841 | switch (builtin_ty.getKind()) { | |
| 2842 | .Bool => return Tag.false_literal.init(), | |
| 2843 | .Char_U, | |
| 2844 | .UChar, | |
| 2845 | .Char_S, | |
| 2846 | .Char8, | |
| 2847 | .SChar, | |
| 2848 | .UShort, | |
| 2849 | .UInt, | |
| 2850 | .ULong, | |
| 2851 | .ULongLong, | |
| 2852 | .Short, | |
| 2853 | .Int, | |
| 2854 | .Long, | |
| 2855 | .LongLong, | |
| 2856 | .UInt128, | |
| 2857 | .Int128, | |
| 2858 | .Float, | |
| 2859 | .Double, | |
| 2860 | .Float128, | |
| 2861 | .Float16, | |
| 2862 | .LongDouble, | |
| 2863 | => return Tag.zero_literal.init(), | |
| 2864 | else => return fail(c, error.UnsupportedType, source_loc, "unsupported builtin type", .{}), | |
| 2865 | } | |
| 2866 | }, | |
| 2867 | .Pointer => return Tag.null_literal.init(), | |
| 2868 | .Typedef => { | |
| 2869 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 2870 | const typedef_decl = typedef_ty.getDecl(); | |
| 2871 | return transZeroInitExpr( | |
| 2872 | c, | |
| 2873 | scope, | |
| 2874 | source_loc, | |
| 2875 | typedef_decl.getUnderlyingType().getTypePtr(), | |
| 2876 | ); | |
| 2877 | }, | |
| 2878 | else => return Tag.std_mem_zeroes.create(c.arena, try transType(c, scope, ty, source_loc)), | |
| 2879 | } | |
| 2880 | } | |
| 2881 | ||
| 2882 | fn transImplicitValueInitExpr( | |
| 2883 | c: *Context, | |
| 2884 | scope: *Scope, | |
| 2885 | expr: *const clang.Expr, | |
| 2886 | ) TransError!Node { | |
| 2887 | const source_loc = expr.getBeginLoc(); | |
| 2888 | const qt = getExprQualType(c, expr); | |
| 2889 | const ty = qt.getTypePtr(); | |
| 2890 | return transZeroInitExpr(c, scope, source_loc, ty); | |
| 2891 | } | |
| 2892 | ||
| 2893 | /// If a statement can possibly translate to a Zig assignment (either directly because it's | |
| 2894 | /// an assignment in C or indirectly via result assignment to `_`) AND it's the sole statement | |
| 2895 | /// in the body of an if statement or loop, then we need to put the statement into its own block. | |
| 2896 | /// The `else` case here corresponds to statements that could result in an assignment. If a statement | |
| 2897 | /// class never needs a block, add its enum to the top prong. | |
| 2898 | fn maybeBlockify(c: *Context, scope: *Scope, stmt: *const clang.Stmt) TransError!Node { | |
| 2899 | switch (stmt.getStmtClass()) { | |
| 2900 | .BreakStmtClass, | |
| 2901 | .CompoundStmtClass, | |
| 2902 | .ContinueStmtClass, | |
| 2903 | .DeclRefExprClass, | |
| 2904 | .DeclStmtClass, | |
| 2905 | .DoStmtClass, | |
| 2906 | .ForStmtClass, | |
| 2907 | .IfStmtClass, | |
| 2908 | .ReturnStmtClass, | |
| 2909 | .NullStmtClass, | |
| 2910 | .WhileStmtClass, | |
| 2911 | => return transStmt(c, scope, stmt, .unused), | |
| 2912 | else => return blockify(c, scope, stmt), | |
| 2913 | } | |
| 2914 | } | |
| 2915 | ||
| 2916 | fn blockify(c: *Context, scope: *Scope, stmt: *const clang.Stmt) TransError!Node { | |
| 2917 | var block_scope = try Scope.Block.init(c, scope, false); | |
| 2918 | defer block_scope.deinit(); | |
| 2919 | const result = try transStmt(c, &block_scope.base, stmt, .unused); | |
| 2920 | try block_scope.statements.append(result); | |
| 2921 | return block_scope.complete(c); | |
| 2922 | } | |
| 2923 | ||
| 2924 | fn transIfStmt( | |
| 2925 | c: *Context, | |
| 2926 | scope: *Scope, | |
| 2927 | stmt: *const clang.IfStmt, | |
| 2928 | ) TransError!Node { | |
| 2929 | // if (c) t | |
| 2930 | // if (c) t else e | |
| 2931 | var cond_scope = Scope.Condition{ | |
| 2932 | .base = .{ | |
| 2933 | .parent = scope, | |
| 2934 | .id = .condition, | |
| 2935 | }, | |
| 2936 | }; | |
| 2937 | defer cond_scope.deinit(); | |
| 2938 | const cond_expr = @as(*const clang.Expr, @ptrCast(stmt.getCond())); | |
| 2939 | const cond = try transBoolExpr(c, &cond_scope.base, cond_expr, .used); | |
| 2940 | ||
| 2941 | const then_stmt = stmt.getThen(); | |
| 2942 | const else_stmt = stmt.getElse(); | |
| 2943 | const then_class = then_stmt.getStmtClass(); | |
| 2944 | // block needed to keep else statement from attaching to inner while | |
| 2945 | const must_blockify = (else_stmt != null) and switch (then_class) { | |
| 2946 | .DoStmtClass, .ForStmtClass, .WhileStmtClass => true, | |
| 2947 | else => false, | |
| 2948 | }; | |
| 2949 | ||
| 2950 | const then_body = if (must_blockify) | |
| 2951 | try blockify(c, scope, then_stmt) | |
| 2952 | else | |
| 2953 | try maybeBlockify(c, scope, then_stmt); | |
| 2954 | ||
| 2955 | const else_body = if (else_stmt) |expr| | |
| 2956 | try maybeBlockify(c, scope, expr) | |
| 2957 | else | |
| 2958 | null; | |
| 2959 | return Tag.@"if".create(c.arena, .{ .cond = cond, .then = then_body, .@"else" = else_body }); | |
| 2960 | } | |
| 2961 | ||
| 2962 | fn transWhileLoop( | |
| 2963 | c: *Context, | |
| 2964 | scope: *Scope, | |
| 2965 | stmt: *const clang.WhileStmt, | |
| 2966 | ) TransError!Node { | |
| 2967 | var cond_scope = Scope.Condition{ | |
| 2968 | .base = .{ | |
| 2969 | .parent = scope, | |
| 2970 | .id = .condition, | |
| 2971 | }, | |
| 2972 | }; | |
| 2973 | defer cond_scope.deinit(); | |
| 2974 | const cond_expr = @as(*const clang.Expr, @ptrCast(stmt.getCond())); | |
| 2975 | const cond = try transBoolExpr(c, &cond_scope.base, cond_expr, .used); | |
| 2976 | ||
| 2977 | var loop_scope = Scope{ | |
| 2978 | .parent = scope, | |
| 2979 | .id = .loop, | |
| 2980 | }; | |
| 2981 | const body = try maybeBlockify(c, &loop_scope, stmt.getBody()); | |
| 2982 | return Tag.@"while".create(c.arena, .{ .cond = cond, .body = body, .cont_expr = null }); | |
| 2983 | } | |
| 2984 | ||
| 2985 | fn transDoWhileLoop( | |
| 2986 | c: *Context, | |
| 2987 | scope: *Scope, | |
| 2988 | stmt: *const clang.DoStmt, | |
| 2989 | ) TransError!Node { | |
| 2990 | var loop_scope = Scope{ | |
| 2991 | .parent = scope, | |
| 2992 | .id = .do_loop, | |
| 2993 | }; | |
| 2994 | ||
| 2995 | // if (!cond) break; | |
| 2996 | var cond_scope = Scope.Condition{ | |
| 2997 | .base = .{ | |
| 2998 | .parent = scope, | |
| 2999 | .id = .condition, | |
| 3000 | }, | |
| 3001 | }; | |
| 3002 | defer cond_scope.deinit(); | |
| 3003 | const cond = try transBoolExpr(c, &cond_scope.base, @as(*const clang.Expr, @ptrCast(stmt.getCond())), .used); | |
| 3004 | const if_not_break = switch (cond.tag()) { | |
| 3005 | .true_literal => { | |
| 3006 | const body_node = try maybeBlockify(c, scope, stmt.getBody()); | |
| 3007 | return Tag.while_true.create(c.arena, body_node); | |
| 3008 | }, | |
| 3009 | else => try Tag.if_not_break.create(c.arena, cond), | |
| 3010 | }; | |
| 3011 | ||
| 3012 | var body_node = try transStmt(c, &loop_scope, stmt.getBody(), .unused); | |
| 3013 | if (body_node.isNoreturn(true)) { | |
| 3014 | // The body node ends in a noreturn statement. Simply put it in a while (true) | |
| 3015 | // in case it contains breaks or continues. | |
| 3016 | } else if (stmt.getBody().getStmtClass() == .CompoundStmtClass) { | |
| 3017 | // there's already a block in C, so we'll append our condition to it. | |
| 3018 | // c: do { | |
| 3019 | // c: a; | |
| 3020 | // c: b; | |
| 3021 | // c: } while(c); | |
| 3022 | // zig: while (true) { | |
| 3023 | // zig: a; | |
| 3024 | // zig: b; | |
| 3025 | // zig: if (!cond) break; | |
| 3026 | // zig: } | |
| 3027 | const block = body_node.castTag(.block).?; | |
| 3028 | block.data.stmts.len += 1; // This is safe since we reserve one extra space in Scope.Block.complete. | |
| 3029 | block.data.stmts[block.data.stmts.len - 1] = if_not_break; | |
| 3030 | } else { | |
| 3031 | // the C statement is without a block, so we need to create a block to contain it. | |
| 3032 | // c: do | |
| 3033 | // c: a; | |
| 3034 | // c: while(c); | |
| 3035 | // zig: while (true) { | |
| 3036 | // zig: a; | |
| 3037 | // zig: if (!cond) break; | |
| 3038 | // zig: } | |
| 3039 | const statements = try c.arena.alloc(Node, 2); | |
| 3040 | statements[0] = body_node; | |
| 3041 | statements[1] = if_not_break; | |
| 3042 | body_node = try Tag.block.create(c.arena, .{ .label = null, .stmts = statements }); | |
| 3043 | } | |
| 3044 | return Tag.while_true.create(c.arena, body_node); | |
| 3045 | } | |
| 3046 | ||
| 3047 | fn transForLoop( | |
| 3048 | c: *Context, | |
| 3049 | scope: *Scope, | |
| 3050 | stmt: *const clang.ForStmt, | |
| 3051 | ) TransError!Node { | |
| 3052 | var loop_scope = Scope{ | |
| 3053 | .parent = scope, | |
| 3054 | .id = .loop, | |
| 3055 | }; | |
| 3056 | ||
| 3057 | var block_scope: ?Scope.Block = null; | |
| 3058 | defer if (block_scope) |*bs| bs.deinit(); | |
| 3059 | ||
| 3060 | if (stmt.getInit()) |init| { | |
| 3061 | block_scope = try Scope.Block.init(c, scope, false); | |
| 3062 | loop_scope.parent = &block_scope.?.base; | |
| 3063 | const init_node = try transStmt(c, &block_scope.?.base, init, .unused); | |
| 3064 | if (init_node.tag() != .declaration) try block_scope.?.statements.append(init_node); | |
| 3065 | } | |
| 3066 | var cond_scope = Scope.Condition{ | |
| 3067 | .base = .{ | |
| 3068 | .parent = &loop_scope, | |
| 3069 | .id = .condition, | |
| 3070 | }, | |
| 3071 | }; | |
| 3072 | defer cond_scope.deinit(); | |
| 3073 | ||
| 3074 | const cond = if (stmt.getCond()) |cond| | |
| 3075 | try transBoolExpr(c, &cond_scope.base, cond, .used) | |
| 3076 | else | |
| 3077 | Tag.true_literal.init(); | |
| 3078 | ||
| 3079 | const cont_expr = if (stmt.getInc()) |incr| | |
| 3080 | try transExpr(c, &cond_scope.base, incr, .unused) | |
| 3081 | else | |
| 3082 | null; | |
| 3083 | ||
| 3084 | const body = try maybeBlockify(c, &loop_scope, stmt.getBody()); | |
| 3085 | const while_node = try Tag.@"while".create(c.arena, .{ .cond = cond, .body = body, .cont_expr = cont_expr }); | |
| 3086 | if (block_scope) |*bs| { | |
| 3087 | try bs.statements.append(while_node); | |
| 3088 | return try bs.complete(c); | |
| 3089 | } else { | |
| 3090 | return while_node; | |
| 3091 | } | |
| 3092 | } | |
| 3093 | ||
| 3094 | fn transSwitch( | |
| 3095 | c: *Context, | |
| 3096 | scope: *Scope, | |
| 3097 | stmt: *const clang.SwitchStmt, | |
| 3098 | ) TransError!Node { | |
| 3099 | var loop_scope = Scope{ | |
| 3100 | .parent = scope, | |
| 3101 | .id = .loop, | |
| 3102 | }; | |
| 3103 | ||
| 3104 | var block_scope = try Scope.Block.init(c, &loop_scope, false); | |
| 3105 | defer block_scope.deinit(); | |
| 3106 | ||
| 3107 | const base_scope = &block_scope.base; | |
| 3108 | ||
| 3109 | var cond_scope = Scope.Condition{ | |
| 3110 | .base = .{ | |
| 3111 | .parent = base_scope, | |
| 3112 | .id = .condition, | |
| 3113 | }, | |
| 3114 | }; | |
| 3115 | defer cond_scope.deinit(); | |
| 3116 | const switch_expr = try transExpr(c, &cond_scope.base, stmt.getCond(), .used); | |
| 3117 | ||
| 3118 | var cases = std.array_list.Managed(Node).init(c.gpa); | |
| 3119 | defer cases.deinit(); | |
| 3120 | var has_default = false; | |
| 3121 | ||
| 3122 | const body = stmt.getBody(); | |
| 3123 | assert(body.getStmtClass() == .CompoundStmtClass); | |
| 3124 | const compound_stmt = @as(*const clang.CompoundStmt, @ptrCast(body)); | |
| 3125 | var it = compound_stmt.body_begin(); | |
| 3126 | const end_it = compound_stmt.body_end(); | |
| 3127 | // Iterate over switch body and collect all cases. | |
| 3128 | // Fallthrough is handled by duplicating statements. | |
| 3129 | while (it != end_it) : (it += 1) { | |
| 3130 | switch (it[0].getStmtClass()) { | |
| 3131 | .CaseStmtClass => { | |
| 3132 | var items = std.array_list.Managed(Node).init(c.gpa); | |
| 3133 | defer items.deinit(); | |
| 3134 | const sub = try transCaseStmt(c, base_scope, it[0], &items); | |
| 3135 | const res = try transSwitchProngStmt(c, base_scope, sub, it, end_it); | |
| 3136 | ||
| 3137 | if (items.items.len == 0) { | |
| 3138 | has_default = true; | |
| 3139 | const switch_else = try Tag.switch_else.create(c.arena, res); | |
| 3140 | try cases.append(switch_else); | |
| 3141 | } else { | |
| 3142 | const switch_prong = try Tag.switch_prong.create(c.arena, .{ | |
| 3143 | .cases = try c.arena.dupe(Node, items.items), | |
| 3144 | .cond = res, | |
| 3145 | }); | |
| 3146 | try cases.append(switch_prong); | |
| 3147 | } | |
| 3148 | }, | |
| 3149 | .DefaultStmtClass => { | |
| 3150 | has_default = true; | |
| 3151 | const default_stmt = @as(*const clang.DefaultStmt, @ptrCast(it[0])); | |
| 3152 | ||
| 3153 | var sub = default_stmt.getSubStmt(); | |
| 3154 | while (true) switch (sub.getStmtClass()) { | |
| 3155 | .CaseStmtClass => sub = @as(*const clang.CaseStmt, @ptrCast(sub)).getSubStmt(), | |
| 3156 | .DefaultStmtClass => sub = @as(*const clang.DefaultStmt, @ptrCast(sub)).getSubStmt(), | |
| 3157 | else => break, | |
| 3158 | }; | |
| 3159 | ||
| 3160 | const res = try transSwitchProngStmt(c, base_scope, sub, it, end_it); | |
| 3161 | ||
| 3162 | const switch_else = try Tag.switch_else.create(c.arena, res); | |
| 3163 | try cases.append(switch_else); | |
| 3164 | }, | |
| 3165 | else => {}, // collected in transSwitchProngStmt | |
| 3166 | } | |
| 3167 | } | |
| 3168 | ||
| 3169 | if (!has_default) { | |
| 3170 | const else_prong = try Tag.switch_else.create(c.arena, Tag.empty_block.init()); | |
| 3171 | try cases.append(else_prong); | |
| 3172 | } | |
| 3173 | ||
| 3174 | const switch_node = try Tag.@"switch".create(c.arena, .{ | |
| 3175 | .cond = switch_expr, | |
| 3176 | .cases = try c.arena.dupe(Node, cases.items), | |
| 3177 | }); | |
| 3178 | try block_scope.statements.append(switch_node); | |
| 3179 | try block_scope.statements.append(Tag.@"break".init()); | |
| 3180 | const while_body = try block_scope.complete(c); | |
| 3181 | ||
| 3182 | return Tag.while_true.create(c.arena, while_body); | |
| 3183 | } | |
| 3184 | ||
| 3185 | /// Collects all items for this case, returns the first statement after the labels. | |
| 3186 | /// If items ends up empty, the prong should be translated as an else. | |
| 3187 | fn transCaseStmt(c: *Context, scope: *Scope, stmt: *const clang.Stmt, items: *std.array_list.Managed(Node)) TransError!*const clang.Stmt { | |
| 3188 | var sub = stmt; | |
| 3189 | var seen_default = false; | |
| 3190 | while (true) { | |
| 3191 | switch (sub.getStmtClass()) { | |
| 3192 | .DefaultStmtClass => { | |
| 3193 | seen_default = true; | |
| 3194 | items.items.len = 0; | |
| 3195 | const default_stmt = @as(*const clang.DefaultStmt, @ptrCast(sub)); | |
| 3196 | sub = default_stmt.getSubStmt(); | |
| 3197 | }, | |
| 3198 | .CaseStmtClass => { | |
| 3199 | const case_stmt = @as(*const clang.CaseStmt, @ptrCast(sub)); | |
| 3200 | ||
| 3201 | if (seen_default) { | |
| 3202 | items.items.len = 0; | |
| 3203 | sub = case_stmt.getSubStmt(); | |
| 3204 | continue; | |
| 3205 | } | |
| 3206 | ||
| 3207 | const expr = if (case_stmt.getRHS()) |rhs| blk: { | |
| 3208 | const lhs_node = try transExprCoercing(c, scope, case_stmt.getLHS(), .used); | |
| 3209 | const rhs_node = try transExprCoercing(c, scope, rhs, .used); | |
| 3210 | ||
| 3211 | break :blk try Tag.ellipsis3.create(c.arena, .{ .lhs = lhs_node, .rhs = rhs_node }); | |
| 3212 | } else try transExprCoercing(c, scope, case_stmt.getLHS(), .used); | |
| 3213 | ||
| 3214 | try items.append(expr); | |
| 3215 | sub = case_stmt.getSubStmt(); | |
| 3216 | }, | |
| 3217 | else => return sub, | |
| 3218 | } | |
| 3219 | } | |
| 3220 | } | |
| 3221 | ||
| 3222 | /// Collects all statements seen by this case into a block. | |
| 3223 | /// Avoids creating a block if the first statement is a break or return. | |
| 3224 | fn transSwitchProngStmt( | |
| 3225 | c: *Context, | |
| 3226 | scope: *Scope, | |
| 3227 | stmt: *const clang.Stmt, | |
| 3228 | parent_it: clang.CompoundStmt.ConstBodyIterator, | |
| 3229 | parent_end_it: clang.CompoundStmt.ConstBodyIterator, | |
| 3230 | ) TransError!Node { | |
| 3231 | switch (stmt.getStmtClass()) { | |
| 3232 | .BreakStmtClass => return Tag.@"break".init(), | |
| 3233 | .ReturnStmtClass => return transStmt(c, scope, stmt, .unused), | |
| 3234 | .CaseStmtClass, .DefaultStmtClass => unreachable, | |
| 3235 | else => { | |
| 3236 | var block_scope = try Scope.Block.init(c, scope, false); | |
| 3237 | defer block_scope.deinit(); | |
| 3238 | ||
| 3239 | // we do not need to translate `stmt` since it is the first stmt of `parent_it` | |
| 3240 | try transSwitchProngStmtInline(c, &block_scope, parent_it, parent_end_it); | |
| 3241 | return try block_scope.complete(c); | |
| 3242 | }, | |
| 3243 | } | |
| 3244 | } | |
| 3245 | ||
| 3246 | /// Collects all statements seen by this case into a block. | |
| 3247 | fn transSwitchProngStmtInline( | |
| 3248 | c: *Context, | |
| 3249 | block: *Scope.Block, | |
| 3250 | start_it: clang.CompoundStmt.ConstBodyIterator, | |
| 3251 | end_it: clang.CompoundStmt.ConstBodyIterator, | |
| 3252 | ) TransError!void { | |
| 3253 | var it = start_it; | |
| 3254 | while (it != end_it) : (it += 1) { | |
| 3255 | switch (it[0].getStmtClass()) { | |
| 3256 | .ReturnStmtClass => { | |
| 3257 | const result = try transStmt(c, &block.base, it[0], .unused); | |
| 3258 | try block.statements.append(result); | |
| 3259 | return; | |
| 3260 | }, | |
| 3261 | .BreakStmtClass => { | |
| 3262 | try block.statements.append(Tag.@"break".init()); | |
| 3263 | return; | |
| 3264 | }, | |
| 3265 | .CaseStmtClass => { | |
| 3266 | var sub = @as(*const clang.CaseStmt, @ptrCast(it[0])).getSubStmt(); | |
| 3267 | while (true) switch (sub.getStmtClass()) { | |
| 3268 | .CaseStmtClass => sub = @as(*const clang.CaseStmt, @ptrCast(sub)).getSubStmt(), | |
| 3269 | .DefaultStmtClass => sub = @as(*const clang.DefaultStmt, @ptrCast(sub)).getSubStmt(), | |
| 3270 | else => break, | |
| 3271 | }; | |
| 3272 | const result = try transStmt(c, &block.base, sub, .unused); | |
| 3273 | assert(result.tag() != .declaration); | |
| 3274 | try block.statements.append(result); | |
| 3275 | if (result.isNoreturn(true)) { | |
| 3276 | return; | |
| 3277 | } | |
| 3278 | }, | |
| 3279 | .DefaultStmtClass => { | |
| 3280 | var sub = @as(*const clang.DefaultStmt, @ptrCast(it[0])).getSubStmt(); | |
| 3281 | while (true) switch (sub.getStmtClass()) { | |
| 3282 | .CaseStmtClass => sub = @as(*const clang.CaseStmt, @ptrCast(sub)).getSubStmt(), | |
| 3283 | .DefaultStmtClass => sub = @as(*const clang.DefaultStmt, @ptrCast(sub)).getSubStmt(), | |
| 3284 | else => break, | |
| 3285 | }; | |
| 3286 | const result = try transStmt(c, &block.base, sub, .unused); | |
| 3287 | assert(result.tag() != .declaration); | |
| 3288 | try block.statements.append(result); | |
| 3289 | if (result.isNoreturn(true)) { | |
| 3290 | return; | |
| 3291 | } | |
| 3292 | }, | |
| 3293 | .CompoundStmtClass => { | |
| 3294 | const result = try transCompoundStmt(c, &block.base, @as(*const clang.CompoundStmt, @ptrCast(it[0]))); | |
| 3295 | try block.statements.append(result); | |
| 3296 | if (result.isNoreturn(true)) { | |
| 3297 | return; | |
| 3298 | } | |
| 3299 | }, | |
| 3300 | else => { | |
| 3301 | const result = try transStmt(c, &block.base, it[0], .unused); | |
| 3302 | switch (result.tag()) { | |
| 3303 | .declaration, .empty_block => {}, | |
| 3304 | else => try block.statements.append(result), | |
| 3305 | } | |
| 3306 | }, | |
| 3307 | } | |
| 3308 | } | |
| 3309 | return; | |
| 3310 | } | |
| 3311 | ||
| 3312 | fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { | |
| 3313 | var result: clang.ExprEvalResult = undefined; | |
| 3314 | if (!expr.evaluateAsConstantExpr(&result, .Normal, c.clang_context)) | |
| 3315 | return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid constant expression", .{}); | |
| 3316 | ||
| 3317 | switch (result.Val.getKind()) { | |
| 3318 | .Int => { | |
| 3319 | // See comment in `transIntegerLiteral` for why this code is here. | |
| 3320 | // @as(T, x) | |
| 3321 | const expr_base = @as(*const clang.Expr, @ptrCast(expr)); | |
| 3322 | const as_node = try Tag.as.create(c.arena, .{ | |
| 3323 | .lhs = try transQualType(c, scope, expr_base.getType(), expr_base.getBeginLoc()), | |
| 3324 | .rhs = try transCreateNodeAPInt(c, result.Val.getInt()), | |
| 3325 | }); | |
| 3326 | return maybeSuppressResult(c, used, as_node); | |
| 3327 | }, | |
| 3328 | else => |kind| { | |
| 3329 | return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "unsupported constant expression kind '{}'", .{kind}); | |
| 3330 | }, | |
| 3331 | } | |
| 3332 | } | |
| 3333 | ||
| 3334 | fn transPredefinedExpr(c: *Context, scope: *Scope, expr: *const clang.PredefinedExpr, used: ResultUsed) TransError!Node { | |
| 3335 | return transStringLiteral(c, scope, expr.getFunctionName(), used); | |
| 3336 | } | |
| 3337 | ||
| 3338 | fn transCreateCharLitNode(c: *Context, narrow: bool, val: u32) TransError!Node { | |
| 3339 | return Tag.char_literal.create(c.arena, if (narrow) | |
| 3340 | try std.fmt.allocPrint(c.arena, "'{f}'", .{std.zig.fmtChar(@intCast(val))}) | |
| 3341 | else | |
| 3342 | try std.fmt.allocPrint(c.arena, "'\\u{{{x}}}'", .{val})); | |
| 3343 | } | |
| 3344 | ||
| 3345 | fn transCharLiteral( | |
| 3346 | c: *Context, | |
| 3347 | scope: *Scope, | |
| 3348 | stmt: *const clang.CharacterLiteral, | |
| 3349 | result_used: ResultUsed, | |
| 3350 | suppress_as: SuppressCast, | |
| 3351 | ) TransError!Node { | |
| 3352 | const kind = stmt.getKind(); | |
| 3353 | const val = stmt.getValue(); | |
| 3354 | const narrow = kind == .Ascii or kind == .UTF8; | |
| 3355 | // C has a somewhat obscure feature called multi-character character constant | |
| 3356 | // e.g. 'abcd' | |
| 3357 | const int_lit_node = if (kind == .Ascii and val > 255) | |
| 3358 | try transCreateNodeNumber(c, val, .int) | |
| 3359 | else | |
| 3360 | try transCreateCharLitNode(c, narrow, val); | |
| 3361 | ||
| 3362 | if (suppress_as == .no_as) { | |
| 3363 | return maybeSuppressResult(c, result_used, int_lit_node); | |
| 3364 | } | |
| 3365 | // See comment in `transIntegerLiteral` for why this code is here. | |
| 3366 | // @as(T, x) | |
| 3367 | const expr_base = @as(*const clang.Expr, @ptrCast(stmt)); | |
| 3368 | const as_node = try Tag.as.create(c.arena, .{ | |
| 3369 | .lhs = try transQualType(c, scope, expr_base.getType(), expr_base.getBeginLoc()), | |
| 3370 | .rhs = int_lit_node, | |
| 3371 | }); | |
| 3372 | return maybeSuppressResult(c, result_used, as_node); | |
| 3373 | } | |
| 3374 | ||
| 3375 | fn transStmtExpr(c: *Context, scope: *Scope, stmt: *const clang.StmtExpr, used: ResultUsed) TransError!Node { | |
| 3376 | const comp = stmt.getSubStmt(); | |
| 3377 | if (used == .unused) { | |
| 3378 | return transCompoundStmt(c, scope, comp); | |
| 3379 | } | |
| 3380 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 3381 | defer block_scope.deinit(); | |
| 3382 | ||
| 3383 | var it = comp.body_begin(); | |
| 3384 | const end_it = comp.body_end(); | |
| 3385 | while (it != end_it - 1) : (it += 1) { | |
| 3386 | const result = try transStmt(c, &block_scope.base, it[0], .unused); | |
| 3387 | switch (result.tag()) { | |
| 3388 | .declaration, .empty_block => {}, | |
| 3389 | else => try block_scope.statements.append(result), | |
| 3390 | } | |
| 3391 | } | |
| 3392 | ||
| 3393 | const last_result = try transStmt(c, &block_scope.base, it[0], .used); | |
| 3394 | switch (last_result.tag()) { | |
| 3395 | .declaration, .empty_block => {}, | |
| 3396 | else => { | |
| 3397 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 3398 | .label = block_scope.label, | |
| 3399 | .val = last_result, | |
| 3400 | }); | |
| 3401 | try block_scope.statements.append(break_node); | |
| 3402 | }, | |
| 3403 | } | |
| 3404 | const res = try block_scope.complete(c); | |
| 3405 | return maybeSuppressResult(c, used, res); | |
| 3406 | } | |
| 3407 | ||
| 3408 | fn transMemberExpr(c: *Context, scope: *Scope, stmt: *const clang.MemberExpr, result_used: ResultUsed) TransError!Node { | |
| 3409 | var container_node = try transExpr(c, scope, stmt.getBase(), .used); | |
| 3410 | if (stmt.isArrow()) { | |
| 3411 | container_node = try Tag.deref.create(c.arena, container_node); | |
| 3412 | } | |
| 3413 | ||
| 3414 | const member_decl = stmt.getMemberDecl(); | |
| 3415 | const name = blk: { | |
| 3416 | const decl_kind = @as(*const clang.Decl, @ptrCast(member_decl)).getKind(); | |
| 3417 | // If we're referring to a anonymous struct/enum find the bogus name | |
| 3418 | // we've assigned to it during the RecordDecl translation | |
| 3419 | if (decl_kind == .Field) { | |
| 3420 | const field_decl = @as(*const clang.FieldDecl, @ptrCast(member_decl)); | |
| 3421 | if (field_decl.isAnonymousStructOrUnion()) { | |
| 3422 | const name = c.decl_table.get(@intFromPtr(field_decl.getCanonicalDecl())).?; | |
| 3423 | break :blk try c.arena.dupe(u8, name); | |
| 3424 | } | |
| 3425 | } | |
| 3426 | const decl = @as(*const clang.NamedDecl, @ptrCast(member_decl)); | |
| 3427 | break :blk try c.str(decl.getName_bytes_begin()); | |
| 3428 | }; | |
| 3429 | ||
| 3430 | var node = try Tag.field_access.create(c.arena, .{ .lhs = container_node, .field_name = name }); | |
| 3431 | if (exprIsFlexibleArrayRef(c, @as(*const clang.Expr, @ptrCast(stmt)))) { | |
| 3432 | node = try Tag.call.create(c.arena, .{ .lhs = node, .args = &.{} }); | |
| 3433 | } | |
| 3434 | return maybeSuppressResult(c, result_used, node); | |
| 3435 | } | |
| 3436 | ||
| 3437 | /// ptr[subscr] (`subscr` is a signed integer expression, `ptr` a pointer) becomes: | |
| 3438 | /// (blk: { | |
| 3439 | /// const tmp = subscr; | |
| 3440 | /// if (tmp >= 0) break :blk ptr + @intCast(usize, tmp) else break :blk ptr - ~@bitCast(usize, @intCast(isize, tmp) +% -1); | |
| 3441 | /// }).* | |
| 3442 | /// Todo: rip this out once `[*]T + isize` becomes valid. | |
| 3443 | fn transSignedArrayAccess( | |
| 3444 | c: *Context, | |
| 3445 | scope: *Scope, | |
| 3446 | container_expr: *const clang.Expr, | |
| 3447 | subscr_expr: *const clang.Expr, | |
| 3448 | result_used: ResultUsed, | |
| 3449 | ) TransError!Node { | |
| 3450 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 3451 | defer block_scope.deinit(); | |
| 3452 | ||
| 3453 | const tmp = try block_scope.makeMangledName(c, "tmp"); | |
| 3454 | ||
| 3455 | const subscr_node = try transExpr(c, &block_scope.base, subscr_expr, .used); | |
| 3456 | const subscr_decl = try Tag.var_simple.create(c.arena, .{ .name = tmp, .init = subscr_node }); | |
| 3457 | try block_scope.statements.append(subscr_decl); | |
| 3458 | ||
| 3459 | const tmp_ref = try Tag.identifier.create(c.arena, tmp); | |
| 3460 | ||
| 3461 | const container_node = try transExpr(c, &block_scope.base, container_expr, .used); | |
| 3462 | ||
| 3463 | const cond_node = try Tag.greater_than_equal.create(c.arena, .{ .lhs = tmp_ref, .rhs = Tag.zero_literal.init() }); | |
| 3464 | ||
| 3465 | const then_value = try Tag.add.create(c.arena, .{ | |
| 3466 | .lhs = container_node, | |
| 3467 | .rhs = try Tag.as.create(c.arena, .{ | |
| 3468 | .lhs = try Tag.type.create(c.arena, "usize"), | |
| 3469 | .rhs = try Tag.int_cast.create(c.arena, tmp_ref), | |
| 3470 | }), | |
| 3471 | }); | |
| 3472 | ||
| 3473 | const then_body = try Tag.break_val.create(c.arena, .{ | |
| 3474 | .label = block_scope.label, | |
| 3475 | .val = then_value, | |
| 3476 | }); | |
| 3477 | ||
| 3478 | const minuend = container_node; | |
| 3479 | const signed_size = try Tag.as.create(c.arena, .{ | |
| 3480 | .lhs = try Tag.type.create(c.arena, "isize"), | |
| 3481 | .rhs = try Tag.int_cast.create(c.arena, tmp_ref), | |
| 3482 | }); | |
| 3483 | const to_cast = try Tag.add_wrap.create(c.arena, .{ | |
| 3484 | .lhs = signed_size, | |
| 3485 | .rhs = try Tag.negate.create(c.arena, Tag.one_literal.init()), | |
| 3486 | }); | |
| 3487 | const bitcast_node = try Tag.as.create(c.arena, .{ | |
| 3488 | .lhs = try Tag.type.create(c.arena, "usize"), | |
| 3489 | .rhs = try Tag.bit_cast.create(c.arena, to_cast), | |
| 3490 | }); | |
| 3491 | const subtrahend = try Tag.bit_not.create(c.arena, bitcast_node); | |
| 3492 | const difference = try Tag.sub.create(c.arena, .{ | |
| 3493 | .lhs = minuend, | |
| 3494 | .rhs = subtrahend, | |
| 3495 | }); | |
| 3496 | const else_body = try Tag.break_val.create(c.arena, .{ | |
| 3497 | .label = block_scope.label, | |
| 3498 | .val = difference, | |
| 3499 | }); | |
| 3500 | ||
| 3501 | const if_node = try Tag.@"if".create(c.arena, .{ | |
| 3502 | .cond = cond_node, | |
| 3503 | .then = then_body, | |
| 3504 | .@"else" = else_body, | |
| 3505 | }); | |
| 3506 | ||
| 3507 | try block_scope.statements.append(if_node); | |
| 3508 | const block_node = try block_scope.complete(c); | |
| 3509 | ||
| 3510 | const derefed = try Tag.deref.create(c.arena, block_node); | |
| 3511 | ||
| 3512 | return maybeSuppressResult(c, result_used, derefed); | |
| 3513 | } | |
| 3514 | ||
| 3515 | fn transArrayAccess(c: *Context, scope: *Scope, stmt: *const clang.ArraySubscriptExpr, result_used: ResultUsed) TransError!Node { | |
| 3516 | const base_stmt = stmt.getBase(); | |
| 3517 | const base_qt = getExprQualType(c, base_stmt); | |
| 3518 | const is_vector = cIsVector(base_qt); | |
| 3519 | ||
| 3520 | const subscr_expr = stmt.getIdx(); | |
| 3521 | const subscr_qt = getExprQualType(c, subscr_expr); | |
| 3522 | const is_longlong = cIsLongLongInteger(subscr_qt); | |
| 3523 | const is_signed = cIsSignedInteger(subscr_qt); | |
| 3524 | const is_nonnegative_int_literal = cIsNonNegativeIntLiteral(c, subscr_expr); | |
| 3525 | ||
| 3526 | // Unwrap the base statement if it's an array decayed to a bare pointer type | |
| 3527 | // so that we index the array itself | |
| 3528 | var unwrapped_base = base_stmt; | |
| 3529 | if (@as(*const clang.Stmt, @ptrCast(base_stmt)).getStmtClass() == .ImplicitCastExprClass) { | |
| 3530 | const implicit_cast = @as(*const clang.ImplicitCastExpr, @ptrCast(base_stmt)); | |
| 3531 | ||
| 3532 | if (implicit_cast.getCastKind() == .ArrayToPointerDecay) { | |
| 3533 | unwrapped_base = implicit_cast.getSubExpr(); | |
| 3534 | } | |
| 3535 | } | |
| 3536 | ||
| 3537 | // Special case: actual pointer (not decayed array) and signed integer subscript | |
| 3538 | // See discussion at https://github.com/ziglang/zig/pull/8589 | |
| 3539 | if (is_signed and (base_stmt == unwrapped_base) and !is_vector and !is_nonnegative_int_literal) | |
| 3540 | return transSignedArrayAccess(c, scope, base_stmt, subscr_expr, result_used); | |
| 3541 | ||
| 3542 | const container_node = try transExpr(c, scope, unwrapped_base, .used); | |
| 3543 | const rhs = if (is_longlong or is_signed) blk: { | |
| 3544 | // check if long long first so that signed long long doesn't just become unsigned long long | |
| 3545 | const typeid_node = if (is_longlong) try Tag.type.create(c.arena, "usize") else try transQualTypeIntWidthOf(c, subscr_qt, false); | |
| 3546 | break :blk try Tag.as.create(c.arena, .{ | |
| 3547 | .lhs = typeid_node, | |
| 3548 | .rhs = try Tag.int_cast.create( | |
| 3549 | c.arena, | |
| 3550 | try transExpr(c, scope, subscr_expr, .used), | |
| 3551 | ), | |
| 3552 | }); | |
| 3553 | } else try transExpr(c, scope, subscr_expr, .used); | |
| 3554 | ||
| 3555 | const node = try Tag.array_access.create(c.arena, .{ | |
| 3556 | .lhs = container_node, | |
| 3557 | .rhs = rhs, | |
| 3558 | }); | |
| 3559 | return maybeSuppressResult(c, result_used, node); | |
| 3560 | } | |
| 3561 | ||
| 3562 | /// Check if an expression is ultimately a reference to a function declaration | |
| 3563 | /// (which means it should not be unwrapped with `.?` in translated code) | |
| 3564 | fn cIsFunctionDeclRef(expr: *const clang.Expr) bool { | |
| 3565 | switch (expr.getStmtClass()) { | |
| 3566 | .ParenExprClass => { | |
| 3567 | const op_expr = @as(*const clang.ParenExpr, @ptrCast(expr)).getSubExpr(); | |
| 3568 | return cIsFunctionDeclRef(op_expr); | |
| 3569 | }, | |
| 3570 | .DeclRefExprClass => { | |
| 3571 | const decl_ref = @as(*const clang.DeclRefExpr, @ptrCast(expr)); | |
| 3572 | const value_decl = decl_ref.getDecl(); | |
| 3573 | const qt = value_decl.getType(); | |
| 3574 | return qualTypeChildIsFnProto(qt); | |
| 3575 | }, | |
| 3576 | .ImplicitCastExprClass => { | |
| 3577 | const implicit_cast = @as(*const clang.ImplicitCastExpr, @ptrCast(expr)); | |
| 3578 | const cast_kind = implicit_cast.getCastKind(); | |
| 3579 | if (cast_kind == .BuiltinFnToFnPtr) return true; | |
| 3580 | if (cast_kind == .FunctionToPointerDecay) { | |
| 3581 | return cIsFunctionDeclRef(implicit_cast.getSubExpr()); | |
| 3582 | } | |
| 3583 | return false; | |
| 3584 | }, | |
| 3585 | .UnaryOperatorClass => { | |
| 3586 | const un_op = @as(*const clang.UnaryOperator, @ptrCast(expr)); | |
| 3587 | const opcode = un_op.getOpcode(); | |
| 3588 | return (opcode == .AddrOf or opcode == .Deref) and cIsFunctionDeclRef(un_op.getSubExpr()); | |
| 3589 | }, | |
| 3590 | .GenericSelectionExprClass => { | |
| 3591 | const gen_sel = @as(*const clang.GenericSelectionExpr, @ptrCast(expr)); | |
| 3592 | return cIsFunctionDeclRef(gen_sel.getResultExpr()); | |
| 3593 | }, | |
| 3594 | else => return false, | |
| 3595 | } | |
| 3596 | } | |
| 3597 | ||
| 3598 | fn transCallExpr(c: *Context, scope: *Scope, stmt: *const clang.CallExpr, result_used: ResultUsed) TransError!Node { | |
| 3599 | const callee = stmt.getCallee(); | |
| 3600 | const raw_fn_expr = try transExpr(c, scope, callee, .used); | |
| 3601 | ||
| 3602 | var is_ptr = false; | |
| 3603 | const fn_ty = qualTypeGetFnProto(callee.getType(), &is_ptr); | |
| 3604 | ||
| 3605 | const fn_expr = if (is_ptr and fn_ty != null and !cIsFunctionDeclRef(callee)) | |
| 3606 | try Tag.unwrap.create(c.arena, raw_fn_expr) | |
| 3607 | else | |
| 3608 | raw_fn_expr; | |
| 3609 | ||
| 3610 | const num_args = stmt.getNumArgs(); | |
| 3611 | const args = try c.arena.alloc(Node, num_args); | |
| 3612 | ||
| 3613 | const c_args = stmt.getArgs(); | |
| 3614 | var i: usize = 0; | |
| 3615 | while (i < num_args) : (i += 1) { | |
| 3616 | var arg = try transExpr(c, scope, c_args[i], .used); | |
| 3617 | ||
| 3618 | // In C the result type of a boolean expression is int. If this result is passed as | |
| 3619 | // an argument to a function whose parameter is also int, there is no cast. Therefore | |
| 3620 | // in Zig we'll need to cast it from bool to u1 (which will safely coerce to c_int). | |
| 3621 | if (fn_ty) |ty| { | |
| 3622 | switch (ty) { | |
| 3623 | .Proto => |fn_proto| { | |
| 3624 | const param_count = fn_proto.getNumParams(); | |
| 3625 | if (i < param_count) { | |
| 3626 | const param_qt = fn_proto.getParamType(@as(c_uint, @intCast(i))); | |
| 3627 | if (isBoolRes(arg) and cIsNativeInt(param_qt)) { | |
| 3628 | arg = try Tag.int_from_bool.create(c.arena, arg); | |
| 3629 | } else if (arg.tag() == .string_literal and qualTypeIsCharStar(param_qt)) { | |
| 3630 | const loc = @as(*const clang.Stmt, @ptrCast(stmt)).getBeginLoc(); | |
| 3631 | const dst_type_node = try transQualType(c, scope, param_qt, loc); | |
| 3632 | arg = try removeCVQualifiers(c, dst_type_node, arg); | |
| 3633 | } | |
| 3634 | } | |
| 3635 | }, | |
| 3636 | else => {}, | |
| 3637 | } | |
| 3638 | } | |
| 3639 | args[i] = arg; | |
| 3640 | } | |
| 3641 | const node = try Tag.call.create(c.arena, .{ .lhs = fn_expr, .args = args }); | |
| 3642 | if (fn_ty) |ty| { | |
| 3643 | const canon = ty.getReturnType().getCanonicalType(); | |
| 3644 | const ret_ty = canon.getTypePtr(); | |
| 3645 | if (ret_ty.isVoidType()) { | |
| 3646 | return node; | |
| 3647 | } | |
| 3648 | } | |
| 3649 | ||
| 3650 | return maybeSuppressResult(c, result_used, node); | |
| 3651 | } | |
| 3652 | ||
| 3653 | const ClangFunctionType = union(enum) { | |
| 3654 | Proto: *const clang.FunctionProtoType, | |
| 3655 | NoProto: *const clang.FunctionType, | |
| 3656 | ||
| 3657 | fn getReturnType(self: @This()) clang.QualType { | |
| 3658 | switch (@as(meta.Tag(@This()), self)) { | |
| 3659 | .Proto => return self.Proto.getReturnType(), | |
| 3660 | .NoProto => return self.NoProto.getReturnType(), | |
| 3661 | } | |
| 3662 | } | |
| 3663 | }; | |
| 3664 | ||
| 3665 | fn qualTypeGetFnProto(qt: clang.QualType, is_ptr: *bool) ?ClangFunctionType { | |
| 3666 | const canon = qt.getCanonicalType(); | |
| 3667 | var ty = canon.getTypePtr(); | |
| 3668 | is_ptr.* = false; | |
| 3669 | ||
| 3670 | if (ty.getTypeClass() == .Pointer) { | |
| 3671 | is_ptr.* = true; | |
| 3672 | const child_qt = ty.getPointeeType(); | |
| 3673 | ty = child_qt.getTypePtr(); | |
| 3674 | } | |
| 3675 | if (ty.getTypeClass() == .FunctionProto) { | |
| 3676 | return ClangFunctionType{ .Proto = @as(*const clang.FunctionProtoType, @ptrCast(ty)) }; | |
| 3677 | } | |
| 3678 | if (ty.getTypeClass() == .FunctionNoProto) { | |
| 3679 | return ClangFunctionType{ .NoProto = @as(*const clang.FunctionType, @ptrCast(ty)) }; | |
| 3680 | } | |
| 3681 | return null; | |
| 3682 | } | |
| 3683 | ||
| 3684 | fn transUnaryExprOrTypeTraitExpr( | |
| 3685 | c: *Context, | |
| 3686 | scope: *Scope, | |
| 3687 | stmt: *const clang.UnaryExprOrTypeTraitExpr, | |
| 3688 | result_used: ResultUsed, | |
| 3689 | ) TransError!Node { | |
| 3690 | const loc = stmt.getBeginLoc(); | |
| 3691 | const type_node = try transQualType(c, scope, stmt.getTypeOfArgument(), loc); | |
| 3692 | ||
| 3693 | const kind = stmt.getKind(); | |
| 3694 | const node = switch (kind) { | |
| 3695 | .SizeOf => try Tag.sizeof.create(c.arena, type_node), | |
| 3696 | .AlignOf => try Tag.alignof.create(c.arena, type_node), | |
| 3697 | .DataSizeOf, | |
| 3698 | .CountOf, | |
| 3699 | .PreferredAlignOf, | |
| 3700 | .PtrAuthTypeDiscriminator, | |
| 3701 | .VecStep, | |
| 3702 | .OpenMPRequiredSimdAlign, | |
| 3703 | => return fail( | |
| 3704 | c, | |
| 3705 | error.UnsupportedTranslation, | |
| 3706 | loc, | |
| 3707 | "unsupported type trait kind {}", | |
| 3708 | .{kind}, | |
| 3709 | ), | |
| 3710 | }; | |
| 3711 | return maybeSuppressResult(c, result_used, node); | |
| 3712 | } | |
| 3713 | ||
| 3714 | fn qualTypeHasWrappingOverflow(qt: clang.QualType) bool { | |
| 3715 | if (cIsUnsignedInteger(qt)) { | |
| 3716 | // unsigned integer overflow wraps around. | |
| 3717 | return true; | |
| 3718 | } else { | |
| 3719 | // float, signed integer, and pointer overflow is undefined behavior. | |
| 3720 | return false; | |
| 3721 | } | |
| 3722 | } | |
| 3723 | ||
| 3724 | fn transUnaryOperator(c: *Context, scope: *Scope, stmt: *const clang.UnaryOperator, used: ResultUsed) TransError!Node { | |
| 3725 | const op_expr = stmt.getSubExpr(); | |
| 3726 | switch (stmt.getOpcode()) { | |
| 3727 | .PostInc => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3728 | return transCreatePostCrement(c, scope, stmt, .add_wrap_assign, used) | |
| 3729 | else | |
| 3730 | return transCreatePostCrement(c, scope, stmt, .add_assign, used), | |
| 3731 | .PostDec => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3732 | return transCreatePostCrement(c, scope, stmt, .sub_wrap_assign, used) | |
| 3733 | else | |
| 3734 | return transCreatePostCrement(c, scope, stmt, .sub_assign, used), | |
| 3735 | .PreInc => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3736 | return transCreatePreCrement(c, scope, stmt, .add_wrap_assign, used) | |
| 3737 | else | |
| 3738 | return transCreatePreCrement(c, scope, stmt, .add_assign, used), | |
| 3739 | .PreDec => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3740 | return transCreatePreCrement(c, scope, stmt, .sub_wrap_assign, used) | |
| 3741 | else | |
| 3742 | return transCreatePreCrement(c, scope, stmt, .sub_assign, used), | |
| 3743 | .AddrOf => { | |
| 3744 | return Tag.address_of.create(c.arena, try transExpr(c, scope, op_expr, used)); | |
| 3745 | }, | |
| 3746 | .Deref => { | |
| 3747 | if (qualTypeWasDemotedToOpaque(c, stmt.getType())) | |
| 3748 | return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "cannot dereference opaque type", .{}); | |
| 3749 | ||
| 3750 | const node = try transExpr(c, scope, op_expr, used); | |
| 3751 | var is_ptr = false; | |
| 3752 | const fn_ty = qualTypeGetFnProto(op_expr.getType(), &is_ptr); | |
| 3753 | if (fn_ty != null and is_ptr) | |
| 3754 | return node; | |
| 3755 | return Tag.deref.create(c.arena, node); | |
| 3756 | }, | |
| 3757 | .Plus => return transExpr(c, scope, op_expr, used), | |
| 3758 | .Minus => { | |
| 3759 | if (!qualTypeHasWrappingOverflow(op_expr.getType())) { | |
| 3760 | const sub_expr_node = try transExpr(c, scope, op_expr, .used); | |
| 3761 | const to_negate = if (isBoolRes(sub_expr_node)) blk: { | |
| 3762 | const ty_node = try Tag.type.create(c.arena, "c_int"); | |
| 3763 | const int_node = try Tag.int_from_bool.create(c.arena, sub_expr_node); | |
| 3764 | break :blk try Tag.as.create(c.arena, .{ .lhs = ty_node, .rhs = int_node }); | |
| 3765 | } else sub_expr_node; | |
| 3766 | return Tag.negate.create(c.arena, to_negate); | |
| 3767 | } else if (cIsUnsignedInteger(op_expr.getType())) { | |
| 3768 | // use -% x for unsigned integers | |
| 3769 | return Tag.negate_wrap.create(c.arena, try transExpr(c, scope, op_expr, .used)); | |
| 3770 | } else return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "C negation with non float non integer", .{}); | |
| 3771 | }, | |
| 3772 | .Not => { | |
| 3773 | return Tag.bit_not.create(c.arena, try transExpr(c, scope, op_expr, .used)); | |
| 3774 | }, | |
| 3775 | .LNot => { | |
| 3776 | return Tag.not.create(c.arena, try transBoolExpr(c, scope, op_expr, .used)); | |
| 3777 | }, | |
| 3778 | .Extension => { | |
| 3779 | return transExpr(c, scope, stmt.getSubExpr(), used); | |
| 3780 | }, | |
| 3781 | else => return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "unsupported C translation {}", .{stmt.getOpcode()}), | |
| 3782 | } | |
| 3783 | } | |
| 3784 | ||
| 3785 | fn transCreatePreCrement( | |
| 3786 | c: *Context, | |
| 3787 | scope: *Scope, | |
| 3788 | stmt: *const clang.UnaryOperator, | |
| 3789 | op: Tag, | |
| 3790 | used: ResultUsed, | |
| 3791 | ) TransError!Node { | |
| 3792 | const op_expr = stmt.getSubExpr(); | |
| 3793 | ||
| 3794 | if (used == .unused) { | |
| 3795 | // common case | |
| 3796 | // c: ++expr | |
| 3797 | // zig: expr += 1 | |
| 3798 | const lhs = try transExpr(c, scope, op_expr, .used); | |
| 3799 | const rhs = Tag.one_literal.init(); | |
| 3800 | return transCreateNodeInfixOp(c, op, lhs, rhs, .used); | |
| 3801 | } | |
| 3802 | // worst case | |
| 3803 | // c: ++expr | |
| 3804 | // zig: (blk: { | |
| 3805 | // zig: const _ref = &expr; | |
| 3806 | // zig: _ref.* += 1; | |
| 3807 | // zig: break :blk _ref.* | |
| 3808 | // zig: }) | |
| 3809 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 3810 | defer block_scope.deinit(); | |
| 3811 | ||
| 3812 | const ref = try block_scope.reserveMangledName(c, "ref"); | |
| 3813 | const expr = try transExpr(c, &block_scope.base, op_expr, .used); | |
| 3814 | const addr_of = try Tag.address_of.create(c.arena, expr); | |
| 3815 | const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = ref, .init = addr_of }); | |
| 3816 | try block_scope.statements.append(ref_decl); | |
| 3817 | ||
| 3818 | const lhs_node = try Tag.identifier.create(c.arena, ref); | |
| 3819 | const ref_node = try Tag.deref.create(c.arena, lhs_node); | |
| 3820 | const node = try transCreateNodeInfixOp(c, op, ref_node, Tag.one_literal.init(), .used); | |
| 3821 | try block_scope.statements.append(node); | |
| 3822 | ||
| 3823 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 3824 | .label = block_scope.label, | |
| 3825 | .val = ref_node, | |
| 3826 | }); | |
| 3827 | try block_scope.statements.append(break_node); | |
| 3828 | return block_scope.complete(c); | |
| 3829 | } | |
| 3830 | ||
| 3831 | fn transCreatePostCrement( | |
| 3832 | c: *Context, | |
| 3833 | scope: *Scope, | |
| 3834 | stmt: *const clang.UnaryOperator, | |
| 3835 | op: Tag, | |
| 3836 | used: ResultUsed, | |
| 3837 | ) TransError!Node { | |
| 3838 | const op_expr = stmt.getSubExpr(); | |
| 3839 | ||
| 3840 | if (used == .unused) { | |
| 3841 | // common case | |
| 3842 | // c: expr++ | |
| 3843 | // zig: expr += 1 | |
| 3844 | const lhs = try transExpr(c, scope, op_expr, .used); | |
| 3845 | const rhs = Tag.one_literal.init(); | |
| 3846 | return transCreateNodeInfixOp(c, op, lhs, rhs, .used); | |
| 3847 | } | |
| 3848 | // worst case | |
| 3849 | // c: expr++ | |
| 3850 | // zig: (blk: { | |
| 3851 | // zig: const _ref = &expr; | |
| 3852 | // zig: const _tmp = _ref.*; | |
| 3853 | // zig: _ref.* += 1; | |
| 3854 | // zig: break :blk _tmp | |
| 3855 | // zig: }) | |
| 3856 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 3857 | defer block_scope.deinit(); | |
| 3858 | const ref = try block_scope.reserveMangledName(c, "ref"); | |
| 3859 | const tmp = try block_scope.reserveMangledName(c, "tmp"); | |
| 3860 | ||
| 3861 | const expr = try transExpr(c, &block_scope.base, op_expr, .used); | |
| 3862 | const addr_of = try Tag.address_of.create(c.arena, expr); | |
| 3863 | const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = ref, .init = addr_of }); | |
| 3864 | try block_scope.statements.append(ref_decl); | |
| 3865 | ||
| 3866 | const lhs_node = try Tag.identifier.create(c.arena, ref); | |
| 3867 | const ref_node = try Tag.deref.create(c.arena, lhs_node); | |
| 3868 | ||
| 3869 | const tmp_decl = try Tag.var_simple.create(c.arena, .{ .name = tmp, .init = ref_node }); | |
| 3870 | try block_scope.statements.append(tmp_decl); | |
| 3871 | ||
| 3872 | const node = try transCreateNodeInfixOp(c, op, ref_node, Tag.one_literal.init(), .used); | |
| 3873 | try block_scope.statements.append(node); | |
| 3874 | ||
| 3875 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 3876 | .label = block_scope.label, | |
| 3877 | .val = try Tag.identifier.create(c.arena, tmp), | |
| 3878 | }); | |
| 3879 | try block_scope.statements.append(break_node); | |
| 3880 | return block_scope.complete(c); | |
| 3881 | } | |
| 3882 | ||
| 3883 | fn transCompoundAssignOperator(c: *Context, scope: *Scope, stmt: *const clang.CompoundAssignOperator, used: ResultUsed) TransError!Node { | |
| 3884 | switch (stmt.getOpcode()) { | |
| 3885 | .MulAssign => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3886 | return transCreateCompoundAssign(c, scope, stmt, .mul_wrap_assign, used) | |
| 3887 | else | |
| 3888 | return transCreateCompoundAssign(c, scope, stmt, .mul_assign, used), | |
| 3889 | .AddAssign => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3890 | return transCreateCompoundAssign(c, scope, stmt, .add_wrap_assign, used) | |
| 3891 | else | |
| 3892 | return transCreateCompoundAssign(c, scope, stmt, .add_assign, used), | |
| 3893 | .SubAssign => if (qualTypeHasWrappingOverflow(stmt.getType())) | |
| 3894 | return transCreateCompoundAssign(c, scope, stmt, .sub_wrap_assign, used) | |
| 3895 | else | |
| 3896 | return transCreateCompoundAssign(c, scope, stmt, .sub_assign, used), | |
| 3897 | .DivAssign => return transCreateCompoundAssign(c, scope, stmt, .div_assign, used), | |
| 3898 | .RemAssign => return transCreateCompoundAssign(c, scope, stmt, .mod_assign, used), | |
| 3899 | .ShlAssign => return transCreateCompoundAssign(c, scope, stmt, .shl_assign, used), | |
| 3900 | .ShrAssign => return transCreateCompoundAssign(c, scope, stmt, .shr_assign, used), | |
| 3901 | .AndAssign => return transCreateCompoundAssign(c, scope, stmt, .bit_and_assign, used), | |
| 3902 | .XorAssign => return transCreateCompoundAssign(c, scope, stmt, .bit_xor_assign, used), | |
| 3903 | .OrAssign => return transCreateCompoundAssign(c, scope, stmt, .bit_or_assign, used), | |
| 3904 | else => return fail( | |
| 3905 | c, | |
| 3906 | error.UnsupportedTranslation, | |
| 3907 | stmt.getBeginLoc(), | |
| 3908 | "unsupported C translation {}", | |
| 3909 | .{stmt.getOpcode()}, | |
| 3910 | ), | |
| 3911 | } | |
| 3912 | } | |
| 3913 | ||
| 3914 | fn transCreateCompoundAssign( | |
| 3915 | c: *Context, | |
| 3916 | scope: *Scope, | |
| 3917 | stmt: *const clang.CompoundAssignOperator, | |
| 3918 | op: Tag, | |
| 3919 | used: ResultUsed, | |
| 3920 | ) TransError!Node { | |
| 3921 | const is_shift = op == .shl_assign or op == .shr_assign; | |
| 3922 | const is_div = op == .div_assign; | |
| 3923 | const is_mod = op == .mod_assign; | |
| 3924 | const lhs = stmt.getLHS(); | |
| 3925 | const rhs = stmt.getRHS(); | |
| 3926 | const loc = stmt.getBeginLoc(); | |
| 3927 | const lhs_qt = getExprQualType(c, lhs); | |
| 3928 | const rhs_qt = getExprQualType(c, rhs); | |
| 3929 | const is_signed = cIsSignedInteger(lhs_qt); | |
| 3930 | const is_ptr_arithmetic = qualTypeIsPtr(lhs_qt) and cIsInteger(rhs_qt); | |
| 3931 | const is_ptr_op_signed = qualTypeIsPtr(lhs_qt) and cIsSignedInteger(rhs_qt); | |
| 3932 | const requires_cast = !lhs_qt.eq(rhs_qt) and !is_ptr_arithmetic; | |
| 3933 | ||
| 3934 | if (used == .unused) { | |
| 3935 | // common case | |
| 3936 | // c: lhs += rhs | |
| 3937 | // zig: lhs += rhs | |
| 3938 | const lhs_node = try transExpr(c, scope, lhs, .used); | |
| 3939 | var rhs_node = try transExpr(c, scope, rhs, .used); | |
| 3940 | if (is_ptr_op_signed) rhs_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node); | |
| 3941 | ||
| 3942 | if ((is_mod or is_div) and is_signed) { | |
| 3943 | if (requires_cast) rhs_node = try transCCast(c, scope, loc, lhs_qt, rhs_qt, rhs_node); | |
| 3944 | const operands: @FieldType(ast.Payload.BinOp, "data") = .{ .lhs = lhs_node, .rhs = rhs_node }; | |
| 3945 | const builtin = if (is_mod) | |
| 3946 | try Tag.signed_remainder.create(c.arena, operands) | |
| 3947 | else | |
| 3948 | try Tag.div_trunc.create(c.arena, operands); | |
| 3949 | ||
| 3950 | return transCreateNodeInfixOp(c, .assign, lhs_node, builtin, .used); | |
| 3951 | } | |
| 3952 | ||
| 3953 | if (is_shift) { | |
| 3954 | rhs_node = try Tag.int_cast.create(c.arena, rhs_node); | |
| 3955 | } else if (requires_cast) { | |
| 3956 | rhs_node = try transCCast(c, scope, loc, lhs_qt, rhs_qt, rhs_node); | |
| 3957 | } | |
| 3958 | return transCreateNodeInfixOp(c, op, lhs_node, rhs_node, .used); | |
| 3959 | } | |
| 3960 | // worst case | |
| 3961 | // c: lhs += rhs | |
| 3962 | // zig: (blk: { | |
| 3963 | // zig: const _ref = &lhs; | |
| 3964 | // zig: _ref.* += rhs; | |
| 3965 | // zig: break :blk _ref.* | |
| 3966 | // zig: }) | |
| 3967 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 3968 | defer block_scope.deinit(); | |
| 3969 | const ref = try block_scope.reserveMangledName(c, "ref"); | |
| 3970 | ||
| 3971 | const expr = try transExpr(c, &block_scope.base, lhs, .used); | |
| 3972 | const addr_of = try Tag.address_of.create(c.arena, expr); | |
| 3973 | const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = ref, .init = addr_of }); | |
| 3974 | try block_scope.statements.append(ref_decl); | |
| 3975 | ||
| 3976 | const lhs_node = try Tag.identifier.create(c.arena, ref); | |
| 3977 | const ref_node = try Tag.deref.create(c.arena, lhs_node); | |
| 3978 | ||
| 3979 | var rhs_node = try transExpr(c, &block_scope.base, rhs, .used); | |
| 3980 | if (is_ptr_op_signed) rhs_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node); | |
| 3981 | if ((is_mod or is_div) and is_signed) { | |
| 3982 | if (requires_cast) rhs_node = try transCCast(c, scope, loc, lhs_qt, rhs_qt, rhs_node); | |
| 3983 | const operands: @FieldType(ast.Payload.BinOp, "data") = .{ .lhs = ref_node, .rhs = rhs_node }; | |
| 3984 | const builtin = if (is_mod) | |
| 3985 | try Tag.signed_remainder.create(c.arena, operands) | |
| 3986 | else | |
| 3987 | try Tag.div_trunc.create(c.arena, operands); | |
| 3988 | ||
| 3989 | const assign = try transCreateNodeInfixOp(c, .assign, ref_node, builtin, .used); | |
| 3990 | try block_scope.statements.append(assign); | |
| 3991 | } else { | |
| 3992 | if (is_shift) { | |
| 3993 | rhs_node = try Tag.int_cast.create(c.arena, rhs_node); | |
| 3994 | } else if (requires_cast) { | |
| 3995 | rhs_node = try transCCast(c, &block_scope.base, loc, lhs_qt, rhs_qt, rhs_node); | |
| 3996 | } | |
| 3997 | ||
| 3998 | const assign = try transCreateNodeInfixOp(c, op, ref_node, rhs_node, .used); | |
| 3999 | try block_scope.statements.append(assign); | |
| 4000 | } | |
| 4001 | ||
| 4002 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 4003 | .label = block_scope.label, | |
| 4004 | .val = ref_node, | |
| 4005 | }); | |
| 4006 | try block_scope.statements.append(break_node); | |
| 4007 | return block_scope.complete(c); | |
| 4008 | } | |
| 4009 | ||
| 4010 | fn removeCVQualifiers(c: *Context, dst_type_node: Node, expr: Node) Error!Node { | |
| 4011 | const volatile_casted = try Tag.volatile_cast.create(c.arena, expr); | |
| 4012 | const const_casted = try Tag.const_cast.create(c.arena, volatile_casted); | |
| 4013 | return Tag.as.create(c.arena, .{ | |
| 4014 | .lhs = dst_type_node, | |
| 4015 | .rhs = try Tag.ptr_cast.create(c.arena, const_casted), | |
| 4016 | }); | |
| 4017 | } | |
| 4018 | ||
| 4019 | fn transCPtrCast( | |
| 4020 | c: *Context, | |
| 4021 | scope: *Scope, | |
| 4022 | loc: clang.SourceLocation, | |
| 4023 | dst_type: clang.QualType, | |
| 4024 | src_type: clang.QualType, | |
| 4025 | expr: Node, | |
| 4026 | ) !Node { | |
| 4027 | const ty = dst_type.getTypePtr(); | |
| 4028 | const child_type = ty.getPointeeType(); | |
| 4029 | const src_ty = src_type.getTypePtr(); | |
| 4030 | const src_child_type = src_ty.getPointeeType(); | |
| 4031 | const dst_type_node = try transType(c, scope, ty, loc); | |
| 4032 | ||
| 4033 | if (!src_ty.isArrayType() and ((src_child_type.isConstQualified() and | |
| 4034 | !child_type.isConstQualified()) or | |
| 4035 | (src_child_type.isVolatileQualified() and | |
| 4036 | !child_type.isVolatileQualified()))) | |
| 4037 | { | |
| 4038 | return removeCVQualifiers(c, dst_type_node, expr); | |
| 4039 | } else { | |
| 4040 | // Implicit downcasting from higher to lower alignment values is forbidden, | |
| 4041 | // use @alignCast to side-step this problem | |
| 4042 | const rhs = if (qualTypeCanon(child_type).isVoidType()) | |
| 4043 | // void has 1-byte alignment, so @alignCast is not needed | |
| 4044 | expr | |
| 4045 | else if (typeIsOpaque(c, qualTypeCanon(child_type), loc)) | |
| 4046 | // For opaque types a ptrCast is enough | |
| 4047 | expr | |
| 4048 | else blk: { | |
| 4049 | break :blk try Tag.align_cast.create(c.arena, expr); | |
| 4050 | }; | |
| 4051 | return Tag.as.create(c.arena, .{ | |
| 4052 | .lhs = dst_type_node, | |
| 4053 | .rhs = try Tag.ptr_cast.create(c.arena, rhs), | |
| 4054 | }); | |
| 4055 | } | |
| 4056 | } | |
| 4057 | ||
| 4058 | fn transFloatingLiteral(c: *Context, expr: *const clang.FloatingLiteral, used: ResultUsed) TransError!Node { | |
| 4059 | // TODO use something more accurate than widening to a larger float type and printing that result | |
| 4060 | switch (expr.getRawSemantics()) { | |
| 4061 | .IEEEhalf, // f16 | |
| 4062 | .IEEEsingle, // f32 | |
| 4063 | .IEEEdouble, // f64 | |
| 4064 | => { | |
| 4065 | var dbl = expr.getValueAsApproximateDouble(); | |
| 4066 | const is_negative = dbl < 0; // -0.0 is considered non-negative | |
| 4067 | if (is_negative) dbl = -dbl; | |
| 4068 | const str = if (dbl == @floor(dbl)) | |
| 4069 | try std.fmt.allocPrint(c.arena, "{d}.0", .{dbl}) | |
| 4070 | else | |
| 4071 | try std.fmt.allocPrint(c.arena, "{d}", .{dbl}); | |
| 4072 | var node = try Tag.float_literal.create(c.arena, str); | |
| 4073 | if (is_negative) node = try Tag.negate.create(c.arena, node); | |
| 4074 | return maybeSuppressResult(c, used, node); | |
| 4075 | }, | |
| 4076 | .x87DoubleExtended, // f80 | |
| 4077 | .IEEEquad, // f128 | |
| 4078 | => return transFloatingLiteralQuad(c, expr, used), | |
| 4079 | else => |format| return fail( | |
| 4080 | c, | |
| 4081 | error.UnsupportedTranslation, | |
| 4082 | expr.getBeginLoc(), | |
| 4083 | "unsupported floating point constant format {}", | |
| 4084 | .{format}, | |
| 4085 | ), | |
| 4086 | } | |
| 4087 | } | |
| 4088 | ||
| 4089 | fn transFloatingLiteralQuad(c: *Context, expr: *const clang.FloatingLiteral, used: ResultUsed) TransError!Node { | |
| 4090 | assert(switch (expr.getRawSemantics()) { | |
| 4091 | .x87DoubleExtended, .IEEEquad => true, | |
| 4092 | else => false, | |
| 4093 | }); | |
| 4094 | ||
| 4095 | var low: u64 = undefined; | |
| 4096 | var high: u64 = undefined; | |
| 4097 | expr.getValueAsApproximateQuadBits(&low, &high); | |
| 4098 | var quad: f128 = @bitCast(low | @as(u128, high) << 64); | |
| 4099 | const is_negative = quad < 0; // -0.0 is considered non-negative | |
| 4100 | if (is_negative) quad = -quad; | |
| 4101 | ||
| 4102 | // TODO implement decimal format for f128 <https://github.com/ziglang/zig/issues/1181> | |
| 4103 | // in the meantime, if the value can be roundtripped by casting it to f64, serializing it to | |
| 4104 | // the decimal format and parsing it back as the exact same f128 value, then use that serialized form | |
| 4105 | const str = fmt_decimal: { | |
| 4106 | var buf: [512]u8 = undefined; // should be large enough to print any f64 in decimal form | |
| 4107 | const dbl: f64 = @floatCast(quad); | |
| 4108 | const temp_str = if (dbl == @floor(dbl)) | |
| 4109 | std.fmt.bufPrint(&buf, "{d}.0", .{dbl}) catch |err| switch (err) { | |
| 4110 | error.NoSpaceLeft => unreachable, | |
| 4111 | } | |
| 4112 | else | |
| 4113 | std.fmt.bufPrint(&buf, "{d}", .{dbl}) catch |err| switch (err) { | |
| 4114 | error.NoSpaceLeft => unreachable, | |
| 4115 | }; | |
| 4116 | const could_roundtrip = if (std.fmt.parseFloat(f128, temp_str)) |parsed_quad| | |
| 4117 | quad == parsed_quad | |
| 4118 | else |_| | |
| 4119 | false; | |
| 4120 | break :fmt_decimal if (could_roundtrip) try c.arena.dupe(u8, temp_str) else null; | |
| 4121 | } | |
| 4122 | // otherwise, fall back to the hexadecimal format | |
| 4123 | orelse try std.fmt.allocPrint(c.arena, "{x}", .{quad}); | |
| 4124 | ||
| 4125 | var node = try Tag.float_literal.create(c.arena, str); | |
| 4126 | if (is_negative) node = try Tag.negate.create(c.arena, node); | |
| 4127 | return maybeSuppressResult(c, used, node); | |
| 4128 | } | |
| 4129 | ||
| 4130 | fn transBinaryConditionalOperator(c: *Context, scope: *Scope, stmt: *const clang.BinaryConditionalOperator, used: ResultUsed) TransError!Node { | |
| 4131 | // GNU extension of the ternary operator where the middle expression is | |
| 4132 | // omitted, the condition itself is returned if it evaluates to true | |
| 4133 | const qt = @as(*const clang.Expr, @ptrCast(stmt)).getType(); | |
| 4134 | const res_is_bool = qualTypeIsBoolean(qt); | |
| 4135 | const casted_stmt = @as(*const clang.AbstractConditionalOperator, @ptrCast(stmt)); | |
| 4136 | const cond_expr = casted_stmt.getCond(); | |
| 4137 | const false_expr = casted_stmt.getFalseExpr(); | |
| 4138 | ||
| 4139 | // c: (cond_expr)?:(false_expr) | |
| 4140 | // zig: (blk: { | |
| 4141 | // const _cond_temp = (cond_expr); | |
| 4142 | // break :blk if (_cond_temp) _cond_temp else (false_expr); | |
| 4143 | // }) | |
| 4144 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 4145 | defer block_scope.deinit(); | |
| 4146 | ||
| 4147 | const cond_temp = try block_scope.reserveMangledName(c, "cond_temp"); | |
| 4148 | const init_node = try transExpr(c, &block_scope.base, cond_expr, .used); | |
| 4149 | const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = cond_temp, .init = init_node }); | |
| 4150 | try block_scope.statements.append(ref_decl); | |
| 4151 | ||
| 4152 | var cond_scope = Scope.Condition{ | |
| 4153 | .base = .{ | |
| 4154 | .parent = &block_scope.base, | |
| 4155 | .id = .condition, | |
| 4156 | }, | |
| 4157 | }; | |
| 4158 | defer cond_scope.deinit(); | |
| 4159 | ||
| 4160 | const cond_ident = try Tag.identifier.create(c.arena, cond_temp); | |
| 4161 | const ty = getExprQualType(c, cond_expr).getTypePtr(); | |
| 4162 | const cond_node = try finishBoolExpr(c, &cond_scope.base, cond_expr.getBeginLoc(), ty, cond_ident, .used); | |
| 4163 | var then_body = cond_ident; | |
| 4164 | if (!res_is_bool and isBoolRes(init_node)) { | |
| 4165 | then_body = try Tag.int_from_bool.create(c.arena, then_body); | |
| 4166 | } | |
| 4167 | ||
| 4168 | var else_body = try transExpr(c, &block_scope.base, false_expr, .used); | |
| 4169 | if (!res_is_bool and isBoolRes(else_body)) { | |
| 4170 | else_body = try Tag.int_from_bool.create(c.arena, else_body); | |
| 4171 | } | |
| 4172 | const if_node = try Tag.@"if".create(c.arena, .{ | |
| 4173 | .cond = cond_node, | |
| 4174 | .then = then_body, | |
| 4175 | .@"else" = else_body, | |
| 4176 | }); | |
| 4177 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 4178 | .label = block_scope.label, | |
| 4179 | .val = if_node, | |
| 4180 | }); | |
| 4181 | try block_scope.statements.append(break_node); | |
| 4182 | const res = try block_scope.complete(c); | |
| 4183 | return maybeSuppressResult(c, used, res); | |
| 4184 | } | |
| 4185 | ||
| 4186 | fn transConditionalOperator(c: *Context, scope: *Scope, stmt: *const clang.ConditionalOperator, used: ResultUsed) TransError!Node { | |
| 4187 | var cond_scope = Scope.Condition{ | |
| 4188 | .base = .{ | |
| 4189 | .parent = scope, | |
| 4190 | .id = .condition, | |
| 4191 | }, | |
| 4192 | }; | |
| 4193 | defer cond_scope.deinit(); | |
| 4194 | ||
| 4195 | const qt = @as(*const clang.Expr, @ptrCast(stmt)).getType(); | |
| 4196 | const res_is_bool = qualTypeIsBoolean(qt); | |
| 4197 | const casted_stmt = @as(*const clang.AbstractConditionalOperator, @ptrCast(stmt)); | |
| 4198 | const cond_expr = casted_stmt.getCond(); | |
| 4199 | const true_expr = casted_stmt.getTrueExpr(); | |
| 4200 | const false_expr = casted_stmt.getFalseExpr(); | |
| 4201 | ||
| 4202 | const cond = try transBoolExpr(c, &cond_scope.base, cond_expr, .used); | |
| 4203 | ||
| 4204 | var then_body = try transExpr(c, scope, true_expr, used); | |
| 4205 | if (!res_is_bool and isBoolRes(then_body)) { | |
| 4206 | then_body = try Tag.int_from_bool.create(c.arena, then_body); | |
| 4207 | } | |
| 4208 | ||
| 4209 | var else_body = try transExpr(c, scope, false_expr, used); | |
| 4210 | if (!res_is_bool and isBoolRes(else_body)) { | |
| 4211 | else_body = try Tag.int_from_bool.create(c.arena, else_body); | |
| 4212 | } | |
| 4213 | ||
| 4214 | const if_node = try Tag.@"if".create(c.arena, .{ | |
| 4215 | .cond = cond, | |
| 4216 | .then = then_body, | |
| 4217 | .@"else" = else_body, | |
| 4218 | }); | |
| 4219 | // Clang inserts ImplicitCast(ToVoid)'s to both rhs and lhs so we don't need to suppress the result here. | |
| 4220 | return if_node; | |
| 4221 | } | |
| 4222 | ||
| 4223 | fn maybeSuppressResult(c: *Context, used: ResultUsed, result: Node) TransError!Node { | |
| 4224 | if (used == .used) return result; | |
| 4225 | return Tag.discard.create(c.arena, .{ .should_skip = false, .value = result }); | |
| 4226 | } | |
| 4227 | ||
| 4228 | fn addTopLevelDecl(c: *Context, name: []const u8, decl_node: Node) !void { | |
| 4229 | const gop = try c.global_scope.sym_table.getOrPut(name); | |
| 4230 | if (!gop.found_existing) { | |
| 4231 | gop.value_ptr.* = decl_node; | |
| 4232 | try c.global_scope.nodes.append(decl_node); | |
| 4233 | } | |
| 4234 | } | |
| 4235 | ||
| 4236 | /// Add an "extern" function prototype declaration that's been declared within a scoped block. | |
| 4237 | /// Similar to static local variables, this will be wrapped in a struct to work with Zig's syntax requirements. | |
| 4238 | /// | |
| 4239 | fn addLocalExternFnDecl(c: *Context, scope: *Scope, name: []const u8, decl_node: Node) !void { | |
| 4240 | const bs: *Scope.Block = try scope.findBlockScope(c); | |
| 4241 | ||
| 4242 | // Special naming convention for local extern function wrapper struct, | |
| 4243 | // this named "ExternLocal_[name]". | |
| 4244 | const struct_name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ Scope.Block.extern_inner_prepend, name }); | |
| 4245 | ||
| 4246 | // Outer Node for the wrapper struct | |
| 4247 | const node = try Tag.extern_local_fn.create(c.arena, .{ .name = struct_name, .init = decl_node }); | |
| 4248 | ||
| 4249 | try bs.statements.append(node); | |
| 4250 | try bs.discardVariable(c, struct_name); | |
| 4251 | } | |
| 4252 | ||
| 4253 | fn transQualTypeInitializedStringLiteral(c: *Context, elem_ty: Node, string_lit: *const clang.StringLiteral) TypeError!Node { | |
| 4254 | const string_lit_size = string_lit.getLength(); | |
| 4255 | const array_size = @as(usize, @intCast(string_lit_size)); | |
| 4256 | ||
| 4257 | // incomplete array initialized with empty string, will be translated as [1]T{0} | |
| 4258 | // see https://github.com/ziglang/zig/issues/8256 | |
| 4259 | if (array_size == 0) return Tag.array_type.create(c.arena, .{ .len = 1, .elem_type = elem_ty }); | |
| 4260 | ||
| 4261 | return Tag.null_sentinel_array_type.create(c.arena, .{ .len = array_size, .elem_type = elem_ty }); | |
| 4262 | } | |
| 4263 | ||
| 4264 | /// Translate a qualtype for a variable with an initializer. This only matters | |
| 4265 | /// for incomplete arrays, since the initializer determines the size of the array. | |
| 4266 | fn transQualTypeInitialized( | |
| 4267 | c: *Context, | |
| 4268 | scope: *Scope, | |
| 4269 | qt: clang.QualType, | |
| 4270 | decl_init: *const clang.Expr, | |
| 4271 | source_loc: clang.SourceLocation, | |
| 4272 | ) TypeError!Node { | |
| 4273 | const ty = qt.getTypePtr(); | |
| 4274 | if (ty.getTypeClass() == .IncompleteArray) { | |
| 4275 | const incomplete_array_ty = @as(*const clang.IncompleteArrayType, @ptrCast(ty)); | |
| 4276 | const elem_ty = try transType(c, scope, incomplete_array_ty.getElementType().getTypePtr(), source_loc); | |
| 4277 | ||
| 4278 | switch (decl_init.getStmtClass()) { | |
| 4279 | .StringLiteralClass => { | |
| 4280 | const string_lit = @as(*const clang.StringLiteral, @ptrCast(decl_init)); | |
| 4281 | return transQualTypeInitializedStringLiteral(c, elem_ty, string_lit); | |
| 4282 | }, | |
| 4283 | .InitListExprClass => { | |
| 4284 | const init_expr = @as(*const clang.InitListExpr, @ptrCast(decl_init)); | |
| 4285 | const size = init_expr.getNumInits(); | |
| 4286 | ||
| 4287 | if (init_expr.isStringLiteralInit()) { | |
| 4288 | assert(size == 1); | |
| 4289 | const string_lit = init_expr.getInit(0).castToStringLiteral().?; | |
| 4290 | return transQualTypeInitializedStringLiteral(c, elem_ty, string_lit); | |
| 4291 | } | |
| 4292 | ||
| 4293 | return Tag.array_type.create(c.arena, .{ .len = size, .elem_type = elem_ty }); | |
| 4294 | }, | |
| 4295 | else => {}, | |
| 4296 | } | |
| 4297 | } | |
| 4298 | return transQualType(c, scope, qt, source_loc); | |
| 4299 | } | |
| 4300 | ||
| 4301 | fn transQualType(c: *Context, scope: *Scope, qt: clang.QualType, source_loc: clang.SourceLocation) TypeError!Node { | |
| 4302 | return transType(c, scope, qt.getTypePtr(), source_loc); | |
| 4303 | } | |
| 4304 | ||
| 4305 | /// Produces a Zig AST node by translating a Clang QualType, respecting the width, but modifying the signed-ness. | |
| 4306 | /// Asserts the type is an integer. | |
| 4307 | fn transQualTypeIntWidthOf(c: *Context, ty: clang.QualType, is_signed: bool) TypeError!Node { | |
| 4308 | return transTypeIntWidthOf(c, qualTypeCanon(ty), is_signed); | |
| 4309 | } | |
| 4310 | ||
| 4311 | /// Produces a Zig AST node by translating a Clang Type, respecting the width, but modifying the signed-ness. | |
| 4312 | /// Asserts the type is an integer. | |
| 4313 | fn transTypeIntWidthOf(c: *Context, ty: *const clang.Type, is_signed: bool) TypeError!Node { | |
| 4314 | assert(ty.getTypeClass() == .Builtin); | |
| 4315 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 4316 | return Tag.type.create(c.arena, switch (builtin_ty.getKind()) { | |
| 4317 | .Char_U, .Char_S, .UChar, .SChar, .Char8 => if (is_signed) "i8" else "u8", | |
| 4318 | .UShort, .Short => if (is_signed) "c_short" else "c_ushort", | |
| 4319 | .UInt, .Int => if (is_signed) "c_int" else "c_uint", | |
| 4320 | .ULong, .Long => if (is_signed) "c_long" else "c_ulong", | |
| 4321 | .ULongLong, .LongLong => if (is_signed) "c_longlong" else "c_ulonglong", | |
| 4322 | .UInt128, .Int128 => if (is_signed) "i128" else "u128", | |
| 4323 | .Char16 => if (is_signed) "i16" else "u16", | |
| 4324 | .Char32 => if (is_signed) "i32" else "u32", | |
| 4325 | else => unreachable, // only call this function when it has already been determined the type is int | |
| 4326 | }); | |
| 4327 | } | |
| 4328 | ||
| 4329 | fn isCBuiltinType(qt: clang.QualType, kind: clang.BuiltinTypeKind) bool { | |
| 4330 | const c_type = qualTypeCanon(qt); | |
| 4331 | if (c_type.getTypeClass() != .Builtin) | |
| 4332 | return false; | |
| 4333 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4334 | return builtin_ty.getKind() == kind; | |
| 4335 | } | |
| 4336 | ||
| 4337 | fn qualTypeIsPtr(qt: clang.QualType) bool { | |
| 4338 | return qualTypeCanon(qt).getTypeClass() == .Pointer; | |
| 4339 | } | |
| 4340 | ||
| 4341 | fn qualTypeIsBoolean(qt: clang.QualType) bool { | |
| 4342 | return qualTypeCanon(qt).isBooleanType(); | |
| 4343 | } | |
| 4344 | ||
| 4345 | fn qualTypeIntBitWidth(c: *Context, qt: clang.QualType) !u32 { | |
| 4346 | const ty = qt.getTypePtr(); | |
| 4347 | ||
| 4348 | switch (ty.getTypeClass()) { | |
| 4349 | .Builtin => { | |
| 4350 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 4351 | ||
| 4352 | switch (builtin_ty.getKind()) { | |
| 4353 | .Char_U, | |
| 4354 | .UChar, | |
| 4355 | .Char_S, | |
| 4356 | .SChar, | |
| 4357 | => return 8, | |
| 4358 | .UInt128, | |
| 4359 | .Int128, | |
| 4360 | => return 128, | |
| 4361 | else => return 0, | |
| 4362 | } | |
| 4363 | ||
| 4364 | unreachable; | |
| 4365 | }, | |
| 4366 | .Typedef => { | |
| 4367 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 4368 | const typedef_decl = typedef_ty.getDecl(); | |
| 4369 | const type_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(typedef_decl)).getName_bytes_begin()); | |
| 4370 | ||
| 4371 | if (mem.eql(u8, type_name, "uint8_t") or mem.eql(u8, type_name, "int8_t")) { | |
| 4372 | return 8; | |
| 4373 | } else if (mem.eql(u8, type_name, "uint16_t") or mem.eql(u8, type_name, "int16_t")) { | |
| 4374 | return 16; | |
| 4375 | } else if (mem.eql(u8, type_name, "uint32_t") or mem.eql(u8, type_name, "int32_t")) { | |
| 4376 | return 32; | |
| 4377 | } else if (mem.eql(u8, type_name, "uint64_t") or mem.eql(u8, type_name, "int64_t")) { | |
| 4378 | return 64; | |
| 4379 | } else { | |
| 4380 | return 0; | |
| 4381 | } | |
| 4382 | }, | |
| 4383 | else => return 0, | |
| 4384 | } | |
| 4385 | } | |
| 4386 | ||
| 4387 | fn qualTypeChildIsFnProto(qt: clang.QualType) bool { | |
| 4388 | const ty = qualTypeCanon(qt); | |
| 4389 | ||
| 4390 | switch (ty.getTypeClass()) { | |
| 4391 | .FunctionProto, .FunctionNoProto => return true, | |
| 4392 | else => return false, | |
| 4393 | } | |
| 4394 | } | |
| 4395 | ||
| 4396 | fn qualTypeCanon(qt: clang.QualType) *const clang.Type { | |
| 4397 | const canon = qt.getCanonicalType(); | |
| 4398 | return canon.getTypePtr(); | |
| 4399 | } | |
| 4400 | ||
| 4401 | fn getExprQualType(c: *Context, expr: *const clang.Expr) clang.QualType { | |
| 4402 | blk: { | |
| 4403 | // If this is a C `char *`, turn it into a `const char *` | |
| 4404 | if (expr.getStmtClass() != .ImplicitCastExprClass) break :blk; | |
| 4405 | const cast_expr = @as(*const clang.ImplicitCastExpr, @ptrCast(expr)); | |
| 4406 | if (cast_expr.getCastKind() != .ArrayToPointerDecay) break :blk; | |
| 4407 | const sub_expr = cast_expr.getSubExpr(); | |
| 4408 | if (sub_expr.getStmtClass() != .StringLiteralClass) break :blk; | |
| 4409 | const array_qt = sub_expr.getType(); | |
| 4410 | const array_type = @as(*const clang.ArrayType, @ptrCast(array_qt.getTypePtr())); | |
| 4411 | var pointee_qt = array_type.getElementType(); | |
| 4412 | pointee_qt.addConst(); | |
| 4413 | return c.clang_context.getPointerType(pointee_qt); | |
| 4414 | } | |
| 4415 | return expr.getType(); | |
| 4416 | } | |
| 4417 | ||
| 4418 | fn typeIsOpaque(c: *Context, ty: *const clang.Type, loc: clang.SourceLocation) bool { | |
| 4419 | switch (ty.getTypeClass()) { | |
| 4420 | .Builtin => { | |
| 4421 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 4422 | return builtin_ty.getKind() == .Void; | |
| 4423 | }, | |
| 4424 | .Record => { | |
| 4425 | const record_ty = @as(*const clang.RecordType, @ptrCast(ty)); | |
| 4426 | const record_decl = record_ty.getDecl(); | |
| 4427 | const record_def = record_decl.getDefinition() orelse | |
| 4428 | return true; | |
| 4429 | var it = record_def.field_begin(); | |
| 4430 | const end_it = record_def.field_end(); | |
| 4431 | while (it.neq(end_it)) : (it = it.next()) { | |
| 4432 | const field_decl = it.deref(); | |
| 4433 | ||
| 4434 | if (field_decl.isBitField()) { | |
| 4435 | return true; | |
| 4436 | } | |
| 4437 | } | |
| 4438 | return false; | |
| 4439 | }, | |
| 4440 | .Elaborated => { | |
| 4441 | const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); | |
| 4442 | const qt = elaborated_ty.getNamedType(); | |
| 4443 | return typeIsOpaque(c, qt.getTypePtr(), loc); | |
| 4444 | }, | |
| 4445 | .Typedef => { | |
| 4446 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 4447 | const typedef_decl = typedef_ty.getDecl(); | |
| 4448 | const underlying_type = typedef_decl.getUnderlyingType(); | |
| 4449 | return typeIsOpaque(c, underlying_type.getTypePtr(), loc); | |
| 4450 | }, | |
| 4451 | else => return false, | |
| 4452 | } | |
| 4453 | } | |
| 4454 | ||
| 4455 | /// plain `char *` (not const; not explicitly signed or unsigned) | |
| 4456 | fn qualTypeIsCharStar(qt: clang.QualType) bool { | |
| 4457 | if (qualTypeIsPtr(qt)) { | |
| 4458 | const child_qt = qualTypeCanon(qt).getPointeeType(); | |
| 4459 | return cIsUnqualifiedChar(child_qt) and !child_qt.isConstQualified(); | |
| 4460 | } | |
| 4461 | return false; | |
| 4462 | } | |
| 4463 | ||
| 4464 | /// C `char` without explicit signed or unsigned qualifier | |
| 4465 | fn cIsUnqualifiedChar(qt: clang.QualType) bool { | |
| 4466 | const c_type = qualTypeCanon(qt); | |
| 4467 | if (c_type.getTypeClass() != .Builtin) return false; | |
| 4468 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4469 | return switch (builtin_ty.getKind()) { | |
| 4470 | .Char_S, .Char_U => true, | |
| 4471 | else => false, | |
| 4472 | }; | |
| 4473 | } | |
| 4474 | ||
| 4475 | fn cIsInteger(qt: clang.QualType) bool { | |
| 4476 | return cIsSignedInteger(qt) or cIsUnsignedInteger(qt); | |
| 4477 | } | |
| 4478 | ||
| 4479 | fn cIsUnsignedInteger(qt: clang.QualType) bool { | |
| 4480 | const c_type = qualTypeCanon(qt); | |
| 4481 | if (c_type.getTypeClass() != .Builtin) return false; | |
| 4482 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4483 | return switch (builtin_ty.getKind()) { | |
| 4484 | .Char_U, | |
| 4485 | .UChar, | |
| 4486 | .Char_S, | |
| 4487 | .UShort, | |
| 4488 | .UInt, | |
| 4489 | .ULong, | |
| 4490 | .ULongLong, | |
| 4491 | .UInt128, | |
| 4492 | .WChar_U, | |
| 4493 | => true, | |
| 4494 | else => false, | |
| 4495 | }; | |
| 4496 | } | |
| 4497 | ||
| 4498 | fn cIntTypeToIndex(qt: clang.QualType) u8 { | |
| 4499 | const c_type = qualTypeCanon(qt); | |
| 4500 | assert(c_type.getTypeClass() == .Builtin); | |
| 4501 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4502 | return switch (builtin_ty.getKind()) { | |
| 4503 | .Bool, .Char_U, .Char_S, .UChar, .SChar, .Char8 => 1, | |
| 4504 | .WChar_U, .WChar_S => 2, | |
| 4505 | .UShort, .Short, .Char16 => 3, | |
| 4506 | .UInt, .Int, .Char32 => 4, | |
| 4507 | .ULong, .Long => 5, | |
| 4508 | .ULongLong, .LongLong => 6, | |
| 4509 | .UInt128, .Int128 => 7, | |
| 4510 | else => unreachable, | |
| 4511 | }; | |
| 4512 | } | |
| 4513 | ||
| 4514 | fn cIntTypeCmp(a: clang.QualType, b: clang.QualType) math.Order { | |
| 4515 | const a_index = cIntTypeToIndex(a); | |
| 4516 | const b_index = cIntTypeToIndex(b); | |
| 4517 | return math.order(a_index, b_index); | |
| 4518 | } | |
| 4519 | ||
| 4520 | /// Checks if expr is an integer literal >= 0 | |
| 4521 | fn cIsNonNegativeIntLiteral(c: *Context, expr: *const clang.Expr) bool { | |
| 4522 | if (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass() == .IntegerLiteralClass) { | |
| 4523 | var signum: c_int = undefined; | |
| 4524 | if (!(@as(*const clang.IntegerLiteral, @ptrCast(expr)).getSignum(&signum, c.clang_context))) { | |
| 4525 | return false; | |
| 4526 | } | |
| 4527 | return signum >= 0; | |
| 4528 | } | |
| 4529 | return false; | |
| 4530 | } | |
| 4531 | ||
| 4532 | fn cIsSignedInteger(qt: clang.QualType) bool { | |
| 4533 | const c_type = qualTypeCanon(qt); | |
| 4534 | if (c_type.getTypeClass() != .Builtin) return false; | |
| 4535 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4536 | return switch (builtin_ty.getKind()) { | |
| 4537 | .SChar, | |
| 4538 | .Short, | |
| 4539 | .Int, | |
| 4540 | .Long, | |
| 4541 | .LongLong, | |
| 4542 | .Int128, | |
| 4543 | .WChar_S, | |
| 4544 | => true, | |
| 4545 | else => false, | |
| 4546 | }; | |
| 4547 | } | |
| 4548 | ||
| 4549 | fn cIsNativeInt(qt: clang.QualType) bool { | |
| 4550 | const c_type = qualTypeCanon(qt); | |
| 4551 | if (c_type.getTypeClass() != .Builtin) return false; | |
| 4552 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4553 | return builtin_ty.getKind() == .Int; | |
| 4554 | } | |
| 4555 | ||
| 4556 | fn cIsFloating(qt: clang.QualType) bool { | |
| 4557 | const c_type = qualTypeCanon(qt); | |
| 4558 | if (c_type.getTypeClass() != .Builtin) return false; | |
| 4559 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4560 | return switch (builtin_ty.getKind()) { | |
| 4561 | .Float, | |
| 4562 | .Double, | |
| 4563 | .Float128, | |
| 4564 | .LongDouble, | |
| 4565 | => true, | |
| 4566 | else => false, | |
| 4567 | }; | |
| 4568 | } | |
| 4569 | ||
| 4570 | fn cIsLongLongInteger(qt: clang.QualType) bool { | |
| 4571 | const c_type = qualTypeCanon(qt); | |
| 4572 | if (c_type.getTypeClass() != .Builtin) return false; | |
| 4573 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); | |
| 4574 | return switch (builtin_ty.getKind()) { | |
| 4575 | .LongLong, .ULongLong, .Int128, .UInt128 => true, | |
| 4576 | else => false, | |
| 4577 | }; | |
| 4578 | } | |
| 4579 | fn transCreateNodeAssign( | |
| 4580 | c: *Context, | |
| 4581 | scope: *Scope, | |
| 4582 | result_used: ResultUsed, | |
| 4583 | lhs: *const clang.Expr, | |
| 4584 | rhs: *const clang.Expr, | |
| 4585 | ) !Node { | |
| 4586 | // common case | |
| 4587 | // c: lhs = rhs | |
| 4588 | // zig: lhs = rhs | |
| 4589 | if (result_used == .unused) { | |
| 4590 | const lhs_node = try transExpr(c, scope, lhs, .used); | |
| 4591 | var rhs_node = try transExprCoercing(c, scope, rhs, .used); | |
| 4592 | if (!exprIsBooleanType(lhs) and isBoolRes(rhs_node)) { | |
| 4593 | rhs_node = try Tag.int_from_bool.create(c.arena, rhs_node); | |
| 4594 | } | |
| 4595 | return transCreateNodeInfixOp(c, .assign, lhs_node, rhs_node, .used); | |
| 4596 | } | |
| 4597 | ||
| 4598 | // worst case | |
| 4599 | // c: lhs = rhs | |
| 4600 | // zig: (blk: { | |
| 4601 | // zig: const _tmp = rhs; | |
| 4602 | // zig: lhs = _tmp; | |
| 4603 | // zig: break :blk _tmp | |
| 4604 | // zig: }) | |
| 4605 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 4606 | defer block_scope.deinit(); | |
| 4607 | ||
| 4608 | const tmp = try block_scope.reserveMangledName(c, "tmp"); | |
| 4609 | var rhs_node = try transExpr(c, &block_scope.base, rhs, .used); | |
| 4610 | if (!exprIsBooleanType(lhs) and isBoolRes(rhs_node)) { | |
| 4611 | rhs_node = try Tag.int_from_bool.create(c.arena, rhs_node); | |
| 4612 | } | |
| 4613 | ||
| 4614 | const tmp_decl = try Tag.var_simple.create(c.arena, .{ .name = tmp, .init = rhs_node }); | |
| 4615 | try block_scope.statements.append(tmp_decl); | |
| 4616 | ||
| 4617 | const lhs_node = try transExpr(c, &block_scope.base, lhs, .used); | |
| 4618 | const tmp_ident = try Tag.identifier.create(c.arena, tmp); | |
| 4619 | const assign = try transCreateNodeInfixOp(c, .assign, lhs_node, tmp_ident, .used); | |
| 4620 | try block_scope.statements.append(assign); | |
| 4621 | ||
| 4622 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 4623 | .label = block_scope.label, | |
| 4624 | .val = tmp_ident, | |
| 4625 | }); | |
| 4626 | try block_scope.statements.append(break_node); | |
| 4627 | return block_scope.complete(c); | |
| 4628 | } | |
| 4629 | ||
| 4630 | fn transCreateNodeInfixOp( | |
| 4631 | c: *Context, | |
| 4632 | op: Tag, | |
| 4633 | lhs: Node, | |
| 4634 | rhs: Node, | |
| 4635 | used: ResultUsed, | |
| 4636 | ) !Node { | |
| 4637 | const payload = try c.arena.create(ast.Payload.BinOp); | |
| 4638 | payload.* = .{ | |
| 4639 | .base = .{ .tag = op }, | |
| 4640 | .data = .{ | |
| 4641 | .lhs = lhs, | |
| 4642 | .rhs = rhs, | |
| 4643 | }, | |
| 4644 | }; | |
| 4645 | return maybeSuppressResult(c, used, Node.initPayload(&payload.base)); | |
| 4646 | } | |
| 4647 | ||
| 4648 | fn transCreateNodeBoolInfixOp( | |
| 4649 | c: *Context, | |
| 4650 | scope: *Scope, | |
| 4651 | stmt: *const clang.BinaryOperator, | |
| 4652 | op: Tag, | |
| 4653 | used: ResultUsed, | |
| 4654 | ) !Node { | |
| 4655 | std.debug.assert(op == .@"and" or op == .@"or"); | |
| 4656 | ||
| 4657 | const lhs = try transBoolExpr(c, scope, stmt.getLHS(), .used); | |
| 4658 | const rhs = try transBoolExpr(c, scope, stmt.getRHS(), .used); | |
| 4659 | ||
| 4660 | return transCreateNodeInfixOp(c, op, lhs, rhs, used); | |
| 4661 | } | |
| 4662 | ||
| 4663 | fn transCreateNodeAPInt(c: *Context, int: *const clang.APSInt) !Node { | |
| 4664 | const num_limbs = math.cast(usize, int.getNumWords()) orelse return error.OutOfMemory; | |
| 4665 | var aps_int = int; | |
| 4666 | const is_negative = int.isSigned() and int.isNegative(); | |
| 4667 | if (is_negative) aps_int = aps_int.negate(); | |
| 4668 | defer if (is_negative) { | |
| 4669 | aps_int.free(); | |
| 4670 | }; | |
| 4671 | ||
| 4672 | const limbs = try c.arena.alloc(math.big.Limb, num_limbs); | |
| 4673 | defer c.arena.free(limbs); | |
| 4674 | ||
| 4675 | const data = aps_int.getRawData(); | |
| 4676 | switch (@sizeOf(math.big.Limb)) { | |
| 4677 | 8 => { | |
| 4678 | var i: usize = 0; | |
| 4679 | while (i < num_limbs) : (i += 1) { | |
| 4680 | limbs[i] = data[i]; | |
| 4681 | } | |
| 4682 | }, | |
| 4683 | 4 => { | |
| 4684 | var limb_i: usize = 0; | |
| 4685 | var data_i: usize = 0; | |
| 4686 | while (limb_i < num_limbs) : ({ | |
| 4687 | limb_i += 2; | |
| 4688 | data_i += 1; | |
| 4689 | }) { | |
| 4690 | limbs[limb_i] = @as(u32, @truncate(data[data_i])); | |
| 4691 | limbs[limb_i + 1] = @as(u32, @truncate(data[data_i] >> 32)); | |
| 4692 | } | |
| 4693 | }, | |
| 4694 | else => @compileError("unimplemented"), | |
| 4695 | } | |
| 4696 | ||
| 4697 | const big: math.big.int.Const = .{ .limbs = limbs, .positive = true }; | |
| 4698 | const str = big.toStringAlloc(c.arena, 10, .lower) catch |err| switch (err) { | |
| 4699 | error.OutOfMemory => return error.OutOfMemory, | |
| 4700 | }; | |
| 4701 | const res = try Tag.integer_literal.create(c.arena, str); | |
| 4702 | if (is_negative) return Tag.negate.create(c.arena, res); | |
| 4703 | return res; | |
| 4704 | } | |
| 4705 | ||
| 4706 | fn transCreateNodeNumber(c: *Context, num: anytype, num_kind: enum { int, float }) !Node { | |
| 4707 | const fmt_s = switch (@typeInfo(@TypeOf(num))) { | |
| 4708 | .int, .comptime_int => "{d}", | |
| 4709 | else => "{s}", | |
| 4710 | }; | |
| 4711 | const str = try std.fmt.allocPrint(c.arena, fmt_s, .{num}); | |
| 4712 | if (num_kind == .float) | |
| 4713 | return Tag.float_literal.create(c.arena, str) | |
| 4714 | else | |
| 4715 | return Tag.integer_literal.create(c.arena, str); | |
| 4716 | } | |
| 4717 | ||
| 4718 | fn transCreateNodeMacroFn(c: *Context, name: []const u8, ref: Node, proto_alias: *ast.Payload.Func) !Node { | |
| 4719 | var fn_params = std.array_list.Managed(ast.Payload.Param).init(c.gpa); | |
| 4720 | defer fn_params.deinit(); | |
| 4721 | ||
| 4722 | for (proto_alias.data.params) |param| { | |
| 4723 | const param_name = param.name orelse | |
| 4724 | try std.fmt.allocPrint(c.arena, "arg_{d}", .{c.getMangle()}); | |
| 4725 | ||
| 4726 | try fn_params.append(.{ | |
| 4727 | .name = param_name, | |
| 4728 | .type = param.type, | |
| 4729 | .is_noalias = param.is_noalias, | |
| 4730 | }); | |
| 4731 | } | |
| 4732 | ||
| 4733 | const init = if (ref.castTag(.var_decl)) |v| | |
| 4734 | v.data.init.? | |
| 4735 | else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| | |
| 4736 | v.data.init | |
| 4737 | else | |
| 4738 | unreachable; | |
| 4739 | ||
| 4740 | const unwrap_expr = try Tag.unwrap.create(c.arena, init); | |
| 4741 | const args = try c.arena.alloc(Node, fn_params.items.len); | |
| 4742 | for (fn_params.items, 0..) |param, i| { | |
| 4743 | args[i] = try Tag.identifier.create(c.arena, param.name.?); | |
| 4744 | } | |
| 4745 | const call_expr = try Tag.call.create(c.arena, .{ | |
| 4746 | .lhs = unwrap_expr, | |
| 4747 | .args = args, | |
| 4748 | }); | |
| 4749 | const return_expr = try Tag.@"return".create(c.arena, call_expr); | |
| 4750 | const block = try Tag.block_single.create(c.arena, return_expr); | |
| 4751 | ||
| 4752 | return Tag.pub_inline_fn.create(c.arena, .{ | |
| 4753 | .name = name, | |
| 4754 | .params = try c.arena.dupe(ast.Payload.Param, fn_params.items), | |
| 4755 | .return_type = proto_alias.data.return_type, | |
| 4756 | .body = block, | |
| 4757 | }); | |
| 4758 | } | |
| 4759 | ||
| 4760 | fn transCreateNodeShiftOp( | |
| 4761 | c: *Context, | |
| 4762 | scope: *Scope, | |
| 4763 | stmt: *const clang.BinaryOperator, | |
| 4764 | op: Tag, | |
| 4765 | used: ResultUsed, | |
| 4766 | ) !Node { | |
| 4767 | std.debug.assert(op == .shl or op == .shr); | |
| 4768 | ||
| 4769 | const lhs_expr = stmt.getLHS(); | |
| 4770 | const rhs_expr = stmt.getRHS(); | |
| 4771 | // lhs >> @as(u5, rh) | |
| 4772 | ||
| 4773 | const lhs = try transExpr(c, scope, lhs_expr, .used); | |
| 4774 | ||
| 4775 | const rhs = try transExprCoercing(c, scope, rhs_expr, .used); | |
| 4776 | const rhs_casted = try Tag.int_cast.create(c.arena, rhs); | |
| 4777 | ||
| 4778 | return transCreateNodeInfixOp(c, op, lhs, rhs_casted, used); | |
| 4779 | } | |
| 4780 | ||
| 4781 | fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clang.SourceLocation) TypeError!Node { | |
| 4782 | switch (ty.getTypeClass()) { | |
| 4783 | .Builtin => { | |
| 4784 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 4785 | return Tag.type.create(c.arena, switch (builtin_ty.getKind()) { | |
| 4786 | .Void => "anyopaque", | |
| 4787 | .Bool => "bool", | |
| 4788 | .Char_U, .UChar, .Char_S, .Char8 => "u8", | |
| 4789 | .SChar => "i8", | |
| 4790 | .UShort => "c_ushort", | |
| 4791 | .UInt => "c_uint", | |
| 4792 | .ULong => "c_ulong", | |
| 4793 | .ULongLong => "c_ulonglong", | |
| 4794 | .Short => "c_short", | |
| 4795 | .Int => "c_int", | |
| 4796 | .Long => "c_long", | |
| 4797 | .LongLong => "c_longlong", | |
| 4798 | .UInt128 => "u128", | |
| 4799 | .Int128 => "i128", | |
| 4800 | .Float => "f32", | |
| 4801 | .Double => "f64", | |
| 4802 | .Float128 => "f128", | |
| 4803 | .Float16 => "f16", | |
| 4804 | .LongDouble => "c_longdouble", | |
| 4805 | else => return fail(c, error.UnsupportedType, source_loc, "unsupported builtin type", .{}), | |
| 4806 | }); | |
| 4807 | }, | |
| 4808 | .FunctionProto => { | |
| 4809 | const fn_proto_ty = @as(*const clang.FunctionProtoType, @ptrCast(ty)); | |
| 4810 | const fn_proto = try transFnProto(c, null, fn_proto_ty, source_loc, null, false); | |
| 4811 | return Node.initPayload(&fn_proto.base); | |
| 4812 | }, | |
| 4813 | .FunctionNoProto => { | |
| 4814 | const fn_no_proto_ty = @as(*const clang.FunctionType, @ptrCast(ty)); | |
| 4815 | const fn_proto = try transFnNoProto(c, fn_no_proto_ty, source_loc, null, false); | |
| 4816 | return Node.initPayload(&fn_proto.base); | |
| 4817 | }, | |
| 4818 | .Paren => { | |
| 4819 | const paren_ty = @as(*const clang.ParenType, @ptrCast(ty)); | |
| 4820 | return transQualType(c, scope, paren_ty.getInnerType(), source_loc); | |
| 4821 | }, | |
| 4822 | .Pointer => { | |
| 4823 | const child_qt = ty.getPointeeType(); | |
| 4824 | const is_fn_proto = qualTypeChildIsFnProto(child_qt); | |
| 4825 | const is_const = is_fn_proto or child_qt.isConstQualified(); | |
| 4826 | const is_volatile = child_qt.isVolatileQualified(); | |
| 4827 | const elem_type = try transQualType(c, scope, child_qt, source_loc); | |
| 4828 | const ptr_info: @FieldType(ast.Payload.Pointer, "data") = .{ | |
| 4829 | .is_const = is_const, | |
| 4830 | .is_volatile = is_volatile, | |
| 4831 | .elem_type = elem_type, | |
| 4832 | }; | |
| 4833 | if (is_fn_proto or | |
| 4834 | typeIsOpaque(c, child_qt.getTypePtr(), source_loc) or | |
| 4835 | qualTypeWasDemotedToOpaque(c, child_qt)) | |
| 4836 | { | |
| 4837 | const ptr = try Tag.single_pointer.create(c.arena, ptr_info); | |
| 4838 | return Tag.optional_type.create(c.arena, ptr); | |
| 4839 | } | |
| 4840 | ||
| 4841 | return Tag.c_pointer.create(c.arena, ptr_info); | |
| 4842 | }, | |
| 4843 | .ConstantArray => { | |
| 4844 | const const_arr_ty = @as(*const clang.ConstantArrayType, @ptrCast(ty)); | |
| 4845 | ||
| 4846 | var size_ap_int: *const clang.APInt = undefined; | |
| 4847 | const_arr_ty.getSize(&size_ap_int); | |
| 4848 | defer size_ap_int.free(); | |
| 4849 | const size = size_ap_int.getLimitedValue(usize); | |
| 4850 | const elem_type = try transType(c, scope, const_arr_ty.getElementType().getTypePtr(), source_loc); | |
| 4851 | ||
| 4852 | return Tag.array_type.create(c.arena, .{ .len = size, .elem_type = elem_type }); | |
| 4853 | }, | |
| 4854 | .IncompleteArray => { | |
| 4855 | const incomplete_array_ty = @as(*const clang.IncompleteArrayType, @ptrCast(ty)); | |
| 4856 | ||
| 4857 | const child_qt = incomplete_array_ty.getElementType(); | |
| 4858 | const is_const = child_qt.isConstQualified(); | |
| 4859 | const is_volatile = child_qt.isVolatileQualified(); | |
| 4860 | const elem_type = try transQualType(c, scope, child_qt, source_loc); | |
| 4861 | ||
| 4862 | return Tag.c_pointer.create(c.arena, .{ .is_const = is_const, .is_volatile = is_volatile, .elem_type = elem_type }); | |
| 4863 | }, | |
| 4864 | .Typedef => { | |
| 4865 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 4866 | ||
| 4867 | const typedef_decl = typedef_ty.getDecl(); | |
| 4868 | var trans_scope = scope; | |
| 4869 | if (@as(*const clang.Decl, @ptrCast(typedef_decl)).castToNamedDecl()) |named_decl| { | |
| 4870 | const decl_name = try c.str(named_decl.getName_bytes_begin()); | |
| 4871 | if (c.global_names.get(decl_name)) |_| trans_scope = &c.global_scope.base; | |
| 4872 | if (builtin_typedef_map.get(decl_name)) |builtin| return Tag.type.create(c.arena, builtin); | |
| 4873 | } | |
| 4874 | try transTypeDef(c, trans_scope, typedef_decl); | |
| 4875 | const name = c.decl_table.get(@intFromPtr(typedef_decl.getCanonicalDecl())).?; | |
| 4876 | return Tag.identifier.create(c.arena, name); | |
| 4877 | }, | |
| 4878 | .Record => { | |
| 4879 | const record_ty = @as(*const clang.RecordType, @ptrCast(ty)); | |
| 4880 | ||
| 4881 | const record_decl = record_ty.getDecl(); | |
| 4882 | var trans_scope = scope; | |
| 4883 | if (@as(*const clang.Decl, @ptrCast(record_decl)).castToNamedDecl()) |named_decl| { | |
| 4884 | const decl_name = try c.str(named_decl.getName_bytes_begin()); | |
| 4885 | if (c.weak_global_names.contains(decl_name)) trans_scope = &c.global_scope.base; | |
| 4886 | } | |
| 4887 | try transRecordDecl(c, trans_scope, record_decl); | |
| 4888 | const name = c.decl_table.get(@intFromPtr(record_decl.getCanonicalDecl())).?; | |
| 4889 | return Tag.identifier.create(c.arena, name); | |
| 4890 | }, | |
| 4891 | .Enum => { | |
| 4892 | const enum_ty = @as(*const clang.EnumType, @ptrCast(ty)); | |
| 4893 | ||
| 4894 | const enum_decl = enum_ty.getDecl(); | |
| 4895 | var trans_scope = scope; | |
| 4896 | if (@as(*const clang.Decl, @ptrCast(enum_decl)).castToNamedDecl()) |named_decl| { | |
| 4897 | const decl_name = try c.str(named_decl.getName_bytes_begin()); | |
| 4898 | if (c.weak_global_names.contains(decl_name)) trans_scope = &c.global_scope.base; | |
| 4899 | } | |
| 4900 | try transEnumDecl(c, trans_scope, enum_decl); | |
| 4901 | const name = c.decl_table.get(@intFromPtr(enum_decl.getCanonicalDecl())).?; | |
| 4902 | return Tag.identifier.create(c.arena, name); | |
| 4903 | }, | |
| 4904 | .Elaborated => { | |
| 4905 | const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); | |
| 4906 | return transQualType(c, scope, elaborated_ty.getNamedType(), source_loc); | |
| 4907 | }, | |
| 4908 | .Decayed => { | |
| 4909 | const decayed_ty = @as(*const clang.DecayedType, @ptrCast(ty)); | |
| 4910 | return transQualType(c, scope, decayed_ty.getDecayedType(), source_loc); | |
| 4911 | }, | |
| 4912 | .Attributed => { | |
| 4913 | const attributed_ty = @as(*const clang.AttributedType, @ptrCast(ty)); | |
| 4914 | return transQualType(c, scope, attributed_ty.getEquivalentType(), source_loc); | |
| 4915 | }, | |
| 4916 | .MacroQualified => { | |
| 4917 | const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(ty)); | |
| 4918 | return transQualType(c, scope, macroqualified_ty.getModifiedType(), source_loc); | |
| 4919 | }, | |
| 4920 | .TypeOf => { | |
| 4921 | const typeof_ty = @as(*const clang.TypeOfType, @ptrCast(ty)); | |
| 4922 | return transQualType(c, scope, typeof_ty.getUnmodifiedType(), source_loc); | |
| 4923 | }, | |
| 4924 | .TypeOfExpr => { | |
| 4925 | const typeofexpr_ty = @as(*const clang.TypeOfExprType, @ptrCast(ty)); | |
| 4926 | const underlying_expr = transExpr(c, scope, typeofexpr_ty.getUnderlyingExpr(), .used) catch |err| switch (err) { | |
| 4927 | error.UnsupportedTranslation => { | |
| 4928 | return fail(c, error.UnsupportedType, source_loc, "unsupported underlying expression for TypeOfExpr", .{}); | |
| 4929 | }, | |
| 4930 | else => |e| return e, | |
| 4931 | }; | |
| 4932 | return Tag.typeof.create(c.arena, underlying_expr); | |
| 4933 | }, | |
| 4934 | .Vector => { | |
| 4935 | const vector_ty = @as(*const clang.VectorType, @ptrCast(ty)); | |
| 4936 | const num_elements = vector_ty.getNumElements(); | |
| 4937 | const element_qt = vector_ty.getElementType(); | |
| 4938 | return Tag.vector.create(c.arena, .{ | |
| 4939 | .lhs = try transCreateNodeNumber(c, num_elements, .int), | |
| 4940 | .rhs = try transQualType(c, scope, element_qt, source_loc), | |
| 4941 | }); | |
| 4942 | }, | |
| 4943 | .BitInt, .ExtVector => { | |
| 4944 | const type_name = try c.str(ty.getTypeClassName()); | |
| 4945 | return fail(c, error.UnsupportedType, source_loc, "TODO implement translation of type: '{s}'", .{type_name}); | |
| 4946 | }, | |
| 4947 | else => { | |
| 4948 | const type_name = try c.str(ty.getTypeClassName()); | |
| 4949 | return fail(c, error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{type_name}); | |
| 4950 | }, | |
| 4951 | } | |
| 4952 | } | |
| 4953 | ||
| 4954 | fn qualTypeWasDemotedToOpaque(c: *Context, qt: clang.QualType) bool { | |
| 4955 | const ty = qt.getTypePtr(); | |
| 4956 | switch (qt.getTypeClass()) { | |
| 4957 | .Typedef => { | |
| 4958 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 4959 | ||
| 4960 | const typedef_decl = typedef_ty.getDecl(); | |
| 4961 | const underlying_type = typedef_decl.getUnderlyingType(); | |
| 4962 | return qualTypeWasDemotedToOpaque(c, underlying_type); | |
| 4963 | }, | |
| 4964 | .Record => { | |
| 4965 | const record_ty = @as(*const clang.RecordType, @ptrCast(ty)); | |
| 4966 | ||
| 4967 | const record_decl = record_ty.getDecl(); | |
| 4968 | const canonical = @intFromPtr(record_decl.getCanonicalDecl()); | |
| 4969 | if (c.opaque_demotes.contains(canonical)) return true; | |
| 4970 | ||
| 4971 | // check all childern for opaque types. | |
| 4972 | var it = record_decl.field_begin(); | |
| 4973 | const end_it = record_decl.field_end(); | |
| 4974 | while (it.neq(end_it)) : (it = it.next()) { | |
| 4975 | const field_decl = it.deref(); | |
| 4976 | if (qualTypeWasDemotedToOpaque(c, field_decl.getType())) return true; | |
| 4977 | } | |
| 4978 | return false; | |
| 4979 | }, | |
| 4980 | .Enum => { | |
| 4981 | const enum_ty = @as(*const clang.EnumType, @ptrCast(ty)); | |
| 4982 | ||
| 4983 | const enum_decl = enum_ty.getDecl(); | |
| 4984 | const canonical = @intFromPtr(enum_decl.getCanonicalDecl()); | |
| 4985 | return c.opaque_demotes.contains(canonical); | |
| 4986 | }, | |
| 4987 | .Elaborated => { | |
| 4988 | const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); | |
| 4989 | return qualTypeWasDemotedToOpaque(c, elaborated_ty.getNamedType()); | |
| 4990 | }, | |
| 4991 | .Decayed => { | |
| 4992 | const decayed_ty = @as(*const clang.DecayedType, @ptrCast(ty)); | |
| 4993 | return qualTypeWasDemotedToOpaque(c, decayed_ty.getDecayedType()); | |
| 4994 | }, | |
| 4995 | .Attributed => { | |
| 4996 | const attributed_ty = @as(*const clang.AttributedType, @ptrCast(ty)); | |
| 4997 | return qualTypeWasDemotedToOpaque(c, attributed_ty.getEquivalentType()); | |
| 4998 | }, | |
| 4999 | .MacroQualified => { | |
| 5000 | const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(ty)); | |
| 5001 | return qualTypeWasDemotedToOpaque(c, macroqualified_ty.getModifiedType()); | |
| 5002 | }, | |
| 5003 | else => return false, | |
| 5004 | } | |
| 5005 | } | |
| 5006 | ||
| 5007 | fn isAnyopaque(qt: clang.QualType) bool { | |
| 5008 | const ty = qt.getTypePtr(); | |
| 5009 | switch (ty.getTypeClass()) { | |
| 5010 | .Builtin => { | |
| 5011 | const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); | |
| 5012 | return builtin_ty.getKind() == .Void; | |
| 5013 | }, | |
| 5014 | .Typedef => { | |
| 5015 | const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); | |
| 5016 | const typedef_decl = typedef_ty.getDecl(); | |
| 5017 | return isAnyopaque(typedef_decl.getUnderlyingType()); | |
| 5018 | }, | |
| 5019 | .Elaborated => { | |
| 5020 | const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); | |
| 5021 | return isAnyopaque(elaborated_ty.getNamedType().getCanonicalType()); | |
| 5022 | }, | |
| 5023 | .Decayed => { | |
| 5024 | const decayed_ty = @as(*const clang.DecayedType, @ptrCast(ty)); | |
| 5025 | return isAnyopaque(decayed_ty.getDecayedType().getCanonicalType()); | |
| 5026 | }, | |
| 5027 | .Attributed => { | |
| 5028 | const attributed_ty = @as(*const clang.AttributedType, @ptrCast(ty)); | |
| 5029 | return isAnyopaque(attributed_ty.getEquivalentType().getCanonicalType()); | |
| 5030 | }, | |
| 5031 | .MacroQualified => { | |
| 5032 | const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(ty)); | |
| 5033 | return isAnyopaque(macroqualified_ty.getModifiedType().getCanonicalType()); | |
| 5034 | }, | |
| 5035 | else => return false, | |
| 5036 | } | |
| 5037 | } | |
| 5038 | ||
| 5039 | const FnDeclContext = struct { | |
| 5040 | fn_name: []const u8, | |
| 5041 | has_body: bool, | |
| 5042 | storage_class: clang.StorageClass, | |
| 5043 | is_always_inline: bool, | |
| 5044 | is_export: bool, | |
| 5045 | }; | |
| 5046 | ||
| 5047 | fn transCC( | |
| 5048 | c: *Context, | |
| 5049 | fn_ty: *const clang.FunctionType, | |
| 5050 | source_loc: clang.SourceLocation, | |
| 5051 | ) !ast.Payload.Func.CallingConvention { | |
| 5052 | const clang_cc = fn_ty.getCallConv(); | |
| 5053 | return switch (clang_cc) { | |
| 5054 | .C => .c, | |
| 5055 | .X86_64SysV => .x86_64_sysv, | |
| 5056 | .Win64 => .x86_64_win, | |
| 5057 | .X86StdCall => .x86_stdcall, | |
| 5058 | .X86FastCall => .x86_fastcall, | |
| 5059 | .X86ThisCall => .x86_thiscall, | |
| 5060 | .X86VectorCall => .x86_vectorcall, | |
| 5061 | .AArch64VectorCall => .aarch64_vfabi, | |
| 5062 | .AAPCS => .arm_aapcs, | |
| 5063 | .AAPCS_VFP => .arm_aapcs_vfp, | |
| 5064 | .M68kRTD => .m68k_rtd, | |
| 5065 | else => return fail( | |
| 5066 | c, | |
| 5067 | error.UnsupportedType, | |
| 5068 | source_loc, | |
| 5069 | "unsupported calling convention: {s}", | |
| 5070 | .{@tagName(clang_cc)}, | |
| 5071 | ), | |
| 5072 | }; | |
| 5073 | } | |
| 5074 | ||
| 5075 | fn transFnProto( | |
| 5076 | c: *Context, | |
| 5077 | fn_decl: ?*const clang.FunctionDecl, | |
| 5078 | fn_proto_ty: *const clang.FunctionProtoType, | |
| 5079 | source_loc: clang.SourceLocation, | |
| 5080 | fn_decl_context: ?FnDeclContext, | |
| 5081 | is_pub: bool, | |
| 5082 | ) !*ast.Payload.Func { | |
| 5083 | const fn_ty = @as(*const clang.FunctionType, @ptrCast(fn_proto_ty)); | |
| 5084 | const cc = try transCC(c, fn_ty, source_loc); | |
| 5085 | const is_var_args = fn_proto_ty.isVariadic(); | |
| 5086 | return finishTransFnProto(c, fn_decl, fn_proto_ty, fn_ty, source_loc, fn_decl_context, is_var_args, cc, is_pub); | |
| 5087 | } | |
| 5088 | ||
| 5089 | fn transFnNoProto( | |
| 5090 | c: *Context, | |
| 5091 | fn_ty: *const clang.FunctionType, | |
| 5092 | source_loc: clang.SourceLocation, | |
| 5093 | fn_decl_context: ?FnDeclContext, | |
| 5094 | is_pub: bool, | |
| 5095 | ) !*ast.Payload.Func { | |
| 5096 | const cc = try transCC(c, fn_ty, source_loc); | |
| 5097 | const is_var_args = if (fn_decl_context) |ctx| (!ctx.is_export and ctx.storage_class != .Static and !ctx.is_always_inline) else true; | |
| 5098 | return finishTransFnProto(c, null, null, fn_ty, source_loc, fn_decl_context, is_var_args, cc, is_pub); | |
| 5099 | } | |
| 5100 | ||
| 5101 | fn finishTransFnProto( | |
| 5102 | c: *Context, | |
| 5103 | fn_decl: ?*const clang.FunctionDecl, | |
| 5104 | fn_proto_ty: ?*const clang.FunctionProtoType, | |
| 5105 | fn_ty: *const clang.FunctionType, | |
| 5106 | source_loc: clang.SourceLocation, | |
| 5107 | fn_decl_context: ?FnDeclContext, | |
| 5108 | is_var_args: bool, | |
| 5109 | cc: ast.Payload.Func.CallingConvention, | |
| 5110 | is_pub: bool, | |
| 5111 | ) !*ast.Payload.Func { | |
| 5112 | const is_export = if (fn_decl_context) |ctx| ctx.is_export else false; | |
| 5113 | const is_extern = if (fn_decl_context) |ctx| !ctx.has_body else false; | |
| 5114 | const is_inline = if (fn_decl_context) |ctx| ctx.is_always_inline else false; | |
| 5115 | const scope = &c.global_scope.base; | |
| 5116 | ||
| 5117 | const param_count: usize = if (fn_proto_ty != null) fn_proto_ty.?.getNumParams() else 0; | |
| 5118 | var fn_params = try std.array_list.Managed(ast.Payload.Param).initCapacity(c.gpa, param_count); | |
| 5119 | defer fn_params.deinit(); | |
| 5120 | ||
| 5121 | var i: usize = 0; | |
| 5122 | while (i < param_count) : (i += 1) { | |
| 5123 | const param_qt = fn_proto_ty.?.getParamType(@as(c_uint, @intCast(i))); | |
| 5124 | const is_noalias = param_qt.isRestrictQualified(); | |
| 5125 | ||
| 5126 | const param_name: ?[]const u8 = | |
| 5127 | if (fn_decl) |decl| blk: { | |
| 5128 | const param = decl.getParamDecl(@as(c_uint, @intCast(i))); | |
| 5129 | const param_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(param)).getName_bytes_begin()); | |
| 5130 | if (param_name.len < 1) | |
| 5131 | break :blk null; | |
| 5132 | ||
| 5133 | break :blk param_name; | |
| 5134 | } else null; | |
| 5135 | const type_node = try transQualType(c, scope, param_qt, source_loc); | |
| 5136 | ||
| 5137 | fn_params.addOneAssumeCapacity().* = .{ | |
| 5138 | .is_noalias = is_noalias, | |
| 5139 | .name = param_name, | |
| 5140 | .type = type_node, | |
| 5141 | }; | |
| 5142 | } | |
| 5143 | ||
| 5144 | const linksection_string = blk: { | |
| 5145 | if (fn_decl) |decl| { | |
| 5146 | var str_len: usize = undefined; | |
| 5147 | if (decl.getSectionAttribute(&str_len)) |str_ptr| { | |
| 5148 | break :blk str_ptr[0..str_len]; | |
| 5149 | } | |
| 5150 | } | |
| 5151 | break :blk null; | |
| 5152 | }; | |
| 5153 | ||
| 5154 | const alignment = if (fn_decl) |decl| ClangAlignment.forFunc(c, decl).zigAlignment() else null; | |
| 5155 | ||
| 5156 | const explicit_callconv = if ((is_inline or is_export or is_extern) and cc == .c) null else cc; | |
| 5157 | ||
| 5158 | const return_type_node = blk: { | |
| 5159 | if (fn_ty.getNoReturnAttr()) { | |
| 5160 | break :blk Tag.noreturn_type.init(); | |
| 5161 | } else { | |
| 5162 | const return_qt = fn_ty.getReturnType(); | |
| 5163 | if (isAnyopaque(return_qt)) { | |
| 5164 | // convert primitive anyopaque to actual void (only for return type) | |
| 5165 | break :blk Tag.void_type.init(); | |
| 5166 | } else { | |
| 5167 | break :blk transQualType(c, scope, return_qt, source_loc) catch |err| switch (err) { | |
| 5168 | error.UnsupportedType => { | |
| 5169 | try warn(c, scope, source_loc, "unsupported function proto return type", .{}); | |
| 5170 | return err; | |
| 5171 | }, | |
| 5172 | error.OutOfMemory => |e| return e, | |
| 5173 | }; | |
| 5174 | } | |
| 5175 | } | |
| 5176 | }; | |
| 5177 | const name: ?[]const u8 = if (fn_decl_context) |ctx| ctx.fn_name else null; | |
| 5178 | const payload = try c.arena.create(ast.Payload.Func); | |
| 5179 | payload.* = .{ | |
| 5180 | .base = .{ .tag = .func }, | |
| 5181 | .data = .{ | |
| 5182 | .is_pub = is_pub, | |
| 5183 | .is_extern = is_extern, | |
| 5184 | .is_export = is_export, | |
| 5185 | .is_inline = is_inline, | |
| 5186 | .is_var_args = is_var_args, | |
| 5187 | .name = name, | |
| 5188 | .linksection_string = linksection_string, | |
| 5189 | .explicit_callconv = explicit_callconv, | |
| 5190 | .params = try c.arena.dupe(ast.Payload.Param, fn_params.items), | |
| 5191 | .return_type = return_type_node, | |
| 5192 | .body = null, | |
| 5193 | .alignment = alignment, | |
| 5194 | }, | |
| 5195 | }; | |
| 5196 | return payload; | |
| 5197 | } | |
| 5198 | ||
| 5199 | fn warn(c: *Context, scope: *Scope, loc: clang.SourceLocation, comptime format: []const u8, args: anytype) !void { | |
| 5200 | const str = try c.locStr(loc); | |
| 5201 | const value = try std.fmt.allocPrint(c.arena, "// {s}: warning: " ++ format, .{str} ++ args); | |
| 5202 | try scope.appendNode(try Tag.warning.create(c.arena, value)); | |
| 5203 | } | |
| 5204 | ||
| 5205 | fn fail( | |
| 5206 | c: *Context, | |
| 5207 | err: anytype, | |
| 5208 | source_loc: clang.SourceLocation, | |
| 5209 | comptime format: []const u8, | |
| 5210 | args: anytype, | |
| 5211 | ) (@TypeOf(err) || error{OutOfMemory}) { | |
| 5212 | try warn(c, &c.global_scope.base, source_loc, format, args); | |
| 5213 | return err; | |
| 5214 | } | |
| 5215 | ||
| 5216 | pub fn failDecl(c: *Context, loc: clang.SourceLocation, name: []const u8, comptime format: []const u8, args: anytype) Error!void { | |
| 5217 | // location | |
| 5218 | // pub const name = @compileError(msg); | |
| 5219 | const fail_msg = try std.fmt.allocPrint(c.arena, format, args); | |
| 5220 | try addTopLevelDecl(c, name, try Tag.fail_decl.create(c.arena, .{ .actual = name, .mangled = fail_msg })); | |
| 5221 | const str = try c.locStr(loc); | |
| 5222 | const location_comment = try std.fmt.allocPrint(c.arena, "// {s}", .{str}); | |
| 5223 | try c.global_scope.nodes.append(try Tag.warning.create(c.arena, location_comment)); | |
| 5224 | } | |
| 5225 | ||
| 5226 | const MacroCtx = struct { | |
| 5227 | source: []const u8, | |
| 5228 | list: []const CToken, | |
| 5229 | i: usize = 0, | |
| 5230 | loc: clang.SourceLocation, | |
| 5231 | name: []const u8, | |
| 5232 | refs_var_decl: bool = false, | |
| 5233 | fn_params: ?[]const ast.Payload.Param = null, | |
| 5234 | ||
| 5235 | fn peek(self: *MacroCtx) ?CToken.Id { | |
| 5236 | if (self.i >= self.list.len) return null; | |
| 5237 | return self.list[self.i + 1].id; | |
| 5238 | } | |
| 5239 | ||
| 5240 | fn next(self: *MacroCtx) ?CToken.Id { | |
| 5241 | if (self.i >= self.list.len) return null; | |
| 5242 | self.i += 1; | |
| 5243 | return self.list[self.i].id; | |
| 5244 | } | |
| 5245 | ||
| 5246 | fn skip(self: *MacroCtx, c: *Context, expected_id: CToken.Id) ParseError!void { | |
| 5247 | const next_id = self.next().?; | |
| 5248 | if (next_id != expected_id and !(expected_id == .identifier and next_id == .extended_identifier)) { | |
| 5249 | try self.fail( | |
| 5250 | c, | |
| 5251 | "unable to translate C expr: expected '{s}' instead got '{s}'", | |
| 5252 | .{ expected_id.symbol(), next_id.symbol() }, | |
| 5253 | ); | |
| 5254 | return error.ParseError; | |
| 5255 | } | |
| 5256 | } | |
| 5257 | ||
| 5258 | fn slice(self: *MacroCtx) []const u8 { | |
| 5259 | const tok = self.list[self.i]; | |
| 5260 | return self.source[tok.start..tok.end]; | |
| 5261 | } | |
| 5262 | ||
| 5263 | fn fail(self: *MacroCtx, c: *Context, comptime fmt: []const u8, args: anytype) !void { | |
| 5264 | return failDecl(c, self.loc, self.name, fmt, args); | |
| 5265 | } | |
| 5266 | ||
| 5267 | fn makeSlicer(self: *const MacroCtx) MacroSlicer { | |
| 5268 | return .{ .source = self.source, .tokens = self.list }; | |
| 5269 | } | |
| 5270 | ||
| 5271 | const MacroTranslateError = union(enum) { | |
| 5272 | undefined_identifier: []const u8, | |
| 5273 | invalid_arg_usage: []const u8, | |
| 5274 | }; | |
| 5275 | ||
| 5276 | fn checkTranslatableMacro(self: *MacroCtx, scope: *Scope, params: []const ast.Payload.Param) ?MacroTranslateError { | |
| 5277 | const slicer = self.makeSlicer(); | |
| 5278 | var last_is_type_kw = false; | |
| 5279 | var i: usize = 1; // index 0 is the macro name | |
| 5280 | while (i < self.list.len) : (i += 1) { | |
| 5281 | const token = self.list[i]; | |
| 5282 | switch (token.id) { | |
| 5283 | .period, .arrow => i += 1, // skip next token since field identifiers can be unknown | |
| 5284 | .keyword_struct, .keyword_union, .keyword_enum => if (!last_is_type_kw) { | |
| 5285 | last_is_type_kw = true; | |
| 5286 | continue; | |
| 5287 | }, | |
| 5288 | .identifier, .extended_identifier => { | |
| 5289 | const identifier = slicer.slice(token); | |
| 5290 | const is_param = for (params) |param| { | |
| 5291 | if (param.name != null and mem.eql(u8, identifier, param.name.?)) break true; | |
| 5292 | } else false; | |
| 5293 | if (is_param and last_is_type_kw) { | |
| 5294 | return .{ .invalid_arg_usage = identifier }; | |
| 5295 | } | |
| 5296 | if (!scope.contains(identifier) and !isBuiltinDefined(identifier) and !is_param) { | |
| 5297 | return .{ .undefined_identifier = identifier }; | |
| 5298 | } | |
| 5299 | }, | |
| 5300 | else => {}, | |
| 5301 | } | |
| 5302 | last_is_type_kw = false; | |
| 5303 | } | |
| 5304 | return null; | |
| 5305 | } | |
| 5306 | ||
| 5307 | fn checkFnParam(self: *MacroCtx, str: []const u8) bool { | |
| 5308 | if (self.fn_params == null) return false; | |
| 5309 | ||
| 5310 | for (self.fn_params.?) |param| { | |
| 5311 | if (mem.eql(u8, param.name.?, str)) return true; | |
| 5312 | } | |
| 5313 | return false; | |
| 5314 | } | |
| 5315 | }; | |
| 5316 | ||
| 5317 | fn getMacroText(unit: *const clang.ASTUnit, c: *const Context, macro: *const clang.MacroDefinitionRecord) ![]const u8 { | |
| 5318 | const begin_loc = macro.getSourceRange_getBegin(); | |
| 5319 | const end_loc = clang.Lexer.getLocForEndOfToken(macro.getSourceRange_getEnd(), c.source_manager, unit); | |
| 5320 | ||
| 5321 | const begin_c = c.source_manager.getCharacterData(begin_loc); | |
| 5322 | const end_c = c.source_manager.getCharacterData(end_loc); | |
| 5323 | const slice_len = @intFromPtr(end_c) - @intFromPtr(begin_c); | |
| 5324 | ||
| 5325 | var comp = aro.Compilation.init(c.gpa, std.fs.cwd()); | |
| 5326 | defer comp.deinit(); | |
| 5327 | const result = comp.addSourceFromBuffer("", begin_c[0..slice_len]) catch return error.OutOfMemory; | |
| 5328 | ||
| 5329 | return c.arena.dupe(u8, result.buf); | |
| 5330 | } | |
| 5331 | ||
| 5332 | fn transPreprocessorEntities(c: *Context, unit: *clang.ASTUnit) Error!void { | |
| 5333 | // TODO if we see #undef, delete it from the table | |
| 5334 | var it = unit.getLocalPreprocessingEntities_begin(); | |
| 5335 | const it_end = unit.getLocalPreprocessingEntities_end(); | |
| 5336 | var tok_list = std.array_list.Managed(CToken).init(c.gpa); | |
| 5337 | defer tok_list.deinit(); | |
| 5338 | const scope = c.global_scope; | |
| 5339 | ||
| 5340 | while (it.I != it_end.I) : (it.I += 1) { | |
| 5341 | const entity = it.deref(); | |
| 5342 | tok_list.items.len = 0; | |
| 5343 | switch (entity.getKind()) { | |
| 5344 | .MacroDefinitionKind => { | |
| 5345 | const macro = @as(*clang.MacroDefinitionRecord, @ptrCast(entity)); | |
| 5346 | const raw_name = macro.getName_getNameStart(); | |
| 5347 | const begin_loc = macro.getSourceRange_getBegin(); | |
| 5348 | ||
| 5349 | const name = try c.str(raw_name); | |
| 5350 | if (scope.containsNow(name)) { | |
| 5351 | continue; | |
| 5352 | } | |
| 5353 | ||
| 5354 | const source = try getMacroText(unit, c, macro); | |
| 5355 | ||
| 5356 | try common.tokenizeMacro(source, &tok_list); | |
| 5357 | ||
| 5358 | var macro_ctx = MacroCtx{ | |
| 5359 | .source = source, | |
| 5360 | .list = tok_list.items, | |
| 5361 | .name = name, | |
| 5362 | .loc = begin_loc, | |
| 5363 | }; | |
| 5364 | assert(mem.eql(u8, macro_ctx.slice(), name)); | |
| 5365 | ||
| 5366 | var macro_fn = false; | |
| 5367 | switch (macro_ctx.peek().?) { | |
| 5368 | .identifier, .extended_identifier => { | |
| 5369 | // if it equals itself, ignore. for example, from stdio.h: | |
| 5370 | // #define stdin stdin | |
| 5371 | const tok = macro_ctx.list[1]; | |
| 5372 | if (mem.eql(u8, name, source[tok.start..tok.end])) { | |
| 5373 | assert(!c.global_names.contains(source[tok.start..tok.end])); | |
| 5374 | continue; | |
| 5375 | } | |
| 5376 | }, | |
| 5377 | .nl, .eof => { | |
| 5378 | // this means it is a macro without a value | |
| 5379 | // We define it as an empty string so that it can still be used with ++ | |
| 5380 | const str_node = try Tag.string_literal.create(c.arena, "\"\""); | |
| 5381 | const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = name, .init = str_node }); | |
| 5382 | try addTopLevelDecl(c, name, var_decl); | |
| 5383 | try c.global_scope.blank_macros.put(name, {}); | |
| 5384 | continue; | |
| 5385 | }, | |
| 5386 | .l_paren => { | |
| 5387 | // if the name is immediately followed by a '(' then it is a function | |
| 5388 | macro_fn = macro_ctx.list[0].end == macro_ctx.list[1].start; | |
| 5389 | }, | |
| 5390 | else => {}, | |
| 5391 | } | |
| 5392 | ||
| 5393 | (if (macro_fn) | |
| 5394 | transMacroFnDefine(c, &macro_ctx) | |
| 5395 | else | |
| 5396 | transMacroDefine(c, &macro_ctx)) catch |err| switch (err) { | |
| 5397 | error.ParseError => continue, | |
| 5398 | error.OutOfMemory => |e| return e, | |
| 5399 | }; | |
| 5400 | }, | |
| 5401 | else => {}, | |
| 5402 | } | |
| 5403 | } | |
| 5404 | } | |
| 5405 | ||
| 5406 | fn transMacroDefine(c: *Context, m: *MacroCtx) ParseError!void { | |
| 5407 | const scope = &c.global_scope.base; | |
| 5408 | ||
| 5409 | if (m.checkTranslatableMacro(scope, &.{})) |err| switch (err) { | |
| 5410 | .undefined_identifier => |ident| return m.fail(c, "unable to translate macro: undefined identifier `{s}`", .{ident}), | |
| 5411 | .invalid_arg_usage => unreachable, // no args | |
| 5412 | }; | |
| 5413 | ||
| 5414 | // Check if the macro only uses other blank macros. | |
| 5415 | while (true) { | |
| 5416 | switch (m.peek().?) { | |
| 5417 | .identifier, .extended_identifier => { | |
| 5418 | const tok = m.list[m.i + 1]; | |
| 5419 | const slice = m.source[tok.start..tok.end]; | |
| 5420 | if (c.global_scope.blank_macros.contains(slice)) { | |
| 5421 | m.i += 1; | |
| 5422 | continue; | |
| 5423 | } | |
| 5424 | }, | |
| 5425 | .eof, .nl => { | |
| 5426 | try c.global_scope.blank_macros.put(m.name, {}); | |
| 5427 | const init_node = try Tag.string_literal.create(c.arena, "\"\""); | |
| 5428 | const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = m.name, .init = init_node }); | |
| 5429 | try addTopLevelDecl(c, m.name, var_decl); | |
| 5430 | return; | |
| 5431 | }, | |
| 5432 | else => {}, | |
| 5433 | } | |
| 5434 | break; | |
| 5435 | } | |
| 5436 | ||
| 5437 | const init_node = try parseCExpr(c, m, scope); | |
| 5438 | const last = m.next().?; | |
| 5439 | if (last != .eof and last != .nl) | |
| 5440 | return m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); | |
| 5441 | ||
| 5442 | const node = node: { | |
| 5443 | const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = m.name, .init = init_node }); | |
| 5444 | ||
| 5445 | if (getFnProto(c, var_decl)) |proto_node| { | |
| 5446 | // If a macro aliases a global variable which is a function pointer, we conclude that | |
| 5447 | // the macro is intended to represent a function that assumes the function pointer | |
| 5448 | // variable is non-null and calls it. | |
| 5449 | break :node try transCreateNodeMacroFn(c, m.name, var_decl, proto_node); | |
| 5450 | } else if (m.refs_var_decl) { | |
| 5451 | const return_type = try Tag.typeof.create(c.arena, init_node); | |
| 5452 | const return_expr = try Tag.@"return".create(c.arena, init_node); | |
| 5453 | const block = try Tag.block_single.create(c.arena, return_expr); | |
| 5454 | try warn(c, scope, m.loc, "macro '{s}' contains a runtime value, translated to function", .{m.name}); | |
| 5455 | ||
| 5456 | break :node try Tag.pub_inline_fn.create(c.arena, .{ | |
| 5457 | .name = m.name, | |
| 5458 | .params = &.{}, | |
| 5459 | .return_type = return_type, | |
| 5460 | .body = block, | |
| 5461 | }); | |
| 5462 | } | |
| 5463 | ||
| 5464 | break :node var_decl; | |
| 5465 | }; | |
| 5466 | ||
| 5467 | try addTopLevelDecl(c, m.name, node); | |
| 5468 | } | |
| 5469 | ||
| 5470 | fn transMacroFnDefine(c: *Context, m: *MacroCtx) ParseError!void { | |
| 5471 | const macro_slicer = m.makeSlicer(); | |
| 5472 | if (try c.pattern_list.match(c.gpa, macro_slicer)) |pattern| { | |
| 5473 | const decl = try Tag.pub_var_simple.create(c.arena, .{ | |
| 5474 | .name = m.name, | |
| 5475 | .init = try Tag.helpers_macro.create(c.arena, pattern.impl), | |
| 5476 | }); | |
| 5477 | try addTopLevelDecl(c, m.name, decl); | |
| 5478 | return; | |
| 5479 | } | |
| 5480 | ||
| 5481 | var block_scope = try Scope.Block.init(c, &c.global_scope.base, false); | |
| 5482 | defer block_scope.deinit(); | |
| 5483 | const scope = &block_scope.base; | |
| 5484 | ||
| 5485 | try m.skip(c, .l_paren); | |
| 5486 | ||
| 5487 | var fn_params = std.array_list.Managed(ast.Payload.Param).init(c.gpa); | |
| 5488 | defer fn_params.deinit(); | |
| 5489 | ||
| 5490 | while (true) { | |
| 5491 | if (!m.peek().?.isMacroIdentifier()) break; | |
| 5492 | ||
| 5493 | _ = m.next(); | |
| 5494 | ||
| 5495 | const mangled_name = try block_scope.makeMangledName(c, m.slice()); | |
| 5496 | try fn_params.append(.{ | |
| 5497 | .is_noalias = false, | |
| 5498 | .name = mangled_name, | |
| 5499 | .type = Tag.@"anytype".init(), | |
| 5500 | }); | |
| 5501 | try block_scope.discardVariable(c, mangled_name); | |
| 5502 | if (m.peek().? != .comma) break; | |
| 5503 | _ = m.next(); | |
| 5504 | } | |
| 5505 | ||
| 5506 | m.fn_params = fn_params.items; | |
| 5507 | ||
| 5508 | try m.skip(c, .r_paren); | |
| 5509 | ||
| 5510 | if (m.checkTranslatableMacro(scope, fn_params.items)) |err| switch (err) { | |
| 5511 | .undefined_identifier => |ident| return m.fail(c, "unable to translate macro: undefined identifier `{s}`", .{ident}), | |
| 5512 | .invalid_arg_usage => |ident| return m.fail(c, "unable to translate macro: untranslatable usage of arg `{s}`", .{ident}), | |
| 5513 | }; | |
| 5514 | ||
| 5515 | const expr = try parseCExpr(c, m, scope); | |
| 5516 | const last = m.next().?; | |
| 5517 | if (last != .eof and last != .nl) | |
| 5518 | return m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); | |
| 5519 | ||
| 5520 | const typeof_arg = if (expr.castTag(.block)) |some| blk: { | |
| 5521 | const stmts = some.data.stmts; | |
| 5522 | const blk_last = stmts[stmts.len - 1]; | |
| 5523 | const br = blk_last.castTag(.break_val).?; | |
| 5524 | break :blk br.data.val; | |
| 5525 | } else expr; | |
| 5526 | ||
| 5527 | const return_type = if (typeof_arg.castTag(.helpers_cast) orelse typeof_arg.castTag(.std_mem_zeroinit)) |some| | |
| 5528 | some.data.lhs | |
| 5529 | else if (typeof_arg.castTag(.std_mem_zeroes)) |some| | |
| 5530 | some.data | |
| 5531 | else | |
| 5532 | try Tag.typeof.create(c.arena, typeof_arg); | |
| 5533 | ||
| 5534 | const return_expr = try Tag.@"return".create(c.arena, expr); | |
| 5535 | try block_scope.statements.append(return_expr); | |
| 5536 | ||
| 5537 | const fn_decl = try Tag.pub_inline_fn.create(c.arena, .{ | |
| 5538 | .name = m.name, | |
| 5539 | .params = try c.arena.dupe(ast.Payload.Param, fn_params.items), | |
| 5540 | .return_type = return_type, | |
| 5541 | .body = try block_scope.complete(c), | |
| 5542 | }); | |
| 5543 | try addTopLevelDecl(c, m.name, fn_decl); | |
| 5544 | } | |
| 5545 | ||
| 5546 | const ParseError = Error || error{ParseError}; | |
| 5547 | ||
| 5548 | fn parseCExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 5549 | // TODO parseCAssignExpr here | |
| 5550 | var block_scope = try Scope.Block.init(c, scope, true); | |
| 5551 | defer block_scope.deinit(); | |
| 5552 | ||
| 5553 | const node = try parseCCondExpr(c, m, &block_scope.base); | |
| 5554 | if (m.next().? != .comma) { | |
| 5555 | m.i -= 1; | |
| 5556 | return node; | |
| 5557 | } | |
| 5558 | ||
| 5559 | var last = node; | |
| 5560 | while (true) { | |
| 5561 | // suppress result | |
| 5562 | const ignore = try Tag.discard.create(c.arena, .{ .should_skip = false, .value = last }); | |
| 5563 | try block_scope.statements.append(ignore); | |
| 5564 | ||
| 5565 | last = try parseCCondExpr(c, m, &block_scope.base); | |
| 5566 | if (m.next().? != .comma) { | |
| 5567 | m.i -= 1; | |
| 5568 | break; | |
| 5569 | } | |
| 5570 | } | |
| 5571 | ||
| 5572 | const break_node = try Tag.break_val.create(c.arena, .{ | |
| 5573 | .label = block_scope.label, | |
| 5574 | .val = last, | |
| 5575 | }); | |
| 5576 | try block_scope.statements.append(break_node); | |
| 5577 | return try block_scope.complete(c); | |
| 5578 | } | |
| 5579 | ||
| 5580 | fn parseCNumLit(ctx: *Context, m: *MacroCtx) ParseError!Node { | |
| 5581 | const lit_bytes = m.slice(); | |
| 5582 | var bytes = try std.ArrayListUnmanaged(u8).initCapacity(ctx.arena, lit_bytes.len + 3); | |
| 5583 | ||
| 5584 | const prefix = aro.Tree.Token.NumberPrefix.fromString(lit_bytes); | |
| 5585 | switch (prefix) { | |
| 5586 | .binary => bytes.appendSliceAssumeCapacity("0b"), | |
| 5587 | .octal => bytes.appendSliceAssumeCapacity("0o"), | |
| 5588 | .hex => bytes.appendSliceAssumeCapacity("0x"), | |
| 5589 | .decimal => {}, | |
| 5590 | } | |
| 5591 | ||
| 5592 | const after_prefix = lit_bytes[prefix.stringLen()..]; | |
| 5593 | const after_int = for (after_prefix, 0..) |c, i| switch (c) { | |
| 5594 | '.' => { | |
| 5595 | if (i == 0) { | |
| 5596 | bytes.appendAssumeCapacity('0'); | |
| 5597 | } | |
| 5598 | break after_prefix[i..]; | |
| 5599 | }, | |
| 5600 | 'e', 'E' => { | |
| 5601 | if (prefix != .hex) break after_prefix[i..]; | |
| 5602 | bytes.appendAssumeCapacity(c); | |
| 5603 | }, | |
| 5604 | 'p', 'P' => break after_prefix[i..], | |
| 5605 | '0'...'9', 'a'...'d', 'A'...'D', 'f', 'F' => { | |
| 5606 | if (!prefix.digitAllowed(c)) break after_prefix[i..]; | |
| 5607 | bytes.appendAssumeCapacity(c); | |
| 5608 | }, | |
| 5609 | '\'' => { | |
| 5610 | bytes.appendAssumeCapacity('_'); | |
| 5611 | }, | |
| 5612 | else => break after_prefix[i..], | |
| 5613 | } else ""; | |
| 5614 | ||
| 5615 | const after_frac = frac: { | |
| 5616 | if (after_int.len == 0 or after_int[0] != '.') break :frac after_int; | |
| 5617 | bytes.appendAssumeCapacity('.'); | |
| 5618 | for (after_int[1..], 1..) |c, i| { | |
| 5619 | if (c == '\'') { | |
| 5620 | bytes.appendAssumeCapacity('_'); | |
| 5621 | continue; | |
| 5622 | } | |
| 5623 | if (!prefix.digitAllowed(c)) break :frac after_int[i..]; | |
| 5624 | bytes.appendAssumeCapacity(c); | |
| 5625 | } | |
| 5626 | break :frac ""; | |
| 5627 | }; | |
| 5628 | ||
| 5629 | const suffix_str = exponent: { | |
| 5630 | if (after_frac.len == 0) break :exponent after_frac; | |
| 5631 | switch (after_frac[0]) { | |
| 5632 | 'e', 'E' => {}, | |
| 5633 | 'p', 'P' => if (prefix != .hex) break :exponent after_frac, | |
| 5634 | else => break :exponent after_frac, | |
| 5635 | } | |
| 5636 | bytes.appendAssumeCapacity(after_frac[0]); | |
| 5637 | for (after_frac[1..], 1..) |c, i| switch (c) { | |
| 5638 | '+', '-', '0'...'9' => { | |
| 5639 | bytes.appendAssumeCapacity(c); | |
| 5640 | }, | |
| 5641 | '\'' => { | |
| 5642 | bytes.appendAssumeCapacity('_'); | |
| 5643 | }, | |
| 5644 | else => break :exponent after_frac[i..], | |
| 5645 | }; | |
| 5646 | break :exponent ""; | |
| 5647 | }; | |
| 5648 | ||
| 5649 | const is_float = after_int.len != suffix_str.len; | |
| 5650 | const suffix = aro.Tree.Token.NumberSuffix.fromString(suffix_str, if (is_float) .float else .int) orelse { | |
| 5651 | try m.fail(ctx, "invalid number suffix: '{s}'", .{suffix_str}); | |
| 5652 | return error.ParseError; | |
| 5653 | }; | |
| 5654 | if (suffix.isImaginary()) { | |
| 5655 | try m.fail(ctx, "TODO: imaginary literals", .{}); | |
| 5656 | return error.ParseError; | |
| 5657 | } | |
| 5658 | if (suffix.isBitInt()) { | |
| 5659 | try m.fail(ctx, "TODO: _BitInt literals", .{}); | |
| 5660 | return error.ParseError; | |
| 5661 | } | |
| 5662 | ||
| 5663 | if (is_float) { | |
| 5664 | const type_node = try Tag.type.create(ctx.arena, switch (suffix) { | |
| 5665 | .F16 => "f16", | |
| 5666 | .F => "f32", | |
| 5667 | .None => "f64", | |
| 5668 | .L => "c_longdouble", | |
| 5669 | .W => "f80", | |
| 5670 | .Q, .F128 => "f128", | |
| 5671 | else => unreachable, | |
| 5672 | }); | |
| 5673 | const rhs = try Tag.float_literal.create(ctx.arena, bytes.items); | |
| 5674 | return Tag.as.create(ctx.arena, .{ .lhs = type_node, .rhs = rhs }); | |
| 5675 | } else { | |
| 5676 | const type_node = try Tag.type.create(ctx.arena, switch (suffix) { | |
| 5677 | .None => "c_int", | |
| 5678 | .U => "c_uint", | |
| 5679 | .L => "c_long", | |
| 5680 | .UL => "c_ulong", | |
| 5681 | .LL => "c_longlong", | |
| 5682 | .ULL => "c_ulonglong", | |
| 5683 | else => unreachable, | |
| 5684 | }); | |
| 5685 | const value = std.fmt.parseInt(i128, bytes.items, 0) catch math.maxInt(i128); | |
| 5686 | ||
| 5687 | // make the output less noisy by skipping promoteIntLiteral where | |
| 5688 | // it's guaranteed to not be required because of C standard type constraints | |
| 5689 | const guaranteed_to_fit = switch (suffix) { | |
| 5690 | .None => math.cast(i16, value) != null, | |
| 5691 | .U => math.cast(u16, value) != null, | |
| 5692 | .L => math.cast(i32, value) != null, | |
| 5693 | .UL => math.cast(u32, value) != null, | |
| 5694 | .LL => math.cast(i64, value) != null, | |
| 5695 | .ULL => math.cast(u64, value) != null, | |
| 5696 | else => unreachable, | |
| 5697 | }; | |
| 5698 | ||
| 5699 | const literal_node = try Tag.integer_literal.create(ctx.arena, bytes.items); | |
| 5700 | if (guaranteed_to_fit) { | |
| 5701 | return Tag.as.create(ctx.arena, .{ .lhs = type_node, .rhs = literal_node }); | |
| 5702 | } else { | |
| 5703 | return Tag.helpers_promoteIntLiteral.create(ctx.arena, .{ | |
| 5704 | .type = type_node, | |
| 5705 | .value = literal_node, | |
| 5706 | .base = try Tag.enum_literal.create(ctx.arena, @tagName(prefix)), | |
| 5707 | }); | |
| 5708 | } | |
| 5709 | } | |
| 5710 | } | |
| 5711 | ||
| 5712 | fn zigifyEscapeSequences(ctx: *Context, m: *MacroCtx) ![]const u8 { | |
| 5713 | var source = m.slice(); | |
| 5714 | for (source, 0..) |c, i| { | |
| 5715 | if (c == '\"' or c == '\'') { | |
| 5716 | source = source[i..]; | |
| 5717 | break; | |
| 5718 | } | |
| 5719 | } | |
| 5720 | for (source) |c| { | |
| 5721 | if (c == '\\' or c == '\t') { | |
| 5722 | break; | |
| 5723 | } | |
| 5724 | } else return source; | |
| 5725 | var bytes = try ctx.arena.alloc(u8, source.len * 2); | |
| 5726 | var state: enum { | |
| 5727 | start, | |
| 5728 | escape, | |
| 5729 | hex, | |
| 5730 | octal, | |
| 5731 | } = .start; | |
| 5732 | var i: usize = 0; | |
| 5733 | var count: u8 = 0; | |
| 5734 | var num: u8 = 0; | |
| 5735 | for (source) |c| { | |
| 5736 | switch (state) { | |
| 5737 | .escape => { | |
| 5738 | switch (c) { | |
| 5739 | 'n', 'r', 't', '\\', '\'', '\"' => { | |
| 5740 | bytes[i] = c; | |
| 5741 | }, | |
| 5742 | '0'...'7' => { | |
| 5743 | count += 1; | |
| 5744 | num += c - '0'; | |
| 5745 | state = .octal; | |
| 5746 | bytes[i] = 'x'; | |
| 5747 | }, | |
| 5748 | 'x' => { | |
| 5749 | state = .hex; | |
| 5750 | bytes[i] = 'x'; | |
| 5751 | }, | |
| 5752 | 'a' => { | |
| 5753 | bytes[i] = 'x'; | |
| 5754 | i += 1; | |
| 5755 | bytes[i] = '0'; | |
| 5756 | i += 1; | |
| 5757 | bytes[i] = '7'; | |
| 5758 | }, | |
| 5759 | 'b' => { | |
| 5760 | bytes[i] = 'x'; | |
| 5761 | i += 1; | |
| 5762 | bytes[i] = '0'; | |
| 5763 | i += 1; | |
| 5764 | bytes[i] = '8'; | |
| 5765 | }, | |
| 5766 | 'f' => { | |
| 5767 | bytes[i] = 'x'; | |
| 5768 | i += 1; | |
| 5769 | bytes[i] = '0'; | |
| 5770 | i += 1; | |
| 5771 | bytes[i] = 'C'; | |
| 5772 | }, | |
| 5773 | 'v' => { | |
| 5774 | bytes[i] = 'x'; | |
| 5775 | i += 1; | |
| 5776 | bytes[i] = '0'; | |
| 5777 | i += 1; | |
| 5778 | bytes[i] = 'B'; | |
| 5779 | }, | |
| 5780 | '?' => { | |
| 5781 | i -= 1; | |
| 5782 | bytes[i] = '?'; | |
| 5783 | }, | |
| 5784 | 'u', 'U' => { | |
| 5785 | try m.fail(ctx, "macro tokenizing failed: TODO unicode escape sequences", .{}); | |
| 5786 | return error.ParseError; | |
| 5787 | }, | |
| 5788 | else => { | |
| 5789 | try m.fail(ctx, "macro tokenizing failed: unknown escape sequence", .{}); | |
| 5790 | return error.ParseError; | |
| 5791 | }, | |
| 5792 | } | |
| 5793 | i += 1; | |
| 5794 | if (state == .escape) | |
| 5795 | state = .start; | |
| 5796 | }, | |
| 5797 | .start => { | |
| 5798 | if (c == '\t') { | |
| 5799 | bytes[i] = '\\'; | |
| 5800 | i += 1; | |
| 5801 | bytes[i] = 't'; | |
| 5802 | i += 1; | |
| 5803 | continue; | |
| 5804 | } | |
| 5805 | if (c == '\\') { | |
| 5806 | state = .escape; | |
| 5807 | } | |
| 5808 | bytes[i] = c; | |
| 5809 | i += 1; | |
| 5810 | }, | |
| 5811 | .hex => { | |
| 5812 | switch (c) { | |
| 5813 | '0'...'9' => { | |
| 5814 | num = std.math.mul(u8, num, 16) catch { | |
| 5815 | try m.fail(ctx, "macro tokenizing failed: hex literal overflowed", .{}); | |
| 5816 | return error.ParseError; | |
| 5817 | }; | |
| 5818 | num += c - '0'; | |
| 5819 | }, | |
| 5820 | 'a'...'f' => { | |
| 5821 | num = std.math.mul(u8, num, 16) catch { | |
| 5822 | try m.fail(ctx, "macro tokenizing failed: hex literal overflowed", .{}); | |
| 5823 | return error.ParseError; | |
| 5824 | }; | |
| 5825 | num += c - 'a' + 10; | |
| 5826 | }, | |
| 5827 | 'A'...'F' => { | |
| 5828 | num = std.math.mul(u8, num, 16) catch { | |
| 5829 | try m.fail(ctx, "macro tokenizing failed: hex literal overflowed", .{}); | |
| 5830 | return error.ParseError; | |
| 5831 | }; | |
| 5832 | num += c - 'A' + 10; | |
| 5833 | }, | |
| 5834 | else => { | |
| 5835 | i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); | |
| 5836 | num = 0; | |
| 5837 | if (c == '\\') | |
| 5838 | state = .escape | |
| 5839 | else | |
| 5840 | state = .start; | |
| 5841 | bytes[i] = c; | |
| 5842 | i += 1; | |
| 5843 | }, | |
| 5844 | } | |
| 5845 | }, | |
| 5846 | .octal => { | |
| 5847 | const accept_digit = switch (c) { | |
| 5848 | // The maximum length of a octal literal is 3 digits | |
| 5849 | '0'...'7' => count < 3, | |
| 5850 | else => false, | |
| 5851 | }; | |
| 5852 | ||
| 5853 | if (accept_digit) { | |
| 5854 | count += 1; | |
| 5855 | num = std.math.mul(u8, num, 8) catch { | |
| 5856 | try m.fail(ctx, "macro tokenizing failed: octal literal overflowed", .{}); | |
| 5857 | return error.ParseError; | |
| 5858 | }; | |
| 5859 | num += c - '0'; | |
| 5860 | } else { | |
| 5861 | i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); | |
| 5862 | num = 0; | |
| 5863 | count = 0; | |
| 5864 | if (c == '\\') | |
| 5865 | state = .escape | |
| 5866 | else | |
| 5867 | state = .start; | |
| 5868 | bytes[i] = c; | |
| 5869 | i += 1; | |
| 5870 | } | |
| 5871 | }, | |
| 5872 | } | |
| 5873 | } | |
| 5874 | if (state == .hex or state == .octal) | |
| 5875 | i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); | |
| 5876 | return bytes[0..i]; | |
| 5877 | } | |
| 5878 | ||
| 5879 | /// non-ASCII characters (c > 127) are also treated as non-printable by ascii.hexEscape. | |
| 5880 | /// If a C string literal or char literal in a macro is not valid UTF-8, we need to escape | |
| 5881 | /// non-ASCII characters so that the Zig source we output will itself be UTF-8. | |
| 5882 | fn escapeUnprintables(ctx: *Context, m: *MacroCtx) ![]const u8 { | |
| 5883 | const zigified = try zigifyEscapeSequences(ctx, m); | |
| 5884 | if (std.unicode.utf8ValidateSlice(zigified)) return zigified; | |
| 5885 | ||
| 5886 | const formatter = std.ascii.hexEscape(zigified, .lower); | |
| 5887 | const encoded_size: usize = @intCast(std.fmt.count("{f}", .{formatter})); | |
| 5888 | const output = try ctx.arena.alloc(u8, encoded_size); | |
| 5889 | return std.fmt.bufPrint(output, "{f}", .{formatter}) catch |err| switch (err) { | |
| 5890 | error.NoSpaceLeft => unreachable, | |
| 5891 | else => |e| return e, | |
| 5892 | }; | |
| 5893 | } | |
| 5894 | ||
| 5895 | fn parseCPrimaryExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 5896 | const tok = m.next().?; | |
| 5897 | const slice = m.slice(); | |
| 5898 | switch (tok) { | |
| 5899 | .char_literal, | |
| 5900 | .char_literal_utf_8, | |
| 5901 | .char_literal_utf_16, | |
| 5902 | .char_literal_utf_32, | |
| 5903 | .char_literal_wide, | |
| 5904 | => { | |
| 5905 | if (slice[0] != '\'' or slice[1] == '\\' or slice.len == 3) { | |
| 5906 | return Tag.char_literal.create(c.arena, try escapeUnprintables(c, m)); | |
| 5907 | } else { | |
| 5908 | const str = try std.fmt.allocPrint(c.arena, "0x{x}", .{slice[1 .. slice.len - 1]}); | |
| 5909 | return Tag.integer_literal.create(c.arena, str); | |
| 5910 | } | |
| 5911 | }, | |
| 5912 | .string_literal, | |
| 5913 | .string_literal_utf_16, | |
| 5914 | .string_literal_utf_8, | |
| 5915 | .string_literal_utf_32, | |
| 5916 | .string_literal_wide, | |
| 5917 | => { | |
| 5918 | return Tag.string_literal.create(c.arena, try escapeUnprintables(c, m)); | |
| 5919 | }, | |
| 5920 | .pp_num => { | |
| 5921 | return parseCNumLit(c, m); | |
| 5922 | }, | |
| 5923 | .l_paren => { | |
| 5924 | const inner_node = try parseCExpr(c, m, scope); | |
| 5925 | ||
| 5926 | try m.skip(c, .r_paren); | |
| 5927 | return inner_node; | |
| 5928 | }, | |
| 5929 | else => {}, | |
| 5930 | } | |
| 5931 | ||
| 5932 | // The C preprocessor has no knowledge of C, so C keywords aren't special in macros. | |
| 5933 | // Thus the current token should be treated like an identifier if its name matches a parameter. | |
| 5934 | if (tok == .identifier or tok == .extended_identifier or m.checkFnParam(slice)) { | |
| 5935 | if (c.global_scope.blank_macros.contains(slice)) { | |
| 5936 | return parseCPrimaryExpr(c, m, scope); | |
| 5937 | } | |
| 5938 | const mangled_name = scope.getAlias(slice); | |
| 5939 | if (builtin_typedef_map.get(mangled_name)) |ty| return Tag.type.create(c.arena, ty); | |
| 5940 | const identifier = try Tag.identifier.create(c.arena, mangled_name); | |
| 5941 | scope.skipVariableDiscard(identifier.castTag(.identifier).?.data); | |
| 5942 | refs_var: { | |
| 5943 | const ident_node = c.global_scope.sym_table.get(slice) orelse break :refs_var; | |
| 5944 | const var_decl_node = ident_node.castTag(.var_decl) orelse break :refs_var; | |
| 5945 | if (!var_decl_node.data.is_const) m.refs_var_decl = true; | |
| 5946 | } | |
| 5947 | return identifier; | |
| 5948 | } | |
| 5949 | ||
| 5950 | // for handling type macros (EVIL) | |
| 5951 | // TODO maybe detect and treat type macros as typedefs in parseCSpecifierQualifierList? | |
| 5952 | m.i -= 1; | |
| 5953 | if (try parseCTypeName(c, m, scope, true)) |type_name| { | |
| 5954 | return type_name; | |
| 5955 | } | |
| 5956 | try m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); | |
| 5957 | return error.ParseError; | |
| 5958 | } | |
| 5959 | ||
| 5960 | fn macroIntFromBool(c: *Context, node: Node) !Node { | |
| 5961 | if (!isBoolRes(node)) { | |
| 5962 | return node; | |
| 5963 | } | |
| 5964 | ||
| 5965 | return Tag.int_from_bool.create(c.arena, node); | |
| 5966 | } | |
| 5967 | ||
| 5968 | fn macroIntToBool(c: *Context, node: Node) !Node { | |
| 5969 | if (isBoolRes(node)) { | |
| 5970 | return node; | |
| 5971 | } | |
| 5972 | if (node.tag() == .string_literal) { | |
| 5973 | // @intFromPtr(node) != 0 | |
| 5974 | const int_from_ptr = try Tag.int_from_ptr.create(c.arena, node); | |
| 5975 | return Tag.not_equal.create(c.arena, .{ .lhs = int_from_ptr, .rhs = Tag.zero_literal.init() }); | |
| 5976 | } | |
| 5977 | // node != 0 | |
| 5978 | return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.zero_literal.init() }); | |
| 5979 | } | |
| 5980 | ||
| 5981 | fn parseCCondExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 5982 | const node = try parseCOrExpr(c, m, scope); | |
| 5983 | if (m.peek().? != .question_mark) { | |
| 5984 | return node; | |
| 5985 | } | |
| 5986 | _ = m.next(); | |
| 5987 | ||
| 5988 | const then_body = try parseCOrExpr(c, m, scope); | |
| 5989 | try m.skip(c, .colon); | |
| 5990 | const else_body = try parseCCondExpr(c, m, scope); | |
| 5991 | return Tag.@"if".create(c.arena, .{ .cond = node, .then = then_body, .@"else" = else_body }); | |
| 5992 | } | |
| 5993 | ||
| 5994 | fn parseCOrExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 5995 | var node = try parseCAndExpr(c, m, scope); | |
| 5996 | while (m.next().? == .pipe_pipe) { | |
| 5997 | const lhs = try macroIntToBool(c, node); | |
| 5998 | const rhs = try macroIntToBool(c, try parseCAndExpr(c, m, scope)); | |
| 5999 | node = try Tag.@"or".create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6000 | } | |
| 6001 | m.i -= 1; | |
| 6002 | return node; | |
| 6003 | } | |
| 6004 | ||
| 6005 | fn parseCAndExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6006 | var node = try parseCBitOrExpr(c, m, scope); | |
| 6007 | while (m.next().? == .ampersand_ampersand) { | |
| 6008 | const lhs = try macroIntToBool(c, node); | |
| 6009 | const rhs = try macroIntToBool(c, try parseCBitOrExpr(c, m, scope)); | |
| 6010 | node = try Tag.@"and".create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6011 | } | |
| 6012 | m.i -= 1; | |
| 6013 | return node; | |
| 6014 | } | |
| 6015 | ||
| 6016 | fn parseCBitOrExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6017 | var node = try parseCBitXorExpr(c, m, scope); | |
| 6018 | while (m.next().? == .pipe) { | |
| 6019 | const lhs = try macroIntFromBool(c, node); | |
| 6020 | const rhs = try macroIntFromBool(c, try parseCBitXorExpr(c, m, scope)); | |
| 6021 | node = try Tag.bit_or.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6022 | } | |
| 6023 | m.i -= 1; | |
| 6024 | return node; | |
| 6025 | } | |
| 6026 | ||
| 6027 | fn parseCBitXorExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6028 | var node = try parseCBitAndExpr(c, m, scope); | |
| 6029 | while (m.next().? == .caret) { | |
| 6030 | const lhs = try macroIntFromBool(c, node); | |
| 6031 | const rhs = try macroIntFromBool(c, try parseCBitAndExpr(c, m, scope)); | |
| 6032 | node = try Tag.bit_xor.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6033 | } | |
| 6034 | m.i -= 1; | |
| 6035 | return node; | |
| 6036 | } | |
| 6037 | ||
| 6038 | fn parseCBitAndExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6039 | var node = try parseCEqExpr(c, m, scope); | |
| 6040 | while (m.next().? == .ampersand) { | |
| 6041 | const lhs = try macroIntFromBool(c, node); | |
| 6042 | const rhs = try macroIntFromBool(c, try parseCEqExpr(c, m, scope)); | |
| 6043 | node = try Tag.bit_and.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6044 | } | |
| 6045 | m.i -= 1; | |
| 6046 | return node; | |
| 6047 | } | |
| 6048 | ||
| 6049 | fn parseCEqExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6050 | var node = try parseCRelExpr(c, m, scope); | |
| 6051 | while (true) { | |
| 6052 | switch (m.peek().?) { | |
| 6053 | .bang_equal => { | |
| 6054 | _ = m.next(); | |
| 6055 | const lhs = try macroIntFromBool(c, node); | |
| 6056 | const rhs = try macroIntFromBool(c, try parseCRelExpr(c, m, scope)); | |
| 6057 | node = try Tag.not_equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6058 | }, | |
| 6059 | .equal_equal => { | |
| 6060 | _ = m.next(); | |
| 6061 | const lhs = try macroIntFromBool(c, node); | |
| 6062 | const rhs = try macroIntFromBool(c, try parseCRelExpr(c, m, scope)); | |
| 6063 | node = try Tag.equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6064 | }, | |
| 6065 | else => return node, | |
| 6066 | } | |
| 6067 | } | |
| 6068 | } | |
| 6069 | ||
| 6070 | fn parseCRelExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6071 | var node = try parseCShiftExpr(c, m, scope); | |
| 6072 | while (true) { | |
| 6073 | switch (m.peek().?) { | |
| 6074 | .angle_bracket_right => { | |
| 6075 | _ = m.next(); | |
| 6076 | const lhs = try macroIntFromBool(c, node); | |
| 6077 | const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); | |
| 6078 | node = try Tag.greater_than.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6079 | }, | |
| 6080 | .angle_bracket_right_equal => { | |
| 6081 | _ = m.next(); | |
| 6082 | const lhs = try macroIntFromBool(c, node); | |
| 6083 | const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); | |
| 6084 | node = try Tag.greater_than_equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6085 | }, | |
| 6086 | .angle_bracket_left => { | |
| 6087 | _ = m.next(); | |
| 6088 | const lhs = try macroIntFromBool(c, node); | |
| 6089 | const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); | |
| 6090 | node = try Tag.less_than.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6091 | }, | |
| 6092 | .angle_bracket_left_equal => { | |
| 6093 | _ = m.next(); | |
| 6094 | const lhs = try macroIntFromBool(c, node); | |
| 6095 | const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); | |
| 6096 | node = try Tag.less_than_equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6097 | }, | |
| 6098 | else => return node, | |
| 6099 | } | |
| 6100 | } | |
| 6101 | } | |
| 6102 | ||
| 6103 | fn parseCShiftExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6104 | var node = try parseCAddSubExpr(c, m, scope); | |
| 6105 | while (true) { | |
| 6106 | switch (m.peek().?) { | |
| 6107 | .angle_bracket_angle_bracket_left => { | |
| 6108 | _ = m.next(); | |
| 6109 | const lhs = try macroIntFromBool(c, node); | |
| 6110 | const rhs = try macroIntFromBool(c, try parseCAddSubExpr(c, m, scope)); | |
| 6111 | node = try Tag.shl.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6112 | }, | |
| 6113 | .angle_bracket_angle_bracket_right => { | |
| 6114 | _ = m.next(); | |
| 6115 | const lhs = try macroIntFromBool(c, node); | |
| 6116 | const rhs = try macroIntFromBool(c, try parseCAddSubExpr(c, m, scope)); | |
| 6117 | node = try Tag.shr.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6118 | }, | |
| 6119 | else => return node, | |
| 6120 | } | |
| 6121 | } | |
| 6122 | } | |
| 6123 | ||
| 6124 | fn parseCAddSubExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6125 | var node = try parseCMulExpr(c, m, scope); | |
| 6126 | while (true) { | |
| 6127 | switch (m.peek().?) { | |
| 6128 | .plus => { | |
| 6129 | _ = m.next(); | |
| 6130 | const lhs = try macroIntFromBool(c, node); | |
| 6131 | const rhs = try macroIntFromBool(c, try parseCMulExpr(c, m, scope)); | |
| 6132 | node = try Tag.add.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6133 | }, | |
| 6134 | .minus => { | |
| 6135 | _ = m.next(); | |
| 6136 | const lhs = try macroIntFromBool(c, node); | |
| 6137 | const rhs = try macroIntFromBool(c, try parseCMulExpr(c, m, scope)); | |
| 6138 | node = try Tag.sub.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6139 | }, | |
| 6140 | else => return node, | |
| 6141 | } | |
| 6142 | } | |
| 6143 | } | |
| 6144 | ||
| 6145 | fn parseCMulExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6146 | var node = try parseCCastExpr(c, m, scope); | |
| 6147 | while (true) { | |
| 6148 | switch (m.next().?) { | |
| 6149 | .asterisk => { | |
| 6150 | const lhs = try macroIntFromBool(c, node); | |
| 6151 | const rhs = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); | |
| 6152 | node = try Tag.mul.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); | |
| 6153 | }, | |
| 6154 | .slash => { | |
| 6155 | const lhs = try macroIntFromBool(c, node); | |
| 6156 | const rhs = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); | |
| 6157 | node = try Tag.macro_arithmetic.create(c.arena, .{ .op = .div, .lhs = lhs, .rhs = rhs }); | |
| 6158 | }, | |
| 6159 | .percent => { | |
| 6160 | const lhs = try macroIntFromBool(c, node); | |
| 6161 | const rhs = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); | |
| 6162 | node = try Tag.macro_arithmetic.create(c.arena, .{ .op = .rem, .lhs = lhs, .rhs = rhs }); | |
| 6163 | }, | |
| 6164 | else => { | |
| 6165 | m.i -= 1; | |
| 6166 | return node; | |
| 6167 | }, | |
| 6168 | } | |
| 6169 | } | |
| 6170 | } | |
| 6171 | ||
| 6172 | fn parseCCastExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6173 | switch (m.next().?) { | |
| 6174 | .l_paren => { | |
| 6175 | if (try parseCTypeName(c, m, scope, true)) |type_name| { | |
| 6176 | while (true) { | |
| 6177 | const next_token = m.next().?; | |
| 6178 | switch (next_token) { | |
| 6179 | .r_paren => break, | |
| 6180 | else => |next_tag| { | |
| 6181 | // Skip trailing blank defined before the RParen. | |
| 6182 | if ((next_tag == .identifier or next_tag == .extended_identifier) and | |
| 6183 | c.global_scope.blank_macros.contains(m.slice())) | |
| 6184 | continue; | |
| 6185 | ||
| 6186 | try m.fail( | |
| 6187 | c, | |
| 6188 | "unable to translate C expr: expected ')' instead got '{s}'", | |
| 6189 | .{next_token.symbol()}, | |
| 6190 | ); | |
| 6191 | return error.ParseError; | |
| 6192 | }, | |
| 6193 | } | |
| 6194 | } | |
| 6195 | if (m.peek().? == .l_brace) { | |
| 6196 | // initializer list | |
| 6197 | return parseCPostfixExpr(c, m, scope, type_name); | |
| 6198 | } | |
| 6199 | const node_to_cast = try parseCCastExpr(c, m, scope); | |
| 6200 | return Tag.helpers_cast.create(c.arena, .{ .lhs = type_name, .rhs = node_to_cast }); | |
| 6201 | } | |
| 6202 | }, | |
| 6203 | else => {}, | |
| 6204 | } | |
| 6205 | m.i -= 1; | |
| 6206 | return parseCUnaryExpr(c, m, scope); | |
| 6207 | } | |
| 6208 | ||
| 6209 | // allow_fail is set when unsure if we are parsing a type-name | |
| 6210 | fn parseCTypeName(c: *Context, m: *MacroCtx, scope: *Scope, allow_fail: bool) ParseError!?Node { | |
| 6211 | if (try parseCSpecifierQualifierList(c, m, scope, allow_fail)) |node| { | |
| 6212 | return try parseCAbstractDeclarator(c, m, node); | |
| 6213 | } else { | |
| 6214 | return null; | |
| 6215 | } | |
| 6216 | } | |
| 6217 | ||
| 6218 | fn parseCSpecifierQualifierList(c: *Context, m: *MacroCtx, scope: *Scope, allow_fail: bool) ParseError!?Node { | |
| 6219 | const tok = m.next().?; | |
| 6220 | const slice = m.slice(); | |
| 6221 | const mangled_name = scope.getAlias(slice); | |
| 6222 | if (!m.checkFnParam(mangled_name)) { | |
| 6223 | switch (tok) { | |
| 6224 | .identifier, .extended_identifier => { | |
| 6225 | if (c.global_scope.blank_macros.contains(m.slice())) { | |
| 6226 | return try parseCSpecifierQualifierList(c, m, scope, allow_fail); | |
| 6227 | } | |
| 6228 | if (!allow_fail or c.typedefs.contains(mangled_name)) { | |
| 6229 | if (builtin_typedef_map.get(mangled_name)) |ty| return try Tag.type.create(c.arena, ty); | |
| 6230 | return try Tag.identifier.create(c.arena, mangled_name); | |
| 6231 | } | |
| 6232 | }, | |
| 6233 | .keyword_void => return try Tag.type.create(c.arena, "anyopaque"), | |
| 6234 | .keyword_bool => return try Tag.type.create(c.arena, "bool"), | |
| 6235 | .keyword_char, | |
| 6236 | .keyword_int, | |
| 6237 | .keyword_short, | |
| 6238 | .keyword_long, | |
| 6239 | .keyword_float, | |
| 6240 | .keyword_double, | |
| 6241 | .keyword_signed, | |
| 6242 | .keyword_unsigned, | |
| 6243 | .keyword_complex, | |
| 6244 | => { | |
| 6245 | m.i -= 1; | |
| 6246 | return try parseCNumericType(c, m); | |
| 6247 | }, | |
| 6248 | .keyword_enum, .keyword_struct, .keyword_union => { | |
| 6249 | // struct Foo will be declared as struct_Foo by transRecordDecl | |
| 6250 | try m.skip(c, .identifier); | |
| 6251 | ||
| 6252 | const name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ slice, m.slice() }); | |
| 6253 | return try Tag.identifier.create(c.arena, name); | |
| 6254 | }, | |
| 6255 | else => {}, | |
| 6256 | } | |
| 6257 | } else { | |
| 6258 | if (allow_fail) { | |
| 6259 | m.i -= 1; | |
| 6260 | return null; | |
| 6261 | } else { | |
| 6262 | return try Tag.identifier.create(c.arena, mangled_name); | |
| 6263 | } | |
| 6264 | } | |
| 6265 | ||
| 6266 | if (allow_fail) { | |
| 6267 | m.i -= 1; | |
| 6268 | return null; | |
| 6269 | } else { | |
| 6270 | try m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); | |
| 6271 | return error.ParseError; | |
| 6272 | } | |
| 6273 | } | |
| 6274 | ||
| 6275 | fn parseCNumericType(c: *Context, m: *MacroCtx) ParseError!Node { | |
| 6276 | const KwCounter = struct { | |
| 6277 | double: u8 = 0, | |
| 6278 | long: u8 = 0, | |
| 6279 | int: u8 = 0, | |
| 6280 | float: u8 = 0, | |
| 6281 | short: u8 = 0, | |
| 6282 | char: u8 = 0, | |
| 6283 | unsigned: u8 = 0, | |
| 6284 | signed: u8 = 0, | |
| 6285 | complex: u8 = 0, | |
| 6286 | ||
| 6287 | fn eql(self: @This(), other: @This()) bool { | |
| 6288 | return meta.eql(self, other); | |
| 6289 | } | |
| 6290 | }; | |
| 6291 | ||
| 6292 | // Yes, these can be in *any* order | |
| 6293 | // This still doesn't cover cases where for example volatile is intermixed | |
| 6294 | ||
| 6295 | var kw = KwCounter{}; | |
| 6296 | // prevent overflow | |
| 6297 | var i: u8 = 0; | |
| 6298 | while (i < math.maxInt(u8)) : (i += 1) { | |
| 6299 | switch (m.next().?) { | |
| 6300 | .keyword_double => kw.double += 1, | |
| 6301 | .keyword_long => kw.long += 1, | |
| 6302 | .keyword_int => kw.int += 1, | |
| 6303 | .keyword_float => kw.float += 1, | |
| 6304 | .keyword_short => kw.short += 1, | |
| 6305 | .keyword_char => kw.char += 1, | |
| 6306 | .keyword_unsigned => kw.unsigned += 1, | |
| 6307 | .keyword_signed => kw.signed += 1, | |
| 6308 | .keyword_complex => kw.complex += 1, | |
| 6309 | else => { | |
| 6310 | m.i -= 1; | |
| 6311 | break; | |
| 6312 | }, | |
| 6313 | } | |
| 6314 | } | |
| 6315 | ||
| 6316 | if (kw.eql(.{ .int = 1 }) or kw.eql(.{ .signed = 1 }) or kw.eql(.{ .signed = 1, .int = 1 })) | |
| 6317 | return Tag.type.create(c.arena, "c_int"); | |
| 6318 | ||
| 6319 | if (kw.eql(.{ .unsigned = 1 }) or kw.eql(.{ .unsigned = 1, .int = 1 })) | |
| 6320 | return Tag.type.create(c.arena, "c_uint"); | |
| 6321 | ||
| 6322 | 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 })) | |
| 6323 | return Tag.type.create(c.arena, "c_long"); | |
| 6324 | ||
| 6325 | if (kw.eql(.{ .unsigned = 1, .long = 1 }) or kw.eql(.{ .unsigned = 1, .long = 1, .int = 1 })) | |
| 6326 | return Tag.type.create(c.arena, "c_ulong"); | |
| 6327 | ||
| 6328 | 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 })) | |
| 6329 | return Tag.type.create(c.arena, "c_longlong"); | |
| 6330 | ||
| 6331 | if (kw.eql(.{ .unsigned = 1, .long = 2 }) or kw.eql(.{ .unsigned = 1, .long = 2, .int = 1 })) | |
| 6332 | return Tag.type.create(c.arena, "c_ulonglong"); | |
| 6333 | ||
| 6334 | if (kw.eql(.{ .signed = 1, .char = 1 })) | |
| 6335 | return Tag.type.create(c.arena, "i8"); | |
| 6336 | ||
| 6337 | if (kw.eql(.{ .char = 1 }) or kw.eql(.{ .unsigned = 1, .char = 1 })) | |
| 6338 | return Tag.type.create(c.arena, "u8"); | |
| 6339 | ||
| 6340 | 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 })) | |
| 6341 | return Tag.type.create(c.arena, "c_short"); | |
| 6342 | ||
| 6343 | if (kw.eql(.{ .unsigned = 1, .short = 1 }) or kw.eql(.{ .unsigned = 1, .short = 1, .int = 1 })) | |
| 6344 | return Tag.type.create(c.arena, "c_ushort"); | |
| 6345 | ||
| 6346 | if (kw.eql(.{ .float = 1 })) | |
| 6347 | return Tag.type.create(c.arena, "f32"); | |
| 6348 | ||
| 6349 | if (kw.eql(.{ .double = 1 })) | |
| 6350 | return Tag.type.create(c.arena, "f64"); | |
| 6351 | ||
| 6352 | if (kw.eql(.{ .long = 1, .double = 1 })) { | |
| 6353 | try m.fail(c, "unable to translate: TODO long double", .{}); | |
| 6354 | return error.ParseError; | |
| 6355 | } | |
| 6356 | ||
| 6357 | if (kw.eql(.{ .float = 1, .complex = 1 })) { | |
| 6358 | try m.fail(c, "unable to translate: TODO _Complex", .{}); | |
| 6359 | return error.ParseError; | |
| 6360 | } | |
| 6361 | ||
| 6362 | if (kw.eql(.{ .double = 1, .complex = 1 })) { | |
| 6363 | try m.fail(c, "unable to translate: TODO _Complex", .{}); | |
| 6364 | return error.ParseError; | |
| 6365 | } | |
| 6366 | ||
| 6367 | if (kw.eql(.{ .long = 1, .double = 1, .complex = 1 })) { | |
| 6368 | try m.fail(c, "unable to translate: TODO _Complex", .{}); | |
| 6369 | return error.ParseError; | |
| 6370 | } | |
| 6371 | ||
| 6372 | try m.fail(c, "unable to translate: invalid numeric type", .{}); | |
| 6373 | return error.ParseError; | |
| 6374 | } | |
| 6375 | ||
| 6376 | fn parseCAbstractDeclarator(c: *Context, m: *MacroCtx, node: Node) ParseError!Node { | |
| 6377 | switch (m.next().?) { | |
| 6378 | .asterisk => { | |
| 6379 | // last token of `node` | |
| 6380 | const prev_id = m.list[m.i - 1].id; | |
| 6381 | ||
| 6382 | if (prev_id == .keyword_void) { | |
| 6383 | const ptr = try Tag.single_pointer.create(c.arena, .{ | |
| 6384 | .is_const = false, | |
| 6385 | .is_volatile = false, | |
| 6386 | .elem_type = node, | |
| 6387 | }); | |
| 6388 | return Tag.optional_type.create(c.arena, ptr); | |
| 6389 | } else { | |
| 6390 | return Tag.c_pointer.create(c.arena, .{ | |
| 6391 | .is_const = false, | |
| 6392 | .is_volatile = false, | |
| 6393 | .elem_type = node, | |
| 6394 | }); | |
| 6395 | } | |
| 6396 | }, | |
| 6397 | else => { | |
| 6398 | m.i -= 1; | |
| 6399 | return node; | |
| 6400 | }, | |
| 6401 | } | |
| 6402 | } | |
| 6403 | ||
| 6404 | fn parseCPostfixExpr(c: *Context, m: *MacroCtx, scope: *Scope, type_name: ?Node) ParseError!Node { | |
| 6405 | var node = try parseCPostfixExprInner(c, m, scope, type_name); | |
| 6406 | // In C the preprocessor would handle concatting strings while expanding macros. | |
| 6407 | // This should do approximately the same by concatting any strings and identifiers | |
| 6408 | // after a primary or postfix expression. | |
| 6409 | while (true) { | |
| 6410 | switch (m.peek().?) { | |
| 6411 | .string_literal, | |
| 6412 | .string_literal_utf_16, | |
| 6413 | .string_literal_utf_8, | |
| 6414 | .string_literal_utf_32, | |
| 6415 | .string_literal_wide, | |
| 6416 | => {}, | |
| 6417 | .identifier, .extended_identifier => { | |
| 6418 | const tok = m.list[m.i + 1]; | |
| 6419 | const slice = m.source[tok.start..tok.end]; | |
| 6420 | if (c.global_scope.blank_macros.contains(slice)) { | |
| 6421 | m.i += 1; | |
| 6422 | continue; | |
| 6423 | } | |
| 6424 | }, | |
| 6425 | else => break, | |
| 6426 | } | |
| 6427 | const rhs = try parseCPostfixExprInner(c, m, scope, type_name); | |
| 6428 | node = try Tag.array_cat.create(c.arena, .{ .lhs = node, .rhs = rhs }); | |
| 6429 | } | |
| 6430 | return node; | |
| 6431 | } | |
| 6432 | ||
| 6433 | fn parseCPostfixExprInner(c: *Context, m: *MacroCtx, scope: *Scope, type_name: ?Node) ParseError!Node { | |
| 6434 | var node = type_name orelse try parseCPrimaryExpr(c, m, scope); | |
| 6435 | while (true) { | |
| 6436 | switch (m.next().?) { | |
| 6437 | .period => { | |
| 6438 | try m.skip(c, .identifier); | |
| 6439 | ||
| 6440 | node = try Tag.field_access.create(c.arena, .{ .lhs = node, .field_name = m.slice() }); | |
| 6441 | }, | |
| 6442 | .arrow => { | |
| 6443 | try m.skip(c, .identifier); | |
| 6444 | ||
| 6445 | const deref = try Tag.deref.create(c.arena, node); | |
| 6446 | node = try Tag.field_access.create(c.arena, .{ .lhs = deref, .field_name = m.slice() }); | |
| 6447 | }, | |
| 6448 | .l_bracket => { | |
| 6449 | const index_val = try macroIntFromBool(c, try parseCExpr(c, m, scope)); | |
| 6450 | const index = try Tag.as.create(c.arena, .{ | |
| 6451 | .lhs = try Tag.type.create(c.arena, "usize"), | |
| 6452 | .rhs = try Tag.int_cast.create(c.arena, index_val), | |
| 6453 | }); | |
| 6454 | node = try Tag.array_access.create(c.arena, .{ .lhs = node, .rhs = index }); | |
| 6455 | try m.skip(c, .r_bracket); | |
| 6456 | }, | |
| 6457 | .l_paren => { | |
| 6458 | if (m.peek().? == .r_paren) { | |
| 6459 | m.i += 1; | |
| 6460 | node = try Tag.call.create(c.arena, .{ .lhs = node, .args = &[0]Node{} }); | |
| 6461 | } else { | |
| 6462 | var args = std.array_list.Managed(Node).init(c.gpa); | |
| 6463 | defer args.deinit(); | |
| 6464 | while (true) { | |
| 6465 | const arg = try parseCCondExpr(c, m, scope); | |
| 6466 | try args.append(arg); | |
| 6467 | const next_id = m.next().?; | |
| 6468 | switch (next_id) { | |
| 6469 | .comma => {}, | |
| 6470 | .r_paren => break, | |
| 6471 | else => { | |
| 6472 | try m.fail(c, "unable to translate C expr: expected ',' or ')' instead got '{s}'", .{next_id.symbol()}); | |
| 6473 | return error.ParseError; | |
| 6474 | }, | |
| 6475 | } | |
| 6476 | } | |
| 6477 | node = try Tag.call.create(c.arena, .{ .lhs = node, .args = try c.arena.dupe(Node, args.items) }); | |
| 6478 | } | |
| 6479 | }, | |
| 6480 | .l_brace => { | |
| 6481 | // Check for designated field initializers | |
| 6482 | if (m.peek().? == .period) { | |
| 6483 | var init_vals = std.array_list.Managed(ast.Payload.ContainerInitDot.Initializer).init(c.gpa); | |
| 6484 | defer init_vals.deinit(); | |
| 6485 | ||
| 6486 | while (true) { | |
| 6487 | try m.skip(c, .period); | |
| 6488 | try m.skip(c, .identifier); | |
| 6489 | const name = m.slice(); | |
| 6490 | try m.skip(c, .equal); | |
| 6491 | ||
| 6492 | const val = try parseCCondExpr(c, m, scope); | |
| 6493 | try init_vals.append(.{ .name = name, .value = val }); | |
| 6494 | const next_id = m.next().?; | |
| 6495 | switch (next_id) { | |
| 6496 | .comma => {}, | |
| 6497 | .r_brace => break, | |
| 6498 | else => { | |
| 6499 | try m.fail(c, "unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); | |
| 6500 | return error.ParseError; | |
| 6501 | }, | |
| 6502 | } | |
| 6503 | } | |
| 6504 | const tuple_node = try Tag.container_init_dot.create(c.arena, try c.arena.dupe(ast.Payload.ContainerInitDot.Initializer, init_vals.items)); | |
| 6505 | node = try Tag.std_mem_zeroinit.create(c.arena, .{ .lhs = node, .rhs = tuple_node }); | |
| 6506 | continue; | |
| 6507 | } | |
| 6508 | ||
| 6509 | var init_vals = std.array_list.Managed(Node).init(c.gpa); | |
| 6510 | defer init_vals.deinit(); | |
| 6511 | ||
| 6512 | while (true) { | |
| 6513 | const val = try parseCCondExpr(c, m, scope); | |
| 6514 | try init_vals.append(val); | |
| 6515 | const next_id = m.next().?; | |
| 6516 | switch (next_id) { | |
| 6517 | .comma => {}, | |
| 6518 | .r_brace => break, | |
| 6519 | else => { | |
| 6520 | try m.fail(c, "unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); | |
| 6521 | return error.ParseError; | |
| 6522 | }, | |
| 6523 | } | |
| 6524 | } | |
| 6525 | const tuple_node = try Tag.tuple.create(c.arena, try c.arena.dupe(Node, init_vals.items)); | |
| 6526 | node = try Tag.std_mem_zeroinit.create(c.arena, .{ .lhs = node, .rhs = tuple_node }); | |
| 6527 | }, | |
| 6528 | .plus_plus, .minus_minus => { | |
| 6529 | try m.fail(c, "TODO postfix inc/dec expr", .{}); | |
| 6530 | return error.ParseError; | |
| 6531 | }, | |
| 6532 | else => { | |
| 6533 | m.i -= 1; | |
| 6534 | return node; | |
| 6535 | }, | |
| 6536 | } | |
| 6537 | } | |
| 6538 | } | |
| 6539 | ||
| 6540 | fn parseCUnaryExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { | |
| 6541 | sw: switch (m.next().?) { | |
| 6542 | .bang => { | |
| 6543 | const operand = try macroIntToBool(c, try parseCCastExpr(c, m, scope)); | |
| 6544 | return Tag.not.create(c.arena, operand); | |
| 6545 | }, | |
| 6546 | .minus => { | |
| 6547 | const operand = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); | |
| 6548 | return Tag.negate.create(c.arena, operand); | |
| 6549 | }, | |
| 6550 | .plus => return try parseCCastExpr(c, m, scope), | |
| 6551 | .tilde => { | |
| 6552 | const operand = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); | |
| 6553 | return Tag.bit_not.create(c.arena, operand); | |
| 6554 | }, | |
| 6555 | .asterisk => { | |
| 6556 | const operand = try parseCCastExpr(c, m, scope); | |
| 6557 | return Tag.deref.create(c.arena, operand); | |
| 6558 | }, | |
| 6559 | .ampersand => { | |
| 6560 | const operand = try parseCCastExpr(c, m, scope); | |
| 6561 | return Tag.address_of.create(c.arena, operand); | |
| 6562 | }, | |
| 6563 | .keyword_sizeof => { | |
| 6564 | // 'sizeof' could be used as a parameter to a macro function. | |
| 6565 | if (m.checkFnParam(m.slice())) break :sw; | |
| 6566 | ||
| 6567 | const operand = if (m.peek().? == .l_paren) blk: { | |
| 6568 | _ = m.next(); | |
| 6569 | const inner = (try parseCTypeName(c, m, scope, false)).?; | |
| 6570 | try m.skip(c, .r_paren); | |
| 6571 | break :blk inner; | |
| 6572 | } else try parseCUnaryExpr(c, m, scope); | |
| 6573 | ||
| 6574 | return Tag.helpers_sizeof.create(c.arena, operand); | |
| 6575 | }, | |
| 6576 | .keyword_alignof => { | |
| 6577 | // 'alignof' could be used as a parameter to a macro function. | |
| 6578 | if (m.checkFnParam(m.slice())) break :sw; | |
| 6579 | ||
| 6580 | // TODO this won't work if using <stdalign.h>'s | |
| 6581 | // #define alignof _Alignof | |
| 6582 | try m.skip(c, .l_paren); | |
| 6583 | const operand = (try parseCTypeName(c, m, scope, false)).?; | |
| 6584 | try m.skip(c, .r_paren); | |
| 6585 | ||
| 6586 | return Tag.alignof.create(c.arena, operand); | |
| 6587 | }, | |
| 6588 | .plus_plus, .minus_minus => { | |
| 6589 | try m.fail(c, "TODO unary inc/dec expr", .{}); | |
| 6590 | return error.ParseError; | |
| 6591 | }, | |
| 6592 | else => {}, | |
| 6593 | } | |
| 6594 | ||
| 6595 | m.i -= 1; | |
| 6596 | return try parseCPostfixExpr(c, m, scope, null); | |
| 6597 | } | |
| 6598 | ||
| 6599 | fn getContainer(c: *Context, node: Node) ?Node { | |
| 6600 | switch (node.tag()) { | |
| 6601 | .@"union", | |
| 6602 | .@"struct", | |
| 6603 | .address_of, | |
| 6604 | .bit_not, | |
| 6605 | .not, | |
| 6606 | .optional_type, | |
| 6607 | .negate, | |
| 6608 | .negate_wrap, | |
| 6609 | .array_type, | |
| 6610 | .c_pointer, | |
| 6611 | .single_pointer, | |
| 6612 | => return node, | |
| 6613 | ||
| 6614 | .identifier => { | |
| 6615 | const ident = node.castTag(.identifier).?; | |
| 6616 | if (c.global_scope.sym_table.get(ident.data)) |value| { | |
| 6617 | if (value.castTag(.var_decl)) |var_decl| | |
| 6618 | return getContainer(c, var_decl.data.init.?); | |
| 6619 | if (value.castTag(.var_simple) orelse value.castTag(.pub_var_simple)) |var_decl| | |
| 6620 | return getContainer(c, var_decl.data.init); | |
| 6621 | } | |
| 6622 | }, | |
| 6623 | ||
| 6624 | .field_access => { | |
| 6625 | const field_access = node.castTag(.field_access).?; | |
| 6626 | ||
| 6627 | if (getContainerTypeOf(c, field_access.data.lhs)) |ty_node| { | |
| 6628 | if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { | |
| 6629 | for (container.data.fields) |field| { | |
| 6630 | if (mem.eql(u8, field.name, field_access.data.field_name)) { | |
| 6631 | return getContainer(c, field.type); | |
| 6632 | } | |
| 6633 | } | |
| 6634 | } | |
| 6635 | } | |
| 6636 | }, | |
| 6637 | ||
| 6638 | else => {}, | |
| 6639 | } | |
| 6640 | return null; | |
| 6641 | } | |
| 6642 | ||
| 6643 | fn getContainerTypeOf(c: *Context, ref: Node) ?Node { | |
| 6644 | if (ref.castTag(.identifier)) |ident| { | |
| 6645 | if (c.global_scope.sym_table.get(ident.data)) |value| { | |
| 6646 | if (value.castTag(.var_decl)) |var_decl| { | |
| 6647 | return getContainer(c, var_decl.data.type); | |
| 6648 | } | |
| 6649 | } | |
| 6650 | } else if (ref.castTag(.field_access)) |field_access| { | |
| 6651 | if (getContainerTypeOf(c, field_access.data.lhs)) |ty_node| { | |
| 6652 | if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { | |
| 6653 | for (container.data.fields) |field| { | |
| 6654 | if (mem.eql(u8, field.name, field_access.data.field_name)) { | |
| 6655 | return getContainer(c, field.type); | |
| 6656 | } | |
| 6657 | } | |
| 6658 | } else return ty_node; | |
| 6659 | } | |
| 6660 | } | |
| 6661 | return null; | |
| 6662 | } | |
| 6663 | ||
| 6664 | fn getFnProto(c: *Context, ref: Node) ?*ast.Payload.Func { | |
| 6665 | const init = if (ref.castTag(.var_decl)) |v| | |
| 6666 | v.data.init orelse return null | |
| 6667 | else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| | |
| 6668 | v.data.init | |
| 6669 | else | |
| 6670 | return null; | |
| 6671 | if (getContainerTypeOf(c, init)) |ty_node| { | |
| 6672 | if (ty_node.castTag(.optional_type)) |prefix| { | |
| 6673 | if (prefix.data.castTag(.single_pointer)) |sp| { | |
| 6674 | if (sp.data.elem_type.castTag(.func)) |fn_proto| { | |
| 6675 | return fn_proto; | |
| 6676 | } | |
| 6677 | } | |
| 6678 | } | |
| 6679 | } | |
| 6680 | return null; | |
| 6681 | } |
src/zig_clang.cpp deleted-4197| ... | ... | @@ -1,4197 +0,0 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2019 Andrew Kelley | |
| 3 | * | |
| 4 | * This file is part of zig, which is MIT licensed. | |
| 5 | * See http://opensource.org/licenses/MIT | |
| 6 | */ | |
| 7 | ||
| 8 | ||
| 9 | /* | |
| 10 | * The point of this file is to contain all the Clang C++ API interaction so that: | |
| 11 | * 1. The compile time of other files is kept under control. | |
| 12 | * 2. Provide a C interface to the Clang functions we need for self-hosting purposes. | |
| 13 | * 3. Prevent C++ from infecting the rest of the project. | |
| 14 | */ | |
| 15 | #include "zig_clang.h" | |
| 16 | ||
| 17 | #if __GNUC__ >= 8 | |
| 18 | #pragma GCC diagnostic push | |
| 19 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <clang/Frontend/ASTUnit.h> | |
| 23 | #include <clang/Frontend/CompilerInstance.h> | |
| 24 | #include <clang/AST/APValue.h> | |
| 25 | #include <clang/AST/Attr.h> | |
| 26 | #include <clang/AST/Expr.h> | |
| 27 | #include <clang/AST/RecordLayout.h> | |
| 28 | ||
| 29 | #if __GNUC__ >= 8 | |
| 30 | #pragma GCC diagnostic pop | |
| 31 | #endif | |
| 32 | ||
| 33 | // Detect additions to the enum | |
| 34 | void ZigClang_detect_enum_BO(clang::BinaryOperatorKind op) { | |
| 35 | switch (op) { | |
| 36 | case clang::BO_PtrMemD: | |
| 37 | case clang::BO_PtrMemI: | |
| 38 | case clang::BO_Cmp: | |
| 39 | case clang::BO_Mul: | |
| 40 | case clang::BO_Div: | |
| 41 | case clang::BO_Rem: | |
| 42 | case clang::BO_Add: | |
| 43 | case clang::BO_Sub: | |
| 44 | case clang::BO_Shl: | |
| 45 | case clang::BO_Shr: | |
| 46 | case clang::BO_LT: | |
| 47 | case clang::BO_GT: | |
| 48 | case clang::BO_LE: | |
| 49 | case clang::BO_GE: | |
| 50 | case clang::BO_EQ: | |
| 51 | case clang::BO_NE: | |
| 52 | case clang::BO_And: | |
| 53 | case clang::BO_Xor: | |
| 54 | case clang::BO_Or: | |
| 55 | case clang::BO_LAnd: | |
| 56 | case clang::BO_LOr: | |
| 57 | case clang::BO_Assign: | |
| 58 | case clang::BO_Comma: | |
| 59 | case clang::BO_MulAssign: | |
| 60 | case clang::BO_DivAssign: | |
| 61 | case clang::BO_RemAssign: | |
| 62 | case clang::BO_AddAssign: | |
| 63 | case clang::BO_SubAssign: | |
| 64 | case clang::BO_ShlAssign: | |
| 65 | case clang::BO_ShrAssign: | |
| 66 | case clang::BO_AndAssign: | |
| 67 | case clang::BO_XorAssign: | |
| 68 | case clang::BO_OrAssign: | |
| 69 | break; | |
| 70 | } | |
| 71 | } | |
| 72 | ||
| 73 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Add == clang::BO_Add, ""); | |
| 74 | static_assert((clang::BinaryOperatorKind)ZigClangBO_AddAssign == clang::BO_AddAssign, ""); | |
| 75 | static_assert((clang::BinaryOperatorKind)ZigClangBO_And == clang::BO_And, ""); | |
| 76 | static_assert((clang::BinaryOperatorKind)ZigClangBO_AndAssign == clang::BO_AndAssign, ""); | |
| 77 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Assign == clang::BO_Assign, ""); | |
| 78 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Cmp == clang::BO_Cmp, ""); | |
| 79 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Comma == clang::BO_Comma, ""); | |
| 80 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Div == clang::BO_Div, ""); | |
| 81 | static_assert((clang::BinaryOperatorKind)ZigClangBO_DivAssign == clang::BO_DivAssign, ""); | |
| 82 | static_assert((clang::BinaryOperatorKind)ZigClangBO_EQ == clang::BO_EQ, ""); | |
| 83 | static_assert((clang::BinaryOperatorKind)ZigClangBO_GE == clang::BO_GE, ""); | |
| 84 | static_assert((clang::BinaryOperatorKind)ZigClangBO_GT == clang::BO_GT, ""); | |
| 85 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LAnd == clang::BO_LAnd, ""); | |
| 86 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LE == clang::BO_LE, ""); | |
| 87 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LOr == clang::BO_LOr, ""); | |
| 88 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LT == clang::BO_LT, ""); | |
| 89 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Mul == clang::BO_Mul, ""); | |
| 90 | static_assert((clang::BinaryOperatorKind)ZigClangBO_MulAssign == clang::BO_MulAssign, ""); | |
| 91 | static_assert((clang::BinaryOperatorKind)ZigClangBO_NE == clang::BO_NE, ""); | |
| 92 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Or == clang::BO_Or, ""); | |
| 93 | static_assert((clang::BinaryOperatorKind)ZigClangBO_OrAssign == clang::BO_OrAssign, ""); | |
| 94 | static_assert((clang::BinaryOperatorKind)ZigClangBO_PtrMemD == clang::BO_PtrMemD, ""); | |
| 95 | static_assert((clang::BinaryOperatorKind)ZigClangBO_PtrMemI == clang::BO_PtrMemI, ""); | |
| 96 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Rem == clang::BO_Rem, ""); | |
| 97 | static_assert((clang::BinaryOperatorKind)ZigClangBO_RemAssign == clang::BO_RemAssign, ""); | |
| 98 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Shl == clang::BO_Shl, ""); | |
| 99 | static_assert((clang::BinaryOperatorKind)ZigClangBO_ShlAssign == clang::BO_ShlAssign, ""); | |
| 100 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Shr == clang::BO_Shr, ""); | |
| 101 | static_assert((clang::BinaryOperatorKind)ZigClangBO_ShrAssign == clang::BO_ShrAssign, ""); | |
| 102 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Sub == clang::BO_Sub, ""); | |
| 103 | static_assert((clang::BinaryOperatorKind)ZigClangBO_SubAssign == clang::BO_SubAssign, ""); | |
| 104 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Xor == clang::BO_Xor, ""); | |
| 105 | static_assert((clang::BinaryOperatorKind)ZigClangBO_XorAssign == clang::BO_XorAssign, ""); | |
| 106 | ||
| 107 | // Detect additions to the enum | |
| 108 | void ZigClang_detect_enum_UO(clang::UnaryOperatorKind op) { | |
| 109 | switch (op) { | |
| 110 | case clang::UO_AddrOf: | |
| 111 | case clang::UO_Coawait: | |
| 112 | case clang::UO_Deref: | |
| 113 | case clang::UO_Extension: | |
| 114 | case clang::UO_Imag: | |
| 115 | case clang::UO_LNot: | |
| 116 | case clang::UO_Minus: | |
| 117 | case clang::UO_Not: | |
| 118 | case clang::UO_Plus: | |
| 119 | case clang::UO_PostDec: | |
| 120 | case clang::UO_PostInc: | |
| 121 | case clang::UO_PreDec: | |
| 122 | case clang::UO_PreInc: | |
| 123 | case clang::UO_Real: | |
| 124 | break; | |
| 125 | } | |
| 126 | } | |
| 127 | ||
| 128 | static_assert((clang::UnaryOperatorKind)ZigClangUO_AddrOf == clang::UO_AddrOf, ""); | |
| 129 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Coawait == clang::UO_Coawait, ""); | |
| 130 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Deref == clang::UO_Deref, ""); | |
| 131 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Extension == clang::UO_Extension, ""); | |
| 132 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Imag == clang::UO_Imag, ""); | |
| 133 | static_assert((clang::UnaryOperatorKind)ZigClangUO_LNot == clang::UO_LNot, ""); | |
| 134 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Minus == clang::UO_Minus, ""); | |
| 135 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Not == clang::UO_Not, ""); | |
| 136 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Plus == clang::UO_Plus, ""); | |
| 137 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PostDec == clang::UO_PostDec, ""); | |
| 138 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PostInc == clang::UO_PostInc, ""); | |
| 139 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PreDec == clang::UO_PreDec, ""); | |
| 140 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PreInc == clang::UO_PreInc, ""); | |
| 141 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Real == clang::UO_Real, ""); | |
| 142 | ||
| 143 | // Detect additions to the enum | |
| 144 | void ZigClang_detect_enum_CK(clang::CastKind x) { | |
| 145 | switch (x) { | |
| 146 | case clang::CK_ARCConsumeObject: | |
| 147 | case clang::CK_ARCExtendBlockObject: | |
| 148 | case clang::CK_ARCProduceObject: | |
| 149 | case clang::CK_ARCReclaimReturnedObject: | |
| 150 | case clang::CK_AddressSpaceConversion: | |
| 151 | case clang::CK_AnyPointerToBlockPointerCast: | |
| 152 | case clang::CK_ArrayToPointerDecay: | |
| 153 | case clang::CK_AtomicToNonAtomic: | |
| 154 | case clang::CK_BaseToDerived: | |
| 155 | case clang::CK_BaseToDerivedMemberPointer: | |
| 156 | case clang::CK_BitCast: | |
| 157 | case clang::CK_BlockPointerToObjCPointerCast: | |
| 158 | case clang::CK_BooleanToSignedIntegral: | |
| 159 | case clang::CK_BuiltinFnToFnPtr: | |
| 160 | case clang::CK_CPointerToObjCPointerCast: | |
| 161 | case clang::CK_ConstructorConversion: | |
| 162 | case clang::CK_CopyAndAutoreleaseBlockObject: | |
| 163 | case clang::CK_Dependent: | |
| 164 | case clang::CK_DerivedToBase: | |
| 165 | case clang::CK_DerivedToBaseMemberPointer: | |
| 166 | case clang::CK_Dynamic: | |
| 167 | case clang::CK_FixedPointCast: | |
| 168 | case clang::CK_FixedPointToBoolean: | |
| 169 | case clang::CK_FixedPointToFloating: | |
| 170 | case clang::CK_FixedPointToIntegral: | |
| 171 | case clang::CK_FloatingCast: | |
| 172 | case clang::CK_FloatingComplexCast: | |
| 173 | case clang::CK_FloatingComplexToBoolean: | |
| 174 | case clang::CK_FloatingComplexToIntegralComplex: | |
| 175 | case clang::CK_FloatingComplexToReal: | |
| 176 | case clang::CK_FloatingRealToComplex: | |
| 177 | case clang::CK_FloatingToBoolean: | |
| 178 | case clang::CK_FloatingToFixedPoint: | |
| 179 | case clang::CK_FloatingToIntegral: | |
| 180 | case clang::CK_FunctionToPointerDecay: | |
| 181 | case clang::CK_IntToOCLSampler: | |
| 182 | case clang::CK_IntegralCast: | |
| 183 | case clang::CK_IntegralComplexCast: | |
| 184 | case clang::CK_IntegralComplexToBoolean: | |
| 185 | case clang::CK_IntegralComplexToFloatingComplex: | |
| 186 | case clang::CK_IntegralComplexToReal: | |
| 187 | case clang::CK_IntegralRealToComplex: | |
| 188 | case clang::CK_IntegralToBoolean: | |
| 189 | case clang::CK_IntegralToFixedPoint: | |
| 190 | case clang::CK_IntegralToFloating: | |
| 191 | case clang::CK_IntegralToPointer: | |
| 192 | case clang::CK_LValueBitCast: | |
| 193 | case clang::CK_LValueToRValue: | |
| 194 | case clang::CK_LValueToRValueBitCast: | |
| 195 | case clang::CK_MatrixCast: | |
| 196 | case clang::CK_MemberPointerToBoolean: | |
| 197 | case clang::CK_NoOp: | |
| 198 | case clang::CK_NonAtomicToAtomic: | |
| 199 | case clang::CK_NullToMemberPointer: | |
| 200 | case clang::CK_NullToPointer: | |
| 201 | case clang::CK_ObjCObjectLValueCast: | |
| 202 | case clang::CK_PointerToBoolean: | |
| 203 | case clang::CK_PointerToIntegral: | |
| 204 | case clang::CK_ReinterpretMemberPointer: | |
| 205 | case clang::CK_ToUnion: | |
| 206 | case clang::CK_ToVoid: | |
| 207 | case clang::CK_UncheckedDerivedToBase: | |
| 208 | case clang::CK_UserDefinedConversion: | |
| 209 | case clang::CK_VectorSplat: | |
| 210 | case clang::CK_ZeroToOCLOpaqueType: | |
| 211 | case clang::CK_HLSLVectorTruncation: | |
| 212 | case clang::CK_HLSLArrayRValue: | |
| 213 | break; | |
| 214 | } | |
| 215 | }; | |
| 216 | ||
| 217 | static_assert((clang::CastKind)ZigClangCK_Dependent == clang::CK_Dependent, ""); | |
| 218 | static_assert((clang::CastKind)ZigClangCK_BitCast == clang::CK_BitCast, ""); | |
| 219 | static_assert((clang::CastKind)ZigClangCK_LValueBitCast == clang::CK_LValueBitCast, ""); | |
| 220 | static_assert((clang::CastKind)ZigClangCK_LValueToRValueBitCast == clang::CK_LValueToRValueBitCast, ""); | |
| 221 | static_assert((clang::CastKind)ZigClangCK_LValueToRValue == clang::CK_LValueToRValue, ""); | |
| 222 | static_assert((clang::CastKind)ZigClangCK_NoOp == clang::CK_NoOp, ""); | |
| 223 | static_assert((clang::CastKind)ZigClangCK_BaseToDerived == clang::CK_BaseToDerived, ""); | |
| 224 | static_assert((clang::CastKind)ZigClangCK_DerivedToBase == clang::CK_DerivedToBase, ""); | |
| 225 | static_assert((clang::CastKind)ZigClangCK_UncheckedDerivedToBase == clang::CK_UncheckedDerivedToBase, ""); | |
| 226 | static_assert((clang::CastKind)ZigClangCK_Dynamic == clang::CK_Dynamic, ""); | |
| 227 | static_assert((clang::CastKind)ZigClangCK_ToUnion == clang::CK_ToUnion, ""); | |
| 228 | static_assert((clang::CastKind)ZigClangCK_ArrayToPointerDecay == clang::CK_ArrayToPointerDecay, ""); | |
| 229 | static_assert((clang::CastKind)ZigClangCK_FunctionToPointerDecay == clang::CK_FunctionToPointerDecay, ""); | |
| 230 | static_assert((clang::CastKind)ZigClangCK_NullToPointer == clang::CK_NullToPointer, ""); | |
| 231 | static_assert((clang::CastKind)ZigClangCK_NullToMemberPointer == clang::CK_NullToMemberPointer, ""); | |
| 232 | static_assert((clang::CastKind)ZigClangCK_BaseToDerivedMemberPointer == clang::CK_BaseToDerivedMemberPointer, ""); | |
| 233 | static_assert((clang::CastKind)ZigClangCK_DerivedToBaseMemberPointer == clang::CK_DerivedToBaseMemberPointer, ""); | |
| 234 | static_assert((clang::CastKind)ZigClangCK_MemberPointerToBoolean == clang::CK_MemberPointerToBoolean, ""); | |
| 235 | static_assert((clang::CastKind)ZigClangCK_ReinterpretMemberPointer == clang::CK_ReinterpretMemberPointer, ""); | |
| 236 | static_assert((clang::CastKind)ZigClangCK_UserDefinedConversion == clang::CK_UserDefinedConversion, ""); | |
| 237 | static_assert((clang::CastKind)ZigClangCK_ConstructorConversion == clang::CK_ConstructorConversion, ""); | |
| 238 | static_assert((clang::CastKind)ZigClangCK_IntegralToPointer == clang::CK_IntegralToPointer, ""); | |
| 239 | static_assert((clang::CastKind)ZigClangCK_PointerToIntegral == clang::CK_PointerToIntegral, ""); | |
| 240 | static_assert((clang::CastKind)ZigClangCK_PointerToBoolean == clang::CK_PointerToBoolean, ""); | |
| 241 | static_assert((clang::CastKind)ZigClangCK_ToVoid == clang::CK_ToVoid, ""); | |
| 242 | static_assert((clang::CastKind)ZigClangCK_MatrixCast == clang::CK_MatrixCast, ""); | |
| 243 | static_assert((clang::CastKind)ZigClangCK_VectorSplat == clang::CK_VectorSplat, ""); | |
| 244 | static_assert((clang::CastKind)ZigClangCK_IntegralCast == clang::CK_IntegralCast, ""); | |
| 245 | static_assert((clang::CastKind)ZigClangCK_IntegralToBoolean == clang::CK_IntegralToBoolean, ""); | |
| 246 | static_assert((clang::CastKind)ZigClangCK_IntegralToFloating == clang::CK_IntegralToFloating, ""); | |
| 247 | static_assert((clang::CastKind)ZigClangCK_FloatingToFixedPoint == clang::CK_FloatingToFixedPoint, ""); | |
| 248 | static_assert((clang::CastKind)ZigClangCK_FixedPointToFloating == clang::CK_FixedPointToFloating, ""); | |
| 249 | static_assert((clang::CastKind)ZigClangCK_FixedPointCast == clang::CK_FixedPointCast, ""); | |
| 250 | static_assert((clang::CastKind)ZigClangCK_FixedPointToIntegral == clang::CK_FixedPointToIntegral, ""); | |
| 251 | static_assert((clang::CastKind)ZigClangCK_IntegralToFixedPoint == clang::CK_IntegralToFixedPoint, ""); | |
| 252 | static_assert((clang::CastKind)ZigClangCK_FixedPointToBoolean == clang::CK_FixedPointToBoolean, ""); | |
| 253 | static_assert((clang::CastKind)ZigClangCK_FloatingToIntegral == clang::CK_FloatingToIntegral, ""); | |
| 254 | static_assert((clang::CastKind)ZigClangCK_FloatingToBoolean == clang::CK_FloatingToBoolean, ""); | |
| 255 | static_assert((clang::CastKind)ZigClangCK_BooleanToSignedIntegral == clang::CK_BooleanToSignedIntegral, ""); | |
| 256 | static_assert((clang::CastKind)ZigClangCK_FloatingCast == clang::CK_FloatingCast, ""); | |
| 257 | static_assert((clang::CastKind)ZigClangCK_CPointerToObjCPointerCast == clang::CK_CPointerToObjCPointerCast, ""); | |
| 258 | static_assert((clang::CastKind)ZigClangCK_BlockPointerToObjCPointerCast == clang::CK_BlockPointerToObjCPointerCast, ""); | |
| 259 | static_assert((clang::CastKind)ZigClangCK_AnyPointerToBlockPointerCast == clang::CK_AnyPointerToBlockPointerCast, ""); | |
| 260 | static_assert((clang::CastKind)ZigClangCK_ObjCObjectLValueCast == clang::CK_ObjCObjectLValueCast, ""); | |
| 261 | static_assert((clang::CastKind)ZigClangCK_FloatingRealToComplex == clang::CK_FloatingRealToComplex, ""); | |
| 262 | static_assert((clang::CastKind)ZigClangCK_FloatingComplexToReal == clang::CK_FloatingComplexToReal, ""); | |
| 263 | static_assert((clang::CastKind)ZigClangCK_FloatingComplexToBoolean == clang::CK_FloatingComplexToBoolean, ""); | |
| 264 | static_assert((clang::CastKind)ZigClangCK_FloatingComplexCast == clang::CK_FloatingComplexCast, ""); | |
| 265 | static_assert((clang::CastKind)ZigClangCK_FloatingComplexToIntegralComplex == clang::CK_FloatingComplexToIntegralComplex, ""); | |
| 266 | static_assert((clang::CastKind)ZigClangCK_IntegralRealToComplex == clang::CK_IntegralRealToComplex, ""); | |
| 267 | static_assert((clang::CastKind)ZigClangCK_IntegralComplexToReal == clang::CK_IntegralComplexToReal, ""); | |
| 268 | static_assert((clang::CastKind)ZigClangCK_IntegralComplexToBoolean == clang::CK_IntegralComplexToBoolean, ""); | |
| 269 | static_assert((clang::CastKind)ZigClangCK_IntegralComplexCast == clang::CK_IntegralComplexCast, ""); | |
| 270 | static_assert((clang::CastKind)ZigClangCK_IntegralComplexToFloatingComplex == clang::CK_IntegralComplexToFloatingComplex, ""); | |
| 271 | static_assert((clang::CastKind)ZigClangCK_ARCProduceObject == clang::CK_ARCProduceObject, ""); | |
| 272 | static_assert((clang::CastKind)ZigClangCK_ARCConsumeObject == clang::CK_ARCConsumeObject, ""); | |
| 273 | static_assert((clang::CastKind)ZigClangCK_ARCReclaimReturnedObject == clang::CK_ARCReclaimReturnedObject, ""); | |
| 274 | static_assert((clang::CastKind)ZigClangCK_ARCExtendBlockObject == clang::CK_ARCExtendBlockObject, ""); | |
| 275 | static_assert((clang::CastKind)ZigClangCK_AtomicToNonAtomic == clang::CK_AtomicToNonAtomic, ""); | |
| 276 | static_assert((clang::CastKind)ZigClangCK_NonAtomicToAtomic == clang::CK_NonAtomicToAtomic, ""); | |
| 277 | static_assert((clang::CastKind)ZigClangCK_CopyAndAutoreleaseBlockObject == clang::CK_CopyAndAutoreleaseBlockObject, ""); | |
| 278 | static_assert((clang::CastKind)ZigClangCK_BuiltinFnToFnPtr == clang::CK_BuiltinFnToFnPtr, ""); | |
| 279 | static_assert((clang::CastKind)ZigClangCK_ZeroToOCLOpaqueType == clang::CK_ZeroToOCLOpaqueType, ""); | |
| 280 | static_assert((clang::CastKind)ZigClangCK_AddressSpaceConversion == clang::CK_AddressSpaceConversion, ""); | |
| 281 | static_assert((clang::CastKind)ZigClangCK_IntToOCLSampler == clang::CK_IntToOCLSampler, ""); | |
| 282 | ||
| 283 | // Detect additions to the enum | |
| 284 | void ZigClang_detect_enum_TypeClass(clang::Type::TypeClass ty) { | |
| 285 | switch (ty) { | |
| 286 | case clang::Type::Builtin: | |
| 287 | case clang::Type::Complex: | |
| 288 | case clang::Type::Pointer: | |
| 289 | case clang::Type::BlockPointer: | |
| 290 | case clang::Type::CountAttributed: | |
| 291 | case clang::Type::LValueReference: | |
| 292 | case clang::Type::RValueReference: | |
| 293 | case clang::Type::MemberPointer: | |
| 294 | case clang::Type::ConstantArray: | |
| 295 | case clang::Type::ArrayParameter: | |
| 296 | case clang::Type::IncompleteArray: | |
| 297 | case clang::Type::VariableArray: | |
| 298 | case clang::Type::DependentSizedArray: | |
| 299 | case clang::Type::DependentSizedExtVector: | |
| 300 | case clang::Type::DependentAddressSpace: | |
| 301 | case clang::Type::DependentBitInt: | |
| 302 | case clang::Type::Vector: | |
| 303 | case clang::Type::DependentVector: | |
| 304 | case clang::Type::ExtVector: | |
| 305 | case clang::Type::FunctionProto: | |
| 306 | case clang::Type::FunctionNoProto: | |
| 307 | case clang::Type::UnresolvedUsing: | |
| 308 | case clang::Type::Using: | |
| 309 | case clang::Type::Paren: | |
| 310 | case clang::Type::Typedef: | |
| 311 | case clang::Type::MacroQualified: | |
| 312 | case clang::Type::ConstantMatrix: | |
| 313 | case clang::Type::DependentSizedMatrix: | |
| 314 | case clang::Type::Adjusted: | |
| 315 | case clang::Type::Decayed: | |
| 316 | case clang::Type::TypeOfExpr: | |
| 317 | case clang::Type::TypeOf: | |
| 318 | case clang::Type::Decltype: | |
| 319 | case clang::Type::UnaryTransform: | |
| 320 | case clang::Type::Record: | |
| 321 | case clang::Type::Enum: | |
| 322 | case clang::Type::Elaborated: | |
| 323 | case clang::Type::Attributed: | |
| 324 | case clang::Type::BTFTagAttributed: | |
| 325 | case clang::Type::BitInt: | |
| 326 | case clang::Type::TemplateTypeParm: | |
| 327 | case clang::Type::SubstTemplateTypeParm: | |
| 328 | case clang::Type::SubstTemplateTypeParmPack: | |
| 329 | case clang::Type::TemplateSpecialization: | |
| 330 | case clang::Type::Auto: | |
| 331 | case clang::Type::DeducedTemplateSpecialization: | |
| 332 | case clang::Type::HLSLAttributedResource: | |
| 333 | case clang::Type::HLSLInlineSpirv: | |
| 334 | case clang::Type::InjectedClassName: | |
| 335 | case clang::Type::DependentName: | |
| 336 | case clang::Type::DependentTemplateSpecialization: | |
| 337 | case clang::Type::PackExpansion: | |
| 338 | case clang::Type::PackIndexing: | |
| 339 | case clang::Type::ObjCTypeParam: | |
| 340 | case clang::Type::ObjCObject: | |
| 341 | case clang::Type::ObjCInterface: | |
| 342 | case clang::Type::ObjCObjectPointer: | |
| 343 | case clang::Type::Pipe: | |
| 344 | case clang::Type::Atomic: | |
| 345 | break; | |
| 346 | } | |
| 347 | } | |
| 348 | ||
| 349 | static_assert((clang::Type::TypeClass)ZigClangType_Adjusted == clang::Type::Adjusted, ""); | |
| 350 | static_assert((clang::Type::TypeClass)ZigClangType_Decayed == clang::Type::Decayed, ""); | |
| 351 | static_assert((clang::Type::TypeClass)ZigClangType_ConstantArray == clang::Type::ConstantArray, ""); | |
| 352 | static_assert((clang::Type::TypeClass)ZigClangType_ArrayParameter == clang::Type::ArrayParameter, ""); | |
| 353 | static_assert((clang::Type::TypeClass)ZigClangType_DependentSizedArray == clang::Type::DependentSizedArray, ""); | |
| 354 | static_assert((clang::Type::TypeClass)ZigClangType_IncompleteArray == clang::Type::IncompleteArray, ""); | |
| 355 | static_assert((clang::Type::TypeClass)ZigClangType_VariableArray == clang::Type::VariableArray, ""); | |
| 356 | static_assert((clang::Type::TypeClass)ZigClangType_Atomic == clang::Type::Atomic, ""); | |
| 357 | static_assert((clang::Type::TypeClass)ZigClangType_Attributed == clang::Type::Attributed, ""); | |
| 358 | static_assert((clang::Type::TypeClass)ZigClangType_BTFTagAttributed == clang::Type::BTFTagAttributed, ""); | |
| 359 | static_assert((clang::Type::TypeClass)ZigClangType_BitInt == clang::Type::BitInt, ""); | |
| 360 | static_assert((clang::Type::TypeClass)ZigClangType_BlockPointer == clang::Type::BlockPointer, ""); | |
| 361 | static_assert((clang::Type::TypeClass)ZigClangType_CountAttributed == clang::Type::CountAttributed, ""); | |
| 362 | static_assert((clang::Type::TypeClass)ZigClangType_Builtin == clang::Type::Builtin, ""); | |
| 363 | static_assert((clang::Type::TypeClass)ZigClangType_Complex == clang::Type::Complex, ""); | |
| 364 | static_assert((clang::Type::TypeClass)ZigClangType_Decltype == clang::Type::Decltype, ""); | |
| 365 | static_assert((clang::Type::TypeClass)ZigClangType_Auto == clang::Type::Auto, ""); | |
| 366 | static_assert((clang::Type::TypeClass)ZigClangType_DeducedTemplateSpecialization == clang::Type::DeducedTemplateSpecialization, ""); | |
| 367 | static_assert((clang::Type::TypeClass)ZigClangType_DependentAddressSpace == clang::Type::DependentAddressSpace, ""); | |
| 368 | static_assert((clang::Type::TypeClass)ZigClangType_DependentBitInt == clang::Type::DependentBitInt, ""); | |
| 369 | static_assert((clang::Type::TypeClass)ZigClangType_DependentName == clang::Type::DependentName, ""); | |
| 370 | static_assert((clang::Type::TypeClass)ZigClangType_DependentSizedExtVector == clang::Type::DependentSizedExtVector, ""); | |
| 371 | static_assert((clang::Type::TypeClass)ZigClangType_DependentTemplateSpecialization == clang::Type::DependentTemplateSpecialization, ""); | |
| 372 | static_assert((clang::Type::TypeClass)ZigClangType_DependentVector == clang::Type::DependentVector, ""); | |
| 373 | static_assert((clang::Type::TypeClass)ZigClangType_Elaborated == clang::Type::Elaborated, ""); | |
| 374 | static_assert((clang::Type::TypeClass)ZigClangType_FunctionNoProto == clang::Type::FunctionNoProto, ""); | |
| 375 | static_assert((clang::Type::TypeClass)ZigClangType_FunctionProto == clang::Type::FunctionProto, ""); | |
| 376 | static_assert((clang::Type::TypeClass)ZigClangType_HLSLAttributedResource == clang::Type::HLSLAttributedResource, ""); | |
| 377 | static_assert((clang::Type::TypeClass)ZigClangType_HLSLInlineSpirv == clang::Type::HLSLInlineSpirv, ""); | |
| 378 | static_assert((clang::Type::TypeClass)ZigClangType_InjectedClassName == clang::Type::InjectedClassName, ""); | |
| 379 | static_assert((clang::Type::TypeClass)ZigClangType_MacroQualified == clang::Type::MacroQualified, ""); | |
| 380 | static_assert((clang::Type::TypeClass)ZigClangType_ConstantMatrix == clang::Type::ConstantMatrix, ""); | |
| 381 | static_assert((clang::Type::TypeClass)ZigClangType_DependentSizedMatrix == clang::Type::DependentSizedMatrix, ""); | |
| 382 | static_assert((clang::Type::TypeClass)ZigClangType_MemberPointer == clang::Type::MemberPointer, ""); | |
| 383 | static_assert((clang::Type::TypeClass)ZigClangType_ObjCObjectPointer == clang::Type::ObjCObjectPointer, ""); | |
| 384 | static_assert((clang::Type::TypeClass)ZigClangType_ObjCObject == clang::Type::ObjCObject, ""); | |
| 385 | static_assert((clang::Type::TypeClass)ZigClangType_ObjCInterface == clang::Type::ObjCInterface, ""); | |
| 386 | static_assert((clang::Type::TypeClass)ZigClangType_ObjCTypeParam == clang::Type::ObjCTypeParam, ""); | |
| 387 | static_assert((clang::Type::TypeClass)ZigClangType_PackExpansion == clang::Type::PackExpansion, ""); | |
| 388 | static_assert((clang::Type::TypeClass)ZigClangType_PackIndexing == clang::Type::PackIndexing, ""); | |
| 389 | static_assert((clang::Type::TypeClass)ZigClangType_Paren == clang::Type::Paren, ""); | |
| 390 | static_assert((clang::Type::TypeClass)ZigClangType_Pipe == clang::Type::Pipe, ""); | |
| 391 | static_assert((clang::Type::TypeClass)ZigClangType_Pointer == clang::Type::Pointer, ""); | |
| 392 | static_assert((clang::Type::TypeClass)ZigClangType_LValueReference == clang::Type::LValueReference, ""); | |
| 393 | static_assert((clang::Type::TypeClass)ZigClangType_RValueReference == clang::Type::RValueReference, ""); | |
| 394 | static_assert((clang::Type::TypeClass)ZigClangType_SubstTemplateTypeParmPack == clang::Type::SubstTemplateTypeParmPack, ""); | |
| 395 | static_assert((clang::Type::TypeClass)ZigClangType_SubstTemplateTypeParm == clang::Type::SubstTemplateTypeParm, ""); | |
| 396 | static_assert((clang::Type::TypeClass)ZigClangType_Enum == clang::Type::Enum, ""); | |
| 397 | static_assert((clang::Type::TypeClass)ZigClangType_Record == clang::Type::Record, ""); | |
| 398 | static_assert((clang::Type::TypeClass)ZigClangType_TemplateSpecialization == clang::Type::TemplateSpecialization, ""); | |
| 399 | static_assert((clang::Type::TypeClass)ZigClangType_TemplateTypeParm == clang::Type::TemplateTypeParm, ""); | |
| 400 | static_assert((clang::Type::TypeClass)ZigClangType_TypeOfExpr == clang::Type::TypeOfExpr, ""); | |
| 401 | static_assert((clang::Type::TypeClass)ZigClangType_TypeOf == clang::Type::TypeOf, ""); | |
| 402 | static_assert((clang::Type::TypeClass)ZigClangType_Typedef == clang::Type::Typedef, ""); | |
| 403 | static_assert((clang::Type::TypeClass)ZigClangType_UnaryTransform == clang::Type::UnaryTransform, ""); | |
| 404 | static_assert((clang::Type::TypeClass)ZigClangType_UnresolvedUsing == clang::Type::UnresolvedUsing, ""); | |
| 405 | static_assert((clang::Type::TypeClass)ZigClangType_Using == clang::Type::Using, ""); | |
| 406 | static_assert((clang::Type::TypeClass)ZigClangType_Vector == clang::Type::Vector, ""); | |
| 407 | static_assert((clang::Type::TypeClass)ZigClangType_ExtVector == clang::Type::ExtVector, ""); | |
| 408 | ||
| 409 | // Detect additions to the enum | |
| 410 | void ZigClang_detect_enum_StmtClass(clang::Stmt::StmtClass x) { | |
| 411 | switch (x) { | |
| 412 | case clang::Stmt::NoStmtClass: | |
| 413 | case clang::Stmt::WhileStmtClass: | |
| 414 | case clang::Stmt::LabelStmtClass: | |
| 415 | case clang::Stmt::VAArgExprClass: | |
| 416 | case clang::Stmt::UnaryOperatorClass: | |
| 417 | case clang::Stmt::UnaryExprOrTypeTraitExprClass: | |
| 418 | case clang::Stmt::TypeTraitExprClass: | |
| 419 | case clang::Stmt::SubstNonTypeTemplateParmPackExprClass: | |
| 420 | case clang::Stmt::SubstNonTypeTemplateParmExprClass: | |
| 421 | case clang::Stmt::StringLiteralClass: | |
| 422 | case clang::Stmt::StmtExprClass: | |
| 423 | case clang::Stmt::SourceLocExprClass: | |
| 424 | case clang::Stmt::SizeOfPackExprClass: | |
| 425 | case clang::Stmt::ShuffleVectorExprClass: | |
| 426 | case clang::Stmt::SYCLUniqueStableNameExprClass: | |
| 427 | case clang::Stmt::RequiresExprClass: | |
| 428 | case clang::Stmt::RecoveryExprClass: | |
| 429 | case clang::Stmt::PseudoObjectExprClass: | |
| 430 | case clang::Stmt::PredefinedExprClass: | |
| 431 | case clang::Stmt::ParenListExprClass: | |
| 432 | case clang::Stmt::ParenExprClass: | |
| 433 | case clang::Stmt::PackIndexingExprClass: | |
| 434 | case clang::Stmt::PackExpansionExprClass: | |
| 435 | case clang::Stmt::UnresolvedMemberExprClass: | |
| 436 | case clang::Stmt::UnresolvedLookupExprClass: | |
| 437 | case clang::Stmt::OpenACCAsteriskSizeExprClass: | |
| 438 | case clang::Stmt::OpaqueValueExprClass: | |
| 439 | case clang::Stmt::OffsetOfExprClass: | |
| 440 | case clang::Stmt::ObjCSubscriptRefExprClass: | |
| 441 | case clang::Stmt::ObjCStringLiteralClass: | |
| 442 | case clang::Stmt::ObjCSelectorExprClass: | |
| 443 | case clang::Stmt::ObjCProtocolExprClass: | |
| 444 | case clang::Stmt::ObjCPropertyRefExprClass: | |
| 445 | case clang::Stmt::ObjCMessageExprClass: | |
| 446 | case clang::Stmt::ObjCIvarRefExprClass: | |
| 447 | case clang::Stmt::ObjCIsaExprClass: | |
| 448 | case clang::Stmt::ObjCIndirectCopyRestoreExprClass: | |
| 449 | case clang::Stmt::ObjCEncodeExprClass: | |
| 450 | case clang::Stmt::ObjCDictionaryLiteralClass: | |
| 451 | case clang::Stmt::ObjCBoxedExprClass: | |
| 452 | case clang::Stmt::ObjCBoolLiteralExprClass: | |
| 453 | case clang::Stmt::ObjCAvailabilityCheckExprClass: | |
| 454 | case clang::Stmt::ObjCArrayLiteralClass: | |
| 455 | case clang::Stmt::OMPIteratorExprClass: | |
| 456 | case clang::Stmt::OMPArrayShapingExprClass: | |
| 457 | case clang::Stmt::NoInitExprClass: | |
| 458 | case clang::Stmt::MemberExprClass: | |
| 459 | case clang::Stmt::MatrixSubscriptExprClass: | |
| 460 | case clang::Stmt::MaterializeTemporaryExprClass: | |
| 461 | case clang::Stmt::MSPropertySubscriptExprClass: | |
| 462 | case clang::Stmt::MSPropertyRefExprClass: | |
| 463 | case clang::Stmt::LambdaExprClass: | |
| 464 | case clang::Stmt::IntegerLiteralClass: | |
| 465 | case clang::Stmt::InitListExprClass: | |
| 466 | case clang::Stmt::ImplicitValueInitExprClass: | |
| 467 | case clang::Stmt::ImaginaryLiteralClass: | |
| 468 | case clang::Stmt::HLSLOutArgExprClass: | |
| 469 | case clang::Stmt::GenericSelectionExprClass: | |
| 470 | case clang::Stmt::GNUNullExprClass: | |
| 471 | case clang::Stmt::FunctionParmPackExprClass: | |
| 472 | case clang::Stmt::ExprWithCleanupsClass: | |
| 473 | case clang::Stmt::ConstantExprClass: | |
| 474 | case clang::Stmt::FloatingLiteralClass: | |
| 475 | case clang::Stmt::FixedPointLiteralClass: | |
| 476 | case clang::Stmt::ExtVectorElementExprClass: | |
| 477 | case clang::Stmt::ExpressionTraitExprClass: | |
| 478 | case clang::Stmt::EmbedExprClass: | |
| 479 | case clang::Stmt::DesignatedInitUpdateExprClass: | |
| 480 | case clang::Stmt::DesignatedInitExprClass: | |
| 481 | case clang::Stmt::DependentScopeDeclRefExprClass: | |
| 482 | case clang::Stmt::DependentCoawaitExprClass: | |
| 483 | case clang::Stmt::DeclRefExprClass: | |
| 484 | case clang::Stmt::CoyieldExprClass: | |
| 485 | case clang::Stmt::CoawaitExprClass: | |
| 486 | case clang::Stmt::ConvertVectorExprClass: | |
| 487 | case clang::Stmt::ConceptSpecializationExprClass: | |
| 488 | case clang::Stmt::CompoundLiteralExprClass: | |
| 489 | case clang::Stmt::ChooseExprClass: | |
| 490 | case clang::Stmt::CharacterLiteralClass: | |
| 491 | case clang::Stmt::ImplicitCastExprClass: | |
| 492 | case clang::Stmt::ObjCBridgedCastExprClass: | |
| 493 | case clang::Stmt::CXXStaticCastExprClass: | |
| 494 | case clang::Stmt::CXXReinterpretCastExprClass: | |
| 495 | case clang::Stmt::CXXDynamicCastExprClass: | |
| 496 | case clang::Stmt::CXXConstCastExprClass: | |
| 497 | case clang::Stmt::CXXAddrspaceCastExprClass: | |
| 498 | case clang::Stmt::CXXFunctionalCastExprClass: | |
| 499 | case clang::Stmt::CStyleCastExprClass: | |
| 500 | case clang::Stmt::BuiltinBitCastExprClass: | |
| 501 | case clang::Stmt::CallExprClass: | |
| 502 | case clang::Stmt::UserDefinedLiteralClass: | |
| 503 | case clang::Stmt::CXXOperatorCallExprClass: | |
| 504 | case clang::Stmt::CXXMemberCallExprClass: | |
| 505 | case clang::Stmt::CUDAKernelCallExprClass: | |
| 506 | case clang::Stmt::CXXUuidofExprClass: | |
| 507 | case clang::Stmt::CXXUnresolvedConstructExprClass: | |
| 508 | case clang::Stmt::CXXTypeidExprClass: | |
| 509 | case clang::Stmt::CXXThrowExprClass: | |
| 510 | case clang::Stmt::CXXThisExprClass: | |
| 511 | case clang::Stmt::CXXStdInitializerListExprClass: | |
| 512 | case clang::Stmt::CXXScalarValueInitExprClass: | |
| 513 | case clang::Stmt::CXXRewrittenBinaryOperatorClass: | |
| 514 | case clang::Stmt::CXXPseudoDestructorExprClass: | |
| 515 | case clang::Stmt::CXXParenListInitExprClass: | |
| 516 | case clang::Stmt::CXXNullPtrLiteralExprClass: | |
| 517 | case clang::Stmt::CXXNoexceptExprClass: | |
| 518 | case clang::Stmt::CXXNewExprClass: | |
| 519 | case clang::Stmt::CXXInheritedCtorInitExprClass: | |
| 520 | case clang::Stmt::CXXFoldExprClass: | |
| 521 | case clang::Stmt::CXXDependentScopeMemberExprClass: | |
| 522 | case clang::Stmt::CXXDeleteExprClass: | |
| 523 | case clang::Stmt::CXXDefaultInitExprClass: | |
| 524 | case clang::Stmt::CXXDefaultArgExprClass: | |
| 525 | case clang::Stmt::CXXConstructExprClass: | |
| 526 | case clang::Stmt::CXXTemporaryObjectExprClass: | |
| 527 | case clang::Stmt::CXXBoolLiteralExprClass: | |
| 528 | case clang::Stmt::CXXBindTemporaryExprClass: | |
| 529 | case clang::Stmt::BlockExprClass: | |
| 530 | case clang::Stmt::BinaryOperatorClass: | |
| 531 | case clang::Stmt::CompoundAssignOperatorClass: | |
| 532 | case clang::Stmt::AtomicExprClass: | |
| 533 | case clang::Stmt::AsTypeExprClass: | |
| 534 | case clang::Stmt::ArrayTypeTraitExprClass: | |
| 535 | case clang::Stmt::ArraySubscriptExprClass: | |
| 536 | case clang::Stmt::ArraySectionExprClass: | |
| 537 | case clang::Stmt::ArrayInitLoopExprClass: | |
| 538 | case clang::Stmt::ArrayInitIndexExprClass: | |
| 539 | case clang::Stmt::AddrLabelExprClass: | |
| 540 | case clang::Stmt::ConditionalOperatorClass: | |
| 541 | case clang::Stmt::BinaryConditionalOperatorClass: | |
| 542 | case clang::Stmt::AttributedStmtClass: | |
| 543 | case clang::Stmt::SwitchStmtClass: | |
| 544 | case clang::Stmt::DefaultStmtClass: | |
| 545 | case clang::Stmt::CaseStmtClass: | |
| 546 | case clang::Stmt::SYCLKernelCallStmtClass: | |
| 547 | case clang::Stmt::SEHTryStmtClass: | |
| 548 | case clang::Stmt::SEHLeaveStmtClass: | |
| 549 | case clang::Stmt::SEHFinallyStmtClass: | |
| 550 | case clang::Stmt::SEHExceptStmtClass: | |
| 551 | case clang::Stmt::ReturnStmtClass: | |
| 552 | case clang::Stmt::OpenACCWaitConstructClass: | |
| 553 | case clang::Stmt::OpenACCUpdateConstructClass: | |
| 554 | case clang::Stmt::OpenACCShutdownConstructClass: | |
| 555 | case clang::Stmt::OpenACCSetConstructClass: | |
| 556 | case clang::Stmt::OpenACCInitConstructClass: | |
| 557 | case clang::Stmt::OpenACCExitDataConstructClass: | |
| 558 | case clang::Stmt::OpenACCEnterDataConstructClass: | |
| 559 | case clang::Stmt::OpenACCCacheConstructClass: | |
| 560 | case clang::Stmt::OpenACCLoopConstructClass: | |
| 561 | case clang::Stmt::OpenACCHostDataConstructClass: | |
| 562 | case clang::Stmt::OpenACCDataConstructClass: | |
| 563 | case clang::Stmt::OpenACCComputeConstructClass: | |
| 564 | case clang::Stmt::OpenACCCombinedConstructClass: | |
| 565 | case clang::Stmt::OpenACCAtomicConstructClass: | |
| 566 | case clang::Stmt::ObjCForCollectionStmtClass: | |
| 567 | case clang::Stmt::ObjCAutoreleasePoolStmtClass: | |
| 568 | case clang::Stmt::ObjCAtTryStmtClass: | |
| 569 | case clang::Stmt::ObjCAtThrowStmtClass: | |
| 570 | case clang::Stmt::ObjCAtSynchronizedStmtClass: | |
| 571 | case clang::Stmt::ObjCAtFinallyStmtClass: | |
| 572 | case clang::Stmt::ObjCAtCatchStmtClass: | |
| 573 | case clang::Stmt::OMPTeamsDirectiveClass: | |
| 574 | case clang::Stmt::OMPTaskyieldDirectiveClass: | |
| 575 | case clang::Stmt::OMPTaskwaitDirectiveClass: | |
| 576 | case clang::Stmt::OMPTaskgroupDirectiveClass: | |
| 577 | case clang::Stmt::OMPTaskDirectiveClass: | |
| 578 | case clang::Stmt::OMPTargetUpdateDirectiveClass: | |
| 579 | case clang::Stmt::OMPTargetTeamsDirectiveClass: | |
| 580 | case clang::Stmt::OMPTargetParallelForDirectiveClass: | |
| 581 | case clang::Stmt::OMPTargetParallelDirectiveClass: | |
| 582 | case clang::Stmt::OMPTargetExitDataDirectiveClass: | |
| 583 | case clang::Stmt::OMPTargetEnterDataDirectiveClass: | |
| 584 | case clang::Stmt::OMPTargetDirectiveClass: | |
| 585 | case clang::Stmt::OMPTargetDataDirectiveClass: | |
| 586 | case clang::Stmt::OMPSingleDirectiveClass: | |
| 587 | case clang::Stmt::OMPSectionsDirectiveClass: | |
| 588 | case clang::Stmt::OMPSectionDirectiveClass: | |
| 589 | case clang::Stmt::OMPScopeDirectiveClass: | |
| 590 | case clang::Stmt::OMPScanDirectiveClass: | |
| 591 | case clang::Stmt::OMPParallelSectionsDirectiveClass: | |
| 592 | case clang::Stmt::OMPParallelMasterDirectiveClass: | |
| 593 | case clang::Stmt::OMPParallelMaskedDirectiveClass: | |
| 594 | case clang::Stmt::OMPParallelDirectiveClass: | |
| 595 | case clang::Stmt::OMPOrderedDirectiveClass: | |
| 596 | case clang::Stmt::OMPMetaDirectiveClass: | |
| 597 | case clang::Stmt::OMPMasterDirectiveClass: | |
| 598 | case clang::Stmt::OMPMaskedDirectiveClass: | |
| 599 | case clang::Stmt::OMPUnrollDirectiveClass: | |
| 600 | case clang::Stmt::OMPTileDirectiveClass: | |
| 601 | case clang::Stmt::OMPStripeDirectiveClass: | |
| 602 | case clang::Stmt::OMPReverseDirectiveClass: | |
| 603 | case clang::Stmt::OMPInterchangeDirectiveClass: | |
| 604 | case clang::Stmt::OMPTeamsGenericLoopDirectiveClass: | |
| 605 | case clang::Stmt::OMPTeamsDistributeSimdDirectiveClass: | |
| 606 | case clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass: | |
| 607 | case clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass: | |
| 608 | case clang::Stmt::OMPTeamsDistributeDirectiveClass: | |
| 609 | case clang::Stmt::OMPTaskLoopSimdDirectiveClass: | |
| 610 | case clang::Stmt::OMPTaskLoopDirectiveClass: | |
| 611 | case clang::Stmt::OMPTargetTeamsGenericLoopDirectiveClass: | |
| 612 | case clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass: | |
| 613 | case clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass: | |
| 614 | case clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass: | |
| 615 | case clang::Stmt::OMPTargetTeamsDistributeDirectiveClass: | |
| 616 | case clang::Stmt::OMPTargetSimdDirectiveClass: | |
| 617 | case clang::Stmt::OMPTargetParallelGenericLoopDirectiveClass: | |
| 618 | case clang::Stmt::OMPTargetParallelForSimdDirectiveClass: | |
| 619 | case clang::Stmt::OMPSimdDirectiveClass: | |
| 620 | case clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass: | |
| 621 | case clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass: | |
| 622 | case clang::Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass: | |
| 623 | case clang::Stmt::OMPParallelMaskedTaskLoopDirectiveClass: | |
| 624 | case clang::Stmt::OMPParallelGenericLoopDirectiveClass: | |
| 625 | case clang::Stmt::OMPParallelForSimdDirectiveClass: | |
| 626 | case clang::Stmt::OMPParallelForDirectiveClass: | |
| 627 | case clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass: | |
| 628 | case clang::Stmt::OMPMasterTaskLoopDirectiveClass: | |
| 629 | case clang::Stmt::OMPMaskedTaskLoopSimdDirectiveClass: | |
| 630 | case clang::Stmt::OMPMaskedTaskLoopDirectiveClass: | |
| 631 | case clang::Stmt::OMPGenericLoopDirectiveClass: | |
| 632 | case clang::Stmt::OMPForSimdDirectiveClass: | |
| 633 | case clang::Stmt::OMPForDirectiveClass: | |
| 634 | case clang::Stmt::OMPDistributeSimdDirectiveClass: | |
| 635 | case clang::Stmt::OMPDistributeParallelForSimdDirectiveClass: | |
| 636 | case clang::Stmt::OMPDistributeParallelForDirectiveClass: | |
| 637 | case clang::Stmt::OMPDistributeDirectiveClass: | |
| 638 | case clang::Stmt::OMPInteropDirectiveClass: | |
| 639 | case clang::Stmt::OMPFlushDirectiveClass: | |
| 640 | case clang::Stmt::OMPErrorDirectiveClass: | |
| 641 | case clang::Stmt::OMPDispatchDirectiveClass: | |
| 642 | case clang::Stmt::OMPDepobjDirectiveClass: | |
| 643 | case clang::Stmt::OMPCriticalDirectiveClass: | |
| 644 | case clang::Stmt::OMPCancellationPointDirectiveClass: | |
| 645 | case clang::Stmt::OMPCancelDirectiveClass: | |
| 646 | case clang::Stmt::OMPBarrierDirectiveClass: | |
| 647 | case clang::Stmt::OMPAtomicDirectiveClass: | |
| 648 | case clang::Stmt::OMPAssumeDirectiveClass: | |
| 649 | case clang::Stmt::OMPCanonicalLoopClass: | |
| 650 | case clang::Stmt::NullStmtClass: | |
| 651 | case clang::Stmt::MSDependentExistsStmtClass: | |
| 652 | case clang::Stmt::IndirectGotoStmtClass: | |
| 653 | case clang::Stmt::IfStmtClass: | |
| 654 | case clang::Stmt::GotoStmtClass: | |
| 655 | case clang::Stmt::ForStmtClass: | |
| 656 | case clang::Stmt::DoStmtClass: | |
| 657 | case clang::Stmt::DeclStmtClass: | |
| 658 | case clang::Stmt::CoroutineBodyStmtClass: | |
| 659 | case clang::Stmt::CoreturnStmtClass: | |
| 660 | case clang::Stmt::ContinueStmtClass: | |
| 661 | case clang::Stmt::CompoundStmtClass: | |
| 662 | case clang::Stmt::CapturedStmtClass: | |
| 663 | case clang::Stmt::CXXTryStmtClass: | |
| 664 | case clang::Stmt::CXXForRangeStmtClass: | |
| 665 | case clang::Stmt::CXXCatchStmtClass: | |
| 666 | case clang::Stmt::BreakStmtClass: | |
| 667 | case clang::Stmt::MSAsmStmtClass: | |
| 668 | case clang::Stmt::GCCAsmStmtClass: | |
| 669 | break; | |
| 670 | } | |
| 671 | } | |
| 672 | ||
| 673 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_NoStmtClass == clang::Stmt::NoStmtClass, ""); | |
| 674 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_WhileStmtClass == clang::Stmt::WhileStmtClass, ""); | |
| 675 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_LabelStmtClass == clang::Stmt::LabelStmtClass, ""); | |
| 676 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_VAArgExprClass == clang::Stmt::VAArgExprClass, ""); | |
| 677 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnaryOperatorClass == clang::Stmt::UnaryOperatorClass, ""); | |
| 678 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnaryExprOrTypeTraitExprClass == clang::Stmt::UnaryExprOrTypeTraitExprClass, ""); | |
| 679 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_TypeTraitExprClass == clang::Stmt::TypeTraitExprClass, ""); | |
| 680 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SubstNonTypeTemplateParmPackExprClass == clang::Stmt::SubstNonTypeTemplateParmPackExprClass, ""); | |
| 681 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SubstNonTypeTemplateParmExprClass == clang::Stmt::SubstNonTypeTemplateParmExprClass, ""); | |
| 682 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_StringLiteralClass == clang::Stmt::StringLiteralClass, ""); | |
| 683 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_StmtExprClass == clang::Stmt::StmtExprClass, ""); | |
| 684 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SourceLocExprClass == clang::Stmt::SourceLocExprClass, ""); | |
| 685 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SizeOfPackExprClass == clang::Stmt::SizeOfPackExprClass, ""); | |
| 686 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ShuffleVectorExprClass == clang::Stmt::ShuffleVectorExprClass, ""); | |
| 687 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SYCLUniqueStableNameExprClass == clang::Stmt::SYCLUniqueStableNameExprClass, ""); | |
| 688 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_RequiresExprClass == clang::Stmt::RequiresExprClass, ""); | |
| 689 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_RecoveryExprClass == clang::Stmt::RecoveryExprClass, ""); | |
| 690 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_PseudoObjectExprClass == clang::Stmt::PseudoObjectExprClass, ""); | |
| 691 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_PredefinedExprClass == clang::Stmt::PredefinedExprClass, ""); | |
| 692 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ParenListExprClass == clang::Stmt::ParenListExprClass, ""); | |
| 693 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ParenExprClass == clang::Stmt::ParenExprClass, ""); | |
| 694 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_PackIndexingExprClass == clang::Stmt::PackIndexingExprClass, ""); | |
| 695 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_PackExpansionExprClass == clang::Stmt::PackExpansionExprClass, ""); | |
| 696 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnresolvedMemberExprClass == clang::Stmt::UnresolvedMemberExprClass, ""); | |
| 697 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnresolvedLookupExprClass == clang::Stmt::UnresolvedLookupExprClass, ""); | |
| 698 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCAsteriskSizeExprClass == clang::Stmt::OpenACCAsteriskSizeExprClass, ""); | |
| 699 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpaqueValueExprClass == clang::Stmt::OpaqueValueExprClass, ""); | |
| 700 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OffsetOfExprClass == clang::Stmt::OffsetOfExprClass, ""); | |
| 701 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCSubscriptRefExprClass == clang::Stmt::ObjCSubscriptRefExprClass, ""); | |
| 702 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCStringLiteralClass == clang::Stmt::ObjCStringLiteralClass, ""); | |
| 703 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCSelectorExprClass == clang::Stmt::ObjCSelectorExprClass, ""); | |
| 704 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCProtocolExprClass == clang::Stmt::ObjCProtocolExprClass, ""); | |
| 705 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCPropertyRefExprClass == clang::Stmt::ObjCPropertyRefExprClass, ""); | |
| 706 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCMessageExprClass == clang::Stmt::ObjCMessageExprClass, ""); | |
| 707 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCIvarRefExprClass == clang::Stmt::ObjCIvarRefExprClass, ""); | |
| 708 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCIsaExprClass == clang::Stmt::ObjCIsaExprClass, ""); | |
| 709 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCIndirectCopyRestoreExprClass == clang::Stmt::ObjCIndirectCopyRestoreExprClass, ""); | |
| 710 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCEncodeExprClass == clang::Stmt::ObjCEncodeExprClass, ""); | |
| 711 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCDictionaryLiteralClass == clang::Stmt::ObjCDictionaryLiteralClass, ""); | |
| 712 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCBoxedExprClass == clang::Stmt::ObjCBoxedExprClass, ""); | |
| 713 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCBoolLiteralExprClass == clang::Stmt::ObjCBoolLiteralExprClass, ""); | |
| 714 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAvailabilityCheckExprClass == clang::Stmt::ObjCAvailabilityCheckExprClass, ""); | |
| 715 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCArrayLiteralClass == clang::Stmt::ObjCArrayLiteralClass, ""); | |
| 716 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPIteratorExprClass == clang::Stmt::OMPIteratorExprClass, ""); | |
| 717 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPArrayShapingExprClass == clang::Stmt::OMPArrayShapingExprClass, ""); | |
| 718 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_NoInitExprClass == clang::Stmt::NoInitExprClass, ""); | |
| 719 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MemberExprClass == clang::Stmt::MemberExprClass, ""); | |
| 720 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MatrixSubscriptExprClass == clang::Stmt::MatrixSubscriptExprClass, ""); | |
| 721 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MaterializeTemporaryExprClass == clang::Stmt::MaterializeTemporaryExprClass, ""); | |
| 722 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSPropertySubscriptExprClass == clang::Stmt::MSPropertySubscriptExprClass, ""); | |
| 723 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSPropertyRefExprClass == clang::Stmt::MSPropertyRefExprClass, ""); | |
| 724 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_LambdaExprClass == clang::Stmt::LambdaExprClass, ""); | |
| 725 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IntegerLiteralClass == clang::Stmt::IntegerLiteralClass, ""); | |
| 726 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_InitListExprClass == clang::Stmt::InitListExprClass, ""); | |
| 727 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ImplicitValueInitExprClass == clang::Stmt::ImplicitValueInitExprClass, ""); | |
| 728 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ImaginaryLiteralClass == clang::Stmt::ImaginaryLiteralClass, ""); | |
| 729 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_HLSLOutArgExprClass == clang::Stmt::HLSLOutArgExprClass, ""); | |
| 730 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GenericSelectionExprClass == clang::Stmt::GenericSelectionExprClass, ""); | |
| 731 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GNUNullExprClass == clang::Stmt::GNUNullExprClass, ""); | |
| 732 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_FunctionParmPackExprClass == clang::Stmt::FunctionParmPackExprClass, ""); | |
| 733 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ExprWithCleanupsClass == clang::Stmt::ExprWithCleanupsClass, ""); | |
| 734 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConstantExprClass == clang::Stmt::ConstantExprClass, ""); | |
| 735 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_FloatingLiteralClass == clang::Stmt::FloatingLiteralClass, ""); | |
| 736 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_FixedPointLiteralClass == clang::Stmt::FixedPointLiteralClass, ""); | |
| 737 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ExtVectorElementExprClass == clang::Stmt::ExtVectorElementExprClass, ""); | |
| 738 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ExpressionTraitExprClass == clang::Stmt::ExpressionTraitExprClass, ""); | |
| 739 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_EmbedExprClass == clang::Stmt::EmbedExprClass, ""); | |
| 740 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DesignatedInitUpdateExprClass == clang::Stmt::DesignatedInitUpdateExprClass, ""); | |
| 741 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DesignatedInitExprClass == clang::Stmt::DesignatedInitExprClass, ""); | |
| 742 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DependentScopeDeclRefExprClass == clang::Stmt::DependentScopeDeclRefExprClass, ""); | |
| 743 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DependentCoawaitExprClass == clang::Stmt::DependentCoawaitExprClass, ""); | |
| 744 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DeclRefExprClass == clang::Stmt::DeclRefExprClass, ""); | |
| 745 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoyieldExprClass == clang::Stmt::CoyieldExprClass, ""); | |
| 746 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoawaitExprClass == clang::Stmt::CoawaitExprClass, ""); | |
| 747 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConvertVectorExprClass == clang::Stmt::ConvertVectorExprClass, ""); | |
| 748 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConceptSpecializationExprClass == clang::Stmt::ConceptSpecializationExprClass, ""); | |
| 749 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundLiteralExprClass == clang::Stmt::CompoundLiteralExprClass, ""); | |
| 750 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ChooseExprClass == clang::Stmt::ChooseExprClass, ""); | |
| 751 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CharacterLiteralClass == clang::Stmt::CharacterLiteralClass, ""); | |
| 752 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ImplicitCastExprClass == clang::Stmt::ImplicitCastExprClass, ""); | |
| 753 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCBridgedCastExprClass == clang::Stmt::ObjCBridgedCastExprClass, ""); | |
| 754 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXStaticCastExprClass == clang::Stmt::CXXStaticCastExprClass, ""); | |
| 755 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXReinterpretCastExprClass == clang::Stmt::CXXReinterpretCastExprClass, ""); | |
| 756 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDynamicCastExprClass == clang::Stmt::CXXDynamicCastExprClass, ""); | |
| 757 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXConstCastExprClass == clang::Stmt::CXXConstCastExprClass, ""); | |
| 758 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXAddrspaceCastExprClass == clang::Stmt::CXXAddrspaceCastExprClass, ""); | |
| 759 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXFunctionalCastExprClass == clang::Stmt::CXXFunctionalCastExprClass, ""); | |
| 760 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CStyleCastExprClass == clang::Stmt::CStyleCastExprClass, ""); | |
| 761 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BuiltinBitCastExprClass == clang::Stmt::BuiltinBitCastExprClass, ""); | |
| 762 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CallExprClass == clang::Stmt::CallExprClass, ""); | |
| 763 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_UserDefinedLiteralClass == clang::Stmt::UserDefinedLiteralClass, ""); | |
| 764 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXOperatorCallExprClass == clang::Stmt::CXXOperatorCallExprClass, ""); | |
| 765 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXMemberCallExprClass == clang::Stmt::CXXMemberCallExprClass, ""); | |
| 766 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CUDAKernelCallExprClass == clang::Stmt::CUDAKernelCallExprClass, ""); | |
| 767 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXUuidofExprClass == clang::Stmt::CXXUuidofExprClass, ""); | |
| 768 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXUnresolvedConstructExprClass == clang::Stmt::CXXUnresolvedConstructExprClass, ""); | |
| 769 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTypeidExprClass == clang::Stmt::CXXTypeidExprClass, ""); | |
| 770 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXThrowExprClass == clang::Stmt::CXXThrowExprClass, ""); | |
| 771 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXThisExprClass == clang::Stmt::CXXThisExprClass, ""); | |
| 772 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXStdInitializerListExprClass == clang::Stmt::CXXStdInitializerListExprClass, ""); | |
| 773 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXScalarValueInitExprClass == clang::Stmt::CXXScalarValueInitExprClass, ""); | |
| 774 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXRewrittenBinaryOperatorClass == clang::Stmt::CXXRewrittenBinaryOperatorClass, ""); | |
| 775 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXPseudoDestructorExprClass == clang::Stmt::CXXPseudoDestructorExprClass, ""); | |
| 776 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXParenListInitExprClass == clang::Stmt::CXXParenListInitExprClass, ""); | |
| 777 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXNullPtrLiteralExprClass == clang::Stmt::CXXNullPtrLiteralExprClass, ""); | |
| 778 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXNoexceptExprClass == clang::Stmt::CXXNoexceptExprClass, ""); | |
| 779 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXNewExprClass == clang::Stmt::CXXNewExprClass, ""); | |
| 780 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXInheritedCtorInitExprClass == clang::Stmt::CXXInheritedCtorInitExprClass, ""); | |
| 781 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXFoldExprClass == clang::Stmt::CXXFoldExprClass, ""); | |
| 782 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDependentScopeMemberExprClass == clang::Stmt::CXXDependentScopeMemberExprClass, ""); | |
| 783 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDeleteExprClass == clang::Stmt::CXXDeleteExprClass, ""); | |
| 784 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDefaultInitExprClass == clang::Stmt::CXXDefaultInitExprClass, ""); | |
| 785 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDefaultArgExprClass == clang::Stmt::CXXDefaultArgExprClass, ""); | |
| 786 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXConstructExprClass == clang::Stmt::CXXConstructExprClass, ""); | |
| 787 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTemporaryObjectExprClass == clang::Stmt::CXXTemporaryObjectExprClass, ""); | |
| 788 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXBoolLiteralExprClass == clang::Stmt::CXXBoolLiteralExprClass, ""); | |
| 789 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXBindTemporaryExprClass == clang::Stmt::CXXBindTemporaryExprClass, ""); | |
| 790 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BlockExprClass == clang::Stmt::BlockExprClass, ""); | |
| 791 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BinaryOperatorClass == clang::Stmt::BinaryOperatorClass, ""); | |
| 792 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundAssignOperatorClass == clang::Stmt::CompoundAssignOperatorClass, ""); | |
| 793 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_AtomicExprClass == clang::Stmt::AtomicExprClass, ""); | |
| 794 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_AsTypeExprClass == clang::Stmt::AsTypeExprClass, ""); | |
| 795 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArrayTypeTraitExprClass == clang::Stmt::ArrayTypeTraitExprClass, ""); | |
| 796 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArraySubscriptExprClass == clang::Stmt::ArraySubscriptExprClass, ""); | |
| 797 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArraySectionExprClass == clang::Stmt::ArraySectionExprClass, ""); | |
| 798 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArrayInitLoopExprClass == clang::Stmt::ArrayInitLoopExprClass, ""); | |
| 799 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArrayInitIndexExprClass == clang::Stmt::ArrayInitIndexExprClass, ""); | |
| 800 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_AddrLabelExprClass == clang::Stmt::AddrLabelExprClass, ""); | |
| 801 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConditionalOperatorClass == clang::Stmt::ConditionalOperatorClass, ""); | |
| 802 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BinaryConditionalOperatorClass == clang::Stmt::BinaryConditionalOperatorClass, ""); | |
| 803 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_AttributedStmtClass == clang::Stmt::AttributedStmtClass, ""); | |
| 804 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SwitchStmtClass == clang::Stmt::SwitchStmtClass, ""); | |
| 805 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DefaultStmtClass == clang::Stmt::DefaultStmtClass, ""); | |
| 806 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CaseStmtClass == clang::Stmt::CaseStmtClass, ""); | |
| 807 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SYCLKernelCallStmtClass == clang::Stmt::SYCLKernelCallStmtClass, ""); | |
| 808 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHTryStmtClass == clang::Stmt::SEHTryStmtClass, ""); | |
| 809 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHLeaveStmtClass == clang::Stmt::SEHLeaveStmtClass, ""); | |
| 810 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHFinallyStmtClass == clang::Stmt::SEHFinallyStmtClass, ""); | |
| 811 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHExceptStmtClass == clang::Stmt::SEHExceptStmtClass, ""); | |
| 812 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ReturnStmtClass == clang::Stmt::ReturnStmtClass, ""); | |
| 813 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCWaitConstructClass == clang::Stmt::OpenACCWaitConstructClass, ""); | |
| 814 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCUpdateConstructClass == clang::Stmt::OpenACCUpdateConstructClass, ""); | |
| 815 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCShutdownConstructClass == clang::Stmt::OpenACCShutdownConstructClass, ""); | |
| 816 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCSetConstructClass == clang::Stmt::OpenACCSetConstructClass, ""); | |
| 817 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCInitConstructClass == clang::Stmt::OpenACCInitConstructClass, ""); | |
| 818 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCExitDataConstructClass == clang::Stmt::OpenACCExitDataConstructClass, ""); | |
| 819 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCEnterDataConstructClass == clang::Stmt::OpenACCEnterDataConstructClass, ""); | |
| 820 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCCacheConstructClass == clang::Stmt::OpenACCCacheConstructClass, ""); | |
| 821 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCLoopConstructClass == clang::Stmt::OpenACCLoopConstructClass, ""); | |
| 822 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCHostDataConstructClass == clang::Stmt::OpenACCHostDataConstructClass, ""); | |
| 823 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCDataConstructClass == clang::Stmt::OpenACCDataConstructClass, ""); | |
| 824 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCComputeConstructClass == clang::Stmt::OpenACCComputeConstructClass, ""); | |
| 825 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCCombinedConstructClass == clang::Stmt::OpenACCCombinedConstructClass, ""); | |
| 826 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCAtomicConstructClass == clang::Stmt::OpenACCAtomicConstructClass, ""); | |
| 827 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCForCollectionStmtClass == clang::Stmt::ObjCForCollectionStmtClass, ""); | |
| 828 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAutoreleasePoolStmtClass == clang::Stmt::ObjCAutoreleasePoolStmtClass, ""); | |
| 829 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtTryStmtClass == clang::Stmt::ObjCAtTryStmtClass, ""); | |
| 830 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtThrowStmtClass == clang::Stmt::ObjCAtThrowStmtClass, ""); | |
| 831 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtSynchronizedStmtClass == clang::Stmt::ObjCAtSynchronizedStmtClass, ""); | |
| 832 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtFinallyStmtClass == clang::Stmt::ObjCAtFinallyStmtClass, ""); | |
| 833 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtCatchStmtClass == clang::Stmt::ObjCAtCatchStmtClass, ""); | |
| 834 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDirectiveClass == clang::Stmt::OMPTeamsDirectiveClass, ""); | |
| 835 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskyieldDirectiveClass == clang::Stmt::OMPTaskyieldDirectiveClass, ""); | |
| 836 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskwaitDirectiveClass == clang::Stmt::OMPTaskwaitDirectiveClass, ""); | |
| 837 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskgroupDirectiveClass == clang::Stmt::OMPTaskgroupDirectiveClass, ""); | |
| 838 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskDirectiveClass == clang::Stmt::OMPTaskDirectiveClass, ""); | |
| 839 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetUpdateDirectiveClass == clang::Stmt::OMPTargetUpdateDirectiveClass, ""); | |
| 840 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDirectiveClass == clang::Stmt::OMPTargetTeamsDirectiveClass, ""); | |
| 841 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelForDirectiveClass == clang::Stmt::OMPTargetParallelForDirectiveClass, ""); | |
| 842 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelDirectiveClass == clang::Stmt::OMPTargetParallelDirectiveClass, ""); | |
| 843 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetExitDataDirectiveClass == clang::Stmt::OMPTargetExitDataDirectiveClass, ""); | |
| 844 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetEnterDataDirectiveClass == clang::Stmt::OMPTargetEnterDataDirectiveClass, ""); | |
| 845 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetDirectiveClass == clang::Stmt::OMPTargetDirectiveClass, ""); | |
| 846 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetDataDirectiveClass == clang::Stmt::OMPTargetDataDirectiveClass, ""); | |
| 847 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSingleDirectiveClass == clang::Stmt::OMPSingleDirectiveClass, ""); | |
| 848 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSectionsDirectiveClass == clang::Stmt::OMPSectionsDirectiveClass, ""); | |
| 849 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSectionDirectiveClass == clang::Stmt::OMPSectionDirectiveClass, ""); | |
| 850 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPScopeDirectiveClass == clang::Stmt::OMPScopeDirectiveClass, ""); | |
| 851 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPScanDirectiveClass == clang::Stmt::OMPScanDirectiveClass, ""); | |
| 852 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelSectionsDirectiveClass == clang::Stmt::OMPParallelSectionsDirectiveClass, ""); | |
| 853 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterDirectiveClass == clang::Stmt::OMPParallelMasterDirectiveClass, ""); | |
| 854 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedDirectiveClass == clang::Stmt::OMPParallelMaskedDirectiveClass, ""); | |
| 855 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelDirectiveClass == clang::Stmt::OMPParallelDirectiveClass, ""); | |
| 856 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPOrderedDirectiveClass == clang::Stmt::OMPOrderedDirectiveClass, ""); | |
| 857 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMetaDirectiveClass == clang::Stmt::OMPMetaDirectiveClass, ""); | |
| 858 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterDirectiveClass == clang::Stmt::OMPMasterDirectiveClass, ""); | |
| 859 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedDirectiveClass == clang::Stmt::OMPMaskedDirectiveClass, ""); | |
| 860 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPUnrollDirectiveClass == clang::Stmt::OMPUnrollDirectiveClass, ""); | |
| 861 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTileDirectiveClass == clang::Stmt::OMPTileDirectiveClass, ""); | |
| 862 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPStripeDirectiveClass == clang::Stmt::OMPStripeDirectiveClass, ""); | |
| 863 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPReverseDirectiveClass == clang::Stmt::OMPReverseDirectiveClass, ""); | |
| 864 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPInterchangeDirectiveClass == clang::Stmt::OMPInterchangeDirectiveClass, ""); | |
| 865 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsGenericLoopDirectiveClass == clang::Stmt::OMPTeamsGenericLoopDirectiveClass, ""); | |
| 866 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeSimdDirectiveClass, ""); | |
| 867 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass, ""); | |
| 868 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass, ""); | |
| 869 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeDirectiveClass == clang::Stmt::OMPTeamsDistributeDirectiveClass, ""); | |
| 870 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopSimdDirectiveClass == clang::Stmt::OMPTaskLoopSimdDirectiveClass, ""); | |
| 871 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopDirectiveClass == clang::Stmt::OMPTaskLoopDirectiveClass, ""); | |
| 872 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsGenericLoopDirectiveClass == clang::Stmt::OMPTargetTeamsGenericLoopDirectiveClass, ""); | |
| 873 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass, ""); | |
| 874 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass, ""); | |
| 875 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass, ""); | |
| 876 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeDirectiveClass, ""); | |
| 877 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetSimdDirectiveClass == clang::Stmt::OMPTargetSimdDirectiveClass, ""); | |
| 878 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelGenericLoopDirectiveClass == clang::Stmt::OMPTargetParallelGenericLoopDirectiveClass, ""); | |
| 879 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelForSimdDirectiveClass == clang::Stmt::OMPTargetParallelForSimdDirectiveClass, ""); | |
| 880 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSimdDirectiveClass == clang::Stmt::OMPSimdDirectiveClass, ""); | |
| 881 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass, ""); | |
| 882 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass, ""); | |
| 883 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass, ""); | |
| 884 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedTaskLoopDirectiveClass == clang::Stmt::OMPParallelMaskedTaskLoopDirectiveClass, ""); | |
| 885 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelGenericLoopDirectiveClass == clang::Stmt::OMPParallelGenericLoopDirectiveClass, ""); | |
| 886 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForSimdDirectiveClass == clang::Stmt::OMPParallelForSimdDirectiveClass, ""); | |
| 887 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForDirectiveClass == clang::Stmt::OMPParallelForDirectiveClass, ""); | |
| 888 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass, ""); | |
| 889 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopDirectiveClass == clang::Stmt::OMPMasterTaskLoopDirectiveClass, ""); | |
| 890 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedTaskLoopSimdDirectiveClass == clang::Stmt::OMPMaskedTaskLoopSimdDirectiveClass, ""); | |
| 891 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedTaskLoopDirectiveClass == clang::Stmt::OMPMaskedTaskLoopDirectiveClass, ""); | |
| 892 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPGenericLoopDirectiveClass == clang::Stmt::OMPGenericLoopDirectiveClass, ""); | |
| 893 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForSimdDirectiveClass == clang::Stmt::OMPForSimdDirectiveClass, ""); | |
| 894 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForDirectiveClass == clang::Stmt::OMPForDirectiveClass, ""); | |
| 895 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeSimdDirectiveClass == clang::Stmt::OMPDistributeSimdDirectiveClass, ""); | |
| 896 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPDistributeParallelForSimdDirectiveClass, ""); | |
| 897 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeParallelForDirectiveClass == clang::Stmt::OMPDistributeParallelForDirectiveClass, ""); | |
| 898 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeDirectiveClass == clang::Stmt::OMPDistributeDirectiveClass, ""); | |
| 899 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPInteropDirectiveClass == clang::Stmt::OMPInteropDirectiveClass, ""); | |
| 900 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPFlushDirectiveClass == clang::Stmt::OMPFlushDirectiveClass, ""); | |
| 901 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPErrorDirectiveClass == clang::Stmt::OMPErrorDirectiveClass, ""); | |
| 902 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDispatchDirectiveClass == clang::Stmt::OMPDispatchDirectiveClass, ""); | |
| 903 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDepobjDirectiveClass == clang::Stmt::OMPDepobjDirectiveClass, ""); | |
| 904 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCriticalDirectiveClass == clang::Stmt::OMPCriticalDirectiveClass, ""); | |
| 905 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCancellationPointDirectiveClass == clang::Stmt::OMPCancellationPointDirectiveClass, ""); | |
| 906 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCancelDirectiveClass == clang::Stmt::OMPCancelDirectiveClass, ""); | |
| 907 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPBarrierDirectiveClass == clang::Stmt::OMPBarrierDirectiveClass, ""); | |
| 908 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPAtomicDirectiveClass == clang::Stmt::OMPAtomicDirectiveClass, ""); | |
| 909 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPAssumeDirectiveClass == clang::Stmt::OMPAssumeDirectiveClass, ""); | |
| 910 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCanonicalLoopClass == clang::Stmt::OMPCanonicalLoopClass, ""); | |
| 911 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_NullStmtClass == clang::Stmt::NullStmtClass, ""); | |
| 912 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSDependentExistsStmtClass == clang::Stmt::MSDependentExistsStmtClass, ""); | |
| 913 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IndirectGotoStmtClass == clang::Stmt::IndirectGotoStmtClass, ""); | |
| 914 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IfStmtClass == clang::Stmt::IfStmtClass, ""); | |
| 915 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GotoStmtClass == clang::Stmt::GotoStmtClass, ""); | |
| 916 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ForStmtClass == clang::Stmt::ForStmtClass, ""); | |
| 917 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DoStmtClass == clang::Stmt::DoStmtClass, ""); | |
| 918 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DeclStmtClass == clang::Stmt::DeclStmtClass, ""); | |
| 919 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoroutineBodyStmtClass == clang::Stmt::CoroutineBodyStmtClass, ""); | |
| 920 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoreturnStmtClass == clang::Stmt::CoreturnStmtClass, ""); | |
| 921 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ContinueStmtClass == clang::Stmt::ContinueStmtClass, ""); | |
| 922 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundStmtClass == clang::Stmt::CompoundStmtClass, ""); | |
| 923 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CapturedStmtClass == clang::Stmt::CapturedStmtClass, ""); | |
| 924 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTryStmtClass == clang::Stmt::CXXTryStmtClass, ""); | |
| 925 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXForRangeStmtClass == clang::Stmt::CXXForRangeStmtClass, ""); | |
| 926 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXCatchStmtClass == clang::Stmt::CXXCatchStmtClass, ""); | |
| 927 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BreakStmtClass == clang::Stmt::BreakStmtClass, ""); | |
| 928 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSAsmStmtClass == clang::Stmt::MSAsmStmtClass, ""); | |
| 929 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GCCAsmStmtClass == clang::Stmt::GCCAsmStmtClass, ""); | |
| 930 | ||
| 931 | void ZigClang_detect_enum_APValueKind(clang::APValue::ValueKind x) { | |
| 932 | switch (x) { | |
| 933 | case clang::APValue::None: | |
| 934 | case clang::APValue::Indeterminate: | |
| 935 | case clang::APValue::Int: | |
| 936 | case clang::APValue::Float: | |
| 937 | case clang::APValue::FixedPoint: | |
| 938 | case clang::APValue::ComplexInt: | |
| 939 | case clang::APValue::ComplexFloat: | |
| 940 | case clang::APValue::LValue: | |
| 941 | case clang::APValue::Vector: | |
| 942 | case clang::APValue::Array: | |
| 943 | case clang::APValue::Struct: | |
| 944 | case clang::APValue::Union: | |
| 945 | case clang::APValue::MemberPointer: | |
| 946 | case clang::APValue::AddrLabelDiff: | |
| 947 | break; | |
| 948 | } | |
| 949 | } | |
| 950 | ||
| 951 | static_assert((clang::APValue::ValueKind)ZigClangAPValueNone == clang::APValue::None, ""); | |
| 952 | static_assert((clang::APValue::ValueKind)ZigClangAPValueIndeterminate == clang::APValue::Indeterminate, ""); | |
| 953 | static_assert((clang::APValue::ValueKind)ZigClangAPValueInt == clang::APValue::Int, ""); | |
| 954 | static_assert((clang::APValue::ValueKind)ZigClangAPValueFloat == clang::APValue::Float, ""); | |
| 955 | static_assert((clang::APValue::ValueKind)ZigClangAPValueFixedPoint == clang::APValue::FixedPoint, ""); | |
| 956 | static_assert((clang::APValue::ValueKind)ZigClangAPValueComplexInt == clang::APValue::ComplexInt, ""); | |
| 957 | static_assert((clang::APValue::ValueKind)ZigClangAPValueComplexFloat == clang::APValue::ComplexFloat, ""); | |
| 958 | static_assert((clang::APValue::ValueKind)ZigClangAPValueLValue == clang::APValue::LValue, ""); | |
| 959 | static_assert((clang::APValue::ValueKind)ZigClangAPValueVector == clang::APValue::Vector, ""); | |
| 960 | static_assert((clang::APValue::ValueKind)ZigClangAPValueArray == clang::APValue::Array, ""); | |
| 961 | static_assert((clang::APValue::ValueKind)ZigClangAPValueStruct == clang::APValue::Struct, ""); | |
| 962 | static_assert((clang::APValue::ValueKind)ZigClangAPValueUnion == clang::APValue::Union, ""); | |
| 963 | static_assert((clang::APValue::ValueKind)ZigClangAPValueMemberPointer == clang::APValue::MemberPointer, ""); | |
| 964 | static_assert((clang::APValue::ValueKind)ZigClangAPValueAddrLabelDiff == clang::APValue::AddrLabelDiff, ""); | |
| 965 | ||
| 966 | ||
| 967 | void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) { | |
| 968 | switch (x) { | |
| 969 | case clang::Decl::TranslationUnit: | |
| 970 | case clang::Decl::RequiresExprBody: | |
| 971 | case clang::Decl::OutlinedFunction: | |
| 972 | case clang::Decl::LinkageSpec: | |
| 973 | case clang::Decl::ExternCContext: | |
| 974 | case clang::Decl::Export: | |
| 975 | case clang::Decl::Captured: | |
| 976 | case clang::Decl::Block: | |
| 977 | case clang::Decl::TopLevelStmt: | |
| 978 | case clang::Decl::StaticAssert: | |
| 979 | case clang::Decl::PragmaDetectMismatch: | |
| 980 | case clang::Decl::PragmaComment: | |
| 981 | case clang::Decl::OpenACCRoutine: | |
| 982 | case clang::Decl::OpenACCDeclare: | |
| 983 | case clang::Decl::ObjCPropertyImpl: | |
| 984 | case clang::Decl::OMPThreadPrivate: | |
| 985 | case clang::Decl::OMPRequires: | |
| 986 | case clang::Decl::OMPAllocate: | |
| 987 | case clang::Decl::ObjCMethod: | |
| 988 | case clang::Decl::ObjCProtocol: | |
| 989 | case clang::Decl::ObjCInterface: | |
| 990 | case clang::Decl::ObjCImplementation: | |
| 991 | case clang::Decl::ObjCCategoryImpl: | |
| 992 | case clang::Decl::ObjCCategory: | |
| 993 | case clang::Decl::Namespace: | |
| 994 | case clang::Decl::HLSLBuffer: | |
| 995 | case clang::Decl::OMPDeclareReduction: | |
| 996 | case clang::Decl::OMPDeclareMapper: | |
| 997 | case clang::Decl::UnresolvedUsingValue: | |
| 998 | case clang::Decl::UnnamedGlobalConstant: | |
| 999 | case clang::Decl::TemplateParamObject: | |
| 1000 | case clang::Decl::MSGuid: | |
| 1001 | case clang::Decl::IndirectField: | |
| 1002 | case clang::Decl::EnumConstant: | |
| 1003 | case clang::Decl::Function: | |
| 1004 | case clang::Decl::CXXMethod: | |
| 1005 | case clang::Decl::CXXDestructor: | |
| 1006 | case clang::Decl::CXXConversion: | |
| 1007 | case clang::Decl::CXXConstructor: | |
| 1008 | case clang::Decl::CXXDeductionGuide: | |
| 1009 | case clang::Decl::Var: | |
| 1010 | case clang::Decl::VarTemplateSpecialization: | |
| 1011 | case clang::Decl::VarTemplatePartialSpecialization: | |
| 1012 | case clang::Decl::ParmVar: | |
| 1013 | case clang::Decl::OMPCapturedExpr: | |
| 1014 | case clang::Decl::ImplicitParam: | |
| 1015 | case clang::Decl::Decomposition: | |
| 1016 | case clang::Decl::NonTypeTemplateParm: | |
| 1017 | case clang::Decl::MSProperty: | |
| 1018 | case clang::Decl::Field: | |
| 1019 | case clang::Decl::ObjCIvar: | |
| 1020 | case clang::Decl::ObjCAtDefsField: | |
| 1021 | case clang::Decl::Binding: | |
| 1022 | case clang::Decl::UsingShadow: | |
| 1023 | case clang::Decl::ConstructorUsingShadow: | |
| 1024 | case clang::Decl::UsingPack: | |
| 1025 | case clang::Decl::UsingDirective: | |
| 1026 | case clang::Decl::UnresolvedUsingIfExists: | |
| 1027 | case clang::Decl::Record: | |
| 1028 | case clang::Decl::CXXRecord: | |
| 1029 | case clang::Decl::ClassTemplateSpecialization: | |
| 1030 | case clang::Decl::ClassTemplatePartialSpecialization: | |
| 1031 | case clang::Decl::Enum: | |
| 1032 | case clang::Decl::UnresolvedUsingTypename: | |
| 1033 | case clang::Decl::Typedef: | |
| 1034 | case clang::Decl::TypeAlias: | |
| 1035 | case clang::Decl::ObjCTypeParam: | |
| 1036 | case clang::Decl::TemplateTypeParm: | |
| 1037 | case clang::Decl::TemplateTemplateParm: | |
| 1038 | case clang::Decl::VarTemplate: | |
| 1039 | case clang::Decl::TypeAliasTemplate: | |
| 1040 | case clang::Decl::FunctionTemplate: | |
| 1041 | case clang::Decl::ClassTemplate: | |
| 1042 | case clang::Decl::Concept: | |
| 1043 | case clang::Decl::BuiltinTemplate: | |
| 1044 | case clang::Decl::ObjCProperty: | |
| 1045 | case clang::Decl::ObjCCompatibleAlias: | |
| 1046 | case clang::Decl::NamespaceAlias: | |
| 1047 | case clang::Decl::Label: | |
| 1048 | case clang::Decl::HLSLRootSignature: | |
| 1049 | case clang::Decl::UsingEnum: | |
| 1050 | case clang::Decl::Using: | |
| 1051 | case clang::Decl::LifetimeExtendedTemporary: | |
| 1052 | case clang::Decl::Import: | |
| 1053 | case clang::Decl::ImplicitConceptSpecialization: | |
| 1054 | case clang::Decl::FriendTemplate: | |
| 1055 | case clang::Decl::Friend: | |
| 1056 | case clang::Decl::FileScopeAsm: | |
| 1057 | case clang::Decl::Empty: | |
| 1058 | case clang::Decl::AccessSpec: | |
| 1059 | break; | |
| 1060 | } | |
| 1061 | } | |
| 1062 | ||
| 1063 | static_assert((clang::Decl::Kind)ZigClangDeclTranslationUnit == clang::Decl::TranslationUnit, ""); | |
| 1064 | static_assert((clang::Decl::Kind)ZigClangDeclTopLevelStmt == clang::Decl::TopLevelStmt, ""); | |
| 1065 | static_assert((clang::Decl::Kind)ZigClangDeclRequiresExprBody == clang::Decl::RequiresExprBody, ""); | |
| 1066 | static_assert((clang::Decl::Kind)ZigClangDeclOutlinedFunction == clang::Decl::OutlinedFunction, ""); | |
| 1067 | static_assert((clang::Decl::Kind)ZigClangDeclLinkageSpec == clang::Decl::LinkageSpec, ""); | |
| 1068 | static_assert((clang::Decl::Kind)ZigClangDeclExternCContext == clang::Decl::ExternCContext, ""); | |
| 1069 | static_assert((clang::Decl::Kind)ZigClangDeclExport == clang::Decl::Export, ""); | |
| 1070 | static_assert((clang::Decl::Kind)ZigClangDeclCaptured == clang::Decl::Captured, ""); | |
| 1071 | static_assert((clang::Decl::Kind)ZigClangDeclBlock == clang::Decl::Block, ""); | |
| 1072 | static_assert((clang::Decl::Kind)ZigClangDeclStaticAssert == clang::Decl::StaticAssert, ""); | |
| 1073 | static_assert((clang::Decl::Kind)ZigClangDeclPragmaDetectMismatch == clang::Decl::PragmaDetectMismatch, ""); | |
| 1074 | static_assert((clang::Decl::Kind)ZigClangDeclPragmaComment == clang::Decl::PragmaComment, ""); | |
| 1075 | static_assert((clang::Decl::Kind)ZigClangDeclOpenACCRoutine == clang::Decl::OpenACCRoutine, ""); | |
| 1076 | static_assert((clang::Decl::Kind)ZigClangDeclOpenACCDeclare == clang::Decl::OpenACCDeclare, ""); | |
| 1077 | static_assert((clang::Decl::Kind)ZigClangDeclObjCPropertyImpl == clang::Decl::ObjCPropertyImpl, ""); | |
| 1078 | static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, ""); | |
| 1079 | static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, ""); | |
| 1080 | static_assert((clang::Decl::Kind)ZigClangDeclOMPAllocate == clang::Decl::OMPAllocate, ""); | |
| 1081 | static_assert((clang::Decl::Kind)ZigClangDeclObjCMethod == clang::Decl::ObjCMethod, ""); | |
| 1082 | static_assert((clang::Decl::Kind)ZigClangDeclObjCProtocol == clang::Decl::ObjCProtocol, ""); | |
| 1083 | static_assert((clang::Decl::Kind)ZigClangDeclObjCInterface == clang::Decl::ObjCInterface, ""); | |
| 1084 | static_assert((clang::Decl::Kind)ZigClangDeclObjCImplementation == clang::Decl::ObjCImplementation, ""); | |
| 1085 | static_assert((clang::Decl::Kind)ZigClangDeclObjCCategoryImpl == clang::Decl::ObjCCategoryImpl, ""); | |
| 1086 | static_assert((clang::Decl::Kind)ZigClangDeclObjCCategory == clang::Decl::ObjCCategory, ""); | |
| 1087 | static_assert((clang::Decl::Kind)ZigClangDeclNamespace == clang::Decl::Namespace, ""); | |
| 1088 | static_assert((clang::Decl::Kind)ZigClangDeclHLSLBuffer == clang::Decl::HLSLBuffer, ""); | |
| 1089 | static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, ""); | |
| 1090 | static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, ""); | |
| 1091 | static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, ""); | |
| 1092 | static_assert((clang::Decl::Kind)ZigClangDeclUnnamedGlobalConstant == clang::Decl::UnnamedGlobalConstant, ""); | |
| 1093 | static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, ""); | |
| 1094 | static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, ""); | |
| 1095 | static_assert((clang::Decl::Kind)ZigClangDeclIndirectField == clang::Decl::IndirectField, ""); | |
| 1096 | static_assert((clang::Decl::Kind)ZigClangDeclEnumConstant == clang::Decl::EnumConstant, ""); | |
| 1097 | static_assert((clang::Decl::Kind)ZigClangDeclFunction == clang::Decl::Function, ""); | |
| 1098 | static_assert((clang::Decl::Kind)ZigClangDeclCXXMethod == clang::Decl::CXXMethod, ""); | |
| 1099 | static_assert((clang::Decl::Kind)ZigClangDeclCXXDestructor == clang::Decl::CXXDestructor, ""); | |
| 1100 | static_assert((clang::Decl::Kind)ZigClangDeclCXXConversion == clang::Decl::CXXConversion, ""); | |
| 1101 | static_assert((clang::Decl::Kind)ZigClangDeclCXXConstructor == clang::Decl::CXXConstructor, ""); | |
| 1102 | static_assert((clang::Decl::Kind)ZigClangDeclCXXDeductionGuide == clang::Decl::CXXDeductionGuide, ""); | |
| 1103 | static_assert((clang::Decl::Kind)ZigClangDeclVar == clang::Decl::Var, ""); | |
| 1104 | static_assert((clang::Decl::Kind)ZigClangDeclVarTemplateSpecialization == clang::Decl::VarTemplateSpecialization, ""); | |
| 1105 | static_assert((clang::Decl::Kind)ZigClangDeclVarTemplatePartialSpecialization == clang::Decl::VarTemplatePartialSpecialization, ""); | |
| 1106 | static_assert((clang::Decl::Kind)ZigClangDeclParmVar == clang::Decl::ParmVar, ""); | |
| 1107 | static_assert((clang::Decl::Kind)ZigClangDeclOMPCapturedExpr == clang::Decl::OMPCapturedExpr, ""); | |
| 1108 | static_assert((clang::Decl::Kind)ZigClangDeclImplicitParam == clang::Decl::ImplicitParam, ""); | |
| 1109 | static_assert((clang::Decl::Kind)ZigClangDeclDecomposition == clang::Decl::Decomposition, ""); | |
| 1110 | static_assert((clang::Decl::Kind)ZigClangDeclNonTypeTemplateParm == clang::Decl::NonTypeTemplateParm, ""); | |
| 1111 | static_assert((clang::Decl::Kind)ZigClangDeclMSProperty == clang::Decl::MSProperty, ""); | |
| 1112 | static_assert((clang::Decl::Kind)ZigClangDeclField == clang::Decl::Field, ""); | |
| 1113 | static_assert((clang::Decl::Kind)ZigClangDeclObjCIvar == clang::Decl::ObjCIvar, ""); | |
| 1114 | static_assert((clang::Decl::Kind)ZigClangDeclObjCAtDefsField == clang::Decl::ObjCAtDefsField, ""); | |
| 1115 | static_assert((clang::Decl::Kind)ZigClangDeclBinding == clang::Decl::Binding, ""); | |
| 1116 | static_assert((clang::Decl::Kind)ZigClangDeclUsingShadow == clang::Decl::UsingShadow, ""); | |
| 1117 | static_assert((clang::Decl::Kind)ZigClangDeclConstructorUsingShadow == clang::Decl::ConstructorUsingShadow, ""); | |
| 1118 | static_assert((clang::Decl::Kind)ZigClangDeclUsingPack == clang::Decl::UsingPack, ""); | |
| 1119 | static_assert((clang::Decl::Kind)ZigClangDeclUsingDirective == clang::Decl::UsingDirective, ""); | |
| 1120 | static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingIfExists == clang::Decl::UnresolvedUsingIfExists, ""); | |
| 1121 | static_assert((clang::Decl::Kind)ZigClangDeclRecord == clang::Decl::Record, ""); | |
| 1122 | static_assert((clang::Decl::Kind)ZigClangDeclCXXRecord == clang::Decl::CXXRecord, ""); | |
| 1123 | static_assert((clang::Decl::Kind)ZigClangDeclClassTemplateSpecialization == clang::Decl::ClassTemplateSpecialization, ""); | |
| 1124 | static_assert((clang::Decl::Kind)ZigClangDeclClassTemplatePartialSpecialization == clang::Decl::ClassTemplatePartialSpecialization, ""); | |
| 1125 | static_assert((clang::Decl::Kind)ZigClangDeclEnum == clang::Decl::Enum, ""); | |
| 1126 | static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingTypename == clang::Decl::UnresolvedUsingTypename, ""); | |
| 1127 | static_assert((clang::Decl::Kind)ZigClangDeclTypedef == clang::Decl::Typedef, ""); | |
| 1128 | static_assert((clang::Decl::Kind)ZigClangDeclTypeAlias == clang::Decl::TypeAlias, ""); | |
| 1129 | static_assert((clang::Decl::Kind)ZigClangDeclObjCTypeParam == clang::Decl::ObjCTypeParam, ""); | |
| 1130 | static_assert((clang::Decl::Kind)ZigClangDeclTemplateTypeParm == clang::Decl::TemplateTypeParm, ""); | |
| 1131 | static_assert((clang::Decl::Kind)ZigClangDeclTemplateTemplateParm == clang::Decl::TemplateTemplateParm, ""); | |
| 1132 | static_assert((clang::Decl::Kind)ZigClangDeclVarTemplate == clang::Decl::VarTemplate, ""); | |
| 1133 | static_assert((clang::Decl::Kind)ZigClangDeclTypeAliasTemplate == clang::Decl::TypeAliasTemplate, ""); | |
| 1134 | static_assert((clang::Decl::Kind)ZigClangDeclFunctionTemplate == clang::Decl::FunctionTemplate, ""); | |
| 1135 | static_assert((clang::Decl::Kind)ZigClangDeclClassTemplate == clang::Decl::ClassTemplate, ""); | |
| 1136 | static_assert((clang::Decl::Kind)ZigClangDeclConcept == clang::Decl::Concept, ""); | |
| 1137 | static_assert((clang::Decl::Kind)ZigClangDeclBuiltinTemplate == clang::Decl::BuiltinTemplate, ""); | |
| 1138 | static_assert((clang::Decl::Kind)ZigClangDeclObjCProperty == clang::Decl::ObjCProperty, ""); | |
| 1139 | static_assert((clang::Decl::Kind)ZigClangDeclObjCCompatibleAlias == clang::Decl::ObjCCompatibleAlias, ""); | |
| 1140 | static_assert((clang::Decl::Kind)ZigClangDeclNamespaceAlias == clang::Decl::NamespaceAlias, ""); | |
| 1141 | static_assert((clang::Decl::Kind)ZigClangDeclLabel == clang::Decl::Label, ""); | |
| 1142 | static_assert((clang::Decl::Kind)ZigClangDeclHLSLRootSignature == clang::Decl::HLSLRootSignature, ""); | |
| 1143 | static_assert((clang::Decl::Kind)ZigClangDeclUsingEnum == clang::Decl::UsingEnum, ""); | |
| 1144 | static_assert((clang::Decl::Kind)ZigClangDeclUsing == clang::Decl::Using, ""); | |
| 1145 | static_assert((clang::Decl::Kind)ZigClangDeclLifetimeExtendedTemporary == clang::Decl::LifetimeExtendedTemporary, ""); | |
| 1146 | static_assert((clang::Decl::Kind)ZigClangDeclImport == clang::Decl::Import, ""); | |
| 1147 | static_assert((clang::Decl::Kind)ZigClangDeclImplicitConceptSpecialization == clang::Decl::ImplicitConceptSpecialization, ""); | |
| 1148 | static_assert((clang::Decl::Kind)ZigClangDeclFriendTemplate == clang::Decl::FriendTemplate, ""); | |
| 1149 | static_assert((clang::Decl::Kind)ZigClangDeclFriend == clang::Decl::Friend, ""); | |
| 1150 | static_assert((clang::Decl::Kind)ZigClangDeclFileScopeAsm == clang::Decl::FileScopeAsm, ""); | |
| 1151 | static_assert((clang::Decl::Kind)ZigClangDeclEmpty == clang::Decl::Empty, ""); | |
| 1152 | static_assert((clang::Decl::Kind)ZigClangDeclAccessSpec == clang::Decl::AccessSpec, ""); | |
| 1153 | ||
| 1154 | void ZigClang_detect_enum_BuiltinTypeKind(clang::BuiltinType::Kind x) { | |
| 1155 | switch (x) { | |
| 1156 | case clang::BuiltinType::OCLImage1dRO: | |
| 1157 | case clang::BuiltinType::OCLImage1dArrayRO: | |
| 1158 | case clang::BuiltinType::OCLImage1dBufferRO: | |
| 1159 | case clang::BuiltinType::OCLImage2dRO: | |
| 1160 | case clang::BuiltinType::OCLImage2dArrayRO: | |
| 1161 | case clang::BuiltinType::OCLImage2dDepthRO: | |
| 1162 | case clang::BuiltinType::OCLImage2dArrayDepthRO: | |
| 1163 | case clang::BuiltinType::OCLImage2dMSAARO: | |
| 1164 | case clang::BuiltinType::OCLImage2dArrayMSAARO: | |
| 1165 | case clang::BuiltinType::OCLImage2dMSAADepthRO: | |
| 1166 | case clang::BuiltinType::OCLImage2dArrayMSAADepthRO: | |
| 1167 | case clang::BuiltinType::OCLImage3dRO: | |
| 1168 | case clang::BuiltinType::OCLImage1dWO: | |
| 1169 | case clang::BuiltinType::OCLImage1dArrayWO: | |
| 1170 | case clang::BuiltinType::OCLImage1dBufferWO: | |
| 1171 | case clang::BuiltinType::OCLImage2dWO: | |
| 1172 | case clang::BuiltinType::OCLImage2dArrayWO: | |
| 1173 | case clang::BuiltinType::OCLImage2dDepthWO: | |
| 1174 | case clang::BuiltinType::OCLImage2dArrayDepthWO: | |
| 1175 | case clang::BuiltinType::OCLImage2dMSAAWO: | |
| 1176 | case clang::BuiltinType::OCLImage2dArrayMSAAWO: | |
| 1177 | case clang::BuiltinType::OCLImage2dMSAADepthWO: | |
| 1178 | case clang::BuiltinType::OCLImage2dArrayMSAADepthWO: | |
| 1179 | case clang::BuiltinType::OCLImage3dWO: | |
| 1180 | case clang::BuiltinType::OCLImage1dRW: | |
| 1181 | case clang::BuiltinType::OCLImage1dArrayRW: | |
| 1182 | case clang::BuiltinType::OCLImage1dBufferRW: | |
| 1183 | case clang::BuiltinType::OCLImage2dRW: | |
| 1184 | case clang::BuiltinType::OCLImage2dArrayRW: | |
| 1185 | case clang::BuiltinType::OCLImage2dDepthRW: | |
| 1186 | case clang::BuiltinType::OCLImage2dArrayDepthRW: | |
| 1187 | case clang::BuiltinType::OCLImage2dMSAARW: | |
| 1188 | case clang::BuiltinType::OCLImage2dArrayMSAARW: | |
| 1189 | case clang::BuiltinType::OCLImage2dMSAADepthRW: | |
| 1190 | case clang::BuiltinType::OCLImage2dArrayMSAADepthRW: | |
| 1191 | case clang::BuiltinType::OCLImage3dRW: | |
| 1192 | case clang::BuiltinType::OCLIntelSubgroupAVCMcePayload: | |
| 1193 | case clang::BuiltinType::OCLIntelSubgroupAVCImePayload: | |
| 1194 | case clang::BuiltinType::OCLIntelSubgroupAVCRefPayload: | |
| 1195 | case clang::BuiltinType::OCLIntelSubgroupAVCSicPayload: | |
| 1196 | case clang::BuiltinType::OCLIntelSubgroupAVCMceResult: | |
| 1197 | case clang::BuiltinType::OCLIntelSubgroupAVCImeResult: | |
| 1198 | case clang::BuiltinType::OCLIntelSubgroupAVCRefResult: | |
| 1199 | case clang::BuiltinType::OCLIntelSubgroupAVCSicResult: | |
| 1200 | case clang::BuiltinType::OCLIntelSubgroupAVCImeResultSingleReferenceStreamout: | |
| 1201 | case clang::BuiltinType::OCLIntelSubgroupAVCImeResultDualReferenceStreamout: | |
| 1202 | case clang::BuiltinType::OCLIntelSubgroupAVCImeSingleReferenceStreamin: | |
| 1203 | case clang::BuiltinType::OCLIntelSubgroupAVCImeDualReferenceStreamin: | |
| 1204 | case clang::BuiltinType::SveInt8: | |
| 1205 | case clang::BuiltinType::SveInt16: | |
| 1206 | case clang::BuiltinType::SveInt32: | |
| 1207 | case clang::BuiltinType::SveInt64: | |
| 1208 | case clang::BuiltinType::SveUint8: | |
| 1209 | case clang::BuiltinType::SveUint16: | |
| 1210 | case clang::BuiltinType::SveUint32: | |
| 1211 | case clang::BuiltinType::SveUint64: | |
| 1212 | case clang::BuiltinType::SveFloat16: | |
| 1213 | case clang::BuiltinType::SveFloat32: | |
| 1214 | case clang::BuiltinType::SveFloat64: | |
| 1215 | case clang::BuiltinType::SveBFloat16: | |
| 1216 | case clang::BuiltinType::SveMFloat8: | |
| 1217 | case clang::BuiltinType::SveInt8x2: | |
| 1218 | case clang::BuiltinType::SveInt16x2: | |
| 1219 | case clang::BuiltinType::SveInt32x2: | |
| 1220 | case clang::BuiltinType::SveInt64x2: | |
| 1221 | case clang::BuiltinType::SveUint8x2: | |
| 1222 | case clang::BuiltinType::SveUint16x2: | |
| 1223 | case clang::BuiltinType::SveUint32x2: | |
| 1224 | case clang::BuiltinType::SveUint64x2: | |
| 1225 | case clang::BuiltinType::SveFloat16x2: | |
| 1226 | case clang::BuiltinType::SveFloat32x2: | |
| 1227 | case clang::BuiltinType::SveFloat64x2: | |
| 1228 | case clang::BuiltinType::SveBFloat16x2: | |
| 1229 | case clang::BuiltinType::SveMFloat8x2: | |
| 1230 | case clang::BuiltinType::SveInt8x3: | |
| 1231 | case clang::BuiltinType::SveInt16x3: | |
| 1232 | case clang::BuiltinType::SveInt32x3: | |
| 1233 | case clang::BuiltinType::SveInt64x3: | |
| 1234 | case clang::BuiltinType::SveUint8x3: | |
| 1235 | case clang::BuiltinType::SveUint16x3: | |
| 1236 | case clang::BuiltinType::SveUint32x3: | |
| 1237 | case clang::BuiltinType::SveUint64x3: | |
| 1238 | case clang::BuiltinType::SveFloat16x3: | |
| 1239 | case clang::BuiltinType::SveFloat32x3: | |
| 1240 | case clang::BuiltinType::SveFloat64x3: | |
| 1241 | case clang::BuiltinType::SveBFloat16x3: | |
| 1242 | case clang::BuiltinType::SveMFloat8x3: | |
| 1243 | case clang::BuiltinType::SveInt8x4: | |
| 1244 | case clang::BuiltinType::SveInt16x4: | |
| 1245 | case clang::BuiltinType::SveInt32x4: | |
| 1246 | case clang::BuiltinType::SveInt64x4: | |
| 1247 | case clang::BuiltinType::SveUint8x4: | |
| 1248 | case clang::BuiltinType::SveUint16x4: | |
| 1249 | case clang::BuiltinType::SveUint32x4: | |
| 1250 | case clang::BuiltinType::SveUint64x4: | |
| 1251 | case clang::BuiltinType::SveFloat16x4: | |
| 1252 | case clang::BuiltinType::SveFloat32x4: | |
| 1253 | case clang::BuiltinType::SveFloat64x4: | |
| 1254 | case clang::BuiltinType::SveBFloat16x4: | |
| 1255 | case clang::BuiltinType::SveMFloat8x4: | |
| 1256 | case clang::BuiltinType::SveBool: | |
| 1257 | case clang::BuiltinType::SveBoolx2: | |
| 1258 | case clang::BuiltinType::SveBoolx4: | |
| 1259 | case clang::BuiltinType::SveCount: | |
| 1260 | case clang::BuiltinType::MFloat8: | |
| 1261 | case clang::BuiltinType::DMR1024: | |
| 1262 | case clang::BuiltinType::VectorQuad: | |
| 1263 | case clang::BuiltinType::VectorPair: | |
| 1264 | case clang::BuiltinType::RvvInt8mf8: | |
| 1265 | case clang::BuiltinType::RvvInt8mf4: | |
| 1266 | case clang::BuiltinType::RvvInt8mf2: | |
| 1267 | case clang::BuiltinType::RvvInt8m1: | |
| 1268 | case clang::BuiltinType::RvvInt8m2: | |
| 1269 | case clang::BuiltinType::RvvInt8m4: | |
| 1270 | case clang::BuiltinType::RvvInt8m8: | |
| 1271 | case clang::BuiltinType::RvvUint8mf8: | |
| 1272 | case clang::BuiltinType::RvvUint8mf4: | |
| 1273 | case clang::BuiltinType::RvvUint8mf2: | |
| 1274 | case clang::BuiltinType::RvvUint8m1: | |
| 1275 | case clang::BuiltinType::RvvUint8m2: | |
| 1276 | case clang::BuiltinType::RvvUint8m4: | |
| 1277 | case clang::BuiltinType::RvvUint8m8: | |
| 1278 | case clang::BuiltinType::RvvInt16mf4: | |
| 1279 | case clang::BuiltinType::RvvInt16mf2: | |
| 1280 | case clang::BuiltinType::RvvInt16m1: | |
| 1281 | case clang::BuiltinType::RvvInt16m2: | |
| 1282 | case clang::BuiltinType::RvvInt16m4: | |
| 1283 | case clang::BuiltinType::RvvInt16m8: | |
| 1284 | case clang::BuiltinType::RvvUint16mf4: | |
| 1285 | case clang::BuiltinType::RvvUint16mf2: | |
| 1286 | case clang::BuiltinType::RvvUint16m1: | |
| 1287 | case clang::BuiltinType::RvvUint16m2: | |
| 1288 | case clang::BuiltinType::RvvUint16m4: | |
| 1289 | case clang::BuiltinType::RvvUint16m8: | |
| 1290 | case clang::BuiltinType::RvvInt32mf2: | |
| 1291 | case clang::BuiltinType::RvvInt32m1: | |
| 1292 | case clang::BuiltinType::RvvInt32m2: | |
| 1293 | case clang::BuiltinType::RvvInt32m4: | |
| 1294 | case clang::BuiltinType::RvvInt32m8: | |
| 1295 | case clang::BuiltinType::RvvUint32mf2: | |
| 1296 | case clang::BuiltinType::RvvUint32m1: | |
| 1297 | case clang::BuiltinType::RvvUint32m2: | |
| 1298 | case clang::BuiltinType::RvvUint32m4: | |
| 1299 | case clang::BuiltinType::RvvUint32m8: | |
| 1300 | case clang::BuiltinType::RvvInt64m1: | |
| 1301 | case clang::BuiltinType::RvvInt64m2: | |
| 1302 | case clang::BuiltinType::RvvInt64m4: | |
| 1303 | case clang::BuiltinType::RvvInt64m8: | |
| 1304 | case clang::BuiltinType::RvvUint64m1: | |
| 1305 | case clang::BuiltinType::RvvUint64m2: | |
| 1306 | case clang::BuiltinType::RvvUint64m4: | |
| 1307 | case clang::BuiltinType::RvvUint64m8: | |
| 1308 | case clang::BuiltinType::RvvFloat16mf4: | |
| 1309 | case clang::BuiltinType::RvvFloat16mf2: | |
| 1310 | case clang::BuiltinType::RvvFloat16m1: | |
| 1311 | case clang::BuiltinType::RvvFloat16m2: | |
| 1312 | case clang::BuiltinType::RvvFloat16m4: | |
| 1313 | case clang::BuiltinType::RvvFloat16m8: | |
| 1314 | case clang::BuiltinType::RvvBFloat16mf4: | |
| 1315 | case clang::BuiltinType::RvvBFloat16mf2: | |
| 1316 | case clang::BuiltinType::RvvBFloat16m1: | |
| 1317 | case clang::BuiltinType::RvvBFloat16m2: | |
| 1318 | case clang::BuiltinType::RvvBFloat16m4: | |
| 1319 | case clang::BuiltinType::RvvBFloat16m8: | |
| 1320 | case clang::BuiltinType::RvvFloat32mf2: | |
| 1321 | case clang::BuiltinType::RvvFloat32m1: | |
| 1322 | case clang::BuiltinType::RvvFloat32m2: | |
| 1323 | case clang::BuiltinType::RvvFloat32m4: | |
| 1324 | case clang::BuiltinType::RvvFloat32m8: | |
| 1325 | case clang::BuiltinType::RvvFloat64m1: | |
| 1326 | case clang::BuiltinType::RvvFloat64m2: | |
| 1327 | case clang::BuiltinType::RvvFloat64m4: | |
| 1328 | case clang::BuiltinType::RvvFloat64m8: | |
| 1329 | case clang::BuiltinType::RvvBool1: | |
| 1330 | case clang::BuiltinType::RvvBool2: | |
| 1331 | case clang::BuiltinType::RvvBool4: | |
| 1332 | case clang::BuiltinType::RvvBool8: | |
| 1333 | case clang::BuiltinType::RvvBool16: | |
| 1334 | case clang::BuiltinType::RvvBool32: | |
| 1335 | case clang::BuiltinType::RvvBool64: | |
| 1336 | case clang::BuiltinType::RvvInt8mf8x2: | |
| 1337 | case clang::BuiltinType::RvvInt8mf8x3: | |
| 1338 | case clang::BuiltinType::RvvInt8mf8x4: | |
| 1339 | case clang::BuiltinType::RvvInt8mf8x5: | |
| 1340 | case clang::BuiltinType::RvvInt8mf8x6: | |
| 1341 | case clang::BuiltinType::RvvInt8mf8x7: | |
| 1342 | case clang::BuiltinType::RvvInt8mf8x8: | |
| 1343 | case clang::BuiltinType::RvvInt8mf4x2: | |
| 1344 | case clang::BuiltinType::RvvInt8mf4x3: | |
| 1345 | case clang::BuiltinType::RvvInt8mf4x4: | |
| 1346 | case clang::BuiltinType::RvvInt8mf4x5: | |
| 1347 | case clang::BuiltinType::RvvInt8mf4x6: | |
| 1348 | case clang::BuiltinType::RvvInt8mf4x7: | |
| 1349 | case clang::BuiltinType::RvvInt8mf4x8: | |
| 1350 | case clang::BuiltinType::RvvInt8mf2x2: | |
| 1351 | case clang::BuiltinType::RvvInt8mf2x3: | |
| 1352 | case clang::BuiltinType::RvvInt8mf2x4: | |
| 1353 | case clang::BuiltinType::RvvInt8mf2x5: | |
| 1354 | case clang::BuiltinType::RvvInt8mf2x6: | |
| 1355 | case clang::BuiltinType::RvvInt8mf2x7: | |
| 1356 | case clang::BuiltinType::RvvInt8mf2x8: | |
| 1357 | case clang::BuiltinType::RvvInt8m1x2: | |
| 1358 | case clang::BuiltinType::RvvInt8m1x3: | |
| 1359 | case clang::BuiltinType::RvvInt8m1x4: | |
| 1360 | case clang::BuiltinType::RvvInt8m1x5: | |
| 1361 | case clang::BuiltinType::RvvInt8m1x6: | |
| 1362 | case clang::BuiltinType::RvvInt8m1x7: | |
| 1363 | case clang::BuiltinType::RvvInt8m1x8: | |
| 1364 | case clang::BuiltinType::RvvInt8m2x2: | |
| 1365 | case clang::BuiltinType::RvvInt8m2x3: | |
| 1366 | case clang::BuiltinType::RvvInt8m2x4: | |
| 1367 | case clang::BuiltinType::RvvInt8m4x2: | |
| 1368 | case clang::BuiltinType::RvvUint8mf8x2: | |
| 1369 | case clang::BuiltinType::RvvUint8mf8x3: | |
| 1370 | case clang::BuiltinType::RvvUint8mf8x4: | |
| 1371 | case clang::BuiltinType::RvvUint8mf8x5: | |
| 1372 | case clang::BuiltinType::RvvUint8mf8x6: | |
| 1373 | case clang::BuiltinType::RvvUint8mf8x7: | |
| 1374 | case clang::BuiltinType::RvvUint8mf8x8: | |
| 1375 | case clang::BuiltinType::RvvUint8mf4x2: | |
| 1376 | case clang::BuiltinType::RvvUint8mf4x3: | |
| 1377 | case clang::BuiltinType::RvvUint8mf4x4: | |
| 1378 | case clang::BuiltinType::RvvUint8mf4x5: | |
| 1379 | case clang::BuiltinType::RvvUint8mf4x6: | |
| 1380 | case clang::BuiltinType::RvvUint8mf4x7: | |
| 1381 | case clang::BuiltinType::RvvUint8mf4x8: | |
| 1382 | case clang::BuiltinType::RvvUint8mf2x2: | |
| 1383 | case clang::BuiltinType::RvvUint8mf2x3: | |
| 1384 | case clang::BuiltinType::RvvUint8mf2x4: | |
| 1385 | case clang::BuiltinType::RvvUint8mf2x5: | |
| 1386 | case clang::BuiltinType::RvvUint8mf2x6: | |
| 1387 | case clang::BuiltinType::RvvUint8mf2x7: | |
| 1388 | case clang::BuiltinType::RvvUint8mf2x8: | |
| 1389 | case clang::BuiltinType::RvvUint8m1x2: | |
| 1390 | case clang::BuiltinType::RvvUint8m1x3: | |
| 1391 | case clang::BuiltinType::RvvUint8m1x4: | |
| 1392 | case clang::BuiltinType::RvvUint8m1x5: | |
| 1393 | case clang::BuiltinType::RvvUint8m1x6: | |
| 1394 | case clang::BuiltinType::RvvUint8m1x7: | |
| 1395 | case clang::BuiltinType::RvvUint8m1x8: | |
| 1396 | case clang::BuiltinType::RvvUint8m2x2: | |
| 1397 | case clang::BuiltinType::RvvUint8m2x3: | |
| 1398 | case clang::BuiltinType::RvvUint8m2x4: | |
| 1399 | case clang::BuiltinType::RvvUint8m4x2: | |
| 1400 | case clang::BuiltinType::RvvInt16mf4x2: | |
| 1401 | case clang::BuiltinType::RvvInt16mf4x3: | |
| 1402 | case clang::BuiltinType::RvvInt16mf4x4: | |
| 1403 | case clang::BuiltinType::RvvInt16mf4x5: | |
| 1404 | case clang::BuiltinType::RvvInt16mf4x6: | |
| 1405 | case clang::BuiltinType::RvvInt16mf4x7: | |
| 1406 | case clang::BuiltinType::RvvInt16mf4x8: | |
| 1407 | case clang::BuiltinType::RvvInt16mf2x2: | |
| 1408 | case clang::BuiltinType::RvvInt16mf2x3: | |
| 1409 | case clang::BuiltinType::RvvInt16mf2x4: | |
| 1410 | case clang::BuiltinType::RvvInt16mf2x5: | |
| 1411 | case clang::BuiltinType::RvvInt16mf2x6: | |
| 1412 | case clang::BuiltinType::RvvInt16mf2x7: | |
| 1413 | case clang::BuiltinType::RvvInt16mf2x8: | |
| 1414 | case clang::BuiltinType::RvvInt16m1x2: | |
| 1415 | case clang::BuiltinType::RvvInt16m1x3: | |
| 1416 | case clang::BuiltinType::RvvInt16m1x4: | |
| 1417 | case clang::BuiltinType::RvvInt16m1x5: | |
| 1418 | case clang::BuiltinType::RvvInt16m1x6: | |
| 1419 | case clang::BuiltinType::RvvInt16m1x7: | |
| 1420 | case clang::BuiltinType::RvvInt16m1x8: | |
| 1421 | case clang::BuiltinType::RvvInt16m2x2: | |
| 1422 | case clang::BuiltinType::RvvInt16m2x3: | |
| 1423 | case clang::BuiltinType::RvvInt16m2x4: | |
| 1424 | case clang::BuiltinType::RvvInt16m4x2: | |
| 1425 | case clang::BuiltinType::RvvUint16mf4x2: | |
| 1426 | case clang::BuiltinType::RvvUint16mf4x3: | |
| 1427 | case clang::BuiltinType::RvvUint16mf4x4: | |
| 1428 | case clang::BuiltinType::RvvUint16mf4x5: | |
| 1429 | case clang::BuiltinType::RvvUint16mf4x6: | |
| 1430 | case clang::BuiltinType::RvvUint16mf4x7: | |
| 1431 | case clang::BuiltinType::RvvUint16mf4x8: | |
| 1432 | case clang::BuiltinType::RvvUint16mf2x2: | |
| 1433 | case clang::BuiltinType::RvvUint16mf2x3: | |
| 1434 | case clang::BuiltinType::RvvUint16mf2x4: | |
| 1435 | case clang::BuiltinType::RvvUint16mf2x5: | |
| 1436 | case clang::BuiltinType::RvvUint16mf2x6: | |
| 1437 | case clang::BuiltinType::RvvUint16mf2x7: | |
| 1438 | case clang::BuiltinType::RvvUint16mf2x8: | |
| 1439 | case clang::BuiltinType::RvvUint16m1x2: | |
| 1440 | case clang::BuiltinType::RvvUint16m1x3: | |
| 1441 | case clang::BuiltinType::RvvUint16m1x4: | |
| 1442 | case clang::BuiltinType::RvvUint16m1x5: | |
| 1443 | case clang::BuiltinType::RvvUint16m1x6: | |
| 1444 | case clang::BuiltinType::RvvUint16m1x7: | |
| 1445 | case clang::BuiltinType::RvvUint16m1x8: | |
| 1446 | case clang::BuiltinType::RvvUint16m2x2: | |
| 1447 | case clang::BuiltinType::RvvUint16m2x3: | |
| 1448 | case clang::BuiltinType::RvvUint16m2x4: | |
| 1449 | case clang::BuiltinType::RvvUint16m4x2: | |
| 1450 | case clang::BuiltinType::RvvInt32mf2x2: | |
| 1451 | case clang::BuiltinType::RvvInt32mf2x3: | |
| 1452 | case clang::BuiltinType::RvvInt32mf2x4: | |
| 1453 | case clang::BuiltinType::RvvInt32mf2x5: | |
| 1454 | case clang::BuiltinType::RvvInt32mf2x6: | |
| 1455 | case clang::BuiltinType::RvvInt32mf2x7: | |
| 1456 | case clang::BuiltinType::RvvInt32mf2x8: | |
| 1457 | case clang::BuiltinType::RvvInt32m1x2: | |
| 1458 | case clang::BuiltinType::RvvInt32m1x3: | |
| 1459 | case clang::BuiltinType::RvvInt32m1x4: | |
| 1460 | case clang::BuiltinType::RvvInt32m1x5: | |
| 1461 | case clang::BuiltinType::RvvInt32m1x6: | |
| 1462 | case clang::BuiltinType::RvvInt32m1x7: | |
| 1463 | case clang::BuiltinType::RvvInt32m1x8: | |
| 1464 | case clang::BuiltinType::RvvInt32m2x2: | |
| 1465 | case clang::BuiltinType::RvvInt32m2x3: | |
| 1466 | case clang::BuiltinType::RvvInt32m2x4: | |
| 1467 | case clang::BuiltinType::RvvInt32m4x2: | |
| 1468 | case clang::BuiltinType::RvvUint32mf2x2: | |
| 1469 | case clang::BuiltinType::RvvUint32mf2x3: | |
| 1470 | case clang::BuiltinType::RvvUint32mf2x4: | |
| 1471 | case clang::BuiltinType::RvvUint32mf2x5: | |
| 1472 | case clang::BuiltinType::RvvUint32mf2x6: | |
| 1473 | case clang::BuiltinType::RvvUint32mf2x7: | |
| 1474 | case clang::BuiltinType::RvvUint32mf2x8: | |
| 1475 | case clang::BuiltinType::RvvUint32m1x2: | |
| 1476 | case clang::BuiltinType::RvvUint32m1x3: | |
| 1477 | case clang::BuiltinType::RvvUint32m1x4: | |
| 1478 | case clang::BuiltinType::RvvUint32m1x5: | |
| 1479 | case clang::BuiltinType::RvvUint32m1x6: | |
| 1480 | case clang::BuiltinType::RvvUint32m1x7: | |
| 1481 | case clang::BuiltinType::RvvUint32m1x8: | |
| 1482 | case clang::BuiltinType::RvvUint32m2x2: | |
| 1483 | case clang::BuiltinType::RvvUint32m2x3: | |
| 1484 | case clang::BuiltinType::RvvUint32m2x4: | |
| 1485 | case clang::BuiltinType::RvvUint32m4x2: | |
| 1486 | case clang::BuiltinType::RvvInt64m1x2: | |
| 1487 | case clang::BuiltinType::RvvInt64m1x3: | |
| 1488 | case clang::BuiltinType::RvvInt64m1x4: | |
| 1489 | case clang::BuiltinType::RvvInt64m1x5: | |
| 1490 | case clang::BuiltinType::RvvInt64m1x6: | |
| 1491 | case clang::BuiltinType::RvvInt64m1x7: | |
| 1492 | case clang::BuiltinType::RvvInt64m1x8: | |
| 1493 | case clang::BuiltinType::RvvInt64m2x2: | |
| 1494 | case clang::BuiltinType::RvvInt64m2x3: | |
| 1495 | case clang::BuiltinType::RvvInt64m2x4: | |
| 1496 | case clang::BuiltinType::RvvInt64m4x2: | |
| 1497 | case clang::BuiltinType::RvvUint64m1x2: | |
| 1498 | case clang::BuiltinType::RvvUint64m1x3: | |
| 1499 | case clang::BuiltinType::RvvUint64m1x4: | |
| 1500 | case clang::BuiltinType::RvvUint64m1x5: | |
| 1501 | case clang::BuiltinType::RvvUint64m1x6: | |
| 1502 | case clang::BuiltinType::RvvUint64m1x7: | |
| 1503 | case clang::BuiltinType::RvvUint64m1x8: | |
| 1504 | case clang::BuiltinType::RvvUint64m2x2: | |
| 1505 | case clang::BuiltinType::RvvUint64m2x3: | |
| 1506 | case clang::BuiltinType::RvvUint64m2x4: | |
| 1507 | case clang::BuiltinType::RvvUint64m4x2: | |
| 1508 | case clang::BuiltinType::RvvFloat16mf4x2: | |
| 1509 | case clang::BuiltinType::RvvFloat16mf4x3: | |
| 1510 | case clang::BuiltinType::RvvFloat16mf4x4: | |
| 1511 | case clang::BuiltinType::RvvFloat16mf4x5: | |
| 1512 | case clang::BuiltinType::RvvFloat16mf4x6: | |
| 1513 | case clang::BuiltinType::RvvFloat16mf4x7: | |
| 1514 | case clang::BuiltinType::RvvFloat16mf4x8: | |
| 1515 | case clang::BuiltinType::RvvFloat16mf2x2: | |
| 1516 | case clang::BuiltinType::RvvFloat16mf2x3: | |
| 1517 | case clang::BuiltinType::RvvFloat16mf2x4: | |
| 1518 | case clang::BuiltinType::RvvFloat16mf2x5: | |
| 1519 | case clang::BuiltinType::RvvFloat16mf2x6: | |
| 1520 | case clang::BuiltinType::RvvFloat16mf2x7: | |
| 1521 | case clang::BuiltinType::RvvFloat16mf2x8: | |
| 1522 | case clang::BuiltinType::RvvFloat16m1x2: | |
| 1523 | case clang::BuiltinType::RvvFloat16m1x3: | |
| 1524 | case clang::BuiltinType::RvvFloat16m1x4: | |
| 1525 | case clang::BuiltinType::RvvFloat16m1x5: | |
| 1526 | case clang::BuiltinType::RvvFloat16m1x6: | |
| 1527 | case clang::BuiltinType::RvvFloat16m1x7: | |
| 1528 | case clang::BuiltinType::RvvFloat16m1x8: | |
| 1529 | case clang::BuiltinType::RvvFloat16m2x2: | |
| 1530 | case clang::BuiltinType::RvvFloat16m2x3: | |
| 1531 | case clang::BuiltinType::RvvFloat16m2x4: | |
| 1532 | case clang::BuiltinType::RvvFloat16m4x2: | |
| 1533 | case clang::BuiltinType::RvvFloat32mf2x2: | |
| 1534 | case clang::BuiltinType::RvvFloat32mf2x3: | |
| 1535 | case clang::BuiltinType::RvvFloat32mf2x4: | |
| 1536 | case clang::BuiltinType::RvvFloat32mf2x5: | |
| 1537 | case clang::BuiltinType::RvvFloat32mf2x6: | |
| 1538 | case clang::BuiltinType::RvvFloat32mf2x7: | |
| 1539 | case clang::BuiltinType::RvvFloat32mf2x8: | |
| 1540 | case clang::BuiltinType::RvvFloat32m1x2: | |
| 1541 | case clang::BuiltinType::RvvFloat32m1x3: | |
| 1542 | case clang::BuiltinType::RvvFloat32m1x4: | |
| 1543 | case clang::BuiltinType::RvvFloat32m1x5: | |
| 1544 | case clang::BuiltinType::RvvFloat32m1x6: | |
| 1545 | case clang::BuiltinType::RvvFloat32m1x7: | |
| 1546 | case clang::BuiltinType::RvvFloat32m1x8: | |
| 1547 | case clang::BuiltinType::RvvFloat32m2x2: | |
| 1548 | case clang::BuiltinType::RvvFloat32m2x3: | |
| 1549 | case clang::BuiltinType::RvvFloat32m2x4: | |
| 1550 | case clang::BuiltinType::RvvFloat32m4x2: | |
| 1551 | case clang::BuiltinType::RvvFloat64m1x2: | |
| 1552 | case clang::BuiltinType::RvvFloat64m1x3: | |
| 1553 | case clang::BuiltinType::RvvFloat64m1x4: | |
| 1554 | case clang::BuiltinType::RvvFloat64m1x5: | |
| 1555 | case clang::BuiltinType::RvvFloat64m1x6: | |
| 1556 | case clang::BuiltinType::RvvFloat64m1x7: | |
| 1557 | case clang::BuiltinType::RvvFloat64m1x8: | |
| 1558 | case clang::BuiltinType::RvvFloat64m2x2: | |
| 1559 | case clang::BuiltinType::RvvFloat64m2x3: | |
| 1560 | case clang::BuiltinType::RvvFloat64m2x4: | |
| 1561 | case clang::BuiltinType::RvvFloat64m4x2: | |
| 1562 | case clang::BuiltinType::RvvBFloat16mf4x2: | |
| 1563 | case clang::BuiltinType::RvvBFloat16mf4x3: | |
| 1564 | case clang::BuiltinType::RvvBFloat16mf4x4: | |
| 1565 | case clang::BuiltinType::RvvBFloat16mf4x5: | |
| 1566 | case clang::BuiltinType::RvvBFloat16mf4x6: | |
| 1567 | case clang::BuiltinType::RvvBFloat16mf4x7: | |
| 1568 | case clang::BuiltinType::RvvBFloat16mf4x8: | |
| 1569 | case clang::BuiltinType::RvvBFloat16mf2x2: | |
| 1570 | case clang::BuiltinType::RvvBFloat16mf2x3: | |
| 1571 | case clang::BuiltinType::RvvBFloat16mf2x4: | |
| 1572 | case clang::BuiltinType::RvvBFloat16mf2x5: | |
| 1573 | case clang::BuiltinType::RvvBFloat16mf2x6: | |
| 1574 | case clang::BuiltinType::RvvBFloat16mf2x7: | |
| 1575 | case clang::BuiltinType::RvvBFloat16mf2x8: | |
| 1576 | case clang::BuiltinType::RvvBFloat16m1x2: | |
| 1577 | case clang::BuiltinType::RvvBFloat16m1x3: | |
| 1578 | case clang::BuiltinType::RvvBFloat16m1x4: | |
| 1579 | case clang::BuiltinType::RvvBFloat16m1x5: | |
| 1580 | case clang::BuiltinType::RvvBFloat16m1x6: | |
| 1581 | case clang::BuiltinType::RvvBFloat16m1x7: | |
| 1582 | case clang::BuiltinType::RvvBFloat16m1x8: | |
| 1583 | case clang::BuiltinType::RvvBFloat16m2x2: | |
| 1584 | case clang::BuiltinType::RvvBFloat16m2x3: | |
| 1585 | case clang::BuiltinType::RvvBFloat16m2x4: | |
| 1586 | case clang::BuiltinType::RvvBFloat16m4x2: | |
| 1587 | case clang::BuiltinType::WasmExternRef: | |
| 1588 | case clang::BuiltinType::AMDGPUBufferRsrc: | |
| 1589 | case clang::BuiltinType::AMDGPUNamedWorkgroupBarrier: | |
| 1590 | case clang::BuiltinType::HLSLResource: | |
| 1591 | case clang::BuiltinType::Void: | |
| 1592 | case clang::BuiltinType::Bool: | |
| 1593 | case clang::BuiltinType::Char_U: | |
| 1594 | case clang::BuiltinType::UChar: | |
| 1595 | case clang::BuiltinType::WChar_U: | |
| 1596 | case clang::BuiltinType::Char8: | |
| 1597 | case clang::BuiltinType::Char16: | |
| 1598 | case clang::BuiltinType::Char32: | |
| 1599 | case clang::BuiltinType::UShort: | |
| 1600 | case clang::BuiltinType::UInt: | |
| 1601 | case clang::BuiltinType::ULong: | |
| 1602 | case clang::BuiltinType::ULongLong: | |
| 1603 | case clang::BuiltinType::UInt128: | |
| 1604 | case clang::BuiltinType::Char_S: | |
| 1605 | case clang::BuiltinType::SChar: | |
| 1606 | case clang::BuiltinType::WChar_S: | |
| 1607 | case clang::BuiltinType::Short: | |
| 1608 | case clang::BuiltinType::Int: | |
| 1609 | case clang::BuiltinType::Long: | |
| 1610 | case clang::BuiltinType::LongLong: | |
| 1611 | case clang::BuiltinType::Int128: | |
| 1612 | case clang::BuiltinType::ShortAccum: | |
| 1613 | case clang::BuiltinType::Accum: | |
| 1614 | case clang::BuiltinType::LongAccum: | |
| 1615 | case clang::BuiltinType::UShortAccum: | |
| 1616 | case clang::BuiltinType::UAccum: | |
| 1617 | case clang::BuiltinType::ULongAccum: | |
| 1618 | case clang::BuiltinType::ShortFract: | |
| 1619 | case clang::BuiltinType::Fract: | |
| 1620 | case clang::BuiltinType::LongFract: | |
| 1621 | case clang::BuiltinType::UShortFract: | |
| 1622 | case clang::BuiltinType::UFract: | |
| 1623 | case clang::BuiltinType::ULongFract: | |
| 1624 | case clang::BuiltinType::SatShortAccum: | |
| 1625 | case clang::BuiltinType::SatAccum: | |
| 1626 | case clang::BuiltinType::SatLongAccum: | |
| 1627 | case clang::BuiltinType::SatUShortAccum: | |
| 1628 | case clang::BuiltinType::SatUAccum: | |
| 1629 | case clang::BuiltinType::SatULongAccum: | |
| 1630 | case clang::BuiltinType::SatShortFract: | |
| 1631 | case clang::BuiltinType::SatFract: | |
| 1632 | case clang::BuiltinType::SatLongFract: | |
| 1633 | case clang::BuiltinType::SatUShortFract: | |
| 1634 | case clang::BuiltinType::SatUFract: | |
| 1635 | case clang::BuiltinType::SatULongFract: | |
| 1636 | case clang::BuiltinType::Half: | |
| 1637 | case clang::BuiltinType::Float: | |
| 1638 | case clang::BuiltinType::Double: | |
| 1639 | case clang::BuiltinType::LongDouble: | |
| 1640 | case clang::BuiltinType::Float16: | |
| 1641 | case clang::BuiltinType::BFloat16: | |
| 1642 | case clang::BuiltinType::Float128: | |
| 1643 | case clang::BuiltinType::Ibm128: | |
| 1644 | case clang::BuiltinType::NullPtr: | |
| 1645 | case clang::BuiltinType::ObjCId: | |
| 1646 | case clang::BuiltinType::ObjCClass: | |
| 1647 | case clang::BuiltinType::ObjCSel: | |
| 1648 | case clang::BuiltinType::OCLSampler: | |
| 1649 | case clang::BuiltinType::OCLEvent: | |
| 1650 | case clang::BuiltinType::OCLClkEvent: | |
| 1651 | case clang::BuiltinType::OCLQueue: | |
| 1652 | case clang::BuiltinType::OCLReserveID: | |
| 1653 | case clang::BuiltinType::Dependent: | |
| 1654 | case clang::BuiltinType::Overload: | |
| 1655 | case clang::BuiltinType::BoundMember: | |
| 1656 | case clang::BuiltinType::UnresolvedTemplate: | |
| 1657 | case clang::BuiltinType::PseudoObject: | |
| 1658 | case clang::BuiltinType::UnknownAny: | |
| 1659 | case clang::BuiltinType::BuiltinFn: | |
| 1660 | case clang::BuiltinType::ARCUnbridgedCast: | |
| 1661 | case clang::BuiltinType::IncompleteMatrixIdx: | |
| 1662 | case clang::BuiltinType::OMPArrayShaping: | |
| 1663 | case clang::BuiltinType::OMPIterator: | |
| 1664 | case clang::BuiltinType::ArraySection: | |
| 1665 | break; | |
| 1666 | } | |
| 1667 | } | |
| 1668 | ||
| 1669 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dRO == clang::BuiltinType::OCLImage1dRO, ""); | |
| 1670 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dArrayRO == clang::BuiltinType::OCLImage1dArrayRO, ""); | |
| 1671 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dBufferRO == clang::BuiltinType::OCLImage1dBufferRO, ""); | |
| 1672 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dRO == clang::BuiltinType::OCLImage2dRO, ""); | |
| 1673 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayRO == clang::BuiltinType::OCLImage2dArrayRO, ""); | |
| 1674 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dDepthRO == clang::BuiltinType::OCLImage2dDepthRO, ""); | |
| 1675 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayDepthRO == clang::BuiltinType::OCLImage2dArrayDepthRO, ""); | |
| 1676 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAARO == clang::BuiltinType::OCLImage2dMSAARO, ""); | |
| 1677 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAARO == clang::BuiltinType::OCLImage2dArrayMSAARO, ""); | |
| 1678 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAADepthRO == clang::BuiltinType::OCLImage2dMSAADepthRO, ""); | |
| 1679 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRO == clang::BuiltinType::OCLImage2dArrayMSAADepthRO, ""); | |
| 1680 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage3dRO == clang::BuiltinType::OCLImage3dRO, ""); | |
| 1681 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dWO == clang::BuiltinType::OCLImage1dWO, ""); | |
| 1682 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dArrayWO == clang::BuiltinType::OCLImage1dArrayWO, ""); | |
| 1683 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dBufferWO == clang::BuiltinType::OCLImage1dBufferWO, ""); | |
| 1684 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dWO == clang::BuiltinType::OCLImage2dWO, ""); | |
| 1685 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayWO == clang::BuiltinType::OCLImage2dArrayWO, ""); | |
| 1686 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dDepthWO == clang::BuiltinType::OCLImage2dDepthWO, ""); | |
| 1687 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayDepthWO == clang::BuiltinType::OCLImage2dArrayDepthWO, ""); | |
| 1688 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAAWO == clang::BuiltinType::OCLImage2dMSAAWO, ""); | |
| 1689 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAAWO == clang::BuiltinType::OCLImage2dArrayMSAAWO, ""); | |
| 1690 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAADepthWO == clang::BuiltinType::OCLImage2dMSAADepthWO, ""); | |
| 1691 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAADepthWO == clang::BuiltinType::OCLImage2dArrayMSAADepthWO, ""); | |
| 1692 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage3dWO == clang::BuiltinType::OCLImage3dWO, ""); | |
| 1693 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dRW == clang::BuiltinType::OCLImage1dRW, ""); | |
| 1694 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dArrayRW == clang::BuiltinType::OCLImage1dArrayRW, ""); | |
| 1695 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dBufferRW == clang::BuiltinType::OCLImage1dBufferRW, ""); | |
| 1696 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dRW == clang::BuiltinType::OCLImage2dRW, ""); | |
| 1697 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayRW == clang::BuiltinType::OCLImage2dArrayRW, ""); | |
| 1698 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dDepthRW == clang::BuiltinType::OCLImage2dDepthRW, ""); | |
| 1699 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayDepthRW == clang::BuiltinType::OCLImage2dArrayDepthRW, ""); | |
| 1700 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAARW == clang::BuiltinType::OCLImage2dMSAARW, ""); | |
| 1701 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAARW == clang::BuiltinType::OCLImage2dArrayMSAARW, ""); | |
| 1702 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAADepthRW == clang::BuiltinType::OCLImage2dMSAADepthRW, ""); | |
| 1703 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRW == clang::BuiltinType::OCLImage2dArrayMSAADepthRW, ""); | |
| 1704 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage3dRW == clang::BuiltinType::OCLImage3dRW, ""); | |
| 1705 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCMcePayload == clang::BuiltinType::OCLIntelSubgroupAVCMcePayload, ""); | |
| 1706 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImePayload == clang::BuiltinType::OCLIntelSubgroupAVCImePayload, ""); | |
| 1707 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCRefPayload == clang::BuiltinType::OCLIntelSubgroupAVCRefPayload, ""); | |
| 1708 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCSicPayload == clang::BuiltinType::OCLIntelSubgroupAVCSicPayload, ""); | |
| 1709 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCMceResult == clang::BuiltinType::OCLIntelSubgroupAVCMceResult, ""); | |
| 1710 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResult == clang::BuiltinType::OCLIntelSubgroupAVCImeResult, ""); | |
| 1711 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCRefResult == clang::BuiltinType::OCLIntelSubgroupAVCRefResult, ""); | |
| 1712 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCSicResult == clang::BuiltinType::OCLIntelSubgroupAVCSicResult, ""); | |
| 1713 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultSingleReferenceStreamout == clang::BuiltinType::OCLIntelSubgroupAVCImeResultSingleReferenceStreamout, ""); | |
| 1714 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultDualReferenceStreamout == clang::BuiltinType::OCLIntelSubgroupAVCImeResultDualReferenceStreamout, ""); | |
| 1715 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeSingleReferenceStreamin == clang::BuiltinType::OCLIntelSubgroupAVCImeSingleReferenceStreamin, ""); | |
| 1716 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeDualReferenceStreamin == clang::BuiltinType::OCLIntelSubgroupAVCImeDualReferenceStreamin, ""); | |
| 1717 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8 == clang::BuiltinType::SveInt8, ""); | |
| 1718 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16 == clang::BuiltinType::SveInt16, ""); | |
| 1719 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32 == clang::BuiltinType::SveInt32, ""); | |
| 1720 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64 == clang::BuiltinType::SveInt64, ""); | |
| 1721 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8 == clang::BuiltinType::SveUint8, ""); | |
| 1722 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16 == clang::BuiltinType::SveUint16, ""); | |
| 1723 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32 == clang::BuiltinType::SveUint32, ""); | |
| 1724 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64 == clang::BuiltinType::SveUint64, ""); | |
| 1725 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16 == clang::BuiltinType::SveFloat16, ""); | |
| 1726 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32 == clang::BuiltinType::SveFloat32, ""); | |
| 1727 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64 == clang::BuiltinType::SveFloat64, ""); | |
| 1728 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16 == clang::BuiltinType::SveBFloat16, ""); | |
| 1729 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8 == clang::BuiltinType::SveMFloat8, ""); | |
| 1730 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8x2 == clang::BuiltinType::SveInt8x2, ""); | |
| 1731 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16x2 == clang::BuiltinType::SveInt16x2, ""); | |
| 1732 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32x2 == clang::BuiltinType::SveInt32x2, ""); | |
| 1733 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64x2 == clang::BuiltinType::SveInt64x2, ""); | |
| 1734 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8x2 == clang::BuiltinType::SveUint8x2, ""); | |
| 1735 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16x2 == clang::BuiltinType::SveUint16x2, ""); | |
| 1736 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32x2 == clang::BuiltinType::SveUint32x2, ""); | |
| 1737 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64x2 == clang::BuiltinType::SveUint64x2, ""); | |
| 1738 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16x2 == clang::BuiltinType::SveFloat16x2, ""); | |
| 1739 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x2 == clang::BuiltinType::SveFloat32x2, ""); | |
| 1740 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x2 == clang::BuiltinType::SveFloat64x2, ""); | |
| 1741 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x2 == clang::BuiltinType::SveBFloat16x2, ""); | |
| 1742 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8x2 == clang::BuiltinType::SveMFloat8x2, ""); | |
| 1743 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8x3 == clang::BuiltinType::SveInt8x3, ""); | |
| 1744 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16x3 == clang::BuiltinType::SveInt16x3, ""); | |
| 1745 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32x3 == clang::BuiltinType::SveInt32x3, ""); | |
| 1746 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64x3 == clang::BuiltinType::SveInt64x3, ""); | |
| 1747 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8x3 == clang::BuiltinType::SveUint8x3, ""); | |
| 1748 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16x3 == clang::BuiltinType::SveUint16x3, ""); | |
| 1749 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32x3 == clang::BuiltinType::SveUint32x3, ""); | |
| 1750 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64x3 == clang::BuiltinType::SveUint64x3, ""); | |
| 1751 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16x3 == clang::BuiltinType::SveFloat16x3, ""); | |
| 1752 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x3 == clang::BuiltinType::SveFloat32x3, ""); | |
| 1753 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x3 == clang::BuiltinType::SveFloat64x3, ""); | |
| 1754 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x3 == clang::BuiltinType::SveBFloat16x3, ""); | |
| 1755 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8x3 == clang::BuiltinType::SveMFloat8x3, ""); | |
| 1756 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8x4 == clang::BuiltinType::SveInt8x4, ""); | |
| 1757 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16x4 == clang::BuiltinType::SveInt16x4, ""); | |
| 1758 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32x4 == clang::BuiltinType::SveInt32x4, ""); | |
| 1759 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64x4 == clang::BuiltinType::SveInt64x4, ""); | |
| 1760 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8x4 == clang::BuiltinType::SveUint8x4, ""); | |
| 1761 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16x4 == clang::BuiltinType::SveUint16x4, ""); | |
| 1762 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32x4 == clang::BuiltinType::SveUint32x4, ""); | |
| 1763 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64x4 == clang::BuiltinType::SveUint64x4, ""); | |
| 1764 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16x4 == clang::BuiltinType::SveFloat16x4, ""); | |
| 1765 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x4 == clang::BuiltinType::SveFloat32x4, ""); | |
| 1766 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x4 == clang::BuiltinType::SveFloat64x4, ""); | |
| 1767 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x4 == clang::BuiltinType::SveBFloat16x4, ""); | |
| 1768 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8x4 == clang::BuiltinType::SveMFloat8x4, ""); | |
| 1769 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBool == clang::BuiltinType::SveBool, ""); | |
| 1770 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBoolx2 == clang::BuiltinType::SveBoolx2, ""); | |
| 1771 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBoolx4 == clang::BuiltinType::SveBoolx4, ""); | |
| 1772 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveCount == clang::BuiltinType::SveCount, ""); | |
| 1773 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeMFloat8 == clang::BuiltinType::MFloat8, ""); | |
| 1774 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeDMR1024 == clang::BuiltinType::DMR1024, ""); | |
| 1775 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorQuad == clang::BuiltinType::VectorQuad, ""); | |
| 1776 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorPair == clang::BuiltinType::VectorPair, ""); | |
| 1777 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8 == clang::BuiltinType::RvvInt8mf8, ""); | |
| 1778 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4 == clang::BuiltinType::RvvInt8mf4, ""); | |
| 1779 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2 == clang::BuiltinType::RvvInt8mf2, ""); | |
| 1780 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1 == clang::BuiltinType::RvvInt8m1, ""); | |
| 1781 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2 == clang::BuiltinType::RvvInt8m2, ""); | |
| 1782 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m4 == clang::BuiltinType::RvvInt8m4, ""); | |
| 1783 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m8 == clang::BuiltinType::RvvInt8m8, ""); | |
| 1784 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8 == clang::BuiltinType::RvvUint8mf8, ""); | |
| 1785 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4 == clang::BuiltinType::RvvUint8mf4, ""); | |
| 1786 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2 == clang::BuiltinType::RvvUint8mf2, ""); | |
| 1787 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1 == clang::BuiltinType::RvvUint8m1, ""); | |
| 1788 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2 == clang::BuiltinType::RvvUint8m2, ""); | |
| 1789 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m4 == clang::BuiltinType::RvvUint8m4, ""); | |
| 1790 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m8 == clang::BuiltinType::RvvUint8m8, ""); | |
| 1791 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4 == clang::BuiltinType::RvvInt16mf4, ""); | |
| 1792 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2 == clang::BuiltinType::RvvInt16mf2, ""); | |
| 1793 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1 == clang::BuiltinType::RvvInt16m1, ""); | |
| 1794 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2 == clang::BuiltinType::RvvInt16m2, ""); | |
| 1795 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m4 == clang::BuiltinType::RvvInt16m4, ""); | |
| 1796 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m8 == clang::BuiltinType::RvvInt16m8, ""); | |
| 1797 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4 == clang::BuiltinType::RvvUint16mf4, ""); | |
| 1798 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2 == clang::BuiltinType::RvvUint16mf2, ""); | |
| 1799 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1 == clang::BuiltinType::RvvUint16m1, ""); | |
| 1800 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2 == clang::BuiltinType::RvvUint16m2, ""); | |
| 1801 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m4 == clang::BuiltinType::RvvUint16m4, ""); | |
| 1802 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m8 == clang::BuiltinType::RvvUint16m8, ""); | |
| 1803 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2 == clang::BuiltinType::RvvInt32mf2, ""); | |
| 1804 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1 == clang::BuiltinType::RvvInt32m1, ""); | |
| 1805 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2 == clang::BuiltinType::RvvInt32m2, ""); | |
| 1806 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m4 == clang::BuiltinType::RvvInt32m4, ""); | |
| 1807 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m8 == clang::BuiltinType::RvvInt32m8, ""); | |
| 1808 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2 == clang::BuiltinType::RvvUint32mf2, ""); | |
| 1809 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1 == clang::BuiltinType::RvvUint32m1, ""); | |
| 1810 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2 == clang::BuiltinType::RvvUint32m2, ""); | |
| 1811 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m4 == clang::BuiltinType::RvvUint32m4, ""); | |
| 1812 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m8 == clang::BuiltinType::RvvUint32m8, ""); | |
| 1813 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1 == clang::BuiltinType::RvvInt64m1, ""); | |
| 1814 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2 == clang::BuiltinType::RvvInt64m2, ""); | |
| 1815 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m4 == clang::BuiltinType::RvvInt64m4, ""); | |
| 1816 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m8 == clang::BuiltinType::RvvInt64m8, ""); | |
| 1817 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1 == clang::BuiltinType::RvvUint64m1, ""); | |
| 1818 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2 == clang::BuiltinType::RvvUint64m2, ""); | |
| 1819 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m4 == clang::BuiltinType::RvvUint64m4, ""); | |
| 1820 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m8 == clang::BuiltinType::RvvUint64m8, ""); | |
| 1821 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4 == clang::BuiltinType::RvvFloat16mf4, ""); | |
| 1822 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2 == clang::BuiltinType::RvvFloat16mf2, ""); | |
| 1823 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1 == clang::BuiltinType::RvvFloat16m1, ""); | |
| 1824 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2 == clang::BuiltinType::RvvFloat16m2, ""); | |
| 1825 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m4 == clang::BuiltinType::RvvFloat16m4, ""); | |
| 1826 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m8 == clang::BuiltinType::RvvFloat16m8, ""); | |
| 1827 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4 == clang::BuiltinType::RvvBFloat16mf4, ""); | |
| 1828 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2 == clang::BuiltinType::RvvBFloat16mf2, ""); | |
| 1829 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1 == clang::BuiltinType::RvvBFloat16m1, ""); | |
| 1830 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2 == clang::BuiltinType::RvvBFloat16m2, ""); | |
| 1831 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m4 == clang::BuiltinType::RvvBFloat16m4, ""); | |
| 1832 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m8 == clang::BuiltinType::RvvBFloat16m8, ""); | |
| 1833 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2 == clang::BuiltinType::RvvFloat32mf2, ""); | |
| 1834 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1 == clang::BuiltinType::RvvFloat32m1, ""); | |
| 1835 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2 == clang::BuiltinType::RvvFloat32m2, ""); | |
| 1836 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m4 == clang::BuiltinType::RvvFloat32m4, ""); | |
| 1837 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m8 == clang::BuiltinType::RvvFloat32m8, ""); | |
| 1838 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1 == clang::BuiltinType::RvvFloat64m1, ""); | |
| 1839 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2 == clang::BuiltinType::RvvFloat64m2, ""); | |
| 1840 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m4 == clang::BuiltinType::RvvFloat64m4, ""); | |
| 1841 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m8 == clang::BuiltinType::RvvFloat64m8, ""); | |
| 1842 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool1 == clang::BuiltinType::RvvBool1, ""); | |
| 1843 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool2 == clang::BuiltinType::RvvBool2, ""); | |
| 1844 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool4 == clang::BuiltinType::RvvBool4, ""); | |
| 1845 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool8 == clang::BuiltinType::RvvBool8, ""); | |
| 1846 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool16 == clang::BuiltinType::RvvBool16, ""); | |
| 1847 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool32 == clang::BuiltinType::RvvBool32, ""); | |
| 1848 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool64 == clang::BuiltinType::RvvBool64, ""); | |
| 1849 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x2 == clang::BuiltinType::RvvInt8mf8x2, ""); | |
| 1850 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x3 == clang::BuiltinType::RvvInt8mf8x3, ""); | |
| 1851 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x4 == clang::BuiltinType::RvvInt8mf8x4, ""); | |
| 1852 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x5 == clang::BuiltinType::RvvInt8mf8x5, ""); | |
| 1853 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x6 == clang::BuiltinType::RvvInt8mf8x6, ""); | |
| 1854 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x7 == clang::BuiltinType::RvvInt8mf8x7, ""); | |
| 1855 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x8 == clang::BuiltinType::RvvInt8mf8x8, ""); | |
| 1856 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x2 == clang::BuiltinType::RvvInt8mf4x2, ""); | |
| 1857 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x3 == clang::BuiltinType::RvvInt8mf4x3, ""); | |
| 1858 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x4 == clang::BuiltinType::RvvInt8mf4x4, ""); | |
| 1859 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x5 == clang::BuiltinType::RvvInt8mf4x5, ""); | |
| 1860 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x6 == clang::BuiltinType::RvvInt8mf4x6, ""); | |
| 1861 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x7 == clang::BuiltinType::RvvInt8mf4x7, ""); | |
| 1862 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x8 == clang::BuiltinType::RvvInt8mf4x8, ""); | |
| 1863 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x2 == clang::BuiltinType::RvvInt8mf2x2, ""); | |
| 1864 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x3 == clang::BuiltinType::RvvInt8mf2x3, ""); | |
| 1865 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x4 == clang::BuiltinType::RvvInt8mf2x4, ""); | |
| 1866 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x5 == clang::BuiltinType::RvvInt8mf2x5, ""); | |
| 1867 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x6 == clang::BuiltinType::RvvInt8mf2x6, ""); | |
| 1868 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x7 == clang::BuiltinType::RvvInt8mf2x7, ""); | |
| 1869 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x8 == clang::BuiltinType::RvvInt8mf2x8, ""); | |
| 1870 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x2 == clang::BuiltinType::RvvInt8m1x2, ""); | |
| 1871 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x3 == clang::BuiltinType::RvvInt8m1x3, ""); | |
| 1872 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x4 == clang::BuiltinType::RvvInt8m1x4, ""); | |
| 1873 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x5 == clang::BuiltinType::RvvInt8m1x5, ""); | |
| 1874 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x6 == clang::BuiltinType::RvvInt8m1x6, ""); | |
| 1875 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x7 == clang::BuiltinType::RvvInt8m1x7, ""); | |
| 1876 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x8 == clang::BuiltinType::RvvInt8m1x8, ""); | |
| 1877 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2x2 == clang::BuiltinType::RvvInt8m2x2, ""); | |
| 1878 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2x3 == clang::BuiltinType::RvvInt8m2x3, ""); | |
| 1879 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2x4 == clang::BuiltinType::RvvInt8m2x4, ""); | |
| 1880 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m4x2 == clang::BuiltinType::RvvInt8m4x2, ""); | |
| 1881 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x2 == clang::BuiltinType::RvvUint8mf8x2, ""); | |
| 1882 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x3 == clang::BuiltinType::RvvUint8mf8x3, ""); | |
| 1883 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x4 == clang::BuiltinType::RvvUint8mf8x4, ""); | |
| 1884 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x5 == clang::BuiltinType::RvvUint8mf8x5, ""); | |
| 1885 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x6 == clang::BuiltinType::RvvUint8mf8x6, ""); | |
| 1886 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x7 == clang::BuiltinType::RvvUint8mf8x7, ""); | |
| 1887 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x8 == clang::BuiltinType::RvvUint8mf8x8, ""); | |
| 1888 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x2 == clang::BuiltinType::RvvUint8mf4x2, ""); | |
| 1889 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x3 == clang::BuiltinType::RvvUint8mf4x3, ""); | |
| 1890 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x4 == clang::BuiltinType::RvvUint8mf4x4, ""); | |
| 1891 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x5 == clang::BuiltinType::RvvUint8mf4x5, ""); | |
| 1892 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x6 == clang::BuiltinType::RvvUint8mf4x6, ""); | |
| 1893 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x7 == clang::BuiltinType::RvvUint8mf4x7, ""); | |
| 1894 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x8 == clang::BuiltinType::RvvUint8mf4x8, ""); | |
| 1895 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x2 == clang::BuiltinType::RvvUint8mf2x2, ""); | |
| 1896 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x3 == clang::BuiltinType::RvvUint8mf2x3, ""); | |
| 1897 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x4 == clang::BuiltinType::RvvUint8mf2x4, ""); | |
| 1898 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x5 == clang::BuiltinType::RvvUint8mf2x5, ""); | |
| 1899 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x6 == clang::BuiltinType::RvvUint8mf2x6, ""); | |
| 1900 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x7 == clang::BuiltinType::RvvUint8mf2x7, ""); | |
| 1901 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x8 == clang::BuiltinType::RvvUint8mf2x8, ""); | |
| 1902 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x2 == clang::BuiltinType::RvvUint8m1x2, ""); | |
| 1903 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x3 == clang::BuiltinType::RvvUint8m1x3, ""); | |
| 1904 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x4 == clang::BuiltinType::RvvUint8m1x4, ""); | |
| 1905 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x5 == clang::BuiltinType::RvvUint8m1x5, ""); | |
| 1906 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x6 == clang::BuiltinType::RvvUint8m1x6, ""); | |
| 1907 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x7 == clang::BuiltinType::RvvUint8m1x7, ""); | |
| 1908 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x8 == clang::BuiltinType::RvvUint8m1x8, ""); | |
| 1909 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2x2 == clang::BuiltinType::RvvUint8m2x2, ""); | |
| 1910 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2x3 == clang::BuiltinType::RvvUint8m2x3, ""); | |
| 1911 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2x4 == clang::BuiltinType::RvvUint8m2x4, ""); | |
| 1912 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m4x2 == clang::BuiltinType::RvvUint8m4x2, ""); | |
| 1913 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x2 == clang::BuiltinType::RvvInt16mf4x2, ""); | |
| 1914 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x3 == clang::BuiltinType::RvvInt16mf4x3, ""); | |
| 1915 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x4 == clang::BuiltinType::RvvInt16mf4x4, ""); | |
| 1916 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x5 == clang::BuiltinType::RvvInt16mf4x5, ""); | |
| 1917 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x6 == clang::BuiltinType::RvvInt16mf4x6, ""); | |
| 1918 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x7 == clang::BuiltinType::RvvInt16mf4x7, ""); | |
| 1919 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x8 == clang::BuiltinType::RvvInt16mf4x8, ""); | |
| 1920 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x2 == clang::BuiltinType::RvvInt16mf2x2, ""); | |
| 1921 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x3 == clang::BuiltinType::RvvInt16mf2x3, ""); | |
| 1922 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x4 == clang::BuiltinType::RvvInt16mf2x4, ""); | |
| 1923 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x5 == clang::BuiltinType::RvvInt16mf2x5, ""); | |
| 1924 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x6 == clang::BuiltinType::RvvInt16mf2x6, ""); | |
| 1925 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x7 == clang::BuiltinType::RvvInt16mf2x7, ""); | |
| 1926 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x8 == clang::BuiltinType::RvvInt16mf2x8, ""); | |
| 1927 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x2 == clang::BuiltinType::RvvInt16m1x2, ""); | |
| 1928 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x3 == clang::BuiltinType::RvvInt16m1x3, ""); | |
| 1929 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x4 == clang::BuiltinType::RvvInt16m1x4, ""); | |
| 1930 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x5 == clang::BuiltinType::RvvInt16m1x5, ""); | |
| 1931 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x6 == clang::BuiltinType::RvvInt16m1x6, ""); | |
| 1932 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x7 == clang::BuiltinType::RvvInt16m1x7, ""); | |
| 1933 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x8 == clang::BuiltinType::RvvInt16m1x8, ""); | |
| 1934 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2x2 == clang::BuiltinType::RvvInt16m2x2, ""); | |
| 1935 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2x3 == clang::BuiltinType::RvvInt16m2x3, ""); | |
| 1936 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2x4 == clang::BuiltinType::RvvInt16m2x4, ""); | |
| 1937 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m4x2 == clang::BuiltinType::RvvInt16m4x2, ""); | |
| 1938 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x2 == clang::BuiltinType::RvvUint16mf4x2, ""); | |
| 1939 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x3 == clang::BuiltinType::RvvUint16mf4x3, ""); | |
| 1940 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x4 == clang::BuiltinType::RvvUint16mf4x4, ""); | |
| 1941 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x5 == clang::BuiltinType::RvvUint16mf4x5, ""); | |
| 1942 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x6 == clang::BuiltinType::RvvUint16mf4x6, ""); | |
| 1943 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x7 == clang::BuiltinType::RvvUint16mf4x7, ""); | |
| 1944 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x8 == clang::BuiltinType::RvvUint16mf4x8, ""); | |
| 1945 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x2 == clang::BuiltinType::RvvUint16mf2x2, ""); | |
| 1946 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x3 == clang::BuiltinType::RvvUint16mf2x3, ""); | |
| 1947 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x4 == clang::BuiltinType::RvvUint16mf2x4, ""); | |
| 1948 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x5 == clang::BuiltinType::RvvUint16mf2x5, ""); | |
| 1949 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x6 == clang::BuiltinType::RvvUint16mf2x6, ""); | |
| 1950 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x7 == clang::BuiltinType::RvvUint16mf2x7, ""); | |
| 1951 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x8 == clang::BuiltinType::RvvUint16mf2x8, ""); | |
| 1952 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x2 == clang::BuiltinType::RvvUint16m1x2, ""); | |
| 1953 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x3 == clang::BuiltinType::RvvUint16m1x3, ""); | |
| 1954 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x4 == clang::BuiltinType::RvvUint16m1x4, ""); | |
| 1955 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x5 == clang::BuiltinType::RvvUint16m1x5, ""); | |
| 1956 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x6 == clang::BuiltinType::RvvUint16m1x6, ""); | |
| 1957 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x7 == clang::BuiltinType::RvvUint16m1x7, ""); | |
| 1958 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x8 == clang::BuiltinType::RvvUint16m1x8, ""); | |
| 1959 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2x2 == clang::BuiltinType::RvvUint16m2x2, ""); | |
| 1960 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2x3 == clang::BuiltinType::RvvUint16m2x3, ""); | |
| 1961 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2x4 == clang::BuiltinType::RvvUint16m2x4, ""); | |
| 1962 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m4x2 == clang::BuiltinType::RvvUint16m4x2, ""); | |
| 1963 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x2 == clang::BuiltinType::RvvInt32mf2x2, ""); | |
| 1964 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x3 == clang::BuiltinType::RvvInt32mf2x3, ""); | |
| 1965 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x4 == clang::BuiltinType::RvvInt32mf2x4, ""); | |
| 1966 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x5 == clang::BuiltinType::RvvInt32mf2x5, ""); | |
| 1967 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x6 == clang::BuiltinType::RvvInt32mf2x6, ""); | |
| 1968 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x7 == clang::BuiltinType::RvvInt32mf2x7, ""); | |
| 1969 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x8 == clang::BuiltinType::RvvInt32mf2x8, ""); | |
| 1970 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x2 == clang::BuiltinType::RvvInt32m1x2, ""); | |
| 1971 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x3 == clang::BuiltinType::RvvInt32m1x3, ""); | |
| 1972 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x4 == clang::BuiltinType::RvvInt32m1x4, ""); | |
| 1973 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x5 == clang::BuiltinType::RvvInt32m1x5, ""); | |
| 1974 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x6 == clang::BuiltinType::RvvInt32m1x6, ""); | |
| 1975 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x7 == clang::BuiltinType::RvvInt32m1x7, ""); | |
| 1976 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x8 == clang::BuiltinType::RvvInt32m1x8, ""); | |
| 1977 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2x2 == clang::BuiltinType::RvvInt32m2x2, ""); | |
| 1978 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2x3 == clang::BuiltinType::RvvInt32m2x3, ""); | |
| 1979 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2x4 == clang::BuiltinType::RvvInt32m2x4, ""); | |
| 1980 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m4x2 == clang::BuiltinType::RvvInt32m4x2, ""); | |
| 1981 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x2 == clang::BuiltinType::RvvUint32mf2x2, ""); | |
| 1982 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x3 == clang::BuiltinType::RvvUint32mf2x3, ""); | |
| 1983 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x4 == clang::BuiltinType::RvvUint32mf2x4, ""); | |
| 1984 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x5 == clang::BuiltinType::RvvUint32mf2x5, ""); | |
| 1985 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x6 == clang::BuiltinType::RvvUint32mf2x6, ""); | |
| 1986 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x7 == clang::BuiltinType::RvvUint32mf2x7, ""); | |
| 1987 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x8 == clang::BuiltinType::RvvUint32mf2x8, ""); | |
| 1988 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x2 == clang::BuiltinType::RvvUint32m1x2, ""); | |
| 1989 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x3 == clang::BuiltinType::RvvUint32m1x3, ""); | |
| 1990 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x4 == clang::BuiltinType::RvvUint32m1x4, ""); | |
| 1991 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x5 == clang::BuiltinType::RvvUint32m1x5, ""); | |
| 1992 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x6 == clang::BuiltinType::RvvUint32m1x6, ""); | |
| 1993 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x7 == clang::BuiltinType::RvvUint32m1x7, ""); | |
| 1994 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x8 == clang::BuiltinType::RvvUint32m1x8, ""); | |
| 1995 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2x2 == clang::BuiltinType::RvvUint32m2x2, ""); | |
| 1996 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2x3 == clang::BuiltinType::RvvUint32m2x3, ""); | |
| 1997 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2x4 == clang::BuiltinType::RvvUint32m2x4, ""); | |
| 1998 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m4x2 == clang::BuiltinType::RvvUint32m4x2, ""); | |
| 1999 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x2 == clang::BuiltinType::RvvInt64m1x2, ""); | |
| 2000 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x3 == clang::BuiltinType::RvvInt64m1x3, ""); | |
| 2001 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x4 == clang::BuiltinType::RvvInt64m1x4, ""); | |
| 2002 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x5 == clang::BuiltinType::RvvInt64m1x5, ""); | |
| 2003 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x6 == clang::BuiltinType::RvvInt64m1x6, ""); | |
| 2004 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x7 == clang::BuiltinType::RvvInt64m1x7, ""); | |
| 2005 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x8 == clang::BuiltinType::RvvInt64m1x8, ""); | |
| 2006 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2x2 == clang::BuiltinType::RvvInt64m2x2, ""); | |
| 2007 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2x3 == clang::BuiltinType::RvvInt64m2x3, ""); | |
| 2008 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2x4 == clang::BuiltinType::RvvInt64m2x4, ""); | |
| 2009 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m4x2 == clang::BuiltinType::RvvInt64m4x2, ""); | |
| 2010 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x2 == clang::BuiltinType::RvvUint64m1x2, ""); | |
| 2011 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x3 == clang::BuiltinType::RvvUint64m1x3, ""); | |
| 2012 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x4 == clang::BuiltinType::RvvUint64m1x4, ""); | |
| 2013 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x5 == clang::BuiltinType::RvvUint64m1x5, ""); | |
| 2014 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x6 == clang::BuiltinType::RvvUint64m1x6, ""); | |
| 2015 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x7 == clang::BuiltinType::RvvUint64m1x7, ""); | |
| 2016 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x8 == clang::BuiltinType::RvvUint64m1x8, ""); | |
| 2017 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2x2 == clang::BuiltinType::RvvUint64m2x2, ""); | |
| 2018 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2x3 == clang::BuiltinType::RvvUint64m2x3, ""); | |
| 2019 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2x4 == clang::BuiltinType::RvvUint64m2x4, ""); | |
| 2020 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m4x2 == clang::BuiltinType::RvvUint64m4x2, ""); | |
| 2021 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x2 == clang::BuiltinType::RvvFloat16mf4x2, ""); | |
| 2022 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x3 == clang::BuiltinType::RvvFloat16mf4x3, ""); | |
| 2023 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x4 == clang::BuiltinType::RvvFloat16mf4x4, ""); | |
| 2024 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x5 == clang::BuiltinType::RvvFloat16mf4x5, ""); | |
| 2025 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x6 == clang::BuiltinType::RvvFloat16mf4x6, ""); | |
| 2026 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x7 == clang::BuiltinType::RvvFloat16mf4x7, ""); | |
| 2027 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x8 == clang::BuiltinType::RvvFloat16mf4x8, ""); | |
| 2028 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x2 == clang::BuiltinType::RvvFloat16mf2x2, ""); | |
| 2029 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x3 == clang::BuiltinType::RvvFloat16mf2x3, ""); | |
| 2030 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x4 == clang::BuiltinType::RvvFloat16mf2x4, ""); | |
| 2031 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x5 == clang::BuiltinType::RvvFloat16mf2x5, ""); | |
| 2032 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x6 == clang::BuiltinType::RvvFloat16mf2x6, ""); | |
| 2033 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x7 == clang::BuiltinType::RvvFloat16mf2x7, ""); | |
| 2034 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x8 == clang::BuiltinType::RvvFloat16mf2x8, ""); | |
| 2035 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x2 == clang::BuiltinType::RvvFloat16m1x2, ""); | |
| 2036 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x3 == clang::BuiltinType::RvvFloat16m1x3, ""); | |
| 2037 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x4 == clang::BuiltinType::RvvFloat16m1x4, ""); | |
| 2038 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x5 == clang::BuiltinType::RvvFloat16m1x5, ""); | |
| 2039 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x6 == clang::BuiltinType::RvvFloat16m1x6, ""); | |
| 2040 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x7 == clang::BuiltinType::RvvFloat16m1x7, ""); | |
| 2041 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x8 == clang::BuiltinType::RvvFloat16m1x8, ""); | |
| 2042 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2x2 == clang::BuiltinType::RvvFloat16m2x2, ""); | |
| 2043 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2x3 == clang::BuiltinType::RvvFloat16m2x3, ""); | |
| 2044 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2x4 == clang::BuiltinType::RvvFloat16m2x4, ""); | |
| 2045 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m4x2 == clang::BuiltinType::RvvFloat16m4x2, ""); | |
| 2046 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x2 == clang::BuiltinType::RvvFloat32mf2x2, ""); | |
| 2047 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x3 == clang::BuiltinType::RvvFloat32mf2x3, ""); | |
| 2048 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x4 == clang::BuiltinType::RvvFloat32mf2x4, ""); | |
| 2049 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x5 == clang::BuiltinType::RvvFloat32mf2x5, ""); | |
| 2050 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x6 == clang::BuiltinType::RvvFloat32mf2x6, ""); | |
| 2051 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x7 == clang::BuiltinType::RvvFloat32mf2x7, ""); | |
| 2052 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x8 == clang::BuiltinType::RvvFloat32mf2x8, ""); | |
| 2053 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x2 == clang::BuiltinType::RvvFloat32m1x2, ""); | |
| 2054 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x3 == clang::BuiltinType::RvvFloat32m1x3, ""); | |
| 2055 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x4 == clang::BuiltinType::RvvFloat32m1x4, ""); | |
| 2056 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x5 == clang::BuiltinType::RvvFloat32m1x5, ""); | |
| 2057 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x6 == clang::BuiltinType::RvvFloat32m1x6, ""); | |
| 2058 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x7 == clang::BuiltinType::RvvFloat32m1x7, ""); | |
| 2059 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x8 == clang::BuiltinType::RvvFloat32m1x8, ""); | |
| 2060 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2x2 == clang::BuiltinType::RvvFloat32m2x2, ""); | |
| 2061 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2x3 == clang::BuiltinType::RvvFloat32m2x3, ""); | |
| 2062 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2x4 == clang::BuiltinType::RvvFloat32m2x4, ""); | |
| 2063 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m4x2 == clang::BuiltinType::RvvFloat32m4x2, ""); | |
| 2064 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x2 == clang::BuiltinType::RvvFloat64m1x2, ""); | |
| 2065 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x3 == clang::BuiltinType::RvvFloat64m1x3, ""); | |
| 2066 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x4 == clang::BuiltinType::RvvFloat64m1x4, ""); | |
| 2067 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x5 == clang::BuiltinType::RvvFloat64m1x5, ""); | |
| 2068 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x6 == clang::BuiltinType::RvvFloat64m1x6, ""); | |
| 2069 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x7 == clang::BuiltinType::RvvFloat64m1x7, ""); | |
| 2070 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x8 == clang::BuiltinType::RvvFloat64m1x8, ""); | |
| 2071 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2x2 == clang::BuiltinType::RvvFloat64m2x2, ""); | |
| 2072 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2x3 == clang::BuiltinType::RvvFloat64m2x3, ""); | |
| 2073 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2x4 == clang::BuiltinType::RvvFloat64m2x4, ""); | |
| 2074 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m4x2 == clang::BuiltinType::RvvFloat64m4x2, ""); | |
| 2075 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x2 == clang::BuiltinType::RvvBFloat16mf4x2, ""); | |
| 2076 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x3 == clang::BuiltinType::RvvBFloat16mf4x3, ""); | |
| 2077 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x4 == clang::BuiltinType::RvvBFloat16mf4x4, ""); | |
| 2078 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x5 == clang::BuiltinType::RvvBFloat16mf4x5, ""); | |
| 2079 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x6 == clang::BuiltinType::RvvBFloat16mf4x6, ""); | |
| 2080 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x7 == clang::BuiltinType::RvvBFloat16mf4x7, ""); | |
| 2081 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x8 == clang::BuiltinType::RvvBFloat16mf4x8, ""); | |
| 2082 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x2 == clang::BuiltinType::RvvBFloat16mf2x2, ""); | |
| 2083 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x3 == clang::BuiltinType::RvvBFloat16mf2x3, ""); | |
| 2084 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x4 == clang::BuiltinType::RvvBFloat16mf2x4, ""); | |
| 2085 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x5 == clang::BuiltinType::RvvBFloat16mf2x5, ""); | |
| 2086 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x6 == clang::BuiltinType::RvvBFloat16mf2x6, ""); | |
| 2087 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x7 == clang::BuiltinType::RvvBFloat16mf2x7, ""); | |
| 2088 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x8 == clang::BuiltinType::RvvBFloat16mf2x8, ""); | |
| 2089 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x2 == clang::BuiltinType::RvvBFloat16m1x2, ""); | |
| 2090 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x3 == clang::BuiltinType::RvvBFloat16m1x3, ""); | |
| 2091 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x4 == clang::BuiltinType::RvvBFloat16m1x4, ""); | |
| 2092 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x5 == clang::BuiltinType::RvvBFloat16m1x5, ""); | |
| 2093 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x6 == clang::BuiltinType::RvvBFloat16m1x6, ""); | |
| 2094 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x7 == clang::BuiltinType::RvvBFloat16m1x7, ""); | |
| 2095 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x8 == clang::BuiltinType::RvvBFloat16m1x8, ""); | |
| 2096 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2x2 == clang::BuiltinType::RvvBFloat16m2x2, ""); | |
| 2097 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2x3 == clang::BuiltinType::RvvBFloat16m2x3, ""); | |
| 2098 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2x4 == clang::BuiltinType::RvvBFloat16m2x4, ""); | |
| 2099 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m4x2 == clang::BuiltinType::RvvBFloat16m4x2, ""); | |
| 2100 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeWasmExternRef == clang::BuiltinType::WasmExternRef, ""); | |
| 2101 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeAMDGPUBufferRsrc == clang::BuiltinType::AMDGPUBufferRsrc, ""); | |
| 2102 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeAMDGPUNamedWorkgroupBarrier == clang::BuiltinType::AMDGPUNamedWorkgroupBarrier, ""); | |
| 2103 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeHLSLResource == clang::BuiltinType::HLSLResource, ""); | |
| 2104 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVoid == clang::BuiltinType::Void, ""); | |
| 2105 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBool == clang::BuiltinType::Bool, ""); | |
| 2106 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_U == clang::BuiltinType::Char_U, ""); | |
| 2107 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUChar == clang::BuiltinType::UChar, ""); | |
| 2108 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeWChar_U == clang::BuiltinType::WChar_U, ""); | |
| 2109 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar8 == clang::BuiltinType::Char8, ""); | |
| 2110 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar16 == clang::BuiltinType::Char16, ""); | |
| 2111 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar32 == clang::BuiltinType::Char32, ""); | |
| 2112 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUShort == clang::BuiltinType::UShort, ""); | |
| 2113 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUInt == clang::BuiltinType::UInt, ""); | |
| 2114 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULong == clang::BuiltinType::ULong, ""); | |
| 2115 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULongLong == clang::BuiltinType::ULongLong, ""); | |
| 2116 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUInt128 == clang::BuiltinType::UInt128, ""); | |
| 2117 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_S == clang::BuiltinType::Char_S, ""); | |
| 2118 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSChar == clang::BuiltinType::SChar, ""); | |
| 2119 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeWChar_S == clang::BuiltinType::WChar_S, ""); | |
| 2120 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeShort == clang::BuiltinType::Short, ""); | |
| 2121 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeInt == clang::BuiltinType::Int, ""); | |
| 2122 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLong == clang::BuiltinType::Long, ""); | |
| 2123 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongLong == clang::BuiltinType::LongLong, ""); | |
| 2124 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeInt128 == clang::BuiltinType::Int128, ""); | |
| 2125 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeShortAccum == clang::BuiltinType::ShortAccum, ""); | |
| 2126 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeAccum == clang::BuiltinType::Accum, ""); | |
| 2127 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongAccum == clang::BuiltinType::LongAccum, ""); | |
| 2128 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUShortAccum == clang::BuiltinType::UShortAccum, ""); | |
| 2129 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUAccum == clang::BuiltinType::UAccum, ""); | |
| 2130 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULongAccum == clang::BuiltinType::ULongAccum, ""); | |
| 2131 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeShortFract == clang::BuiltinType::ShortFract, ""); | |
| 2132 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFract == clang::BuiltinType::Fract, ""); | |
| 2133 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongFract == clang::BuiltinType::LongFract, ""); | |
| 2134 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUShortFract == clang::BuiltinType::UShortFract, ""); | |
| 2135 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUFract == clang::BuiltinType::UFract, ""); | |
| 2136 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULongFract == clang::BuiltinType::ULongFract, ""); | |
| 2137 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatShortAccum == clang::BuiltinType::SatShortAccum, ""); | |
| 2138 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatAccum == clang::BuiltinType::SatAccum, ""); | |
| 2139 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatLongAccum == clang::BuiltinType::SatLongAccum, ""); | |
| 2140 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUShortAccum == clang::BuiltinType::SatUShortAccum, ""); | |
| 2141 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUAccum == clang::BuiltinType::SatUAccum, ""); | |
| 2142 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatULongAccum == clang::BuiltinType::SatULongAccum, ""); | |
| 2143 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatShortFract == clang::BuiltinType::SatShortFract, ""); | |
| 2144 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatFract == clang::BuiltinType::SatFract, ""); | |
| 2145 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatLongFract == clang::BuiltinType::SatLongFract, ""); | |
| 2146 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUShortFract == clang::BuiltinType::SatUShortFract, ""); | |
| 2147 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUFract == clang::BuiltinType::SatUFract, ""); | |
| 2148 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatULongFract == clang::BuiltinType::SatULongFract, ""); | |
| 2149 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeHalf == clang::BuiltinType::Half, ""); | |
| 2150 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFloat == clang::BuiltinType::Float, ""); | |
| 2151 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeDouble == clang::BuiltinType::Double, ""); | |
| 2152 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongDouble == clang::BuiltinType::LongDouble, ""); | |
| 2153 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFloat16 == clang::BuiltinType::Float16, ""); | |
| 2154 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBFloat16 == clang::BuiltinType::BFloat16, ""); | |
| 2155 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFloat128 == clang::BuiltinType::Float128, ""); | |
| 2156 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeIbm128 == clang::BuiltinType::Ibm128, ""); | |
| 2157 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeNullPtr == clang::BuiltinType::NullPtr, ""); | |
| 2158 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeObjCId == clang::BuiltinType::ObjCId, ""); | |
| 2159 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeObjCClass == clang::BuiltinType::ObjCClass, ""); | |
| 2160 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeObjCSel == clang::BuiltinType::ObjCSel, ""); | |
| 2161 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLSampler == clang::BuiltinType::OCLSampler, ""); | |
| 2162 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLEvent == clang::BuiltinType::OCLEvent, ""); | |
| 2163 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLClkEvent == clang::BuiltinType::OCLClkEvent, ""); | |
| 2164 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLQueue == clang::BuiltinType::OCLQueue, ""); | |
| 2165 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLReserveID == clang::BuiltinType::OCLReserveID, ""); | |
| 2166 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeDependent == clang::BuiltinType::Dependent, ""); | |
| 2167 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOverload == clang::BuiltinType::Overload, ""); | |
| 2168 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBoundMember == clang::BuiltinType::BoundMember, ""); | |
| 2169 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUnresolvedTemplate == clang::BuiltinType::UnresolvedTemplate, ""); | |
| 2170 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypePseudoObject == clang::BuiltinType::PseudoObject, ""); | |
| 2171 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUnknownAny == clang::BuiltinType::UnknownAny, ""); | |
| 2172 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBuiltinFn == clang::BuiltinType::BuiltinFn, ""); | |
| 2173 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeARCUnbridgedCast == clang::BuiltinType::ARCUnbridgedCast, ""); | |
| 2174 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeIncompleteMatrixIdx == clang::BuiltinType::IncompleteMatrixIdx, ""); | |
| 2175 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOMPArrayShaping == clang::BuiltinType::OMPArrayShaping, ""); | |
| 2176 | static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOMPIterator == clang::BuiltinType::OMPIterator, ""); | |
| 2177 | ||
| 2178 | void ZigClang_detect_enum_CallingConv(clang::CallingConv x) { | |
| 2179 | switch (x) { | |
| 2180 | case clang::CC_C: | |
| 2181 | case clang::CC_X86StdCall: | |
| 2182 | case clang::CC_X86FastCall: | |
| 2183 | case clang::CC_X86ThisCall: | |
| 2184 | case clang::CC_X86VectorCall: | |
| 2185 | case clang::CC_X86Pascal: | |
| 2186 | case clang::CC_Win64: | |
| 2187 | case clang::CC_X86_64SysV: | |
| 2188 | case clang::CC_X86RegCall: | |
| 2189 | case clang::CC_AAPCS: | |
| 2190 | case clang::CC_AAPCS_VFP: | |
| 2191 | case clang::CC_IntelOclBicc: | |
| 2192 | case clang::CC_SpirFunction: | |
| 2193 | case clang::CC_DeviceKernel: | |
| 2194 | case clang::CC_Swift: | |
| 2195 | case clang::CC_SwiftAsync: | |
| 2196 | case clang::CC_PreserveMost: | |
| 2197 | case clang::CC_PreserveAll: | |
| 2198 | case clang::CC_AArch64VectorCall: | |
| 2199 | case clang::CC_AArch64SVEPCS: | |
| 2200 | case clang::CC_M68kRTD: | |
| 2201 | case clang::CC_PreserveNone: | |
| 2202 | case clang::CC_RISCVVectorCall: | |
| 2203 | break; | |
| 2204 | } | |
| 2205 | } | |
| 2206 | ||
| 2207 | static_assert((clang::CallingConv)ZigClangCallingConv_C == clang::CC_C, ""); | |
| 2208 | static_assert((clang::CallingConv)ZigClangCallingConv_X86StdCall == clang::CC_X86StdCall, ""); | |
| 2209 | static_assert((clang::CallingConv)ZigClangCallingConv_X86FastCall == clang::CC_X86FastCall, ""); | |
| 2210 | static_assert((clang::CallingConv)ZigClangCallingConv_X86ThisCall == clang::CC_X86ThisCall, ""); | |
| 2211 | static_assert((clang::CallingConv)ZigClangCallingConv_X86VectorCall == clang::CC_X86VectorCall, ""); | |
| 2212 | static_assert((clang::CallingConv)ZigClangCallingConv_X86Pascal == clang::CC_X86Pascal, ""); | |
| 2213 | static_assert((clang::CallingConv)ZigClangCallingConv_Win64 == clang::CC_Win64, ""); | |
| 2214 | static_assert((clang::CallingConv)ZigClangCallingConv_X86_64SysV == clang::CC_X86_64SysV, ""); | |
| 2215 | static_assert((clang::CallingConv)ZigClangCallingConv_X86RegCall == clang::CC_X86RegCall, ""); | |
| 2216 | static_assert((clang::CallingConv)ZigClangCallingConv_AAPCS == clang::CC_AAPCS, ""); | |
| 2217 | static_assert((clang::CallingConv)ZigClangCallingConv_AAPCS_VFP == clang::CC_AAPCS_VFP, ""); | |
| 2218 | static_assert((clang::CallingConv)ZigClangCallingConv_IntelOclBicc == clang::CC_IntelOclBicc, ""); | |
| 2219 | static_assert((clang::CallingConv)ZigClangCallingConv_SpirFunction == clang::CC_SpirFunction, ""); | |
| 2220 | static_assert((clang::CallingConv)ZigClangCallingConv_DeviceKernel == clang::CC_DeviceKernel, ""); | |
| 2221 | static_assert((clang::CallingConv)ZigClangCallingConv_Swift == clang::CC_Swift, ""); | |
| 2222 | static_assert((clang::CallingConv)ZigClangCallingConv_SwiftAsync == clang::CC_SwiftAsync, ""); | |
| 2223 | static_assert((clang::CallingConv)ZigClangCallingConv_PreserveMost == clang::CC_PreserveMost, ""); | |
| 2224 | static_assert((clang::CallingConv)ZigClangCallingConv_PreserveAll == clang::CC_PreserveAll, ""); | |
| 2225 | static_assert((clang::CallingConv)ZigClangCallingConv_AArch64VectorCall == clang::CC_AArch64VectorCall, ""); | |
| 2226 | static_assert((clang::CallingConv)ZigClangCallingConv_AArch64SVEPCS == clang::CC_AArch64SVEPCS, ""); | |
| 2227 | static_assert((clang::CallingConv)ZigClangCallingConv_M68kRTD == clang::CC_M68kRTD, ""); | |
| 2228 | static_assert((clang::CallingConv)ZigClangCallingConv_PreserveNone == clang::CC_PreserveNone, ""); | |
| 2229 | static_assert((clang::CallingConv)ZigClangCallingConv_RISCVVectorCall == clang::CC_RISCVVectorCall, ""); | |
| 2230 | ||
| 2231 | void ZigClang_detect_enum_StorageClass(clang::StorageClass x) { | |
| 2232 | switch (x) { | |
| 2233 | case clang::SC_None: | |
| 2234 | case clang::SC_Extern: | |
| 2235 | case clang::SC_Static: | |
| 2236 | case clang::SC_PrivateExtern: | |
| 2237 | case clang::SC_Auto: | |
| 2238 | case clang::SC_Register: | |
| 2239 | break; | |
| 2240 | } | |
| 2241 | } | |
| 2242 | ||
| 2243 | static_assert((clang::StorageClass)ZigClangStorageClass_None == clang::SC_None, ""); | |
| 2244 | static_assert((clang::StorageClass)ZigClangStorageClass_Extern == clang::SC_Extern, ""); | |
| 2245 | static_assert((clang::StorageClass)ZigClangStorageClass_Static == clang::SC_Static, ""); | |
| 2246 | static_assert((clang::StorageClass)ZigClangStorageClass_PrivateExtern == clang::SC_PrivateExtern, ""); | |
| 2247 | static_assert((clang::StorageClass)ZigClangStorageClass_Auto == clang::SC_Auto, ""); | |
| 2248 | static_assert((clang::StorageClass)ZigClangStorageClass_Register == clang::SC_Register, ""); | |
| 2249 | ||
| 2250 | void ZigClang_detect_enum_RoundingMode(llvm::RoundingMode x) { | |
| 2251 | switch (x) { | |
| 2252 | case llvm::RoundingMode::TowardZero: | |
| 2253 | case llvm::RoundingMode::NearestTiesToEven: | |
| 2254 | case llvm::RoundingMode::TowardPositive: | |
| 2255 | case llvm::RoundingMode::TowardNegative: | |
| 2256 | case llvm::RoundingMode::NearestTiesToAway: | |
| 2257 | case llvm::RoundingMode::Dynamic: | |
| 2258 | case llvm::RoundingMode::Invalid: | |
| 2259 | break; | |
| 2260 | } | |
| 2261 | } | |
| 2262 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_NearestTiesToEven == llvm::RoundingMode::NearestTiesToEven, ""); | |
| 2263 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_TowardPositive == llvm::RoundingMode::TowardPositive, ""); | |
| 2264 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_TowardNegative == llvm::RoundingMode::TowardNegative, ""); | |
| 2265 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_TowardZero == llvm::RoundingMode::TowardZero, ""); | |
| 2266 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_NearestTiesToAway == llvm::RoundingMode::NearestTiesToAway, ""); | |
| 2267 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Dynamic == llvm::RoundingMode::Dynamic, ""); | |
| 2268 | static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Invalid == llvm::RoundingMode::Invalid, ""); | |
| 2269 | ||
| 2270 | void ZigClang_detect_enum_CharacterLiteralKind(clang::CharacterLiteralKind x) { | |
| 2271 | switch (x) { | |
| 2272 | case clang::CharacterLiteralKind::Ascii: | |
| 2273 | case clang::CharacterLiteralKind::Wide: | |
| 2274 | case clang::CharacterLiteralKind::UTF8: | |
| 2275 | case clang::CharacterLiteralKind::UTF16: | |
| 2276 | case clang::CharacterLiteralKind::UTF32: | |
| 2277 | break; | |
| 2278 | } | |
| 2279 | } | |
| 2280 | static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_Ascii == clang::CharacterLiteralKind::Ascii, ""); | |
| 2281 | static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_Wide == clang::CharacterLiteralKind::Wide, ""); | |
| 2282 | static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_UTF8 == clang::CharacterLiteralKind::UTF8, ""); | |
| 2283 | static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_UTF16 == clang::CharacterLiteralKind::UTF16, ""); | |
| 2284 | static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_UTF32 == clang::CharacterLiteralKind::UTF32, ""); | |
| 2285 | ||
| 2286 | void ZigClang_detect_enum_ElaboratedTypeKeyword(clang::ElaboratedTypeKeyword x) { | |
| 2287 | switch (x) { | |
| 2288 | case clang::ElaboratedTypeKeyword::Struct: | |
| 2289 | case clang::ElaboratedTypeKeyword::Interface: | |
| 2290 | case clang::ElaboratedTypeKeyword::Union: | |
| 2291 | case clang::ElaboratedTypeKeyword::Class: | |
| 2292 | case clang::ElaboratedTypeKeyword::Enum: | |
| 2293 | case clang::ElaboratedTypeKeyword::Typename: | |
| 2294 | case clang::ElaboratedTypeKeyword::None: | |
| 2295 | break; | |
| 2296 | } | |
| 2297 | } | |
| 2298 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Struct == clang::ElaboratedTypeKeyword::Struct, ""); | |
| 2299 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Interface == clang::ElaboratedTypeKeyword::Interface, ""); | |
| 2300 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Union == clang::ElaboratedTypeKeyword::Union, ""); | |
| 2301 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Class == clang::ElaboratedTypeKeyword::Class, ""); | |
| 2302 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Enum == clang::ElaboratedTypeKeyword::Enum, ""); | |
| 2303 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Typename == clang::ElaboratedTypeKeyword::Typename, ""); | |
| 2304 | static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_None == clang::ElaboratedTypeKeyword::None, ""); | |
| 2305 | ||
| 2306 | void ZigClang_detect_enum_EntityKind(clang::PreprocessedEntity::EntityKind x) { | |
| 2307 | switch (x) { | |
| 2308 | case clang::PreprocessedEntity::InvalidKind: | |
| 2309 | case clang::PreprocessedEntity::MacroExpansionKind: | |
| 2310 | case clang::PreprocessedEntity::MacroDefinitionKind: | |
| 2311 | case clang::PreprocessedEntity::InclusionDirectiveKind: | |
| 2312 | break; | |
| 2313 | } | |
| 2314 | } | |
| 2315 | static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InvalidKind == clang::PreprocessedEntity::InvalidKind, ""); | |
| 2316 | static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_MacroExpansionKind == clang::PreprocessedEntity::MacroExpansionKind, ""); | |
| 2317 | static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_MacroDefinitionKind == clang::PreprocessedEntity::MacroDefinitionKind, ""); | |
| 2318 | static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InclusionDirectiveKind == clang::PreprocessedEntity::InclusionDirectiveKind, ""); | |
| 2319 | ||
| 2320 | ||
| 2321 | void ZigClang_detect_enum_ConstantExprKind(clang::Expr::ConstantExprKind x) { | |
| 2322 | switch (x) { | |
| 2323 | case clang::Expr::ConstantExprKind::Normal: | |
| 2324 | case clang::Expr::ConstantExprKind::NonClassTemplateArgument: | |
| 2325 | case clang::Expr::ConstantExprKind::ClassTemplateArgument: | |
| 2326 | case clang::Expr::ConstantExprKind::ImmediateInvocation: | |
| 2327 | break; | |
| 2328 | } | |
| 2329 | } | |
| 2330 | static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, ""); | |
| 2331 | static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_NonClassTemplateArgument == clang::Expr::ConstantExprKind::NonClassTemplateArgument, ""); | |
| 2332 | static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_ClassTemplateArgument == clang::Expr::ConstantExprKind::ClassTemplateArgument, ""); | |
| 2333 | static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_ImmediateInvocation == clang::Expr::ConstantExprKind::ImmediateInvocation, ""); | |
| 2334 | ||
| 2335 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindSizeOf == clang::UnaryExprOrTypeTrait::UETT_SizeOf, ""); | |
| 2336 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindDataSizeOf == clang::UnaryExprOrTypeTrait::UETT_DataSizeOf, ""); | |
| 2337 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindCountOf == clang::UnaryExprOrTypeTrait::UETT_CountOf, ""); | |
| 2338 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindAlignOf == clang::UnaryExprOrTypeTrait::UETT_AlignOf, ""); | |
| 2339 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindPreferredAlignOf == clang::UnaryExprOrTypeTrait::UETT_PreferredAlignOf, ""); | |
| 2340 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindPtrAuthTypeDiscriminator == clang::UnaryExprOrTypeTrait::UETT_PtrAuthTypeDiscriminator, ""); | |
| 2341 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindVecStep == clang::UnaryExprOrTypeTrait::UETT_VecStep, ""); | |
| 2342 | static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindOpenMPRequiredSimdAlign == clang::UnaryExprOrTypeTrait::UETT_OpenMPRequiredSimdAlign, ""); | |
| 2343 | ||
| 2344 | static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), ""); | |
| 2345 | static_assert(alignof(ZigClangAPValue) == alignof(clang::APValue), ""); | |
| 2346 | ||
| 2347 | static_assert(sizeof(ZigClangSourceLocation) == sizeof(clang::SourceLocation), ""); | |
| 2348 | static ZigClangSourceLocation bitcast(clang::SourceLocation src) { | |
| 2349 | ZigClangSourceLocation dest; | |
| 2350 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangSourceLocation)); | |
| 2351 | return dest; | |
| 2352 | } | |
| 2353 | static clang::SourceLocation bitcast(ZigClangSourceLocation src) { | |
| 2354 | clang::SourceLocation dest; | |
| 2355 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangSourceLocation)); | |
| 2356 | return dest; | |
| 2357 | } | |
| 2358 | ||
| 2359 | static_assert(sizeof(ZigClangQualType) == sizeof(clang::QualType), ""); | |
| 2360 | static ZigClangQualType bitcast(clang::QualType src) { | |
| 2361 | ZigClangQualType dest; | |
| 2362 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangQualType)); | |
| 2363 | return dest; | |
| 2364 | } | |
| 2365 | static clang::QualType bitcast(ZigClangQualType src) { | |
| 2366 | clang::QualType dest; | |
| 2367 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangQualType)); | |
| 2368 | return dest; | |
| 2369 | } | |
| 2370 | ||
| 2371 | static_assert(sizeof(ZigClangExprEvalResult) == sizeof(clang::Expr::EvalResult), ""); | |
| 2372 | static ZigClangExprEvalResult bitcast(clang::Expr::EvalResult src) { | |
| 2373 | ZigClangExprEvalResult dest; | |
| 2374 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangExprEvalResult)); | |
| 2375 | return dest; | |
| 2376 | } | |
| 2377 | ||
| 2378 | static_assert(sizeof(ZigClangAPValueLValueBase) == sizeof(clang::APValue::LValueBase), ""); | |
| 2379 | static ZigClangAPValueLValueBase bitcast(clang::APValue::LValueBase src) { | |
| 2380 | ZigClangAPValueLValueBase dest; | |
| 2381 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangAPValueLValueBase)); | |
| 2382 | return dest; | |
| 2383 | } | |
| 2384 | static clang::APValue::LValueBase bitcast(ZigClangAPValueLValueBase src) { | |
| 2385 | clang::APValue::LValueBase dest; | |
| 2386 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangAPValueLValueBase)); | |
| 2387 | return dest; | |
| 2388 | } | |
| 2389 | ||
| 2390 | static_assert(sizeof(ZigClangCompoundStmt_const_body_iterator) == sizeof(clang::CompoundStmt::const_body_iterator), ""); | |
| 2391 | static ZigClangCompoundStmt_const_body_iterator bitcast(clang::CompoundStmt::const_body_iterator src) { | |
| 2392 | ZigClangCompoundStmt_const_body_iterator dest; | |
| 2393 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangCompoundStmt_const_body_iterator)); | |
| 2394 | return dest; | |
| 2395 | } | |
| 2396 | ||
| 2397 | static_assert(sizeof(ZigClangDeclStmt_const_decl_iterator) == sizeof(clang::DeclStmt::const_decl_iterator), ""); | |
| 2398 | static ZigClangDeclStmt_const_decl_iterator bitcast(clang::DeclStmt::const_decl_iterator src) { | |
| 2399 | ZigClangDeclStmt_const_decl_iterator dest; | |
| 2400 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangDeclStmt_const_decl_iterator)); | |
| 2401 | return dest; | |
| 2402 | } | |
| 2403 | ||
| 2404 | static_assert(sizeof(ZigClangPreprocessingRecord_iterator) == sizeof(clang::PreprocessingRecord::iterator), ""); | |
| 2405 | static ZigClangPreprocessingRecord_iterator bitcast(clang::PreprocessingRecord::iterator src) { | |
| 2406 | ZigClangPreprocessingRecord_iterator dest; | |
| 2407 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangPreprocessingRecord_iterator)); | |
| 2408 | return dest; | |
| 2409 | } | |
| 2410 | static clang::PreprocessingRecord::iterator bitcast(ZigClangPreprocessingRecord_iterator src) { | |
| 2411 | clang::PreprocessingRecord::iterator dest; | |
| 2412 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangPreprocessingRecord_iterator)); | |
| 2413 | return dest; | |
| 2414 | } | |
| 2415 | ||
| 2416 | static_assert(sizeof(ZigClangRecordDecl_field_iterator) == sizeof(clang::RecordDecl::field_iterator), ""); | |
| 2417 | static ZigClangRecordDecl_field_iterator bitcast(clang::RecordDecl::field_iterator src) { | |
| 2418 | ZigClangRecordDecl_field_iterator dest; | |
| 2419 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangRecordDecl_field_iterator)); | |
| 2420 | return dest; | |
| 2421 | } | |
| 2422 | static clang::RecordDecl::field_iterator bitcast(ZigClangRecordDecl_field_iterator src) { | |
| 2423 | clang::RecordDecl::field_iterator dest; | |
| 2424 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangRecordDecl_field_iterator)); | |
| 2425 | return dest; | |
| 2426 | } | |
| 2427 | ||
| 2428 | static_assert(sizeof(ZigClangEnumDecl_enumerator_iterator) == sizeof(clang::EnumDecl::enumerator_iterator), ""); | |
| 2429 | static ZigClangEnumDecl_enumerator_iterator bitcast(clang::EnumDecl::enumerator_iterator src) { | |
| 2430 | ZigClangEnumDecl_enumerator_iterator dest; | |
| 2431 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangEnumDecl_enumerator_iterator)); | |
| 2432 | return dest; | |
| 2433 | } | |
| 2434 | static clang::EnumDecl::enumerator_iterator bitcast(ZigClangEnumDecl_enumerator_iterator src) { | |
| 2435 | clang::EnumDecl::enumerator_iterator dest; | |
| 2436 | memcpy(&dest, static_cast<void *>(&src), sizeof(ZigClangEnumDecl_enumerator_iterator)); | |
| 2437 | return dest; | |
| 2438 | } | |
| 2439 | ||
| 2440 | ||
| 2441 | ZigClangSourceLocation ZigClangSourceManager_getSpellingLoc(const ZigClangSourceManager *self, | |
| 2442 | ZigClangSourceLocation Loc) | |
| 2443 | { | |
| 2444 | return bitcast(reinterpret_cast<const clang::SourceManager *>(self)->getSpellingLoc(bitcast(Loc))); | |
| 2445 | } | |
| 2446 | ||
| 2447 | const char *ZigClangSourceManager_getFilename(const ZigClangSourceManager *self, | |
| 2448 | ZigClangSourceLocation SpellingLoc) | |
| 2449 | { | |
| 2450 | llvm::StringRef s = reinterpret_cast<const clang::SourceManager *>(self)->getFilename(bitcast(SpellingLoc)); | |
| 2451 | return (const char *)s.bytes_begin(); | |
| 2452 | } | |
| 2453 | ||
| 2454 | unsigned ZigClangSourceManager_getSpellingLineNumber(const ZigClangSourceManager *self, | |
| 2455 | ZigClangSourceLocation Loc) | |
| 2456 | { | |
| 2457 | return reinterpret_cast<const clang::SourceManager *>(self)->getSpellingLineNumber(bitcast(Loc)); | |
| 2458 | } | |
| 2459 | ||
| 2460 | unsigned ZigClangSourceManager_getSpellingColumnNumber(const ZigClangSourceManager *self, | |
| 2461 | ZigClangSourceLocation Loc) | |
| 2462 | { | |
| 2463 | return reinterpret_cast<const clang::SourceManager *>(self)->getSpellingColumnNumber(bitcast(Loc)); | |
| 2464 | } | |
| 2465 | ||
| 2466 | const char* ZigClangSourceManager_getCharacterData(const ZigClangSourceManager *self, | |
| 2467 | ZigClangSourceLocation SL) | |
| 2468 | { | |
| 2469 | return reinterpret_cast<const clang::SourceManager *>(self)->getCharacterData(bitcast(SL)); | |
| 2470 | } | |
| 2471 | ||
| 2472 | ZigClangQualType ZigClangASTContext_getPointerType(const ZigClangASTContext* self, ZigClangQualType T) { | |
| 2473 | return bitcast(reinterpret_cast<const clang::ASTContext *>(self)->getPointerType(bitcast(T))); | |
| 2474 | } | |
| 2475 | ||
| 2476 | unsigned ZigClangASTContext_getTypeAlign(const ZigClangASTContext* self, ZigClangQualType T) { | |
| 2477 | return reinterpret_cast<const clang::ASTContext *>(self)->getTypeAlign(bitcast(T)); | |
| 2478 | } | |
| 2479 | ||
| 2480 | ZigClangASTContext *ZigClangASTUnit_getASTContext(ZigClangASTUnit *self) { | |
| 2481 | clang::ASTContext *result = &reinterpret_cast<clang::ASTUnit *>(self)->getASTContext(); | |
| 2482 | return reinterpret_cast<ZigClangASTContext *>(result); | |
| 2483 | } | |
| 2484 | ||
| 2485 | ZigClangSourceManager *ZigClangASTUnit_getSourceManager(ZigClangASTUnit *self) { | |
| 2486 | clang::SourceManager *result = &reinterpret_cast<clang::ASTUnit *>(self)->getSourceManager(); | |
| 2487 | return reinterpret_cast<ZigClangSourceManager *>(result); | |
| 2488 | } | |
| 2489 | ||
| 2490 | bool ZigClangASTUnit_visitLocalTopLevelDecls(ZigClangASTUnit *self, void *context, | |
| 2491 | bool (*Fn)(void *context, const ZigClangDecl *decl)) | |
| 2492 | { | |
| 2493 | return reinterpret_cast<clang::ASTUnit *>(self)->visitLocalTopLevelDecls(context, | |
| 2494 | reinterpret_cast<bool (*)(void *, const clang::Decl *)>(Fn)); | |
| 2495 | } | |
| 2496 | ||
| 2497 | struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_begin( | |
| 2498 | struct ZigClangASTUnit *self) | |
| 2499 | { | |
| 2500 | auto casted = reinterpret_cast<const clang::ASTUnit *>(self); | |
| 2501 | return bitcast(casted->getLocalPreprocessingEntities().begin()); | |
| 2502 | } | |
| 2503 | ||
| 2504 | struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_end( | |
| 2505 | struct ZigClangASTUnit *self) | |
| 2506 | { | |
| 2507 | auto casted = reinterpret_cast<const clang::ASTUnit *>(self); | |
| 2508 | return bitcast(casted->getLocalPreprocessingEntities().end()); | |
| 2509 | } | |
| 2510 | ||
| 2511 | struct ZigClangPreprocessedEntity *ZigClangPreprocessingRecord_iterator_deref( | |
| 2512 | struct ZigClangPreprocessingRecord_iterator self) | |
| 2513 | { | |
| 2514 | clang::PreprocessingRecord::iterator casted = bitcast(self); | |
| 2515 | clang::PreprocessedEntity *result = *casted; | |
| 2516 | return reinterpret_cast<ZigClangPreprocessedEntity *>(result); | |
| 2517 | } | |
| 2518 | ||
| 2519 | const ZigClangRecordDecl *ZigClangRecordType_getDecl(const ZigClangRecordType *record_ty) { | |
| 2520 | const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordType *>(record_ty)->getDecl(); | |
| 2521 | return reinterpret_cast<const ZigClangRecordDecl *>(record_decl); | |
| 2522 | } | |
| 2523 | ||
| 2524 | const ZigClangEnumDecl *ZigClangEnumType_getDecl(const ZigClangEnumType *enum_ty) { | |
| 2525 | const clang::EnumDecl *enum_decl = reinterpret_cast<const clang::EnumType *>(enum_ty)->getDecl(); | |
| 2526 | return reinterpret_cast<const ZigClangEnumDecl *>(enum_decl); | |
| 2527 | } | |
| 2528 | ||
| 2529 | const ZigClangTagDecl *ZigClangRecordDecl_getCanonicalDecl(const ZigClangRecordDecl *record_decl) { | |
| 2530 | const clang::TagDecl *tag_decl = reinterpret_cast<const clang::RecordDecl*>(record_decl)->getCanonicalDecl(); | |
| 2531 | return reinterpret_cast<const ZigClangTagDecl *>(tag_decl); | |
| 2532 | } | |
| 2533 | ||
| 2534 | const ZigClangFieldDecl *ZigClangFieldDecl_getCanonicalDecl(const ZigClangFieldDecl *field_decl) { | |
| 2535 | const clang::FieldDecl *canon_decl = reinterpret_cast<const clang::FieldDecl*>(field_decl)->getCanonicalDecl(); | |
| 2536 | return reinterpret_cast<const ZigClangFieldDecl *>(canon_decl); | |
| 2537 | } | |
| 2538 | ||
| 2539 | const ZigClangTagDecl *ZigClangEnumDecl_getCanonicalDecl(const ZigClangEnumDecl *enum_decl) { | |
| 2540 | const clang::TagDecl *tag_decl = reinterpret_cast<const clang::EnumDecl*>(enum_decl)->getCanonicalDecl(); | |
| 2541 | return reinterpret_cast<const ZigClangTagDecl *>(tag_decl); | |
| 2542 | } | |
| 2543 | ||
| 2544 | const ZigClangTypedefNameDecl *ZigClangTypedefNameDecl_getCanonicalDecl(const ZigClangTypedefNameDecl *self) { | |
| 2545 | const clang::TypedefNameDecl *decl = reinterpret_cast<const clang::TypedefNameDecl*>(self)->getCanonicalDecl(); | |
| 2546 | return reinterpret_cast<const ZigClangTypedefNameDecl *>(decl); | |
| 2547 | } | |
| 2548 | ||
| 2549 | const ZigClangFunctionDecl *ZigClangFunctionDecl_getCanonicalDecl(const ZigClangFunctionDecl *self) { | |
| 2550 | const clang::FunctionDecl *decl = reinterpret_cast<const clang::FunctionDecl*>(self)->getCanonicalDecl(); | |
| 2551 | return reinterpret_cast<const ZigClangFunctionDecl *>(decl); | |
| 2552 | } | |
| 2553 | ||
| 2554 | const ZigClangVarDecl *ZigClangVarDecl_getCanonicalDecl(const ZigClangVarDecl *self) { | |
| 2555 | const clang::VarDecl *decl = reinterpret_cast<const clang::VarDecl*>(self)->getCanonicalDecl(); | |
| 2556 | return reinterpret_cast<const ZigClangVarDecl *>(decl); | |
| 2557 | } | |
| 2558 | ||
| 2559 | const char* ZigClangVarDecl_getSectionAttribute(const struct ZigClangVarDecl *self, size_t *len) { | |
| 2560 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 2561 | if (const clang::SectionAttr *SA = casted->getAttr<clang::SectionAttr>()) { | |
| 2562 | llvm::StringRef str_ref = SA->getName(); | |
| 2563 | *len = str_ref.size(); | |
| 2564 | return (const char *)str_ref.bytes_begin(); | |
| 2565 | } | |
| 2566 | return nullptr; | |
| 2567 | } | |
| 2568 | ||
| 2569 | bool ZigClangRecordDecl_getPackedAttribute(const ZigClangRecordDecl *zig_record_decl) { | |
| 2570 | const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordDecl *>(zig_record_decl); | |
| 2571 | return record_decl->hasAttr<clang::PackedAttr>(); | |
| 2572 | } | |
| 2573 | ||
| 2574 | unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, const ZigClangASTContext* ctx) { | |
| 2575 | auto casted_self = reinterpret_cast<const clang::VarDecl *>(self); | |
| 2576 | auto casted_ctx = const_cast<clang::ASTContext *>(reinterpret_cast<const clang::ASTContext *>(ctx)); | |
| 2577 | if (const clang::AlignedAttr *AA = casted_self->getAttr<clang::AlignedAttr>()) { | |
| 2578 | return AA->getAlignment(*casted_ctx); | |
| 2579 | } | |
| 2580 | // Zero means no explicit alignment factor was specified | |
| 2581 | return 0; | |
| 2582 | } | |
| 2583 | ||
| 2584 | const struct ZigClangFunctionDecl *ZigClangVarDecl_getCleanupAttribute(const struct ZigClangVarDecl *self) { | |
| 2585 | auto casted_self = reinterpret_cast<const clang::VarDecl *>(self); | |
| 2586 | if (const clang::CleanupAttr *CA = casted_self->getAttr<clang::CleanupAttr>()) { | |
| 2587 | return reinterpret_cast<const ZigClangFunctionDecl *>(CA->getFunctionDecl()); | |
| 2588 | } | |
| 2589 | return nullptr; | |
| 2590 | } | |
| 2591 | ||
| 2592 | unsigned ZigClangFieldDecl_getAlignedAttribute(const struct ZigClangFieldDecl *self, const ZigClangASTContext* ctx) { | |
| 2593 | auto casted_self = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 2594 | auto casted_ctx = const_cast<clang::ASTContext *>(reinterpret_cast<const clang::ASTContext *>(ctx)); | |
| 2595 | if (const clang::AlignedAttr *AA = casted_self->getAttr<clang::AlignedAttr>()) { | |
| 2596 | return AA->getAlignment(*casted_ctx); | |
| 2597 | } | |
| 2598 | // Zero means no explicit alignment factor was specified | |
| 2599 | return 0; | |
| 2600 | } | |
| 2601 | ||
| 2602 | unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionDecl *self, const ZigClangASTContext* ctx) { | |
| 2603 | auto casted_self = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2604 | auto casted_ctx = const_cast<clang::ASTContext *>(reinterpret_cast<const clang::ASTContext *>(ctx)); | |
| 2605 | if (const clang::AlignedAttr *AA = casted_self->getAttr<clang::AlignedAttr>()) { | |
| 2606 | return AA->getAlignment(*casted_ctx); | |
| 2607 | } | |
| 2608 | // Zero means no explicit alignment factor was specified | |
| 2609 | return 0; | |
| 2610 | } | |
| 2611 | ||
| 2612 | bool ZigClangVarDecl_getPackedAttribute(const struct ZigClangVarDecl *self) { | |
| 2613 | auto casted_self = reinterpret_cast<const clang::VarDecl *>(self); | |
| 2614 | return casted_self->hasAttr<clang::PackedAttr>(); | |
| 2615 | } | |
| 2616 | ||
| 2617 | bool ZigClangFieldDecl_getPackedAttribute(const struct ZigClangFieldDecl *self) { | |
| 2618 | auto casted_self = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 2619 | return casted_self->hasAttr<clang::PackedAttr>(); | |
| 2620 | } | |
| 2621 | ||
| 2622 | ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self) { | |
| 2623 | return bitcast(reinterpret_cast<const clang::ParmVarDecl *>(self)->getOriginalType()); | |
| 2624 | } | |
| 2625 | ||
| 2626 | const ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const ZigClangRecordDecl *zig_record_decl) { | |
| 2627 | const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordDecl *>(zig_record_decl); | |
| 2628 | const clang::RecordDecl *definition = record_decl->getDefinition(); | |
| 2629 | return reinterpret_cast<const ZigClangRecordDecl *>(definition); | |
| 2630 | } | |
| 2631 | ||
| 2632 | const ZigClangEnumDecl *ZigClangEnumDecl_getDefinition(const ZigClangEnumDecl *zig_enum_decl) { | |
| 2633 | const clang::EnumDecl *enum_decl = reinterpret_cast<const clang::EnumDecl *>(zig_enum_decl); | |
| 2634 | const clang::EnumDecl *definition = enum_decl->getDefinition(); | |
| 2635 | return reinterpret_cast<const ZigClangEnumDecl *>(definition); | |
| 2636 | } | |
| 2637 | ||
| 2638 | const char *ZigClangFileScopeAsmDecl_getAsmString(const ZigClangFileScopeAsmDecl *self) { | |
| 2639 | std::string str = reinterpret_cast<const clang::FileScopeAsmDecl*>(self)->getAsmString(); | |
| 2640 | char *result = new char[str.size() + 1]; | |
| 2641 | strcpy(result, str.c_str()); | |
| 2642 | return result; | |
| 2643 | } | |
| 2644 | ||
| 2645 | void ZigClangFileScopeAsmDecl_freeAsmString(const char *str) { | |
| 2646 | delete[] str; | |
| 2647 | } | |
| 2648 | ||
| 2649 | bool ZigClangRecordDecl_isUnion(const ZigClangRecordDecl *record_decl) { | |
| 2650 | return reinterpret_cast<const clang::RecordDecl*>(record_decl)->isUnion(); | |
| 2651 | } | |
| 2652 | ||
| 2653 | bool ZigClangRecordDecl_isStruct(const ZigClangRecordDecl *record_decl) { | |
| 2654 | return reinterpret_cast<const clang::RecordDecl*>(record_decl)->isStruct(); | |
| 2655 | } | |
| 2656 | ||
| 2657 | bool ZigClangRecordDecl_isAnonymousStructOrUnion(const ZigClangRecordDecl *record_decl) { | |
| 2658 | return reinterpret_cast<const clang::RecordDecl*>(record_decl)->isAnonymousStructOrUnion(); | |
| 2659 | } | |
| 2660 | ||
| 2661 | const ZigClangNamedDecl* ZigClangDecl_castToNamedDecl(const ZigClangDecl *self) { | |
| 2662 | auto casted = reinterpret_cast<const clang::Decl *>(self); | |
| 2663 | auto cast = clang::dyn_cast<const clang::NamedDecl>(casted); | |
| 2664 | return reinterpret_cast<const ZigClangNamedDecl *>(cast); | |
| 2665 | } | |
| 2666 | ||
| 2667 | const char *ZigClangNamedDecl_getName_bytes_begin(const ZigClangNamedDecl *self) { | |
| 2668 | auto casted = reinterpret_cast<const clang::NamedDecl *>(self); | |
| 2669 | return (const char *)casted->getName().bytes_begin(); | |
| 2670 | } | |
| 2671 | ||
| 2672 | ZigClangDeclKind ZigClangDecl_getKind(const struct ZigClangDecl *self) { | |
| 2673 | auto casted = reinterpret_cast<const clang::Decl *>(self); | |
| 2674 | return (ZigClangDeclKind)casted->getKind(); | |
| 2675 | } | |
| 2676 | ||
| 2677 | const char *ZigClangDecl_getDeclKindName(const struct ZigClangDecl *self) { | |
| 2678 | auto casted = reinterpret_cast<const clang::Decl *>(self); | |
| 2679 | return casted->getDeclKindName(); | |
| 2680 | } | |
| 2681 | ||
| 2682 | ZigClangSourceLocation ZigClangRecordDecl_getLocation(const ZigClangRecordDecl *zig_record_decl) { | |
| 2683 | const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordDecl *>(zig_record_decl); | |
| 2684 | return bitcast(record_decl->getLocation()); | |
| 2685 | } | |
| 2686 | ||
| 2687 | ZigClangSourceLocation ZigClangEnumDecl_getLocation(const ZigClangEnumDecl *self) { | |
| 2688 | auto casted = reinterpret_cast<const clang::EnumDecl *>(self); | |
| 2689 | return bitcast(casted->getLocation()); | |
| 2690 | } | |
| 2691 | ||
| 2692 | ZigClangSourceLocation ZigClangTypedefNameDecl_getLocation(const ZigClangTypedefNameDecl *self) { | |
| 2693 | auto casted = reinterpret_cast<const clang::TypedefNameDecl *>(self); | |
| 2694 | return bitcast(casted->getLocation()); | |
| 2695 | } | |
| 2696 | ||
| 2697 | ZigClangSourceLocation ZigClangDecl_getLocation(const ZigClangDecl *self) { | |
| 2698 | auto casted = reinterpret_cast<const clang::Decl *>(self); | |
| 2699 | return bitcast(casted->getLocation()); | |
| 2700 | } | |
| 2701 | ||
| 2702 | bool ZigClangSourceLocation_eq(ZigClangSourceLocation zig_a, ZigClangSourceLocation zig_b) { | |
| 2703 | clang::SourceLocation a = bitcast(zig_a); | |
| 2704 | clang::SourceLocation b = bitcast(zig_b); | |
| 2705 | return a == b; | |
| 2706 | } | |
| 2707 | ||
| 2708 | ZigClangQualType ZigClangEnumDecl_getIntegerType(const ZigClangEnumDecl *self) { | |
| 2709 | return bitcast(reinterpret_cast<const clang::EnumDecl *>(self)->getIntegerType()); | |
| 2710 | } | |
| 2711 | ||
| 2712 | struct ZigClangQualType ZigClangFunctionDecl_getType(const struct ZigClangFunctionDecl *self) { | |
| 2713 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2714 | return bitcast(casted->getType()); | |
| 2715 | } | |
| 2716 | ||
| 2717 | struct ZigClangSourceLocation ZigClangFunctionDecl_getLocation(const struct ZigClangFunctionDecl *self) { | |
| 2718 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2719 | return bitcast(casted->getLocation()); | |
| 2720 | } | |
| 2721 | ||
| 2722 | bool ZigClangFunctionDecl_hasBody(const struct ZigClangFunctionDecl *self) { | |
| 2723 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2724 | return casted->hasBody(); | |
| 2725 | } | |
| 2726 | ||
| 2727 | enum ZigClangStorageClass ZigClangFunctionDecl_getStorageClass(const struct ZigClangFunctionDecl *self) { | |
| 2728 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2729 | return (ZigClangStorageClass)casted->getStorageClass(); | |
| 2730 | } | |
| 2731 | ||
| 2732 | const struct ZigClangParmVarDecl *ZigClangFunctionDecl_getParamDecl(const struct ZigClangFunctionDecl *self, | |
| 2733 | unsigned i) | |
| 2734 | { | |
| 2735 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2736 | const clang::ParmVarDecl *parm_var_decl = casted->getParamDecl(i); | |
| 2737 | return reinterpret_cast<const ZigClangParmVarDecl *>(parm_var_decl); | |
| 2738 | } | |
| 2739 | ||
| 2740 | const struct ZigClangStmt *ZigClangFunctionDecl_getBody(const struct ZigClangFunctionDecl *self) { | |
| 2741 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2742 | const clang::Stmt *stmt = casted->getBody(); | |
| 2743 | return reinterpret_cast<const ZigClangStmt *>(stmt); | |
| 2744 | } | |
| 2745 | ||
| 2746 | bool ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(const struct ZigClangFunctionDecl *self) { | |
| 2747 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2748 | return casted->doesDeclarationForceExternallyVisibleDefinition(); | |
| 2749 | } | |
| 2750 | ||
| 2751 | bool ZigClangFunctionDecl_isThisDeclarationADefinition(const struct ZigClangFunctionDecl *self) { | |
| 2752 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2753 | return casted->isThisDeclarationADefinition(); | |
| 2754 | } | |
| 2755 | ||
| 2756 | bool ZigClangFunctionDecl_doesThisDeclarationHaveABody(const struct ZigClangFunctionDecl *self) { | |
| 2757 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2758 | return casted->doesThisDeclarationHaveABody(); | |
| 2759 | } | |
| 2760 | ||
| 2761 | bool ZigClangFunctionDecl_isDefined(const struct ZigClangFunctionDecl *self) { | |
| 2762 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2763 | return casted->isDefined(); | |
| 2764 | } | |
| 2765 | ||
| 2766 | const ZigClangFunctionDecl* ZigClangFunctionDecl_getDefinition(const struct ZigClangFunctionDecl *self) { | |
| 2767 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2768 | return reinterpret_cast<const ZigClangFunctionDecl *>(casted->getDefinition()); | |
| 2769 | } | |
| 2770 | ||
| 2771 | bool ZigClangTagDecl_isThisDeclarationADefinition(const struct ZigClangTagDecl *self) { | |
| 2772 | auto casted = reinterpret_cast<const clang::TagDecl *>(self); | |
| 2773 | return casted->isThisDeclarationADefinition(); | |
| 2774 | } | |
| 2775 | ||
| 2776 | bool ZigClangFunctionDecl_isInlineSpecified(const struct ZigClangFunctionDecl *self) { | |
| 2777 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2778 | return casted->isInlineSpecified(); | |
| 2779 | } | |
| 2780 | ||
| 2781 | bool ZigClangFunctionDecl_hasAlwaysInlineAttr(const struct ZigClangFunctionDecl *self) { | |
| 2782 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2783 | return casted->hasAttr<clang::AlwaysInlineAttr>(); | |
| 2784 | } | |
| 2785 | ||
| 2786 | const char* ZigClangFunctionDecl_getSectionAttribute(const struct ZigClangFunctionDecl *self, size_t *len) { | |
| 2787 | auto casted = reinterpret_cast<const clang::FunctionDecl *>(self); | |
| 2788 | if (const clang::SectionAttr *SA = casted->getAttr<clang::SectionAttr>()) { | |
| 2789 | llvm::StringRef str_ref = SA->getName(); | |
| 2790 | *len = str_ref.size(); | |
| 2791 | return (const char *)str_ref.bytes_begin(); | |
| 2792 | } | |
| 2793 | return nullptr; | |
| 2794 | } | |
| 2795 | ||
| 2796 | const ZigClangExpr *ZigClangOpaqueValueExpr_getSourceExpr(const ZigClangOpaqueValueExpr *self) { | |
| 2797 | auto casted = reinterpret_cast<const clang::OpaqueValueExpr *>(self); | |
| 2798 | return reinterpret_cast<const ZigClangExpr *>(casted->getSourceExpr()); | |
| 2799 | } | |
| 2800 | ||
| 2801 | const ZigClangTypedefNameDecl *ZigClangTypedefType_getDecl(const ZigClangTypedefType *self) { | |
| 2802 | auto casted = reinterpret_cast<const clang::TypedefType *>(self); | |
| 2803 | const clang::TypedefNameDecl *name_decl = casted->getDecl(); | |
| 2804 | return reinterpret_cast<const ZigClangTypedefNameDecl *>(name_decl); | |
| 2805 | } | |
| 2806 | ||
| 2807 | ZigClangQualType ZigClangTypedefNameDecl_getUnderlyingType(const ZigClangTypedefNameDecl *self) { | |
| 2808 | auto casted = reinterpret_cast<const clang::TypedefNameDecl *>(self); | |
| 2809 | clang::QualType ty = casted->getUnderlyingType(); | |
| 2810 | return bitcast(ty); | |
| 2811 | } | |
| 2812 | ||
| 2813 | ZigClangQualType ZigClangQualType_getCanonicalType(ZigClangQualType self) { | |
| 2814 | clang::QualType qt = bitcast(self); | |
| 2815 | return bitcast(qt.getCanonicalType()); | |
| 2816 | } | |
| 2817 | ||
| 2818 | const ZigClangType *ZigClangQualType_getTypePtr(ZigClangQualType self) { | |
| 2819 | clang::QualType qt = bitcast(self); | |
| 2820 | const clang::Type *ty = qt.getTypePtr(); | |
| 2821 | return reinterpret_cast<const ZigClangType *>(ty); | |
| 2822 | } | |
| 2823 | ||
| 2824 | ZigClangTypeClass ZigClangQualType_getTypeClass(ZigClangQualType self) { | |
| 2825 | clang::QualType ty = bitcast(self); | |
| 2826 | return (ZigClangTypeClass)(ty->getTypeClass()); | |
| 2827 | } | |
| 2828 | ||
| 2829 | void ZigClangQualType_addConst(ZigClangQualType *self) { | |
| 2830 | reinterpret_cast<clang::QualType *>(self)->addConst(); | |
| 2831 | } | |
| 2832 | ||
| 2833 | bool ZigClangQualType_eq(ZigClangQualType zig_t1, ZigClangQualType zig_t2) { | |
| 2834 | clang::QualType t1 = bitcast(zig_t1); | |
| 2835 | clang::QualType t2 = bitcast(zig_t2); | |
| 2836 | if (t1.isConstQualified() != t2.isConstQualified()) { | |
| 2837 | return false; | |
| 2838 | } | |
| 2839 | if (t1.isVolatileQualified() != t2.isVolatileQualified()) { | |
| 2840 | return false; | |
| 2841 | } | |
| 2842 | if (t1.isRestrictQualified() != t2.isRestrictQualified()) { | |
| 2843 | return false; | |
| 2844 | } | |
| 2845 | return t1.getTypePtr() == t2.getTypePtr(); | |
| 2846 | } | |
| 2847 | ||
| 2848 | bool ZigClangQualType_isConstQualified(ZigClangQualType self) { | |
| 2849 | clang::QualType qt = bitcast(self); | |
| 2850 | return qt.isConstQualified(); | |
| 2851 | } | |
| 2852 | ||
| 2853 | bool ZigClangQualType_isVolatileQualified(ZigClangQualType self) { | |
| 2854 | clang::QualType qt = bitcast(self); | |
| 2855 | return qt.isVolatileQualified(); | |
| 2856 | } | |
| 2857 | ||
| 2858 | bool ZigClangQualType_isRestrictQualified(ZigClangQualType self) { | |
| 2859 | clang::QualType qt = bitcast(self); | |
| 2860 | return qt.isRestrictQualified(); | |
| 2861 | } | |
| 2862 | ||
| 2863 | ZigClangTypeClass ZigClangType_getTypeClass(const ZigClangType *self) { | |
| 2864 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2865 | clang::Type::TypeClass tc = casted->getTypeClass(); | |
| 2866 | return (ZigClangTypeClass)tc; | |
| 2867 | } | |
| 2868 | ||
| 2869 | ZigClangQualType ZigClangType_getPointeeType(const ZigClangType *self) { | |
| 2870 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2871 | return bitcast(casted->getPointeeType()); | |
| 2872 | } | |
| 2873 | ||
| 2874 | bool ZigClangType_isBooleanType(const ZigClangType *self) { | |
| 2875 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2876 | return casted->isBooleanType(); | |
| 2877 | } | |
| 2878 | ||
| 2879 | bool ZigClangType_isVoidType(const ZigClangType *self) { | |
| 2880 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2881 | return casted->isVoidType(); | |
| 2882 | } | |
| 2883 | ||
| 2884 | bool ZigClangType_isArrayType(const ZigClangType *self) { | |
| 2885 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2886 | return casted->isArrayType(); | |
| 2887 | } | |
| 2888 | ||
| 2889 | bool ZigClangType_isRecordType(const ZigClangType *self) { | |
| 2890 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2891 | return casted->isRecordType(); | |
| 2892 | } | |
| 2893 | ||
| 2894 | bool ZigClangType_isVectorType(const ZigClangType *self) { | |
| 2895 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2896 | return casted->isVectorType(); | |
| 2897 | } | |
| 2898 | ||
| 2899 | bool ZigClangType_isIncompleteOrZeroLengthArrayType(const ZigClangQualType *self, | |
| 2900 | const struct ZigClangASTContext *ctx) | |
| 2901 | { | |
| 2902 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 2903 | auto casted = reinterpret_cast<const clang::QualType *>(self); | |
| 2904 | auto casted_type = reinterpret_cast<const clang::Type *>(self); | |
| 2905 | if (casted_type->isIncompleteArrayType()) | |
| 2906 | return true; | |
| 2907 | ||
| 2908 | clang::QualType elem_type = *casted; | |
| 2909 | while (const clang::ConstantArrayType *ArrayT = casted_ctx->getAsConstantArrayType(elem_type)) { | |
| 2910 | if (ArrayT->getSize() == 0) | |
| 2911 | return true; | |
| 2912 | ||
| 2913 | elem_type = ArrayT->getElementType(); | |
| 2914 | } | |
| 2915 | ||
| 2916 | return false; | |
| 2917 | } | |
| 2918 | ||
| 2919 | bool ZigClangType_isConstantArrayType(const ZigClangType *self) { | |
| 2920 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2921 | return casted->isConstantArrayType(); | |
| 2922 | } | |
| 2923 | ||
| 2924 | const char *ZigClangType_getTypeClassName(const ZigClangType *self) { | |
| 2925 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2926 | return casted->getTypeClassName(); | |
| 2927 | } | |
| 2928 | ||
| 2929 | const ZigClangArrayType *ZigClangType_getAsArrayTypeUnsafe(const ZigClangType *self) { | |
| 2930 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2931 | const clang::ArrayType *result = casted->getAsArrayTypeUnsafe(); | |
| 2932 | return reinterpret_cast<const ZigClangArrayType *>(result); | |
| 2933 | } | |
| 2934 | ||
| 2935 | const ZigClangRecordType *ZigClangType_getAsRecordType(const ZigClangType *self) { | |
| 2936 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2937 | const clang::RecordType *result = casted->getAsStructureType(); | |
| 2938 | return reinterpret_cast<const ZigClangRecordType *>(result); | |
| 2939 | } | |
| 2940 | ||
| 2941 | const ZigClangRecordType *ZigClangType_getAsUnionType(const ZigClangType *self) { | |
| 2942 | auto casted = reinterpret_cast<const clang::Type *>(self); | |
| 2943 | const clang::RecordType *result = casted->getAsUnionType(); | |
| 2944 | return reinterpret_cast<const ZigClangRecordType *>(result); | |
| 2945 | } | |
| 2946 | ||
| 2947 | ZigClangSourceLocation ZigClangStmt_getBeginLoc(const ZigClangStmt *self) { | |
| 2948 | auto casted = reinterpret_cast<const clang::Stmt *>(self); | |
| 2949 | return bitcast(casted->getBeginLoc()); | |
| 2950 | } | |
| 2951 | ||
| 2952 | bool ZigClangStmt_classof_Expr(const ZigClangStmt *self) { | |
| 2953 | auto casted = reinterpret_cast<const clang::Stmt *>(self); | |
| 2954 | return clang::Expr::classof(casted); | |
| 2955 | } | |
| 2956 | ||
| 2957 | ZigClangStmtClass ZigClangStmt_getStmtClass(const ZigClangStmt *self) { | |
| 2958 | auto casted = reinterpret_cast<const clang::Stmt *>(self); | |
| 2959 | return (ZigClangStmtClass)casted->getStmtClass(); | |
| 2960 | } | |
| 2961 | ||
| 2962 | ZigClangStmtClass ZigClangExpr_getStmtClass(const ZigClangExpr *self) { | |
| 2963 | auto casted = reinterpret_cast<const clang::Expr *>(self); | |
| 2964 | return (ZigClangStmtClass)casted->getStmtClass(); | |
| 2965 | } | |
| 2966 | ||
| 2967 | ZigClangQualType ZigClangExpr_getType(const ZigClangExpr *self) { | |
| 2968 | auto casted = reinterpret_cast<const clang::Expr *>(self); | |
| 2969 | return bitcast(casted->getType()); | |
| 2970 | } | |
| 2971 | ||
| 2972 | ZigClangSourceLocation ZigClangExpr_getBeginLoc(const ZigClangExpr *self) { | |
| 2973 | auto casted = reinterpret_cast<const clang::Expr *>(self); | |
| 2974 | return bitcast(casted->getBeginLoc()); | |
| 2975 | } | |
| 2976 | ||
| 2977 | bool ZigClangExpr_EvaluateAsBooleanCondition(const ZigClangExpr *self, bool *result, | |
| 2978 | const struct ZigClangASTContext *ctx, bool in_constant_context) | |
| 2979 | { | |
| 2980 | auto casted = reinterpret_cast<const clang::Expr *>(self); | |
| 2981 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 2982 | return casted->EvaluateAsBooleanCondition(*result, *casted_ctx, in_constant_context); | |
| 2983 | } | |
| 2984 | ||
| 2985 | bool ZigClangExpr_EvaluateAsFloat(const ZigClangExpr *self, ZigClangAPFloat **result, | |
| 2986 | const struct ZigClangASTContext *ctx) | |
| 2987 | { | |
| 2988 | llvm::APFloat *ap_float = new llvm::APFloat(0.0f); | |
| 2989 | *result = reinterpret_cast<ZigClangAPFloat *>(ap_float); | |
| 2990 | auto casted = reinterpret_cast<const clang::Expr *>(self); | |
| 2991 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 2992 | return casted->EvaluateAsFloat(*ap_float, *casted_ctx); | |
| 2993 | } | |
| 2994 | ||
| 2995 | bool ZigClangExpr_EvaluateAsConstantExpr(const ZigClangExpr *self, ZigClangExprEvalResult *result, | |
| 2996 | ZigClangExpr_ConstantExprKind kind, const struct ZigClangASTContext *ctx) | |
| 2997 | { | |
| 2998 | auto casted_self = reinterpret_cast<const clang::Expr *>(self); | |
| 2999 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 3000 | clang::Expr::EvalResult eval_result; | |
| 3001 | if (!casted_self->EvaluateAsConstantExpr(eval_result, *casted_ctx, (clang::Expr::ConstantExprKind)kind)) { | |
| 3002 | return false; | |
| 3003 | } | |
| 3004 | *result = bitcast(eval_result); | |
| 3005 | return true; | |
| 3006 | } | |
| 3007 | ||
| 3008 | const ZigClangStringLiteral *ZigClangExpr_castToStringLiteral(const struct ZigClangExpr *self) { | |
| 3009 | auto casted_self = reinterpret_cast<const clang::Expr *>(self); | |
| 3010 | auto cast = clang::dyn_cast<const clang::StringLiteral>(casted_self); | |
| 3011 | return reinterpret_cast<const ZigClangStringLiteral *>(cast); | |
| 3012 | } | |
| 3013 | ||
| 3014 | const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *self, unsigned i) { | |
| 3015 | auto casted = reinterpret_cast<const clang::InitListExpr *>(self); | |
| 3016 | const clang::Expr *result = casted->getInit(i); | |
| 3017 | return reinterpret_cast<const ZigClangExpr *>(result); | |
| 3018 | } | |
| 3019 | ||
| 3020 | const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *self) { | |
| 3021 | auto casted = reinterpret_cast<const clang::InitListExpr *>(self); | |
| 3022 | const clang::Expr *result = casted->getArrayFiller(); | |
| 3023 | return reinterpret_cast<const ZigClangExpr *>(result); | |
| 3024 | } | |
| 3025 | ||
| 3026 | bool ZigClangInitListExpr_hasArrayFiller(const ZigClangInitListExpr *self) { | |
| 3027 | auto casted = reinterpret_cast<const clang::InitListExpr *>(self); | |
| 3028 | return casted->hasArrayFiller(); | |
| 3029 | } | |
| 3030 | ||
| 3031 | bool ZigClangInitListExpr_isStringLiteralInit(const ZigClangInitListExpr *self) { | |
| 3032 | auto casted = reinterpret_cast<const clang::InitListExpr *>(self); | |
| 3033 | return casted->isStringLiteralInit(); | |
| 3034 | } | |
| 3035 | ||
| 3036 | const ZigClangFieldDecl *ZigClangInitListExpr_getInitializedFieldInUnion(const ZigClangInitListExpr *self) { | |
| 3037 | auto casted = reinterpret_cast<const clang::InitListExpr *>(self); | |
| 3038 | const clang::FieldDecl *result = casted->getInitializedFieldInUnion(); | |
| 3039 | return reinterpret_cast<const ZigClangFieldDecl *>(result); | |
| 3040 | } | |
| 3041 | ||
| 3042 | unsigned ZigClangInitListExpr_getNumInits(const ZigClangInitListExpr *self) { | |
| 3043 | auto casted = reinterpret_cast<const clang::InitListExpr *>(self); | |
| 3044 | return casted->getNumInits(); | |
| 3045 | } | |
| 3046 | ||
| 3047 | ZigClangAPValueKind ZigClangAPValue_getKind(const ZigClangAPValue *self) { | |
| 3048 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3049 | return (ZigClangAPValueKind)casted->getKind(); | |
| 3050 | } | |
| 3051 | ||
| 3052 | const ZigClangAPSInt *ZigClangAPValue_getInt(const ZigClangAPValue *self) { | |
| 3053 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3054 | const llvm::APSInt *result = &casted->getInt(); | |
| 3055 | return reinterpret_cast<const ZigClangAPSInt *>(result); | |
| 3056 | } | |
| 3057 | ||
| 3058 | unsigned ZigClangAPValue_getArrayInitializedElts(const ZigClangAPValue *self) { | |
| 3059 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3060 | return casted->getArrayInitializedElts(); | |
| 3061 | } | |
| 3062 | ||
| 3063 | const ZigClangAPValue *ZigClangAPValue_getArrayInitializedElt(const ZigClangAPValue *self, unsigned i) { | |
| 3064 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3065 | const clang::APValue *result = &casted->getArrayInitializedElt(i); | |
| 3066 | return reinterpret_cast<const ZigClangAPValue *>(result); | |
| 3067 | } | |
| 3068 | ||
| 3069 | const ZigClangAPValue *ZigClangAPValue_getArrayFiller(const ZigClangAPValue *self) { | |
| 3070 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3071 | const clang::APValue *result = &casted->getArrayFiller(); | |
| 3072 | return reinterpret_cast<const ZigClangAPValue *>(result); | |
| 3073 | } | |
| 3074 | ||
| 3075 | unsigned ZigClangAPValue_getArraySize(const ZigClangAPValue *self) { | |
| 3076 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3077 | return casted->getArraySize(); | |
| 3078 | } | |
| 3079 | ||
| 3080 | const ZigClangAPSInt *ZigClangAPSInt_negate(const ZigClangAPSInt *self) { | |
| 3081 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3082 | llvm::APSInt *result = new llvm::APSInt(); | |
| 3083 | *result = *casted; | |
| 3084 | *result = -*result; | |
| 3085 | return reinterpret_cast<const ZigClangAPSInt *>(result); | |
| 3086 | } | |
| 3087 | ||
| 3088 | void ZigClangAPSInt_free(const ZigClangAPSInt *self) { | |
| 3089 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3090 | delete casted; | |
| 3091 | } | |
| 3092 | ||
| 3093 | bool ZigClangAPSInt_isSigned(const ZigClangAPSInt *self) { | |
| 3094 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3095 | return casted->isSigned(); | |
| 3096 | } | |
| 3097 | ||
| 3098 | bool ZigClangAPSInt_isNegative(const ZigClangAPSInt *self) { | |
| 3099 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3100 | return casted->isNegative(); | |
| 3101 | } | |
| 3102 | ||
| 3103 | const uint64_t *ZigClangAPSInt_getRawData(const ZigClangAPSInt *self) { | |
| 3104 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3105 | return casted->getRawData(); | |
| 3106 | } | |
| 3107 | ||
| 3108 | unsigned ZigClangAPSInt_getNumWords(const ZigClangAPSInt *self) { | |
| 3109 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3110 | return casted->getNumWords(); | |
| 3111 | } | |
| 3112 | ||
| 3113 | bool ZigClangAPSInt_lessThanEqual(const ZigClangAPSInt *self, uint64_t rhs) { | |
| 3114 | auto casted = reinterpret_cast<const llvm::APSInt *>(self); | |
| 3115 | return casted->ule(rhs); | |
| 3116 | } | |
| 3117 | ||
| 3118 | void ZigClangAPInt_free(const ZigClangAPInt *self) { | |
| 3119 | auto casted = reinterpret_cast<const llvm::APInt *>(self); | |
| 3120 | delete casted; | |
| 3121 | } | |
| 3122 | ||
| 3123 | uint64_t ZigClangAPInt_getLimitedValue(const ZigClangAPInt *self, uint64_t limit) { | |
| 3124 | auto casted = reinterpret_cast<const llvm::APInt *>(self); | |
| 3125 | return casted->getLimitedValue(limit); | |
| 3126 | } | |
| 3127 | ||
| 3128 | const ZigClangExpr *ZigClangAPValueLValueBase_dyn_cast_Expr(ZigClangAPValueLValueBase self) { | |
| 3129 | clang::APValue::LValueBase casted = bitcast(self); | |
| 3130 | const clang::Expr *expr = casted.dyn_cast<const clang::Expr *>(); | |
| 3131 | return reinterpret_cast<const ZigClangExpr *>(expr); | |
| 3132 | } | |
| 3133 | ||
| 3134 | ZigClangAPValueLValueBase ZigClangAPValue_getLValueBase(const ZigClangAPValue *self) { | |
| 3135 | auto casted = reinterpret_cast<const clang::APValue *>(self); | |
| 3136 | clang::APValue::LValueBase lval_base = casted->getLValueBase(); | |
| 3137 | return bitcast(lval_base); | |
| 3138 | } | |
| 3139 | ||
| 3140 | ZigClangASTUnit *ZigClangLoadFromCommandLine(const char **args_begin, const char **args_end, | |
| 3141 | struct Stage2ErrorMsg **errors_ptr, size_t *errors_len, const char *resources_path) | |
| 3142 | { | |
| 3143 | llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS = llvm::vfs::getRealFileSystem(); | |
| 3144 | auto diag_opts = std::make_shared<clang::DiagnosticOptions>(); | |
| 3145 | clang::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diags(clang::CompilerInstance::createDiagnostics(*VFS, *diag_opts)); | |
| 3146 | ||
| 3147 | std::shared_ptr<clang::PCHContainerOperations> pch_container_ops = std::make_shared<clang::PCHContainerOperations>(); | |
| 3148 | ||
| 3149 | bool only_local_decls = true; | |
| 3150 | bool user_files_are_volatile = true; | |
| 3151 | bool allow_pch_with_compiler_errors = false; | |
| 3152 | bool single_file_parse = false; | |
| 3153 | bool for_serialization = false; | |
| 3154 | bool retain_excluded_conditional_blocks = false; | |
| 3155 | bool store_preambles_in_memory = false; | |
| 3156 | llvm::StringRef preamble_storage_path = llvm::StringRef(); | |
| 3157 | clang::ArrayRef<clang::ASTUnit::RemappedFile> remapped_files = {}; | |
| 3158 | std::unique_ptr<clang::ASTUnit> err_unit; | |
| 3159 | std::optional<llvm::StringRef> ModuleFormat = std::nullopt; | |
| 3160 | std::unique_ptr<clang::ASTUnit> ast_unit_unique_ptr = clang::ASTUnit::LoadFromCommandLine( | |
| 3161 | args_begin, args_end, | |
| 3162 | pch_container_ops, | |
| 3163 | diag_opts, | |
| 3164 | diags, | |
| 3165 | resources_path, | |
| 3166 | store_preambles_in_memory, | |
| 3167 | preamble_storage_path, | |
| 3168 | only_local_decls, | |
| 3169 | clang::CaptureDiagsKind::All, | |
| 3170 | remapped_files, | |
| 3171 | true, // remapped files keep original name | |
| 3172 | 0, // precompiled preable after n parses | |
| 3173 | clang::TU_Complete, | |
| 3174 | false, // cache code completion results | |
| 3175 | false, // include brief comments in code completion | |
| 3176 | allow_pch_with_compiler_errors, | |
| 3177 | clang::SkipFunctionBodiesScope::None, | |
| 3178 | single_file_parse, | |
| 3179 | user_files_are_volatile, | |
| 3180 | for_serialization, | |
| 3181 | retain_excluded_conditional_blocks, | |
| 3182 | ModuleFormat, | |
| 3183 | &err_unit, | |
| 3184 | VFS); | |
| 3185 | clang::ASTUnit * ast_unit = ast_unit_unique_ptr.release(); | |
| 3186 | ||
| 3187 | *errors_len = 0; | |
| 3188 | ||
| 3189 | // Early failures in LoadFromCommandLine may return with ErrUnit unset. | |
| 3190 | if (!ast_unit && !err_unit) { | |
| 3191 | return nullptr; | |
| 3192 | } | |
| 3193 | ||
| 3194 | if (diags->hasErrorOccurred()) { | |
| 3195 | // Take ownership of the err_unit ASTUnit object so that it won't be | |
| 3196 | // free'd when we return, invalidating the error message pointers | |
| 3197 | clang::ASTUnit *unit = ast_unit ? ast_unit : err_unit.release(); | |
| 3198 | Stage2ErrorMsg *errors = nullptr; | |
| 3199 | ||
| 3200 | for (clang::ASTUnit::stored_diag_iterator it = unit->stored_diag_begin(), | |
| 3201 | it_end = unit->stored_diag_end(); it != it_end; ++it) | |
| 3202 | { | |
| 3203 | switch (it->getLevel()) { | |
| 3204 | case clang::DiagnosticsEngine::Ignored: | |
| 3205 | case clang::DiagnosticsEngine::Note: | |
| 3206 | case clang::DiagnosticsEngine::Remark: | |
| 3207 | case clang::DiagnosticsEngine::Warning: | |
| 3208 | continue; | |
| 3209 | case clang::DiagnosticsEngine::Error: | |
| 3210 | case clang::DiagnosticsEngine::Fatal: | |
| 3211 | break; | |
| 3212 | } | |
| 3213 | ||
| 3214 | llvm::StringRef msg_str_ref = it->getMessage(); | |
| 3215 | ||
| 3216 | *errors_len += 1; | |
| 3217 | errors = reinterpret_cast<Stage2ErrorMsg*>(realloc(errors, sizeof(Stage2ErrorMsg) * *errors_len)); | |
| 3218 | if (errors == nullptr) abort(); | |
| 3219 | Stage2ErrorMsg *msg = &errors[*errors_len - 1]; | |
| 3220 | memset(msg, 0, sizeof(*msg)); | |
| 3221 | ||
| 3222 | msg->msg_ptr = (const char *)msg_str_ref.bytes_begin(); | |
| 3223 | msg->msg_len = msg_str_ref.size(); | |
| 3224 | ||
| 3225 | clang::FullSourceLoc fsl = it->getLocation(); | |
| 3226 | ||
| 3227 | // Ensure the source location is valid before expanding it | |
| 3228 | if (fsl.isInvalid()) { | |
| 3229 | continue; | |
| 3230 | } | |
| 3231 | // Expand the location if possible | |
| 3232 | fsl = fsl.getFileLoc(); | |
| 3233 | ||
| 3234 | // The only known way to obtain a Loc without a manager associated | |
| 3235 | // to it is if you have a lot of errors clang emits "too many errors | |
| 3236 | // emitted, stopping now" | |
| 3237 | if (fsl.hasManager()) { | |
| 3238 | const clang::SourceManager &SM = fsl.getManager(); | |
| 3239 | ||
| 3240 | clang::PresumedLoc presumed_loc = SM.getPresumedLoc(fsl); | |
| 3241 | assert(!presumed_loc.isInvalid()); | |
| 3242 | ||
| 3243 | msg->line = presumed_loc.getLine() - 1; | |
| 3244 | msg->column = presumed_loc.getColumn() - 1; | |
| 3245 | ||
| 3246 | clang::StringRef filename = presumed_loc.getFilename(); | |
| 3247 | if (!filename.empty()) { | |
| 3248 | msg->filename_ptr = (const char *)filename.bytes_begin(); | |
| 3249 | msg->filename_len = filename.size(); | |
| 3250 | } | |
| 3251 | ||
| 3252 | bool invalid; | |
| 3253 | clang::StringRef buffer = fsl.getBufferData(&invalid); | |
| 3254 | ||
| 3255 | if (!invalid) { | |
| 3256 | msg->source = (const char *)buffer.bytes_begin(); | |
| 3257 | msg->offset = SM.getFileOffset(fsl); | |
| 3258 | } | |
| 3259 | } | |
| 3260 | } | |
| 3261 | ||
| 3262 | *errors_ptr = errors; | |
| 3263 | ||
| 3264 | return nullptr; | |
| 3265 | } | |
| 3266 | ||
| 3267 | return reinterpret_cast<ZigClangASTUnit *>(ast_unit); | |
| 3268 | } | |
| 3269 | ||
| 3270 | void ZigClangErrorMsg_delete(Stage2ErrorMsg *ptr, size_t len) { | |
| 3271 | free(ptr); | |
| 3272 | } | |
| 3273 | ||
| 3274 | void ZigClangASTUnit_delete(struct ZigClangASTUnit *self) { | |
| 3275 | delete reinterpret_cast<clang::ASTUnit *>(self); | |
| 3276 | } | |
| 3277 | ||
| 3278 | struct ZigClangQualType ZigClangVarDecl_getType(const struct ZigClangVarDecl *self) { | |
| 3279 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3280 | return bitcast(casted->getType()); | |
| 3281 | } | |
| 3282 | ||
| 3283 | struct ZigClangQualType ZigClangVarDecl_getTypeSourceInfo_getType(const struct ZigClangVarDecl *self) { | |
| 3284 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3285 | return bitcast(casted->getTypeSourceInfo()->getType()); | |
| 3286 | } | |
| 3287 | ||
| 3288 | const struct ZigClangExpr *ZigClangVarDecl_getInit(const struct ZigClangVarDecl *self) { | |
| 3289 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3290 | return reinterpret_cast<const ZigClangExpr *>(casted->getInit()); | |
| 3291 | } | |
| 3292 | ||
| 3293 | enum ZigClangVarDecl_TLSKind ZigClangVarDecl_getTLSKind(const ZigClangVarDecl *self) { | |
| 3294 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3295 | return (ZigClangVarDecl_TLSKind)casted->getTLSKind(); | |
| 3296 | } | |
| 3297 | ||
| 3298 | struct ZigClangSourceLocation ZigClangVarDecl_getLocation(const struct ZigClangVarDecl *self) { | |
| 3299 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3300 | return bitcast(casted->getLocation()); | |
| 3301 | } | |
| 3302 | ||
| 3303 | bool ZigClangVarDecl_hasExternalStorage(const struct ZigClangVarDecl *self) { | |
| 3304 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3305 | return casted->hasExternalStorage(); | |
| 3306 | } | |
| 3307 | ||
| 3308 | bool ZigClangVarDecl_isFileVarDecl(const struct ZigClangVarDecl *self) { | |
| 3309 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3310 | return casted->isFileVarDecl(); | |
| 3311 | } | |
| 3312 | ||
| 3313 | bool ZigClangVarDecl_hasInit(const struct ZigClangVarDecl *self) { | |
| 3314 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3315 | return casted->hasInit(); | |
| 3316 | } | |
| 3317 | ||
| 3318 | const ZigClangAPValue * ZigClangVarDecl_evaluateValue(const struct ZigClangVarDecl *self) { | |
| 3319 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3320 | const clang::APValue *result = casted->evaluateValue(); | |
| 3321 | return reinterpret_cast<const ZigClangAPValue *>(result); | |
| 3322 | } | |
| 3323 | ||
| 3324 | enum ZigClangStorageClass ZigClangVarDecl_getStorageClass(const struct ZigClangVarDecl *self) { | |
| 3325 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3326 | return (ZigClangStorageClass)casted->getStorageClass(); | |
| 3327 | } | |
| 3328 | ||
| 3329 | bool ZigClangVarDecl_isStaticLocal(const struct ZigClangVarDecl *self) { | |
| 3330 | auto casted = reinterpret_cast<const clang::VarDecl *>(self); | |
| 3331 | return casted->isStaticLocal(); | |
| 3332 | } | |
| 3333 | ||
| 3334 | enum ZigClangBuiltinTypeKind ZigClangBuiltinType_getKind(const struct ZigClangBuiltinType *self) { | |
| 3335 | auto casted = reinterpret_cast<const clang::BuiltinType *>(self); | |
| 3336 | return (ZigClangBuiltinTypeKind)casted->getKind(); | |
| 3337 | } | |
| 3338 | ||
| 3339 | bool ZigClangFunctionType_getNoReturnAttr(const struct ZigClangFunctionType *self) { | |
| 3340 | auto casted = reinterpret_cast<const clang::FunctionType *>(self); | |
| 3341 | return casted->getNoReturnAttr(); | |
| 3342 | } | |
| 3343 | ||
| 3344 | enum ZigClangCallingConv ZigClangFunctionType_getCallConv(const struct ZigClangFunctionType *self) { | |
| 3345 | auto casted = reinterpret_cast<const clang::FunctionType *>(self); | |
| 3346 | return (ZigClangCallingConv)casted->getCallConv(); | |
| 3347 | } | |
| 3348 | ||
| 3349 | struct ZigClangQualType ZigClangFunctionType_getReturnType(const struct ZigClangFunctionType *self) { | |
| 3350 | auto casted = reinterpret_cast<const clang::FunctionType *>(self); | |
| 3351 | return bitcast(casted->getReturnType()); | |
| 3352 | } | |
| 3353 | ||
| 3354 | const struct ZigClangExpr *ZigClangGenericSelectionExpr_getResultExpr(const struct ZigClangGenericSelectionExpr *self) { | |
| 3355 | auto casted = reinterpret_cast<const clang::GenericSelectionExpr *>(self); | |
| 3356 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getResultExpr()); | |
| 3357 | } | |
| 3358 | ||
| 3359 | bool ZigClangFunctionProtoType_isVariadic(const struct ZigClangFunctionProtoType *self) { | |
| 3360 | auto casted = reinterpret_cast<const clang::FunctionProtoType *>(self); | |
| 3361 | return casted->isVariadic(); | |
| 3362 | } | |
| 3363 | ||
| 3364 | unsigned ZigClangFunctionProtoType_getNumParams(const struct ZigClangFunctionProtoType *self) { | |
| 3365 | auto casted = reinterpret_cast<const clang::FunctionProtoType *>(self); | |
| 3366 | return casted->getNumParams(); | |
| 3367 | } | |
| 3368 | ||
| 3369 | struct ZigClangQualType ZigClangFunctionProtoType_getParamType(const struct ZigClangFunctionProtoType *self, | |
| 3370 | unsigned index) | |
| 3371 | { | |
| 3372 | auto casted = reinterpret_cast<const clang::FunctionProtoType *>(self); | |
| 3373 | return bitcast(casted->getParamType(index)); | |
| 3374 | } | |
| 3375 | ||
| 3376 | struct ZigClangQualType ZigClangFunctionProtoType_getReturnType(const struct ZigClangFunctionProtoType *self) { | |
| 3377 | auto casted = reinterpret_cast<const clang::FunctionProtoType *>(self); | |
| 3378 | return bitcast(casted->getReturnType()); | |
| 3379 | } | |
| 3380 | ||
| 3381 | ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_begin(const struct ZigClangCompoundStmt *self) { | |
| 3382 | auto casted = reinterpret_cast<const clang::CompoundStmt *>(self); | |
| 3383 | return bitcast(casted->body_begin()); | |
| 3384 | } | |
| 3385 | ||
| 3386 | ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_end(const struct ZigClangCompoundStmt *self) { | |
| 3387 | auto casted = reinterpret_cast<const clang::CompoundStmt *>(self); | |
| 3388 | return bitcast(casted->body_end()); | |
| 3389 | } | |
| 3390 | ||
| 3391 | ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_begin(const struct ZigClangDeclStmt *self) { | |
| 3392 | auto casted = reinterpret_cast<const clang::DeclStmt *>(self); | |
| 3393 | return bitcast(casted->decl_begin()); | |
| 3394 | } | |
| 3395 | ||
| 3396 | ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_end(const struct ZigClangDeclStmt *self) { | |
| 3397 | auto casted = reinterpret_cast<const clang::DeclStmt *>(self); | |
| 3398 | return bitcast(casted->decl_end()); | |
| 3399 | } | |
| 3400 | ||
| 3401 | ZigClangSourceLocation ZigClangDeclStmt_getBeginLoc(const struct ZigClangDeclStmt *self) { | |
| 3402 | auto casted = reinterpret_cast<const clang::DeclStmt *>(self); | |
| 3403 | return bitcast(casted->getBeginLoc()); | |
| 3404 | } | |
| 3405 | ||
| 3406 | unsigned ZigClangAPFloat_convertToHexString(const ZigClangAPFloat *self, char *DST, | |
| 3407 | unsigned HexDigits, bool UpperCase, enum ZigClangAPFloat_roundingMode RM) | |
| 3408 | { | |
| 3409 | auto casted = reinterpret_cast<const llvm::APFloat *>(self); | |
| 3410 | return casted->convertToHexString(DST, HexDigits, UpperCase, (llvm::APFloat::roundingMode)RM); | |
| 3411 | } | |
| 3412 | ||
| 3413 | double ZigClangFloatingLiteral_getValueAsApproximateDouble(const ZigClangFloatingLiteral *self) { | |
| 3414 | auto casted = reinterpret_cast<const clang::FloatingLiteral *>(self); | |
| 3415 | return casted->getValueAsApproximateDouble(); | |
| 3416 | } | |
| 3417 | ||
| 3418 | void ZigClangFloatingLiteral_getValueAsApproximateQuadBits(const ZigClangFloatingLiteral *self, uint64_t *low, uint64_t *high) { | |
| 3419 | auto casted = reinterpret_cast<const clang::FloatingLiteral *>(self); | |
| 3420 | llvm::APFloat apf = casted->getValue(); | |
| 3421 | bool ignored; | |
| 3422 | apf.convert(llvm::APFloat::IEEEquad(), llvm::APFloat::rmNearestTiesToEven, &ignored); | |
| 3423 | const llvm::APInt api = apf.bitcastToAPInt(); | |
| 3424 | const uint64_t *api_data = api.getRawData(); | |
| 3425 | *low = api_data[0]; | |
| 3426 | *high = api_data[1]; | |
| 3427 | } | |
| 3428 | ||
| 3429 | struct ZigClangSourceLocation ZigClangFloatingLiteral_getBeginLoc(const struct ZigClangFloatingLiteral *self) { | |
| 3430 | auto casted = reinterpret_cast<const clang::FloatingLiteral *>(self); | |
| 3431 | return bitcast(casted->getBeginLoc()); | |
| 3432 | } | |
| 3433 | ||
| 3434 | ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigClangFloatingLiteral *self) { | |
| 3435 | auto casted = reinterpret_cast<const clang::FloatingLiteral *>(self); | |
| 3436 | return static_cast<ZigClangAPFloatBase_Semantics>(casted->getRawSemantics()); | |
| 3437 | } | |
| 3438 | ||
| 3439 | enum ZigClangCharacterLiteralKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self) { | |
| 3440 | auto casted = reinterpret_cast<const clang::StringLiteral *>(self); | |
| 3441 | return (ZigClangCharacterLiteralKind)casted->getKind(); | |
| 3442 | } | |
| 3443 | ||
| 3444 | uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i) { | |
| 3445 | auto casted = reinterpret_cast<const clang::StringLiteral *>(self); | |
| 3446 | return casted->getCodeUnit(i); | |
| 3447 | } | |
| 3448 | ||
| 3449 | unsigned ZigClangStringLiteral_getLength(const struct ZigClangStringLiteral *self) { | |
| 3450 | auto casted = reinterpret_cast<const clang::StringLiteral *>(self); | |
| 3451 | return casted->getLength(); | |
| 3452 | } | |
| 3453 | ||
| 3454 | unsigned ZigClangStringLiteral_getCharByteWidth(const struct ZigClangStringLiteral *self) { | |
| 3455 | auto casted = reinterpret_cast<const clang::StringLiteral *>(self); | |
| 3456 | return casted->getCharByteWidth(); | |
| 3457 | } | |
| 3458 | ||
| 3459 | const char *ZigClangStringLiteral_getString_bytes_begin_size(const struct ZigClangStringLiteral *self, size_t *len) { | |
| 3460 | auto casted = reinterpret_cast<const clang::StringLiteral *>(self); | |
| 3461 | llvm::StringRef str_ref = casted->getString(); | |
| 3462 | *len = str_ref.size(); | |
| 3463 | return (const char *)str_ref.bytes_begin(); | |
| 3464 | } | |
| 3465 | ||
| 3466 | const struct ZigClangStringLiteral *ZigClangPredefinedExpr_getFunctionName( | |
| 3467 | const struct ZigClangPredefinedExpr *self) | |
| 3468 | { | |
| 3469 | auto casted = reinterpret_cast<const clang::PredefinedExpr *>(self); | |
| 3470 | const clang::StringLiteral *result = casted->getFunctionName(); | |
| 3471 | return reinterpret_cast<const struct ZigClangStringLiteral *>(result); | |
| 3472 | } | |
| 3473 | ||
| 3474 | ZigClangSourceLocation ZigClangImplicitCastExpr_getBeginLoc(const struct ZigClangImplicitCastExpr *self) { | |
| 3475 | auto casted = reinterpret_cast<const clang::ImplicitCastExpr *>(self); | |
| 3476 | return bitcast(casted->getBeginLoc()); | |
| 3477 | } | |
| 3478 | ||
| 3479 | enum ZigClangCK ZigClangImplicitCastExpr_getCastKind(const struct ZigClangImplicitCastExpr *self) { | |
| 3480 | auto casted = reinterpret_cast<const clang::ImplicitCastExpr *>(self); | |
| 3481 | return (ZigClangCK)casted->getCastKind(); | |
| 3482 | } | |
| 3483 | ||
| 3484 | const struct ZigClangExpr *ZigClangImplicitCastExpr_getSubExpr(const struct ZigClangImplicitCastExpr *self) { | |
| 3485 | auto casted = reinterpret_cast<const clang::ImplicitCastExpr *>(self); | |
| 3486 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getSubExpr()); | |
| 3487 | } | |
| 3488 | ||
| 3489 | struct ZigClangQualType ZigClangArrayType_getElementType(const struct ZigClangArrayType *self) { | |
| 3490 | auto casted = reinterpret_cast<const clang::ArrayType *>(self); | |
| 3491 | return bitcast(casted->getElementType()); | |
| 3492 | } | |
| 3493 | ||
| 3494 | struct ZigClangQualType ZigClangIncompleteArrayType_getElementType(const struct ZigClangIncompleteArrayType *self) { | |
| 3495 | auto casted = reinterpret_cast<const clang::IncompleteArrayType *>(self); | |
| 3496 | return bitcast(casted->getElementType()); | |
| 3497 | } | |
| 3498 | ||
| 3499 | struct ZigClangQualType ZigClangConstantArrayType_getElementType(const struct ZigClangConstantArrayType *self) { | |
| 3500 | auto casted = reinterpret_cast<const clang::ConstantArrayType *>(self); | |
| 3501 | return bitcast(casted->getElementType()); | |
| 3502 | } | |
| 3503 | ||
| 3504 | void ZigClangConstantArrayType_getSize(const struct ZigClangConstantArrayType *self, const struct ZigClangAPInt **result) { | |
| 3505 | auto casted = reinterpret_cast<const clang::ConstantArrayType *>(self); | |
| 3506 | llvm::APInt *ap_int = new llvm::APInt(casted->getSize()); | |
| 3507 | *result = reinterpret_cast<const ZigClangAPInt *>(ap_int); | |
| 3508 | } | |
| 3509 | ||
| 3510 | const struct ZigClangValueDecl *ZigClangDeclRefExpr_getDecl(const struct ZigClangDeclRefExpr *self) { | |
| 3511 | auto casted = reinterpret_cast<const clang::DeclRefExpr *>(self); | |
| 3512 | return reinterpret_cast<const struct ZigClangValueDecl *>(casted->getDecl()); | |
| 3513 | } | |
| 3514 | ||
| 3515 | const struct ZigClangNamedDecl *ZigClangDeclRefExpr_getFoundDecl(const struct ZigClangDeclRefExpr *self) { | |
| 3516 | auto casted = reinterpret_cast<const clang::DeclRefExpr *>(self); | |
| 3517 | return reinterpret_cast<const struct ZigClangNamedDecl *>(casted->getFoundDecl()); | |
| 3518 | } | |
| 3519 | ||
| 3520 | struct ZigClangQualType ZigClangParenType_getInnerType(const struct ZigClangParenType *self) { | |
| 3521 | auto casted = reinterpret_cast<const clang::ParenType *>(self); | |
| 3522 | return bitcast(casted->getInnerType()); | |
| 3523 | } | |
| 3524 | ||
| 3525 | struct ZigClangQualType ZigClangAttributedType_getEquivalentType(const struct ZigClangAttributedType *self) { | |
| 3526 | auto casted = reinterpret_cast<const clang::AttributedType *>(self); | |
| 3527 | return bitcast(casted->getEquivalentType()); | |
| 3528 | } | |
| 3529 | ||
| 3530 | struct ZigClangQualType ZigClangMacroQualifiedType_getModifiedType(const struct ZigClangMacroQualifiedType *self) { | |
| 3531 | auto casted = reinterpret_cast<const clang::MacroQualifiedType *>(self); | |
| 3532 | return bitcast(casted->getModifiedType()); | |
| 3533 | } | |
| 3534 | ||
| 3535 | struct ZigClangQualType ZigClangTypeOfType_getUnmodifiedType(const struct ZigClangTypeOfType *self) { | |
| 3536 | auto casted = reinterpret_cast<const clang::TypeOfType *>(self); | |
| 3537 | return bitcast(casted->getUnmodifiedType()); | |
| 3538 | } | |
| 3539 | ||
| 3540 | const struct ZigClangExpr *ZigClangTypeOfExprType_getUnderlyingExpr(const struct ZigClangTypeOfExprType *self) { | |
| 3541 | auto casted = reinterpret_cast<const clang::TypeOfExprType *>(self); | |
| 3542 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getUnderlyingExpr()); | |
| 3543 | } | |
| 3544 | ||
| 3545 | enum ZigClangOffsetOfNode_Kind ZigClangOffsetOfNode_getKind(const struct ZigClangOffsetOfNode *self) { | |
| 3546 | auto casted = reinterpret_cast<const clang::OffsetOfNode *>(self); | |
| 3547 | return (ZigClangOffsetOfNode_Kind)casted->getKind(); | |
| 3548 | } | |
| 3549 | ||
| 3550 | unsigned ZigClangOffsetOfNode_getArrayExprIndex(const struct ZigClangOffsetOfNode *self) { | |
| 3551 | auto casted = reinterpret_cast<const clang::OffsetOfNode *>(self); | |
| 3552 | return casted->getArrayExprIndex(); | |
| 3553 | } | |
| 3554 | ||
| 3555 | struct ZigClangFieldDecl *ZigClangOffsetOfNode_getField(const struct ZigClangOffsetOfNode *self) { | |
| 3556 | auto casted = reinterpret_cast<const clang::OffsetOfNode *>(self); | |
| 3557 | return reinterpret_cast<ZigClangFieldDecl *>(casted->getField()); | |
| 3558 | } | |
| 3559 | ||
| 3560 | unsigned ZigClangOffsetOfExpr_getNumComponents(const struct ZigClangOffsetOfExpr *self) { | |
| 3561 | auto casted = reinterpret_cast<const clang::OffsetOfExpr *>(self); | |
| 3562 | return casted->getNumComponents(); | |
| 3563 | } | |
| 3564 | ||
| 3565 | unsigned ZigClangOffsetOfExpr_getNumExpressions(const struct ZigClangOffsetOfExpr *self) { | |
| 3566 | auto casted = reinterpret_cast<const clang::OffsetOfExpr *>(self); | |
| 3567 | return casted->getNumExpressions(); | |
| 3568 | } | |
| 3569 | ||
| 3570 | const struct ZigClangExpr *ZigClangOffsetOfExpr_getIndexExpr(const struct ZigClangOffsetOfExpr *self, unsigned idx) { | |
| 3571 | auto casted = reinterpret_cast<const clang::OffsetOfExpr *>(self); | |
| 3572 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getIndexExpr(idx)); | |
| 3573 | } | |
| 3574 | ||
| 3575 | const struct ZigClangOffsetOfNode *ZigClangOffsetOfExpr_getComponent(const struct ZigClangOffsetOfExpr *self, unsigned idx) { | |
| 3576 | auto casted = reinterpret_cast<const clang::OffsetOfExpr *>(self); | |
| 3577 | return reinterpret_cast<const struct ZigClangOffsetOfNode *>(&casted->getComponent(idx)); | |
| 3578 | } | |
| 3579 | ||
| 3580 | ZigClangSourceLocation ZigClangOffsetOfExpr_getBeginLoc(const ZigClangOffsetOfExpr *self) { | |
| 3581 | auto casted = reinterpret_cast<const clang::OffsetOfExpr *>(self); | |
| 3582 | return bitcast(casted->getBeginLoc()); | |
| 3583 | } | |
| 3584 | ||
| 3585 | struct ZigClangQualType ZigClangElaboratedType_getNamedType(const struct ZigClangElaboratedType *self) { | |
| 3586 | auto casted = reinterpret_cast<const clang::ElaboratedType *>(self); | |
| 3587 | return bitcast(casted->getNamedType()); | |
| 3588 | } | |
| 3589 | ||
| 3590 | enum ZigClangElaboratedTypeKeyword ZigClangElaboratedType_getKeyword(const struct ZigClangElaboratedType *self) { | |
| 3591 | auto casted = reinterpret_cast<const clang::ElaboratedType *>(self); | |
| 3592 | return (ZigClangElaboratedTypeKeyword)casted->getKeyword(); | |
| 3593 | } | |
| 3594 | ||
| 3595 | struct ZigClangSourceLocation ZigClangCStyleCastExpr_getBeginLoc(const struct ZigClangCStyleCastExpr *self) { | |
| 3596 | auto casted = reinterpret_cast<const clang::CStyleCastExpr *>(self); | |
| 3597 | return bitcast(casted->getBeginLoc()); | |
| 3598 | } | |
| 3599 | ||
| 3600 | const struct ZigClangExpr *ZigClangCStyleCastExpr_getSubExpr(const struct ZigClangCStyleCastExpr *self) { | |
| 3601 | auto casted = reinterpret_cast<const clang::CStyleCastExpr *>(self); | |
| 3602 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getSubExpr()); | |
| 3603 | } | |
| 3604 | ||
| 3605 | struct ZigClangQualType ZigClangCStyleCastExpr_getType(const struct ZigClangCStyleCastExpr *self) { | |
| 3606 | auto casted = reinterpret_cast<const clang::CStyleCastExpr *>(self); | |
| 3607 | return bitcast(casted->getType()); | |
| 3608 | } | |
| 3609 | ||
| 3610 | const struct ZigClangASTRecordLayout *ZigClangRecordDecl_getASTRecordLayout(const struct ZigClangRecordDecl *self, const struct ZigClangASTContext *ctx) { | |
| 3611 | auto casted_self = reinterpret_cast<const clang::RecordDecl *>(self); | |
| 3612 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 3613 | const clang::ASTRecordLayout &layout = casted_ctx->getASTRecordLayout(casted_self); | |
| 3614 | return reinterpret_cast<const struct ZigClangASTRecordLayout *>(&layout); | |
| 3615 | } | |
| 3616 | ||
| 3617 | uint64_t ZigClangASTRecordLayout_getFieldOffset(const struct ZigClangASTRecordLayout *self, unsigned field_no) { | |
| 3618 | return reinterpret_cast<const clang::ASTRecordLayout *>(self)->getFieldOffset(field_no); | |
| 3619 | } | |
| 3620 | ||
| 3621 | int64_t ZigClangASTRecordLayout_getAlignment(const struct ZigClangASTRecordLayout *self) { | |
| 3622 | auto casted_self = reinterpret_cast<const clang::ASTRecordLayout *>(self); | |
| 3623 | return casted_self->getAlignment().getQuantity(); | |
| 3624 | } | |
| 3625 | ||
| 3626 | bool ZigClangIntegerLiteral_EvaluateAsInt(const struct ZigClangIntegerLiteral *self, struct ZigClangExprEvalResult *result, const struct ZigClangASTContext *ctx) { | |
| 3627 | auto casted_self = reinterpret_cast<const clang::IntegerLiteral *>(self); | |
| 3628 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 3629 | clang::Expr::EvalResult eval_result; | |
| 3630 | if (!casted_self->EvaluateAsInt(eval_result, *casted_ctx)) { | |
| 3631 | return false; | |
| 3632 | } | |
| 3633 | *result = bitcast(eval_result); | |
| 3634 | return true; | |
| 3635 | } | |
| 3636 | ||
| 3637 | struct ZigClangSourceLocation ZigClangIntegerLiteral_getBeginLoc(const struct ZigClangIntegerLiteral *self) { | |
| 3638 | auto casted = reinterpret_cast<const clang::IntegerLiteral *>(self); | |
| 3639 | return bitcast(casted->getBeginLoc()); | |
| 3640 | } | |
| 3641 | ||
| 3642 | bool ZigClangIntegerLiteral_getSignum(const struct ZigClangIntegerLiteral *self, int *result, const struct ZigClangASTContext *ctx) { | |
| 3643 | auto casted_self = reinterpret_cast<const clang::IntegerLiteral *>(self); | |
| 3644 | auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx); | |
| 3645 | clang::Expr::EvalResult eval_result; | |
| 3646 | if (!casted_self->EvaluateAsInt(eval_result, *casted_ctx)) { | |
| 3647 | return false; | |
| 3648 | } | |
| 3649 | const llvm::APSInt result_int = eval_result.Val.getInt(); | |
| 3650 | const llvm::APSInt zero(result_int.getBitWidth(), result_int.isUnsigned()); | |
| 3651 | ||
| 3652 | if (zero == result_int) { | |
| 3653 | *result = 0; | |
| 3654 | } else if (result_int < zero) { | |
| 3655 | *result = -1; | |
| 3656 | } else if (result_int > zero) { | |
| 3657 | *result = 1; | |
| 3658 | } else { | |
| 3659 | return false; | |
| 3660 | } | |
| 3661 | ||
| 3662 | return true; | |
| 3663 | } | |
| 3664 | ||
| 3665 | const struct ZigClangExpr *ZigClangReturnStmt_getRetValue(const struct ZigClangReturnStmt *self) { | |
| 3666 | auto casted = reinterpret_cast<const clang::ReturnStmt *>(self); | |
| 3667 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getRetValue()); | |
| 3668 | } | |
| 3669 | ||
| 3670 | enum ZigClangBO ZigClangBinaryOperator_getOpcode(const struct ZigClangBinaryOperator *self) { | |
| 3671 | auto casted = reinterpret_cast<const clang::BinaryOperator *>(self); | |
| 3672 | return (ZigClangBO)casted->getOpcode(); | |
| 3673 | } | |
| 3674 | ||
| 3675 | struct ZigClangSourceLocation ZigClangBinaryOperator_getBeginLoc(const struct ZigClangBinaryOperator *self) { | |
| 3676 | auto casted = reinterpret_cast<const clang::BinaryOperator *>(self); | |
| 3677 | return bitcast(casted->getBeginLoc()); | |
| 3678 | } | |
| 3679 | ||
| 3680 | const struct ZigClangExpr *ZigClangBinaryOperator_getLHS(const struct ZigClangBinaryOperator *self) { | |
| 3681 | auto casted = reinterpret_cast<const clang::BinaryOperator *>(self); | |
| 3682 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getLHS()); | |
| 3683 | } | |
| 3684 | ||
| 3685 | const struct ZigClangExpr *ZigClangBinaryOperator_getRHS(const struct ZigClangBinaryOperator *self) { | |
| 3686 | auto casted = reinterpret_cast<const clang::BinaryOperator *>(self); | |
| 3687 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getRHS()); | |
| 3688 | } | |
| 3689 | ||
| 3690 | struct ZigClangQualType ZigClangBinaryOperator_getType(const struct ZigClangBinaryOperator *self) { | |
| 3691 | auto casted = reinterpret_cast<const clang::BinaryOperator *>(self); | |
| 3692 | return bitcast(casted->getType()); | |
| 3693 | } | |
| 3694 | ||
| 3695 | const struct ZigClangExpr *ZigClangConvertVectorExpr_getSrcExpr(const struct ZigClangConvertVectorExpr *self) { | |
| 3696 | auto casted = reinterpret_cast<const clang::ConvertVectorExpr *>(self); | |
| 3697 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getSrcExpr()); | |
| 3698 | } | |
| 3699 | ||
| 3700 | struct ZigClangQualType ZigClangConvertVectorExpr_getTypeSourceInfo_getType(const struct ZigClangConvertVectorExpr *self) { | |
| 3701 | auto casted = reinterpret_cast<const clang::ConvertVectorExpr *>(self); | |
| 3702 | return bitcast(casted->getTypeSourceInfo()->getType()); | |
| 3703 | } | |
| 3704 | ||
| 3705 | struct ZigClangQualType ZigClangDecayedType_getDecayedType(const struct ZigClangDecayedType *self) { | |
| 3706 | auto casted = reinterpret_cast<const clang::DecayedType *>(self); | |
| 3707 | return bitcast(casted->getDecayedType()); | |
| 3708 | } | |
| 3709 | ||
| 3710 | const struct ZigClangCompoundStmt *ZigClangStmtExpr_getSubStmt(const struct ZigClangStmtExpr *self) { | |
| 3711 | auto casted = reinterpret_cast<const clang::StmtExpr *>(self); | |
| 3712 | return reinterpret_cast<const ZigClangCompoundStmt *>(casted->getSubStmt()); | |
| 3713 | } | |
| 3714 | ||
| 3715 | enum ZigClangCK ZigClangCastExpr_getCastKind(const struct ZigClangCastExpr *self) { | |
| 3716 | auto casted = reinterpret_cast<const clang::CastExpr *>(self); | |
| 3717 | return (ZigClangCK)casted->getCastKind(); | |
| 3718 | } | |
| 3719 | ||
| 3720 | const struct ZigClangFieldDecl *ZigClangCastExpr_getTargetFieldForToUnionCast(const struct ZigClangCastExpr *self, ZigClangQualType union_type, ZigClangQualType op_type) { | |
| 3721 | clang::QualType union_qt = bitcast(union_type); | |
| 3722 | clang::QualType op_qt = bitcast(op_type); | |
| 3723 | auto casted = reinterpret_cast<const clang::CastExpr *>(self); | |
| 3724 | return reinterpret_cast<const ZigClangFieldDecl *>(casted->getTargetFieldForToUnionCast(union_qt, op_qt)); | |
| 3725 | } | |
| 3726 | ||
| 3727 | struct ZigClangSourceLocation ZigClangCharacterLiteral_getBeginLoc(const struct ZigClangCharacterLiteral *self) { | |
| 3728 | auto casted = reinterpret_cast<const clang::CharacterLiteral *>(self); | |
| 3729 | return bitcast(casted->getBeginLoc()); | |
| 3730 | } | |
| 3731 | ||
| 3732 | enum ZigClangCharacterLiteralKind ZigClangCharacterLiteral_getKind(const struct ZigClangCharacterLiteral *self) { | |
| 3733 | auto casted = reinterpret_cast<const clang::CharacterLiteral *>(self); | |
| 3734 | return (ZigClangCharacterLiteralKind)casted->getKind(); | |
| 3735 | } | |
| 3736 | ||
| 3737 | unsigned ZigClangCharacterLiteral_getValue(const struct ZigClangCharacterLiteral *self) { | |
| 3738 | auto casted = reinterpret_cast<const clang::CharacterLiteral *>(self); | |
| 3739 | return casted->getValue(); | |
| 3740 | } | |
| 3741 | ||
| 3742 | const struct ZigClangExpr *ZigClangChooseExpr_getChosenSubExpr(const struct ZigClangChooseExpr *self) { | |
| 3743 | auto casted = reinterpret_cast<const clang::ChooseExpr *>(self); | |
| 3744 | return reinterpret_cast<const ZigClangExpr *>(casted->getChosenSubExpr()); | |
| 3745 | } | |
| 3746 | ||
| 3747 | const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getCond(const struct ZigClangAbstractConditionalOperator *self) { | |
| 3748 | auto casted = reinterpret_cast<const clang::AbstractConditionalOperator *>(self); | |
| 3749 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond()); | |
| 3750 | } | |
| 3751 | ||
| 3752 | const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getTrueExpr(const struct ZigClangAbstractConditionalOperator *self) { | |
| 3753 | auto casted = reinterpret_cast<const clang::AbstractConditionalOperator *>(self); | |
| 3754 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getTrueExpr()); | |
| 3755 | } | |
| 3756 | ||
| 3757 | const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getFalseExpr(const struct ZigClangAbstractConditionalOperator *self) { | |
| 3758 | auto casted = reinterpret_cast<const clang::AbstractConditionalOperator *>(self); | |
| 3759 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getFalseExpr()); | |
| 3760 | } | |
| 3761 | ||
| 3762 | struct ZigClangQualType ZigClangCompoundAssignOperator_getType(const struct ZigClangCompoundAssignOperator *self) { | |
| 3763 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3764 | return bitcast(casted->getType()); | |
| 3765 | } | |
| 3766 | ||
| 3767 | struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationLHSType(const struct ZigClangCompoundAssignOperator *self) { | |
| 3768 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3769 | return bitcast(casted->getComputationLHSType()); | |
| 3770 | } | |
| 3771 | ||
| 3772 | struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationResultType(const struct ZigClangCompoundAssignOperator *self) { | |
| 3773 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3774 | return bitcast(casted->getComputationResultType()); | |
| 3775 | } | |
| 3776 | ||
| 3777 | struct ZigClangSourceLocation ZigClangCompoundAssignOperator_getBeginLoc(const struct ZigClangCompoundAssignOperator *self) { | |
| 3778 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3779 | return bitcast(casted->getBeginLoc()); | |
| 3780 | } | |
| 3781 | ||
| 3782 | enum ZigClangBO ZigClangCompoundAssignOperator_getOpcode(const struct ZigClangCompoundAssignOperator *self) { | |
| 3783 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3784 | return (ZigClangBO)casted->getOpcode(); | |
| 3785 | } | |
| 3786 | ||
| 3787 | const struct ZigClangExpr *ZigClangCompoundAssignOperator_getLHS(const struct ZigClangCompoundAssignOperator *self) { | |
| 3788 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3789 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getLHS()); | |
| 3790 | } | |
| 3791 | ||
| 3792 | const struct ZigClangExpr *ZigClangCompoundAssignOperator_getRHS(const struct ZigClangCompoundAssignOperator *self) { | |
| 3793 | auto casted = reinterpret_cast<const clang::CompoundAssignOperator *>(self); | |
| 3794 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getRHS()); | |
| 3795 | } | |
| 3796 | ||
| 3797 | const struct ZigClangExpr *ZigClangCompoundLiteralExpr_getInitializer(const ZigClangCompoundLiteralExpr *self) { | |
| 3798 | auto casted = reinterpret_cast<const clang::CompoundLiteralExpr *>(self); | |
| 3799 | return reinterpret_cast<const ZigClangExpr *>(casted->getInitializer()); | |
| 3800 | } | |
| 3801 | ||
| 3802 | enum ZigClangUO ZigClangUnaryOperator_getOpcode(const struct ZigClangUnaryOperator *self) { | |
| 3803 | auto casted = reinterpret_cast<const clang::UnaryOperator *>(self); | |
| 3804 | return (ZigClangUO)casted->getOpcode(); | |
| 3805 | } | |
| 3806 | ||
| 3807 | struct ZigClangQualType ZigClangUnaryOperator_getType(const struct ZigClangUnaryOperator *self) { | |
| 3808 | auto casted = reinterpret_cast<const clang::UnaryOperator *>(self); | |
| 3809 | return bitcast(casted->getType()); | |
| 3810 | } | |
| 3811 | ||
| 3812 | const struct ZigClangExpr *ZigClangUnaryOperator_getSubExpr(const struct ZigClangUnaryOperator *self) { | |
| 3813 | auto casted = reinterpret_cast<const clang::UnaryOperator *>(self); | |
| 3814 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getSubExpr()); | |
| 3815 | } | |
| 3816 | ||
| 3817 | struct ZigClangSourceLocation ZigClangUnaryOperator_getBeginLoc(const struct ZigClangUnaryOperator *self) { | |
| 3818 | auto casted = reinterpret_cast<const clang::UnaryOperator *>(self); | |
| 3819 | return bitcast(casted->getBeginLoc()); | |
| 3820 | } | |
| 3821 | ||
| 3822 | struct ZigClangQualType ZigClangValueDecl_getType(const struct ZigClangValueDecl *self) { | |
| 3823 | auto casted = reinterpret_cast<const clang::ValueDecl *>(self); | |
| 3824 | return bitcast(casted->getType()); | |
| 3825 | } | |
| 3826 | ||
| 3827 | struct ZigClangQualType ZigClangVectorType_getElementType(const struct ZigClangVectorType *self) { | |
| 3828 | auto casted = reinterpret_cast<const clang::VectorType *>(self); | |
| 3829 | return bitcast(casted->getElementType()); | |
| 3830 | } | |
| 3831 | ||
| 3832 | unsigned ZigClangVectorType_getNumElements(const struct ZigClangVectorType *self) { | |
| 3833 | auto casted = reinterpret_cast<const clang::VectorType *>(self); | |
| 3834 | return casted->getNumElements(); | |
| 3835 | } | |
| 3836 | ||
| 3837 | const struct ZigClangExpr *ZigClangWhileStmt_getCond(const struct ZigClangWhileStmt *self) { | |
| 3838 | auto casted = reinterpret_cast<const clang::WhileStmt *>(self); | |
| 3839 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond()); | |
| 3840 | } | |
| 3841 | ||
| 3842 | const struct ZigClangStmt *ZigClangWhileStmt_getBody(const struct ZigClangWhileStmt *self) { | |
| 3843 | auto casted = reinterpret_cast<const clang::WhileStmt *>(self); | |
| 3844 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getBody()); | |
| 3845 | } | |
| 3846 | ||
| 3847 | const struct ZigClangStmt *ZigClangIfStmt_getThen(const struct ZigClangIfStmt *self) { | |
| 3848 | auto casted = reinterpret_cast<const clang::IfStmt *>(self); | |
| 3849 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getThen()); | |
| 3850 | } | |
| 3851 | ||
| 3852 | const struct ZigClangStmt *ZigClangIfStmt_getElse(const struct ZigClangIfStmt *self) { | |
| 3853 | auto casted = reinterpret_cast<const clang::IfStmt *>(self); | |
| 3854 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getElse()); | |
| 3855 | } | |
| 3856 | ||
| 3857 | const struct ZigClangExpr *ZigClangIfStmt_getCond(const struct ZigClangIfStmt *self) { | |
| 3858 | auto casted = reinterpret_cast<const clang::IfStmt *>(self); | |
| 3859 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond()); | |
| 3860 | } | |
| 3861 | ||
| 3862 | const struct ZigClangExpr *ZigClangCallExpr_getCallee(const struct ZigClangCallExpr *self) { | |
| 3863 | auto casted = reinterpret_cast<const clang::CallExpr *>(self); | |
| 3864 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCallee()); | |
| 3865 | } | |
| 3866 | ||
| 3867 | unsigned ZigClangCallExpr_getNumArgs(const struct ZigClangCallExpr *self) { | |
| 3868 | auto casted = reinterpret_cast<const clang::CallExpr *>(self); | |
| 3869 | return casted->getNumArgs(); | |
| 3870 | } | |
| 3871 | ||
| 3872 | const struct ZigClangExpr * const * ZigClangCallExpr_getArgs(const struct ZigClangCallExpr *self) { | |
| 3873 | auto casted = reinterpret_cast<const clang::CallExpr *>(self); | |
| 3874 | return reinterpret_cast<const struct ZigClangExpr * const*>(casted->getArgs()); | |
| 3875 | } | |
| 3876 | ||
| 3877 | const struct ZigClangExpr * ZigClangMemberExpr_getBase(const struct ZigClangMemberExpr *self) { | |
| 3878 | auto casted = reinterpret_cast<const clang::MemberExpr *>(self); | |
| 3879 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getBase()); | |
| 3880 | } | |
| 3881 | ||
| 3882 | bool ZigClangMemberExpr_isArrow(const struct ZigClangMemberExpr *self) { | |
| 3883 | auto casted = reinterpret_cast<const clang::MemberExpr *>(self); | |
| 3884 | return casted->isArrow(); | |
| 3885 | } | |
| 3886 | ||
| 3887 | const struct ZigClangValueDecl * ZigClangMemberExpr_getMemberDecl(const struct ZigClangMemberExpr *self) { | |
| 3888 | auto casted = reinterpret_cast<const clang::MemberExpr *>(self); | |
| 3889 | return reinterpret_cast<const struct ZigClangValueDecl *>(casted->getMemberDecl()); | |
| 3890 | } | |
| 3891 | ||
| 3892 | const struct ZigClangExpr *ZigClangArraySubscriptExpr_getBase(const struct ZigClangArraySubscriptExpr *self) { | |
| 3893 | auto casted = reinterpret_cast<const clang::ArraySubscriptExpr *>(self); | |
| 3894 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getBase()); | |
| 3895 | } | |
| 3896 | ||
| 3897 | const struct ZigClangExpr *ZigClangArraySubscriptExpr_getIdx(const struct ZigClangArraySubscriptExpr *self) { | |
| 3898 | auto casted = reinterpret_cast<const clang::ArraySubscriptExpr *>(self); | |
| 3899 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getIdx()); | |
| 3900 | } | |
| 3901 | ||
| 3902 | struct ZigClangQualType ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument( | |
| 3903 | const struct ZigClangUnaryExprOrTypeTraitExpr *self) | |
| 3904 | { | |
| 3905 | auto casted = reinterpret_cast<const clang::UnaryExprOrTypeTraitExpr *>(self); | |
| 3906 | return bitcast(casted->getTypeOfArgument()); | |
| 3907 | } | |
| 3908 | ||
| 3909 | struct ZigClangSourceLocation ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc( | |
| 3910 | const struct ZigClangUnaryExprOrTypeTraitExpr *self) | |
| 3911 | { | |
| 3912 | auto casted = reinterpret_cast<const clang::UnaryExprOrTypeTraitExpr *>(self); | |
| 3913 | return bitcast(casted->getBeginLoc()); | |
| 3914 | } | |
| 3915 | ||
| 3916 | unsigned ZigClangShuffleVectorExpr_getNumSubExprs(const ZigClangShuffleVectorExpr *self) { | |
| 3917 | auto casted = reinterpret_cast<const clang::ShuffleVectorExpr *>(self); | |
| 3918 | return casted->getNumSubExprs(); | |
| 3919 | } | |
| 3920 | ||
| 3921 | const struct ZigClangExpr *ZigClangShuffleVectorExpr_getExpr(const struct ZigClangShuffleVectorExpr *self, unsigned idx) { | |
| 3922 | auto casted = reinterpret_cast<const clang::ShuffleVectorExpr *>(self); | |
| 3923 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getExpr(idx)); | |
| 3924 | } | |
| 3925 | ||
| 3926 | enum ZigClangUnaryExprOrTypeTrait_Kind ZigClangUnaryExprOrTypeTraitExpr_getKind( | |
| 3927 | const struct ZigClangUnaryExprOrTypeTraitExpr *self) | |
| 3928 | { | |
| 3929 | auto casted = reinterpret_cast<const clang::UnaryExprOrTypeTraitExpr *>(self); | |
| 3930 | return (ZigClangUnaryExprOrTypeTrait_Kind)casted->getKind(); | |
| 3931 | } | |
| 3932 | ||
| 3933 | const struct ZigClangStmt *ZigClangDoStmt_getBody(const struct ZigClangDoStmt *self) { | |
| 3934 | auto casted = reinterpret_cast<const clang::DoStmt *>(self); | |
| 3935 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getBody()); | |
| 3936 | } | |
| 3937 | ||
| 3938 | const struct ZigClangExpr *ZigClangDoStmt_getCond(const struct ZigClangDoStmt *self) { | |
| 3939 | auto casted = reinterpret_cast<const clang::DoStmt *>(self); | |
| 3940 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond()); | |
| 3941 | } | |
| 3942 | ||
| 3943 | const struct ZigClangStmt *ZigClangForStmt_getInit(const struct ZigClangForStmt *self) { | |
| 3944 | auto casted = reinterpret_cast<const clang::ForStmt *>(self); | |
| 3945 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getInit()); | |
| 3946 | } | |
| 3947 | ||
| 3948 | const struct ZigClangExpr *ZigClangForStmt_getCond(const struct ZigClangForStmt *self) { | |
| 3949 | auto casted = reinterpret_cast<const clang::ForStmt *>(self); | |
| 3950 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond()); | |
| 3951 | } | |
| 3952 | ||
| 3953 | const struct ZigClangExpr *ZigClangForStmt_getInc(const struct ZigClangForStmt *self) { | |
| 3954 | auto casted = reinterpret_cast<const clang::ForStmt *>(self); | |
| 3955 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getInc()); | |
| 3956 | } | |
| 3957 | ||
| 3958 | const struct ZigClangStmt *ZigClangForStmt_getBody(const struct ZigClangForStmt *self) { | |
| 3959 | auto casted = reinterpret_cast<const clang::ForStmt *>(self); | |
| 3960 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getBody()); | |
| 3961 | } | |
| 3962 | ||
| 3963 | const struct ZigClangDeclStmt *ZigClangSwitchStmt_getConditionVariableDeclStmt( | |
| 3964 | const struct ZigClangSwitchStmt *self) | |
| 3965 | { | |
| 3966 | auto casted = reinterpret_cast<const clang::SwitchStmt *>(self); | |
| 3967 | return reinterpret_cast<const struct ZigClangDeclStmt *>(casted->getConditionVariableDeclStmt()); | |
| 3968 | } | |
| 3969 | ||
| 3970 | const struct ZigClangExpr *ZigClangSwitchStmt_getCond(const struct ZigClangSwitchStmt *self) { | |
| 3971 | auto casted = reinterpret_cast<const clang::SwitchStmt *>(self); | |
| 3972 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond()); | |
| 3973 | } | |
| 3974 | ||
| 3975 | const struct ZigClangStmt *ZigClangSwitchStmt_getBody(const struct ZigClangSwitchStmt *self) { | |
| 3976 | auto casted = reinterpret_cast<const clang::SwitchStmt *>(self); | |
| 3977 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getBody()); | |
| 3978 | } | |
| 3979 | ||
| 3980 | bool ZigClangSwitchStmt_isAllEnumCasesCovered(const struct ZigClangSwitchStmt *self) { | |
| 3981 | auto casted = reinterpret_cast<const clang::SwitchStmt *>(self); | |
| 3982 | return casted->isAllEnumCasesCovered(); | |
| 3983 | } | |
| 3984 | ||
| 3985 | const struct ZigClangExpr *ZigClangCaseStmt_getLHS(const struct ZigClangCaseStmt *self) { | |
| 3986 | auto casted = reinterpret_cast<const clang::CaseStmt *>(self); | |
| 3987 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getLHS()); | |
| 3988 | } | |
| 3989 | ||
| 3990 | const struct ZigClangExpr *ZigClangCaseStmt_getRHS(const struct ZigClangCaseStmt *self) { | |
| 3991 | auto casted = reinterpret_cast<const clang::CaseStmt *>(self); | |
| 3992 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getRHS()); | |
| 3993 | } | |
| 3994 | ||
| 3995 | struct ZigClangSourceLocation ZigClangCaseStmt_getBeginLoc(const struct ZigClangCaseStmt *self) { | |
| 3996 | auto casted = reinterpret_cast<const clang::CaseStmt *>(self); | |
| 3997 | return bitcast(casted->getBeginLoc()); | |
| 3998 | } | |
| 3999 | ||
| 4000 | const struct ZigClangStmt *ZigClangCaseStmt_getSubStmt(const struct ZigClangCaseStmt *self) { | |
| 4001 | auto casted = reinterpret_cast<const clang::CaseStmt *>(self); | |
| 4002 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getSubStmt()); | |
| 4003 | } | |
| 4004 | ||
| 4005 | const struct ZigClangStmt *ZigClangDefaultStmt_getSubStmt(const struct ZigClangDefaultStmt *self) { | |
| 4006 | auto casted = reinterpret_cast<const clang::DefaultStmt *>(self); | |
| 4007 | return reinterpret_cast<const struct ZigClangStmt *>(casted->getSubStmt()); | |
| 4008 | } | |
| 4009 | ||
| 4010 | const struct ZigClangExpr *ZigClangParenExpr_getSubExpr(const struct ZigClangParenExpr *self) { | |
| 4011 | auto casted = reinterpret_cast<const clang::ParenExpr *>(self); | |
| 4012 | return reinterpret_cast<const struct ZigClangExpr *>(casted->getSubExpr()); | |
| 4013 | } | |
| 4014 | ||
| 4015 | enum ZigClangPreprocessedEntity_EntityKind ZigClangPreprocessedEntity_getKind( | |
| 4016 | const struct ZigClangPreprocessedEntity *self) | |
| 4017 | { | |
| 4018 | auto casted = reinterpret_cast<const clang::PreprocessedEntity *>(self); | |
| 4019 | return (ZigClangPreprocessedEntity_EntityKind)casted->getKind(); | |
| 4020 | } | |
| 4021 | ||
| 4022 | const char *ZigClangMacroDefinitionRecord_getName_getNameStart(const struct ZigClangMacroDefinitionRecord *self) { | |
| 4023 | auto casted = reinterpret_cast<const clang::MacroDefinitionRecord *>(self); | |
| 4024 | return casted->getName()->getNameStart(); | |
| 4025 | } | |
| 4026 | ||
| 4027 | struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getBegin(const struct ZigClangMacroDefinitionRecord *self) { | |
| 4028 | auto casted = reinterpret_cast<const clang::MacroDefinitionRecord *>(self); | |
| 4029 | return bitcast(casted->getSourceRange().getBegin()); | |
| 4030 | } | |
| 4031 | ||
| 4032 | struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getEnd(const struct ZigClangMacroDefinitionRecord *self) { | |
| 4033 | auto casted = reinterpret_cast<const clang::MacroDefinitionRecord *>(self); | |
| 4034 | return bitcast(casted->getSourceRange().getEnd()); | |
| 4035 | } | |
| 4036 | ||
| 4037 | struct ZigClangSourceLocation ZigClangLexer_getLocForEndOfToken(ZigClangSourceLocation loc, const ZigClangSourceManager *sm, const ZigClangASTUnit *unit) { | |
| 4038 | const clang::SourceManager *casted_sm = reinterpret_cast<const clang::SourceManager *>(sm); | |
| 4039 | const clang::ASTUnit *casted_unit = reinterpret_cast<const clang::ASTUnit *>(unit); | |
| 4040 | clang::SourceLocation endloc = clang::Lexer::getLocForEndOfToken(bitcast(loc), 0, *casted_sm, casted_unit->getLangOpts()); | |
| 4041 | return bitcast(endloc); | |
| 4042 | } | |
| 4043 | ||
| 4044 | ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_begin(const struct ZigClangRecordDecl *self) { | |
| 4045 | auto casted = reinterpret_cast<const clang::RecordDecl *>(self); | |
| 4046 | return bitcast(casted->field_begin()); | |
| 4047 | } | |
| 4048 | ||
| 4049 | ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_end(const struct ZigClangRecordDecl *self) { | |
| 4050 | auto casted = reinterpret_cast<const clang::RecordDecl *>(self); | |
| 4051 | return bitcast(casted->field_end()); | |
| 4052 | } | |
| 4053 | ||
| 4054 | bool ZigClangFieldDecl_isBitField(const struct ZigClangFieldDecl *self) { | |
| 4055 | auto casted = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 4056 | return casted->isBitField(); | |
| 4057 | } | |
| 4058 | ||
| 4059 | bool ZigClangFieldDecl_isAnonymousStructOrUnion(const ZigClangFieldDecl *field_decl) { | |
| 4060 | return reinterpret_cast<const clang::FieldDecl*>(field_decl)->isAnonymousStructOrUnion(); | |
| 4061 | } | |
| 4062 | ||
| 4063 | ZigClangSourceLocation ZigClangFieldDecl_getLocation(const struct ZigClangFieldDecl *self) { | |
| 4064 | auto casted = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 4065 | return bitcast(casted->getLocation()); | |
| 4066 | } | |
| 4067 | ||
| 4068 | const struct ZigClangRecordDecl *ZigClangFieldDecl_getParent(const struct ZigClangFieldDecl *self) { | |
| 4069 | auto casted = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 4070 | return reinterpret_cast<const ZigClangRecordDecl *>(casted->getParent()); | |
| 4071 | } | |
| 4072 | ||
| 4073 | unsigned ZigClangFieldDecl_getFieldIndex(const struct ZigClangFieldDecl *self) { | |
| 4074 | auto casted = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 4075 | return casted->getFieldIndex(); | |
| 4076 | } | |
| 4077 | ||
| 4078 | ZigClangQualType ZigClangFieldDecl_getType(const struct ZigClangFieldDecl *self) { | |
| 4079 | auto casted = reinterpret_cast<const clang::FieldDecl *>(self); | |
| 4080 | return bitcast(casted->getType()); | |
| 4081 | } | |
| 4082 | ||
| 4083 | ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_iterator_next( | |
| 4084 | struct ZigClangRecordDecl_field_iterator self) | |
| 4085 | { | |
| 4086 | clang::RecordDecl::field_iterator casted = bitcast(self); | |
| 4087 | ++casted; | |
| 4088 | return bitcast(casted); | |
| 4089 | } | |
| 4090 | ||
| 4091 | const struct ZigClangFieldDecl * ZigClangRecordDecl_field_iterator_deref( | |
| 4092 | struct ZigClangRecordDecl_field_iterator self) | |
| 4093 | { | |
| 4094 | clang::RecordDecl::field_iterator casted = bitcast(self); | |
| 4095 | const clang::FieldDecl *result = *casted; | |
| 4096 | return reinterpret_cast<const ZigClangFieldDecl *>(result); | |
| 4097 | } | |
| 4098 | ||
| 4099 | bool ZigClangRecordDecl_field_iterator_neq( | |
| 4100 | struct ZigClangRecordDecl_field_iterator a, | |
| 4101 | struct ZigClangRecordDecl_field_iterator b) | |
| 4102 | { | |
| 4103 | clang::RecordDecl::field_iterator casted_a = bitcast(a); | |
| 4104 | clang::RecordDecl::field_iterator casted_b = bitcast(b); | |
| 4105 | return casted_a != casted_b; | |
| 4106 | } | |
| 4107 | ||
| 4108 | ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_begin(const struct ZigClangEnumDecl *self) { | |
| 4109 | auto casted = reinterpret_cast<const clang::EnumDecl *>(self); | |
| 4110 | return bitcast(casted->enumerator_begin()); | |
| 4111 | } | |
| 4112 | ||
| 4113 | ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_end(const struct ZigClangEnumDecl *self) { | |
| 4114 | auto casted = reinterpret_cast<const clang::EnumDecl *>(self); | |
| 4115 | return bitcast(casted->enumerator_end()); | |
| 4116 | } | |
| 4117 | ||
| 4118 | ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_iterator_next( | |
| 4119 | struct ZigClangEnumDecl_enumerator_iterator self) | |
| 4120 | { | |
| 4121 | clang::EnumDecl::enumerator_iterator casted = bitcast(self); | |
| 4122 | ++casted; | |
| 4123 | return bitcast(casted); | |
| 4124 | } | |
| 4125 | ||
| 4126 | const struct ZigClangEnumConstantDecl * ZigClangEnumDecl_enumerator_iterator_deref( | |
| 4127 | struct ZigClangEnumDecl_enumerator_iterator self) | |
| 4128 | { | |
| 4129 | clang::EnumDecl::enumerator_iterator casted = bitcast(self); | |
| 4130 | const clang::EnumConstantDecl *result = *casted; | |
| 4131 | return reinterpret_cast<const ZigClangEnumConstantDecl *>(result); | |
| 4132 | } | |
| 4133 | ||
| 4134 | bool ZigClangEnumDecl_enumerator_iterator_neq( | |
| 4135 | struct ZigClangEnumDecl_enumerator_iterator a, | |
| 4136 | struct ZigClangEnumDecl_enumerator_iterator b) | |
| 4137 | { | |
| 4138 | clang::EnumDecl::enumerator_iterator casted_a = bitcast(a); | |
| 4139 | clang::EnumDecl::enumerator_iterator casted_b = bitcast(b); | |
| 4140 | return casted_a != casted_b; | |
| 4141 | } | |
| 4142 | ||
| 4143 | const struct ZigClangAPSInt *ZigClangEnumConstantDecl_getInitVal(const struct ZigClangEnumConstantDecl *self) { | |
| 4144 | auto casted = reinterpret_cast<const clang::EnumConstantDecl *>(self); | |
| 4145 | llvm::APSInt *result = new llvm::APSInt(); | |
| 4146 | *result = casted->getInitVal(); | |
| 4147 | return reinterpret_cast<const ZigClangAPSInt *>(result); | |
| 4148 | } | |
| 4149 | ||
| 4150 | // Get a pointer to a static variable in libc++ from LLVM and make sure that | |
| 4151 | // it matches our own. | |
| 4152 | // | |
| 4153 | // This check is needed because if static/dynamic linking is mixed incorrectly, | |
| 4154 | // it's possible for Clang and LLVM to end up with duplicate "copies" of libc++. | |
| 4155 | // | |
| 4156 | // This is not benign: Static variables are not shared, so equality comparisons | |
| 4157 | // that depend on pointers to static variables will fail. One such failure is | |
| 4158 | // std::generic_category(), which causes POSIX error codes to compare as unequal | |
| 4159 | // when passed between LLVM and Clang. | |
| 4160 | // | |
| 4161 | // See also: https://github.com/ziglang/zig/issues/11168 | |
| 4162 | bool ZigClangIsLLVMUsingSeparateLibcxx() { | |
| 4163 | ||
| 4164 | // Temporarily create an InMemoryFileSystem, so that we can perform a file | |
| 4165 | // lookup that is guaranteed to fail. | |
| 4166 | auto FS = new llvm::vfs::InMemoryFileSystem(true); | |
| 4167 | auto StatusOrErr = FS->status("foo.txt"); | |
| 4168 | delete FS; | |
| 4169 | ||
| 4170 | // This should return a POSIX (generic_category) error code, but if LLVM has | |
| 4171 | // its own copy of libc++ this will actually be a separate category instance. | |
| 4172 | assert(!StatusOrErr); | |
| 4173 | auto EC = StatusOrErr.getError(); | |
| 4174 | return EC.category() != std::generic_category(); | |
| 4175 | } | |
| 4176 | ||
| 4177 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEhalf == llvm::APFloatBase::S_IEEEhalf, ""); | |
| 4178 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_BFloat == llvm::APFloatBase::S_BFloat); | |
| 4179 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEsingle == llvm::APFloatBase::S_IEEEsingle); | |
| 4180 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEdouble == llvm::APFloatBase::S_IEEEdouble); | |
| 4181 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEquad == llvm::APFloatBase::S_IEEEquad); | |
| 4182 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_PPCDoubleDouble == llvm::APFloatBase::S_PPCDoubleDouble); | |
| 4183 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_PPCDoubleDoubleLegacy == llvm::APFloatBase::S_PPCDoubleDoubleLegacy); | |
| 4184 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E5M2 == llvm::APFloatBase::S_Float8E5M2); | |
| 4185 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E5M2FNUZ == llvm::APFloatBase::S_Float8E5M2FNUZ); | |
| 4186 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3 == llvm::APFloatBase::S_Float8E4M3); | |
| 4187 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3FN == llvm::APFloatBase::S_Float8E4M3FN); | |
| 4188 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3FNUZ == llvm::APFloatBase::S_Float8E4M3FNUZ); | |
| 4189 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3B11FNUZ == llvm::APFloatBase::S_Float8E4M3B11FNUZ); | |
| 4190 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E3M4 == llvm::APFloatBase::S_Float8E3M4); | |
| 4191 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_FloatTF32 == llvm::APFloatBase::S_FloatTF32); | |
| 4192 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E8M0FNU == llvm::APFloatBase::S_Float8E8M0FNU); | |
| 4193 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float6E3M2FN == llvm::APFloatBase::S_Float6E3M2FN); | |
| 4194 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float6E2M3FN == llvm::APFloatBase::S_Float6E2M3FN); | |
| 4195 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float4E2M1FN == llvm::APFloatBase::S_Float4E2M1FN); | |
| 4196 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_x87DoubleExtended == llvm::APFloatBase::S_x87DoubleExtended); | |
| 4197 | static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_MaxSemantics == llvm::APFloatBase::S_MaxSemantics); |
src/zig_clang.h deleted-1778| ... | ... | @@ -1,1778 +0,0 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2019 Andrew Kelley | |
| 3 | * | |
| 4 | * This file is part of zig, which is MIT licensed. | |
| 5 | * See http://opensource.org/licenses/MIT | |
| 6 | */ | |
| 7 | ||
| 8 | #ifndef ZIG_ZIG_CLANG_H | |
| 9 | #define ZIG_ZIG_CLANG_H | |
| 10 | ||
| 11 | #include <inttypes.h> | |
| 12 | #include <stdalign.h> | |
| 13 | #include <stdbool.h> | |
| 14 | #include <stddef.h> | |
| 15 | ||
| 16 | #ifdef __cplusplus | |
| 17 | #define ZIG_EXTERN_C extern "C" | |
| 18 | #else | |
| 19 | #define ZIG_EXTERN_C | |
| 20 | #endif | |
| 21 | ||
| 22 | // ATTENTION: If you modify this file, be sure to update the corresponding | |
| 23 | // extern function declarations in the self-hosted compiler file | |
| 24 | // src/clang.zig. | |
| 25 | ||
| 26 | // ABI warning | |
| 27 | struct Stage2ErrorMsg { | |
| 28 | const char *filename_ptr; // can be null | |
| 29 | size_t filename_len; | |
| 30 | const char *msg_ptr; | |
| 31 | size_t msg_len; | |
| 32 | const char *source; // valid until the ASTUnit is freed. can be null | |
| 33 | unsigned line; // 0 based | |
| 34 | unsigned column; // 0 based | |
| 35 | unsigned offset; // byte offset into source | |
| 36 | }; | |
| 37 | ||
| 38 | struct ZigClangSourceLocation { | |
| 39 | unsigned ID; | |
| 40 | }; | |
| 41 | ||
| 42 | struct ZigClangQualType { | |
| 43 | void *ptr; | |
| 44 | }; | |
| 45 | ||
| 46 | struct alignas(uint64_t) ZigClangAPValueLValueBase { | |
| 47 | void* Ptr; | |
| 48 | union { | |
| 49 | struct { | |
| 50 | unsigned CallIndex; | |
| 51 | unsigned Version; | |
| 52 | } Local; | |
| 53 | void* TypeInfoType; | |
| 54 | void* DynamicAllocType; | |
| 55 | }; | |
| 56 | }; | |
| 57 | ||
| 58 | enum ZigClangAPValueKind { | |
| 59 | ZigClangAPValueNone, | |
| 60 | ZigClangAPValueIndeterminate, | |
| 61 | ZigClangAPValueInt, | |
| 62 | ZigClangAPValueFloat, | |
| 63 | ZigClangAPValueFixedPoint, | |
| 64 | ZigClangAPValueComplexInt, | |
| 65 | ZigClangAPValueComplexFloat, | |
| 66 | ZigClangAPValueLValue, | |
| 67 | ZigClangAPValueVector, | |
| 68 | ZigClangAPValueArray, | |
| 69 | ZigClangAPValueStruct, | |
| 70 | ZigClangAPValueUnion, | |
| 71 | ZigClangAPValueMemberPointer, | |
| 72 | ZigClangAPValueAddrLabelDiff, | |
| 73 | }; | |
| 74 | ||
| 75 | #if defined(__i386__) && !defined(_WIN32) | |
| 76 | # define ZIG_CLANG_APVALUE_SIZE 44 | |
| 77 | # define ZIG_CLANG_APVALUE_ALIGN 4 | |
| 78 | #else | |
| 79 | # define ZIG_CLANG_APVALUE_SIZE 52 | |
| 80 | # define ZIG_CLANG_APVALUE_ALIGN 8 | |
| 81 | #endif | |
| 82 | ||
| 83 | struct alignas(ZIG_CLANG_APVALUE_ALIGN) ZigClangAPValue { | |
| 84 | enum ZigClangAPValueKind Kind; | |
| 85 | // experimentally-derived size of clang::APValue::DataType | |
| 86 | char Data[ZIG_CLANG_APVALUE_SIZE]; | |
| 87 | }; | |
| 88 | ||
| 89 | struct ZigClangExprEvalResult { | |
| 90 | bool HasSideEffects; | |
| 91 | bool HasUndefinedBehavior; | |
| 92 | void *SmallVectorImpl; | |
| 93 | ZigClangAPValue Val; | |
| 94 | }; | |
| 95 | ||
| 96 | struct ZigClangAbstractConditionalOperator; | |
| 97 | struct ZigClangAPFloat; | |
| 98 | struct ZigClangAPInt; | |
| 99 | struct ZigClangAPSInt; | |
| 100 | struct ZigClangASTContext; | |
| 101 | struct ZigClangASTRecordLayout; | |
| 102 | struct ZigClangASTUnit; | |
| 103 | struct ZigClangArraySubscriptExpr; | |
| 104 | struct ZigClangArrayType; | |
| 105 | struct ZigClangAttributedType; | |
| 106 | struct ZigClangBinaryOperator; | |
| 107 | struct ZigClangBinaryConditionalOperator; | |
| 108 | struct ZigClangBreakStmt; | |
| 109 | struct ZigClangBuiltinType; | |
| 110 | struct ZigClangCStyleCastExpr; | |
| 111 | struct ZigClangCallExpr; | |
| 112 | struct ZigClangCaseStmt; | |
| 113 | struct ZigClangCastExpr; | |
| 114 | struct ZigClangCharacterLiteral; | |
| 115 | struct ZigClangChooseExpr; | |
| 116 | struct ZigClangCompoundAssignOperator; | |
| 117 | struct ZigClangCompoundStmt; | |
| 118 | struct ZigClangConditionalOperator; | |
| 119 | struct ZigClangConstantArrayType; | |
| 120 | struct ZigClangConstantExpr; | |
| 121 | struct ZigClangContinueStmt; | |
| 122 | struct ZigClangDecayedType; | |
| 123 | struct ZigClangDecl; | |
| 124 | struct ZigClangDeclRefExpr; | |
| 125 | struct ZigClangDeclStmt; | |
| 126 | struct ZigClangDefaultStmt; | |
| 127 | struct ZigClangDiagnosticOptions; | |
| 128 | struct ZigClangDiagnosticsEngine; | |
| 129 | struct ZigClangDoStmt; | |
| 130 | struct ZigClangElaboratedType; | |
| 131 | struct ZigClangEnumConstantDecl; | |
| 132 | struct ZigClangEnumDecl; | |
| 133 | struct ZigClangEnumType; | |
| 134 | struct ZigClangExpr; | |
| 135 | struct ZigClangFieldDecl; | |
| 136 | struct ZigClangFileID; | |
| 137 | struct ZigClangFileScopeAsmDecl; | |
| 138 | struct ZigClangFloatingLiteral; | |
| 139 | struct ZigClangForStmt; | |
| 140 | struct ZigClangFullSourceLoc; | |
| 141 | struct ZigClangFunctionDecl; | |
| 142 | struct ZigClangFunctionProtoType; | |
| 143 | struct ZigClangFunctionType; | |
| 144 | struct ZigClangIfStmt; | |
| 145 | struct ZigClangImplicitCastExpr; | |
| 146 | struct ZigClangIncompleteArrayType; | |
| 147 | struct ZigClangIntegerLiteral; | |
| 148 | struct ZigClangMacroDefinitionRecord; | |
| 149 | struct ZigClangMacroQualifiedType; | |
| 150 | struct ZigClangMemberExpr; | |
| 151 | struct ZigClangNamedDecl; | |
| 152 | struct ZigClangNone; | |
| 153 | struct ZigClangOpaqueValueExpr; | |
| 154 | struct ZigClangPCHContainerOperations; | |
| 155 | struct ZigClangParenExpr; | |
| 156 | struct ZigClangParenType; | |
| 157 | struct ZigClangParmVarDecl; | |
| 158 | struct ZigClangPointerType; | |
| 159 | struct ZigClangPredefinedExpr; | |
| 160 | struct ZigClangPreprocessedEntity; | |
| 161 | struct ZigClangPreprocessingRecord; | |
| 162 | struct ZigClangRecordDecl; | |
| 163 | struct ZigClangRecordType; | |
| 164 | struct ZigClangReturnStmt; | |
| 165 | struct ZigClangSkipFunctionBodiesScope; | |
| 166 | struct ZigClangSourceManager; | |
| 167 | struct ZigClangSourceRange; | |
| 168 | struct ZigClangStmt; | |
| 169 | struct ZigClangStmtExpr; | |
| 170 | struct ZigClangStringLiteral; | |
| 171 | struct ZigClangStringRef; | |
| 172 | struct ZigClangSwitchStmt; | |
| 173 | struct ZigClangTagDecl; | |
| 174 | struct ZigClangType; | |
| 175 | struct ZigClangTypedefNameDecl; | |
| 176 | struct ZigClangTypedefType; | |
| 177 | struct ZigClangUnaryExprOrTypeTraitExpr; | |
| 178 | struct ZigClangUnaryOperator; | |
| 179 | struct ZigClangValueDecl; | |
| 180 | struct ZigClangVarDecl; | |
| 181 | struct ZigClangWhileStmt; | |
| 182 | struct ZigClangInitListExpr; | |
| 183 | ||
| 184 | typedef struct ZigClangStmt *const * ZigClangCompoundStmt_const_body_iterator; | |
| 185 | typedef struct ZigClangDecl *const * ZigClangDeclStmt_const_decl_iterator; | |
| 186 | ||
| 187 | struct ZigClangRecordDecl_field_iterator { | |
| 188 | void *opaque; | |
| 189 | }; | |
| 190 | ||
| 191 | struct ZigClangEnumDecl_enumerator_iterator { | |
| 192 | void *opaque; | |
| 193 | }; | |
| 194 | ||
| 195 | struct ZigClangPreprocessingRecord_iterator { | |
| 196 | int I; | |
| 197 | struct ZigClangPreprocessingRecord *Self; | |
| 198 | }; | |
| 199 | ||
| 200 | enum ZigClangBO { | |
| 201 | ZigClangBO_PtrMemD, | |
| 202 | ZigClangBO_PtrMemI, | |
| 203 | ZigClangBO_Mul, | |
| 204 | ZigClangBO_Div, | |
| 205 | ZigClangBO_Rem, | |
| 206 | ZigClangBO_Add, | |
| 207 | ZigClangBO_Sub, | |
| 208 | ZigClangBO_Shl, | |
| 209 | ZigClangBO_Shr, | |
| 210 | ZigClangBO_Cmp, | |
| 211 | ZigClangBO_LT, | |
| 212 | ZigClangBO_GT, | |
| 213 | ZigClangBO_LE, | |
| 214 | ZigClangBO_GE, | |
| 215 | ZigClangBO_EQ, | |
| 216 | ZigClangBO_NE, | |
| 217 | ZigClangBO_And, | |
| 218 | ZigClangBO_Xor, | |
| 219 | ZigClangBO_Or, | |
| 220 | ZigClangBO_LAnd, | |
| 221 | ZigClangBO_LOr, | |
| 222 | ZigClangBO_Assign, | |
| 223 | ZigClangBO_MulAssign, | |
| 224 | ZigClangBO_DivAssign, | |
| 225 | ZigClangBO_RemAssign, | |
| 226 | ZigClangBO_AddAssign, | |
| 227 | ZigClangBO_SubAssign, | |
| 228 | ZigClangBO_ShlAssign, | |
| 229 | ZigClangBO_ShrAssign, | |
| 230 | ZigClangBO_AndAssign, | |
| 231 | ZigClangBO_XorAssign, | |
| 232 | ZigClangBO_OrAssign, | |
| 233 | ZigClangBO_Comma, | |
| 234 | }; | |
| 235 | ||
| 236 | enum ZigClangUO { | |
| 237 | ZigClangUO_PostInc, | |
| 238 | ZigClangUO_PostDec, | |
| 239 | ZigClangUO_PreInc, | |
| 240 | ZigClangUO_PreDec, | |
| 241 | ZigClangUO_AddrOf, | |
| 242 | ZigClangUO_Deref, | |
| 243 | ZigClangUO_Plus, | |
| 244 | ZigClangUO_Minus, | |
| 245 | ZigClangUO_Not, | |
| 246 | ZigClangUO_LNot, | |
| 247 | ZigClangUO_Real, | |
| 248 | ZigClangUO_Imag, | |
| 249 | ZigClangUO_Extension, | |
| 250 | ZigClangUO_Coawait, | |
| 251 | }; | |
| 252 | ||
| 253 | enum ZigClangTypeClass { | |
| 254 | ZigClangType_Adjusted, | |
| 255 | ZigClangType_Decayed, | |
| 256 | ZigClangType_ConstantArray, | |
| 257 | ZigClangType_ArrayParameter, | |
| 258 | ZigClangType_DependentSizedArray, | |
| 259 | ZigClangType_IncompleteArray, | |
| 260 | ZigClangType_VariableArray, | |
| 261 | ZigClangType_Atomic, | |
| 262 | ZigClangType_Attributed, | |
| 263 | ZigClangType_BTFTagAttributed, | |
| 264 | ZigClangType_BitInt, | |
| 265 | ZigClangType_BlockPointer, | |
| 266 | ZigClangType_CountAttributed, | |
| 267 | ZigClangType_Builtin, | |
| 268 | ZigClangType_Complex, | |
| 269 | ZigClangType_Decltype, | |
| 270 | ZigClangType_Auto, | |
| 271 | ZigClangType_DeducedTemplateSpecialization, | |
| 272 | ZigClangType_DependentAddressSpace, | |
| 273 | ZigClangType_DependentBitInt, | |
| 274 | ZigClangType_DependentName, | |
| 275 | ZigClangType_DependentSizedExtVector, | |
| 276 | ZigClangType_DependentTemplateSpecialization, | |
| 277 | ZigClangType_DependentVector, | |
| 278 | ZigClangType_Elaborated, | |
| 279 | ZigClangType_FunctionNoProto, | |
| 280 | ZigClangType_FunctionProto, | |
| 281 | ZigClangType_HLSLAttributedResource, | |
| 282 | ZigClangType_HLSLInlineSpirv, | |
| 283 | ZigClangType_InjectedClassName, | |
| 284 | ZigClangType_MacroQualified, | |
| 285 | ZigClangType_ConstantMatrix, | |
| 286 | ZigClangType_DependentSizedMatrix, | |
| 287 | ZigClangType_MemberPointer, | |
| 288 | ZigClangType_ObjCObjectPointer, | |
| 289 | ZigClangType_ObjCObject, | |
| 290 | ZigClangType_ObjCInterface, | |
| 291 | ZigClangType_ObjCTypeParam, | |
| 292 | ZigClangType_PackExpansion, | |
| 293 | ZigClangType_PackIndexing, | |
| 294 | ZigClangType_Paren, | |
| 295 | ZigClangType_Pipe, | |
| 296 | ZigClangType_Pointer, | |
| 297 | ZigClangType_LValueReference, | |
| 298 | ZigClangType_RValueReference, | |
| 299 | ZigClangType_SubstTemplateTypeParmPack, | |
| 300 | ZigClangType_SubstTemplateTypeParm, | |
| 301 | ZigClangType_Enum, | |
| 302 | ZigClangType_Record, | |
| 303 | ZigClangType_TemplateSpecialization, | |
| 304 | ZigClangType_TemplateTypeParm, | |
| 305 | ZigClangType_TypeOfExpr, | |
| 306 | ZigClangType_TypeOf, | |
| 307 | ZigClangType_Typedef, | |
| 308 | ZigClangType_UnaryTransform, | |
| 309 | ZigClangType_UnresolvedUsing, | |
| 310 | ZigClangType_Using, | |
| 311 | ZigClangType_Vector, | |
| 312 | ZigClangType_ExtVector, | |
| 313 | }; | |
| 314 | ||
| 315 | enum ZigClangStmtClass { | |
| 316 | ZigClangStmt_NoStmtClass, | |
| 317 | ZigClangStmt_WhileStmtClass, | |
| 318 | ZigClangStmt_LabelStmtClass, | |
| 319 | ZigClangStmt_VAArgExprClass, | |
| 320 | ZigClangStmt_UnaryOperatorClass, | |
| 321 | ZigClangStmt_UnaryExprOrTypeTraitExprClass, | |
| 322 | ZigClangStmt_TypeTraitExprClass, | |
| 323 | ZigClangStmt_SubstNonTypeTemplateParmPackExprClass, | |
| 324 | ZigClangStmt_SubstNonTypeTemplateParmExprClass, | |
| 325 | ZigClangStmt_StringLiteralClass, | |
| 326 | ZigClangStmt_StmtExprClass, | |
| 327 | ZigClangStmt_SourceLocExprClass, | |
| 328 | ZigClangStmt_SizeOfPackExprClass, | |
| 329 | ZigClangStmt_ShuffleVectorExprClass, | |
| 330 | ZigClangStmt_SYCLUniqueStableNameExprClass, | |
| 331 | ZigClangStmt_RequiresExprClass, | |
| 332 | ZigClangStmt_RecoveryExprClass, | |
| 333 | ZigClangStmt_PseudoObjectExprClass, | |
| 334 | ZigClangStmt_PredefinedExprClass, | |
| 335 | ZigClangStmt_ParenListExprClass, | |
| 336 | ZigClangStmt_ParenExprClass, | |
| 337 | ZigClangStmt_PackIndexingExprClass, | |
| 338 | ZigClangStmt_PackExpansionExprClass, | |
| 339 | ZigClangStmt_UnresolvedMemberExprClass, | |
| 340 | ZigClangStmt_UnresolvedLookupExprClass, | |
| 341 | ZigClangStmt_OpenACCAsteriskSizeExprClass, | |
| 342 | ZigClangStmt_OpaqueValueExprClass, | |
| 343 | ZigClangStmt_OffsetOfExprClass, | |
| 344 | ZigClangStmt_ObjCSubscriptRefExprClass, | |
| 345 | ZigClangStmt_ObjCStringLiteralClass, | |
| 346 | ZigClangStmt_ObjCSelectorExprClass, | |
| 347 | ZigClangStmt_ObjCProtocolExprClass, | |
| 348 | ZigClangStmt_ObjCPropertyRefExprClass, | |
| 349 | ZigClangStmt_ObjCMessageExprClass, | |
| 350 | ZigClangStmt_ObjCIvarRefExprClass, | |
| 351 | ZigClangStmt_ObjCIsaExprClass, | |
| 352 | ZigClangStmt_ObjCIndirectCopyRestoreExprClass, | |
| 353 | ZigClangStmt_ObjCEncodeExprClass, | |
| 354 | ZigClangStmt_ObjCDictionaryLiteralClass, | |
| 355 | ZigClangStmt_ObjCBoxedExprClass, | |
| 356 | ZigClangStmt_ObjCBoolLiteralExprClass, | |
| 357 | ZigClangStmt_ObjCAvailabilityCheckExprClass, | |
| 358 | ZigClangStmt_ObjCArrayLiteralClass, | |
| 359 | ZigClangStmt_OMPIteratorExprClass, | |
| 360 | ZigClangStmt_OMPArrayShapingExprClass, | |
| 361 | ZigClangStmt_NoInitExprClass, | |
| 362 | ZigClangStmt_MemberExprClass, | |
| 363 | ZigClangStmt_MatrixSubscriptExprClass, | |
| 364 | ZigClangStmt_MaterializeTemporaryExprClass, | |
| 365 | ZigClangStmt_MSPropertySubscriptExprClass, | |
| 366 | ZigClangStmt_MSPropertyRefExprClass, | |
| 367 | ZigClangStmt_LambdaExprClass, | |
| 368 | ZigClangStmt_IntegerLiteralClass, | |
| 369 | ZigClangStmt_InitListExprClass, | |
| 370 | ZigClangStmt_ImplicitValueInitExprClass, | |
| 371 | ZigClangStmt_ImaginaryLiteralClass, | |
| 372 | ZigClangStmt_HLSLOutArgExprClass, | |
| 373 | ZigClangStmt_GenericSelectionExprClass, | |
| 374 | ZigClangStmt_GNUNullExprClass, | |
| 375 | ZigClangStmt_FunctionParmPackExprClass, | |
| 376 | ZigClangStmt_ExprWithCleanupsClass, | |
| 377 | ZigClangStmt_ConstantExprClass, | |
| 378 | ZigClangStmt_FloatingLiteralClass, | |
| 379 | ZigClangStmt_FixedPointLiteralClass, | |
| 380 | ZigClangStmt_ExtVectorElementExprClass, | |
| 381 | ZigClangStmt_ExpressionTraitExprClass, | |
| 382 | ZigClangStmt_EmbedExprClass, | |
| 383 | ZigClangStmt_DesignatedInitUpdateExprClass, | |
| 384 | ZigClangStmt_DesignatedInitExprClass, | |
| 385 | ZigClangStmt_DependentScopeDeclRefExprClass, | |
| 386 | ZigClangStmt_DependentCoawaitExprClass, | |
| 387 | ZigClangStmt_DeclRefExprClass, | |
| 388 | ZigClangStmt_CoyieldExprClass, | |
| 389 | ZigClangStmt_CoawaitExprClass, | |
| 390 | ZigClangStmt_ConvertVectorExprClass, | |
| 391 | ZigClangStmt_ConceptSpecializationExprClass, | |
| 392 | ZigClangStmt_CompoundLiteralExprClass, | |
| 393 | ZigClangStmt_ChooseExprClass, | |
| 394 | ZigClangStmt_CharacterLiteralClass, | |
| 395 | ZigClangStmt_ImplicitCastExprClass, | |
| 396 | ZigClangStmt_ObjCBridgedCastExprClass, | |
| 397 | ZigClangStmt_CXXStaticCastExprClass, | |
| 398 | ZigClangStmt_CXXReinterpretCastExprClass, | |
| 399 | ZigClangStmt_CXXDynamicCastExprClass, | |
| 400 | ZigClangStmt_CXXConstCastExprClass, | |
| 401 | ZigClangStmt_CXXAddrspaceCastExprClass, | |
| 402 | ZigClangStmt_CXXFunctionalCastExprClass, | |
| 403 | ZigClangStmt_CStyleCastExprClass, | |
| 404 | ZigClangStmt_BuiltinBitCastExprClass, | |
| 405 | ZigClangStmt_CallExprClass, | |
| 406 | ZigClangStmt_UserDefinedLiteralClass, | |
| 407 | ZigClangStmt_CXXOperatorCallExprClass, | |
| 408 | ZigClangStmt_CXXMemberCallExprClass, | |
| 409 | ZigClangStmt_CUDAKernelCallExprClass, | |
| 410 | ZigClangStmt_CXXUuidofExprClass, | |
| 411 | ZigClangStmt_CXXUnresolvedConstructExprClass, | |
| 412 | ZigClangStmt_CXXTypeidExprClass, | |
| 413 | ZigClangStmt_CXXThrowExprClass, | |
| 414 | ZigClangStmt_CXXThisExprClass, | |
| 415 | ZigClangStmt_CXXStdInitializerListExprClass, | |
| 416 | ZigClangStmt_CXXScalarValueInitExprClass, | |
| 417 | ZigClangStmt_CXXRewrittenBinaryOperatorClass, | |
| 418 | ZigClangStmt_CXXPseudoDestructorExprClass, | |
| 419 | ZigClangStmt_CXXParenListInitExprClass, | |
| 420 | ZigClangStmt_CXXNullPtrLiteralExprClass, | |
| 421 | ZigClangStmt_CXXNoexceptExprClass, | |
| 422 | ZigClangStmt_CXXNewExprClass, | |
| 423 | ZigClangStmt_CXXInheritedCtorInitExprClass, | |
| 424 | ZigClangStmt_CXXFoldExprClass, | |
| 425 | ZigClangStmt_CXXDependentScopeMemberExprClass, | |
| 426 | ZigClangStmt_CXXDeleteExprClass, | |
| 427 | ZigClangStmt_CXXDefaultInitExprClass, | |
| 428 | ZigClangStmt_CXXDefaultArgExprClass, | |
| 429 | ZigClangStmt_CXXConstructExprClass, | |
| 430 | ZigClangStmt_CXXTemporaryObjectExprClass, | |
| 431 | ZigClangStmt_CXXBoolLiteralExprClass, | |
| 432 | ZigClangStmt_CXXBindTemporaryExprClass, | |
| 433 | ZigClangStmt_BlockExprClass, | |
| 434 | ZigClangStmt_BinaryOperatorClass, | |
| 435 | ZigClangStmt_CompoundAssignOperatorClass, | |
| 436 | ZigClangStmt_AtomicExprClass, | |
| 437 | ZigClangStmt_AsTypeExprClass, | |
| 438 | ZigClangStmt_ArrayTypeTraitExprClass, | |
| 439 | ZigClangStmt_ArraySubscriptExprClass, | |
| 440 | ZigClangStmt_ArraySectionExprClass, | |
| 441 | ZigClangStmt_ArrayInitLoopExprClass, | |
| 442 | ZigClangStmt_ArrayInitIndexExprClass, | |
| 443 | ZigClangStmt_AddrLabelExprClass, | |
| 444 | ZigClangStmt_ConditionalOperatorClass, | |
| 445 | ZigClangStmt_BinaryConditionalOperatorClass, | |
| 446 | ZigClangStmt_AttributedStmtClass, | |
| 447 | ZigClangStmt_SwitchStmtClass, | |
| 448 | ZigClangStmt_DefaultStmtClass, | |
| 449 | ZigClangStmt_CaseStmtClass, | |
| 450 | ZigClangStmt_SYCLKernelCallStmtClass, | |
| 451 | ZigClangStmt_SEHTryStmtClass, | |
| 452 | ZigClangStmt_SEHLeaveStmtClass, | |
| 453 | ZigClangStmt_SEHFinallyStmtClass, | |
| 454 | ZigClangStmt_SEHExceptStmtClass, | |
| 455 | ZigClangStmt_ReturnStmtClass, | |
| 456 | ZigClangStmt_OpenACCWaitConstructClass, | |
| 457 | ZigClangStmt_OpenACCUpdateConstructClass, | |
| 458 | ZigClangStmt_OpenACCShutdownConstructClass, | |
| 459 | ZigClangStmt_OpenACCSetConstructClass, | |
| 460 | ZigClangStmt_OpenACCInitConstructClass, | |
| 461 | ZigClangStmt_OpenACCExitDataConstructClass, | |
| 462 | ZigClangStmt_OpenACCEnterDataConstructClass, | |
| 463 | ZigClangStmt_OpenACCCacheConstructClass, | |
| 464 | ZigClangStmt_OpenACCLoopConstructClass, | |
| 465 | ZigClangStmt_OpenACCHostDataConstructClass, | |
| 466 | ZigClangStmt_OpenACCDataConstructClass, | |
| 467 | ZigClangStmt_OpenACCComputeConstructClass, | |
| 468 | ZigClangStmt_OpenACCCombinedConstructClass, | |
| 469 | ZigClangStmt_OpenACCAtomicConstructClass, | |
| 470 | ZigClangStmt_ObjCForCollectionStmtClass, | |
| 471 | ZigClangStmt_ObjCAutoreleasePoolStmtClass, | |
| 472 | ZigClangStmt_ObjCAtTryStmtClass, | |
| 473 | ZigClangStmt_ObjCAtThrowStmtClass, | |
| 474 | ZigClangStmt_ObjCAtSynchronizedStmtClass, | |
| 475 | ZigClangStmt_ObjCAtFinallyStmtClass, | |
| 476 | ZigClangStmt_ObjCAtCatchStmtClass, | |
| 477 | ZigClangStmt_OMPTeamsDirectiveClass, | |
| 478 | ZigClangStmt_OMPTaskyieldDirectiveClass, | |
| 479 | ZigClangStmt_OMPTaskwaitDirectiveClass, | |
| 480 | ZigClangStmt_OMPTaskgroupDirectiveClass, | |
| 481 | ZigClangStmt_OMPTaskDirectiveClass, | |
| 482 | ZigClangStmt_OMPTargetUpdateDirectiveClass, | |
| 483 | ZigClangStmt_OMPTargetTeamsDirectiveClass, | |
| 484 | ZigClangStmt_OMPTargetParallelForDirectiveClass, | |
| 485 | ZigClangStmt_OMPTargetParallelDirectiveClass, | |
| 486 | ZigClangStmt_OMPTargetExitDataDirectiveClass, | |
| 487 | ZigClangStmt_OMPTargetEnterDataDirectiveClass, | |
| 488 | ZigClangStmt_OMPTargetDirectiveClass, | |
| 489 | ZigClangStmt_OMPTargetDataDirectiveClass, | |
| 490 | ZigClangStmt_OMPSingleDirectiveClass, | |
| 491 | ZigClangStmt_OMPSectionsDirectiveClass, | |
| 492 | ZigClangStmt_OMPSectionDirectiveClass, | |
| 493 | ZigClangStmt_OMPScopeDirectiveClass, | |
| 494 | ZigClangStmt_OMPScanDirectiveClass, | |
| 495 | ZigClangStmt_OMPParallelSectionsDirectiveClass, | |
| 496 | ZigClangStmt_OMPParallelMasterDirectiveClass, | |
| 497 | ZigClangStmt_OMPParallelMaskedDirectiveClass, | |
| 498 | ZigClangStmt_OMPParallelDirectiveClass, | |
| 499 | ZigClangStmt_OMPOrderedDirectiveClass, | |
| 500 | ZigClangStmt_OMPMetaDirectiveClass, | |
| 501 | ZigClangStmt_OMPMasterDirectiveClass, | |
| 502 | ZigClangStmt_OMPMaskedDirectiveClass, | |
| 503 | ZigClangStmt_OMPUnrollDirectiveClass, | |
| 504 | ZigClangStmt_OMPTileDirectiveClass, | |
| 505 | ZigClangStmt_OMPStripeDirectiveClass, | |
| 506 | ZigClangStmt_OMPReverseDirectiveClass, | |
| 507 | ZigClangStmt_OMPInterchangeDirectiveClass, | |
| 508 | ZigClangStmt_OMPTeamsGenericLoopDirectiveClass, | |
| 509 | ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass, | |
| 510 | ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass, | |
| 511 | ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass, | |
| 512 | ZigClangStmt_OMPTeamsDistributeDirectiveClass, | |
| 513 | ZigClangStmt_OMPTaskLoopSimdDirectiveClass, | |
| 514 | ZigClangStmt_OMPTaskLoopDirectiveClass, | |
| 515 | ZigClangStmt_OMPTargetTeamsGenericLoopDirectiveClass, | |
| 516 | ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass, | |
| 517 | ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass, | |
| 518 | ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass, | |
| 519 | ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass, | |
| 520 | ZigClangStmt_OMPTargetSimdDirectiveClass, | |
| 521 | ZigClangStmt_OMPTargetParallelGenericLoopDirectiveClass, | |
| 522 | ZigClangStmt_OMPTargetParallelForSimdDirectiveClass, | |
| 523 | ZigClangStmt_OMPSimdDirectiveClass, | |
| 524 | ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass, | |
| 525 | ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass, | |
| 526 | ZigClangStmt_OMPParallelMaskedTaskLoopSimdDirectiveClass, | |
| 527 | ZigClangStmt_OMPParallelMaskedTaskLoopDirectiveClass, | |
| 528 | ZigClangStmt_OMPParallelGenericLoopDirectiveClass, | |
| 529 | ZigClangStmt_OMPParallelForSimdDirectiveClass, | |
| 530 | ZigClangStmt_OMPParallelForDirectiveClass, | |
| 531 | ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass, | |
| 532 | ZigClangStmt_OMPMasterTaskLoopDirectiveClass, | |
| 533 | ZigClangStmt_OMPMaskedTaskLoopSimdDirectiveClass, | |
| 534 | ZigClangStmt_OMPMaskedTaskLoopDirectiveClass, | |
| 535 | ZigClangStmt_OMPGenericLoopDirectiveClass, | |
| 536 | ZigClangStmt_OMPForSimdDirectiveClass, | |
| 537 | ZigClangStmt_OMPForDirectiveClass, | |
| 538 | ZigClangStmt_OMPDistributeSimdDirectiveClass, | |
| 539 | ZigClangStmt_OMPDistributeParallelForSimdDirectiveClass, | |
| 540 | ZigClangStmt_OMPDistributeParallelForDirectiveClass, | |
| 541 | ZigClangStmt_OMPDistributeDirectiveClass, | |
| 542 | ZigClangStmt_OMPInteropDirectiveClass, | |
| 543 | ZigClangStmt_OMPFlushDirectiveClass, | |
| 544 | ZigClangStmt_OMPErrorDirectiveClass, | |
| 545 | ZigClangStmt_OMPDispatchDirectiveClass, | |
| 546 | ZigClangStmt_OMPDepobjDirectiveClass, | |
| 547 | ZigClangStmt_OMPCriticalDirectiveClass, | |
| 548 | ZigClangStmt_OMPCancellationPointDirectiveClass, | |
| 549 | ZigClangStmt_OMPCancelDirectiveClass, | |
| 550 | ZigClangStmt_OMPBarrierDirectiveClass, | |
| 551 | ZigClangStmt_OMPAtomicDirectiveClass, | |
| 552 | ZigClangStmt_OMPAssumeDirectiveClass, | |
| 553 | ZigClangStmt_OMPCanonicalLoopClass, | |
| 554 | ZigClangStmt_NullStmtClass, | |
| 555 | ZigClangStmt_MSDependentExistsStmtClass, | |
| 556 | ZigClangStmt_IndirectGotoStmtClass, | |
| 557 | ZigClangStmt_IfStmtClass, | |
| 558 | ZigClangStmt_GotoStmtClass, | |
| 559 | ZigClangStmt_ForStmtClass, | |
| 560 | ZigClangStmt_DoStmtClass, | |
| 561 | ZigClangStmt_DeclStmtClass, | |
| 562 | ZigClangStmt_CoroutineBodyStmtClass, | |
| 563 | ZigClangStmt_CoreturnStmtClass, | |
| 564 | ZigClangStmt_ContinueStmtClass, | |
| 565 | ZigClangStmt_CompoundStmtClass, | |
| 566 | ZigClangStmt_CapturedStmtClass, | |
| 567 | ZigClangStmt_CXXTryStmtClass, | |
| 568 | ZigClangStmt_CXXForRangeStmtClass, | |
| 569 | ZigClangStmt_CXXCatchStmtClass, | |
| 570 | ZigClangStmt_BreakStmtClass, | |
| 571 | ZigClangStmt_MSAsmStmtClass, | |
| 572 | ZigClangStmt_GCCAsmStmtClass, | |
| 573 | }; | |
| 574 | ||
| 575 | enum ZigClangCK { | |
| 576 | ZigClangCK_Dependent, | |
| 577 | ZigClangCK_BitCast, | |
| 578 | ZigClangCK_LValueBitCast, | |
| 579 | ZigClangCK_LValueToRValueBitCast, | |
| 580 | ZigClangCK_LValueToRValue, | |
| 581 | ZigClangCK_NoOp, | |
| 582 | ZigClangCK_BaseToDerived, | |
| 583 | ZigClangCK_DerivedToBase, | |
| 584 | ZigClangCK_UncheckedDerivedToBase, | |
| 585 | ZigClangCK_Dynamic, | |
| 586 | ZigClangCK_ToUnion, | |
| 587 | ZigClangCK_ArrayToPointerDecay, | |
| 588 | ZigClangCK_FunctionToPointerDecay, | |
| 589 | ZigClangCK_NullToPointer, | |
| 590 | ZigClangCK_NullToMemberPointer, | |
| 591 | ZigClangCK_BaseToDerivedMemberPointer, | |
| 592 | ZigClangCK_DerivedToBaseMemberPointer, | |
| 593 | ZigClangCK_MemberPointerToBoolean, | |
| 594 | ZigClangCK_ReinterpretMemberPointer, | |
| 595 | ZigClangCK_UserDefinedConversion, | |
| 596 | ZigClangCK_ConstructorConversion, | |
| 597 | ZigClangCK_IntegralToPointer, | |
| 598 | ZigClangCK_PointerToIntegral, | |
| 599 | ZigClangCK_PointerToBoolean, | |
| 600 | ZigClangCK_ToVoid, | |
| 601 | ZigClangCK_MatrixCast, | |
| 602 | ZigClangCK_VectorSplat, | |
| 603 | ZigClangCK_IntegralCast, | |
| 604 | ZigClangCK_IntegralToBoolean, | |
| 605 | ZigClangCK_IntegralToFloating, | |
| 606 | ZigClangCK_FloatingToFixedPoint, | |
| 607 | ZigClangCK_FixedPointToFloating, | |
| 608 | ZigClangCK_FixedPointCast, | |
| 609 | ZigClangCK_FixedPointToIntegral, | |
| 610 | ZigClangCK_IntegralToFixedPoint, | |
| 611 | ZigClangCK_FixedPointToBoolean, | |
| 612 | ZigClangCK_FloatingToIntegral, | |
| 613 | ZigClangCK_FloatingToBoolean, | |
| 614 | ZigClangCK_BooleanToSignedIntegral, | |
| 615 | ZigClangCK_FloatingCast, | |
| 616 | ZigClangCK_CPointerToObjCPointerCast, | |
| 617 | ZigClangCK_BlockPointerToObjCPointerCast, | |
| 618 | ZigClangCK_AnyPointerToBlockPointerCast, | |
| 619 | ZigClangCK_ObjCObjectLValueCast, | |
| 620 | ZigClangCK_FloatingRealToComplex, | |
| 621 | ZigClangCK_FloatingComplexToReal, | |
| 622 | ZigClangCK_FloatingComplexToBoolean, | |
| 623 | ZigClangCK_FloatingComplexCast, | |
| 624 | ZigClangCK_FloatingComplexToIntegralComplex, | |
| 625 | ZigClangCK_IntegralRealToComplex, | |
| 626 | ZigClangCK_IntegralComplexToReal, | |
| 627 | ZigClangCK_IntegralComplexToBoolean, | |
| 628 | ZigClangCK_IntegralComplexCast, | |
| 629 | ZigClangCK_IntegralComplexToFloatingComplex, | |
| 630 | ZigClangCK_ARCProduceObject, | |
| 631 | ZigClangCK_ARCConsumeObject, | |
| 632 | ZigClangCK_ARCReclaimReturnedObject, | |
| 633 | ZigClangCK_ARCExtendBlockObject, | |
| 634 | ZigClangCK_AtomicToNonAtomic, | |
| 635 | ZigClangCK_NonAtomicToAtomic, | |
| 636 | ZigClangCK_CopyAndAutoreleaseBlockObject, | |
| 637 | ZigClangCK_BuiltinFnToFnPtr, | |
| 638 | ZigClangCK_ZeroToOCLOpaqueType, | |
| 639 | ZigClangCK_AddressSpaceConversion, | |
| 640 | ZigClangCK_IntToOCLSampler, | |
| 641 | }; | |
| 642 | ||
| 643 | enum ZigClangDeclKind { | |
| 644 | ZigClangDeclTranslationUnit, | |
| 645 | ZigClangDeclTopLevelStmt, | |
| 646 | ZigClangDeclRequiresExprBody, | |
| 647 | ZigClangDeclOutlinedFunction, | |
| 648 | ZigClangDeclLinkageSpec, | |
| 649 | ZigClangDeclExternCContext, | |
| 650 | ZigClangDeclExport, | |
| 651 | ZigClangDeclCaptured, | |
| 652 | ZigClangDeclBlock, | |
| 653 | ZigClangDeclStaticAssert, | |
| 654 | ZigClangDeclPragmaDetectMismatch, | |
| 655 | ZigClangDeclPragmaComment, | |
| 656 | ZigClangDeclOpenACCRoutine, | |
| 657 | ZigClangDeclOpenACCDeclare, | |
| 658 | ZigClangDeclObjCPropertyImpl, | |
| 659 | ZigClangDeclOMPThreadPrivate, | |
| 660 | ZigClangDeclOMPRequires, | |
| 661 | ZigClangDeclOMPAllocate, | |
| 662 | ZigClangDeclObjCMethod, | |
| 663 | ZigClangDeclObjCProtocol, | |
| 664 | ZigClangDeclObjCInterface, | |
| 665 | ZigClangDeclObjCImplementation, | |
| 666 | ZigClangDeclObjCCategoryImpl, | |
| 667 | ZigClangDeclObjCCategory, | |
| 668 | ZigClangDeclNamespace, | |
| 669 | ZigClangDeclHLSLBuffer, | |
| 670 | ZigClangDeclOMPDeclareReduction, | |
| 671 | ZigClangDeclOMPDeclareMapper, | |
| 672 | ZigClangDeclUnresolvedUsingValue, | |
| 673 | ZigClangDeclUnnamedGlobalConstant, | |
| 674 | ZigClangDeclTemplateParamObject, | |
| 675 | ZigClangDeclMSGuid, | |
| 676 | ZigClangDeclIndirectField, | |
| 677 | ZigClangDeclEnumConstant, | |
| 678 | ZigClangDeclFunction, | |
| 679 | ZigClangDeclCXXMethod, | |
| 680 | ZigClangDeclCXXDestructor, | |
| 681 | ZigClangDeclCXXConversion, | |
| 682 | ZigClangDeclCXXConstructor, | |
| 683 | ZigClangDeclCXXDeductionGuide, | |
| 684 | ZigClangDeclVar, | |
| 685 | ZigClangDeclVarTemplateSpecialization, | |
| 686 | ZigClangDeclVarTemplatePartialSpecialization, | |
| 687 | ZigClangDeclParmVar, | |
| 688 | ZigClangDeclOMPCapturedExpr, | |
| 689 | ZigClangDeclImplicitParam, | |
| 690 | ZigClangDeclDecomposition, | |
| 691 | ZigClangDeclNonTypeTemplateParm, | |
| 692 | ZigClangDeclMSProperty, | |
| 693 | ZigClangDeclField, | |
| 694 | ZigClangDeclObjCIvar, | |
| 695 | ZigClangDeclObjCAtDefsField, | |
| 696 | ZigClangDeclBinding, | |
| 697 | ZigClangDeclUsingShadow, | |
| 698 | ZigClangDeclConstructorUsingShadow, | |
| 699 | ZigClangDeclUsingPack, | |
| 700 | ZigClangDeclUsingDirective, | |
| 701 | ZigClangDeclUnresolvedUsingIfExists, | |
| 702 | ZigClangDeclRecord, | |
| 703 | ZigClangDeclCXXRecord, | |
| 704 | ZigClangDeclClassTemplateSpecialization, | |
| 705 | ZigClangDeclClassTemplatePartialSpecialization, | |
| 706 | ZigClangDeclEnum, | |
| 707 | ZigClangDeclUnresolvedUsingTypename, | |
| 708 | ZigClangDeclTypedef, | |
| 709 | ZigClangDeclTypeAlias, | |
| 710 | ZigClangDeclObjCTypeParam, | |
| 711 | ZigClangDeclTemplateTypeParm, | |
| 712 | ZigClangDeclTemplateTemplateParm, | |
| 713 | ZigClangDeclVarTemplate, | |
| 714 | ZigClangDeclTypeAliasTemplate, | |
| 715 | ZigClangDeclFunctionTemplate, | |
| 716 | ZigClangDeclClassTemplate, | |
| 717 | ZigClangDeclConcept, | |
| 718 | ZigClangDeclBuiltinTemplate, | |
| 719 | ZigClangDeclObjCProperty, | |
| 720 | ZigClangDeclObjCCompatibleAlias, | |
| 721 | ZigClangDeclNamespaceAlias, | |
| 722 | ZigClangDeclLabel, | |
| 723 | ZigClangDeclHLSLRootSignature, | |
| 724 | ZigClangDeclUsingEnum, | |
| 725 | ZigClangDeclUsing, | |
| 726 | ZigClangDeclLifetimeExtendedTemporary, | |
| 727 | ZigClangDeclImport, | |
| 728 | ZigClangDeclImplicitConceptSpecialization, | |
| 729 | ZigClangDeclFriendTemplate, | |
| 730 | ZigClangDeclFriend, | |
| 731 | ZigClangDeclFileScopeAsm, | |
| 732 | ZigClangDeclEmpty, | |
| 733 | ZigClangDeclAccessSpec, | |
| 734 | }; | |
| 735 | ||
| 736 | enum ZigClangBuiltinTypeKind { | |
| 737 | ZigClangBuiltinTypeOCLImage1dRO, | |
| 738 | ZigClangBuiltinTypeOCLImage1dArrayRO, | |
| 739 | ZigClangBuiltinTypeOCLImage1dBufferRO, | |
| 740 | ZigClangBuiltinTypeOCLImage2dRO, | |
| 741 | ZigClangBuiltinTypeOCLImage2dArrayRO, | |
| 742 | ZigClangBuiltinTypeOCLImage2dDepthRO, | |
| 743 | ZigClangBuiltinTypeOCLImage2dArrayDepthRO, | |
| 744 | ZigClangBuiltinTypeOCLImage2dMSAARO, | |
| 745 | ZigClangBuiltinTypeOCLImage2dArrayMSAARO, | |
| 746 | ZigClangBuiltinTypeOCLImage2dMSAADepthRO, | |
| 747 | ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRO, | |
| 748 | ZigClangBuiltinTypeOCLImage3dRO, | |
| 749 | ZigClangBuiltinTypeOCLImage1dWO, | |
| 750 | ZigClangBuiltinTypeOCLImage1dArrayWO, | |
| 751 | ZigClangBuiltinTypeOCLImage1dBufferWO, | |
| 752 | ZigClangBuiltinTypeOCLImage2dWO, | |
| 753 | ZigClangBuiltinTypeOCLImage2dArrayWO, | |
| 754 | ZigClangBuiltinTypeOCLImage2dDepthWO, | |
| 755 | ZigClangBuiltinTypeOCLImage2dArrayDepthWO, | |
| 756 | ZigClangBuiltinTypeOCLImage2dMSAAWO, | |
| 757 | ZigClangBuiltinTypeOCLImage2dArrayMSAAWO, | |
| 758 | ZigClangBuiltinTypeOCLImage2dMSAADepthWO, | |
| 759 | ZigClangBuiltinTypeOCLImage2dArrayMSAADepthWO, | |
| 760 | ZigClangBuiltinTypeOCLImage3dWO, | |
| 761 | ZigClangBuiltinTypeOCLImage1dRW, | |
| 762 | ZigClangBuiltinTypeOCLImage1dArrayRW, | |
| 763 | ZigClangBuiltinTypeOCLImage1dBufferRW, | |
| 764 | ZigClangBuiltinTypeOCLImage2dRW, | |
| 765 | ZigClangBuiltinTypeOCLImage2dArrayRW, | |
| 766 | ZigClangBuiltinTypeOCLImage2dDepthRW, | |
| 767 | ZigClangBuiltinTypeOCLImage2dArrayDepthRW, | |
| 768 | ZigClangBuiltinTypeOCLImage2dMSAARW, | |
| 769 | ZigClangBuiltinTypeOCLImage2dArrayMSAARW, | |
| 770 | ZigClangBuiltinTypeOCLImage2dMSAADepthRW, | |
| 771 | ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRW, | |
| 772 | ZigClangBuiltinTypeOCLImage3dRW, | |
| 773 | ZigClangBuiltinTypeOCLIntelSubgroupAVCMcePayload, | |
| 774 | ZigClangBuiltinTypeOCLIntelSubgroupAVCImePayload, | |
| 775 | ZigClangBuiltinTypeOCLIntelSubgroupAVCRefPayload, | |
| 776 | ZigClangBuiltinTypeOCLIntelSubgroupAVCSicPayload, | |
| 777 | ZigClangBuiltinTypeOCLIntelSubgroupAVCMceResult, | |
| 778 | ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResult, | |
| 779 | ZigClangBuiltinTypeOCLIntelSubgroupAVCRefResult, | |
| 780 | ZigClangBuiltinTypeOCLIntelSubgroupAVCSicResult, | |
| 781 | ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultSingleReferenceStreamout, | |
| 782 | ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultDualReferenceStreamout, | |
| 783 | ZigClangBuiltinTypeOCLIntelSubgroupAVCImeSingleReferenceStreamin, | |
| 784 | ZigClangBuiltinTypeOCLIntelSubgroupAVCImeDualReferenceStreamin, | |
| 785 | ZigClangBuiltinTypeSveInt8, | |
| 786 | ZigClangBuiltinTypeSveInt16, | |
| 787 | ZigClangBuiltinTypeSveInt32, | |
| 788 | ZigClangBuiltinTypeSveInt64, | |
| 789 | ZigClangBuiltinTypeSveUint8, | |
| 790 | ZigClangBuiltinTypeSveUint16, | |
| 791 | ZigClangBuiltinTypeSveUint32, | |
| 792 | ZigClangBuiltinTypeSveUint64, | |
| 793 | ZigClangBuiltinTypeSveFloat16, | |
| 794 | ZigClangBuiltinTypeSveFloat32, | |
| 795 | ZigClangBuiltinTypeSveFloat64, | |
| 796 | ZigClangBuiltinTypeSveBFloat16, | |
| 797 | ZigClangBuiltinTypeSveMFloat8, | |
| 798 | ZigClangBuiltinTypeSveInt8x2, | |
| 799 | ZigClangBuiltinTypeSveInt16x2, | |
| 800 | ZigClangBuiltinTypeSveInt32x2, | |
| 801 | ZigClangBuiltinTypeSveInt64x2, | |
| 802 | ZigClangBuiltinTypeSveUint8x2, | |
| 803 | ZigClangBuiltinTypeSveUint16x2, | |
| 804 | ZigClangBuiltinTypeSveUint32x2, | |
| 805 | ZigClangBuiltinTypeSveUint64x2, | |
| 806 | ZigClangBuiltinTypeSveFloat16x2, | |
| 807 | ZigClangBuiltinTypeSveFloat32x2, | |
| 808 | ZigClangBuiltinTypeSveFloat64x2, | |
| 809 | ZigClangBuiltinTypeSveBFloat16x2, | |
| 810 | ZigClangBuiltinTypeSveMFloat8x2, | |
| 811 | ZigClangBuiltinTypeSveInt8x3, | |
| 812 | ZigClangBuiltinTypeSveInt16x3, | |
| 813 | ZigClangBuiltinTypeSveInt32x3, | |
| 814 | ZigClangBuiltinTypeSveInt64x3, | |
| 815 | ZigClangBuiltinTypeSveUint8x3, | |
| 816 | ZigClangBuiltinTypeSveUint16x3, | |
| 817 | ZigClangBuiltinTypeSveUint32x3, | |
| 818 | ZigClangBuiltinTypeSveUint64x3, | |
| 819 | ZigClangBuiltinTypeSveFloat16x3, | |
| 820 | ZigClangBuiltinTypeSveFloat32x3, | |
| 821 | ZigClangBuiltinTypeSveFloat64x3, | |
| 822 | ZigClangBuiltinTypeSveBFloat16x3, | |
| 823 | ZigClangBuiltinTypeSveMFloat8x3, | |
| 824 | ZigClangBuiltinTypeSveInt8x4, | |
| 825 | ZigClangBuiltinTypeSveInt16x4, | |
| 826 | ZigClangBuiltinTypeSveInt32x4, | |
| 827 | ZigClangBuiltinTypeSveInt64x4, | |
| 828 | ZigClangBuiltinTypeSveUint8x4, | |
| 829 | ZigClangBuiltinTypeSveUint16x4, | |
| 830 | ZigClangBuiltinTypeSveUint32x4, | |
| 831 | ZigClangBuiltinTypeSveUint64x4, | |
| 832 | ZigClangBuiltinTypeSveFloat16x4, | |
| 833 | ZigClangBuiltinTypeSveFloat32x4, | |
| 834 | ZigClangBuiltinTypeSveFloat64x4, | |
| 835 | ZigClangBuiltinTypeSveBFloat16x4, | |
| 836 | ZigClangBuiltinTypeSveMFloat8x4, | |
| 837 | ZigClangBuiltinTypeSveBool, | |
| 838 | ZigClangBuiltinTypeSveBoolx2, | |
| 839 | ZigClangBuiltinTypeSveBoolx4, | |
| 840 | ZigClangBuiltinTypeSveCount, | |
| 841 | ZigClangBuiltinTypeMFloat8, | |
| 842 | ZigClangBuiltinTypeDMR1024, | |
| 843 | ZigClangBuiltinTypeVectorQuad, | |
| 844 | ZigClangBuiltinTypeVectorPair, | |
| 845 | ZigClangBuiltinTypeRvvInt8mf8, | |
| 846 | ZigClangBuiltinTypeRvvInt8mf4, | |
| 847 | ZigClangBuiltinTypeRvvInt8mf2, | |
| 848 | ZigClangBuiltinTypeRvvInt8m1, | |
| 849 | ZigClangBuiltinTypeRvvInt8m2, | |
| 850 | ZigClangBuiltinTypeRvvInt8m4, | |
| 851 | ZigClangBuiltinTypeRvvInt8m8, | |
| 852 | ZigClangBuiltinTypeRvvUint8mf8, | |
| 853 | ZigClangBuiltinTypeRvvUint8mf4, | |
| 854 | ZigClangBuiltinTypeRvvUint8mf2, | |
| 855 | ZigClangBuiltinTypeRvvUint8m1, | |
| 856 | ZigClangBuiltinTypeRvvUint8m2, | |
| 857 | ZigClangBuiltinTypeRvvUint8m4, | |
| 858 | ZigClangBuiltinTypeRvvUint8m8, | |
| 859 | ZigClangBuiltinTypeRvvInt16mf4, | |
| 860 | ZigClangBuiltinTypeRvvInt16mf2, | |
| 861 | ZigClangBuiltinTypeRvvInt16m1, | |
| 862 | ZigClangBuiltinTypeRvvInt16m2, | |
| 863 | ZigClangBuiltinTypeRvvInt16m4, | |
| 864 | ZigClangBuiltinTypeRvvInt16m8, | |
| 865 | ZigClangBuiltinTypeRvvUint16mf4, | |
| 866 | ZigClangBuiltinTypeRvvUint16mf2, | |
| 867 | ZigClangBuiltinTypeRvvUint16m1, | |
| 868 | ZigClangBuiltinTypeRvvUint16m2, | |
| 869 | ZigClangBuiltinTypeRvvUint16m4, | |
| 870 | ZigClangBuiltinTypeRvvUint16m8, | |
| 871 | ZigClangBuiltinTypeRvvInt32mf2, | |
| 872 | ZigClangBuiltinTypeRvvInt32m1, | |
| 873 | ZigClangBuiltinTypeRvvInt32m2, | |
| 874 | ZigClangBuiltinTypeRvvInt32m4, | |
| 875 | ZigClangBuiltinTypeRvvInt32m8, | |
| 876 | ZigClangBuiltinTypeRvvUint32mf2, | |
| 877 | ZigClangBuiltinTypeRvvUint32m1, | |
| 878 | ZigClangBuiltinTypeRvvUint32m2, | |
| 879 | ZigClangBuiltinTypeRvvUint32m4, | |
| 880 | ZigClangBuiltinTypeRvvUint32m8, | |
| 881 | ZigClangBuiltinTypeRvvInt64m1, | |
| 882 | ZigClangBuiltinTypeRvvInt64m2, | |
| 883 | ZigClangBuiltinTypeRvvInt64m4, | |
| 884 | ZigClangBuiltinTypeRvvInt64m8, | |
| 885 | ZigClangBuiltinTypeRvvUint64m1, | |
| 886 | ZigClangBuiltinTypeRvvUint64m2, | |
| 887 | ZigClangBuiltinTypeRvvUint64m4, | |
| 888 | ZigClangBuiltinTypeRvvUint64m8, | |
| 889 | ZigClangBuiltinTypeRvvFloat16mf4, | |
| 890 | ZigClangBuiltinTypeRvvFloat16mf2, | |
| 891 | ZigClangBuiltinTypeRvvFloat16m1, | |
| 892 | ZigClangBuiltinTypeRvvFloat16m2, | |
| 893 | ZigClangBuiltinTypeRvvFloat16m4, | |
| 894 | ZigClangBuiltinTypeRvvFloat16m8, | |
| 895 | ZigClangBuiltinTypeRvvBFloat16mf4, | |
| 896 | ZigClangBuiltinTypeRvvBFloat16mf2, | |
| 897 | ZigClangBuiltinTypeRvvBFloat16m1, | |
| 898 | ZigClangBuiltinTypeRvvBFloat16m2, | |
| 899 | ZigClangBuiltinTypeRvvBFloat16m4, | |
| 900 | ZigClangBuiltinTypeRvvBFloat16m8, | |
| 901 | ZigClangBuiltinTypeRvvFloat32mf2, | |
| 902 | ZigClangBuiltinTypeRvvFloat32m1, | |
| 903 | ZigClangBuiltinTypeRvvFloat32m2, | |
| 904 | ZigClangBuiltinTypeRvvFloat32m4, | |
| 905 | ZigClangBuiltinTypeRvvFloat32m8, | |
| 906 | ZigClangBuiltinTypeRvvFloat64m1, | |
| 907 | ZigClangBuiltinTypeRvvFloat64m2, | |
| 908 | ZigClangBuiltinTypeRvvFloat64m4, | |
| 909 | ZigClangBuiltinTypeRvvFloat64m8, | |
| 910 | ZigClangBuiltinTypeRvvBool1, | |
| 911 | ZigClangBuiltinTypeRvvBool2, | |
| 912 | ZigClangBuiltinTypeRvvBool4, | |
| 913 | ZigClangBuiltinTypeRvvBool8, | |
| 914 | ZigClangBuiltinTypeRvvBool16, | |
| 915 | ZigClangBuiltinTypeRvvBool32, | |
| 916 | ZigClangBuiltinTypeRvvBool64, | |
| 917 | ZigClangBuiltinTypeRvvInt8mf8x2, | |
| 918 | ZigClangBuiltinTypeRvvInt8mf8x3, | |
| 919 | ZigClangBuiltinTypeRvvInt8mf8x4, | |
| 920 | ZigClangBuiltinTypeRvvInt8mf8x5, | |
| 921 | ZigClangBuiltinTypeRvvInt8mf8x6, | |
| 922 | ZigClangBuiltinTypeRvvInt8mf8x7, | |
| 923 | ZigClangBuiltinTypeRvvInt8mf8x8, | |
| 924 | ZigClangBuiltinTypeRvvInt8mf4x2, | |
| 925 | ZigClangBuiltinTypeRvvInt8mf4x3, | |
| 926 | ZigClangBuiltinTypeRvvInt8mf4x4, | |
| 927 | ZigClangBuiltinTypeRvvInt8mf4x5, | |
| 928 | ZigClangBuiltinTypeRvvInt8mf4x6, | |
| 929 | ZigClangBuiltinTypeRvvInt8mf4x7, | |
| 930 | ZigClangBuiltinTypeRvvInt8mf4x8, | |
| 931 | ZigClangBuiltinTypeRvvInt8mf2x2, | |
| 932 | ZigClangBuiltinTypeRvvInt8mf2x3, | |
| 933 | ZigClangBuiltinTypeRvvInt8mf2x4, | |
| 934 | ZigClangBuiltinTypeRvvInt8mf2x5, | |
| 935 | ZigClangBuiltinTypeRvvInt8mf2x6, | |
| 936 | ZigClangBuiltinTypeRvvInt8mf2x7, | |
| 937 | ZigClangBuiltinTypeRvvInt8mf2x8, | |
| 938 | ZigClangBuiltinTypeRvvInt8m1x2, | |
| 939 | ZigClangBuiltinTypeRvvInt8m1x3, | |
| 940 | ZigClangBuiltinTypeRvvInt8m1x4, | |
| 941 | ZigClangBuiltinTypeRvvInt8m1x5, | |
| 942 | ZigClangBuiltinTypeRvvInt8m1x6, | |
| 943 | ZigClangBuiltinTypeRvvInt8m1x7, | |
| 944 | ZigClangBuiltinTypeRvvInt8m1x8, | |
| 945 | ZigClangBuiltinTypeRvvInt8m2x2, | |
| 946 | ZigClangBuiltinTypeRvvInt8m2x3, | |
| 947 | ZigClangBuiltinTypeRvvInt8m2x4, | |
| 948 | ZigClangBuiltinTypeRvvInt8m4x2, | |
| 949 | ZigClangBuiltinTypeRvvUint8mf8x2, | |
| 950 | ZigClangBuiltinTypeRvvUint8mf8x3, | |
| 951 | ZigClangBuiltinTypeRvvUint8mf8x4, | |
| 952 | ZigClangBuiltinTypeRvvUint8mf8x5, | |
| 953 | ZigClangBuiltinTypeRvvUint8mf8x6, | |
| 954 | ZigClangBuiltinTypeRvvUint8mf8x7, | |
| 955 | ZigClangBuiltinTypeRvvUint8mf8x8, | |
| 956 | ZigClangBuiltinTypeRvvUint8mf4x2, | |
| 957 | ZigClangBuiltinTypeRvvUint8mf4x3, | |
| 958 | ZigClangBuiltinTypeRvvUint8mf4x4, | |
| 959 | ZigClangBuiltinTypeRvvUint8mf4x5, | |
| 960 | ZigClangBuiltinTypeRvvUint8mf4x6, | |
| 961 | ZigClangBuiltinTypeRvvUint8mf4x7, | |
| 962 | ZigClangBuiltinTypeRvvUint8mf4x8, | |
| 963 | ZigClangBuiltinTypeRvvUint8mf2x2, | |
| 964 | ZigClangBuiltinTypeRvvUint8mf2x3, | |
| 965 | ZigClangBuiltinTypeRvvUint8mf2x4, | |
| 966 | ZigClangBuiltinTypeRvvUint8mf2x5, | |
| 967 | ZigClangBuiltinTypeRvvUint8mf2x6, | |
| 968 | ZigClangBuiltinTypeRvvUint8mf2x7, | |
| 969 | ZigClangBuiltinTypeRvvUint8mf2x8, | |
| 970 | ZigClangBuiltinTypeRvvUint8m1x2, | |
| 971 | ZigClangBuiltinTypeRvvUint8m1x3, | |
| 972 | ZigClangBuiltinTypeRvvUint8m1x4, | |
| 973 | ZigClangBuiltinTypeRvvUint8m1x5, | |
| 974 | ZigClangBuiltinTypeRvvUint8m1x6, | |
| 975 | ZigClangBuiltinTypeRvvUint8m1x7, | |
| 976 | ZigClangBuiltinTypeRvvUint8m1x8, | |
| 977 | ZigClangBuiltinTypeRvvUint8m2x2, | |
| 978 | ZigClangBuiltinTypeRvvUint8m2x3, | |
| 979 | ZigClangBuiltinTypeRvvUint8m2x4, | |
| 980 | ZigClangBuiltinTypeRvvUint8m4x2, | |
| 981 | ZigClangBuiltinTypeRvvInt16mf4x2, | |
| 982 | ZigClangBuiltinTypeRvvInt16mf4x3, | |
| 983 | ZigClangBuiltinTypeRvvInt16mf4x4, | |
| 984 | ZigClangBuiltinTypeRvvInt16mf4x5, | |
| 985 | ZigClangBuiltinTypeRvvInt16mf4x6, | |
| 986 | ZigClangBuiltinTypeRvvInt16mf4x7, | |
| 987 | ZigClangBuiltinTypeRvvInt16mf4x8, | |
| 988 | ZigClangBuiltinTypeRvvInt16mf2x2, | |
| 989 | ZigClangBuiltinTypeRvvInt16mf2x3, | |
| 990 | ZigClangBuiltinTypeRvvInt16mf2x4, | |
| 991 | ZigClangBuiltinTypeRvvInt16mf2x5, | |
| 992 | ZigClangBuiltinTypeRvvInt16mf2x6, | |
| 993 | ZigClangBuiltinTypeRvvInt16mf2x7, | |
| 994 | ZigClangBuiltinTypeRvvInt16mf2x8, | |
| 995 | ZigClangBuiltinTypeRvvInt16m1x2, | |
| 996 | ZigClangBuiltinTypeRvvInt16m1x3, | |
| 997 | ZigClangBuiltinTypeRvvInt16m1x4, | |
| 998 | ZigClangBuiltinTypeRvvInt16m1x5, | |
| 999 | ZigClangBuiltinTypeRvvInt16m1x6, | |
| 1000 | ZigClangBuiltinTypeRvvInt16m1x7, | |
| 1001 | ZigClangBuiltinTypeRvvInt16m1x8, | |
| 1002 | ZigClangBuiltinTypeRvvInt16m2x2, | |
| 1003 | ZigClangBuiltinTypeRvvInt16m2x3, | |
| 1004 | ZigClangBuiltinTypeRvvInt16m2x4, | |
| 1005 | ZigClangBuiltinTypeRvvInt16m4x2, | |
| 1006 | ZigClangBuiltinTypeRvvUint16mf4x2, | |
| 1007 | ZigClangBuiltinTypeRvvUint16mf4x3, | |
| 1008 | ZigClangBuiltinTypeRvvUint16mf4x4, | |
| 1009 | ZigClangBuiltinTypeRvvUint16mf4x5, | |
| 1010 | ZigClangBuiltinTypeRvvUint16mf4x6, | |
| 1011 | ZigClangBuiltinTypeRvvUint16mf4x7, | |
| 1012 | ZigClangBuiltinTypeRvvUint16mf4x8, | |
| 1013 | ZigClangBuiltinTypeRvvUint16mf2x2, | |
| 1014 | ZigClangBuiltinTypeRvvUint16mf2x3, | |
| 1015 | ZigClangBuiltinTypeRvvUint16mf2x4, | |
| 1016 | ZigClangBuiltinTypeRvvUint16mf2x5, | |
| 1017 | ZigClangBuiltinTypeRvvUint16mf2x6, | |
| 1018 | ZigClangBuiltinTypeRvvUint16mf2x7, | |
| 1019 | ZigClangBuiltinTypeRvvUint16mf2x8, | |
| 1020 | ZigClangBuiltinTypeRvvUint16m1x2, | |
| 1021 | ZigClangBuiltinTypeRvvUint16m1x3, | |
| 1022 | ZigClangBuiltinTypeRvvUint16m1x4, | |
| 1023 | ZigClangBuiltinTypeRvvUint16m1x5, | |
| 1024 | ZigClangBuiltinTypeRvvUint16m1x6, | |
| 1025 | ZigClangBuiltinTypeRvvUint16m1x7, | |
| 1026 | ZigClangBuiltinTypeRvvUint16m1x8, | |
| 1027 | ZigClangBuiltinTypeRvvUint16m2x2, | |
| 1028 | ZigClangBuiltinTypeRvvUint16m2x3, | |
| 1029 | ZigClangBuiltinTypeRvvUint16m2x4, | |
| 1030 | ZigClangBuiltinTypeRvvUint16m4x2, | |
| 1031 | ZigClangBuiltinTypeRvvInt32mf2x2, | |
| 1032 | ZigClangBuiltinTypeRvvInt32mf2x3, | |
| 1033 | ZigClangBuiltinTypeRvvInt32mf2x4, | |
| 1034 | ZigClangBuiltinTypeRvvInt32mf2x5, | |
| 1035 | ZigClangBuiltinTypeRvvInt32mf2x6, | |
| 1036 | ZigClangBuiltinTypeRvvInt32mf2x7, | |
| 1037 | ZigClangBuiltinTypeRvvInt32mf2x8, | |
| 1038 | ZigClangBuiltinTypeRvvInt32m1x2, | |
| 1039 | ZigClangBuiltinTypeRvvInt32m1x3, | |
| 1040 | ZigClangBuiltinTypeRvvInt32m1x4, | |
| 1041 | ZigClangBuiltinTypeRvvInt32m1x5, | |
| 1042 | ZigClangBuiltinTypeRvvInt32m1x6, | |
| 1043 | ZigClangBuiltinTypeRvvInt32m1x7, | |
| 1044 | ZigClangBuiltinTypeRvvInt32m1x8, | |
| 1045 | ZigClangBuiltinTypeRvvInt32m2x2, | |
| 1046 | ZigClangBuiltinTypeRvvInt32m2x3, | |
| 1047 | ZigClangBuiltinTypeRvvInt32m2x4, | |
| 1048 | ZigClangBuiltinTypeRvvInt32m4x2, | |
| 1049 | ZigClangBuiltinTypeRvvUint32mf2x2, | |
| 1050 | ZigClangBuiltinTypeRvvUint32mf2x3, | |
| 1051 | ZigClangBuiltinTypeRvvUint32mf2x4, | |
| 1052 | ZigClangBuiltinTypeRvvUint32mf2x5, | |
| 1053 | ZigClangBuiltinTypeRvvUint32mf2x6, | |
| 1054 | ZigClangBuiltinTypeRvvUint32mf2x7, | |
| 1055 | ZigClangBuiltinTypeRvvUint32mf2x8, | |
| 1056 | ZigClangBuiltinTypeRvvUint32m1x2, | |
| 1057 | ZigClangBuiltinTypeRvvUint32m1x3, | |
| 1058 | ZigClangBuiltinTypeRvvUint32m1x4, | |
| 1059 | ZigClangBuiltinTypeRvvUint32m1x5, | |
| 1060 | ZigClangBuiltinTypeRvvUint32m1x6, | |
| 1061 | ZigClangBuiltinTypeRvvUint32m1x7, | |
| 1062 | ZigClangBuiltinTypeRvvUint32m1x8, | |
| 1063 | ZigClangBuiltinTypeRvvUint32m2x2, | |
| 1064 | ZigClangBuiltinTypeRvvUint32m2x3, | |
| 1065 | ZigClangBuiltinTypeRvvUint32m2x4, | |
| 1066 | ZigClangBuiltinTypeRvvUint32m4x2, | |
| 1067 | ZigClangBuiltinTypeRvvInt64m1x2, | |
| 1068 | ZigClangBuiltinTypeRvvInt64m1x3, | |
| 1069 | ZigClangBuiltinTypeRvvInt64m1x4, | |
| 1070 | ZigClangBuiltinTypeRvvInt64m1x5, | |
| 1071 | ZigClangBuiltinTypeRvvInt64m1x6, | |
| 1072 | ZigClangBuiltinTypeRvvInt64m1x7, | |
| 1073 | ZigClangBuiltinTypeRvvInt64m1x8, | |
| 1074 | ZigClangBuiltinTypeRvvInt64m2x2, | |
| 1075 | ZigClangBuiltinTypeRvvInt64m2x3, | |
| 1076 | ZigClangBuiltinTypeRvvInt64m2x4, | |
| 1077 | ZigClangBuiltinTypeRvvInt64m4x2, | |
| 1078 | ZigClangBuiltinTypeRvvUint64m1x2, | |
| 1079 | ZigClangBuiltinTypeRvvUint64m1x3, | |
| 1080 | ZigClangBuiltinTypeRvvUint64m1x4, | |
| 1081 | ZigClangBuiltinTypeRvvUint64m1x5, | |
| 1082 | ZigClangBuiltinTypeRvvUint64m1x6, | |
| 1083 | ZigClangBuiltinTypeRvvUint64m1x7, | |
| 1084 | ZigClangBuiltinTypeRvvUint64m1x8, | |
| 1085 | ZigClangBuiltinTypeRvvUint64m2x2, | |
| 1086 | ZigClangBuiltinTypeRvvUint64m2x3, | |
| 1087 | ZigClangBuiltinTypeRvvUint64m2x4, | |
| 1088 | ZigClangBuiltinTypeRvvUint64m4x2, | |
| 1089 | ZigClangBuiltinTypeRvvFloat16mf4x2, | |
| 1090 | ZigClangBuiltinTypeRvvFloat16mf4x3, | |
| 1091 | ZigClangBuiltinTypeRvvFloat16mf4x4, | |
| 1092 | ZigClangBuiltinTypeRvvFloat16mf4x5, | |
| 1093 | ZigClangBuiltinTypeRvvFloat16mf4x6, | |
| 1094 | ZigClangBuiltinTypeRvvFloat16mf4x7, | |
| 1095 | ZigClangBuiltinTypeRvvFloat16mf4x8, | |
| 1096 | ZigClangBuiltinTypeRvvFloat16mf2x2, | |
| 1097 | ZigClangBuiltinTypeRvvFloat16mf2x3, | |
| 1098 | ZigClangBuiltinTypeRvvFloat16mf2x4, | |
| 1099 | ZigClangBuiltinTypeRvvFloat16mf2x5, | |
| 1100 | ZigClangBuiltinTypeRvvFloat16mf2x6, | |
| 1101 | ZigClangBuiltinTypeRvvFloat16mf2x7, | |
| 1102 | ZigClangBuiltinTypeRvvFloat16mf2x8, | |
| 1103 | ZigClangBuiltinTypeRvvFloat16m1x2, | |
| 1104 | ZigClangBuiltinTypeRvvFloat16m1x3, | |
| 1105 | ZigClangBuiltinTypeRvvFloat16m1x4, | |
| 1106 | ZigClangBuiltinTypeRvvFloat16m1x5, | |
| 1107 | ZigClangBuiltinTypeRvvFloat16m1x6, | |
| 1108 | ZigClangBuiltinTypeRvvFloat16m1x7, | |
| 1109 | ZigClangBuiltinTypeRvvFloat16m1x8, | |
| 1110 | ZigClangBuiltinTypeRvvFloat16m2x2, | |
| 1111 | ZigClangBuiltinTypeRvvFloat16m2x3, | |
| 1112 | ZigClangBuiltinTypeRvvFloat16m2x4, | |
| 1113 | ZigClangBuiltinTypeRvvFloat16m4x2, | |
| 1114 | ZigClangBuiltinTypeRvvFloat32mf2x2, | |
| 1115 | ZigClangBuiltinTypeRvvFloat32mf2x3, | |
| 1116 | ZigClangBuiltinTypeRvvFloat32mf2x4, | |
| 1117 | ZigClangBuiltinTypeRvvFloat32mf2x5, | |
| 1118 | ZigClangBuiltinTypeRvvFloat32mf2x6, | |
| 1119 | ZigClangBuiltinTypeRvvFloat32mf2x7, | |
| 1120 | ZigClangBuiltinTypeRvvFloat32mf2x8, | |
| 1121 | ZigClangBuiltinTypeRvvFloat32m1x2, | |
| 1122 | ZigClangBuiltinTypeRvvFloat32m1x3, | |
| 1123 | ZigClangBuiltinTypeRvvFloat32m1x4, | |
| 1124 | ZigClangBuiltinTypeRvvFloat32m1x5, | |
| 1125 | ZigClangBuiltinTypeRvvFloat32m1x6, | |
| 1126 | ZigClangBuiltinTypeRvvFloat32m1x7, | |
| 1127 | ZigClangBuiltinTypeRvvFloat32m1x8, | |
| 1128 | ZigClangBuiltinTypeRvvFloat32m2x2, | |
| 1129 | ZigClangBuiltinTypeRvvFloat32m2x3, | |
| 1130 | ZigClangBuiltinTypeRvvFloat32m2x4, | |
| 1131 | ZigClangBuiltinTypeRvvFloat32m4x2, | |
| 1132 | ZigClangBuiltinTypeRvvFloat64m1x2, | |
| 1133 | ZigClangBuiltinTypeRvvFloat64m1x3, | |
| 1134 | ZigClangBuiltinTypeRvvFloat64m1x4, | |
| 1135 | ZigClangBuiltinTypeRvvFloat64m1x5, | |
| 1136 | ZigClangBuiltinTypeRvvFloat64m1x6, | |
| 1137 | ZigClangBuiltinTypeRvvFloat64m1x7, | |
| 1138 | ZigClangBuiltinTypeRvvFloat64m1x8, | |
| 1139 | ZigClangBuiltinTypeRvvFloat64m2x2, | |
| 1140 | ZigClangBuiltinTypeRvvFloat64m2x3, | |
| 1141 | ZigClangBuiltinTypeRvvFloat64m2x4, | |
| 1142 | ZigClangBuiltinTypeRvvFloat64m4x2, | |
| 1143 | ZigClangBuiltinTypeRvvBFloat16mf4x2, | |
| 1144 | ZigClangBuiltinTypeRvvBFloat16mf4x3, | |
| 1145 | ZigClangBuiltinTypeRvvBFloat16mf4x4, | |
| 1146 | ZigClangBuiltinTypeRvvBFloat16mf4x5, | |
| 1147 | ZigClangBuiltinTypeRvvBFloat16mf4x6, | |
| 1148 | ZigClangBuiltinTypeRvvBFloat16mf4x7, | |
| 1149 | ZigClangBuiltinTypeRvvBFloat16mf4x8, | |
| 1150 | ZigClangBuiltinTypeRvvBFloat16mf2x2, | |
| 1151 | ZigClangBuiltinTypeRvvBFloat16mf2x3, | |
| 1152 | ZigClangBuiltinTypeRvvBFloat16mf2x4, | |
| 1153 | ZigClangBuiltinTypeRvvBFloat16mf2x5, | |
| 1154 | ZigClangBuiltinTypeRvvBFloat16mf2x6, | |
| 1155 | ZigClangBuiltinTypeRvvBFloat16mf2x7, | |
| 1156 | ZigClangBuiltinTypeRvvBFloat16mf2x8, | |
| 1157 | ZigClangBuiltinTypeRvvBFloat16m1x2, | |
| 1158 | ZigClangBuiltinTypeRvvBFloat16m1x3, | |
| 1159 | ZigClangBuiltinTypeRvvBFloat16m1x4, | |
| 1160 | ZigClangBuiltinTypeRvvBFloat16m1x5, | |
| 1161 | ZigClangBuiltinTypeRvvBFloat16m1x6, | |
| 1162 | ZigClangBuiltinTypeRvvBFloat16m1x7, | |
| 1163 | ZigClangBuiltinTypeRvvBFloat16m1x8, | |
| 1164 | ZigClangBuiltinTypeRvvBFloat16m2x2, | |
| 1165 | ZigClangBuiltinTypeRvvBFloat16m2x3, | |
| 1166 | ZigClangBuiltinTypeRvvBFloat16m2x4, | |
| 1167 | ZigClangBuiltinTypeRvvBFloat16m4x2, | |
| 1168 | ZigClangBuiltinTypeWasmExternRef, | |
| 1169 | ZigClangBuiltinTypeAMDGPUBufferRsrc, | |
| 1170 | ZigClangBuiltinTypeAMDGPUNamedWorkgroupBarrier, | |
| 1171 | ZigClangBuiltinTypeHLSLResource, | |
| 1172 | ZigClangBuiltinTypeVoid, | |
| 1173 | ZigClangBuiltinTypeBool, | |
| 1174 | ZigClangBuiltinTypeChar_U, | |
| 1175 | ZigClangBuiltinTypeUChar, | |
| 1176 | ZigClangBuiltinTypeWChar_U, | |
| 1177 | ZigClangBuiltinTypeChar8, | |
| 1178 | ZigClangBuiltinTypeChar16, | |
| 1179 | ZigClangBuiltinTypeChar32, | |
| 1180 | ZigClangBuiltinTypeUShort, | |
| 1181 | ZigClangBuiltinTypeUInt, | |
| 1182 | ZigClangBuiltinTypeULong, | |
| 1183 | ZigClangBuiltinTypeULongLong, | |
| 1184 | ZigClangBuiltinTypeUInt128, | |
| 1185 | ZigClangBuiltinTypeChar_S, | |
| 1186 | ZigClangBuiltinTypeSChar, | |
| 1187 | ZigClangBuiltinTypeWChar_S, | |
| 1188 | ZigClangBuiltinTypeShort, | |
| 1189 | ZigClangBuiltinTypeInt, | |
| 1190 | ZigClangBuiltinTypeLong, | |
| 1191 | ZigClangBuiltinTypeLongLong, | |
| 1192 | ZigClangBuiltinTypeInt128, | |
| 1193 | ZigClangBuiltinTypeShortAccum, | |
| 1194 | ZigClangBuiltinTypeAccum, | |
| 1195 | ZigClangBuiltinTypeLongAccum, | |
| 1196 | ZigClangBuiltinTypeUShortAccum, | |
| 1197 | ZigClangBuiltinTypeUAccum, | |
| 1198 | ZigClangBuiltinTypeULongAccum, | |
| 1199 | ZigClangBuiltinTypeShortFract, | |
| 1200 | ZigClangBuiltinTypeFract, | |
| 1201 | ZigClangBuiltinTypeLongFract, | |
| 1202 | ZigClangBuiltinTypeUShortFract, | |
| 1203 | ZigClangBuiltinTypeUFract, | |
| 1204 | ZigClangBuiltinTypeULongFract, | |
| 1205 | ZigClangBuiltinTypeSatShortAccum, | |
| 1206 | ZigClangBuiltinTypeSatAccum, | |
| 1207 | ZigClangBuiltinTypeSatLongAccum, | |
| 1208 | ZigClangBuiltinTypeSatUShortAccum, | |
| 1209 | ZigClangBuiltinTypeSatUAccum, | |
| 1210 | ZigClangBuiltinTypeSatULongAccum, | |
| 1211 | ZigClangBuiltinTypeSatShortFract, | |
| 1212 | ZigClangBuiltinTypeSatFract, | |
| 1213 | ZigClangBuiltinTypeSatLongFract, | |
| 1214 | ZigClangBuiltinTypeSatUShortFract, | |
| 1215 | ZigClangBuiltinTypeSatUFract, | |
| 1216 | ZigClangBuiltinTypeSatULongFract, | |
| 1217 | ZigClangBuiltinTypeHalf, | |
| 1218 | ZigClangBuiltinTypeFloat, | |
| 1219 | ZigClangBuiltinTypeDouble, | |
| 1220 | ZigClangBuiltinTypeLongDouble, | |
| 1221 | ZigClangBuiltinTypeFloat16, | |
| 1222 | ZigClangBuiltinTypeBFloat16, | |
| 1223 | ZigClangBuiltinTypeFloat128, | |
| 1224 | ZigClangBuiltinTypeIbm128, | |
| 1225 | ZigClangBuiltinTypeNullPtr, | |
| 1226 | ZigClangBuiltinTypeObjCId, | |
| 1227 | ZigClangBuiltinTypeObjCClass, | |
| 1228 | ZigClangBuiltinTypeObjCSel, | |
| 1229 | ZigClangBuiltinTypeOCLSampler, | |
| 1230 | ZigClangBuiltinTypeOCLEvent, | |
| 1231 | ZigClangBuiltinTypeOCLClkEvent, | |
| 1232 | ZigClangBuiltinTypeOCLQueue, | |
| 1233 | ZigClangBuiltinTypeOCLReserveID, | |
| 1234 | ZigClangBuiltinTypeDependent, | |
| 1235 | ZigClangBuiltinTypeOverload, | |
| 1236 | ZigClangBuiltinTypeBoundMember, | |
| 1237 | ZigClangBuiltinTypeUnresolvedTemplate, | |
| 1238 | ZigClangBuiltinTypePseudoObject, | |
| 1239 | ZigClangBuiltinTypeUnknownAny, | |
| 1240 | ZigClangBuiltinTypeBuiltinFn, | |
| 1241 | ZigClangBuiltinTypeARCUnbridgedCast, | |
| 1242 | ZigClangBuiltinTypeIncompleteMatrixIdx, | |
| 1243 | ZigClangBuiltinTypeOMPArraySection, | |
| 1244 | ZigClangBuiltinTypeOMPArrayShaping, | |
| 1245 | ZigClangBuiltinTypeOMPIterator, | |
| 1246 | }; | |
| 1247 | ||
| 1248 | enum ZigClangCallingConv { | |
| 1249 | ZigClangCallingConv_C, | |
| 1250 | ZigClangCallingConv_X86StdCall, | |
| 1251 | ZigClangCallingConv_X86FastCall, | |
| 1252 | ZigClangCallingConv_X86ThisCall, | |
| 1253 | ZigClangCallingConv_X86VectorCall, | |
| 1254 | ZigClangCallingConv_X86Pascal, | |
| 1255 | ZigClangCallingConv_Win64, | |
| 1256 | ZigClangCallingConv_X86_64SysV, | |
| 1257 | ZigClangCallingConv_X86RegCall, | |
| 1258 | ZigClangCallingConv_AAPCS, | |
| 1259 | ZigClangCallingConv_AAPCS_VFP, | |
| 1260 | ZigClangCallingConv_IntelOclBicc, | |
| 1261 | ZigClangCallingConv_SpirFunction, | |
| 1262 | ZigClangCallingConv_DeviceKernel, | |
| 1263 | ZigClangCallingConv_Swift, | |
| 1264 | ZigClangCallingConv_SwiftAsync, | |
| 1265 | ZigClangCallingConv_PreserveMost, | |
| 1266 | ZigClangCallingConv_PreserveAll, | |
| 1267 | ZigClangCallingConv_AArch64VectorCall, | |
| 1268 | ZigClangCallingConv_AArch64SVEPCS, | |
| 1269 | ZigClangCallingConv_M68kRTD, | |
| 1270 | ZigClangCallingConv_PreserveNone, | |
| 1271 | ZigClangCallingConv_RISCVVectorCall, | |
| 1272 | }; | |
| 1273 | ||
| 1274 | enum ZigClangStorageClass { | |
| 1275 | // These are legal on both functions and variables. | |
| 1276 | ZigClangStorageClass_None, | |
| 1277 | ZigClangStorageClass_Extern, | |
| 1278 | ZigClangStorageClass_Static, | |
| 1279 | ZigClangStorageClass_PrivateExtern, | |
| 1280 | ||
| 1281 | // These are only legal on variables. | |
| 1282 | ZigClangStorageClass_Auto, | |
| 1283 | ZigClangStorageClass_Register, | |
| 1284 | }; | |
| 1285 | ||
| 1286 | /// IEEE-754R 4.3: Rounding-direction attributes. | |
| 1287 | enum ZigClangAPFloat_roundingMode { | |
| 1288 | ZigClangAPFloat_roundingMode_TowardZero = 0, | |
| 1289 | ZigClangAPFloat_roundingMode_NearestTiesToEven = 1, | |
| 1290 | ZigClangAPFloat_roundingMode_TowardPositive = 2, | |
| 1291 | ZigClangAPFloat_roundingMode_TowardNegative = 3, | |
| 1292 | ZigClangAPFloat_roundingMode_NearestTiesToAway = 4, | |
| 1293 | ||
| 1294 | ZigClangAPFloat_roundingMode_Dynamic = 7, | |
| 1295 | ZigClangAPFloat_roundingMode_Invalid = -1, | |
| 1296 | }; | |
| 1297 | ||
| 1298 | enum ZigClangAPFloatBase_Semantics { | |
| 1299 | ZigClangAPFloatBase_Semantics_IEEEhalf, | |
| 1300 | ZigClangAPFloatBase_Semantics_BFloat, | |
| 1301 | ZigClangAPFloatBase_Semantics_IEEEsingle, | |
| 1302 | ZigClangAPFloatBase_Semantics_IEEEdouble, | |
| 1303 | ZigClangAPFloatBase_Semantics_IEEEquad, | |
| 1304 | ZigClangAPFloatBase_Semantics_PPCDoubleDouble, | |
| 1305 | ZigClangAPFloatBase_Semantics_PPCDoubleDoubleLegacy, | |
| 1306 | ZigClangAPFloatBase_Semantics_Float8E5M2, | |
| 1307 | ZigClangAPFloatBase_Semantics_Float8E5M2FNUZ, | |
| 1308 | ZigClangAPFloatBase_Semantics_Float8E4M3, | |
| 1309 | ZigClangAPFloatBase_Semantics_Float8E4M3FN, | |
| 1310 | ZigClangAPFloatBase_Semantics_Float8E4M3FNUZ, | |
| 1311 | ZigClangAPFloatBase_Semantics_Float8E4M3B11FNUZ, | |
| 1312 | ZigClangAPFloatBase_Semantics_Float8E3M4, | |
| 1313 | ZigClangAPFloatBase_Semantics_FloatTF32, | |
| 1314 | ZigClangAPFloatBase_Semantics_Float8E8M0FNU, | |
| 1315 | ZigClangAPFloatBase_Semantics_Float6E3M2FN, | |
| 1316 | ZigClangAPFloatBase_Semantics_Float6E2M3FN, | |
| 1317 | ZigClangAPFloatBase_Semantics_Float4E2M1FN, | |
| 1318 | ZigClangAPFloatBase_Semantics_x87DoubleExtended, | |
| 1319 | ZigClangAPFloatBase_Semantics_MaxSemantics = ZigClangAPFloatBase_Semantics_x87DoubleExtended, | |
| 1320 | }; | |
| 1321 | ||
| 1322 | enum ZigClangStringLiteral_StringKind { | |
| 1323 | ZigClangStringLiteral_StringKind_Ascii, | |
| 1324 | ZigClangStringLiteral_StringKind_Wide, | |
| 1325 | ZigClangStringLiteral_StringKind_UTF8, | |
| 1326 | ZigClangStringLiteral_StringKind_UTF16, | |
| 1327 | ZigClangStringLiteral_StringKind_UTF32, | |
| 1328 | }; | |
| 1329 | ||
| 1330 | enum ZigClangCharacterLiteralKind { | |
| 1331 | ZigClangCharacterLiteralKind_Ascii, | |
| 1332 | ZigClangCharacterLiteralKind_Wide, | |
| 1333 | ZigClangCharacterLiteralKind_UTF8, | |
| 1334 | ZigClangCharacterLiteralKind_UTF16, | |
| 1335 | ZigClangCharacterLiteralKind_UTF32, | |
| 1336 | }; | |
| 1337 | ||
| 1338 | enum ZigClangVarDecl_TLSKind { | |
| 1339 | ZigClangVarDecl_TLSKind_None, | |
| 1340 | ZigClangVarDecl_TLSKind_Static, | |
| 1341 | ZigClangVarDecl_TLSKind_Dynamic, | |
| 1342 | }; | |
| 1343 | ||
| 1344 | enum ZigClangElaboratedTypeKeyword { | |
| 1345 | ZigClangElaboratedTypeKeyword_Struct, | |
| 1346 | ZigClangElaboratedTypeKeyword_Interface, | |
| 1347 | ZigClangElaboratedTypeKeyword_Union, | |
| 1348 | ZigClangElaboratedTypeKeyword_Class, | |
| 1349 | ZigClangElaboratedTypeKeyword_Enum, | |
| 1350 | ZigClangElaboratedTypeKeyword_Typename, | |
| 1351 | ZigClangElaboratedTypeKeyword_None, | |
| 1352 | }; | |
| 1353 | ||
| 1354 | enum ZigClangPreprocessedEntity_EntityKind { | |
| 1355 | ZigClangPreprocessedEntity_InvalidKind, | |
| 1356 | ZigClangPreprocessedEntity_MacroExpansionKind, | |
| 1357 | ZigClangPreprocessedEntity_MacroDefinitionKind, | |
| 1358 | ZigClangPreprocessedEntity_InclusionDirectiveKind, | |
| 1359 | }; | |
| 1360 | ||
| 1361 | enum ZigClangExpr_ConstantExprKind { | |
| 1362 | ZigClangExpr_ConstantExprKind_Normal, | |
| 1363 | ZigClangExpr_ConstantExprKind_NonClassTemplateArgument, | |
| 1364 | ZigClangExpr_ConstantExprKind_ClassTemplateArgument, | |
| 1365 | ZigClangExpr_ConstantExprKind_ImmediateInvocation, | |
| 1366 | }; | |
| 1367 | ||
| 1368 | enum ZigClangUnaryExprOrTypeTrait_Kind { | |
| 1369 | ZigClangUnaryExprOrTypeTrait_KindSizeOf, | |
| 1370 | ZigClangUnaryExprOrTypeTrait_KindDataSizeOf, | |
| 1371 | ZigClangUnaryExprOrTypeTrait_KindCountOf, | |
| 1372 | ZigClangUnaryExprOrTypeTrait_KindAlignOf, | |
| 1373 | ZigClangUnaryExprOrTypeTrait_KindPreferredAlignOf, | |
| 1374 | ZigClangUnaryExprOrTypeTrait_KindPtrAuthTypeDiscriminator, | |
| 1375 | ZigClangUnaryExprOrTypeTrait_KindVecStep, | |
| 1376 | ZigClangUnaryExprOrTypeTrait_KindOpenMPRequiredSimdAlign, | |
| 1377 | }; | |
| 1378 | ||
| 1379 | enum ZigClangOffsetOfNode_Kind { | |
| 1380 | ZigClangOffsetOfNode_KindArray, | |
| 1381 | ZigClangOffsetOfNode_KindField, | |
| 1382 | ZigClangOffsetOfNode_KindIdentifier, | |
| 1383 | ZigClangOffsetOfNode_KindBase, | |
| 1384 | }; | |
| 1385 | ||
| 1386 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangSourceManager_getSpellingLoc(const struct ZigClangSourceManager *, | |
| 1387 | struct ZigClangSourceLocation Loc); | |
| 1388 | ZIG_EXTERN_C const char *ZigClangSourceManager_getFilename(const struct ZigClangSourceManager *, | |
| 1389 | struct ZigClangSourceLocation SpellingLoc); | |
| 1390 | ZIG_EXTERN_C unsigned ZigClangSourceManager_getSpellingLineNumber(const struct ZigClangSourceManager *, | |
| 1391 | struct ZigClangSourceLocation Loc); | |
| 1392 | ZIG_EXTERN_C unsigned ZigClangSourceManager_getSpellingColumnNumber(const struct ZigClangSourceManager *, | |
| 1393 | struct ZigClangSourceLocation Loc); | |
| 1394 | ZIG_EXTERN_C const char* ZigClangSourceManager_getCharacterData(const struct ZigClangSourceManager *, | |
| 1395 | struct ZigClangSourceLocation SL); | |
| 1396 | ||
| 1397 | ZIG_EXTERN_C struct ZigClangQualType ZigClangASTContext_getPointerType(const struct ZigClangASTContext*, struct ZigClangQualType T); | |
| 1398 | ||
| 1399 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangLexer_getLocForEndOfToken(struct ZigClangSourceLocation, | |
| 1400 | const ZigClangSourceManager *, const ZigClangASTUnit *); | |
| 1401 | ||
| 1402 | // Can return null. | |
| 1403 | ZIG_EXTERN_C struct ZigClangASTUnit *ZigClangLoadFromCommandLine( | |
| 1404 | const char **args_begin, const char **args_end, | |
| 1405 | struct Stage2ErrorMsg **errors_ptr, size_t *errors_len, const char *resources_path); | |
| 1406 | ZIG_EXTERN_C void ZigClangASTUnit_delete(struct ZigClangASTUnit *); | |
| 1407 | ZIG_EXTERN_C void ZigClangErrorMsg_delete(struct Stage2ErrorMsg *ptr, size_t len); | |
| 1408 | ||
| 1409 | ZIG_EXTERN_C struct ZigClangASTContext *ZigClangASTUnit_getASTContext(struct ZigClangASTUnit *); | |
| 1410 | ZIG_EXTERN_C struct ZigClangSourceManager *ZigClangASTUnit_getSourceManager(struct ZigClangASTUnit *); | |
| 1411 | ZIG_EXTERN_C bool ZigClangASTUnit_visitLocalTopLevelDecls(struct ZigClangASTUnit *, void *context, | |
| 1412 | bool (*Fn)(void *context, const struct ZigClangDecl *decl)); | |
| 1413 | ZIG_EXTERN_C struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_begin(struct ZigClangASTUnit *); | |
| 1414 | ZIG_EXTERN_C struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_end(struct ZigClangASTUnit *); | |
| 1415 | ||
| 1416 | ZIG_EXTERN_C struct ZigClangPreprocessedEntity *ZigClangPreprocessingRecord_iterator_deref( | |
| 1417 | struct ZigClangPreprocessingRecord_iterator); | |
| 1418 | ||
| 1419 | ZIG_EXTERN_C enum ZigClangPreprocessedEntity_EntityKind ZigClangPreprocessedEntity_getKind(const struct ZigClangPreprocessedEntity *); | |
| 1420 | ||
| 1421 | ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangRecordType_getDecl(const struct ZigClangRecordType *record_ty); | |
| 1422 | ZIG_EXTERN_C const struct ZigClangEnumDecl *ZigClangEnumType_getDecl(const struct ZigClangEnumType *record_ty); | |
| 1423 | ||
| 1424 | ZIG_EXTERN_C bool ZigClangTagDecl_isThisDeclarationADefinition(const struct ZigClangTagDecl *); | |
| 1425 | ||
| 1426 | ZIG_EXTERN_C const struct ZigClangTagDecl *ZigClangRecordDecl_getCanonicalDecl(const struct ZigClangRecordDecl *record_decl); | |
| 1427 | ZIG_EXTERN_C const struct ZigClangTagDecl *ZigClangEnumDecl_getCanonicalDecl(const struct ZigClangEnumDecl *); | |
| 1428 | ZIG_EXTERN_C const struct ZigClangFieldDecl *ZigClangFieldDecl_getCanonicalDecl(const ZigClangFieldDecl *); | |
| 1429 | ZIG_EXTERN_C const struct ZigClangTypedefNameDecl *ZigClangTypedefNameDecl_getCanonicalDecl(const struct ZigClangTypedefNameDecl *); | |
| 1430 | ZIG_EXTERN_C const struct ZigClangFunctionDecl *ZigClangFunctionDecl_getCanonicalDecl(const ZigClangFunctionDecl *self); | |
| 1431 | ZIG_EXTERN_C const struct ZigClangVarDecl *ZigClangVarDecl_getCanonicalDecl(const ZigClangVarDecl *self); | |
| 1432 | ZIG_EXTERN_C const char* ZigClangVarDecl_getSectionAttribute(const struct ZigClangVarDecl *self, size_t *len); | |
| 1433 | ZIG_EXTERN_C const struct ZigClangFunctionDecl *ZigClangVarDecl_getCleanupAttribute(const struct ZigClangVarDecl *self); | |
| 1434 | ZIG_EXTERN_C unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, const ZigClangASTContext* ctx); | |
| 1435 | ZIG_EXTERN_C unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionDecl *self, const ZigClangASTContext* ctx); | |
| 1436 | ZIG_EXTERN_C unsigned ZigClangFieldDecl_getAlignedAttribute(const struct ZigClangFieldDecl *self, const ZigClangASTContext* ctx); | |
| 1437 | ZIG_EXTERN_C bool ZigClangVarDecl_getPackedAttribute(const struct ZigClangVarDecl *self); | |
| 1438 | ZIG_EXTERN_C bool ZigClangFieldDecl_getPackedAttribute(const struct ZigClangFieldDecl *self); | |
| 1439 | ||
| 1440 | ZIG_EXTERN_C const char *ZigClangFileScopeAsmDecl_getAsmString(const struct ZigClangFileScopeAsmDecl *self); | |
| 1441 | ZIG_EXTERN_C void ZigClangFileScopeAsmDecl_freeAsmString(const char *str); | |
| 1442 | ||
| 1443 | ZIG_EXTERN_C struct ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self); | |
| 1444 | ||
| 1445 | ZIG_EXTERN_C bool ZigClangRecordDecl_getPackedAttribute(const struct ZigClangRecordDecl *); | |
| 1446 | ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const struct ZigClangRecordDecl *); | |
| 1447 | ZIG_EXTERN_C const struct ZigClangEnumDecl *ZigClangEnumDecl_getDefinition(const struct ZigClangEnumDecl *); | |
| 1448 | ||
| 1449 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangRecordDecl_getLocation(const struct ZigClangRecordDecl *); | |
| 1450 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangEnumDecl_getLocation(const struct ZigClangEnumDecl *); | |
| 1451 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangTypedefNameDecl_getLocation(const struct ZigClangTypedefNameDecl *); | |
| 1452 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangDecl_getLocation(const struct ZigClangDecl *); | |
| 1453 | ||
| 1454 | ZIG_EXTERN_C const struct ZigClangASTRecordLayout *ZigClangRecordDecl_getASTRecordLayout(const struct ZigClangRecordDecl *, const struct ZigClangASTContext *); | |
| 1455 | ||
| 1456 | ZIG_EXTERN_C uint64_t ZigClangASTRecordLayout_getFieldOffset(const struct ZigClangASTRecordLayout *, unsigned); | |
| 1457 | ZIG_EXTERN_C int64_t ZigClangASTRecordLayout_getAlignment(const struct ZigClangASTRecordLayout *); | |
| 1458 | ||
| 1459 | ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionDecl_getType(const struct ZigClangFunctionDecl *); | |
| 1460 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFunctionDecl_getLocation(const struct ZigClangFunctionDecl *); | |
| 1461 | ZIG_EXTERN_C bool ZigClangFunctionDecl_hasBody(const struct ZigClangFunctionDecl *); | |
| 1462 | ZIG_EXTERN_C enum ZigClangStorageClass ZigClangFunctionDecl_getStorageClass(const struct ZigClangFunctionDecl *); | |
| 1463 | ZIG_EXTERN_C const struct ZigClangParmVarDecl *ZigClangFunctionDecl_getParamDecl(const struct ZigClangFunctionDecl *, unsigned i); | |
| 1464 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangFunctionDecl_getBody(const struct ZigClangFunctionDecl *); | |
| 1465 | ZIG_EXTERN_C bool ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(const struct ZigClangFunctionDecl *); | |
| 1466 | ZIG_EXTERN_C bool ZigClangFunctionDecl_isThisDeclarationADefinition(const struct ZigClangFunctionDecl *); | |
| 1467 | ZIG_EXTERN_C bool ZigClangFunctionDecl_doesThisDeclarationHaveABody(const struct ZigClangFunctionDecl *); | |
| 1468 | ZIG_EXTERN_C bool ZigClangFunctionDecl_isInlineSpecified(const struct ZigClangFunctionDecl *); | |
| 1469 | ZIG_EXTERN_C bool ZigClangFunctionDecl_hasAlwaysInlineAttr(const struct ZigClangFunctionDecl *); | |
| 1470 | ZIG_EXTERN_C bool ZigClangFunctionDecl_isDefined(const struct ZigClangFunctionDecl *); | |
| 1471 | ZIG_EXTERN_C const struct ZigClangFunctionDecl* ZigClangFunctionDecl_getDefinition(const struct ZigClangFunctionDecl *); | |
| 1472 | ZIG_EXTERN_C const char* ZigClangFunctionDecl_getSectionAttribute(const struct ZigClangFunctionDecl *, size_t *); | |
| 1473 | ||
| 1474 | ZIG_EXTERN_C bool ZigClangRecordDecl_isUnion(const struct ZigClangRecordDecl *record_decl); | |
| 1475 | ZIG_EXTERN_C bool ZigClangRecordDecl_isStruct(const struct ZigClangRecordDecl *record_decl); | |
| 1476 | ZIG_EXTERN_C bool ZigClangRecordDecl_isAnonymousStructOrUnion(const struct ZigClangRecordDecl *record_decl); | |
| 1477 | ZIG_EXTERN_C ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_begin(const struct ZigClangRecordDecl *); | |
| 1478 | ZIG_EXTERN_C ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_end(const struct ZigClangRecordDecl *); | |
| 1479 | ZIG_EXTERN_C ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_iterator_next(struct ZigClangRecordDecl_field_iterator); | |
| 1480 | ZIG_EXTERN_C const struct ZigClangFieldDecl * ZigClangRecordDecl_field_iterator_deref(struct ZigClangRecordDecl_field_iterator); | |
| 1481 | ZIG_EXTERN_C bool ZigClangRecordDecl_field_iterator_neq( | |
| 1482 | struct ZigClangRecordDecl_field_iterator a, | |
| 1483 | struct ZigClangRecordDecl_field_iterator b); | |
| 1484 | ||
| 1485 | ZIG_EXTERN_C struct ZigClangQualType ZigClangEnumDecl_getIntegerType(const struct ZigClangEnumDecl *); | |
| 1486 | ZIG_EXTERN_C ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_begin(const struct ZigClangEnumDecl *); | |
| 1487 | ZIG_EXTERN_C ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_end(const struct ZigClangEnumDecl *); | |
| 1488 | ZIG_EXTERN_C ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_iterator_next(struct ZigClangEnumDecl_enumerator_iterator); | |
| 1489 | ZIG_EXTERN_C const struct ZigClangEnumConstantDecl * ZigClangEnumDecl_enumerator_iterator_deref(struct ZigClangEnumDecl_enumerator_iterator); | |
| 1490 | ZIG_EXTERN_C bool ZigClangEnumDecl_enumerator_iterator_neq( | |
| 1491 | struct ZigClangEnumDecl_enumerator_iterator a, | |
| 1492 | struct ZigClangEnumDecl_enumerator_iterator b); | |
| 1493 | ||
| 1494 | ZIG_EXTERN_C const ZigClangNamedDecl* ZigClangDecl_castToNamedDecl(const ZigClangDecl *self); | |
| 1495 | ZIG_EXTERN_C const char *ZigClangNamedDecl_getName_bytes_begin(const struct ZigClangNamedDecl *self); | |
| 1496 | ZIG_EXTERN_C enum ZigClangDeclKind ZigClangDecl_getKind(const struct ZigClangDecl *decl); | |
| 1497 | ZIG_EXTERN_C const char *ZigClangDecl_getDeclKindName(const struct ZigClangDecl *decl); | |
| 1498 | ||
| 1499 | ZIG_EXTERN_C struct ZigClangQualType ZigClangVarDecl_getType(const struct ZigClangVarDecl *); | |
| 1500 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangVarDecl_getInit(const struct ZigClangVarDecl *var_decl); | |
| 1501 | ZIG_EXTERN_C enum ZigClangVarDecl_TLSKind ZigClangVarDecl_getTLSKind(const struct ZigClangVarDecl *var_decl); | |
| 1502 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangVarDecl_getLocation(const struct ZigClangVarDecl *); | |
| 1503 | ZIG_EXTERN_C bool ZigClangVarDecl_hasExternalStorage(const struct ZigClangVarDecl *); | |
| 1504 | ZIG_EXTERN_C bool ZigClangVarDecl_isFileVarDecl(const struct ZigClangVarDecl *); | |
| 1505 | ZIG_EXTERN_C bool ZigClangVarDecl_hasInit(const struct ZigClangVarDecl *); | |
| 1506 | ZIG_EXTERN_C const struct ZigClangAPValue *ZigClangVarDecl_evaluateValue(const struct ZigClangVarDecl *); | |
| 1507 | ZIG_EXTERN_C struct ZigClangQualType ZigClangVarDecl_getTypeSourceInfo_getType(const struct ZigClangVarDecl *); | |
| 1508 | ZIG_EXTERN_C enum ZigClangStorageClass ZigClangVarDecl_getStorageClass(const struct ZigClangVarDecl *self); | |
| 1509 | ZIG_EXTERN_C bool ZigClangVarDecl_isStaticLocal(const struct ZigClangVarDecl *self); | |
| 1510 | ||
| 1511 | ZIG_EXTERN_C bool ZigClangSourceLocation_eq(struct ZigClangSourceLocation a, struct ZigClangSourceLocation b); | |
| 1512 | ||
| 1513 | ZIG_EXTERN_C const struct ZigClangTypedefNameDecl *ZigClangTypedefType_getDecl(const struct ZigClangTypedefType *); | |
| 1514 | ZIG_EXTERN_C struct ZigClangQualType ZigClangTypedefNameDecl_getUnderlyingType(const struct ZigClangTypedefNameDecl *); | |
| 1515 | ||
| 1516 | ZIG_EXTERN_C struct ZigClangQualType ZigClangQualType_getCanonicalType(struct ZigClangQualType); | |
| 1517 | ZIG_EXTERN_C const struct ZigClangType *ZigClangQualType_getTypePtr(struct ZigClangQualType); | |
| 1518 | ZIG_EXTERN_C enum ZigClangTypeClass ZigClangQualType_getTypeClass(struct ZigClangQualType); | |
| 1519 | ZIG_EXTERN_C void ZigClangQualType_addConst(struct ZigClangQualType *); | |
| 1520 | ZIG_EXTERN_C bool ZigClangQualType_eq(struct ZigClangQualType, struct ZigClangQualType); | |
| 1521 | ZIG_EXTERN_C bool ZigClangQualType_isConstQualified(struct ZigClangQualType); | |
| 1522 | ZIG_EXTERN_C bool ZigClangQualType_isVolatileQualified(struct ZigClangQualType); | |
| 1523 | ZIG_EXTERN_C bool ZigClangQualType_isRestrictQualified(struct ZigClangQualType); | |
| 1524 | ||
| 1525 | ZIG_EXTERN_C enum ZigClangTypeClass ZigClangType_getTypeClass(const struct ZigClangType *self); | |
| 1526 | ZIG_EXTERN_C struct ZigClangQualType ZigClangType_getPointeeType(const struct ZigClangType *self); | |
| 1527 | ZIG_EXTERN_C bool ZigClangType_isBooleanType(const struct ZigClangType *self); | |
| 1528 | ZIG_EXTERN_C bool ZigClangType_isVoidType(const struct ZigClangType *self); | |
| 1529 | ZIG_EXTERN_C bool ZigClangType_isArrayType(const struct ZigClangType *self); | |
| 1530 | ZIG_EXTERN_C bool ZigClangType_isRecordType(const struct ZigClangType *self); | |
| 1531 | ZIG_EXTERN_C bool ZigClangType_isVectorType(const struct ZigClangType *self); | |
| 1532 | ZIG_EXTERN_C bool ZigClangType_isIncompleteOrZeroLengthArrayType(const ZigClangQualType *self, const struct ZigClangASTContext *ctx); | |
| 1533 | ZIG_EXTERN_C bool ZigClangType_isConstantArrayType(const ZigClangType *self); | |
| 1534 | ZIG_EXTERN_C const char *ZigClangType_getTypeClassName(const struct ZigClangType *self); | |
| 1535 | ZIG_EXTERN_C const struct ZigClangArrayType *ZigClangType_getAsArrayTypeUnsafe(const struct ZigClangType *self); | |
| 1536 | ZIG_EXTERN_C const ZigClangRecordType *ZigClangType_getAsRecordType(const ZigClangType *self); | |
| 1537 | ZIG_EXTERN_C const ZigClangRecordType *ZigClangType_getAsUnionType(const ZigClangType *self); | |
| 1538 | ||
| 1539 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangStmt_getBeginLoc(const struct ZigClangStmt *self); | |
| 1540 | ZIG_EXTERN_C enum ZigClangStmtClass ZigClangStmt_getStmtClass(const struct ZigClangStmt *self); | |
| 1541 | ZIG_EXTERN_C bool ZigClangStmt_classof_Expr(const struct ZigClangStmt *self); | |
| 1542 | ||
| 1543 | ZIG_EXTERN_C enum ZigClangStmtClass ZigClangExpr_getStmtClass(const struct ZigClangExpr *self); | |
| 1544 | ZIG_EXTERN_C struct ZigClangQualType ZigClangExpr_getType(const struct ZigClangExpr *self); | |
| 1545 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangExpr_getBeginLoc(const struct ZigClangExpr *self); | |
| 1546 | ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsBooleanCondition(const struct ZigClangExpr *self, | |
| 1547 | bool *result, const struct ZigClangASTContext *ctx, bool in_constant_context); | |
| 1548 | ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsFloat(const struct ZigClangExpr *self, | |
| 1549 | ZigClangAPFloat **result, const struct ZigClangASTContext *ctx); | |
| 1550 | ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsConstantExpr(const struct ZigClangExpr *, | |
| 1551 | struct ZigClangExprEvalResult *, ZigClangExpr_ConstantExprKind, const struct ZigClangASTContext *); | |
| 1552 | ZIG_EXTERN_C const struct ZigClangStringLiteral *ZigClangExpr_castToStringLiteral(const struct ZigClangExpr *self); | |
| 1553 | ||
| 1554 | ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *, unsigned); | |
| 1555 | ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *); | |
| 1556 | ZIG_EXTERN_C bool ZigClangInitListExpr_hasArrayFiller(const ZigClangInitListExpr *); | |
| 1557 | ZIG_EXTERN_C bool ZigClangInitListExpr_isStringLiteralInit(const ZigClangInitListExpr *); | |
| 1558 | ZIG_EXTERN_C unsigned ZigClangInitListExpr_getNumInits(const ZigClangInitListExpr *); | |
| 1559 | ZIG_EXTERN_C const ZigClangFieldDecl *ZigClangInitListExpr_getInitializedFieldInUnion(const ZigClangInitListExpr *self); | |
| 1560 | ||
| 1561 | ZIG_EXTERN_C enum ZigClangAPValueKind ZigClangAPValue_getKind(const struct ZigClangAPValue *self); | |
| 1562 | ZIG_EXTERN_C const struct ZigClangAPSInt *ZigClangAPValue_getInt(const struct ZigClangAPValue *self); | |
| 1563 | ZIG_EXTERN_C unsigned ZigClangAPValue_getArrayInitializedElts(const struct ZigClangAPValue *self); | |
| 1564 | ZIG_EXTERN_C const struct ZigClangAPValue *ZigClangAPValue_getArrayInitializedElt(const struct ZigClangAPValue *self, unsigned i); | |
| 1565 | ZIG_EXTERN_C const struct ZigClangAPValue *ZigClangAPValue_getArrayFiller(const struct ZigClangAPValue *self); | |
| 1566 | ZIG_EXTERN_C unsigned ZigClangAPValue_getArraySize(const struct ZigClangAPValue *self); | |
| 1567 | ZIG_EXTERN_C struct ZigClangAPValueLValueBase ZigClangAPValue_getLValueBase(const struct ZigClangAPValue *self); | |
| 1568 | ||
| 1569 | ZIG_EXTERN_C bool ZigClangAPSInt_isSigned(const struct ZigClangAPSInt *self); | |
| 1570 | ZIG_EXTERN_C bool ZigClangAPSInt_isNegative(const struct ZigClangAPSInt *self); | |
| 1571 | ZIG_EXTERN_C const struct ZigClangAPSInt *ZigClangAPSInt_negate(const struct ZigClangAPSInt *self); | |
| 1572 | ZIG_EXTERN_C void ZigClangAPSInt_free(const struct ZigClangAPSInt *self); | |
| 1573 | ZIG_EXTERN_C const uint64_t *ZigClangAPSInt_getRawData(const struct ZigClangAPSInt *self); | |
| 1574 | ZIG_EXTERN_C unsigned ZigClangAPSInt_getNumWords(const struct ZigClangAPSInt *self); | |
| 1575 | ZIG_EXTERN_C bool ZigClangAPSInt_lessThanEqual(const struct ZigClangAPSInt *self, uint64_t rhs); | |
| 1576 | ||
| 1577 | ZIG_EXTERN_C void ZigClangAPInt_free(const struct ZigClangAPInt *self); | |
| 1578 | ZIG_EXTERN_C uint64_t ZigClangAPInt_getLimitedValue(const struct ZigClangAPInt *self, uint64_t limit); | |
| 1579 | ||
| 1580 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAPValueLValueBase_dyn_cast_Expr(struct ZigClangAPValueLValueBase self); | |
| 1581 | ||
| 1582 | ZIG_EXTERN_C enum ZigClangBuiltinTypeKind ZigClangBuiltinType_getKind(const struct ZigClangBuiltinType *self); | |
| 1583 | ||
| 1584 | ZIG_EXTERN_C bool ZigClangFunctionType_getNoReturnAttr(const struct ZigClangFunctionType *self); | |
| 1585 | ZIG_EXTERN_C enum ZigClangCallingConv ZigClangFunctionType_getCallConv(const struct ZigClangFunctionType *self); | |
| 1586 | ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionType_getReturnType(const struct ZigClangFunctionType *self); | |
| 1587 | ||
| 1588 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangGenericSelectionExpr_getResultExpr(const struct ZigClangGenericSelectionExpr *self); | |
| 1589 | ||
| 1590 | ZIG_EXTERN_C bool ZigClangFunctionProtoType_isVariadic(const struct ZigClangFunctionProtoType *self); | |
| 1591 | ZIG_EXTERN_C unsigned ZigClangFunctionProtoType_getNumParams(const struct ZigClangFunctionProtoType *self); | |
| 1592 | ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionProtoType_getParamType(const struct ZigClangFunctionProtoType *self, unsigned i); | |
| 1593 | ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionProtoType_getReturnType(const struct ZigClangFunctionProtoType *self); | |
| 1594 | ||
| 1595 | ||
| 1596 | ZIG_EXTERN_C ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_begin(const struct ZigClangCompoundStmt *self); | |
| 1597 | ZIG_EXTERN_C ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_end(const struct ZigClangCompoundStmt *self); | |
| 1598 | ||
| 1599 | ZIG_EXTERN_C ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_begin(const struct ZigClangDeclStmt *self); | |
| 1600 | ZIG_EXTERN_C ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_end(const struct ZigClangDeclStmt *self); | |
| 1601 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangDeclStmt_getBeginLoc(const struct ZigClangDeclStmt *self); | |
| 1602 | ||
| 1603 | ZIG_EXTERN_C unsigned ZigClangAPFloat_convertToHexString(const struct ZigClangAPFloat *self, char *DST, | |
| 1604 | unsigned HexDigits, bool UpperCase, enum ZigClangAPFloat_roundingMode RM); | |
| 1605 | ZIG_EXTERN_C double ZigClangFloatingLiteral_getValueAsApproximateDouble(const ZigClangFloatingLiteral *self); | |
| 1606 | ZIG_EXTERN_C void ZigClangFloatingLiteral_getValueAsApproximateQuadBits(const ZigClangFloatingLiteral *self, uint64_t *low, uint64_t *high); | |
| 1607 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFloatingLiteral_getBeginLoc(const struct ZigClangFloatingLiteral *); | |
| 1608 | ZIG_EXTERN_C ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigClangFloatingLiteral *self); | |
| 1609 | ||
| 1610 | ||
| 1611 | ZIG_EXTERN_C enum ZigClangCharacterLiteralKind ZigClangStringLiteral_getKind( | |
| 1612 | const struct ZigClangStringLiteral *self); | |
| 1613 | ZIG_EXTERN_C uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i); | |
| 1614 | ZIG_EXTERN_C unsigned ZigClangStringLiteral_getLength(const struct ZigClangStringLiteral *self); | |
| 1615 | ZIG_EXTERN_C unsigned ZigClangStringLiteral_getCharByteWidth(const struct ZigClangStringLiteral *self); | |
| 1616 | ||
| 1617 | ZIG_EXTERN_C const char *ZigClangStringLiteral_getString_bytes_begin_size(const struct ZigClangStringLiteral *self, | |
| 1618 | size_t *len); | |
| 1619 | ||
| 1620 | ZIG_EXTERN_C const struct ZigClangStringLiteral *ZigClangPredefinedExpr_getFunctionName( | |
| 1621 | const struct ZigClangPredefinedExpr *self); | |
| 1622 | ||
| 1623 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangImplicitCastExpr_getBeginLoc(const struct ZigClangImplicitCastExpr *); | |
| 1624 | ZIG_EXTERN_C enum ZigClangCK ZigClangImplicitCastExpr_getCastKind(const struct ZigClangImplicitCastExpr *); | |
| 1625 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangImplicitCastExpr_getSubExpr(const struct ZigClangImplicitCastExpr *); | |
| 1626 | ||
| 1627 | ZIG_EXTERN_C struct ZigClangQualType ZigClangArrayType_getElementType(const struct ZigClangArrayType *); | |
| 1628 | ||
| 1629 | ZIG_EXTERN_C struct ZigClangQualType ZigClangIncompleteArrayType_getElementType(const struct ZigClangIncompleteArrayType *); | |
| 1630 | ||
| 1631 | ZIG_EXTERN_C struct ZigClangQualType ZigClangConstantArrayType_getElementType(const struct ZigClangConstantArrayType *); | |
| 1632 | ZIG_EXTERN_C void ZigClangConstantArrayType_getSize(const struct ZigClangConstantArrayType *, const struct ZigClangAPInt **result); | |
| 1633 | ||
| 1634 | ZIG_EXTERN_C const struct ZigClangValueDecl *ZigClangDeclRefExpr_getDecl(const struct ZigClangDeclRefExpr *); | |
| 1635 | ZIG_EXTERN_C const struct ZigClangNamedDecl *ZigClangDeclRefExpr_getFoundDecl(const struct ZigClangDeclRefExpr *); | |
| 1636 | ||
| 1637 | ZIG_EXTERN_C struct ZigClangQualType ZigClangParenType_getInnerType(const struct ZigClangParenType *); | |
| 1638 | ||
| 1639 | ZIG_EXTERN_C struct ZigClangQualType ZigClangAttributedType_getEquivalentType(const struct ZigClangAttributedType *); | |
| 1640 | ||
| 1641 | ZIG_EXTERN_C struct ZigClangQualType ZigClangMacroQualifiedType_getModifiedType(const struct ZigClangMacroQualifiedType *); | |
| 1642 | ||
| 1643 | ZIG_EXTERN_C struct ZigClangQualType ZigClangTypeOfType_getUnmodifiedType(const struct ZigClangTypeOfType *); | |
| 1644 | ||
| 1645 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangTypeOfExprType_getUnderlyingExpr(const struct ZigClangTypeOfExprType *); | |
| 1646 | ||
| 1647 | ZIG_EXTERN_C enum ZigClangOffsetOfNode_Kind ZigClangOffsetOfNode_getKind(const struct ZigClangOffsetOfNode *); | |
| 1648 | ZIG_EXTERN_C unsigned ZigClangOffsetOfNode_getArrayExprIndex(const struct ZigClangOffsetOfNode *); | |
| 1649 | ZIG_EXTERN_C struct ZigClangFieldDecl * ZigClangOffsetOfNode_getField(const struct ZigClangOffsetOfNode *); | |
| 1650 | ||
| 1651 | ZIG_EXTERN_C unsigned ZigClangOffsetOfExpr_getNumComponents(const struct ZigClangOffsetOfExpr *); | |
| 1652 | ZIG_EXTERN_C unsigned ZigClangOffsetOfExpr_getNumExpressions(const struct ZigClangOffsetOfExpr *); | |
| 1653 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangOffsetOfExpr_getIndexExpr(const struct ZigClangOffsetOfExpr *, unsigned idx); | |
| 1654 | ZIG_EXTERN_C const struct ZigClangOffsetOfNode *ZigClangOffsetOfExpr_getComponent(const struct ZigClangOffsetOfExpr *, unsigned idx); | |
| 1655 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangOffsetOfExpr_getBeginLoc(const struct ZigClangOffsetOfExpr *); | |
| 1656 | ||
| 1657 | ZIG_EXTERN_C struct ZigClangQualType ZigClangElaboratedType_getNamedType(const struct ZigClangElaboratedType *); | |
| 1658 | ZIG_EXTERN_C enum ZigClangElaboratedTypeKeyword ZigClangElaboratedType_getKeyword(const struct ZigClangElaboratedType *); | |
| 1659 | ||
| 1660 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCStyleCastExpr_getBeginLoc(const struct ZigClangCStyleCastExpr *); | |
| 1661 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCStyleCastExpr_getSubExpr(const struct ZigClangCStyleCastExpr *); | |
| 1662 | ZIG_EXTERN_C struct ZigClangQualType ZigClangCStyleCastExpr_getType(const struct ZigClangCStyleCastExpr *); | |
| 1663 | ||
| 1664 | ZIG_EXTERN_C bool ZigClangIntegerLiteral_EvaluateAsInt(const struct ZigClangIntegerLiteral *, struct ZigClangExprEvalResult *, const struct ZigClangASTContext *); | |
| 1665 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangIntegerLiteral_getBeginLoc(const struct ZigClangIntegerLiteral *); | |
| 1666 | ZIG_EXTERN_C bool ZigClangIntegerLiteral_getSignum(const struct ZigClangIntegerLiteral *, int *, const struct ZigClangASTContext *); | |
| 1667 | ||
| 1668 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangReturnStmt_getRetValue(const struct ZigClangReturnStmt *); | |
| 1669 | ||
| 1670 | ZIG_EXTERN_C enum ZigClangBO ZigClangBinaryOperator_getOpcode(const struct ZigClangBinaryOperator *); | |
| 1671 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangBinaryOperator_getBeginLoc(const struct ZigClangBinaryOperator *); | |
| 1672 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangBinaryOperator_getLHS(const struct ZigClangBinaryOperator *); | |
| 1673 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangBinaryOperator_getRHS(const struct ZigClangBinaryOperator *); | |
| 1674 | ZIG_EXTERN_C struct ZigClangQualType ZigClangBinaryOperator_getType(const struct ZigClangBinaryOperator *); | |
| 1675 | ||
| 1676 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangConvertVectorExpr_getSrcExpr(const struct ZigClangConvertVectorExpr *); | |
| 1677 | ZIG_EXTERN_C struct ZigClangQualType ZigClangConvertVectorExpr_getTypeSourceInfo_getType(const struct ZigClangConvertVectorExpr *); | |
| 1678 | ||
| 1679 | ZIG_EXTERN_C struct ZigClangQualType ZigClangDecayedType_getDecayedType(const struct ZigClangDecayedType *); | |
| 1680 | ||
| 1681 | ZIG_EXTERN_C const struct ZigClangCompoundStmt *ZigClangStmtExpr_getSubStmt(const struct ZigClangStmtExpr *); | |
| 1682 | ||
| 1683 | ZIG_EXTERN_C enum ZigClangCK ZigClangCastExpr_getCastKind(const struct ZigClangCastExpr *); | |
| 1684 | ZIG_EXTERN_C const struct ZigClangFieldDecl *ZigClangCastExpr_getTargetFieldForToUnionCast(const struct ZigClangCastExpr *, struct ZigClangQualType, struct ZigClangQualType); | |
| 1685 | ||
| 1686 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCharacterLiteral_getBeginLoc(const struct ZigClangCharacterLiteral *); | |
| 1687 | ZIG_EXTERN_C enum ZigClangCharacterLiteralKind ZigClangCharacterLiteral_getKind(const struct ZigClangCharacterLiteral *); | |
| 1688 | ZIG_EXTERN_C unsigned ZigClangCharacterLiteral_getValue(const struct ZigClangCharacterLiteral *); | |
| 1689 | ||
| 1690 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangChooseExpr_getChosenSubExpr(const struct ZigClangChooseExpr *); | |
| 1691 | ||
| 1692 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getCond(const struct ZigClangAbstractConditionalOperator *); | |
| 1693 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getTrueExpr(const struct ZigClangAbstractConditionalOperator *); | |
| 1694 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getFalseExpr(const struct ZigClangAbstractConditionalOperator *); | |
| 1695 | ||
| 1696 | ZIG_EXTERN_C struct ZigClangQualType ZigClangCompoundAssignOperator_getType(const struct ZigClangCompoundAssignOperator *); | |
| 1697 | ZIG_EXTERN_C struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationLHSType(const struct ZigClangCompoundAssignOperator *); | |
| 1698 | ZIG_EXTERN_C struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationResultType(const struct ZigClangCompoundAssignOperator *); | |
| 1699 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCompoundAssignOperator_getBeginLoc(const struct ZigClangCompoundAssignOperator *); | |
| 1700 | ZIG_EXTERN_C enum ZigClangBO ZigClangCompoundAssignOperator_getOpcode(const struct ZigClangCompoundAssignOperator *); | |
| 1701 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCompoundAssignOperator_getLHS(const struct ZigClangCompoundAssignOperator *); | |
| 1702 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCompoundAssignOperator_getRHS(const struct ZigClangCompoundAssignOperator *); | |
| 1703 | ||
| 1704 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCompoundLiteralExpr_getInitializer(const struct ZigClangCompoundLiteralExpr *); | |
| 1705 | ||
| 1706 | ZIG_EXTERN_C enum ZigClangUO ZigClangUnaryOperator_getOpcode(const struct ZigClangUnaryOperator *); | |
| 1707 | ZIG_EXTERN_C struct ZigClangQualType ZigClangUnaryOperator_getType(const struct ZigClangUnaryOperator *); | |
| 1708 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangUnaryOperator_getSubExpr(const struct ZigClangUnaryOperator *); | |
| 1709 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangUnaryOperator_getBeginLoc(const struct ZigClangUnaryOperator *); | |
| 1710 | ||
| 1711 | ZIG_EXTERN_C struct ZigClangQualType ZigClangValueDecl_getType(const struct ZigClangValueDecl *); | |
| 1712 | ||
| 1713 | ZIG_EXTERN_C struct ZigClangQualType ZigClangVectorType_getElementType(const struct ZigClangVectorType *); | |
| 1714 | ZIG_EXTERN_C unsigned ZigClangVectorType_getNumElements(const struct ZigClangVectorType *); | |
| 1715 | ||
| 1716 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangWhileStmt_getCond(const struct ZigClangWhileStmt *); | |
| 1717 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangWhileStmt_getBody(const struct ZigClangWhileStmt *); | |
| 1718 | ||
| 1719 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangIfStmt_getThen(const struct ZigClangIfStmt *); | |
| 1720 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangIfStmt_getElse(const struct ZigClangIfStmt *); | |
| 1721 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangIfStmt_getCond(const struct ZigClangIfStmt *); | |
| 1722 | ||
| 1723 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCallExpr_getCallee(const struct ZigClangCallExpr *); | |
| 1724 | ZIG_EXTERN_C unsigned ZigClangCallExpr_getNumArgs(const struct ZigClangCallExpr *); | |
| 1725 | ZIG_EXTERN_C const struct ZigClangExpr * const * ZigClangCallExpr_getArgs(const struct ZigClangCallExpr *); | |
| 1726 | ||
| 1727 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangMemberExpr_getBase(const struct ZigClangMemberExpr *); | |
| 1728 | ZIG_EXTERN_C bool ZigClangMemberExpr_isArrow(const struct ZigClangMemberExpr *); | |
| 1729 | ZIG_EXTERN_C const struct ZigClangValueDecl * ZigClangMemberExpr_getMemberDecl(const struct ZigClangMemberExpr *); | |
| 1730 | ||
| 1731 | ZIG_EXTERN_C const ZigClangExpr *ZigClangOpaqueValueExpr_getSourceExpr(const struct ZigClangOpaqueValueExpr *); | |
| 1732 | ||
| 1733 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangArraySubscriptExpr_getBase(const struct ZigClangArraySubscriptExpr *); | |
| 1734 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangArraySubscriptExpr_getIdx(const struct ZigClangArraySubscriptExpr *); | |
| 1735 | ||
| 1736 | ZIG_EXTERN_C struct ZigClangQualType ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument(const struct ZigClangUnaryExprOrTypeTraitExpr *); | |
| 1737 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc(const struct ZigClangUnaryExprOrTypeTraitExpr *); | |
| 1738 | ZIG_EXTERN_C enum ZigClangUnaryExprOrTypeTrait_Kind ZigClangUnaryExprOrTypeTraitExpr_getKind(const struct ZigClangUnaryExprOrTypeTraitExpr *); | |
| 1739 | ||
| 1740 | ZIG_EXTERN_C unsigned ZigClangShuffleVectorExpr_getNumSubExprs(const struct ZigClangShuffleVectorExpr *); | |
| 1741 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangShuffleVectorExpr_getExpr(const struct ZigClangShuffleVectorExpr *, unsigned); | |
| 1742 | ||
| 1743 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangDoStmt_getBody(const struct ZigClangDoStmt *); | |
| 1744 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangDoStmt_getCond(const struct ZigClangDoStmt *); | |
| 1745 | ||
| 1746 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangForStmt_getInit(const struct ZigClangForStmt *); | |
| 1747 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangForStmt_getCond(const struct ZigClangForStmt *); | |
| 1748 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangForStmt_getInc(const struct ZigClangForStmt *); | |
| 1749 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangForStmt_getBody(const struct ZigClangForStmt *); | |
| 1750 | ||
| 1751 | ZIG_EXTERN_C const struct ZigClangDeclStmt *ZigClangSwitchStmt_getConditionVariableDeclStmt(const struct ZigClangSwitchStmt *); | |
| 1752 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangSwitchStmt_getCond(const struct ZigClangSwitchStmt *); | |
| 1753 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangSwitchStmt_getBody(const struct ZigClangSwitchStmt *); | |
| 1754 | ZIG_EXTERN_C bool ZigClangSwitchStmt_isAllEnumCasesCovered(const struct ZigClangSwitchStmt *); | |
| 1755 | ||
| 1756 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCaseStmt_getLHS(const struct ZigClangCaseStmt *); | |
| 1757 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCaseStmt_getRHS(const struct ZigClangCaseStmt *); | |
| 1758 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCaseStmt_getBeginLoc(const struct ZigClangCaseStmt *); | |
| 1759 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangCaseStmt_getSubStmt(const struct ZigClangCaseStmt *); | |
| 1760 | ||
| 1761 | ZIG_EXTERN_C const struct ZigClangStmt *ZigClangDefaultStmt_getSubStmt(const struct ZigClangDefaultStmt *); | |
| 1762 | ||
| 1763 | ZIG_EXTERN_C const struct ZigClangExpr *ZigClangParenExpr_getSubExpr(const struct ZigClangParenExpr *); | |
| 1764 | ||
| 1765 | ZIG_EXTERN_C const char *ZigClangMacroDefinitionRecord_getName_getNameStart(const struct ZigClangMacroDefinitionRecord *); | |
| 1766 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getBegin(const struct ZigClangMacroDefinitionRecord *); | |
| 1767 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getEnd(const struct ZigClangMacroDefinitionRecord *); | |
| 1768 | ||
| 1769 | ZIG_EXTERN_C bool ZigClangFieldDecl_isBitField(const struct ZigClangFieldDecl *); | |
| 1770 | ZIG_EXTERN_C bool ZigClangFieldDecl_isAnonymousStructOrUnion(const ZigClangFieldDecl *); | |
| 1771 | ZIG_EXTERN_C struct ZigClangQualType ZigClangFieldDecl_getType(const struct ZigClangFieldDecl *); | |
| 1772 | ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFieldDecl_getLocation(const struct ZigClangFieldDecl *); | |
| 1773 | ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangFieldDecl_getParent(const struct ZigClangFieldDecl *); | |
| 1774 | ZIG_EXTERN_C unsigned ZigClangFieldDecl_getFieldIndex(const struct ZigClangFieldDecl *); | |
| 1775 | ||
| 1776 | ZIG_EXTERN_C const struct ZigClangAPSInt *ZigClangEnumConstantDecl_getInitVal(const struct ZigClangEnumConstantDecl *); | |
| 1777 | ZIG_EXTERN_C bool ZigClangIsLLVMUsingSeparateLibcxx(); | |
| 1778 | #endif |
test/behavior/vector.zig-22| ... | ... | @@ -885,28 +885,6 @@ test "vector @reduce comptime" { |
| 885 | 885 | try expect(is_all_true == false); |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | test "mask parameter of @shuffle is comptime scope" { | |
| 889 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 890 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 891 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 892 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 893 | ||
| 894 | const __v4hi = @Vector(4, i16); | |
| 895 | var v4_a = __v4hi{ 1, 2, 3, 4 }; | |
| 896 | var v4_b = __v4hi{ 5, 6, 7, 8 }; | |
| 897 | _ = .{ &v4_a, &v4_b }; | |
| 898 | const shuffled: __v4hi = @shuffle(i16, v4_a, v4_b, @Vector(4, i32){ | |
| 899 | std.zig.c_translation.shuffleVectorIndex(0, @typeInfo(@TypeOf(v4_a)).vector.len), | |
| 900 | std.zig.c_translation.shuffleVectorIndex(2, @typeInfo(@TypeOf(v4_a)).vector.len), | |
| 901 | std.zig.c_translation.shuffleVectorIndex(4, @typeInfo(@TypeOf(v4_a)).vector.len), | |
| 902 | std.zig.c_translation.shuffleVectorIndex(6, @typeInfo(@TypeOf(v4_a)).vector.len), | |
| 903 | }); | |
| 904 | try expect(shuffled[0] == 1); | |
| 905 | try expect(shuffled[1] == 3); | |
| 906 | try expect(shuffled[2] == 5); | |
| 907 | try expect(shuffled[3] == 7); | |
| 908 | } | |
| 909 | ||
| 910 | 888 | test "saturating add" { |
| 911 | 889 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 912 | 890 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
test/c_import.zig deleted-4| ... | ... | @@ -1,4 +0,0 @@ |
| 1 | test { | |
| 2 | _ = @import("c_import/c_char_signedness.zig"); | |
| 3 | _ = @import("c_import/macros.zig"); | |
| 4 | } |
test/c_import/c_char_signedness.zig deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | const expectEqual = std.testing.expectEqual; | |
| 4 | const c = @cImport({ | |
| 5 | @cInclude("limits.h"); | |
| 6 | }); | |
| 7 | ||
| 8 | test "c_char signedness" { | |
| 9 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 10 | ||
| 11 | try expectEqual(@as(c_char, c.CHAR_MIN), std.math.minInt(c_char)); | |
| 12 | try expectEqual(@as(c_char, c.CHAR_MAX), std.math.maxInt(c_char)); | |
| 13 | } |
test/c_import/macros.h deleted-70| ... | ... | @@ -1,70 +0,0 @@ |
| 1 | // initializer list expression | |
| 2 | typedef struct Color { | |
| 3 | unsigned char r; | |
| 4 | unsigned char g; | |
| 5 | unsigned char b; | |
| 6 | unsigned char a; | |
| 7 | } Color; | |
| 8 | #define CLITERAL(type) (type) | |
| 9 | #define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray | |
| 10 | ||
| 11 | #define MY_SIZEOF(x) ((int)sizeof(x)) | |
| 12 | #define MY_SIZEOF2(x) ((int)sizeof x) | |
| 13 | ||
| 14 | struct Foo { | |
| 15 | int a; | |
| 16 | }; | |
| 17 | ||
| 18 | union U { | |
| 19 | long l; | |
| 20 | double d; | |
| 21 | }; | |
| 22 | ||
| 23 | #define SIZE_OF_FOO sizeof(struct Foo) | |
| 24 | ||
| 25 | #define MAP_FAILED	((void *) -1) | |
| 26 | ||
| 27 | #define IGNORE_ME_1(x) ((void)(x)) | |
| 28 | #define IGNORE_ME_2(x) ((const void)(x)) | |
| 29 | #define IGNORE_ME_3(x) ((volatile void)(x)) | |
| 30 | #define IGNORE_ME_4(x) ((const volatile void)(x)) | |
| 31 | #define IGNORE_ME_5(x) ((volatile const void)(x)) | |
| 32 | ||
| 33 | #define IGNORE_ME_6(x) (void)(x) | |
| 34 | #define IGNORE_ME_7(x) (const void)(x) | |
| 35 | #define IGNORE_ME_8(x) (volatile void)(x) | |
| 36 | #define IGNORE_ME_9(x) (const volatile void)(x) | |
| 37 | #define IGNORE_ME_10(x) (volatile const void)(x) | |
| 38 | ||
| 39 | #define UNION_CAST(X) (union U)(X) | |
| 40 | #define CAST_OR_CALL_WITH_PARENS(type_or_fn, val) ((type_or_fn)(val)) | |
| 41 | ||
| 42 | #define NESTED_COMMA_OPERATOR (1, (2, 3)) | |
| 43 | #define NESTED_COMMA_OPERATOR_LHS (1, 2), 3 | |
| 44 | ||
| 45 | #include <stdint.h> | |
| 46 | #if !defined(__UINTPTR_MAX__) | |
| 47 | typedef _Bool uintptr_t; | |
| 48 | #endif | |
| 49 | ||
| 50 | #define CAST_TO_BOOL(X) (_Bool)(X) | |
| 51 | #define CAST_TO_UINTPTR(X) (uintptr_t)(X) | |
| 52 | ||
| 53 | #define LARGE_INT 18446744073709550592 | |
| 54 | ||
| 55 | #define EMBEDDED_TAB "hello	" | |
| 56 | ||
| 57 | #define DIVIDE_CONSTANT(version) (version / 1000) | |
| 58 | #define DIVIDE_ARGS(A, B) (A / B) | |
| 59 | ||
| 60 | #define REMAINDER_CONSTANT(version) (version % 10000) | |
| 61 | #define REMAINDER_ARGS(A, B) (A % B) | |
| 62 | ||
| 63 | #define LONG(x) x##L | |
| 64 | #define X LONG(10) | |
| 65 | ||
| 66 | #define BLANK_MACRO | |
| 67 | #define BLANK_CHILD_MACRO BLANK_MACRO BLANK_MACRO BLANK_MACRO | |
| 68 | #define MACRO_VALUE 0 | |
| 69 | typedef long def_type; | |
| 70 | #define BLANK_MACRO_CAST (BLANK_CHILD_MACRO def_type BLANK_CHILD_MACRO)MACRO_VALUE |
test/c_import/macros.zig deleted-239| ... | ... | @@ -1,239 +0,0 @@ |
| 1 | const builtin = @import("builtin"); | |
| 2 | const std = @import("std"); | |
| 3 | const expect = std.testing.expect; | |
| 4 | const expectEqual = std.testing.expectEqual; | |
| 5 | const expectEqualStrings = std.testing.expectEqualStrings; | |
| 6 | ||
| 7 | const h = @cImport(@cInclude("macros.h")); | |
| 8 | const latin1 = @cImport(@cInclude("macros_not_utf8.h")); | |
| 9 | ||
| 10 | test "casting to void with a macro" { | |
| 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 12 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 13 | ||
| 14 | h.IGNORE_ME_1(42); | |
| 15 | h.IGNORE_ME_2(42); | |
| 16 | h.IGNORE_ME_3(42); | |
| 17 | h.IGNORE_ME_4(42); | |
| 18 | h.IGNORE_ME_5(42); | |
| 19 | h.IGNORE_ME_6(42); | |
| 20 | h.IGNORE_ME_7(42); | |
| 21 | h.IGNORE_ME_8(42); | |
| 22 | h.IGNORE_ME_9(42); | |
| 23 | h.IGNORE_ME_10(42); | |
| 24 | } | |
| 25 | ||
| 26 | test "initializer list expression" { | |
| 27 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 28 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 29 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 30 | ||
| 31 | try expectEqual(h.Color{ | |
| 32 | .r = 200, | |
| 33 | .g = 200, | |
| 34 | .b = 200, | |
| 35 | .a = 255, | |
| 36 | }, h.LIGHTGRAY); | |
| 37 | } | |
| 38 | ||
| 39 | test "sizeof in macros" { | |
| 40 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 41 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 42 | ||
| 43 | try expect(@as(c_int, @sizeOf(u32)) == h.MY_SIZEOF(u32)); | |
| 44 | try expect(@as(c_int, @sizeOf(u32)) == h.MY_SIZEOF2(u32)); | |
| 45 | } | |
| 46 | ||
| 47 | test "reference to a struct type" { | |
| 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 49 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 50 | ||
| 51 | try expect(@sizeOf(h.struct_Foo) == h.SIZE_OF_FOO); | |
| 52 | } | |
| 53 | ||
| 54 | test "cast negative integer to pointer" { | |
| 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 57 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 58 | ||
| 59 | try expectEqual(@as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1))))), h.MAP_FAILED); | |
| 60 | } | |
| 61 | ||
| 62 | test "casting to union with a macro" { | |
| 63 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 65 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 66 | ||
| 67 | const l: c_long = 42; | |
| 68 | const d: f64 = 2.0; | |
| 69 | ||
| 70 | var casted = h.UNION_CAST(l); | |
| 71 | try expect(l == casted.l); | |
| 72 | ||
| 73 | casted = h.UNION_CAST(d); | |
| 74 | try expect(d == casted.d); | |
| 75 | } | |
| 76 | ||
| 77 | test "casting or calling a value with a paren-surrounded macro" { | |
| 78 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 79 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 80 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 81 | ||
| 82 | const l: c_long = 42; | |
| 83 | const casted = h.CAST_OR_CALL_WITH_PARENS(c_int, l); | |
| 84 | try expect(casted == @as(c_int, @intCast(l))); | |
| 85 | ||
| 86 | const Helper = struct { | |
| 87 | fn foo(n: c_int) !void { | |
| 88 | try expect(n == 42); | |
| 89 | } | |
| 90 | }; | |
| 91 | ||
| 92 | try h.CAST_OR_CALL_WITH_PARENS(Helper.foo, 42); | |
| 93 | } | |
| 94 | ||
| 95 | test "nested comma operator" { | |
| 96 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 97 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 98 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 99 | ||
| 100 | try expectEqual(@as(c_int, 3), h.NESTED_COMMA_OPERATOR); | |
| 101 | try expectEqual(@as(c_int, 3), h.NESTED_COMMA_OPERATOR_LHS); | |
| 102 | } | |
| 103 | ||
| 104 | test "cast functions" { | |
| 105 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 106 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 107 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 108 | ||
| 109 | const S = struct { | |
| 110 | fn foo() void {} | |
| 111 | }; | |
| 112 | try expectEqual(true, h.CAST_TO_BOOL(S.foo)); | |
| 113 | try expect(h.CAST_TO_UINTPTR(S.foo) != 0); | |
| 114 | } | |
| 115 | ||
| 116 | test "large integer macro" { | |
| 117 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 118 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 119 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 120 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 121 | ||
| 122 | try expectEqual(@as(c_ulonglong, 18446744073709550592), h.LARGE_INT); | |
| 123 | } | |
| 124 | ||
| 125 | test "string literal macro with embedded tab character" { | |
| 126 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 127 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 128 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 129 | ||
| 130 | try expectEqualStrings("hello\t", h.EMBEDDED_TAB); | |
| 131 | } | |
| 132 | ||
| 133 | test "string and char literals that are not UTF-8 encoded. Issue #12784" { | |
| 134 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 135 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 136 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 137 | ||
| 138 | try expectEqual(@as(u8, '\xA9'), latin1.UNPRINTABLE_CHAR); | |
| 139 | try expectEqualStrings("\xA9\xA9\xA9", latin1.UNPRINTABLE_STRING); | |
| 140 | } | |
| 141 | ||
| 142 | test "Macro that uses division operator. Issue #13162" { | |
| 143 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 147 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; | |
| 148 | ||
| 149 | try expectEqual(@as(c_int, 42), h.DIVIDE_CONSTANT(@as(c_int, 42_000))); | |
| 150 | try expectEqual(@as(c_uint, 42), h.DIVIDE_CONSTANT(@as(c_uint, 42_000))); | |
| 151 | ||
| 152 | try expectEqual( | |
| 153 | @as(f64, 42.0), | |
| 154 | h.DIVIDE_ARGS( | |
| 155 | @as(f64, 42.0), | |
| 156 | true, | |
| 157 | ), | |
| 158 | ); | |
| 159 | ||
| 160 | try expectEqual( | |
| 161 | @as(c_int, 21), | |
| 162 | h.DIVIDE_ARGS( | |
| 163 | @as(i8, 42), | |
| 164 | @as(i8, 2), | |
| 165 | ), | |
| 166 | ); | |
| 167 | ||
| 168 | try expectEqual( | |
| 169 | @as(c_uint, 21), | |
| 170 | h.DIVIDE_ARGS( | |
| 171 | @as(u32, 42), | |
| 172 | @as(u32, 2), | |
| 173 | ), | |
| 174 | ); | |
| 175 | ||
| 176 | try expectEqual( | |
| 177 | @as(c_int, 21), | |
| 178 | h.DIVIDE_ARGS( | |
| 179 | @as(c_ushort, 42), | |
| 180 | @as(c_ushort, 2), | |
| 181 | ), | |
| 182 | ); | |
| 183 | } | |
| 184 | ||
| 185 | test "Macro that uses remainder operator. Issue #13346" { | |
| 186 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 187 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 188 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | |
| 189 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 190 | ||
| 191 | try expectEqual(@as(c_int, 2_010), h.REMAINDER_CONSTANT(@as(c_int, 42_010))); | |
| 192 | try expectEqual(@as(c_uint, 2_030), h.REMAINDER_CONSTANT(@as(c_uint, 42_030))); | |
| 193 | ||
| 194 | try expectEqual( | |
| 195 | @as(c_int, 7), | |
| 196 | h.REMAINDER_ARGS( | |
| 197 | @as(i8, 17), | |
| 198 | @as(i8, 10), | |
| 199 | ), | |
| 200 | ); | |
| 201 | ||
| 202 | try expectEqual( | |
| 203 | @as(c_int, 5), | |
| 204 | h.REMAINDER_ARGS( | |
| 205 | @as(c_ushort, 25), | |
| 206 | @as(c_ushort, 20), | |
| 207 | ), | |
| 208 | ); | |
| 209 | ||
| 210 | try expectEqual( | |
| 211 | @as(c_int, 1), | |
| 212 | h.REMAINDER_ARGS( | |
| 213 | @as(c_int, 5), | |
| 214 | @as(c_int, -2), | |
| 215 | ), | |
| 216 | ); | |
| 217 | } | |
| 218 | ||
| 219 | test "@typeInfo on @cImport result" { | |
| 220 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 221 | ||
| 222 | try expect(@typeInfo(h).@"struct".decls.len > 1); | |
| 223 | } | |
| 224 | ||
| 225 | test "Macro that uses Long type concatenation casting" { | |
| 226 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 227 | ||
| 228 | try expect((@TypeOf(h.X)) == c_long); | |
| 229 | try expectEqual(h.X, @as(c_long, 10)); | |
| 230 | } | |
| 231 | ||
| 232 | test "Blank macros" { | |
| 233 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 234 | ||
| 235 | try expectEqual(h.BLANK_MACRO, ""); | |
| 236 | try expectEqual(h.BLANK_CHILD_MACRO, ""); | |
| 237 | try expect(@TypeOf(h.BLANK_MACRO_CAST) == h.def_type); | |
| 238 | try expectEqual(h.BLANK_MACRO_CAST, @as(c_long, 0)); | |
| 239 | } |
test/c_import/macros_not_utf8.h deleted-5| ... | ... | @@ -1,5 +0,0 @@ |
| 1 | // Note: This file is encoded with ISO/IEC 8859-1 (latin1), not UTF-8. | |
| 2 | // Do not change the encoding | |
| 3 | ||
| 4 | #define UNPRINTABLE_STRING "���" | |
| 5 | #define UNPRINTABLE_CHAR '�' |
test/cases/README.md-27| ... | ... | @@ -22,33 +22,6 @@ This will do `zig run` on the code and expect exit code 0. |
| 22 | 22 | // run |
| 23 | 23 | ``` |
| 24 | 24 | |
| 25 | ## Translate-c | |
| 26 | ||
| 27 | If you want to test translating C code to Zig use `translate-c`: | |
| 28 | ||
| 29 | ```c | |
| 30 | // translate-c | |
| 31 | // c_frontend=aro,clang | |
| 32 | // target=x86_64-linux | |
| 33 | // | |
| 34 | // pub const foo = 1; | |
| 35 | // pub const immediately_after_foo = 2; | |
| 36 | // | |
| 37 | // pub const somewhere_else_in_the_file = 3: | |
| 38 | ``` | |
| 39 | ||
| 40 | ## Run Translated C | |
| 41 | ||
| 42 | If you want to test translating C code to Zig and then executing it use `run-translated-c`: | |
| 43 | ||
| 44 | ```c | |
| 45 | // run-translated-c | |
| 46 | // c_frontend=aro,clang | |
| 47 | // target=x86_64-linux | |
| 48 | // | |
| 49 | // Hello world! | |
| 50 | ``` | |
| 51 | ||
| 52 | 25 | ## Incremental Compilation |
| 53 | 26 | |
| 54 | 27 | Make multiple files that have ".", and then an integer, before the ".zig" |
test/cases/run_translated_c/compound_assignments_with_implicit_casts.c deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | int main() { | |
| 2 | int i = 2; | |
| 3 | float f = 3.2f; | |
| 4 | ||
| 5 | i += 1.7; | |
| 6 | if (i != 3) return 1; | |
| 7 | i += f; | |
| 8 | if (i != 6) return 2; | |
| 9 | ||
| 10 | ||
| 11 | f += 2UL; | |
| 12 | if (f <= 5.1999 || f >= 5.2001) return 3; | |
| 13 | f += i; | |
| 14 | if (f <= 11.1999 || f >= 11.2001) return 4; | |
| 15 | ||
| 16 | return 0; | |
| 17 | } | |
| 18 | ||
| 19 | // run-translated-c | |
| 20 | // c_frontend=clang |
test/cases/run_translated_c/compound_assignments_with_pointer_arithmetic.c deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | int main() { | |
| 2 | const char *s = "forgreatjustice"; | |
| 3 | unsigned int add = 1; | |
| 4 | ||
| 5 | s += add; | |
| 6 | if (*s != 'o') return 1; | |
| 7 | ||
| 8 | s += 1UL; | |
| 9 | if (*s != 'r') return 2; | |
| 10 | ||
| 11 | const char *s2 = (s += add); | |
| 12 | if (*s2 != 'g') return 3; | |
| 13 | ||
| 14 | s2 -= add; | |
| 15 | if (*s2 != 'r') return 4; | |
| 16 | ||
| 17 | return 0; | |
| 18 | } | |
| 19 | ||
| 20 | // run-translated-c | |
| 21 | // c_frontend=clang |
test/cases/run_translated_c/dereference address of.c	 deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | #include <stdlib.h> | |
| 2 | int main(void) { | |
| 3 | int i = 0; | |
| 4 | *&i = 42; | |
| 5 | if (i != 42) abort(); | |
| 6 | return 0; | |
| 7 | } | |
| 8 | ||
| 9 | // run-translated-c | |
| 10 | // c_frontend=clang | |
| 11 | // link_libc=true |
test/cases/run_translated_c/explicit_cast_bool_from_float.c deleted-10| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | #include <stdbool.h> | |
| 2 | ||
| 3 | int main() { | |
| 4 | float f = 2.0f; | |
| 5 | bool b = (bool) f; | |
| 6 | return 0; | |
| 7 | } | |
| 8 | ||
| 9 | // run-translated-c | |
| 10 | // c_frontend=clang |
test/cases/run_translated_c/extern_typedef_variables_in_functions.c deleted-22| ... | ... | @@ -1,22 +0,0 @@ |
| 1 | const int ev = 40; | |
| 2 | ||
| 3 | static int func(void) | |
| 4 | { | |
| 5 | typedef int test_type_t; | |
| 6 | extern const test_type_t ev; | |
| 7 | // Ensure mangled name is also being used for conditions and loops, see #20828 | |
| 8 | if (ev == 0); | |
| 9 | while (ev == 0); | |
| 10 | do; while (ev == 0); | |
| 11 | return ev + 2; | |
| 12 | } | |
| 13 | ||
| 14 | int main() | |
| 15 | { | |
| 16 | if (func() != 42) | |
| 17 | return 1; | |
| 18 | return 0; | |
| 19 | } | |
| 20 | ||
| 21 | // run-translated-c | |
| 22 | // c_frontend=clang |
test/cases/run_translated_c/float_from_bool_expr_cast.c deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | int main() { | |
| 2 | float f = (float)(10.0f > 1.0f); | |
| 3 | return 0; | |
| 4 | } | |
| 5 | ||
| 6 | // run-translated-c | |
| 7 | // c_frontend=clang | |
| 8 | // |
test/cases/run_translated_c/sub_scope_extern_local_var_ref.c deleted-23| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | #include <stdlib.h> | |
| 2 | int a = 42; | |
| 3 | int foo(int bar) { | |
| 4 | extern int a; | |
| 5 | if (bar) { | |
| 6 | return a; | |
| 7 | } | |
| 8 | return 0; | |
| 9 | } | |
| 10 | int main() { | |
| 11 | int result1 = foo(0); | |
| 12 | if (result1 != 0) abort(); | |
| 13 | int result2 = foo(1); | |
| 14 | if (result2 != 42) abort(); | |
| 15 | a = 100; | |
| 16 | int result3 = foo(1); | |
| 17 | if (result3 != 100) abort(); | |
| 18 | return 0; | |
| 19 | } | |
| 20 | ||
| 21 | // run-translated-c | |
| 22 | // c_frontend=clang | |
| 23 | // link_libc=true |
test/cases/translate_c/_Static_assert.c deleted-7| ... | ... | @@ -1,7 +0,0 @@ |
| 1 | _Static_assert(1 == 1, ""); | |
| 2 | ||
| 3 | // translate-c | |
| 4 | // target=x86_64-linux | |
| 5 | // c_frontend=aro | |
| 6 | // | |
| 7 | // tmp.c:1:1: warning: ignoring _Static_assert declaration |
test/cases/translate_c/align() attribute.c	 deleted-17| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | __attribute__ ((aligned(128))) | |
| 2 | extern char my_array[16]; | |
| 3 | __attribute__ ((aligned(128))) | |
| 4 | void my_fn(void) { } | |
| 5 | void other_fn(void) { | |
| 6 | char ARR[16] __attribute__ ((aligned (16))); | |
| 7 | } | |
| 8 | ||
| 9 | // translate-c | |
| 10 | // c_frontend=clang | |
| 11 | // | |
| 12 | // pub extern var my_array: [16]u8 align(128); | |
| 13 | // pub export fn my_fn() align(128) void {} | |
| 14 | // pub export fn other_fn() void { | |
| 15 | // var ARR: [16]u8 align(16) = undefined; | |
| 16 | // _ = &ARR; | |
| 17 | // } |
test/cases/translate_c/assert_with_strlit.c deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | ||
| 2 | void assert(int x) {} | |
| 3 | #define FOO assert(0 && "error message") | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=clang | |
| 7 | // | |
| 8 | // pub const FOO = assert((@as(c_int, 0) != 0) and (@intFromPtr("error message") != 0)); |
test/cases/translate_c/atomic types.c	 deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | typedef _Atomic(int) AtomicInt; | |
| 2 | ||
| 3 | // translate-c | |
| 4 | // target=x86_64-linux | |
| 5 | // c_frontend=aro | |
| 6 | // | |
| 7 | // tmp.c:1:22: warning: unsupported type: '_Atomic(int)' | |
| 8 | // pub const AtomicInt = @compileError("unable to resolve typedef child type"); |
test/cases/translate_c/c_keywords_as_macro_function_parameters.c deleted-82| ... | ... | @@ -1,82 +0,0 @@ |
| 1 | #define GUARDED_INT_ADDITION(int) ((int) + 1) | |
| 2 | ||
| 3 | #define UNGUARDED_INT_SUBTRACTION(int) (int - 2) | |
| 4 | ||
| 5 | #define GUARDED_INT_MULTIPLY(int) ((int) * 3) | |
| 6 | ||
| 7 | #define UNGUARDED_INT_DIVIDE(int) (int / 4) | |
| 8 | ||
| 9 | #define WRAPPED_RETURN(return) ((return) % 2) | |
| 10 | ||
| 11 | #define UNWRAPPED_RETURN(return) (return ^ 0x7F) | |
| 12 | ||
| 13 | #define WITH_TWO_PARAMETERS(signed, x) ((signed) + (x) + 9) | |
| 14 | ||
| 15 | #define GUARDED_ALIGNOF(_Alignof) ((_Alignof) & 0x55) | |
| 16 | ||
| 17 | #define UNGUARDED_ALIGNOF(_Alignof) (_Alignof | 0x80) | |
| 18 | ||
| 19 | #define GUARDED_SIZEOF(sizeof) ((sizeof) == 64) | |
| 20 | ||
| 21 | #define UNGUARDED_SIZEOF(sizeof) (sizeof < 64) | |
| 22 | ||
| 23 | #define SIZEOF(x) ((int)sizeof(x)) | |
| 24 | ||
| 25 | #define SIZEOF2(x) ((int)sizeof x) | |
| 26 | ||
| 27 | // translate-c | |
| 28 | // c_frontend=clang | |
| 29 | // | |
| 30 | // pub inline fn GUARDED_INT_ADDITION(int: anytype) @TypeOf(int + @as(c_int, 1)) { | |
| 31 | // _ = &int; | |
| 32 | // return int + @as(c_int, 1); | |
| 33 | // } | |
| 34 | // pub inline fn UNGUARDED_INT_SUBTRACTION(int: anytype) @TypeOf(int - @as(c_int, 2)) { | |
| 35 | // _ = &int; | |
| 36 | // return int - @as(c_int, 2); | |
| 37 | // } | |
| 38 | // pub inline fn GUARDED_INT_MULTIPLY(int: anytype) @TypeOf(int * @as(c_int, 3)) { | |
| 39 | // _ = &int; | |
| 40 | // return int * @as(c_int, 3); | |
| 41 | // } | |
| 42 | // pub inline fn UNGUARDED_INT_DIVIDE(int: anytype) @TypeOf(@import("std").zig.c_translation.MacroArithmetic.div(int, @as(c_int, 4))) { | |
| 43 | // _ = &int; | |
| 44 | // return @import("std").zig.c_translation.MacroArithmetic.div(int, @as(c_int, 4)); | |
| 45 | // } | |
| 46 | // pub inline fn WRAPPED_RETURN(@"return": anytype) @TypeOf(@import("std").zig.c_translation.MacroArithmetic.rem(@"return", @as(c_int, 2))) { | |
| 47 | // _ = &@"return"; | |
| 48 | // return @import("std").zig.c_translation.MacroArithmetic.rem(@"return", @as(c_int, 2)); | |
| 49 | // } | |
| 50 | // pub inline fn UNWRAPPED_RETURN(@"return": anytype) @TypeOf(@"return" ^ @as(c_int, 0x7F)) { | |
| 51 | // _ = &@"return"; | |
| 52 | // return @"return" ^ @as(c_int, 0x7F); | |
| 53 | // } | |
| 54 | // pub inline fn WITH_TWO_PARAMETERS(signed: anytype, x: anytype) @TypeOf((signed + x) + @as(c_int, 9)) { | |
| 55 | // _ = &signed; | |
| 56 | // _ = &x; | |
| 57 | // return (signed + x) + @as(c_int, 9); | |
| 58 | // } | |
| 59 | // pub inline fn GUARDED_ALIGNOF(_Alignof: anytype) @TypeOf(_Alignof & @as(c_int, 0x55)) { | |
| 60 | // _ = &_Alignof; | |
| 61 | // return _Alignof & @as(c_int, 0x55); | |
| 62 | // } | |
| 63 | // pub inline fn UNGUARDED_ALIGNOF(_Alignof: anytype) @TypeOf(_Alignof | @as(c_int, 0x80)) { | |
| 64 | // _ = &_Alignof; | |
| 65 | // return _Alignof | @as(c_int, 0x80); | |
| 66 | // } | |
| 67 | // pub inline fn GUARDED_SIZEOF(sizeof: anytype) @TypeOf(sizeof == @as(c_int, 64)) { | |
| 68 | // _ = &sizeof; | |
| 69 | // return sizeof == @as(c_int, 64); | |
| 70 | // } | |
| 71 | // pub inline fn UNGUARDED_SIZEOF(sizeof: anytype) @TypeOf(sizeof < @as(c_int, 64)) { | |
| 72 | // _ = &sizeof; | |
| 73 | // return sizeof < @as(c_int, 64); | |
| 74 | // } | |
| 75 | // pub inline fn SIZEOF(x: anytype) c_int { | |
| 76 | // _ = &x; | |
| 77 | // return @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.sizeof(x)); | |
| 78 | // } | |
| 79 | // pub inline fn SIZEOF2(x: anytype) c_int { | |
| 80 | // _ = &x; | |
| 81 | // return @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.sizeof(x)); | |
| 82 | // } |
test/cases/translate_c/circular_struct_definitions.c deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | struct Bar; | |
| 2 | ||
| 3 | struct Foo { | |
| 4 | struct Bar *next; | |
| 5 | }; | |
| 6 | ||
| 7 | struct Bar { | |
| 8 | struct Foo *next; | |
| 9 | }; | |
| 10 | ||
| 11 | // translate-c | |
| 12 | // c_frontend=clang | |
| 13 | // | |
| 14 | // pub const struct_Bar = extern struct { | |
| 15 | // next: [*c]struct_Foo = @import("std").mem.zeroes([*c]struct_Foo), | |
| 16 | // }; | |
| 17 | // | |
| 18 | // pub const struct_Foo = extern struct { | |
| 19 | // next: [*c]struct_Bar = @import("std").mem.zeroes([*c]struct_Bar), | |
| 20 | // }; |
test/cases/translate_c/continue_from_while.c deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | void foo() { | |
| 2 | for (;;) { | |
| 3 | continue; | |
| 4 | } | |
| 5 | } | |
| 6 | ||
| 7 | // translate-c | |
| 8 | // c_frontend=clang | |
| 9 | // | |
| 10 | // pub export fn foo() void { | |
| 11 | // while (true) { | |
| 12 | // continue; | |
| 13 | // } | |
| 14 | // } |
test/cases/translate_c/double_define_struct.c deleted-25| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | typedef struct Bar Bar; | |
| 2 | typedef struct Foo Foo; | |
| 3 | ||
| 4 | struct Foo { | |
| 5 | Foo *a; | |
| 6 | }; | |
| 7 | ||
| 8 | struct Bar { | |
| 9 | Foo *a; | |
| 10 | }; | |
| 11 | ||
| 12 | // translate-c | |
| 13 | // c_frontend=clang | |
| 14 | // | |
| 15 | // pub const struct_Foo = extern struct { | |
| 16 | // a: [*c]Foo = @import("std").mem.zeroes([*c]Foo), | |
| 17 | // }; | |
| 18 | // | |
| 19 | // pub const Foo = struct_Foo; | |
| 20 | // | |
| 21 | // pub const struct_Bar = extern struct { | |
| 22 | // a: [*c]Foo = @import("std").mem.zeroes([*c]Foo), | |
| 23 | // }; | |
| 24 | // | |
| 25 | // pub const Bar = struct_Bar; |
test/cases/translate_c/empty declaration.c	 deleted-6| ... | ... | @@ -1,6 +0,0 @@ |
| 1 | ; | |
| 2 | ||
| 3 | // translate-c | |
| 4 | // c_frontend=clang,aro | |
| 5 | // | |
| 6 | // | |
| \ No newline at end of file |
test/cases/translate_c/empty union initializer list.c	 deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | union U { | |
| 2 | int x; | |
| 3 | long y; | |
| 4 | }; | |
| 5 | ||
| 6 | void foo(void) { | |
| 7 | union U u = {}; | |
| 8 | } | |
| 9 | // translate-c | |
| 10 | // target=x86_64-linux | |
| 11 | // c_frontend=clang | |
| 12 | // | |
| 13 | // pub const union_U = extern union { | |
| 14 | // x: c_int, | |
| 15 | // y: c_long, | |
| 16 | // }; | |
| 17 | // pub export fn foo() void { | |
| 18 | // var u: union_U = @import("std").mem.zeroes(union_U); | |
| 19 | // _ = &u; | |
| 20 | // } |
test/cases/translate_c/enums msvc.c	 deleted-16| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | enum Foo { | |
| 2 | FooA = 2, | |
| 3 | FooB = 5, | |
| 4 | Foo1, | |
| 5 | }; | |
| 6 | ||
| 7 | // translate-c | |
| 8 | // target=x86_64-windows-msvc | |
| 9 | // c_frontend=clang | |
| 10 | // | |
| 11 | // pub const FooA: c_int = 2; | |
| 12 | // pub const FooB: c_int = 5; | |
| 13 | // pub const Foo1: c_int = 6; | |
| 14 | // pub const enum_Foo = c_int; | |
| 15 | // | |
| 16 | // pub const Foo = enum_Foo; |
test/cases/translate_c/enums.c deleted-16| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | enum Foo { | |
| 2 | FooA = 2, | |
| 3 | FooB = 5, | |
| 4 | Foo1, | |
| 5 | }; | |
| 6 | ||
| 7 | // translate-c | |
| 8 | // target=x86_64-linux | |
| 9 | // c_frontend=clang,aro | |
| 10 | // | |
| 11 | // pub const FooA: c_int = 2; | |
| 12 | // pub const FooB: c_int = 5; | |
| 13 | // pub const Foo1: c_int = 6; | |
| 14 | // pub const enum_Foo = c_uint; | |
| 15 | // | |
| 16 | // pub const Foo = enum_Foo; |
test/cases/translate_c/field_access_is_grouped_if_necessary.c deleted-18| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | unsigned long foo(unsigned long x) { | |
| 2 | return ((union{unsigned long _x}){x})._x; | |
| 3 | } | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=clang | |
| 7 | // | |
| 8 | // pub export fn foo(arg_x: c_ulong) c_ulong { | |
| 9 | // var x = arg_x; | |
| 10 | // _ = &x; | |
| 11 | // const union_unnamed_1 = extern union { | |
| 12 | // _x: c_ulong, | |
| 13 | // }; | |
| 14 | // _ = &union_unnamed_1; | |
| 15 | // return (union_unnamed_1{ | |
| 16 | // ._x = x, | |
| 17 | // })._x; | |
| 18 | // } |
test/cases/translate_c/function prototype with parenthesis.c	 deleted-10| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | void (f0) (void *L); | |
| 2 | void ((f1)) (void *L); | |
| 3 | void (((f2))) (void *L); | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=clang,aro | |
| 7 | // | |
| 8 | // pub extern fn f0(L: ?*anyopaque) void; | |
| 9 | // pub extern fn f1(L: ?*anyopaque) void; | |
| 10 | // pub extern fn f2(L: ?*anyopaque) void; |
test/cases/translate_c/global_struct_whose_default_name_conflicts_with_global_is_mangled.c deleted-15| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | struct foo { | |
| 2 | int x; | |
| 3 | }; | |
| 4 | const char *struct_foo = "hello world"; | |
| 5 | ||
| 6 | // translate-c | |
| 7 | // c_frontend=clang | |
| 8 | // | |
| 9 | // pub const struct_foo_1 = extern struct { | |
| 10 | // x: c_int = @import("std").mem.zeroes(c_int), | |
| 11 | // }; | |
| 12 | // | |
| 13 | // pub const foo = struct_foo_1; | |
| 14 | // | |
| 15 | // pub export var struct_foo: [*c]const u8 = "hello world"; |
test/cases/translate_c/large_packed_struct.c deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | struct __attribute__((packed)) bar { | |
| 2 | short a; | |
| 3 | float b; | |
| 4 | double c; | |
| 5 | short x; | |
| 6 | float y; | |
| 7 | double z; | |
| 8 | }; | |
| 9 | ||
| 10 | // translate-c | |
| 11 | // c_frontend=aro,clang | |
| 12 | // | |
| 13 | // pub const struct_bar = extern struct { | |
| 14 | // a: c_short align(1) = @import("std").mem.zeroes(c_short), | |
| 15 | // b: f32 align(1) = @import("std").mem.zeroes(f32), | |
| 16 | // c: f64 align(1) = @import("std").mem.zeroes(f64), | |
| 17 | // x: c_short align(1) = @import("std").mem.zeroes(c_short), | |
| 18 | // y: f32 align(1) = @import("std").mem.zeroes(f32), | |
| 19 | // z: f64 align(1) = @import("std").mem.zeroes(f64), | |
| 20 | // }; |
test/cases/translate_c/macro_calling_convention.c deleted-9| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | #define SYSV_ABI __attribute__((sysv_abi)) | |
| 2 | void SYSV_ABI foo(void); | |
| 3 | ||
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=clang | |
| 7 | // target=x86_64-windows | |
| 8 | // | |
| 9 | // pub extern fn foo() callconv(.{ .x86_64_sysv = .{} }) void; |
test/cases/translate_c/macro_function_string_concat.c deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | #define bar() "" | |
| 2 | #define FOO bar() "," bar() | |
| 3 | ||
| 4 | // translate-c | |
| 5 | // target=x86_64-linux | |
| 6 | // c_frontend=clang | |
| 7 | // | |
| 8 | // pub inline fn bar() @TypeOf("") { | |
| 9 | // return ""; | |
| 10 | // } | |
| 11 | // pub const FOO = bar() ++ "," ++ bar(); |
test/cases/translate_c/macro_referencing_var.c deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | extern float foo; | |
| 2 | #define FOO_TWICE foo * 2.0f | |
| 3 | #define FOO_NEGATIVE -foo | |
| 4 | ||
| 5 | #define BAR 10.0f | |
| 6 | #define BAR_TWICE BAR * 2.0f | |
| 7 | ||
| 8 | // translate-c | |
| 9 | // c_frontend=clang | |
| 10 | // | |
| 11 | // pub extern var foo: f32; | |
| 12 | // | |
| 13 | // pub inline fn FOO_TWICE() @TypeOf(foo * @as(f32, 2.0)) { | |
| 14 | // return foo * @as(f32, 2.0); | |
| 15 | // } | |
| 16 | // | |
| 17 | // pub inline fn FOO_NEGATIVE() @TypeOf(-foo) { | |
| 18 | // return -foo; | |
| 19 | // } | |
| 20 | // pub const BAR = @as(f32, 10.0); | |
| 21 | // pub const BAR_TWICE = BAR * @as(f32, 2.0); |
test/cases/translate_c/noreturn attribute.c	 deleted-6| ... | ... | @@ -1,6 +0,0 @@ |
| 1 | void foo(void) __attribute__((noreturn)); | |
| 2 | ||
| 3 | // translate-c | |
| 4 | // c_frontend=aro,clang | |
| 5 | // | |
| 6 | // pub extern fn foo() noreturn; |
test/cases/translate_c/packed_union_nested_unpacked.c deleted-25| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | // NOTE: The nested struct is *not* packed/aligned, | |
| 2 | // even though the parent struct is | |
| 3 | // this is consistent with GCC docs | |
| 4 | union Foo{ | |
| 5 | short x; | |
| 6 | double y; | |
| 7 | struct { | |
| 8 | int b; | |
| 9 | } z; | |
| 10 | } __attribute__((packed)); | |
| 11 | ||
| 12 | // translate-c | |
| 13 | // c_frontend=aro,clang | |
| 14 | // | |
| 15 | // const struct_unnamed_1 = extern struct { | |
| 16 | // b: c_int = @import("std").mem.zeroes(c_int), | |
| 17 | // }; | |
| 18 | // | |
| 19 | // pub const union_Foo = extern union { | |
| 20 | // x: c_short align(1), | |
| 21 | // y: f64 align(1), | |
| 22 | // z: struct_unnamed_1 align(1), | |
| 23 | // }; | |
| 24 | // | |
| 25 | // pub const Foo = union_Foo; |
test/cases/translate_c/packed_union_simple.c deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | union Foo { | |
| 2 | short x; | |
| 3 | double y; | |
| 4 | } __attribute__((packed)); | |
| 5 | ||
| 6 | // translate-c | |
| 7 | // c_frontend=aro,clang | |
| 8 | // | |
| 9 | // pub const union_Foo = extern union { | |
| 10 | // x: c_short align(1), | |
| 11 | // y: f64 align(1), | |
| 12 | // }; | |
| 13 | // | |
| 14 | // pub const Foo = union_Foo; |
test/cases/translate_c/pointer_to_struct_demoted_opaque_due_to_bit_fields.c deleted-15| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | struct Foo { | |
| 2 | unsigned int: 1; | |
| 3 | }; | |
| 4 | struct Bar { | |
| 5 | struct Foo *foo; | |
| 6 | }; | |
| 7 | ||
| 8 | // translate-c | |
| 9 | // c_frontend=clang | |
| 10 | // | |
| 11 | // pub const struct_Foo = opaque {}; | |
| 12 | // | |
| 13 | // pub const struct_Bar = extern struct { | |
| 14 | // foo: ?*struct_Foo = @import("std").mem.zeroes(?*struct_Foo), | |
| 15 | // }; |
test/cases/translate_c/qualified_struct_and_enum.c deleted-25| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | struct Foo { | |
| 2 | int x; | |
| 3 | int y; | |
| 4 | }; | |
| 5 | enum Bar { | |
| 6 | BarA, | |
| 7 | BarB, | |
| 8 | }; | |
| 9 | void func(struct Foo *a, enum Bar **b); | |
| 10 | ||
| 11 | // translate-c | |
| 12 | // c_frontend=clang | |
| 13 | // target=x86_64-linux,x86_64-macos | |
| 14 | // | |
| 15 | // pub const struct_Foo = extern struct { | |
| 16 | // x: c_int = @import("std").mem.zeroes(c_int), | |
| 17 | // y: c_int = @import("std").mem.zeroes(c_int), | |
| 18 | // }; | |
| 19 | // pub const BarA: c_int = 0; | |
| 20 | // pub const BarB: c_int = 1; | |
| 21 | // pub const enum_Bar = c_uint; | |
| 22 | // pub extern fn func(a: [*c]struct_Foo, b: [*c][*c]enum_Bar) void; | |
| 23 | // | |
| 24 | // pub const Foo = struct_Foo; | |
| 25 | // pub const Bar = enum_Bar; |
test/cases/translate_c/qualified_struct_and_enum_msvc.c deleted-25| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | struct Foo { | |
| 2 | int x; | |
| 3 | int y; | |
| 4 | }; | |
| 5 | enum Bar { | |
| 6 | BarA, | |
| 7 | BarB, | |
| 8 | }; | |
| 9 | void func(struct Foo *a, enum Bar **b); | |
| 10 | ||
| 11 | // translate-c | |
| 12 | // c_frontend=clang | |
| 13 | // target=x86_64-windows-msvc | |
| 14 | // | |
| 15 | // pub const struct_Foo = extern struct { | |
| 16 | // x: c_int = @import("std").mem.zeroes(c_int), | |
| 17 | // y: c_int = @import("std").mem.zeroes(c_int), | |
| 18 | // }; | |
| 19 | // pub const BarA: c_int = 0; | |
| 20 | // pub const BarB: c_int = 1; | |
| 21 | // pub const enum_Bar = c_int; | |
| 22 | // pub extern fn func(a: [*c]struct_Foo, b: [*c][*c]enum_Bar) void; | |
| 23 | // | |
| 24 | // pub const Foo = struct_Foo; | |
| 25 | // pub const Bar = enum_Bar; |
test/cases/translate_c/scoped_record.c deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | void foo() { | |
| 2 | 	struct Foo { | |
| 3 | 		int A; | |
| 4 | 		int B; | |
| 5 | 		int C; | |
| 6 | 	}; | |
| 7 | 	struct Foo a = {0}; | |
| 8 | 	{ | |
| 9 | 		struct Foo { | |
| 10 | 			int A; | |
| 11 | 			int B; | |
| 12 | 			int C; | |
| 13 | 		}; | |
| 14 | 		struct Foo a = {0}; | |
| 15 | 	} | |
| 16 | } | |
| 17 | ||
| 18 | // translate-c | |
| 19 | // c_frontend=clang | |
| 20 | // | |
| 21 | // pub export fn foo() void { | |
| 22 | // const struct_Foo = extern struct { | |
| 23 | // A: c_int = @import("std").mem.zeroes(c_int), | |
| 24 | // B: c_int = @import("std").mem.zeroes(c_int), | |
| 25 | // C: c_int = @import("std").mem.zeroes(c_int), | |
| 26 | // }; | |
| 27 | // _ = &struct_Foo; | |
| 28 | // var a: struct_Foo = struct_Foo{ | |
| 29 | // .A = @as(c_int, 0), | |
| 30 | // .B = 0, | |
| 31 | // .C = 0, | |
| 32 | // }; | |
| 33 | // _ = &a; | |
| 34 | // { | |
| 35 | // const struct_Foo_1 = extern struct { | |
| 36 | // A: c_int = @import("std").mem.zeroes(c_int), | |
| 37 | // B: c_int = @import("std").mem.zeroes(c_int), | |
| 38 | // C: c_int = @import("std").mem.zeroes(c_int), | |
| 39 | // }; | |
| 40 | // _ = &struct_Foo_1; | |
| 41 | // var a_2: struct_Foo_1 = struct_Foo_1{ | |
| 42 | // .A = @as(c_int, 0), | |
| 43 | // .B = 0, | |
| 44 | // .C = 0, | |
| 45 | // }; | |
| 46 | // _ = &a_2; | |
| 47 | // } | |
| 48 | // } | |
| 49 |
test/cases/translate_c/simple function prototypes.c	 deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | void __attribute__((noreturn)) foo(void); | |
| 2 | int bar(void); | |
| 3 | ||
| 4 | // translate-c | |
| 5 | // c_frontend=clang,aro | |
| 6 | // | |
| 7 | // pub extern fn foo() noreturn; | |
| 8 | // pub extern fn bar() c_int; |
test/cases/translate_c/simple_struct.c deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | struct Foo { | |
| 2 | int x; | |
| 3 | }; | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=aro,clang | |
| 7 | // | |
| 8 | // const struct_Foo = extern struct { | |
| 9 | // x: c_int = @import("std").mem.zeroes(c_int), | |
| 10 | // }; | |
| 11 | // | |
| 12 | // pub const Foo = struct_Foo; |
test/cases/translate_c/simple_union.c deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | union Foo { | |
| 2 | int x; | |
| 3 | }; | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=aro,clang | |
| 7 | // | |
| 8 | // pub const union_Foo = extern union { | |
| 9 | // x: c_int, | |
| 10 | // }; | |
| 11 | // | |
| 12 | // pub const Foo = union_Foo; |
test/cases/translate_c/static empty struct.c	 deleted-17| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | struct empty_struct {}; | |
| 2 | ||
| 3 | static inline void foo() { | |
| 4 | static struct empty_struct bar = {}; | |
| 5 | } | |
| 6 | ||
| 7 | // translate-c | |
| 8 | // target=x86_64-linux | |
| 9 | // c_frontend=clang | |
| 10 | // | |
| 11 | // pub const struct_empty_struct = extern struct {}; | |
| 12 | // pub fn foo() callconv(.c) void { | |
| 13 | // const bar = struct { | |
| 14 | // var static: struct_empty_struct = @import("std").mem.zeroes(struct_empty_struct); | |
| 15 | // }; | |
| 16 | // _ = &bar; | |
| 17 | // } |
test/cases/translate_c/strlit_as_bool.c deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | void foo() { if(0 && "error message") {} } | |
| 2 | ||
| 3 | // translate-c | |
| 4 | // c_frontend=clang | |
| 5 | // | |
| 6 | // pub export fn foo() void { | |
| 7 | // if (false and (@intFromPtr("error message") != 0)) {} | |
| 8 | // } |
test/cases/translate_c/struct prototype used in func.c	 deleted-10| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | struct Foo; | |
| 2 | struct Foo *some_func(struct Foo *foo, int x); | |
| 3 | ||
| 4 | // translate-c | |
| 5 | // c_frontend=clang,aro | |
| 6 | // | |
| 7 | // pub const struct_Foo = opaque {}; | |
| 8 | // pub extern fn some_func(foo: ?*struct_Foo, x: c_int) ?*struct_Foo; | |
| 9 | // | |
| 10 | // pub const Foo = struct_Foo; |
test/cases/translate_c/struct_in_struct_init_to_zero.c deleted-24| ... | ... | @@ -1,24 +0,0 @@ |
| 1 | struct Foo { | |
| 2 | int a; | |
| 3 | struct Bar { | |
| 4 | int a; | |
| 5 | } b; | |
| 6 | } a = {}; | |
| 7 | #define PTR void * | |
| 8 | ||
| 9 | // translate-c | |
| 10 | // c_frontend=clang | |
| 11 | // | |
| 12 | // pub const struct_Bar_1 = extern struct { | |
| 13 | // a: c_int = @import("std").mem.zeroes(c_int), | |
| 14 | // }; | |
| 15 | // pub const struct_Foo = extern struct { | |
| 16 | // a: c_int = @import("std").mem.zeroes(c_int), | |
| 17 | // b: struct_Bar_1 = @import("std").mem.zeroes(struct_Bar_1), | |
| 18 | // }; | |
| 19 | // pub export var a: struct_Foo = struct_Foo{ | |
| 20 | // .a = 0, | |
| 21 | // .b = @import("std").mem.zeroes(struct_Bar_1), | |
| 22 | // }; | |
| 23 | // | |
| 24 | // pub const PTR = ?*anyopaque; |
test/cases/translate_c/struct_with_aligned_fields.c deleted-10| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | struct foo { | |
| 2 | __attribute__((aligned(4))) short bar; | |
| 3 | }; | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=aro,clang | |
| 7 | // | |
| 8 | // pub const struct_foo = extern struct { | |
| 9 | // bar: c_short align(4) = @import("std").mem.zeroes(c_short), | |
| 10 | // }; |
test/cases/translate_c/struct_with_invalid_field_alignment.c deleted-35| ... | ... | @@ -1,35 +0,0 @@ |
| 1 | // The aligned attribute cannot decrease the alignment of a field. The packed attribute is required | |
| 2 | // for decreasing the alignment. gcc and clang will compile these structs without error | |
| 3 | // (and possibly without warning), but checking the alignment will reveal a different value than | |
| 4 | // what was requested. This is consistent with the gcc documentation on type attributes. | |
| 5 | // | |
| 6 | // This test is currently broken for the clang frontend. See issue #19307. | |
| 7 | ||
| 8 | struct foo { | |
| 9 | __attribute__((aligned(1)))int x; | |
| 10 | }; | |
| 11 | ||
| 12 | struct bar { | |
| 13 | __attribute__((aligned(2)))float y; | |
| 14 | }; | |
| 15 | ||
| 16 | struct baz { | |
| 17 | __attribute__((aligned(4)))double z; | |
| 18 | }; | |
| 19 | ||
| 20 | // translate-c | |
| 21 | // c_frontend=aro | |
| 22 | // target=x86_64-linux | |
| 23 | // | |
| 24 | // pub const struct_foo = extern struct { | |
| 25 | // x: c_int = @import("std").mem.zeroes(c_int), | |
| 26 | // }; | |
| 27 | // | |
| 28 | // pub const struct_bar = extern struct { | |
| 29 | // y: f32 = @import("std").mem.zeroes(f32), | |
| 30 | // }; | |
| 31 | // | |
| 32 | // pub const struct_baz = extern struct { | |
| 33 | // z: f64 = @import("std").mem.zeroes(f64), | |
| 34 | // }; | |
| 35 | // |
test/cases/translate_c/type_referenced_struct.c deleted-19| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | // When clang uses the <arch>-windows-none, triple it behaves as MSVC and | |
| 2 | // interprets the inner `struct Bar` as an anonymous structure | |
| 3 | struct Foo { | |
| 4 | struct Bar{ | |
| 5 | int b; | |
| 6 | }; | |
| 7 | struct Bar c; | |
| 8 | }; | |
| 9 | ||
| 10 | // translate-c | |
| 11 | // c_frontend=aro,clang | |
| 12 | // target=x86_64-linux-gnu | |
| 13 | // | |
| 14 | // pub const struct_Bar_1 = extern struct { | |
| 15 | // b: c_int = @import("std").mem.zeroes(c_int), | |
| 16 | // }; | |
| 17 | // pub const struct_Foo = extern struct { | |
| 18 | // c: struct_Bar_1 = @import("std").mem.zeroes(struct_Bar_1), | |
| 19 | // }; |
test/cases/translate_c/union_initializer.c deleted-22| ... | ... | @@ -1,22 +0,0 @@ |
| 1 | union { int x; char c[4]; } | |
| 2 | ua = {1}, | |
| 3 | ub = {.c={'a','b','b','a'}}; | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=clang | |
| 7 | // | |
| 8 | // const union_unnamed_1 = extern union { | |
| 9 | // x: c_int, | |
| 10 | // c: [4]u8, | |
| 11 | // }; | |
| 12 | // pub export var ua: union_unnamed_1 = union_unnamed_1{ | |
| 13 | // .x = @as(c_int, 1), | |
| 14 | // }; | |
| 15 | // pub export var ub: union_unnamed_1 = union_unnamed_1{ | |
| 16 | // .c = [4]u8{ | |
| 17 | // 'a', | |
| 18 | // 'b', | |
| 19 | // 'b', | |
| 20 | // 'a', | |
| 21 | // }, | |
| 22 | // }; |
test/cases/translate_c/union_struct_forward_decl.c deleted-37| ... | ... | @@ -1,37 +0,0 @@ |
| 1 | struct A; | |
| 2 | union B; | |
| 3 | enum C; | |
| 4 | ||
| 5 | struct A { | |
| 6 | short x; | |
| 7 | double y; | |
| 8 | }; | |
| 9 | ||
| 10 | union B { | |
| 11 | short x; | |
| 12 | double y; | |
| 13 | }; | |
| 14 | ||
| 15 | struct Foo { | |
| 16 | struct A a; | |
| 17 | union B b; | |
| 18 | }; | |
| 19 | ||
| 20 | ||
| 21 | // translate-c | |
| 22 | // c_frontend=aro,clang | |
| 23 | // | |
| 24 | // pub const struct_A = extern struct { | |
| 25 | // x: c_short = @import("std").mem.zeroes(c_short), | |
| 26 | // y: f64 = @import("std").mem.zeroes(f64), | |
| 27 | // }; | |
| 28 | // | |
| 29 | // pub const union_B = extern union { | |
| 30 | // x: c_short, | |
| 31 | // y: f64, | |
| 32 | // }; | |
| 33 | // | |
| 34 | // pub const struct_Foo = extern struct { | |
| 35 | // a: struct_A = @import("std").mem.zeroes(struct_A), | |
| 36 | // b: union_B = @import("std").mem.zeroes(union_B), | |
| 37 | // }; |
test/cases/translate_c/unnamed_fields_have_predictable_names.c deleted-22| ... | ... | @@ -1,22 +0,0 @@ |
| 1 | struct a { | |
| 2 | struct { int x; }; | |
| 3 | }; | |
| 4 | struct b { | |
| 5 | struct { int y; }; | |
| 6 | }; | |
| 7 | ||
| 8 | // translate-c | |
| 9 | // c_frontend=aro,clang | |
| 10 | // | |
| 11 | // const struct_unnamed_1 = extern struct { | |
| 12 | // x: c_int = @import("std").mem.zeroes(c_int), | |
| 13 | // }; | |
| 14 | // pub const struct_a = extern struct { | |
| 15 | // unnamed_0: struct_unnamed_1 = @import("std").mem.zeroes(struct_unnamed_1), | |
| 16 | // }; | |
| 17 | // const struct_unnamed_2 = extern struct { | |
| 18 | // y: c_int = @import("std").mem.zeroes(c_int), | |
| 19 | // }; | |
| 20 | // pub const struct_b = extern struct { | |
| 21 | // unnamed_0: struct_unnamed_2 = @import("std").mem.zeroes(struct_unnamed_2), | |
| 22 | // }; |
test/cases/translate_c/void_pointer_subtraction.c deleted-16| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | #include <stddef.h> | |
| 2 | ptrdiff_t sub_ptr(void *a, void *b) { | |
| 3 | return a - b; | |
| 4 | } | |
| 5 | ||
| 6 | // translate-c | |
| 7 | // c_frontend=clang | |
| 8 | // target=x86_64-linux | |
| 9 | // | |
| 10 | // pub export fn sub_ptr(arg_a: ?*anyopaque, arg_b: ?*anyopaque) ptrdiff_t { | |
| 11 | // var a = arg_a; | |
| 12 | // _ = &a; | |
| 13 | // var b = arg_b; | |
| 14 | // _ = &b; | |
| 15 | // return @as(c_long, @bitCast(@intFromPtr(a) -% @intFromPtr(b))); | |
| 16 | // } |
test/cases/translate_c/zero_width_field_alignment.c deleted-18| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | struct __attribute__((packed)) foo { | |
| 2 | int x; | |
| 3 | struct {}; | |
| 4 | float y; | |
| 5 | union {}; | |
| 6 | }; | |
| 7 | ||
| 8 | // translate-c | |
| 9 | // c_frontend=aro | |
| 10 | // | |
| 11 | // const struct_unnamed_1 = extern struct {}; | |
| 12 | // const union_unnamed_2 = extern union {}; | |
| 13 | // pub const struct_foo = extern struct { | |
| 14 | // x: c_int align(1) = @import("std").mem.zeroes(c_int), | |
| 15 | // unnamed_0: struct_unnamed_1 align(1) = @import("std").mem.zeroes(struct_unnamed_1), | |
| 16 | // y: f32 align(1) = @import("std").mem.zeroes(f32), | |
| 17 | // unnamed_1: union_unnamed_2 align(1) = @import("std").mem.zeroes(union_unnamed_2), | |
| 18 | // }; |
test/cases/translate_c/zig_keywords_in_c_code.c deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | struct comptime { | |
| 2 | int defer; | |
| 3 | }; | |
| 4 | ||
| 5 | // translate-c | |
| 6 | // c_frontend=aro,clang | |
| 7 | // | |
| 8 | // pub const struct_comptime = extern struct { | |
| 9 | // @"defer": c_int = @import("std").mem.zeroes(c_int), | |
| 10 | // }; | |
| 11 | // | |
| 12 | // pub const @"comptime" = struct_comptime; |
test/run_translated_c.zig deleted-1825| ... | ... | @@ -1,1825 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const tests = @import("tests.zig"); | |
| 3 | const nl = if (@import("builtin").os.tag == .windows) "\r\n" else "\n"; | |
| 4 | ||
| 5 | // ********************************************************* | |
| 6 | // * * | |
| 7 | // * DO NOT ADD NEW CASES HERE * | |
| 8 | // * instead add a file to test/cases/run_translated_c * | |
| 9 | // * * | |
| 10 | // ********************************************************* | |
| 11 | ||
| 12 | pub fn addCases(cases: *tests.RunTranslatedCContext) void { | |
| 13 | cases.add("division of floating literals", | |
| 14 | \\#define _NO_CRT_STDIO_INLINE 1 | |
| 15 | \\#include <stdio.h> | |
| 16 | \\#define PI 3.14159265358979323846f | |
| 17 | \\#define DEG2RAD (PI/180.0f) | |
| 18 | \\int main(void) { | |
| 19 | \\ printf("DEG2RAD is: %f\n", DEG2RAD); | |
| 20 | \\ return 0; | |
| 21 | \\} | |
| 22 | , "DEG2RAD is: 0.017453" ++ nl); | |
| 23 | ||
| 24 | cases.add("use global scope for record/enum/typedef type translation if needed", | |
| 25 | \\void bar(void); | |
| 26 | \\void baz(void); | |
| 27 | \\struct foo { int x; }; | |
| 28 | \\void bar() { | |
| 29 | \\ struct foo tmp; | |
| 30 | \\} | |
| 31 | \\ | |
| 32 | \\void baz() { | |
| 33 | \\ struct foo tmp; | |
| 34 | \\} | |
| 35 | \\ | |
| 36 | \\int main(void) { | |
| 37 | \\ bar(); | |
| 38 | \\ baz(); | |
| 39 | \\ return 0; | |
| 40 | \\} | |
| 41 | , ""); | |
| 42 | ||
| 43 | cases.add("failed macros are only declared once", | |
| 44 | \\#define FOO = | |
| 45 | \\#define FOO = | |
| 46 | \\#define PtrToPtr64(p) ((void *POINTER_64) p) | |
| 47 | \\#define STRUC_ALIGNED_STACK_COPY(t,s) ((CONST t *)(s)) | |
| 48 | \\#define bar = 0x | |
| 49 | \\#define baz = 0b | |
| 50 | \\int main(void) {} | |
| 51 | , ""); | |
| 52 | ||
| 53 | cases.add("parenthesized string literal", | |
| 54 | \\void foo(const char *s) {} | |
| 55 | \\int main(void) { | |
| 56 | \\ foo(("bar")); | |
| 57 | \\} | |
| 58 | , ""); | |
| 59 | ||
| 60 | cases.add("variable shadowing type type", | |
| 61 | \\#include <stdlib.h> | |
| 62 | \\int main() { | |
| 63 | \\ int type = 1; | |
| 64 | \\ if (type != 1) abort(); | |
| 65 | \\} | |
| 66 | , ""); | |
| 67 | ||
| 68 | cases.add("assignment as expression", | |
| 69 | \\#include <stdlib.h> | |
| 70 | \\int main() { | |
| 71 | \\ int a, b, c, d = 5; | |
| 72 | \\ int e = a = b = c = d; | |
| 73 | \\ if (e != 5) abort(); | |
| 74 | \\} | |
| 75 | , ""); | |
| 76 | ||
| 77 | cases.add("static variable in block scope", | |
| 78 | \\#include <stdlib.h> | |
| 79 | \\int foo() { | |
| 80 | \\ static int bar; | |
| 81 | \\ bar += 1; | |
| 82 | \\ return bar; | |
| 83 | \\} | |
| 84 | \\int main() { | |
| 85 | \\ foo(); | |
| 86 | \\ foo(); | |
| 87 | \\ if (foo() != 3) abort(); | |
| 88 | \\} | |
| 89 | , ""); | |
| 90 | ||
| 91 | cases.add("array initializer", | |
| 92 | \\#include <stdlib.h> | |
| 93 | \\int main(int argc, char **argv) { | |
| 94 | \\ int a0[4] = {1}; | |
| 95 | \\ int a1[4] = {1,2,3,4}; | |
| 96 | \\ int s0 = 0, s1 = 0; | |
| 97 | \\ for (int i = 0; i < 4; i++) { | |
| 98 | \\ s0 += a0[i]; | |
| 99 | \\ s1 += a1[i]; | |
| 100 | \\ } | |
| 101 | \\ if (s0 != 1) abort(); | |
| 102 | \\ if (s1 != 10) abort(); | |
| 103 | \\} | |
| 104 | , ""); | |
| 105 | ||
| 106 | cases.add("forward declarations", | |
| 107 | \\#include <stdlib.h> | |
| 108 | \\int foo(int); | |
| 109 | \\int foo(int x) { return x + 1; } | |
| 110 | \\int main(int argc, char **argv) { | |
| 111 | \\ if (foo(2) != 3) abort(); | |
| 112 | \\ return 0; | |
| 113 | \\} | |
| 114 | , ""); | |
| 115 | ||
| 116 | cases.add("typedef and function pointer", | |
| 117 | \\#include <stdlib.h> | |
| 118 | \\typedef struct _Foo Foo; | |
| 119 | \\typedef int Ret; | |
| 120 | \\typedef int Param; | |
| 121 | \\struct _Foo { Ret (*func)(Param p); }; | |
| 122 | \\static Ret add1(Param p) { | |
| 123 | \\ return p + 1; | |
| 124 | \\} | |
| 125 | \\int main(int argc, char **argv) { | |
| 126 | \\ Foo strct = { .func = add1 }; | |
| 127 | \\ if (strct.func(16) != 17) abort(); | |
| 128 | \\ return 0; | |
| 129 | \\} | |
| 130 | , ""); | |
| 131 | ||
| 132 | cases.add("ternary operator", | |
| 133 | \\#include <stdlib.h> | |
| 134 | \\static int cnt = 0; | |
| 135 | \\int foo() { cnt++; return 42; } | |
| 136 | \\int main(int argc, char **argv) { | |
| 137 | \\ short q = 3; | |
| 138 | \\ signed char z0 = q?:1; | |
| 139 | \\ if (z0 != 3) abort(); | |
| 140 | \\ int z1 = 3?:1; | |
| 141 | \\ if (z1 != 3) abort(); | |
| 142 | \\ int z2 = foo()?:-1; | |
| 143 | \\ if (z2 != 42) abort(); | |
| 144 | \\ if (cnt != 1) abort(); | |
| 145 | \\ return 0; | |
| 146 | \\} | |
| 147 | , ""); | |
| 148 | ||
| 149 | cases.add("switch case", | |
| 150 | \\#include <stdlib.h> | |
| 151 | \\int lottery(unsigned int x) { | |
| 152 | \\ switch (x) { | |
| 153 | \\ case 3: return 0; | |
| 154 | \\ case -1: return 3; | |
| 155 | \\ case 8 ... 10: return x; | |
| 156 | \\ default: return -1; | |
| 157 | \\ } | |
| 158 | \\} | |
| 159 | \\int main(int argc, char **argv) { | |
| 160 | \\ if (lottery(2) != -1) abort(); | |
| 161 | \\ if (lottery(3) != 0) abort(); | |
| 162 | \\ if (lottery(-1) != 3) abort(); | |
| 163 | \\ if (lottery(9) != 9) abort(); | |
| 164 | \\ return 0; | |
| 165 | \\} | |
| 166 | , ""); | |
| 167 | ||
| 168 | cases.add("boolean values and expressions", | |
| 169 | \\#include <stdlib.h> | |
| 170 | \\static const _Bool false_val = 0; | |
| 171 | \\static const _Bool true_val = 1; | |
| 172 | \\void foo(int x, int y) { | |
| 173 | \\ _Bool r = x < y; | |
| 174 | \\ if (!r) abort(); | |
| 175 | \\ _Bool self = foo; | |
| 176 | \\ if (self == false_val) abort(); | |
| 177 | \\ if (((r) ? 'a' : 'b') != 'a') abort(); | |
| 178 | \\} | |
| 179 | \\int main(int argc, char **argv) { | |
| 180 | \\ foo(2, 5); | |
| 181 | \\ if (false_val == true_val) abort(); | |
| 182 | \\ return 0; | |
| 183 | \\} | |
| 184 | , ""); | |
| 185 | ||
| 186 | cases.add("hello world", | |
| 187 | \\#define _NO_CRT_STDIO_INLINE 1 | |
| 188 | \\#include <stdio.h> | |
| 189 | \\int main(int argc, char **argv) { | |
| 190 | \\ printf("hello, world!\n"); | |
| 191 | \\ return 0; | |
| 192 | \\} | |
| 193 | , "hello, world!" ++ nl); | |
| 194 | ||
| 195 | cases.add("anon struct init", | |
| 196 | \\#include <stdlib.h> | |
| 197 | \\struct {int a; int b;} x = {1, 2}; | |
| 198 | \\int main(int argc, char **argv) { | |
| 199 | \\ x.a += 2; | |
| 200 | \\ x.b += 1; | |
| 201 | \\ if (x.a != 3) abort(); | |
| 202 | \\ if (x.b != 3) abort(); | |
| 203 | \\ return 0; | |
| 204 | \\} | |
| 205 | , ""); | |
| 206 | ||
| 207 | cases.add("casting away const and volatile", | |
| 208 | \\void foo(int *a) {} | |
| 209 | \\void bar(const int *a) { | |
| 210 | \\ foo((int *)a); | |
| 211 | \\} | |
| 212 | \\void baz(volatile int *a) { | |
| 213 | \\ foo((int *)a); | |
| 214 | \\} | |
| 215 | \\int main(int argc, char **argv) { | |
| 216 | \\ int a = 0; | |
| 217 | \\ bar((const int *)&a); | |
| 218 | \\ baz((volatile int *)&a); | |
| 219 | \\ return 0; | |
| 220 | \\} | |
| 221 | , ""); | |
| 222 | ||
| 223 | cases.add("anonymous struct & unions", | |
| 224 | \\#include <stdlib.h> | |
| 225 | \\#include <stdint.h> | |
| 226 | \\static struct { struct { uint16_t x, y; }; } x = { 1 }; | |
| 227 | \\static struct { union { uint32_t x; uint8_t y; }; } y = { 0x55AA55AA }; | |
| 228 | \\int main(int argc, char **argv) { | |
| 229 | \\ if (x.x != 1) abort(); | |
| 230 | \\ if (x.y != 0) abort(); | |
| 231 | \\ if (y.x != 0x55AA55AA) abort(); | |
| 232 | \\ if (y.y != 0xAA) abort(); | |
| 233 | \\ return 0; | |
| 234 | \\} | |
| 235 | , ""); | |
| 236 | ||
| 237 | cases.add("array to pointer decay", | |
| 238 | \\#include <stdlib.h> | |
| 239 | \\int main(int argc, char **argv) { | |
| 240 | \\ char data[3] = {'a','b','c'}; | |
| 241 | \\ if (2[data] != data[2]) abort(); | |
| 242 | \\ if ("abc"[1] != data[1]) abort(); | |
| 243 | \\ char *as_ptr = data; | |
| 244 | \\ if (2[as_ptr] != as_ptr[2]) abort(); | |
| 245 | \\ if ("abc"[1] != as_ptr[1]) abort(); | |
| 246 | \\ return 0; | |
| 247 | \\} | |
| 248 | , ""); | |
| 249 | ||
| 250 | cases.add("struct initializer - packed", | |
| 251 | \\#define _NO_CRT_STDIO_INLINE 1 | |
| 252 | \\#include <stdint.h> | |
| 253 | \\#include <stdlib.h> | |
| 254 | \\struct s {uint8_t x,y; | |
| 255 | \\ uint32_t z;} __attribute__((packed)) s0 = {1, 2}; | |
| 256 | \\int main() { | |
| 257 | \\ /* sizeof nor offsetof currently supported */ | |
| 258 | \\ if (((intptr_t)&s0.z - (intptr_t)&s0.x) != 2) abort(); | |
| 259 | \\ return 0; | |
| 260 | \\} | |
| 261 | , ""); | |
| 262 | ||
| 263 | cases.add("cast signed array index to unsigned", | |
| 264 | \\#include <stdlib.h> | |
| 265 | \\int main(int argc, char **argv) { | |
| 266 | \\ int a[10], i = 0; | |
| 267 | \\ a[i] = 0; | |
| 268 | \\ if (a[i] != 0) abort(); | |
| 269 | \\ return 0; | |
| 270 | \\} | |
| 271 | , ""); | |
| 272 | ||
| 273 | cases.add("cast long long array index to unsigned", | |
| 274 | \\#include <stdlib.h> | |
| 275 | \\int main(int argc, char **argv) { | |
| 276 | \\ long long a[10], i = 0; | |
| 277 | \\ a[i] = 0; | |
| 278 | \\ if (a[i] != 0) abort(); | |
| 279 | \\ return 0; | |
| 280 | \\} | |
| 281 | , ""); | |
| 282 | ||
| 283 | cases.add("case boolean expression converted to int", | |
| 284 | \\#include <stdlib.h> | |
| 285 | \\int main(int argc, char **argv) { | |
| 286 | \\ int value = 1 + 2 * 3 + 4 * 5 + 6 << 7 | 8 == 9; | |
| 287 | \\ if (value != 4224) abort(); | |
| 288 | \\ return 0; | |
| 289 | \\} | |
| 290 | , ""); | |
| 291 | ||
| 292 | cases.add("case boolean expression on left converted to int", | |
| 293 | \\#include <stdlib.h> | |
| 294 | \\int main(int argc, char **argv) { | |
| 295 | \\ int value = 8 == 9 | 1 + 2 * 3 + 4 * 5 + 6 << 7; | |
| 296 | \\ if (value != 4224) abort(); | |
| 297 | \\ return 0; | |
| 298 | \\} | |
| 299 | , ""); | |
| 300 | ||
| 301 | cases.add("case boolean and operator+ converts bool to int", | |
| 302 | \\#include <stdlib.h> | |
| 303 | \\int main(int argc, char **argv) { | |
| 304 | \\ int value = (8 == 9) + 3; | |
| 305 | \\ int value2 = 3 + (8 == 9); | |
| 306 | \\ if (value != value2) abort(); | |
| 307 | \\ return 0; | |
| 308 | \\} | |
| 309 | , ""); | |
| 310 | ||
| 311 | cases.add("case boolean and operator<", | |
| 312 | \\#include <stdlib.h> | |
| 313 | \\int main(int argc, char **argv) { | |
| 314 | \\ int value = (8 == 9) < 3; | |
| 315 | \\ if (value == 0) abort(); | |
| 316 | \\ return 0; | |
| 317 | \\} | |
| 318 | , ""); | |
| 319 | ||
| 320 | cases.add("case boolean and operator*", | |
| 321 | \\#include <stdlib.h> | |
| 322 | \\int main(int argc, char **argv) { | |
| 323 | \\ int value = (8 == 9) * 3; | |
| 324 | \\ int value2 = 3 * (9 == 9); | |
| 325 | \\ if (value != 0) abort(); | |
| 326 | \\ if (value2 == 0) abort(); | |
| 327 | \\ return 0; | |
| 328 | \\} | |
| 329 | , ""); | |
| 330 | ||
| 331 | cases.add("scoped typedef", | |
| 332 | \\int main(int argc, char **argv) { | |
| 333 | \\ typedef int Foo; | |
| 334 | \\ typedef Foo Bar; | |
| 335 | \\ typedef void (*func)(int); | |
| 336 | \\ typedef int uint32_t; | |
| 337 | \\ uint32_t a; | |
| 338 | \\ Foo i; | |
| 339 | \\ Bar j; | |
| 340 | \\ return 0; | |
| 341 | \\} | |
| 342 | , ""); | |
| 343 | ||
| 344 | cases.add("scoped for loops with shadowing", | |
| 345 | \\#include <stdlib.h> | |
| 346 | \\int main() { | |
| 347 | \\ int count = 0; | |
| 348 | \\ for (int x = 0; x < 2; x++) | |
| 349 | \\ for (int x = 0; x < 2; x++) | |
| 350 | \\ count++; | |
| 351 | \\ | |
| 352 | \\ if (count != 4) abort(); | |
| 353 | \\ return 0; | |
| 354 | \\} | |
| 355 | , ""); | |
| 356 | ||
| 357 | cases.add("array value type casts properly", | |
| 358 | \\#include <stdlib.h> | |
| 359 | \\unsigned int choose[53][10]; | |
| 360 | \\static int hash_binary(int k) | |
| 361 | \\{ | |
| 362 | \\ choose[0][k] = 3; | |
| 363 | \\ int sum = 0; | |
| 364 | \\ sum += choose[0][k]; | |
| 365 | \\ return sum; | |
| 366 | \\} | |
| 367 | \\ | |
| 368 | \\int main() { | |
| 369 | \\ int s = hash_binary(4); | |
| 370 | \\ if (s != 3) abort(); | |
| 371 | \\ return 0; | |
| 372 | \\} | |
| 373 | , ""); | |
| 374 | ||
| 375 | cases.add("array value type casts properly use +=", | |
| 376 | \\#include <stdlib.h> | |
| 377 | \\static int hash_binary(int k) | |
| 378 | \\{ | |
| 379 | \\ unsigned int choose[1][1] = {{3}}; | |
| 380 | \\ int sum = -1; | |
| 381 | \\ int prev = 0; | |
| 382 | \\ prev = sum += choose[0][0]; | |
| 383 | \\ if (sum != 2) abort(); | |
| 384 | \\ return sum + prev; | |
| 385 | \\} | |
| 386 | \\ | |
| 387 | \\int main() { | |
| 388 | \\ int x = hash_binary(4); | |
| 389 | \\ if (x != 4) abort(); | |
| 390 | \\ return 0; | |
| 391 | \\} | |
| 392 | , ""); | |
| 393 | ||
| 394 | cases.add("ensure array casts outside +=", | |
| 395 | \\#include <stdlib.h> | |
| 396 | \\static int hash_binary(int k) | |
| 397 | \\{ | |
| 398 | \\ unsigned int choose[3] = {1, 2, 3}; | |
| 399 | \\ int sum = -2; | |
| 400 | \\ int prev = sum + choose[k]; | |
| 401 | \\ if (prev != 0) abort(); | |
| 402 | \\ return sum + prev; | |
| 403 | \\} | |
| 404 | \\ | |
| 405 | \\int main() { | |
| 406 | \\ int x = hash_binary(1); | |
| 407 | \\ if (x != -2) abort(); | |
| 408 | \\ return 0; | |
| 409 | \\} | |
| 410 | , ""); | |
| 411 | ||
| 412 | cases.add("array cast int to uint", | |
| 413 | \\#include <stdlib.h> | |
| 414 | \\static unsigned int hash_binary(int k) | |
| 415 | \\{ | |
| 416 | \\ int choose[3] = {-1, -2, 3}; | |
| 417 | \\ unsigned int sum = 2; | |
| 418 | \\ sum += choose[k]; | |
| 419 | \\ return sum; | |
| 420 | \\} | |
| 421 | \\ | |
| 422 | \\int main() { | |
| 423 | \\ unsigned int x = hash_binary(1); | |
| 424 | \\ if (x != 0) abort(); | |
| 425 | \\ return 0; | |
| 426 | \\} | |
| 427 | , ""); | |
| 428 | ||
| 429 | cases.add("assign enum to uint, no explicit cast", | |
| 430 | \\#include <stdlib.h> | |
| 431 | \\typedef enum { | |
| 432 | \\ ENUM_0 = 0, | |
| 433 | \\ ENUM_1 = 1, | |
| 434 | \\} my_enum_t; | |
| 435 | \\ | |
| 436 | \\int main() { | |
| 437 | \\ my_enum_t val = ENUM_1; | |
| 438 | \\ unsigned int x = val; | |
| 439 | \\ if (x != 1) abort(); | |
| 440 | \\ return 0; | |
| 441 | \\} | |
| 442 | , ""); | |
| 443 | ||
| 444 | cases.add("assign enum to int", | |
| 445 | \\#include <stdlib.h> | |
| 446 | \\typedef enum { | |
| 447 | \\ ENUM_0 = 0, | |
| 448 | \\ ENUM_1 = 1, | |
| 449 | \\} my_enum_t; | |
| 450 | \\ | |
| 451 | \\int main() { | |
| 452 | \\ my_enum_t val = ENUM_1; | |
| 453 | \\ int x = val; | |
| 454 | \\ if (x != 1) abort(); | |
| 455 | \\ return 0; | |
| 456 | \\} | |
| 457 | , ""); | |
| 458 | ||
| 459 | cases.add("cast enum to smaller uint", | |
| 460 | \\#include <stdlib.h> | |
| 461 | \\#include <stdint.h> | |
| 462 | \\typedef enum { | |
| 463 | \\ ENUM_0 = 0, | |
| 464 | \\ ENUM_257 = 257, | |
| 465 | \\} my_enum_t; | |
| 466 | \\ | |
| 467 | \\int main() { | |
| 468 | \\ my_enum_t val = ENUM_257; | |
| 469 | \\ uint8_t x = (uint8_t)val; | |
| 470 | \\ if (x != (uint8_t)257) abort(); | |
| 471 | \\ return 0; | |
| 472 | \\} | |
| 473 | , ""); | |
| 474 | ||
| 475 | cases.add("cast enum to smaller signed int", | |
| 476 | \\#include <stdlib.h> | |
| 477 | \\#include <stdint.h> | |
| 478 | \\typedef enum { | |
| 479 | \\ ENUM_0 = 0, | |
| 480 | \\ ENUM_384 = 384, | |
| 481 | \\} my_enum_t; | |
| 482 | \\ | |
| 483 | \\int main() { | |
| 484 | \\ my_enum_t val = ENUM_384; | |
| 485 | \\ int8_t x = (int8_t)val; | |
| 486 | \\ if (x != (int8_t)384) abort(); | |
| 487 | \\ return 0; | |
| 488 | \\} | |
| 489 | , ""); | |
| 490 | ||
| 491 | cases.add("cast negative enum to smaller signed int", | |
| 492 | \\#include <stdlib.h> | |
| 493 | \\#include <stdint.h> | |
| 494 | \\typedef enum { | |
| 495 | \\ ENUM_MINUS_1 = -1, | |
| 496 | \\ ENUM_384 = 384, | |
| 497 | \\} my_enum_t; | |
| 498 | \\ | |
| 499 | \\int main() { | |
| 500 | \\ my_enum_t val = ENUM_MINUS_1; | |
| 501 | \\ int8_t x = (int8_t)val; | |
| 502 | \\ if (x != -1) abort(); | |
| 503 | \\ return 0; | |
| 504 | \\} | |
| 505 | , ""); | |
| 506 | ||
| 507 | cases.add("cast negative enum to smaller unsigned int", | |
| 508 | \\#include <stdlib.h> | |
| 509 | \\#include <stdint.h> | |
| 510 | \\typedef enum { | |
| 511 | \\ ENUM_MINUS_1 = -1, | |
| 512 | \\ ENUM_384 = 384, | |
| 513 | \\} my_enum_t; | |
| 514 | \\ | |
| 515 | \\int main() { | |
| 516 | \\ my_enum_t val = ENUM_MINUS_1; | |
| 517 | \\ uint8_t x = (uint8_t)val; | |
| 518 | \\ if (x != (uint8_t)-1) abort(); | |
| 519 | \\ return 0; | |
| 520 | \\} | |
| 521 | , ""); | |
| 522 | ||
| 523 | cases.add("implicit enum cast in boolean expression", | |
| 524 | \\#include <stdlib.h> | |
| 525 | \\enum Foo { | |
| 526 | \\ FooA, | |
| 527 | \\ FooB, | |
| 528 | \\ FooC, | |
| 529 | \\}; | |
| 530 | \\int main() { | |
| 531 | \\ int a = 0; | |
| 532 | \\ float b = 0; | |
| 533 | \\ void *c = 0; | |
| 534 | \\ enum Foo d = FooA; | |
| 535 | \\ if (a || d) abort(); | |
| 536 | \\ if (d && b) abort(); | |
| 537 | \\ if (c || d) abort(); | |
| 538 | \\ return 0; | |
| 539 | \\} | |
| 540 | , ""); | |
| 541 | ||
| 542 | cases.add("issue #6707 cast builtin call result to opaque struct pointer", | |
| 543 | \\#include <stdlib.h> | |
| 544 | \\struct foo* make_foo(void) | |
| 545 | \\{ | |
| 546 | \\ return (struct foo*)__builtin_strlen("0123456789ABCDEF"); | |
| 547 | \\} | |
| 548 | \\int main(void) { | |
| 549 | \\ struct foo *foo_pointer = make_foo(); | |
| 550 | \\ if (foo_pointer != (struct foo*)16) abort(); | |
| 551 | \\ return 0; | |
| 552 | \\} | |
| 553 | , ""); | |
| 554 | ||
| 555 | cases.add("C built-ins", | |
| 556 | \\#include <stdlib.h> | |
| 557 | \\#include <limits.h> | |
| 558 | \\#include <stdbool.h> | |
| 559 | \\#define M_E 2.71828182845904523536 | |
| 560 | \\#define M_PI_2 1.57079632679489661923 | |
| 561 | \\bool check_clz(unsigned int pos) { | |
| 562 | \\ return (__builtin_clz(1 << pos) == (8 * sizeof(unsigned int) - pos - 1)); | |
| 563 | \\} | |
| 564 | \\int main(void) { | |
| 565 | \\ if (__builtin_bswap16(0x0102) != 0x0201) abort(); | |
| 566 | \\ if (__builtin_bswap32(0x01020304) != 0x04030201) abort(); | |
| 567 | \\ if (__builtin_bswap64(0x0102030405060708) != 0x0807060504030201) abort(); | |
| 568 | \\ | |
| 569 | \\ if (__builtin_signbit(0.0) != 0) abort(); | |
| 570 | \\ if (__builtin_signbitf(0.0f) != 0) abort(); | |
| 571 | \\ if (__builtin_signbit(1.0) != 0) abort(); | |
| 572 | \\ if (__builtin_signbitf(1.0f) != 0) abort(); | |
| 573 | \\ if (__builtin_signbit(-1.0) != 1) abort(); | |
| 574 | \\ if (__builtin_signbitf(-1.0f) != 1) abort(); | |
| 575 | \\ | |
| 576 | \\ if (__builtin_popcount(0) != 0) abort(); | |
| 577 | \\ if (__builtin_popcount(0b1) != 1) abort(); | |
| 578 | \\ if (__builtin_popcount(0b11) != 2) abort(); | |
| 579 | \\ if (__builtin_popcount(0b1111) != 4) abort(); | |
| 580 | \\ if (__builtin_popcount(0b11111111) != 8) abort(); | |
| 581 | \\ | |
| 582 | \\ if (__builtin_ctz(0b1) != 0) abort(); | |
| 583 | \\ if (__builtin_ctz(0b10) != 1) abort(); | |
| 584 | \\ if (__builtin_ctz(0b100) != 2) abort(); | |
| 585 | \\ if (__builtin_ctz(0b10000) != 4) abort(); | |
| 586 | \\ if (__builtin_ctz(0b100000000) != 8) abort(); | |
| 587 | \\ | |
| 588 | \\ if (!check_clz(0)) abort(); | |
| 589 | \\ if (!check_clz(1)) abort(); | |
| 590 | \\ if (!check_clz(2)) abort(); | |
| 591 | \\ if (!check_clz(4)) abort(); | |
| 592 | \\ if (!check_clz(8)) abort(); | |
| 593 | \\ | |
| 594 | \\ if (__builtin_sqrt(__builtin_sqrt(__builtin_sqrt(256))) != 2.0) abort(); | |
| 595 | \\ if (__builtin_sqrt(__builtin_sqrt(__builtin_sqrt(256.0))) != 2.0) abort(); | |
| 596 | \\ if (__builtin_sqrt(__builtin_sqrt(__builtin_sqrt(256.0f))) != 2.0) abort(); | |
| 597 | \\ if (__builtin_sqrtf(__builtin_sqrtf(__builtin_sqrtf(256.0f))) != 2.0f) abort(); | |
| 598 | \\ | |
| 599 | \\ if (__builtin_sin(1.0) != -__builtin_sin(-1.0)) abort(); | |
| 600 | \\ if (__builtin_sinf(1.0f) != -__builtin_sinf(-1.0f)) abort(); | |
| 601 | \\ if (__builtin_sin(M_PI_2) != 1.0) abort(); | |
| 602 | \\ if (__builtin_sinf(M_PI_2) != 1.0f) abort(); | |
| 603 | \\ | |
| 604 | \\ if (__builtin_cos(1.0) != __builtin_cos(-1.0)) abort(); | |
| 605 | \\ if (__builtin_cosf(1.0f) != __builtin_cosf(-1.0f)) abort(); | |
| 606 | \\ if (__builtin_cos(0.0) != 1.0) abort(); | |
| 607 | \\ if (__builtin_cosf(0.0f) != 1.0f) abort(); | |
| 608 | \\ | |
| 609 | \\ if (__builtin_exp(0) != 1.0) abort(); | |
| 610 | \\ if (__builtin_fabs(__builtin_exp(1.0) - M_E) > 0.00000001) abort(); | |
| 611 | \\ if (__builtin_exp(0.0f) != 1.0f) abort(); | |
| 612 | \\ | |
| 613 | \\ if (__builtin_exp2(0) != 1.0) abort(); | |
| 614 | \\ if (__builtin_exp2(4.0) != 16.0) abort(); | |
| 615 | \\ if (__builtin_exp2f(0.0f) != 1.0f) abort(); | |
| 616 | \\ if (__builtin_exp2f(4.0f) != 16.0f) abort(); | |
| 617 | \\ | |
| 618 | \\ if (__builtin_log(M_E) != 1.0) abort(); | |
| 619 | \\ if (__builtin_log(1.0) != 0.0) abort(); | |
| 620 | \\ if (__builtin_logf(1.0f) != 0.0f) abort(); | |
| 621 | \\ | |
| 622 | \\ if (__builtin_log2(8.0) != 3.0) abort(); | |
| 623 | \\ if (__builtin_log2(1.0) != 0.0) abort(); | |
| 624 | \\ if (__builtin_log2f(8.0f) != 3.0f) abort(); | |
| 625 | \\ if (__builtin_log2f(1.0f) != 0.0f) abort(); | |
| 626 | \\ | |
| 627 | \\ if (__builtin_log10(1000.0) != 3.0) abort(); | |
| 628 | \\ if (__builtin_log10(1.0) != 0.0) abort(); | |
| 629 | \\ if (__builtin_log10f(1000.0f) != 3.0f) abort(); | |
| 630 | \\ if (__builtin_log10f(1.0f) != 0.0f) abort(); | |
| 631 | \\ | |
| 632 | \\ if (__builtin_fabs(-42.0f) != 42.0) abort(); | |
| 633 | \\ if (__builtin_fabs(-42.0) != 42.0) abort(); | |
| 634 | \\ if (__builtin_fabs(-42) != 42.0) abort(); | |
| 635 | \\ if (__builtin_fabsf(-42.0f) != 42.0f) abort(); | |
| 636 | \\ | |
| 637 | \\ if (__builtin_fabs(-42.0f) != 42.0) abort(); | |
| 638 | \\ if (__builtin_fabs(-42.0) != 42.0) abort(); | |
| 639 | \\ if (__builtin_fabs(-42) != 42.0) abort(); | |
| 640 | \\ if (__builtin_fabsf(-42.0f) != 42.0f) abort(); | |
| 641 | \\ | |
| 642 | \\ if (__builtin_abs(42) != 42) abort(); | |
| 643 | \\ if (__builtin_abs(-42) != 42) abort(); | |
| 644 | \\ if (__builtin_abs(INT_MIN) != INT_MIN) abort(); | |
| 645 | \\ | |
| 646 | \\ if (__builtin_floor(42.9) != 42.0) abort(); | |
| 647 | \\ if (__builtin_floor(-42.9) != -43.0) abort(); | |
| 648 | \\ if (__builtin_floorf(42.9f) != 42.0f) abort(); | |
| 649 | \\ if (__builtin_floorf(-42.9f) != -43.0f) abort(); | |
| 650 | \\ | |
| 651 | \\ if (__builtin_ceil(42.9) != 43.0) abort(); | |
| 652 | \\ if (__builtin_ceil(-42.9) != -42) abort(); | |
| 653 | \\ if (__builtin_ceilf(42.9f) != 43.0f) abort(); | |
| 654 | \\ if (__builtin_ceilf(-42.9f) != -42.0f) abort(); | |
| 655 | \\ | |
| 656 | \\ if (__builtin_trunc(42.9) != 42.0) abort(); | |
| 657 | \\ if (__builtin_truncf(42.9f) != 42.0f) abort(); | |
| 658 | \\ if (__builtin_trunc(-42.9) != -42.0) abort(); | |
| 659 | \\ if (__builtin_truncf(-42.9f) != -42.0f) abort(); | |
| 660 | \\ | |
| 661 | \\ if (__builtin_round(0.5) != 1.0) abort(); | |
| 662 | \\ if (__builtin_round(-0.5) != -1.0) abort(); | |
| 663 | \\ if (__builtin_roundf(0.5f) != 1.0f) abort(); | |
| 664 | \\ if (__builtin_roundf(-0.5f) != -1.0f) abort(); | |
| 665 | \\ | |
| 666 | \\ if (__builtin_strcmp("abc", "abc") != 0) abort(); | |
| 667 | \\ if (__builtin_strcmp("abc", "def") >= 0 ) abort(); | |
| 668 | \\ if (__builtin_strcmp("def", "abc") <= 0) abort(); | |
| 669 | \\ | |
| 670 | \\ if (__builtin_strlen("this is a string") != 16) abort(); | |
| 671 | \\ | |
| 672 | \\ char *s = malloc(6); | |
| 673 | \\ __builtin_memcpy(s, "hello", 5); | |
| 674 | \\ s[5] = '\0'; | |
| 675 | \\ if (__builtin_strlen(s) != 5) abort(); | |
| 676 | \\ | |
| 677 | \\ __builtin_memset(s, 42, __builtin_strlen(s)); | |
| 678 | \\ if (s[0] != 42 || s[1] != 42 || s[2] != 42 || s[3] != 42 || s[4] != 42) abort(); | |
| 679 | \\ | |
| 680 | \\ free(s); | |
| 681 | \\ | |
| 682 | \\ return 0; | |
| 683 | \\} | |
| 684 | , ""); | |
| 685 | ||
| 686 | cases.add("function macro that uses builtin", | |
| 687 | \\#include <stdlib.h> | |
| 688 | \\#define FOO(x, y) (__builtin_popcount((x)) + __builtin_strlen((y))) | |
| 689 | \\int main() { | |
| 690 | \\ if (FOO(7, "hello!") != 9) abort(); | |
| 691 | \\ return 0; | |
| 692 | \\} | |
| 693 | , ""); | |
| 694 | ||
| 695 | cases.add("assign bool result to int or char", | |
| 696 | \\#include <stdlib.h> | |
| 697 | \\#include <stdbool.h> | |
| 698 | \\bool foo() { return true; } | |
| 699 | \\int main() { | |
| 700 | \\ int x = foo(); | |
| 701 | \\ if (x != 1) abort(); | |
| 702 | \\ signed char c = foo(); | |
| 703 | \\ if (c != 1) abort(); | |
| 704 | \\ return 0; | |
| 705 | \\} | |
| 706 | , ""); | |
| 707 | ||
| 708 | cases.add("static K&R-style no prototype function declaration (empty parameter list)", | |
| 709 | \\#include <stdlib.h> | |
| 710 | \\static int foo() { | |
| 711 | \\ return 42; | |
| 712 | \\} | |
| 713 | \\int main() { | |
| 714 | \\ if (foo() != 42) abort(); | |
| 715 | \\ return 0; | |
| 716 | \\} | |
| 717 | , ""); | |
| 718 | ||
| 719 | cases.add("K&R-style static function prototype for unused function", | |
| 720 | \\static int foo(); | |
| 721 | \\int main() { | |
| 722 | \\ return 0; | |
| 723 | \\} | |
| 724 | , ""); | |
| 725 | ||
| 726 | cases.add("K&R-style static function prototype + separate definition", | |
| 727 | \\#include <stdlib.h> | |
| 728 | \\static int foo(); | |
| 729 | \\static int foo(int a, int b) { | |
| 730 | \\ return a + b; | |
| 731 | \\} | |
| 732 | \\int main() { | |
| 733 | \\ if (foo(40, 2) != 42) abort(); | |
| 734 | \\ return 0; | |
| 735 | \\} | |
| 736 | , ""); | |
| 737 | ||
| 738 | cases.add("dollar sign in identifiers", | |
| 739 | \\#include <stdlib.h> | |
| 740 | \\#define $FOO 2 | |
| 741 | \\#define $foo bar$ | |
| 742 | \\#define $baz($x) ($x + $FOO) | |
| 743 | \\int $$$(int $x$) { return $x$ + $FOO; } | |
| 744 | \\int main() { | |
| 745 | \\ int bar$ = 42; | |
| 746 | \\ if ($foo != 42) abort(); | |
| 747 | \\ if (bar$ != 42) abort(); | |
| 748 | \\ if ($baz(bar$) != 44) abort(); | |
| 749 | \\ if ($$$(bar$) != 44) abort(); | |
| 750 | \\ return 0; | |
| 751 | \\} | |
| 752 | , ""); | |
| 753 | ||
| 754 | cases.add("Cast boolean expression result to int", | |
| 755 | \\#include <stdlib.h> | |
| 756 | \\char foo(char c) { return c; } | |
| 757 | \\int bar(int i) { return i; } | |
| 758 | \\long baz(long l) { return l; } | |
| 759 | \\int main() { | |
| 760 | \\ if (foo(1 == 2)) abort(); | |
| 761 | \\ if (!foo(1 == 1)) abort(); | |
| 762 | \\ if (bar(1 == 2)) abort(); | |
| 763 | \\ if (!bar(1 == 1)) abort(); | |
| 764 | \\ if (baz(1 == 2)) abort(); | |
| 765 | \\ if (!baz(1 == 1)) abort(); | |
| 766 | \\ return 0; | |
| 767 | \\} | |
| 768 | , ""); | |
| 769 | ||
| 770 | cases.add("Wide, UTF-16, and UTF-32 character literals", | |
| 771 | \\#include <wchar.h> | |
| 772 | \\#include <stdlib.h> | |
| 773 | \\int main() { | |
| 774 | \\ wchar_t wc = L'™'; | |
| 775 | \\ int utf16_char = u'™'; | |
| 776 | \\ int utf32_char = U'💯'; | |
| 777 | \\ if (wc != 8482) abort(); | |
| 778 | \\ if (utf16_char != 8482) abort(); | |
| 779 | \\ if (utf32_char != 128175) abort(); | |
| 780 | \\ unsigned char c = wc; | |
| 781 | \\ if (c != 0x22) abort(); | |
| 782 | \\ c = utf32_char; | |
| 783 | \\ if (c != 0xaf) abort(); | |
| 784 | \\ return 0; | |
| 785 | \\} | |
| 786 | , ""); | |
| 787 | ||
| 788 | cases.add("Variadic function call", | |
| 789 | \\#define _NO_CRT_STDIO_INLINE 1 | |
| 790 | \\#include <stdio.h> | |
| 791 | \\int main(void) { | |
| 792 | \\ printf("%d %d\n", 1, 2); | |
| 793 | \\ return 0; | |
| 794 | \\} | |
| 795 | , "1 2" ++ nl); | |
| 796 | ||
| 797 | cases.add("multi-character character constant", | |
| 798 | \\#include <stdlib.h> | |
| 799 | \\int main(void) { | |
| 800 | \\ int foo = 'abcd'; | |
| 801 | \\ switch (foo) { | |
| 802 | \\ case 'abcd': break; | |
| 803 | \\ default: abort(); | |
| 804 | \\ } | |
| 805 | \\ return 0; | |
| 806 | \\} | |
| 807 | , ""); | |
| 808 | ||
| 809 | cases.add("Array initializers (string literals, incomplete arrays)", | |
| 810 | \\#include <stdlib.h> | |
| 811 | \\#include <string.h> | |
| 812 | \\extern int foo[]; | |
| 813 | \\int global_arr[] = {1, 2, 3}; | |
| 814 | \\char global_string[] = "hello"; | |
| 815 | \\int main(int argc, char *argv[]) { | |
| 816 | \\ if (global_arr[2] != 3) abort(); | |
| 817 | \\ if (strlen(global_string) != 5) abort(); | |
| 818 | \\ const char *const_str = "hello"; | |
| 819 | \\ if (strcmp(const_str, "hello") != 0) abort(); | |
| 820 | \\ char empty_str[] = ""; | |
| 821 | \\ if (strlen(empty_str) != 0) abort(); | |
| 822 | \\ char hello[] = "hello"; | |
| 823 | \\ if (strlen(hello) != 5 || sizeof(hello) != 6) abort(); | |
| 824 | \\ int empty[] = {}; | |
| 825 | \\ if (sizeof(empty) != 0) abort(); | |
| 826 | \\ int bar[] = {42}; | |
| 827 | \\ if (bar[0] != 42) abort(); | |
| 828 | \\ bar[0] = 43; | |
| 829 | \\ if (bar[0] != 43) abort(); | |
| 830 | \\ int baz[] = {1, [42] = 123, 456}; | |
| 831 | \\ if (baz[42] != 123 || baz[43] != 456) abort(); | |
| 832 | \\ if (sizeof(baz) != sizeof(int) * 44) abort(); | |
| 833 | \\ const char *const names[] = {"first", "second", "third"}; | |
| 834 | \\ if (strcmp(names[2], "third") != 0) abort(); | |
| 835 | \\ char catted_str[] = "abc" "def"; | |
| 836 | \\ if (strlen(catted_str) != 6 || sizeof(catted_str) != 7) abort(); | |
| 837 | \\ char catted_trunc_str[2] = "abc" "def"; | |
| 838 | \\ if (sizeof(catted_trunc_str) != 2 || catted_trunc_str[0] != 'a' || catted_trunc_str[1] != 'b') abort(); | |
| 839 | \\ char big_array_utf8lit[10] = "💯"; | |
| 840 | \\ if (strcmp(big_array_utf8lit, "💯") != 0 || big_array_utf8lit[9] != 0) abort(); | |
| 841 | \\ return 0; | |
| 842 | \\} | |
| 843 | , ""); | |
| 844 | ||
| 845 | cases.add("Wide, UTF-16, and UTF-32 string literals", | |
| 846 | \\#include <stdlib.h> | |
| 847 | \\#include <stdint.h> | |
| 848 | \\#include <wchar.h> | |
| 849 | \\int main(void) { | |
| 850 | \\ const wchar_t *wide_str = L"wide"; | |
| 851 | \\ const wchar_t wide_hello[] = L"hello"; | |
| 852 | \\ if (wcslen(wide_str) != 4) abort(); | |
| 853 | \\ if (wcslen(L"literal") != 7) abort(); | |
| 854 | \\ if (wcscmp(wide_hello, L"hello") != 0) abort(); | |
| 855 | \\ | |
| 856 | \\ const uint16_t *u16_str = u"wide"; | |
| 857 | \\ const uint16_t u16_hello[] = u"hello"; | |
| 858 | \\ if (u16_str[3] != u'e' || u16_str[4] != 0) abort(); | |
| 859 | \\ if (u16_hello[4] != u'o' || u16_hello[5] != 0) abort(); | |
| 860 | \\ | |
| 861 | \\ const uint32_t *u32_str = U"wide"; | |
| 862 | \\ const uint32_t u32_hello[] = U"hello"; | |
| 863 | \\ if (u32_str[3] != U'e' || u32_str[4] != 0) abort(); | |
| 864 | \\ if (u32_hello[4] != U'o' || u32_hello[5] != 0) abort(); | |
| 865 | \\ return 0; | |
| 866 | \\} | |
| 867 | , ""); | |
| 868 | ||
| 869 | cases.add("Address of function is no-op", | |
| 870 | \\#include <stdlib.h> | |
| 871 | \\#include <stdbool.h> | |
| 872 | \\typedef int (*myfunc)(int); | |
| 873 | \\int a(int arg) { return arg + 1;} | |
| 874 | \\int b(int arg) { return arg + 2;} | |
| 875 | \\int caller(myfunc fn, int arg) { | |
| 876 | \\ return fn(arg); | |
| 877 | \\} | |
| 878 | \\int main() { | |
| 879 | \\ myfunc arr[3] = {&a, &b, a}; | |
| 880 | \\ myfunc foo = a; | |
| 881 | \\ myfunc bar = &(a); | |
| 882 | \\ if (foo != bar) abort(); | |
| 883 | \\ if (arr[0] == arr[1]) abort(); | |
| 884 | \\ if (arr[0] != arr[2]) abort(); | |
| 885 | \\ if (caller(b, 40) != 42) abort(); | |
| 886 | \\ if (caller(&b, 40) != 42) abort(); | |
| 887 | \\ return 0; | |
| 888 | \\} | |
| 889 | , ""); | |
| 890 | ||
| 891 | cases.add("Obscure ways of calling functions; issue #4124", | |
| 892 | \\#include <stdlib.h> | |
| 893 | \\static int add(int a, int b) { | |
| 894 | \\ return a + b; | |
| 895 | \\} | |
| 896 | \\typedef int (*adder)(int, int); | |
| 897 | \\typedef void (*funcptr)(void); | |
| 898 | \\int main() { | |
| 899 | \\ if ((add)(1, 2) != 3) abort(); | |
| 900 | \\ if ((&add)(1, 2) != 3) abort(); | |
| 901 | \\ if (add(3, 1) != 4) abort(); | |
| 902 | \\ if ((*add)(2, 3) != 5) abort(); | |
| 903 | \\ if ((**add)(7, -1) != 6) abort(); | |
| 904 | \\ if ((***add)(-2, 9) != 7) abort(); | |
| 905 | \\ | |
| 906 | \\ int (*ptr)(int a, int b); | |
| 907 | \\ ptr = add; | |
| 908 | \\ | |
| 909 | \\ if (ptr(1, 2) != 3) abort(); | |
| 910 | \\ if ((*ptr)(3, 1) != 4) abort(); | |
| 911 | \\ if ((**ptr)(2, 3) != 5) abort(); | |
| 912 | \\ if ((***ptr)(7, -1) != 6) abort(); | |
| 913 | \\ if ((****ptr)(-2, 9) != 7) abort(); | |
| 914 | \\ | |
| 915 | \\ funcptr addr1 = (funcptr)(add); | |
| 916 | \\ funcptr addr2 = (funcptr)(&add); | |
| 917 | \\ | |
| 918 | \\ if (addr1 != addr2) abort(); | |
| 919 | \\ if (((int(*)(int, int))addr1)(1, 2) != 3) abort(); | |
| 920 | \\ if (((adder)addr2)(1, 2) != 3) abort(); | |
| 921 | \\ return 0; | |
| 922 | \\} | |
| 923 | , ""); | |
| 924 | ||
| 925 | cases.add("Return boolean expression as int; issue #6215", | |
| 926 | \\#include <stdlib.h> | |
| 927 | \\#include <stdbool.h> | |
| 928 | \\bool actual_bool(void) { return 4 - 1 < 4;} | |
| 929 | \\char char_bool_ret(void) { return 0 || 1; } | |
| 930 | \\short short_bool_ret(void) { return 0 < 1; } | |
| 931 | \\int int_bool_ret(void) { return 1 && 1; } | |
| 932 | \\long long_bool_ret(void) { return !(0 > 1); } | |
| 933 | \\static int GLOBAL = 1; | |
| 934 | \\int nested_scopes(int a, int b) { | |
| 935 | \\ if (a == 1) { | |
| 936 | \\ int target = 1; | |
| 937 | \\ return b == target; | |
| 938 | \\ } else { | |
| 939 | \\ int target = 2; | |
| 940 | \\ if (b == target) { | |
| 941 | \\ return GLOBAL == 1; | |
| 942 | \\ } | |
| 943 | \\ return target == 2; | |
| 944 | \\ } | |
| 945 | \\} | |
| 946 | \\int main(void) { | |
| 947 | \\ if (!actual_bool()) abort(); | |
| 948 | \\ if (!char_bool_ret()) abort(); | |
| 949 | \\ if (!short_bool_ret()) abort(); | |
| 950 | \\ if (!int_bool_ret()) abort(); | |
| 951 | \\ if (!long_bool_ret()) abort(); | |
| 952 | \\ if (!nested_scopes(1, 1)) abort(); | |
| 953 | \\ if (nested_scopes(1, 2)) abort(); | |
| 954 | \\ if (!nested_scopes(0, 2)) abort(); | |
| 955 | \\ if (!nested_scopes(0, 3)) abort(); | |
| 956 | \\ return 1 != 1; | |
| 957 | \\} | |
| 958 | , ""); | |
| 959 | ||
| 960 | cases.add("Comma operator should create new scope; issue #7989", | |
| 961 | \\#include <stdlib.h> | |
| 962 | \\#include <stdio.h> | |
| 963 | \\int main(void) { | |
| 964 | \\ if (1 || (abort(), 1)) {} | |
| 965 | \\ if (0 && (1, printf("do not print\n"))) {} | |
| 966 | \\ int x = 0; | |
| 967 | \\ x = (x = 3, 4, x + 1); | |
| 968 | \\ if (x != 4) abort(); | |
| 969 | \\ return 0; | |
| 970 | \\} | |
| 971 | , ""); | |
| 972 | ||
| 973 | cases.add("Use correct break label for statement expression in nested scope", | |
| 974 | \\#include <stdlib.h> | |
| 975 | \\int main(void) { | |
| 976 | \\ int x = ({1, ({2; 3;});}); | |
| 977 | \\ if (x != 3) abort(); | |
| 978 | \\ return 0; | |
| 979 | \\} | |
| 980 | , ""); | |
| 981 | ||
| 982 | cases.add("pointer difference: scalar array w/ size truncation or negative result. Issue #7216", | |
| 983 | \\#include <stdlib.h> | |
| 984 | \\#include <stddef.h> | |
| 985 | \\#define SIZE 10 | |
| 986 | \\int main() { | |
| 987 | \\ int foo[SIZE]; | |
| 988 | \\ int *start = &foo[0]; | |
| 989 | \\ int *one_past_end = start + SIZE; | |
| 990 | \\ ptrdiff_t diff = one_past_end - start; | |
| 991 | \\ char diff_char = one_past_end - start; | |
| 992 | \\ if (diff != SIZE || diff_char != SIZE) abort(); | |
| 993 | \\ diff = start - one_past_end; | |
| 994 | \\ if (diff != -SIZE) abort(); | |
| 995 | \\ if (one_past_end - foo != SIZE) abort(); | |
| 996 | \\ if ((one_past_end - 1) - foo != SIZE - 1) abort(); | |
| 997 | \\ if ((start + 1) - foo != 1) abort(); | |
| 998 | \\ return 0; | |
| 999 | \\} | |
| 1000 | , ""); | |
| 1001 | ||
| 1002 | // C standard: if the expression P points either to an element of an array object or one | |
| 1003 | // past the last element of an array object, and the expression Q points to the last | |
| 1004 | // element of the same array object, the expression ((Q)+1)-(P) has the same value as | |
| 1005 | // ((Q)-(P))+1 and as -((P)-((Q)+1)), and has the value zero if the expression P points | |
| 1006 | // one past the last element of the array object, even though the expression (Q)+1 | |
| 1007 | // does not point to an element of the array object | |
| 1008 | cases.add("pointer difference: C standard edge case", | |
| 1009 | \\#include <stdlib.h> | |
| 1010 | \\#include <stddef.h> | |
| 1011 | \\#define SIZE 10 | |
| 1012 | \\int main() { | |
| 1013 | \\ int foo[SIZE]; | |
| 1014 | \\ int *start = &foo[0]; | |
| 1015 | \\ int *P = start + SIZE; | |
| 1016 | \\ int *Q = &foo[SIZE - 1]; | |
| 1017 | \\ if ((Q + 1) - P != 0) abort(); | |
| 1018 | \\ if ((Q + 1) - P != (Q - P) + 1) abort(); | |
| 1019 | \\ if ((Q + 1) - P != -(P - (Q + 1))) abort(); | |
| 1020 | \\ return 0; | |
| 1021 | \\} | |
| 1022 | , ""); | |
| 1023 | ||
| 1024 | cases.add("pointer difference: unary operators", | |
| 1025 | \\#include <stdlib.h> | |
| 1026 | \\int main() { | |
| 1027 | \\ int foo[10]; | |
| 1028 | \\ int *x = &foo[1]; | |
| 1029 | \\ const int *y = &foo[5]; | |
| 1030 | \\ if (y - x++ != 4) abort(); | |
| 1031 | \\ if (y - x != 3) abort(); | |
| 1032 | \\ if (y - ++x != 2) abort(); | |
| 1033 | \\ if (y - x-- != 2) abort(); | |
| 1034 | \\ if (y - x != 3) abort(); | |
| 1035 | \\ if (y - --x != 4) abort(); | |
| 1036 | \\ if (y - &foo[0] != 5) abort(); | |
| 1037 | \\ return 0; | |
| 1038 | \\} | |
| 1039 | , ""); | |
| 1040 | ||
| 1041 | cases.add("pointer difference: struct array with padding", | |
| 1042 | \\#include <stdlib.h> | |
| 1043 | \\#include <stddef.h> | |
| 1044 | \\#define SIZE 10 | |
| 1045 | \\typedef struct my_struct { | |
| 1046 | \\ int x; | |
| 1047 | \\ char c; | |
| 1048 | \\ int y; | |
| 1049 | \\} my_struct_t; | |
| 1050 | \\int main() { | |
| 1051 | \\ my_struct_t foo[SIZE]; | |
| 1052 | \\ my_struct_t *start = &foo[0]; | |
| 1053 | \\ my_struct_t *one_past_end = start + SIZE; | |
| 1054 | \\ ptrdiff_t diff = one_past_end - start; | |
| 1055 | \\ int diff_int = one_past_end - start; | |
| 1056 | \\ if (diff != SIZE || diff_int != SIZE) abort(); | |
| 1057 | \\ diff = start - one_past_end; | |
| 1058 | \\ if (diff != -SIZE) abort(); | |
| 1059 | \\ return 0; | |
| 1060 | \\} | |
| 1061 | , ""); | |
| 1062 | ||
| 1063 | cases.add("pointer difference: array of function pointers", | |
| 1064 | \\#include <stdlib.h> | |
| 1065 | \\int a(void) { return 1;} | |
| 1066 | \\int b(void) { return 2;} | |
| 1067 | \\int c(void) { return 3;} | |
| 1068 | \\typedef int (*myfunc)(void); | |
| 1069 | \\int main() { | |
| 1070 | \\ myfunc arr[] = {a, b, c, a, b, c}; | |
| 1071 | \\ myfunc *f1 = &arr[1]; | |
| 1072 | \\ myfunc *f4 = &arr[4]; | |
| 1073 | \\ if (f4 - f1 != 3) abort(); | |
| 1074 | \\ return 0; | |
| 1075 | \\} | |
| 1076 | , ""); | |
| 1077 | ||
| 1078 | cases.add("typeof operator", | |
| 1079 | \\#include <stdlib.h> | |
| 1080 | \\static int FOO = 42; | |
| 1081 | \\typedef typeof(FOO) foo_type; | |
| 1082 | \\typeof(foo_type) myfunc(typeof(FOO) x) { return (typeof(FOO)) x; } | |
| 1083 | \\int main(void) { | |
| 1084 | \\ int x = FOO; | |
| 1085 | \\ typeof(x) y = x; | |
| 1086 | \\ foo_type z = y; | |
| 1087 | \\ if (x != y) abort(); | |
| 1088 | \\ if (myfunc(z) != x) abort(); | |
| 1089 | \\ | |
| 1090 | \\ const char *my_string = "bar"; | |
| 1091 | \\ typeof (typeof (my_string)[4]) string_arr = {"a","b","c","d"}; | |
| 1092 | \\ if (string_arr[0][0] != 'a' || string_arr[3][0] != 'd') abort(); | |
| 1093 | \\ return 0; | |
| 1094 | \\} | |
| 1095 | , ""); | |
| 1096 | ||
| 1097 | cases.add("offsetof", | |
| 1098 | \\#include <stddef.h> | |
| 1099 | \\#include <stdlib.h> | |
| 1100 | \\#define container_of(ptr, type, member) ({ \ | |
| 1101 | \\ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | |
| 1102 | \\ (type *)( (char *)__mptr - offsetof(type,member) );}) | |
| 1103 | \\typedef struct { | |
| 1104 | \\ int i; | |
| 1105 | \\ struct { int x; char y; int z; } s; | |
| 1106 | \\ float f; | |
| 1107 | \\} container; | |
| 1108 | \\int main(void) { | |
| 1109 | \\ if (offsetof(container, i) != 0) abort(); | |
| 1110 | \\ if (offsetof(container, s) <= offsetof(container, i)) abort(); | |
| 1111 | \\ if (offsetof(container, f) <= offsetof(container, s)) abort(); | |
| 1112 | \\ | |
| 1113 | \\ container my_container; | |
| 1114 | \\ typeof(my_container.s) *inner_member_pointer = &my_container.s; | |
| 1115 | \\ float *float_member_pointer = &my_container.f; | |
| 1116 | \\ int *anon_member_pointer = &my_container.s.z; | |
| 1117 | \\ container *my_container_p; | |
| 1118 | \\ | |
| 1119 | \\ my_container_p = container_of(inner_member_pointer, container, s); | |
| 1120 | \\ if (my_container_p != &my_container) abort(); | |
| 1121 | \\ | |
| 1122 | \\ my_container_p = container_of(float_member_pointer, container, f); | |
| 1123 | \\ if (my_container_p != &my_container) abort(); | |
| 1124 | \\ | |
| 1125 | \\ if (container_of(anon_member_pointer, typeof(my_container.s), z) != inner_member_pointer) abort(); | |
| 1126 | \\ return 0; | |
| 1127 | \\} | |
| 1128 | , ""); | |
| 1129 | ||
| 1130 | cases.add("handle assert.h", | |
| 1131 | \\#include <assert.h> | |
| 1132 | \\int main() { | |
| 1133 | \\ int x = 1; | |
| 1134 | \\ int *xp = &x; | |
| 1135 | \\ assert(1); | |
| 1136 | \\ assert(x != 0); | |
| 1137 | \\ assert(xp); | |
| 1138 | \\ assert(*xp); | |
| 1139 | \\ return 0; | |
| 1140 | \\} | |
| 1141 | , ""); | |
| 1142 | ||
| 1143 | cases.add("NDEBUG disables assert", | |
| 1144 | \\#define NDEBUG | |
| 1145 | \\#include <assert.h> | |
| 1146 | \\int main() { | |
| 1147 | \\ assert(0); | |
| 1148 | \\ assert(NULL); | |
| 1149 | \\ return 0; | |
| 1150 | \\} | |
| 1151 | , ""); | |
| 1152 | ||
| 1153 | cases.add("pointer arithmetic with signed operand", | |
| 1154 | \\#include <stdlib.h> | |
| 1155 | \\int main() { | |
| 1156 | \\ int array[10]; | |
| 1157 | \\ int *x = &array[5]; | |
| 1158 | \\ int *y; | |
| 1159 | \\ int idx = 0; | |
| 1160 | \\ y = x + ++idx; | |
| 1161 | \\ if (y != x + 1 || y != &array[6]) abort(); | |
| 1162 | \\ y = idx + x; | |
| 1163 | \\ if (y != x + 1 || y != &array[6]) abort(); | |
| 1164 | \\ y = x - idx; | |
| 1165 | \\ if (y != x - 1 || y != &array[4]) abort(); | |
| 1166 | \\ | |
| 1167 | \\ idx = 0; | |
| 1168 | \\ y = --idx + x; | |
| 1169 | \\ if (y != x - 1 || y != &array[4]) abort(); | |
| 1170 | \\ y = idx + x; | |
| 1171 | \\ if (y != x - 1 || y != &array[4]) abort(); | |
| 1172 | \\ y = x - idx; | |
| 1173 | \\ if (y != x + 1 || y != &array[6]) abort(); | |
| 1174 | \\ | |
| 1175 | \\ idx = 1; | |
| 1176 | \\ x += idx; | |
| 1177 | \\ if (x != &array[6]) abort(); | |
| 1178 | \\ x -= idx; | |
| 1179 | \\ if (x != &array[5]) abort(); | |
| 1180 | \\ y = (x += idx); | |
| 1181 | \\ if (y != x || y != &array[6]) abort(); | |
| 1182 | \\ y = (x -= idx); | |
| 1183 | \\ if (y != x || y != &array[5]) abort(); | |
| 1184 | \\ | |
| 1185 | \\ if (array + idx != &array[1] || array + 1 != &array[1]) abort(); | |
| 1186 | \\ idx = -1; | |
| 1187 | \\ if (array - idx != &array[1]) abort(); | |
| 1188 | \\ | |
| 1189 | \\ return 0; | |
| 1190 | \\} | |
| 1191 | , ""); | |
| 1192 | ||
| 1193 | cases.add("Compound literals", | |
| 1194 | \\#include <stdlib.h> | |
| 1195 | \\struct Foo { | |
| 1196 | \\ int a; | |
| 1197 | \\ char b[2]; | |
| 1198 | \\ float c; | |
| 1199 | \\}; | |
| 1200 | \\int main() { | |
| 1201 | \\ struct Foo foo; | |
| 1202 | \\ int x = 1, y = 2; | |
| 1203 | \\ foo = (struct Foo) {x + y, {'a', 'b'}, 42.0f}; | |
| 1204 | \\ if (foo.a != x + y || foo.b[0] != 'a' || foo.b[1] != 'b' || foo.c != 42.0f) abort(); | |
| 1205 | \\ return 0; | |
| 1206 | \\} | |
| 1207 | , ""); | |
| 1208 | ||
| 1209 | cases.add("Generic selections", | |
| 1210 | \\#include <stdlib.h> | |
| 1211 | \\#include <string.h> | |
| 1212 | \\#include <stdint.h> | |
| 1213 | \\#define my_generic_fn(X) _Generic((X), \ | |
| 1214 | \\ int: abs, \ | |
| 1215 | \\ char *: strlen, \ | |
| 1216 | \\ size_t: malloc, \ | |
| 1217 | \\ default: free \ | |
| 1218 | \\)(X) | |
| 1219 | \\#define my_generic_val(X) _Generic((X), \ | |
| 1220 | \\ int: 1, \ | |
| 1221 | \\ const char *: "bar" \ | |
| 1222 | \\) | |
| 1223 | \\int main(void) { | |
| 1224 | \\ if (my_generic_val(100) != 1) abort(); | |
| 1225 | \\ | |
| 1226 | \\ const char *foo = "foo"; | |
| 1227 | \\ const char *bar = my_generic_val(foo); | |
| 1228 | \\ if (strcmp(bar, "bar") != 0) abort(); | |
| 1229 | \\ | |
| 1230 | \\ if (my_generic_fn(-42) != 42) abort(); | |
| 1231 | \\ if (my_generic_fn("hello") != 5) abort(); | |
| 1232 | \\ | |
| 1233 | \\ size_t size = 8192; | |
| 1234 | \\ uint8_t *mem = my_generic_fn(size); | |
| 1235 | \\ memset(mem, 42, size); | |
| 1236 | \\ if (mem[size - 1] != 42) abort(); | |
| 1237 | \\ my_generic_fn(mem); | |
| 1238 | \\ | |
| 1239 | \\ return 0; | |
| 1240 | \\} | |
| 1241 | , ""); | |
| 1242 | ||
| 1243 | // See __builtin_alloca_with_align comment in std.zig.c_builtins | |
| 1244 | cases.add("use of unimplemented builtin in unused function does not prevent compilation", | |
| 1245 | \\#include <stdlib.h> | |
| 1246 | \\void unused() { | |
| 1247 | \\ __builtin_alloca_with_align(1, 8); | |
| 1248 | \\} | |
| 1249 | \\int main(void) { | |
| 1250 | \\ if (__builtin_sqrt(1.0) != 1.0) abort(); | |
| 1251 | \\ return 0; | |
| 1252 | \\} | |
| 1253 | , ""); | |
| 1254 | ||
| 1255 | cases.add("convert single-statement bodies into blocks for if/else/for/while. issue #8159", | |
| 1256 | \\#include <stdlib.h> | |
| 1257 | \\int foo() { return 1; } | |
| 1258 | \\int main(void) { | |
| 1259 | \\ int i = 0; | |
| 1260 | \\ if (i == 0) if (i == 0) if (i != 0) i = 1; | |
| 1261 | \\ if (i != 0) i = 1; else if (i == 0) if (i == 0) i += 1; | |
| 1262 | \\ for (; i < 10;) for (; i < 10;) i++; | |
| 1263 | \\ while (i == 100) while (i == 100) foo(); | |
| 1264 | \\ if (0) do do "string"; while(1); while(1); | |
| 1265 | \\ return 0; | |
| 1266 | \\} | |
| 1267 | , ""); | |
| 1268 | ||
| 1269 | cases.add("cast RHS of compound assignment if necessary, unused result", | |
| 1270 | \\#include <stdlib.h> | |
| 1271 | \\int main(void) { | |
| 1272 | \\ signed short val = -1; | |
| 1273 | \\ val += 1; if (val != 0) abort(); | |
| 1274 | \\ val -= 1; if (val != -1) abort(); | |
| 1275 | \\ val *= 2; if (val != -2) abort(); | |
| 1276 | \\ val /= 2; if (val != -1) abort(); | |
| 1277 | \\ val %= 2; if (val != -1) abort(); | |
| 1278 | \\ val <<= 1; if (val != -2) abort(); | |
| 1279 | \\ val >>= 1; if (val != -1) abort(); | |
| 1280 | \\ val += 100000000; // compile error if @truncate() not inserted | |
| 1281 | \\ unsigned short uval = 1; | |
| 1282 | \\ uval += 1; if (uval != 2) abort(); | |
| 1283 | \\ uval -= 1; if (uval != 1) abort(); | |
| 1284 | \\ uval *= 2; if (uval != 2) abort(); | |
| 1285 | \\ uval /= 2; if (uval != 1) abort(); | |
| 1286 | \\ uval %= 2; if (uval != 1) abort(); | |
| 1287 | \\ uval <<= 1; if (uval != 2) abort(); | |
| 1288 | \\ uval >>= 1; if (uval != 1) abort(); | |
| 1289 | \\ uval += 100000000; // compile error if @truncate() not inserted | |
| 1290 | \\} | |
| 1291 | , ""); | |
| 1292 | ||
| 1293 | cases.add("cast RHS of compound assignment if necessary, used result", | |
| 1294 | \\#include <stdlib.h> | |
| 1295 | \\int main(void) { | |
| 1296 | \\ signed short foo; | |
| 1297 | \\ signed short val = -1; | |
| 1298 | \\ foo = (val += 1); if (foo != 0) abort(); | |
| 1299 | \\ foo = (val -= 1); if (foo != -1) abort(); | |
| 1300 | \\ foo = (val *= 2); if (foo != -2) abort(); | |
| 1301 | \\ foo = (val /= 2); if (foo != -1) abort(); | |
| 1302 | \\ foo = (val %= 2); if (foo != -1) abort(); | |
| 1303 | \\ foo = (val <<= 1); if (foo != -2) abort(); | |
| 1304 | \\ foo = (val >>= 1); if (foo != -1) abort(); | |
| 1305 | \\ foo = (val += 100000000); // compile error if @truncate() not inserted | |
| 1306 | \\ unsigned short ufoo; | |
| 1307 | \\ unsigned short uval = 1; | |
| 1308 | \\ ufoo = (uval += 1); if (ufoo != 2) abort(); | |
| 1309 | \\ ufoo = (uval -= 1); if (ufoo != 1) abort(); | |
| 1310 | \\ ufoo = (uval *= 2); if (ufoo != 2) abort(); | |
| 1311 | \\ ufoo = (uval /= 2); if (ufoo != 1) abort(); | |
| 1312 | \\ ufoo = (uval %= 2); if (ufoo != 1) abort(); | |
| 1313 | \\ ufoo = (uval <<= 1); if (ufoo != 2) abort(); | |
| 1314 | \\ ufoo = (uval >>= 1); if (ufoo != 1) abort(); | |
| 1315 | \\ ufoo = (uval += 100000000); // compile error if @truncate() not inserted | |
| 1316 | \\} | |
| 1317 | , ""); | |
| 1318 | ||
| 1319 | cases.add("break from switch statement. Issue #8387", | |
| 1320 | \\#include <stdlib.h> | |
| 1321 | \\int switcher(int x) { | |
| 1322 | \\ switch (x) { | |
| 1323 | \\ case 0: // no braces | |
| 1324 | \\ x += 1; | |
| 1325 | \\ break; | |
| 1326 | \\ case 1: // conditional break | |
| 1327 | \\ if (x == 1) { | |
| 1328 | \\ x += 1; | |
| 1329 | \\ break; | |
| 1330 | \\ } | |
| 1331 | \\ x += 100; | |
| 1332 | \\ case 2: { // braces with fallthrough | |
| 1333 | \\ x += 1; | |
| 1334 | \\ } | |
| 1335 | \\ case 3: // fallthrough to return statement | |
| 1336 | \\ x += 1; | |
| 1337 | \\ case 42: { // random out of order case | |
| 1338 | \\ x += 1; | |
| 1339 | \\ return x; | |
| 1340 | \\ } | |
| 1341 | \\ case 4: { // break within braces | |
| 1342 | \\ x += 1; | |
| 1343 | \\ break; | |
| 1344 | \\ } | |
| 1345 | \\ case 5: | |
| 1346 | \\ x += 1; // fallthrough to default | |
| 1347 | \\ default: | |
| 1348 | \\ x += 1; | |
| 1349 | \\ } | |
| 1350 | \\ return x; | |
| 1351 | \\} | |
| 1352 | \\int main(void) { | |
| 1353 | \\ int expected[] = {1, 2, 5, 5, 5, 7, 7}; | |
| 1354 | \\ for (int i = 0; i < sizeof(expected) / sizeof(int); i++) { | |
| 1355 | \\ int res = switcher(i); | |
| 1356 | \\ if (res != expected[i]) abort(); | |
| 1357 | \\ } | |
| 1358 | \\ if (switcher(42) != 43) abort(); | |
| 1359 | \\ return 0; | |
| 1360 | \\} | |
| 1361 | , ""); | |
| 1362 | ||
| 1363 | cases.add("Cast to enum from larger integral type. Issue #6011", | |
| 1364 | \\#include <stdint.h> | |
| 1365 | \\#include <stdlib.h> | |
| 1366 | \\enum Foo { A, B, C }; | |
| 1367 | \\static inline enum Foo do_stuff(void) { | |
| 1368 | \\ int64_t i = 1; | |
| 1369 | \\ return (enum Foo)i; | |
| 1370 | \\} | |
| 1371 | \\int main(void) { | |
| 1372 | \\ if (do_stuff() != B) abort(); | |
| 1373 | \\ return 0; | |
| 1374 | \\} | |
| 1375 | , ""); | |
| 1376 | ||
| 1377 | cases.add("Render array LHS as grouped node if necessary", | |
| 1378 | \\#include <stdlib.h> | |
| 1379 | \\int main(void) { | |
| 1380 | \\ int arr[] = {40, 41, 42, 43}; | |
| 1381 | \\ if ((arr + 1)[1] != 42) abort(); | |
| 1382 | \\ return 0; | |
| 1383 | \\} | |
| 1384 | , ""); | |
| 1385 | ||
| 1386 | cases.add("typedef with multiple names", | |
| 1387 | \\#include <stdlib.h> | |
| 1388 | \\typedef struct { | |
| 1389 | \\ char field; | |
| 1390 | \\} a_t, b_t; | |
| 1391 | \\ | |
| 1392 | \\int main(void) { | |
| 1393 | \\ a_t a = { .field = 42 }; | |
| 1394 | \\ b_t b = a; | |
| 1395 | \\ if (b.field != 42) abort(); | |
| 1396 | \\ return 0; | |
| 1397 | \\} | |
| 1398 | , ""); | |
| 1399 | ||
| 1400 | cases.add("__cleanup__ attribute", | |
| 1401 | \\#include <stdlib.h> | |
| 1402 | \\static int cleanup_count = 0; | |
| 1403 | \\void clean_up(int *final_value) { | |
| 1404 | \\ if (*final_value != cleanup_count++) abort(); | |
| 1405 | \\} | |
| 1406 | \\void doit(void) { | |
| 1407 | \\ int a __attribute__ ((__cleanup__(clean_up))) __attribute__ ((unused)) = 2; | |
| 1408 | \\ int b __attribute__ ((__cleanup__(clean_up))) __attribute__ ((unused)) = 1; | |
| 1409 | \\ int c __attribute__ ((__cleanup__(clean_up))) __attribute__ ((unused)) = 0; | |
| 1410 | \\} | |
| 1411 | \\int main(void) { | |
| 1412 | \\ doit(); | |
| 1413 | \\ if (cleanup_count != 3) abort(); | |
| 1414 | \\ return 0; | |
| 1415 | \\} | |
| 1416 | , ""); | |
| 1417 | ||
| 1418 | cases.add("enum used as boolean expression", | |
| 1419 | \\#include <stdlib.h> | |
| 1420 | \\enum FOO {BAR, BAZ}; | |
| 1421 | \\int main(void) { | |
| 1422 | \\ enum FOO x = BAR; | |
| 1423 | \\ if (x) abort(); | |
| 1424 | \\ if (!BAZ) abort(); | |
| 1425 | \\ return 0; | |
| 1426 | \\} | |
| 1427 | , ""); | |
| 1428 | ||
| 1429 | cases.add("Flexible arrays", | |
| 1430 | \\#include <stdlib.h> | |
| 1431 | \\#include <stdint.h> | |
| 1432 | \\typedef struct { char foo; int bar; } ITEM; | |
| 1433 | \\typedef struct { size_t count; ITEM items[]; } ITEM_LIST; | |
| 1434 | \\typedef struct { unsigned char count; int items[]; } INT_LIST; | |
| 1435 | \\#define SIZE 10 | |
| 1436 | \\int main(void) { | |
| 1437 | \\ ITEM_LIST *list = malloc(sizeof(ITEM_LIST) + SIZE * sizeof(ITEM)); | |
| 1438 | \\ for (int i = 0; i < SIZE; i++) list->items[i] = (ITEM) {.foo = i, .bar = i + 1}; | |
| 1439 | \\ const ITEM_LIST *const c_list = list; | |
| 1440 | \\ for (int i = 0; i < SIZE; i++) if (c_list->items[i].foo != i || c_list->items[i].bar != i + 1) abort(); | |
| 1441 | \\ INT_LIST *int_list = malloc(sizeof(INT_LIST) + SIZE * sizeof(int)); | |
| 1442 | \\ for (int i = 0; i < SIZE; i++) int_list->items[i] = i; | |
| 1443 | \\ const INT_LIST *const c_int_list = int_list; | |
| 1444 | \\ const int *const ints = int_list->items; | |
| 1445 | \\ for (int i = 0; i < SIZE; i++) if (ints[i] != i) abort(); | |
| 1446 | \\ return 0; | |
| 1447 | \\} | |
| 1448 | , ""); | |
| 1449 | ||
| 1450 | cases.add("Flexible array with typedefed flexible item, issue #16838", | |
| 1451 | \\#include <stdlib.h> | |
| 1452 | \\#include <assert.h> | |
| 1453 | \\typedef int MARKER[0]; | |
| 1454 | \\typedef struct { int x; MARKER y; } Flexible; | |
| 1455 | \\#define SIZE 10 | |
| 1456 | \\int main(void) { | |
| 1457 | \\ Flexible *flex = malloc(sizeof(Flexible) + SIZE * sizeof(int)); | |
| 1458 | \\ for (int i = 0; i < SIZE; i++) { | |
| 1459 | \\ flex->y[i] = i; | |
| 1460 | \\ } | |
| 1461 | \\ for (int i = 0; i < SIZE; i++) { | |
| 1462 | \\ assert(flex->y[i] == i); | |
| 1463 | \\ } | |
| 1464 | \\ return 0; | |
| 1465 | \\} | |
| 1466 | , ""); | |
| 1467 | ||
| 1468 | cases.add("enum with value that fits in c_uint but not c_int, issue #8003", | |
| 1469 | \\#include <stdlib.h> | |
| 1470 | \\enum my_enum { | |
| 1471 | \\ FORCE_UINT = 0xffffffff | |
| 1472 | \\}; | |
| 1473 | \\int main(void) { | |
| 1474 | \\ if(FORCE_UINT != 0xffffffff) abort(); | |
| 1475 | \\} | |
| 1476 | , ""); | |
| 1477 | ||
| 1478 | cases.add("block-scope static variable shadows function parameter. Issue #8208", | |
| 1479 | \\#include <stdlib.h> | |
| 1480 | \\int func1(int foo) { return foo + 1; } | |
| 1481 | \\int func2(void) { | |
| 1482 | \\ static int foo = 5; | |
| 1483 | \\ return foo++; | |
| 1484 | \\} | |
| 1485 | \\int main(void) { | |
| 1486 | \\ if (func1(42) != 43) abort(); | |
| 1487 | \\ if (func2() != 5) abort(); | |
| 1488 | \\ if (func2() != 6) abort(); | |
| 1489 | \\ return 0; | |
| 1490 | \\} | |
| 1491 | , ""); | |
| 1492 | ||
| 1493 | cases.add("nested same-name static locals", | |
| 1494 | \\#include <stdlib.h> | |
| 1495 | \\int func(int val) { | |
| 1496 | \\ static int foo; | |
| 1497 | \\ if (foo != val) abort(); | |
| 1498 | \\ { | |
| 1499 | \\ foo += 1; | |
| 1500 | \\ static int foo = 2; | |
| 1501 | \\ if (foo != val + 2) abort(); | |
| 1502 | \\ foo += 1; | |
| 1503 | \\ } | |
| 1504 | \\ return foo; | |
| 1505 | \\} | |
| 1506 | \\int main(void) { | |
| 1507 | \\ int foo = 1; | |
| 1508 | \\ if (func(0) != 1) abort(); | |
| 1509 | \\ if (func(1) != 2) abort(); | |
| 1510 | \\ if (func(2) != 3) abort(); | |
| 1511 | \\ if (foo != 1) abort(); | |
| 1512 | \\ return 0; | |
| 1513 | \\} | |
| 1514 | , ""); | |
| 1515 | ||
| 1516 | cases.add("Enum constants are assigned correct type. Issue #9153", | |
| 1517 | \\enum A { A0, A1=0xFFFFFFFF }; | |
| 1518 | \\enum B { B0=-1, B1=0xFFFFFFFF }; | |
| 1519 | \\enum C { C0=-1, C1=0 }; | |
| 1520 | \\enum D { D0, D1=0xFFFFFFFFFFL }; | |
| 1521 | \\enum E { E0=-1, E1=0xFFFFFFFFFFL }; | |
| 1522 | \\int main(void) { | |
| 1523 | \\ signed char a0 = A0, a1 = A1; | |
| 1524 | \\ signed char b0 = B0, b1 = B1; | |
| 1525 | \\ signed char c0 = C0, c1 = C1; | |
| 1526 | \\ signed char d0 = D0, d1 = D1; | |
| 1527 | \\ signed char e0 = E0, e1 = E1; | |
| 1528 | \\ return 0; | |
| 1529 | \\} | |
| 1530 | , ""); | |
| 1531 | ||
| 1532 | cases.add("Enum constant matches enum name; multiple enumerations with same value", | |
| 1533 | \\#include <stdlib.h> | |
| 1534 | \\enum FOO { | |
| 1535 | \\ FOO = 1, | |
| 1536 | \\ BAR = 2, | |
| 1537 | \\ BAZ = 1, | |
| 1538 | \\}; | |
| 1539 | \\int main(void) { | |
| 1540 | \\ enum FOO x = BAZ; | |
| 1541 | \\ if (x != 1) abort(); | |
| 1542 | \\ if (x != BAZ) abort(); | |
| 1543 | \\ if (x != FOO) abort(); | |
| 1544 | \\} | |
| 1545 | , ""); | |
| 1546 | ||
| 1547 | cases.add("Scoped enums", | |
| 1548 | \\#include <stdlib.h> | |
| 1549 | \\int main(void) { | |
| 1550 | \\ enum Foo { A, B, C }; | |
| 1551 | \\ enum Foo a = B; | |
| 1552 | \\ if (a != B) abort(); | |
| 1553 | \\ if (a != 1) abort(); | |
| 1554 | \\ { | |
| 1555 | \\ enum Foo { A = 5, B = 6, C = 7 }; | |
| 1556 | \\ enum Foo a = B; | |
| 1557 | \\ if (a != B) abort(); | |
| 1558 | \\ if (a != 6) abort(); | |
| 1559 | \\ } | |
| 1560 | \\ if (a != B) abort(); | |
| 1561 | \\ if (a != 1) abort(); | |
| 1562 | \\} | |
| 1563 | , ""); | |
| 1564 | ||
| 1565 | cases.add("Underscore identifiers", | |
| 1566 | \\#include <stdlib.h> | |
| 1567 | \\int _ = 10; | |
| 1568 | \\typedef struct { int _; } S; | |
| 1569 | \\int main(void) { | |
| 1570 | \\ if (_ != 10) abort(); | |
| 1571 | \\ S foo = { ._ = _ }; | |
| 1572 | \\ if (foo._ != _) abort(); | |
| 1573 | \\ return 0; | |
| 1574 | \\} | |
| 1575 | , ""); | |
| 1576 | ||
| 1577 | cases.add("__builtin_choose_expr (unchosen expression is not evaluated)", | |
| 1578 | \\#include <stdlib.h> | |
| 1579 | \\int main(void) { | |
| 1580 | \\ int x = 0.0; | |
| 1581 | \\ int y = 0.0; | |
| 1582 | \\ int res; | |
| 1583 | \\ res = __builtin_choose_expr(1, 1, x / y); | |
| 1584 | \\ if (res != 1) abort(); | |
| 1585 | \\ res = __builtin_choose_expr(0, x / y, 2); | |
| 1586 | \\ if (res != 2) abort(); | |
| 1587 | \\ return 0; | |
| 1588 | \\} | |
| 1589 | , ""); | |
| 1590 | ||
| 1591 | // TODO: add isnan check for long double once bitfield support is added | |
| 1592 | // (needed for x86_64-windows-gnu) | |
| 1593 | // TODO: add isinf check for long double once std.math.isInf supports c_longdouble | |
| 1594 | cases.add("NAN and INFINITY", | |
| 1595 | \\#include <math.h> | |
| 1596 | \\#include <stdint.h> | |
| 1597 | \\#include <stdlib.h> | |
| 1598 | \\union uf { uint32_t u; float f; }; | |
| 1599 | \\#define CHECK_NAN(STR, VAL) { \ | |
| 1600 | \\ union uf unpack = {.f = __builtin_nanf(STR)}; \ | |
| 1601 | \\ if (!isnan(unpack.f)) abort(); \ | |
| 1602 | \\ if (unpack.u != VAL) abort(); \ | |
| 1603 | \\} | |
| 1604 | \\int main(void) { | |
| 1605 | \\ float f_nan = NAN; | |
| 1606 | \\ if (!isnan(f_nan)) abort(); | |
| 1607 | \\ double d_nan = NAN; | |
| 1608 | \\ if (!isnan(d_nan)) abort(); | |
| 1609 | \\ CHECK_NAN("0", 0x7FC00000); | |
| 1610 | \\ CHECK_NAN("", 0x7FC00000); | |
| 1611 | \\ CHECK_NAN("1", 0x7FC00001); | |
| 1612 | \\ CHECK_NAN("0x7FC00000", 0x7FC00000); | |
| 1613 | \\ CHECK_NAN("0x7FC0000F", 0x7FC0000F); | |
| 1614 | \\ CHECK_NAN("0x7FC000F0", 0x7FC000F0); | |
| 1615 | \\ CHECK_NAN("0x7FC00F00", 0x7FC00F00); | |
| 1616 | \\ CHECK_NAN("0x7FC0F000", 0x7FC0F000); | |
| 1617 | \\ CHECK_NAN("0x7FCF0000", 0x7FCF0000); | |
| 1618 | \\ CHECK_NAN("0xFFFFFFFF", 0x7FFFFFFF); | |
| 1619 | \\ float f_inf = INFINITY; | |
| 1620 | \\ if (!isinf(f_inf)) abort(); | |
| 1621 | \\ double d_inf = INFINITY; | |
| 1622 | \\ if (!isinf(d_inf)) abort(); | |
| 1623 | \\ return 0; | |
| 1624 | \\} | |
| 1625 | , ""); | |
| 1626 | ||
| 1627 | cases.add("signed array subscript. Issue #8556", | |
| 1628 | \\#include <stdint.h> | |
| 1629 | \\#include <stdlib.h> | |
| 1630 | \\#define TEST_NEGATIVE(type) { type x = -1; if (ptr[x] != 42) abort(); } | |
| 1631 | \\#define TEST_UNSIGNED(type) { type x = 2; if (arr[x] != 42) abort(); } | |
| 1632 | \\int main(void) { | |
| 1633 | \\ int arr[] = {40, 41, 42, 43}; | |
| 1634 | \\ int *ptr = arr + 3; | |
| 1635 | \\ if (ptr[-1] != 42) abort(); | |
| 1636 | \\ TEST_NEGATIVE(int); | |
| 1637 | \\ TEST_NEGATIVE(long); | |
| 1638 | \\ TEST_NEGATIVE(long long); | |
| 1639 | \\ TEST_NEGATIVE(int64_t); | |
| 1640 | \\ TEST_NEGATIVE(__int128); | |
| 1641 | \\ TEST_UNSIGNED(unsigned); | |
| 1642 | \\ TEST_UNSIGNED(unsigned long); | |
| 1643 | \\ TEST_UNSIGNED(unsigned long long); | |
| 1644 | \\ TEST_UNSIGNED(uint64_t); | |
| 1645 | \\ TEST_UNSIGNED(size_t); | |
| 1646 | \\ TEST_UNSIGNED(unsigned __int128); | |
| 1647 | \\ return 0; | |
| 1648 | \\} | |
| 1649 | , ""); | |
| 1650 | ||
| 1651 | cases.add("Ensure side-effects only evaluated once for signed array indices", | |
| 1652 | \\#include <stdlib.h> | |
| 1653 | \\int main(void) { | |
| 1654 | \\ int foo[] = {1, 2, 3, 4}; | |
| 1655 | \\ int *p = foo; | |
| 1656 | \\ int idx = 1; | |
| 1657 | \\ if ((++p)[--idx] != 2) abort(); | |
| 1658 | \\ if (p != foo + 1) abort(); | |
| 1659 | \\ if (idx != 0) abort(); | |
| 1660 | \\ if ((p++)[idx++] != 2) abort(); | |
| 1661 | \\ if (p != foo + 2) abort(); | |
| 1662 | \\ if (idx != 1) abort(); | |
| 1663 | \\ return 0; | |
| 1664 | \\} | |
| 1665 | , ""); | |
| 1666 | ||
| 1667 | cases.add("Allow non-const char* string literals. Issue #9126", | |
| 1668 | \\#include <stdlib.h> | |
| 1669 | \\int func(char *x) { return x[0]; } | |
| 1670 | \\struct S { char *member; }; | |
| 1671 | \\struct S global_struct = { .member = "global" }; | |
| 1672 | \\char *g = "global"; | |
| 1673 | \\int main(void) { | |
| 1674 | \\ if (g[0] != 'g') abort(); | |
| 1675 | \\ if (global_struct.member[0] != 'g') abort(); | |
| 1676 | \\ char *string = "hello"; | |
| 1677 | \\ if (string[0] != 'h') abort(); | |
| 1678 | \\ struct S s = {.member = "hello"}; | |
| 1679 | \\ if (s.member[0] != 'h') abort(); | |
| 1680 | \\ if (func("foo") != 'f') abort(); | |
| 1681 | \\ return 0; | |
| 1682 | \\} | |
| 1683 | , ""); | |
| 1684 | ||
| 1685 | cases.add("Ensure while loop under an if doesn't steal the else. Issue #9953", | |
| 1686 | \\#include <stdio.h> | |
| 1687 | \\void doWork(int id) { } | |
| 1688 | \\int reallyDelete(int id) { printf("deleted %d\n", id); return 1; } | |
| 1689 | \\int process(int id, int n, int delete) { | |
| 1690 | \\ if(!delete) | |
| 1691 | \\ while(n-- > 0) doWork(id); | |
| 1692 | \\ else | |
| 1693 | \\ return reallyDelete(id); | |
| 1694 | \\ return 0; | |
| 1695 | \\} | |
| 1696 | \\int main(void) { | |
| 1697 | \\ process(99, 3, 0); | |
| 1698 | \\ return 0; | |
| 1699 | \\} | |
| 1700 | , ""); | |
| 1701 | ||
| 1702 | cases.add("Remainder operator with negative integers. Issue #10176", | |
| 1703 | \\#include <stdlib.h> | |
| 1704 | \\int main(void) { | |
| 1705 | \\ int denominator = -2; | |
| 1706 | \\ int numerator = 5; | |
| 1707 | \\ if (numerator % denominator != 1) abort(); | |
| 1708 | \\ numerator = -5; denominator = 2; | |
| 1709 | \\ if (numerator % denominator != -1) abort(); | |
| 1710 | \\ return 0; | |
| 1711 | \\} | |
| 1712 | , ""); | |
| 1713 | ||
| 1714 | cases.add("Boolean expression coerced to int. Issue #10175", | |
| 1715 | \\#include <stdlib.h> | |
| 1716 | \\int sign(int v) { | |
| 1717 | \\ return -(v < 0); | |
| 1718 | \\} | |
| 1719 | \\int main(void) { | |
| 1720 | \\ if (sign(-5) != -1) abort(); | |
| 1721 | \\ if (sign(5) != 0) abort(); | |
| 1722 | \\ if (sign(0) != 0) abort(); | |
| 1723 | \\ return 0; | |
| 1724 | \\} | |
| 1725 | , ""); | |
| 1726 | ||
| 1727 | cases.add("Typedef'ed void used as return type. Issue #10356", | |
| 1728 | \\typedef void V; | |
| 1729 | \\V foo(V *f) {} | |
| 1730 | \\int main(void) { | |
| 1731 | \\ int x = 0; | |
| 1732 | \\ foo(&x); | |
| 1733 | \\ return 0; | |
| 1734 | \\} | |
| 1735 | , ""); | |
| 1736 | ||
| 1737 | cases.add("Zero-initialization of global union. Issue #10797", | |
| 1738 | \\#include <stdlib.h> | |
| 1739 | \\union U { int x; double y; }; | |
| 1740 | \\union U u; | |
| 1741 | \\int main(void) { | |
| 1742 | \\ if (u.x != 0) abort(); | |
| 1743 | \\ return 0; | |
| 1744 | \\} | |
| 1745 | , ""); | |
| 1746 | ||
| 1747 | cases.add("Cast-to-union. Issue #10955", | |
| 1748 | \\#include <stdlib.h> | |
| 1749 | \\struct S { int x; }; | |
| 1750 | \\union U { | |
| 1751 | \\ long l; | |
| 1752 | \\ double d; | |
| 1753 | \\ struct S s; | |
| 1754 | \\}; | |
| 1755 | \\union U bar(union U u) { return u; } | |
| 1756 | \\int main(void) { | |
| 1757 | \\ union U u = (union U) 42L; | |
| 1758 | \\ if (u.l != 42L) abort(); | |
| 1759 | \\ u = (union U) 2.0; | |
| 1760 | \\ if (u.d != 2.0) abort(); | |
| 1761 | \\ u = bar((union U)4.0); | |
| 1762 | \\ if (u.d != 4.0) abort(); | |
| 1763 | \\ u = (union U)(struct S){ .x = 5 }; | |
| 1764 | \\ if (u.s.x != 5) abort(); | |
| 1765 | \\ return 0; | |
| 1766 | \\} | |
| 1767 | , ""); | |
| 1768 | ||
| 1769 | cases.add("Nested comma operator in macro. Issue #11040", | |
| 1770 | \\#include <stdlib.h> | |
| 1771 | \\#define FOO (1, (2, 3)) | |
| 1772 | \\int main(void) { | |
| 1773 | \\ int x = FOO; | |
| 1774 | \\ if (x != 3) abort(); | |
| 1775 | \\ return 0; | |
| 1776 | \\} | |
| 1777 | , ""); | |
| 1778 | ||
| 1779 | // The C standard does not require function pointers to be convertible to any integer type. | |
| 1780 | // However, POSIX requires that function pointers have the same representation as `void *` | |
| 1781 | // so that dlsym() can work | |
| 1782 | cases.add("Function to integral", | |
| 1783 | \\#include <stdint.h> | |
| 1784 | \\int main(void) { | |
| 1785 | \\#if defined(__UINTPTR_MAX__) && __has_include(<unistd.h>) | |
| 1786 | \\ uintptr_t x = (uintptr_t)main; | |
| 1787 | \\#endif | |
| 1788 | \\ return 0; | |
| 1789 | \\} | |
| 1790 | , ""); | |
| 1791 | ||
| 1792 | cases.add("Closure over local in typeof", | |
| 1793 | \\#include <stdlib.h> | |
| 1794 | \\int main(void) { | |
| 1795 | \\ int x = 123; | |
| 1796 | \\ union { typeof(x) val; } u = { x }; | |
| 1797 | \\ if (u.val != 123) abort(); | |
| 1798 | \\ return 0; | |
| 1799 | \\} | |
| 1800 | , ""); | |
| 1801 | ||
| 1802 | cases.add("struct without global declaration does not conflict with local variable name", | |
| 1803 | \\#include <stdlib.h> | |
| 1804 | \\static void foo(struct foobar *unused) {} | |
| 1805 | \\int main(void) { | |
| 1806 | \\ int struct_foobar = 123; | |
| 1807 | \\ if (struct_foobar != 123) abort(); | |
| 1808 | \\ int foobar = 456; | |
| 1809 | \\ if (foobar != 456) abort(); | |
| 1810 | \\ return 0; | |
| 1811 | \\} | |
| 1812 | , ""); | |
| 1813 | ||
| 1814 | cases.add("struct without global declaration does not conflict with global variable name", | |
| 1815 | \\#include <stdlib.h> | |
| 1816 | \\static void foo(struct foobar *unused) {} | |
| 1817 | \\static int struct_foobar = 123; | |
| 1818 | \\static int foobar = 456; | |
| 1819 | \\int main(void) { | |
| 1820 | \\ if (struct_foobar != 123) abort(); | |
| 1821 | \\ if (foobar != 456) abort(); | |
| 1822 | \\ return 0; | |
| 1823 | \\} | |
| 1824 | , ""); | |
| 1825 | } |
test/src/Cases.zig+1-145| ... | ... | @@ -9,7 +9,6 @@ const ArrayList = std.ArrayList; |
| 9 | 9 | gpa: Allocator, |
| 10 | 10 | arena: Allocator, |
| 11 | 11 | cases: std.array_list.Managed(Case), |
| 12 | translate: std.array_list.Managed(Translate), | |
| 13 | 12 | |
| 14 | 13 | pub const IncrementalCase = struct { |
| 15 | 14 | base_path: []const u8, |
| ... | ... | @@ -127,25 +126,6 @@ pub const Case = struct { |
| 127 | 126 | } |
| 128 | 127 | }; |
| 129 | 128 | |
| 130 | pub const Translate = struct { | |
| 131 | /// The name of the test case. This is shown if a test fails, and | |
| 132 | /// otherwise ignored. | |
| 133 | name: []const u8, | |
| 134 | ||
| 135 | input: [:0]const u8, | |
| 136 | target: std.Build.ResolvedTarget, | |
| 137 | link_libc: bool, | |
| 138 | c_frontend: CFrontend, | |
| 139 | kind: union(enum) { | |
| 140 | /// Translate the input, run it and check that it | |
| 141 | /// outputs the expected text. | |
| 142 | run: []const u8, | |
| 143 | /// Translate the input and check that it contains | |
| 144 | /// the expected lines of code. | |
| 145 | translate: []const []const u8, | |
| 146 | }, | |
| 147 | }; | |
| 148 | ||
| 149 | 129 | pub fn addExe( |
| 150 | 130 | ctx: *Cases, |
| 151 | 131 | name: []const u8, |
| ... | ... | @@ -374,7 +354,6 @@ fn addFromDirInner( |
| 374 | 354 | |
| 375 | 355 | const backends = try manifest.getConfigForKeyAlloc(ctx.arena, "backend", Backend); |
| 376 | 356 | const targets = try manifest.getConfigForKeyAlloc(ctx.arena, "target", std.Target.Query); |
| 377 | const c_frontends = try manifest.getConfigForKeyAlloc(ctx.arena, "c_frontend", CFrontend); | |
| 378 | 357 | const is_test = try manifest.getConfigForKeyAssertSingle("is_test", bool); |
| 379 | 358 | const link_libc = try manifest.getConfigForKeyAssertSingle("link_libc", bool); |
| 380 | 359 | const output_mode = try manifest.getConfigForKeyAssertSingle("output_mode", std.builtin.OutputMode); |
| ... | ... | @@ -384,39 +363,6 @@ fn addFromDirInner( |
| 384 | 363 | const emit_bin = try manifest.getConfigForKeyAssertSingle("emit_bin", bool); |
| 385 | 364 | const imports = try manifest.getConfigForKeyAlloc(ctx.arena, "imports", []const u8); |
| 386 | 365 | |
| 387 | if (manifest.type == .translate_c) { | |
| 388 | for (c_frontends) |c_frontend| { | |
| 389 | for (targets) |target_query| { | |
| 390 | const output = try manifest.trailingLinesSplit(ctx.arena); | |
| 391 | try ctx.translate.append(.{ | |
| 392 | .name = try caseNameFromPath(ctx.arena, filename), | |
| 393 | .c_frontend = c_frontend, | |
| 394 | .target = b.resolveTargetQuery(target_query), | |
| 395 | .link_libc = link_libc, | |
| 396 | .input = src, | |
| 397 | .kind = .{ .translate = output }, | |
| 398 | }); | |
| 399 | } | |
| 400 | } | |
| 401 | continue; | |
| 402 | } | |
| 403 | if (manifest.type == .run_translated_c) { | |
| 404 | for (c_frontends) |c_frontend| { | |
| 405 | for (targets) |target_query| { | |
| 406 | const output = try manifest.trailingSplit(ctx.arena); | |
| 407 | try ctx.translate.append(.{ | |
| 408 | .name = try caseNameFromPath(ctx.arena, filename), | |
| 409 | .c_frontend = c_frontend, | |
| 410 | .target = b.resolveTargetQuery(target_query), | |
| 411 | .link_libc = link_libc, | |
| 412 | .input = src, | |
| 413 | .kind = .{ .run = output }, | |
| 414 | }); | |
| 415 | } | |
| 416 | } | |
| 417 | continue; | |
| 418 | } | |
| 419 | ||
| 420 | 366 | var cases = std.array_list.Managed(usize).init(ctx.arena); |
| 421 | 367 | |
| 422 | 368 | // Cross-product to get all possible test combinations |
| ... | ... | @@ -484,101 +430,11 @@ fn addFromDirInner( |
| 484 | 430 | pub fn init(gpa: Allocator, arena: Allocator) Cases { |
| 485 | 431 | return .{ |
| 486 | 432 | .gpa = gpa, |
| 487 | .cases = std.array_list.Managed(Case).init(gpa), | |
| 488 | .translate = std.array_list.Managed(Translate).init(gpa), | |
| 433 | .cases = .init(gpa), | |
| 489 | 434 | .arena = arena, |
| 490 | 435 | }; |
| 491 | 436 | } |
| 492 | 437 | |
| 493 | pub const TranslateCOptions = struct { | |
| 494 | skip_translate_c: bool = false, | |
| 495 | skip_run_translated_c: bool = false, | |
| 496 | }; | |
| 497 | pub fn lowerToTranslateCSteps( | |
| 498 | self: *Cases, | |
| 499 | b: *std.Build, | |
| 500 | parent_step: *std.Build.Step, | |
| 501 | test_filters: []const []const u8, | |
| 502 | test_target_filters: []const []const u8, | |
| 503 | target: std.Build.ResolvedTarget, | |
| 504 | translate_c_options: TranslateCOptions, | |
| 505 | ) void { | |
| 506 | const tests = @import("../tests.zig"); | |
| 507 | const test_translate_c_step = b.step("test-translate-c", "Run the C translation tests"); | |
| 508 | if (!translate_c_options.skip_translate_c) { | |
| 509 | tests.addTranslateCTests(b, test_translate_c_step, test_filters, test_target_filters); | |
| 510 | parent_step.dependOn(test_translate_c_step); | |
| 511 | } | |
| 512 | ||
| 513 | const test_run_translated_c_step = b.step("test-run-translated-c", "Run the Run-Translated-C tests"); | |
| 514 | if (!translate_c_options.skip_run_translated_c) { | |
| 515 | tests.addRunTranslatedCTests(b, test_run_translated_c_step, test_filters, target); | |
| 516 | parent_step.dependOn(test_run_translated_c_step); | |
| 517 | } | |
| 518 | ||
| 519 | for (self.translate.items) |case| switch (case.kind) { | |
| 520 | .run => |output| { | |
| 521 | if (translate_c_options.skip_run_translated_c) continue; | |
| 522 | const annotated_case_name = b.fmt("run-translated-c {s}", .{case.name}); | |
| 523 | for (test_filters) |test_filter| { | |
| 524 | if (std.mem.indexOf(u8, annotated_case_name, test_filter)) |_| break; | |
| 525 | } else if (test_filters.len > 0) continue; | |
| 526 | if (!std.process.can_spawn) { | |
| 527 | std.debug.print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)}); | |
| 528 | continue; // Pass test. | |
| 529 | } | |
| 530 | ||
| 531 | const write_src = b.addWriteFiles(); | |
| 532 | const file_source = write_src.add("tmp.c", case.input); | |
| 533 | ||
| 534 | const translate_c = b.addTranslateC(.{ | |
| 535 | .root_source_file = file_source, | |
| 536 | .optimize = .Debug, | |
| 537 | .target = case.target, | |
| 538 | .link_libc = case.link_libc, | |
| 539 | .use_clang = case.c_frontend == .clang, | |
| 540 | }); | |
| 541 | translate_c.step.name = b.fmt("{s} translate-c", .{annotated_case_name}); | |
| 542 | ||
| 543 | const run_exe = b.addExecutable(.{ | |
| 544 | .name = "translated_c", | |
| 545 | .root_module = translate_c.createModule(), | |
| 546 | }); | |
| 547 | run_exe.step.name = b.fmt("{s} build-exe", .{annotated_case_name}); | |
| 548 | run_exe.root_module.link_libc = true; | |
| 549 | const run = b.addRunArtifact(run_exe); | |
| 550 | run.step.name = b.fmt("{s} run", .{annotated_case_name}); | |
| 551 | run.expectStdOutEqual(output); | |
| 552 | run.skip_foreign_checks = true; | |
| 553 | ||
| 554 | test_run_translated_c_step.dependOn(&run.step); | |
| 555 | }, | |
| 556 | .translate => |output| { | |
| 557 | if (translate_c_options.skip_translate_c) continue; | |
| 558 | const annotated_case_name = b.fmt("zig translate-c {s}", .{case.name}); | |
| 559 | for (test_filters) |test_filter| { | |
| 560 | if (std.mem.indexOf(u8, annotated_case_name, test_filter)) |_| break; | |
| 561 | } else if (test_filters.len > 0) continue; | |
| 562 | ||
| 563 | const write_src = b.addWriteFiles(); | |
| 564 | const file_source = write_src.add("tmp.c", case.input); | |
| 565 | ||
| 566 | const translate_c = b.addTranslateC(.{ | |
| 567 | .root_source_file = file_source, | |
| 568 | .optimize = .Debug, | |
| 569 | .target = case.target, | |
| 570 | .link_libc = case.link_libc, | |
| 571 | .use_clang = case.c_frontend == .clang, | |
| 572 | }); | |
| 573 | translate_c.step.name = b.fmt("{s} translate-c", .{annotated_case_name}); | |
| 574 | ||
| 575 | const check_file = translate_c.addCheckFile(output); | |
| 576 | check_file.step.name = b.fmt("{s} CheckFile", .{annotated_case_name}); | |
| 577 | test_translate_c_step.dependOn(&check_file.step); | |
| 578 | }, | |
| 579 | }; | |
| 580 | } | |
| 581 | ||
| 582 | 438 | pub const CaseTestOptions = struct { |
| 583 | 439 | test_filters: []const []const u8, |
| 584 | 440 | test_target_filters: []const []const u8, |
test/tests.zig-53| ... | ... | @@ -7,14 +7,10 @@ const Step = std.Build.Step; |
| 7 | 7 | |
| 8 | 8 | // Cases |
| 9 | 9 | const stack_traces = @import("stack_traces.zig"); |
| 10 | const translate_c = @import("translate_c.zig"); | |
| 11 | const run_translated_c = @import("run_translated_c.zig"); | |
| 12 | 10 | const llvm_ir = @import("llvm_ir.zig"); |
| 13 | 11 | const libc = @import("libc.zig"); |
| 14 | 12 | |
| 15 | 13 | // Implementations |
| 16 | pub const TranslateCContext = @import("src/TranslateC.zig"); | |
| 17 | pub const RunTranslatedCContext = @import("src/RunTranslatedC.zig"); | |
| 18 | 14 | pub const StackTracesContext = @import("src/StackTrace.zig"); |
| 19 | 15 | pub const DebuggerContext = @import("src/Debugger.zig"); |
| 20 | 16 | pub const LlvmIrContext = @import("src/LlvmIr.zig"); |
| ... | ... | @@ -1901,7 +1897,6 @@ pub fn addStandaloneTests( |
| 1901 | 1897 | enable_macos_sdk: bool, |
| 1902 | 1898 | enable_ios_sdk: bool, |
| 1903 | 1899 | enable_symlinks_windows: bool, |
| 1904 | skip_translate_c: bool, | |
| 1905 | 1900 | ) *Step { |
| 1906 | 1901 | const step = b.step("test-standalone", "Run the standalone tests"); |
| 1907 | 1902 | if (compilerHasPackageManager(b)) { |
| ... | ... | @@ -1914,7 +1909,6 @@ pub fn addStandaloneTests( |
| 1914 | 1909 | .simple_skip_release_safe = mem.indexOfScalar(OptimizeMode, optimize_modes, .ReleaseSafe) == null, |
| 1915 | 1910 | .simple_skip_release_fast = mem.indexOfScalar(OptimizeMode, optimize_modes, .ReleaseFast) == null, |
| 1916 | 1911 | .simple_skip_release_small = mem.indexOfScalar(OptimizeMode, optimize_modes, .ReleaseSmall) == null, |
| 1917 | .skip_translate_c = skip_translate_c, | |
| 1918 | 1912 | }); |
| 1919 | 1913 | const test_cases_dep_step = test_cases_dep.builder.default_step; |
| 1920 | 1914 | test_cases_dep_step.name = b.dupe(test_cases_dep_name); |
| ... | ... | @@ -2155,42 +2149,6 @@ pub fn addCliTests(b: *std.Build) *Step { |
| 2155 | 2149 | return step; |
| 2156 | 2150 | } |
| 2157 | 2151 | |
| 2158 | pub fn addTranslateCTests( | |
| 2159 | b: *std.Build, | |
| 2160 | parent_step: *std.Build.Step, | |
| 2161 | test_filters: []const []const u8, | |
| 2162 | test_target_filters: []const []const u8, | |
| 2163 | ) void { | |
| 2164 | const cases = b.allocator.create(TranslateCContext) catch @panic("OOM"); | |
| 2165 | cases.* = TranslateCContext{ | |
| 2166 | .b = b, | |
| 2167 | .step = parent_step, | |
| 2168 | .test_index = 0, | |
| 2169 | .test_filters = test_filters, | |
| 2170 | .test_target_filters = test_target_filters, | |
| 2171 | }; | |
| 2172 | ||
| 2173 | translate_c.addCases(cases); | |
| 2174 | } | |
| 2175 | ||
| 2176 | pub fn addRunTranslatedCTests( | |
| 2177 | b: *std.Build, | |
| 2178 | parent_step: *std.Build.Step, | |
| 2179 | test_filters: []const []const u8, | |
| 2180 | target: std.Build.ResolvedTarget, | |
| 2181 | ) void { | |
| 2182 | const cases = b.allocator.create(RunTranslatedCContext) catch @panic("OOM"); | |
| 2183 | cases.* = .{ | |
| 2184 | .b = b, | |
| 2185 | .step = parent_step, | |
| 2186 | .test_index = 0, | |
| 2187 | .test_filters = test_filters, | |
| 2188 | .target = target, | |
| 2189 | }; | |
| 2190 | ||
| 2191 | run_translated_c.addCases(cases); | |
| 2192 | } | |
| 2193 | ||
| 2194 | 2152 | const ModuleTestOptions = struct { |
| 2195 | 2153 | test_filters: []const []const u8, |
| 2196 | 2154 | test_target_filters: []const []const u8, |
| ... | ... | @@ -2558,9 +2516,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step { |
| 2558 | 2516 | pub fn addCases( |
| 2559 | 2517 | b: *std.Build, |
| 2560 | 2518 | parent_step: *Step, |
| 2561 | target: std.Build.ResolvedTarget, | |
| 2562 | 2519 | case_test_options: @import("src/Cases.zig").CaseTestOptions, |
| 2563 | translate_c_options: @import("src/Cases.zig").TranslateCOptions, | |
| 2564 | 2520 | build_options: @import("cases.zig").BuildOptions, |
| 2565 | 2521 | ) !void { |
| 2566 | 2522 | const arena = b.allocator; |
| ... | ... | @@ -2574,15 +2530,6 @@ pub fn addCases( |
| 2574 | 2530 | cases.addFromDir(dir, b); |
| 2575 | 2531 | try @import("cases.zig").addCases(&cases, build_options, b); |
| 2576 | 2532 | |
| 2577 | cases.lowerToTranslateCSteps( | |
| 2578 | b, | |
| 2579 | parent_step, | |
| 2580 | case_test_options.test_filters, | |
| 2581 | case_test_options.test_target_filters, | |
| 2582 | target, | |
| 2583 | translate_c_options, | |
| 2584 | ); | |
| 2585 | ||
| 2586 | 2533 | cases.lowerToBuildSteps( |
| 2587 | 2534 | b, |
| 2588 | 2535 | parent_step, |
test/translate_c.zig deleted-3923| ... | ... | @@ -1,3923 +0,0 @@ |
| 1 | const std = @import("std"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | const tests = @import("tests.zig"); | |
| 4 | ||
| 5 | // ******************************************************** | |
| 6 | // * * | |
| 7 | // * DO NOT ADD NEW CASES HERE * | |
| 8 | // * instead add a file to test/cases/translate_c * | |
| 9 | // * * | |
| 10 | // ******************************************************** | |
| 11 | ||
| 12 | pub fn addCases(cases: *tests.TranslateCContext) void { | |
| 13 | const default_enum_type = if (builtin.abi == .msvc) "c_int" else "c_uint"; | |
| 14 | ||
| 15 | cases.add("do while with breaks", | |
| 16 | \\void foo(int a) { | |
| 17 | \\ do { | |
| 18 | \\ if (a) break; | |
| 19 | \\ } while (4); | |
| 20 | \\ do { | |
| 21 | \\ if (a) break; | |
| 22 | \\ } while (0); | |
| 23 | \\ do { | |
| 24 | \\ if (a) break; | |
| 25 | \\ } while (a); | |
| 26 | \\ do { | |
| 27 | \\ break; | |
| 28 | \\ } while (3); | |
| 29 | \\ do { | |
| 30 | \\ break; | |
| 31 | \\ } while (0); | |
| 32 | \\ do { | |
| 33 | \\ break; | |
| 34 | \\ } while (a); | |
| 35 | \\} | |
| 36 | , &[_][]const u8{ | |
| 37 | \\pub export fn foo(arg_a: c_int) void { | |
| 38 | \\ var a = arg_a; | |
| 39 | \\ _ = &a; | |
| 40 | \\ while (true) { | |
| 41 | \\ if (a != 0) break; | |
| 42 | \\ } | |
| 43 | \\ while (true) { | |
| 44 | \\ if (a != 0) break; | |
| 45 | \\ if (!false) break; | |
| 46 | \\ } | |
| 47 | \\ while (true) { | |
| 48 | \\ if (a != 0) break; | |
| 49 | \\ if (!(a != 0)) break; | |
| 50 | \\ } | |
| 51 | \\ while (true) { | |
| 52 | \\ break; | |
| 53 | \\ } | |
| 54 | \\ while (true) { | |
| 55 | \\ break; | |
| 56 | \\ } | |
| 57 | \\ while (true) { | |
| 58 | \\ break; | |
| 59 | \\ } | |
| 60 | \\} | |
| 61 | }); | |
| 62 | ||
| 63 | cases.add("variables check for opaque demotion", | |
| 64 | \\struct A { | |
| 65 | \\ _Atomic int a; | |
| 66 | \\} a; | |
| 67 | \\int main(void) { | |
| 68 | \\ struct A a; | |
| 69 | \\} | |
| 70 | , &[_][]const u8{ | |
| 71 | \\pub const struct_A = opaque {}; | |
| 72 | \\pub const a = @compileError("non-extern variable has opaque type"); | |
| 73 | , | |
| 74 | \\pub extern fn main() c_int; | |
| 75 | }); | |
| 76 | ||
| 77 | cases.add("unnamed child types of typedef receive typedef's name", | |
| 78 | \\typedef enum { | |
| 79 | \\ FooA, | |
| 80 | \\ FooB, | |
| 81 | \\} Foo; | |
| 82 | \\typedef struct { | |
| 83 | \\ int a, b; | |
| 84 | \\} Bar; | |
| 85 | , &[_][]const u8{ | |
| 86 | \\pub const FooA: c_int = 0; | |
| 87 | \\pub const FooB: c_int = 1; | |
| 88 | \\pub const Foo = | |
| 89 | ++ " " ++ default_enum_type ++ | |
| 90 | \\; | |
| 91 | \\pub const Bar = extern struct { | |
| 92 | \\ a: c_int = @import("std").mem.zeroes(c_int), | |
| 93 | \\ b: c_int = @import("std").mem.zeroes(c_int), | |
| 94 | \\}; | |
| 95 | }); | |
| 96 | ||
| 97 | cases.add("if as while stmt has semicolon", | |
| 98 | \\void foo() { | |
| 99 | \\ while (1) if (1) { | |
| 100 | \\ int a = 1; | |
| 101 | \\ } else { | |
| 102 | \\ int b = 2; | |
| 103 | \\ } | |
| 104 | \\ if (1) if (1) {} | |
| 105 | \\} | |
| 106 | , &[_][]const u8{ | |
| 107 | \\pub export fn foo() void { | |
| 108 | \\ while (true) if (true) { | |
| 109 | \\ var a: c_int = 1; | |
| 110 | \\ _ = &a; | |
| 111 | \\ } else { | |
| 112 | \\ var b: c_int = 2; | |
| 113 | \\ _ = &b; | |
| 114 | \\ }; | |
| 115 | \\ if (true) if (true) {}; | |
| 116 | \\} | |
| 117 | }); | |
| 118 | ||
| 119 | cases.add("conditional operator cast to void", | |
| 120 | \\int bar(); | |
| 121 | \\void foo() { | |
| 122 | \\ int a; | |
| 123 | \\ a ? a = 2 : bar(); | |
| 124 | \\} | |
| 125 | , &[_][]const u8{ | |
| 126 | \\pub extern fn bar(...) c_int; | |
| 127 | \\pub export fn foo() void { | |
| 128 | \\ var a: c_int = undefined; | |
| 129 | \\ _ = &a; | |
| 130 | \\ if (a != 0) a = 2 else _ = bar(); | |
| 131 | \\} | |
| 132 | }); | |
| 133 | ||
| 134 | cases.add("scoped typedef", | |
| 135 | \\void foo() { | |
| 136 | \\ typedef union { | |
| 137 | \\ int A; | |
| 138 | \\ int B; | |
| 139 | \\ int C; | |
| 140 | \\ } Foo; | |
| 141 | \\ Foo a = {0}; | |
| 142 | \\ { | |
| 143 | \\ typedef union { | |
| 144 | \\ int A; | |
| 145 | \\ int B; | |
| 146 | \\ int C; | |
| 147 | \\ } Foo; | |
| 148 | \\ Foo a = {0}; | |
| 149 | \\ } | |
| 150 | \\} | |
| 151 | , &[_][]const u8{ | |
| 152 | \\pub export fn foo() void { | |
| 153 | \\ const union_unnamed_1 = extern union { | |
| 154 | \\ A: c_int, | |
| 155 | \\ B: c_int, | |
| 156 | \\ C: c_int, | |
| 157 | \\ }; | |
| 158 | \\ _ = &union_unnamed_1; | |
| 159 | \\ const Foo = union_unnamed_1; | |
| 160 | \\ _ = &Foo; | |
| 161 | \\ var a: Foo = Foo{ | |
| 162 | \\ .A = @as(c_int, 0), | |
| 163 | \\ }; | |
| 164 | \\ _ = &a; | |
| 165 | \\ { | |
| 166 | \\ const union_unnamed_2 = extern union { | |
| 167 | \\ A: c_int, | |
| 168 | \\ B: c_int, | |
| 169 | \\ C: c_int, | |
| 170 | \\ }; | |
| 171 | \\ _ = &union_unnamed_2; | |
| 172 | \\ const Foo_1 = union_unnamed_2; | |
| 173 | \\ _ = &Foo_1; | |
| 174 | \\ var a_2: Foo_1 = Foo_1{ | |
| 175 | \\ .A = @as(c_int, 0), | |
| 176 | \\ }; | |
| 177 | \\ _ = &a_2; | |
| 178 | \\ } | |
| 179 | \\} | |
| 180 | }); | |
| 181 | ||
| 182 | cases.add("use cast param as macro fn return type", | |
| 183 | \\#include <stdint.h> | |
| 184 | \\#define SYS_BASE_CACHED 0 | |
| 185 | \\#define MEM_PHYSICAL_TO_K0(x) (void*)((uint32_t)(x) + SYS_BASE_CACHED) | |
| 186 | , &[_][]const u8{ | |
| 187 | \\pub inline fn MEM_PHYSICAL_TO_K0(x: anytype) ?*anyopaque { | |
| 188 | \\ _ = &x; | |
| 189 | \\ return @import("std").zig.c_translation.cast(?*anyopaque, @import("std").zig.c_translation.cast(u32, x) + SYS_BASE_CACHED); | |
| 190 | \\} | |
| 191 | }); | |
| 192 | ||
| 193 | cases.add("variadic function demoted to extern", | |
| 194 | \\int foo(int bar, ...) { | |
| 195 | \\ return 1; | |
| 196 | \\} | |
| 197 | , &[_][]const u8{ | |
| 198 | \\warning: TODO unable to translate variadic function, demoted to extern | |
| 199 | \\pub extern fn foo(bar: c_int, ...) c_int; | |
| 200 | }); | |
| 201 | ||
| 202 | cases.add("pointer to opaque demoted struct", | |
| 203 | \\typedef struct { | |
| 204 | \\ _Atomic int foo; | |
| 205 | \\} Foo; | |
| 206 | \\ | |
| 207 | \\typedef struct { | |
| 208 | \\ Foo *bar; | |
| 209 | \\} Bar; | |
| 210 | , &[_][]const u8{ | |
| 211 | \\source.h:1:9: warning: struct demoted to opaque type - unable to translate type of field foo | |
| 212 | \\pub const Foo = opaque {}; | |
| 213 | \\pub const Bar = extern struct { | |
| 214 | \\ bar: ?*Foo = @import("std").mem.zeroes(?*Foo), | |
| 215 | \\}; | |
| 216 | }); | |
| 217 | ||
| 218 | cases.add("macro expressions respect C operator precedence", | |
| 219 | \\int *foo = 0; | |
| 220 | \\#define FOO *((foo) + 2) | |
| 221 | \\#define VALUE (1 + 2 * 3 + 4 * 5 + 6 << 7 | 8 == 9) | |
| 222 | \\#define _AL_READ3BYTES(p) ((*(unsigned char *)(p)) \ | |
| 223 | \\ | (*((unsigned char *)(p) + 1) << 8) \ | |
| 224 | \\ | (*((unsigned char *)(p) + 2) << 16)) | |
| 225 | , &[_][]const u8{ | |
| 226 | \\pub inline fn FOO() @TypeOf((foo + @as(c_int, 2)).*) { | |
| 227 | \\ return (foo + @as(c_int, 2)).*; | |
| 228 | \\} | |
| 229 | , | |
| 230 | \\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)); | |
| 231 | , | |
| 232 | \\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))) { | |
| 233 | \\ _ = &p; | |
| 234 | \\ 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)); | |
| 235 | \\} | |
| 236 | }); | |
| 237 | ||
| 238 | cases.add("static variable in block scope", | |
| 239 | \\float bar; | |
| 240 | \\int foo() { | |
| 241 | \\ _Thread_local static int bar = 2; | |
| 242 | \\} | |
| 243 | , &[_][]const u8{ | |
| 244 | \\pub export var bar: f32 = @import("std").mem.zeroes(f32); | |
| 245 | \\pub export fn foo() c_int { | |
| 246 | \\ const bar_1 = struct { | |
| 247 | \\ threadlocal var static: c_int = 2; | |
| 248 | \\ }; | |
| 249 | \\ _ = &bar_1; | |
| 250 | \\ return 0; | |
| 251 | \\} | |
| 252 | }); | |
| 253 | ||
| 254 | cases.add("missing return stmt", | |
| 255 | \\int foo() {} | |
| 256 | \\int bar() { | |
| 257 | \\ int a = 2; | |
| 258 | \\} | |
| 259 | \\int baz() { | |
| 260 | \\ return 0; | |
| 261 | \\} | |
| 262 | , &[_][]const u8{ | |
| 263 | \\pub export fn foo() c_int { | |
| 264 | \\ return 0; | |
| 265 | \\} | |
| 266 | \\pub export fn bar() c_int { | |
| 267 | \\ var a: c_int = 2; | |
| 268 | \\ _ = &a; | |
| 269 | \\ return 0; | |
| 270 | \\} | |
| 271 | \\pub export fn baz() c_int { | |
| 272 | \\ return 0; | |
| 273 | \\} | |
| 274 | }); | |
| 275 | ||
| 276 | cases.add("alignof", | |
| 277 | \\void main() { | |
| 278 | \\ int a = _Alignof(int); | |
| 279 | \\} | |
| 280 | , &[_][]const u8{ | |
| 281 | \\pub export fn main() void { | |
| 282 | \\ var a: c_int = @as(c_int, @bitCast(@as(c_uint, @truncate(@alignOf(c_int))))); | |
| 283 | \\ _ = &a; | |
| 284 | \\} | |
| 285 | }); | |
| 286 | ||
| 287 | cases.add("initializer list macro", | |
| 288 | \\typedef struct Color { | |
| 289 | \\ unsigned char r; | |
| 290 | \\ unsigned char g; | |
| 291 | \\ unsigned char b; | |
| 292 | \\ unsigned char a; | |
| 293 | \\} Color; | |
| 294 | \\#define CLITERAL(type) (type) | |
| 295 | \\#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray | |
| 296 | \\typedef struct boom_t | |
| 297 | \\{ | |
| 298 | \\ int i1; | |
| 299 | \\} boom_t; | |
| 300 | \\#define FOO ((boom_t){1}) | |
| 301 | \\typedef struct { float x; } MyCStruct; | |
| 302 | \\#define A(_x) (MyCStruct) { .x = (_x) } | |
| 303 | \\#define B A(0.f) | |
| 304 | , &[_][]const u8{ | |
| 305 | \\pub const struct_Color = extern struct { | |
| 306 | \\ r: u8 = @import("std").mem.zeroes(u8), | |
| 307 | \\ g: u8 = @import("std").mem.zeroes(u8), | |
| 308 | \\ b: u8 = @import("std").mem.zeroes(u8), | |
| 309 | \\ a: u8 = @import("std").mem.zeroes(u8), | |
| 310 | \\}; | |
| 311 | \\pub const Color = struct_Color; | |
| 312 | , | |
| 313 | \\pub inline fn CLITERAL(@"type": anytype) @TypeOf(@"type") { | |
| 314 | \\ _ = &@"type"; | |
| 315 | \\ return @"type"; | |
| 316 | \\} | |
| 317 | , | |
| 318 | \\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) }); | |
| 319 | , | |
| 320 | \\pub const struct_boom_t = extern struct { | |
| 321 | \\ i1: c_int = @import("std").mem.zeroes(c_int), | |
| 322 | \\}; | |
| 323 | \\pub const boom_t = struct_boom_t; | |
| 324 | , | |
| 325 | \\pub const FOO = @import("std").mem.zeroInit(boom_t, .{@as(c_int, 1)}); | |
| 326 | , | |
| 327 | \\pub const MyCStruct = extern struct { | |
| 328 | \\ x: f32 = @import("std").mem.zeroes(f32), | |
| 329 | \\}; | |
| 330 | , | |
| 331 | \\pub inline fn A(_x: anytype) MyCStruct { | |
| 332 | \\ _ = &_x; | |
| 333 | \\ return @import("std").mem.zeroInit(MyCStruct, .{ | |
| 334 | \\ .x = _x, | |
| 335 | \\ }); | |
| 336 | \\} | |
| 337 | , | |
| 338 | \\pub const B = A(@as(f32, 0)); | |
| 339 | }); | |
| 340 | ||
| 341 | cases.add("complex switch", | |
| 342 | \\int main() { | |
| 343 | \\ int i = 2; | |
| 344 | \\ switch (i) { | |
| 345 | \\ case 0: { | |
| 346 | \\ case 2:{ | |
| 347 | \\ i += 2;} | |
| 348 | \\ i += 1; | |
| 349 | \\ } | |
| 350 | \\ } | |
| 351 | \\} | |
| 352 | , &[_][]const u8{ // TODO properly translate this | |
| 353 | \\source.h:5:13: warning: TODO complex switch | |
| 354 | , | |
| 355 | \\source.h:1:5: warning: unable to translate function, demoted to extern | |
| 356 | \\pub extern fn main() c_int; | |
| 357 | }); | |
| 358 | ||
| 359 | cases.add("correct semicolon after infixop", | |
| 360 | \\#define _IO_ERR_SEEN 0 | |
| 361 | \\#define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0) | |
| 362 | , &[_][]const u8{ | |
| 363 | \\pub inline fn __ferror_unlocked_body(_fp: anytype) @TypeOf((_fp.*._flags & _IO_ERR_SEEN) != @as(c_int, 0)) { | |
| 364 | \\ _ = &_fp; | |
| 365 | \\ return (_fp.*._flags & _IO_ERR_SEEN) != @as(c_int, 0); | |
| 366 | \\} | |
| 367 | }); | |
| 368 | ||
| 369 | cases.add("c booleans are just ints", | |
| 370 | \\#define FOO(x) ((x >= 0) + (x >= 0)) | |
| 371 | \\#define BAR 1 && 2 > 4 | |
| 372 | , &[_][]const u8{ | |
| 373 | \\pub inline fn FOO(x: anytype) @TypeOf(@intFromBool(x >= @as(c_int, 0)) + @intFromBool(x >= @as(c_int, 0))) { | |
| 374 | \\ _ = &x; | |
| 375 | \\ return @intFromBool(x >= @as(c_int, 0)) + @intFromBool(x >= @as(c_int, 0)); | |
| 376 | \\} | |
| 377 | , | |
| 378 | \\pub const BAR = (@as(c_int, 1) != 0) and (@as(c_int, 2) > @as(c_int, 4)); | |
| 379 | }); | |
| 380 | ||
| 381 | cases.add("struct with flexible array", | |
| 382 | \\struct foo { int x; int y[]; }; | |
| 383 | \\struct bar { int x; int y[0]; }; | |
| 384 | , &[_][]const u8{ | |
| 385 | \\pub const struct_foo = extern struct { | |
| 386 | \\ x: c_int align(4) = @import("std").mem.zeroes(c_int), | |
| 387 | \\ pub fn y(self: anytype) @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int) { | |
| 388 | \\ const Intermediate = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), u8); | |
| 389 | \\ const ReturnType = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int); | |
| 390 | \\ return @as(ReturnType, @ptrCast(@alignCast(@as(Intermediate, @ptrCast(self)) + 4))); | |
| 391 | \\ } | |
| 392 | \\}; | |
| 393 | \\pub const struct_bar = extern struct { | |
| 394 | \\ x: c_int align(4) = @import("std").mem.zeroes(c_int), | |
| 395 | \\ pub fn y(self: anytype) @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int) { | |
| 396 | \\ const Intermediate = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), u8); | |
| 397 | \\ const ReturnType = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int); | |
| 398 | \\ return @as(ReturnType, @ptrCast(@alignCast(@as(Intermediate, @ptrCast(self)) + 4))); | |
| 399 | \\ } | |
| 400 | \\}; | |
| 401 | }); | |
| 402 | ||
| 403 | cases.add("nested loops without blocks", | |
| 404 | \\void foo() { | |
| 405 | \\ while (0) while (0) {} | |
| 406 | \\ for (;;) while (0); | |
| 407 | \\ for (;;) do {} while (0); | |
| 408 | \\} | |
| 409 | , &[_][]const u8{ | |
| 410 | \\pub export fn foo() void { | |
| 411 | \\ while (false) while (false) {}; | |
| 412 | \\ while (true) while (false) {}; | |
| 413 | \\ while (true) while (true) { | |
| 414 | \\ if (!false) break; | |
| 415 | \\ }; | |
| 416 | \\} | |
| 417 | }); | |
| 418 | ||
| 419 | cases.add("macro comma operator", | |
| 420 | \\#define foo (foo, bar) | |
| 421 | \\int baz(int x, int y) { return 0; } | |
| 422 | \\#define bar(x) (&x, +3, 4 == 4, 5 * 6, baz(1, 2), 2 % 2, baz(1,2)) | |
| 423 | , &[_][]const u8{ | |
| 424 | \\pub const foo = blk_1: { | |
| 425 | \\ _ = &foo; | |
| 426 | \\ break :blk_1 bar; | |
| 427 | \\}; | |
| 428 | , | |
| 429 | \\pub inline fn bar(x: anytype) @TypeOf(baz(@as(c_int, 1), @as(c_int, 2))) { | |
| 430 | \\ _ = &x; | |
| 431 | \\ return blk_1: { | |
| 432 | \\ _ = &x; | |
| 433 | \\ _ = @as(c_int, 3); | |
| 434 | \\ _ = @as(c_int, 4) == @as(c_int, 4); | |
| 435 | \\ _ = @as(c_int, 5) * @as(c_int, 6); | |
| 436 | \\ _ = baz(@as(c_int, 1), @as(c_int, 2)); | |
| 437 | \\ _ = @import("std").zig.c_translation.MacroArithmetic.rem(@as(c_int, 2), @as(c_int, 2)); | |
| 438 | \\ break :blk_1 baz(@as(c_int, 1), @as(c_int, 2)); | |
| 439 | \\ }; | |
| 440 | \\} | |
| 441 | }); | |
| 442 | ||
| 443 | cases.add("macro keyword define", | |
| 444 | \\#define foo 1 | |
| 445 | \\#define inline 2 | |
| 446 | , &[_][]const u8{ | |
| 447 | \\pub const foo = @as(c_int, 1); | |
| 448 | , | |
| 449 | \\pub const @"inline" = @as(c_int, 2); | |
| 450 | }); | |
| 451 | ||
| 452 | cases.add("macro line continuation", | |
| 453 | \\int BAR = 0; | |
| 454 | \\#define FOO -\ | |
| 455 | \\BAR | |
| 456 | , &[_][]const u8{ | |
| 457 | \\pub inline fn FOO() @TypeOf(-BAR) { | |
| 458 | \\ return -BAR; | |
| 459 | \\} | |
| 460 | }); | |
| 461 | ||
| 462 | cases.add("struct with atomic field", | |
| 463 | \\struct arcan_shmif_cont { | |
| 464 | \\ struct arcan_shmif_page* addr; | |
| 465 | \\}; | |
| 466 | \\struct arcan_shmif_page { | |
| 467 | \\ volatile _Atomic int abufused[12]; | |
| 468 | \\}; | |
| 469 | , &[_][]const u8{ | |
| 470 | \\source.h:4:8: warning: struct demoted to opaque type - unable to translate type of field abufused | |
| 471 | \\pub const struct_arcan_shmif_page = opaque {}; | |
| 472 | \\pub const struct_arcan_shmif_cont = extern struct { | |
| 473 | \\ addr: ?*struct_arcan_shmif_page = @import("std").mem.zeroes(?*struct_arcan_shmif_page), | |
| 474 | \\}; | |
| 475 | }); | |
| 476 | ||
| 477 | cases.add("function prototype translated as optional", | |
| 478 | \\typedef void (*fnptr_ty)(void); | |
| 479 | \\typedef __attribute__((cdecl)) void (*fnptr_attr_ty)(void); | |
| 480 | \\struct foo { | |
| 481 | \\ __attribute__((cdecl)) void (*foo)(void); | |
| 482 | \\ void (*bar)(void); | |
| 483 | \\ fnptr_ty baz; | |
| 484 | \\ fnptr_attr_ty qux; | |
| 485 | \\}; | |
| 486 | , &[_][]const u8{ | |
| 487 | \\pub const fnptr_ty = ?*const fn () callconv(.c) void; | |
| 488 | \\pub const fnptr_attr_ty = ?*const fn () callconv(.c) void; | |
| 489 | \\pub const struct_foo = extern struct { | |
| 490 | \\ foo: ?*const fn () callconv(.c) void = @import("std").mem.zeroes(?*const fn () callconv(.c) void), | |
| 491 | \\ bar: ?*const fn () callconv(.c) void = @import("std").mem.zeroes(?*const fn () callconv(.c) void), | |
| 492 | \\ baz: fnptr_ty = @import("std").mem.zeroes(fnptr_ty), | |
| 493 | \\ qux: fnptr_attr_ty = @import("std").mem.zeroes(fnptr_attr_ty), | |
| 494 | \\}; | |
| 495 | }); | |
| 496 | ||
| 497 | cases.add("array initializer w/ typedef", | |
| 498 | \\typedef unsigned char uuid_t[16]; | |
| 499 | \\static const uuid_t UUID_NULL __attribute__ ((unused)) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | |
| 500 | , &[_][]const u8{ | |
| 501 | \\pub const uuid_t = [16]u8; | |
| 502 | \\pub const UUID_NULL: uuid_t = [16]u8{ | |
| 503 | \\ 0, | |
| 504 | \\ 0, | |
| 505 | \\ 0, | |
| 506 | \\ 0, | |
| 507 | \\ 0, | |
| 508 | \\ 0, | |
| 509 | \\ 0, | |
| 510 | \\ 0, | |
| 511 | \\ 0, | |
| 512 | \\ 0, | |
| 513 | \\ 0, | |
| 514 | \\ 0, | |
| 515 | \\ 0, | |
| 516 | \\ 0, | |
| 517 | \\ 0, | |
| 518 | \\ 0, | |
| 519 | \\}; | |
| 520 | }); | |
| 521 | ||
| 522 | cases.add("#define hex literal with capital X", | |
| 523 | \\#define VAL 0XF00D | |
| 524 | , &[_][]const u8{ | |
| 525 | \\pub const VAL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xF00D, .hex); | |
| 526 | }); | |
| 527 | ||
| 528 | cases.add("anonymous struct & unions", | |
| 529 | \\typedef struct { | |
| 530 | \\ union { | |
| 531 | \\ char x; | |
| 532 | \\ struct { int y; }; | |
| 533 | \\ }; | |
| 534 | \\} outer; | |
| 535 | \\void foo(outer *x) { x->y = x->x; } | |
| 536 | , &[_][]const u8{ | |
| 537 | \\const struct_unnamed_2 = extern struct { | |
| 538 | \\ y: c_int = @import("std").mem.zeroes(c_int), | |
| 539 | \\}; | |
| 540 | \\const union_unnamed_1 = extern union { | |
| 541 | \\ x: u8, | |
| 542 | \\ unnamed_0: struct_unnamed_2, | |
| 543 | \\}; | |
| 544 | \\pub const outer = extern struct { | |
| 545 | \\ unnamed_0: union_unnamed_1 = @import("std").mem.zeroes(union_unnamed_1), | |
| 546 | \\}; | |
| 547 | \\pub export fn foo(arg_x: [*c]outer) void { | |
| 548 | \\ var x = arg_x; | |
| 549 | \\ _ = &x; | |
| 550 | \\ x.*.unnamed_0.unnamed_0.y = @as(c_int, @bitCast(@as(c_uint, x.*.unnamed_0.x))); | |
| 551 | \\} | |
| 552 | }); | |
| 553 | ||
| 554 | cases.add("struct initializer - simple", | |
| 555 | \\typedef struct { int x; } foo; | |
| 556 | \\struct {double x,y,z;} s0 = {1.2, 1.3}; | |
| 557 | \\struct {int sec,min,hour,day,mon,year;} s1 = {.day=31,12,2014,.sec=30,15,17}; | |
| 558 | \\struct {int x,y;} s2 = {.y = 2, .x=1}; | |
| 559 | \\foo s3 = { 123 }; | |
| 560 | , &[_][]const u8{ | |
| 561 | \\pub const foo = extern struct { | |
| 562 | \\ x: c_int = @import("std").mem.zeroes(c_int), | |
| 563 | \\}; | |
| 564 | \\const struct_unnamed_1 = extern struct { | |
| 565 | \\ x: f64 = @import("std").mem.zeroes(f64), | |
| 566 | \\ y: f64 = @import("std").mem.zeroes(f64), | |
| 567 | \\ z: f64 = @import("std").mem.zeroes(f64), | |
| 568 | \\}; | |
| 569 | \\pub export var s0: struct_unnamed_1 = struct_unnamed_1{ | |
| 570 | \\ .x = 1.2, | |
| 571 | \\ .y = 1.3, | |
| 572 | \\ .z = 0, | |
| 573 | \\}; | |
| 574 | \\const struct_unnamed_2 = extern struct { | |
| 575 | \\ sec: c_int = @import("std").mem.zeroes(c_int), | |
| 576 | \\ min: c_int = @import("std").mem.zeroes(c_int), | |
| 577 | \\ hour: c_int = @import("std").mem.zeroes(c_int), | |
| 578 | \\ day: c_int = @import("std").mem.zeroes(c_int), | |
| 579 | \\ mon: c_int = @import("std").mem.zeroes(c_int), | |
| 580 | \\ year: c_int = @import("std").mem.zeroes(c_int), | |
| 581 | \\}; | |
| 582 | \\pub export var s1: struct_unnamed_2 = struct_unnamed_2{ | |
| 583 | \\ .sec = @as(c_int, 30), | |
| 584 | \\ .min = @as(c_int, 15), | |
| 585 | \\ .hour = @as(c_int, 17), | |
| 586 | \\ .day = @as(c_int, 31), | |
| 587 | \\ .mon = @as(c_int, 12), | |
| 588 | \\ .year = @as(c_int, 2014), | |
| 589 | \\}; | |
| 590 | \\const struct_unnamed_3 = extern struct { | |
| 591 | \\ x: c_int = @import("std").mem.zeroes(c_int), | |
| 592 | \\ y: c_int = @import("std").mem.zeroes(c_int), | |
| 593 | \\}; | |
| 594 | \\pub export var s2: struct_unnamed_3 = struct_unnamed_3{ | |
| 595 | \\ .x = @as(c_int, 1), | |
| 596 | \\ .y = @as(c_int, 2), | |
| 597 | \\}; | |
| 598 | \\pub export var s3: foo = foo{ | |
| 599 | \\ .x = @as(c_int, 123), | |
| 600 | \\}; | |
| 601 | }); | |
| 602 | ||
| 603 | cases.add("simple ptrCast for casts between opaque types", | |
| 604 | \\struct opaque; | |
| 605 | \\struct opaque_2; | |
| 606 | \\void function(struct opaque *opaque) { | |
| 607 | \\ struct opaque_2 *cast = (struct opaque_2 *)opaque; | |
| 608 | \\} | |
| 609 | , &[_][]const u8{ | |
| 610 | \\pub const struct_opaque = opaque {}; | |
| 611 | \\pub const struct_opaque_2 = opaque {}; | |
| 612 | \\pub export fn function(arg_opaque_1: ?*struct_opaque) void { | |
| 613 | \\ var opaque_1 = arg_opaque_1; | |
| 614 | \\ _ = &opaque_1; | |
| 615 | \\ var cast: ?*struct_opaque_2 = @as(?*struct_opaque_2, @ptrCast(opaque_1)); | |
| 616 | \\ _ = &cast; | |
| 617 | \\} | |
| 618 | }); | |
| 619 | ||
| 620 | cases.add("struct initializer - packed", | |
| 621 | \\struct {int x,y,z;} __attribute__((packed)) s0 = {1, 2}; | |
| 622 | , &[_][]const u8{ | |
| 623 | \\const struct_unnamed_1 = extern struct { | |
| 624 | \\ x: c_int align(1) = @import("std").mem.zeroes(c_int), | |
| 625 | \\ y: c_int align(1) = @import("std").mem.zeroes(c_int), | |
| 626 | \\ z: c_int align(1) = @import("std").mem.zeroes(c_int), | |
| 627 | \\}; | |
| 628 | \\pub export var s0: struct_unnamed_1 = struct_unnamed_1{ | |
| 629 | \\ .x = @as(c_int, 1), | |
| 630 | \\ .y = @as(c_int, 2), | |
| 631 | \\ .z = 0, | |
| 632 | \\}; | |
| 633 | }); | |
| 634 | ||
| 635 | cases.add("linksection() attribute", | |
| 636 | \\// Use the "segment,section" format to make this test pass when | |
| 637 | \\// targeting the mach-o binary format | |
| 638 | \\__attribute__ ((__section__("NEAR,.data"))) | |
| 639 | \\extern char my_array[16]; | |
| 640 | \\__attribute__ ((__section__("NEAR,.data"))) | |
| 641 | \\void my_fn(void) { } | |
| 642 | , &[_][]const u8{ | |
| 643 | \\pub extern var my_array: [16]u8 linksection("NEAR,.data"); | |
| 644 | \\pub export fn my_fn() linksection("NEAR,.data") void {} | |
| 645 | }); | |
| 646 | ||
| 647 | cases.add("simple var decls", | |
| 648 | \\void foo(void) { | |
| 649 | \\ int a; | |
| 650 | \\ char b = 123; | |
| 651 | \\ const int c; | |
| 652 | \\ const unsigned d = 440; | |
| 653 | \\ int e = 10; | |
| 654 | \\ unsigned int f = 10u; | |
| 655 | \\} | |
| 656 | , &[_][]const u8{ | |
| 657 | \\pub export fn foo() void { | |
| 658 | \\ var a: c_int = undefined; | |
| 659 | \\ _ = &a; | |
| 660 | \\ var b: u8 = 123; | |
| 661 | \\ _ = &b; | |
| 662 | \\ const c: c_int = undefined; | |
| 663 | \\ _ = &c; | |
| 664 | \\ const d: c_uint = @as(c_uint, @bitCast(@as(c_int, 440))); | |
| 665 | \\ _ = &d; | |
| 666 | \\ var e: c_int = 10; | |
| 667 | \\ _ = &e; | |
| 668 | \\ var f: c_uint = 10; | |
| 669 | \\ _ = &f; | |
| 670 | \\} | |
| 671 | }); | |
| 672 | ||
| 673 | cases.add("ignore result, explicit function arguments", | |
| 674 | \\void foo(void) { | |
| 675 | \\ int a; | |
| 676 | \\ 1; | |
| 677 | \\ "hey"; | |
| 678 | \\ 1 + 1; | |
| 679 | \\ 1 - 1; | |
| 680 | \\ a = 1; | |
| 681 | \\} | |
| 682 | , &[_][]const u8{ | |
| 683 | \\pub export fn foo() void { | |
| 684 | \\ var a: c_int = undefined; | |
| 685 | \\ _ = &a; | |
| 686 | \\ _ = @as(c_int, 1); | |
| 687 | \\ _ = "hey"; | |
| 688 | \\ _ = @as(c_int, 1) + @as(c_int, 1); | |
| 689 | \\ _ = @as(c_int, 1) - @as(c_int, 1); | |
| 690 | \\ a = 1; | |
| 691 | \\} | |
| 692 | }); | |
| 693 | ||
| 694 | cases.add("function with no prototype", | |
| 695 | \\int foo() { | |
| 696 | \\ return 5; | |
| 697 | \\} | |
| 698 | , &[_][]const u8{ | |
| 699 | \\pub export fn foo() c_int { | |
| 700 | \\ return 5; | |
| 701 | \\} | |
| 702 | }); | |
| 703 | ||
| 704 | cases.add("variables", | |
| 705 | \\extern int extern_var; | |
| 706 | \\static const int int_var = 13; | |
| 707 | \\int foo; | |
| 708 | , &[_][]const u8{ | |
| 709 | \\pub extern var extern_var: c_int; | |
| 710 | \\pub const int_var: c_int = 13; | |
| 711 | \\pub export var foo: c_int = @import("std").mem.zeroes(c_int); | |
| 712 | }); | |
| 713 | ||
| 714 | cases.add("const ptr initializer", | |
| 715 | \\static const char *v0 = "0.0.0"; | |
| 716 | , &[_][]const u8{ | |
| 717 | \\pub var v0: [*c]const u8 = "0.0.0"; | |
| 718 | }); | |
| 719 | ||
| 720 | cases.add("static incomplete array inside function", | |
| 721 | \\void foo(void) { | |
| 722 | \\ static const char v2[] = "2.2.2"; | |
| 723 | \\} | |
| 724 | , &[_][]const u8{ | |
| 725 | \\pub export fn foo() void { | |
| 726 | \\ const v2 = struct { | |
| 727 | \\ const static: [5:0]u8 = "2.2.2".*; | |
| 728 | \\ }; | |
| 729 | \\ _ = &v2; | |
| 730 | \\} | |
| 731 | }); | |
| 732 | ||
| 733 | cases.add("simple function definition", | |
| 734 | \\void foo(void) {} | |
| 735 | \\static void bar(void) {} | |
| 736 | , &[_][]const u8{ | |
| 737 | \\pub export fn foo() void {} | |
| 738 | \\pub fn bar() callconv(.c) void {} | |
| 739 | }); | |
| 740 | ||
| 741 | cases.add("typedef void", | |
| 742 | \\typedef void Foo; | |
| 743 | \\Foo fun(Foo *a); | |
| 744 | , &[_][]const u8{ | |
| 745 | \\pub const Foo = anyopaque; | |
| 746 | , | |
| 747 | \\pub extern fn fun(a: ?*Foo) void; | |
| 748 | }); | |
| 749 | ||
| 750 | cases.add("duplicate typedef", | |
| 751 | \\typedef long foo; | |
| 752 | \\typedef int bar; | |
| 753 | \\typedef long foo; | |
| 754 | \\typedef int baz; | |
| 755 | , &[_][]const u8{ | |
| 756 | \\pub const foo = c_long; | |
| 757 | \\pub const bar = c_int; | |
| 758 | \\pub const baz = c_int; | |
| 759 | }); | |
| 760 | ||
| 761 | cases.add("casting pointers to ints and ints to pointers", | |
| 762 | \\void foo(void); | |
| 763 | \\void bar(void) { | |
| 764 | \\ void *func_ptr = foo; | |
| 765 | \\ void (*typed_func_ptr)(void) = (void (*)(void)) (unsigned long) func_ptr; | |
| 766 | \\} | |
| 767 | , &[_][]const u8{ | |
| 768 | \\pub extern fn foo() void; | |
| 769 | \\pub export fn bar() void { | |
| 770 | \\ var func_ptr: ?*anyopaque = @as(?*anyopaque, @ptrCast(&foo)); | |
| 771 | \\ _ = &func_ptr; | |
| 772 | \\ var typed_func_ptr: ?*const fn () callconv(.c) void = @as(?*const fn () callconv(.c) void, @ptrFromInt(@as(c_ulong, @intCast(@intFromPtr(func_ptr))))); | |
| 773 | \\ _ = &typed_func_ptr; | |
| 774 | \\} | |
| 775 | }); | |
| 776 | ||
| 777 | cases.add("always_inline attribute", | |
| 778 | \\__attribute__((always_inline)) int foo() { | |
| 779 | \\ return 5; | |
| 780 | \\} | |
| 781 | , &[_][]const u8{ | |
| 782 | \\pub inline fn foo() c_int { | |
| 783 | \\ return 5; | |
| 784 | \\} | |
| 785 | }); | |
| 786 | ||
| 787 | cases.add("add, sub, mul, div, rem", | |
| 788 | \\int s() { | |
| 789 | \\ int a, b, c; | |
| 790 | \\ c = a + b; | |
| 791 | \\ c = a - b; | |
| 792 | \\ c = a * b; | |
| 793 | \\ c = a / b; | |
| 794 | \\ c = a % b; | |
| 795 | \\} | |
| 796 | \\unsigned u() { | |
| 797 | \\ unsigned a, b, c; | |
| 798 | \\ c = a + b; | |
| 799 | \\ c = a - b; | |
| 800 | \\ c = a * b; | |
| 801 | \\ c = a / b; | |
| 802 | \\ c = a % b; | |
| 803 | \\} | |
| 804 | , &[_][]const u8{ | |
| 805 | \\pub export fn s() c_int { | |
| 806 | \\ var a: c_int = undefined; | |
| 807 | \\ _ = &a; | |
| 808 | \\ var b: c_int = undefined; | |
| 809 | \\ _ = &b; | |
| 810 | \\ var c: c_int = undefined; | |
| 811 | \\ _ = &c; | |
| 812 | \\ c = a + b; | |
| 813 | \\ c = a - b; | |
| 814 | \\ c = a * b; | |
| 815 | \\ c = @divTrunc(a, b); | |
| 816 | \\ c = @import("std").zig.c_translation.signedRemainder(a, b); | |
| 817 | \\ return 0; | |
| 818 | \\} | |
| 819 | \\pub export fn u() c_uint { | |
| 820 | \\ var a: c_uint = undefined; | |
| 821 | \\ _ = &a; | |
| 822 | \\ var b: c_uint = undefined; | |
| 823 | \\ _ = &b; | |
| 824 | \\ var c: c_uint = undefined; | |
| 825 | \\ _ = &c; | |
| 826 | \\ c = a +% b; | |
| 827 | \\ c = a -% b; | |
| 828 | \\ c = a *% b; | |
| 829 | \\ c = a / b; | |
| 830 | \\ c = a % b; | |
| 831 | \\ return 0; | |
| 832 | \\} | |
| 833 | }); | |
| 834 | ||
| 835 | cases.add("typedef of function in struct field", | |
| 836 | \\typedef void lws_callback_function(void); | |
| 837 | \\struct Foo { | |
| 838 | \\ void (*func)(void); | |
| 839 | \\ lws_callback_function *callback_http; | |
| 840 | \\}; | |
| 841 | , &[_][]const u8{ | |
| 842 | \\pub const lws_callback_function = fn () callconv(.c) void; | |
| 843 | \\pub const struct_Foo = extern struct { | |
| 844 | \\ func: ?*const fn () callconv(.c) void = @import("std").mem.zeroes(?*const fn () callconv(.c) void), | |
| 845 | \\ callback_http: ?*const lws_callback_function = @import("std").mem.zeroes(?*const lws_callback_function), | |
| 846 | \\}; | |
| 847 | }); | |
| 848 | ||
| 849 | cases.add("macro with left shift", | |
| 850 | \\#define REDISMODULE_READ (1<<0) | |
| 851 | , &[_][]const u8{ | |
| 852 | \\pub const REDISMODULE_READ = @as(c_int, 1) << @as(c_int, 0); | |
| 853 | }); | |
| 854 | ||
| 855 | cases.add("macro with right shift", | |
| 856 | \\#define FLASH_SIZE 0x200000UL /* 2 MB */ | |
| 857 | \\#define FLASH_BANK_SIZE (FLASH_SIZE >> 1) /* 1 MB */ | |
| 858 | , &[_][]const u8{ | |
| 859 | \\pub const FLASH_SIZE = @as(c_ulong, 0x200000); | |
| 860 | , | |
| 861 | \\pub const FLASH_BANK_SIZE = FLASH_SIZE >> @as(c_int, 1); | |
| 862 | }); | |
| 863 | ||
| 864 | cases.add("self referential struct with function pointer", | |
| 865 | \\struct Foo { | |
| 866 | \\ void (*derp)(struct Foo *foo); | |
| 867 | \\}; | |
| 868 | , &[_][]const u8{ | |
| 869 | \\pub const struct_Foo = extern struct { | |
| 870 | \\ derp: ?*const fn ([*c]struct_Foo) callconv(.c) void = @import("std").mem.zeroes(?*const fn ([*c]struct_Foo) callconv(.c) void), | |
| 871 | \\}; | |
| 872 | , | |
| 873 | \\pub const Foo = struct_Foo; | |
| 874 | }); | |
| 875 | ||
| 876 | cases.add("#define an unsigned integer literal", | |
| 877 | \\#define CHANNEL_COUNT 24 | |
| 878 | , &[_][]const u8{ | |
| 879 | \\pub const CHANNEL_COUNT = @as(c_int, 24); | |
| 880 | }); | |
| 881 | ||
| 882 | cases.add("#define referencing another #define", | |
| 883 | \\#define THING2 THING1 | |
| 884 | \\#define THING1 1234 | |
| 885 | , &[_][]const u8{ | |
| 886 | \\pub const THING1 = @as(c_int, 1234); | |
| 887 | , | |
| 888 | \\pub const THING2 = THING1; | |
| 889 | }); | |
| 890 | ||
| 891 | cases.add("#define string", | |
| 892 | \\#define foo "a string" | |
| 893 | , &[_][]const u8{ | |
| 894 | \\pub const foo = "a string"; | |
| 895 | }); | |
| 896 | ||
| 897 | cases.add("macro with parens around negative number", | |
| 898 | \\#define LUA_GLOBALSINDEX (-10002) | |
| 899 | , &[_][]const u8{ | |
| 900 | \\pub const LUA_GLOBALSINDEX = -@as(c_int, 10002); | |
| 901 | }); | |
| 902 | ||
| 903 | cases.add( | |
| 904 | "u integer suffix after 0 (zero) in macro definition", | |
| 905 | "#define ZERO 0U", | |
| 906 | &[_][]const u8{ | |
| 907 | "pub const ZERO = @as(c_uint, 0);", | |
| 908 | }, | |
| 909 | ); | |
| 910 | ||
| 911 | cases.add( | |
| 912 | "l integer suffix after 0 (zero) in macro definition", | |
| 913 | "#define ZERO 0L", | |
| 914 | &[_][]const u8{ | |
| 915 | "pub const ZERO = @as(c_long, 0);", | |
| 916 | }, | |
| 917 | ); | |
| 918 | ||
| 919 | cases.add( | |
| 920 | "ul integer suffix after 0 (zero) in macro definition", | |
| 921 | "#define ZERO 0UL", | |
| 922 | &[_][]const u8{ | |
| 923 | "pub const ZERO = @as(c_ulong, 0);", | |
| 924 | }, | |
| 925 | ); | |
| 926 | ||
| 927 | cases.add( | |
| 928 | "lu integer suffix after 0 (zero) in macro definition", | |
| 929 | "#define ZERO 0LU", | |
| 930 | &[_][]const u8{ | |
| 931 | "pub const ZERO = @as(c_ulong, 0);", | |
| 932 | }, | |
| 933 | ); | |
| 934 | ||
| 935 | cases.add( | |
| 936 | "ll integer suffix after 0 (zero) in macro definition", | |
| 937 | "#define ZERO 0LL", | |
| 938 | &[_][]const u8{ | |
| 939 | "pub const ZERO = @as(c_longlong, 0);", | |
| 940 | }, | |
| 941 | ); | |
| 942 | ||
| 943 | cases.add( | |
| 944 | "ull integer suffix after 0 (zero) in macro definition", | |
| 945 | "#define ZERO 0ULL", | |
| 946 | &[_][]const u8{ | |
| 947 | "pub const ZERO = @as(c_ulonglong, 0);", | |
| 948 | }, | |
| 949 | ); | |
| 950 | ||
| 951 | cases.add( | |
| 952 | "llu integer suffix after 0 (zero) in macro definition", | |
| 953 | "#define ZERO 0LLU", | |
| 954 | &[_][]const u8{ | |
| 955 | "pub const ZERO = @as(c_ulonglong, 0);", | |
| 956 | }, | |
| 957 | ); | |
| 958 | ||
| 959 | cases.add( | |
| 960 | "bitwise not on u-suffixed 0 (zero) in macro definition", | |
| 961 | "#define NOT_ZERO (~0U)", | |
| 962 | &[_][]const u8{ | |
| 963 | "pub const NOT_ZERO = ~@as(c_uint, 0);", | |
| 964 | }, | |
| 965 | ); | |
| 966 | ||
| 967 | cases.add("float suffixes", | |
| 968 | \\#define foo 3.14f | |
| 969 | \\#define bar 16.e-2l | |
| 970 | \\#define FOO 0.12345 | |
| 971 | \\#define BAR .12345 | |
| 972 | \\#define baz 1e1 | |
| 973 | \\#define BAZ 42e-3f | |
| 974 | \\#define foobar -73.L | |
| 975 | \\extern const float my_float = 1.0f; | |
| 976 | \\extern const double my_double = 1.0; | |
| 977 | \\extern const long double my_longdouble = 1.0l; | |
| 978 | \\extern const long double my_extended_precision_longdouble = 1.0000000000000003l; | |
| 979 | , &([_][]const u8{ | |
| 980 | "pub const foo = @as(f32, 3.14);", | |
| 981 | "pub const bar = @as(c_longdouble, 16.e-2);", | |
| 982 | "pub const FOO = @as(f64, 0.12345);", | |
| 983 | "pub const BAR = @as(f64, 0.12345);", | |
| 984 | "pub const baz = @as(f64, 1e1);", | |
| 985 | "pub const BAZ = @as(f32, 42e-3);", | |
| 986 | "pub const foobar = -@as(c_longdouble, 73);", | |
| 987 | "pub export const my_float: f32 = 1.0;", | |
| 988 | "pub export const my_double: f64 = 1.0;", | |
| 989 | "pub export const my_longdouble: c_longdouble = 1.0;", | |
| 990 | switch (@bitSizeOf(c_longdouble)) { | |
| 991 | // TODO implement decimal format for f128 <https://github.com/ziglang/zig/issues/1181> | |
| 992 | // (so that f80/f128 values not exactly representable as f64 can be emitted in decimal form) | |
| 993 | 80 => "pub export const my_extended_precision_longdouble: c_longdouble = 0x1.000000000000159ep0;", | |
| 994 | 128 => "pub export const my_extended_precision_longdouble: c_longdouble = 0x1.000000000000159e05f1e2674d21p0;", | |
| 995 | else => "pub export const my_extended_precision_longdouble: c_longdouble = 1.0000000000000002;", | |
| 996 | }, | |
| 997 | })); | |
| 998 | ||
| 999 | cases.add("macro defines hexadecimal float", | |
| 1000 | \\#define FOO 0xf7p38 | |
| 1001 | \\#define BAR -0X8F.BP5F | |
| 1002 | \\#define FOOBAR 0X0P+0 | |
| 1003 | \\#define BAZ -0x.0a5dp+12 | |
| 1004 | \\#define FOOBAZ 0xfE.P-1l | |
| 1005 | , &[_][]const u8{ | |
| 1006 | "pub const FOO = @as(f64, 0xf7p38);", | |
| 1007 | "pub const BAR = -@as(f32, 0x8F.BP5);", | |
| 1008 | "pub const FOOBAR = @as(f64, 0x0P+0);", | |
| 1009 | "pub const BAZ = -@as(f64, 0x0.0a5dp+12);", | |
| 1010 | "pub const FOOBAZ = @as(c_longdouble, 0xfE.P-1);", | |
| 1011 | }); | |
| 1012 | ||
| 1013 | cases.add("comments", | |
| 1014 | \\#define foo 1 //foo | |
| 1015 | \\#define bar /* bar */ 2 | |
| 1016 | , &[_][]const u8{ | |
| 1017 | "pub const foo = @as(c_int, 1);", | |
| 1018 | "pub const bar = @as(c_int, 2);", | |
| 1019 | }); | |
| 1020 | ||
| 1021 | cases.add("string prefix", | |
| 1022 | \\#define foo L"hello" | |
| 1023 | , &[_][]const u8{ | |
| 1024 | "pub const foo = \"hello\";", | |
| 1025 | }); | |
| 1026 | ||
| 1027 | cases.add("null statements", | |
| 1028 | \\void foo(void) { | |
| 1029 | \\ ;;;;; | |
| 1030 | \\} | |
| 1031 | , &[_][]const u8{ | |
| 1032 | \\pub export fn foo() void {} | |
| 1033 | }); | |
| 1034 | ||
| 1035 | if (builtin.os.tag != .windows) { | |
| 1036 | // Windows treats this as an enum with type c_int | |
| 1037 | cases.add("big negative enum init values when C ABI supports long long enums", | |
| 1038 | \\enum EnumWithInits { | |
| 1039 | \\ VAL01 = 0, | |
| 1040 | \\ VAL02 = 1, | |
| 1041 | \\ VAL03 = 2, | |
| 1042 | \\ VAL04 = 3, | |
| 1043 | \\ VAL05 = -1, | |
| 1044 | \\ VAL06 = -2, | |
| 1045 | \\ VAL07 = -3, | |
| 1046 | \\ VAL08 = -4, | |
| 1047 | \\ VAL09 = VAL02 + VAL08, | |
| 1048 | \\ VAL10 = -1000012000, | |
| 1049 | \\ VAL11 = -1000161000, | |
| 1050 | \\ VAL12 = -1000174001, | |
| 1051 | \\ VAL13 = VAL09, | |
| 1052 | \\ VAL14 = VAL10, | |
| 1053 | \\ VAL15 = VAL11, | |
| 1054 | \\ VAL16 = VAL13, | |
| 1055 | \\ VAL17 = (VAL16 - VAL10 + 1), | |
| 1056 | \\ VAL18 = 0x1000000000000000L, | |
| 1057 | \\ VAL19 = VAL18 + VAL18 + VAL18 - 1, | |
| 1058 | \\ VAL20 = VAL19 + VAL19, | |
| 1059 | \\ VAL21 = VAL20 + 0xFFFFFFFFFFFFFFFF, | |
| 1060 | \\ VAL22 = 0xFFFFFFFFFFFFFFFF + 1, | |
| 1061 | \\ VAL23 = 0xFFFFFFFFFFFFFFFF, | |
| 1062 | \\}; | |
| 1063 | , &[_][]const u8{ | |
| 1064 | \\pub const VAL01: c_longlong = 0; | |
| 1065 | \\pub const VAL02: c_longlong = 1; | |
| 1066 | \\pub const VAL03: c_longlong = 2; | |
| 1067 | \\pub const VAL04: c_longlong = 3; | |
| 1068 | \\pub const VAL05: c_longlong = -1; | |
| 1069 | \\pub const VAL06: c_longlong = -2; | |
| 1070 | \\pub const VAL07: c_longlong = -3; | |
| 1071 | \\pub const VAL08: c_longlong = -4; | |
| 1072 | \\pub const VAL09: c_longlong = -3; | |
| 1073 | \\pub const VAL10: c_longlong = -1000012000; | |
| 1074 | \\pub const VAL11: c_longlong = -1000161000; | |
| 1075 | \\pub const VAL12: c_longlong = -1000174001; | |
| 1076 | \\pub const VAL13: c_longlong = -3; | |
| 1077 | \\pub const VAL14: c_longlong = -1000012000; | |
| 1078 | \\pub const VAL15: c_longlong = -1000161000; | |
| 1079 | \\pub const VAL16: c_longlong = -3; | |
| 1080 | \\pub const VAL17: c_longlong = 1000011998; | |
| 1081 | \\pub const VAL18: c_longlong = 1152921504606846976; | |
| 1082 | \\pub const VAL19: c_longlong = 3458764513820540927; | |
| 1083 | \\pub const VAL20: c_longlong = 6917529027641081854; | |
| 1084 | \\pub const VAL21: c_longlong = 6917529027641081853; | |
| 1085 | \\pub const VAL22: c_longlong = 0; | |
| 1086 | \\pub const VAL23: c_longlong = -1; | |
| 1087 | \\pub const enum_EnumWithInits = c_longlong; | |
| 1088 | }); | |
| 1089 | } | |
| 1090 | ||
| 1091 | cases.add("predefined expressions", | |
| 1092 | \\void foo(void) { | |
| 1093 | \\ __func__; | |
| 1094 | \\ __FUNCTION__; | |
| 1095 | \\ __PRETTY_FUNCTION__; | |
| 1096 | \\} | |
| 1097 | , &[_][]const u8{ | |
| 1098 | \\pub export fn foo() void { | |
| 1099 | \\ _ = "foo"; | |
| 1100 | \\ _ = "foo"; | |
| 1101 | \\ _ = "void foo(void)"; | |
| 1102 | \\} | |
| 1103 | }); | |
| 1104 | ||
| 1105 | cases.add("constant size array", | |
| 1106 | \\void func(int array[20]); | |
| 1107 | , &[_][]const u8{ | |
| 1108 | \\pub extern fn func(array: [*c]c_int) void; | |
| 1109 | }); | |
| 1110 | ||
| 1111 | cases.add("__cdecl doesn't mess up function pointers", | |
| 1112 | \\void foo(void (__cdecl *fn_ptr)(void)); | |
| 1113 | , &[_][]const u8{ | |
| 1114 | \\pub extern fn foo(fn_ptr: ?*const fn () callconv(.c) void) void; | |
| 1115 | }); | |
| 1116 | ||
| 1117 | cases.add("void cast", | |
| 1118 | \\void foo() { | |
| 1119 | \\ int a; | |
| 1120 | \\ (void) a; | |
| 1121 | \\} | |
| 1122 | , &[_][]const u8{ | |
| 1123 | \\pub export fn foo() void { | |
| 1124 | \\ var a: c_int = undefined; | |
| 1125 | \\ _ = &a; | |
| 1126 | \\ _ = &a; | |
| 1127 | \\} | |
| 1128 | }); | |
| 1129 | ||
| 1130 | cases.add("implicit cast to void *", | |
| 1131 | \\void *foo() { | |
| 1132 | \\ unsigned short *x; | |
| 1133 | \\ return x; | |
| 1134 | \\} | |
| 1135 | , &[_][]const u8{ | |
| 1136 | \\pub export fn foo() ?*anyopaque { | |
| 1137 | \\ var x: [*c]c_ushort = undefined; | |
| 1138 | \\ _ = &x; | |
| 1139 | \\ return @as(?*anyopaque, @ptrCast(x)); | |
| 1140 | \\} | |
| 1141 | }); | |
| 1142 | ||
| 1143 | cases.add("null pointer implicit cast", | |
| 1144 | \\int* foo(void) { | |
| 1145 | \\ return 0; | |
| 1146 | \\} | |
| 1147 | , &[_][]const u8{ | |
| 1148 | \\pub export fn foo() [*c]c_int { | |
| 1149 | \\ return null; | |
| 1150 | \\} | |
| 1151 | }); | |
| 1152 | ||
| 1153 | cases.add("string literal", | |
| 1154 | \\const char *foo(void) { | |
| 1155 | \\ return "bar"; | |
| 1156 | \\} | |
| 1157 | , &[_][]const u8{ | |
| 1158 | \\pub export fn foo() [*c]const u8 { | |
| 1159 | \\ return "bar"; | |
| 1160 | \\} | |
| 1161 | }); | |
| 1162 | ||
| 1163 | cases.add("return void", | |
| 1164 | \\void foo(void) { | |
| 1165 | \\ return; | |
| 1166 | \\} | |
| 1167 | , &[_][]const u8{ | |
| 1168 | \\pub export fn foo() void { | |
| 1169 | \\ return; | |
| 1170 | \\} | |
| 1171 | }); | |
| 1172 | ||
| 1173 | cases.add("for loop", | |
| 1174 | \\void foo(void) { | |
| 1175 | \\ for (int i = 0; i; i++) { } | |
| 1176 | \\} | |
| 1177 | , &[_][]const u8{ | |
| 1178 | \\pub export fn foo() void { | |
| 1179 | \\ { | |
| 1180 | \\ var i: c_int = 0; | |
| 1181 | \\ _ = &i; | |
| 1182 | \\ while (i != 0) : (i += 1) {} | |
| 1183 | \\ } | |
| 1184 | \\} | |
| 1185 | }); | |
| 1186 | ||
| 1187 | cases.add("empty for loop", | |
| 1188 | \\void foo(void) { | |
| 1189 | \\ for (;;) { } | |
| 1190 | \\} | |
| 1191 | , &[_][]const u8{ | |
| 1192 | \\pub export fn foo() void { | |
| 1193 | \\ while (true) {} | |
| 1194 | \\} | |
| 1195 | }); | |
| 1196 | ||
| 1197 | cases.add("for loop with simple init expression", | |
| 1198 | \\void foo(void) { | |
| 1199 | \\ int i; | |
| 1200 | \\ for (i = 3; i; i--) { } | |
| 1201 | \\} | |
| 1202 | , &[_][]const u8{ | |
| 1203 | \\pub export fn foo() void { | |
| 1204 | \\ var i: c_int = undefined; | |
| 1205 | \\ _ = &i; | |
| 1206 | \\ { | |
| 1207 | \\ i = 3; | |
| 1208 | \\ while (i != 0) : (i -= 1) {} | |
| 1209 | \\ } | |
| 1210 | \\} | |
| 1211 | }); | |
| 1212 | ||
| 1213 | cases.add("break statement", | |
| 1214 | \\void foo(void) { | |
| 1215 | \\ for (;;) { | |
| 1216 | \\ break; | |
| 1217 | \\ } | |
| 1218 | \\} | |
| 1219 | , &[_][]const u8{ | |
| 1220 | \\pub export fn foo() void { | |
| 1221 | \\ while (true) { | |
| 1222 | \\ break; | |
| 1223 | \\ } | |
| 1224 | \\} | |
| 1225 | }); | |
| 1226 | ||
| 1227 | cases.add("continue statement", | |
| 1228 | \\void foo(void) { | |
| 1229 | \\ for (;;) { | |
| 1230 | \\ continue; | |
| 1231 | \\ } | |
| 1232 | \\} | |
| 1233 | , &[_][]const u8{ | |
| 1234 | \\pub export fn foo() void { | |
| 1235 | \\ while (true) { | |
| 1236 | \\ continue; | |
| 1237 | \\ } | |
| 1238 | \\} | |
| 1239 | }); | |
| 1240 | ||
| 1241 | cases.add("pointer casting", | |
| 1242 | \\float *ptrcast() { | |
| 1243 | \\ int *a; | |
| 1244 | \\ return (float *)a; | |
| 1245 | \\} | |
| 1246 | , &[_][]const u8{ | |
| 1247 | \\pub export fn ptrcast() [*c]f32 { | |
| 1248 | \\ var a: [*c]c_int = undefined; | |
| 1249 | \\ _ = &a; | |
| 1250 | \\ return @as([*c]f32, @ptrCast(@alignCast(a))); | |
| 1251 | \\} | |
| 1252 | }); | |
| 1253 | ||
| 1254 | cases.add("casting pointer to pointer", | |
| 1255 | \\float **ptrptrcast() { | |
| 1256 | \\ int **a; | |
| 1257 | \\ return (float **)a; | |
| 1258 | \\} | |
| 1259 | , &[_][]const u8{ | |
| 1260 | \\pub export fn ptrptrcast() [*c][*c]f32 { | |
| 1261 | \\ var a: [*c][*c]c_int = undefined; | |
| 1262 | \\ _ = &a; | |
| 1263 | \\ return @as([*c][*c]f32, @ptrCast(@alignCast(a))); | |
| 1264 | \\} | |
| 1265 | }); | |
| 1266 | ||
| 1267 | cases.add("pointer conversion with different alignment", | |
| 1268 | \\void test_ptr_cast() { | |
| 1269 | \\ void *p; | |
| 1270 | \\ { | |
| 1271 | \\ char *to_char = (char *)p; | |
| 1272 | \\ short *to_short = (short *)p; | |
| 1273 | \\ int *to_int = (int *)p; | |
| 1274 | \\ long long *to_longlong = (long long *)p; | |
| 1275 | \\ } | |
| 1276 | \\ { | |
| 1277 | \\ char *to_char = p; | |
| 1278 | \\ short *to_short = p; | |
| 1279 | \\ int *to_int = p; | |
| 1280 | \\ long long *to_longlong = p; | |
| 1281 | \\ } | |
| 1282 | \\} | |
| 1283 | , &[_][]const u8{ | |
| 1284 | \\pub export fn test_ptr_cast() void { | |
| 1285 | \\ var p: ?*anyopaque = undefined; | |
| 1286 | \\ _ = &p; | |
| 1287 | \\ { | |
| 1288 | \\ var to_char: [*c]u8 = @as([*c]u8, @ptrCast(@alignCast(p))); | |
| 1289 | \\ _ = &to_char; | |
| 1290 | \\ var to_short: [*c]c_short = @as([*c]c_short, @ptrCast(@alignCast(p))); | |
| 1291 | \\ _ = &to_short; | |
| 1292 | \\ var to_int: [*c]c_int = @as([*c]c_int, @ptrCast(@alignCast(p))); | |
| 1293 | \\ _ = &to_int; | |
| 1294 | \\ var to_longlong: [*c]c_longlong = @as([*c]c_longlong, @ptrCast(@alignCast(p))); | |
| 1295 | \\ _ = &to_longlong; | |
| 1296 | \\ } | |
| 1297 | \\ { | |
| 1298 | \\ var to_char: [*c]u8 = @as([*c]u8, @ptrCast(@alignCast(p))); | |
| 1299 | \\ _ = &to_char; | |
| 1300 | \\ var to_short: [*c]c_short = @as([*c]c_short, @ptrCast(@alignCast(p))); | |
| 1301 | \\ _ = &to_short; | |
| 1302 | \\ var to_int: [*c]c_int = @as([*c]c_int, @ptrCast(@alignCast(p))); | |
| 1303 | \\ _ = &to_int; | |
| 1304 | \\ var to_longlong: [*c]c_longlong = @as([*c]c_longlong, @ptrCast(@alignCast(p))); | |
| 1305 | \\ _ = &to_longlong; | |
| 1306 | \\ } | |
| 1307 | \\} | |
| 1308 | }); | |
| 1309 | ||
| 1310 | cases.add("while on non-bool", | |
| 1311 | \\int while_none_bool() { | |
| 1312 | \\ int a; | |
| 1313 | \\ float b; | |
| 1314 | \\ void *c; | |
| 1315 | \\ while (a) return 0; | |
| 1316 | \\ while (b) return 1; | |
| 1317 | \\ while (c) return 2; | |
| 1318 | \\ return 3; | |
| 1319 | \\} | |
| 1320 | , &[_][]const u8{ | |
| 1321 | \\pub export fn while_none_bool() c_int { | |
| 1322 | \\ var a: c_int = undefined; | |
| 1323 | \\ _ = &a; | |
| 1324 | \\ var b: f32 = undefined; | |
| 1325 | \\ _ = &b; | |
| 1326 | \\ var c: ?*anyopaque = undefined; | |
| 1327 | \\ _ = &c; | |
| 1328 | \\ while (a != 0) return 0; | |
| 1329 | \\ while (b != 0) return 1; | |
| 1330 | \\ while (c != null) return 2; | |
| 1331 | \\ return 3; | |
| 1332 | \\} | |
| 1333 | }); | |
| 1334 | ||
| 1335 | cases.add("for on non-bool", | |
| 1336 | \\int for_none_bool() { | |
| 1337 | \\ int a; | |
| 1338 | \\ float b; | |
| 1339 | \\ void *c; | |
| 1340 | \\ for (;a;) return 0; | |
| 1341 | \\ for (;b;) return 1; | |
| 1342 | \\ for (;c;) return 2; | |
| 1343 | \\ return 3; | |
| 1344 | \\} | |
| 1345 | , &[_][]const u8{ | |
| 1346 | \\pub export fn for_none_bool() c_int { | |
| 1347 | \\ var a: c_int = undefined; | |
| 1348 | \\ _ = &a; | |
| 1349 | \\ var b: f32 = undefined; | |
| 1350 | \\ _ = &b; | |
| 1351 | \\ var c: ?*anyopaque = undefined; | |
| 1352 | \\ _ = &c; | |
| 1353 | \\ while (a != 0) return 0; | |
| 1354 | \\ while (b != 0) return 1; | |
| 1355 | \\ while (c != null) return 2; | |
| 1356 | \\ return 3; | |
| 1357 | \\} | |
| 1358 | }); | |
| 1359 | ||
| 1360 | cases.add("bitshift", | |
| 1361 | \\int foo(void) { | |
| 1362 | \\ return (1 << 2) >> 1; | |
| 1363 | \\} | |
| 1364 | , &[_][]const u8{ | |
| 1365 | \\pub export fn foo() c_int { | |
| 1366 | \\ return (@as(c_int, 1) << @intCast(2)) >> @intCast(1); | |
| 1367 | \\} | |
| 1368 | }); | |
| 1369 | ||
| 1370 | cases.add("sizeof", | |
| 1371 | \\#include <stddef.h> | |
| 1372 | \\size_t size_of(void) { | |
| 1373 | \\ return sizeof(int); | |
| 1374 | \\} | |
| 1375 | , &[_][]const u8{ | |
| 1376 | \\pub export fn size_of() usize { | |
| 1377 | \\ return @sizeOf(c_int); | |
| 1378 | \\} | |
| 1379 | }); | |
| 1380 | ||
| 1381 | cases.add("normal deref", | |
| 1382 | \\void foo() { | |
| 1383 | \\ int *x; | |
| 1384 | \\ *x = 1; | |
| 1385 | \\} | |
| 1386 | , &[_][]const u8{ | |
| 1387 | \\pub export fn foo() void { | |
| 1388 | \\ var x: [*c]c_int = undefined; | |
| 1389 | \\ _ = &x; | |
| 1390 | \\ x.* = 1; | |
| 1391 | \\} | |
| 1392 | }); | |
| 1393 | ||
| 1394 | cases.add("address of operator", | |
| 1395 | \\int foo(void) { | |
| 1396 | \\ int x = 1234; | |
| 1397 | \\ int *ptr = &x; | |
| 1398 | \\ return *ptr; | |
| 1399 | \\} | |
| 1400 | , &[_][]const u8{ | |
| 1401 | \\pub export fn foo() c_int { | |
| 1402 | \\ var x: c_int = 1234; | |
| 1403 | \\ _ = &x; | |
| 1404 | \\ var ptr: [*c]c_int = &x; | |
| 1405 | \\ _ = &ptr; | |
| 1406 | \\ return ptr.*; | |
| 1407 | \\} | |
| 1408 | }); | |
| 1409 | ||
| 1410 | cases.add("bin not", | |
| 1411 | \\int foo() { | |
| 1412 | \\ int x; | |
| 1413 | \\ return ~x; | |
| 1414 | \\} | |
| 1415 | , &[_][]const u8{ | |
| 1416 | \\pub export fn foo() c_int { | |
| 1417 | \\ var x: c_int = undefined; | |
| 1418 | \\ _ = &x; | |
| 1419 | \\ return ~x; | |
| 1420 | \\} | |
| 1421 | }); | |
| 1422 | ||
| 1423 | cases.add("bool not", | |
| 1424 | \\int foo() { | |
| 1425 | \\ int a; | |
| 1426 | \\ float b; | |
| 1427 | \\ void *c; | |
| 1428 | \\ return !(a == 0); | |
| 1429 | \\ return !a; | |
| 1430 | \\ return !b; | |
| 1431 | \\ return !c; | |
| 1432 | \\} | |
| 1433 | , &[_][]const u8{ | |
| 1434 | \\pub export fn foo() c_int { | |
| 1435 | \\ var a: c_int = undefined; | |
| 1436 | \\ _ = &a; | |
| 1437 | \\ var b: f32 = undefined; | |
| 1438 | \\ _ = &b; | |
| 1439 | \\ var c: ?*anyopaque = undefined; | |
| 1440 | \\ _ = &c; | |
| 1441 | \\ return @intFromBool(!(a == @as(c_int, 0))); | |
| 1442 | \\ return @intFromBool(!(a != 0)); | |
| 1443 | \\ return @intFromBool(!(b != 0)); | |
| 1444 | \\ return @intFromBool(!(c != null)); | |
| 1445 | \\} | |
| 1446 | }); | |
| 1447 | ||
| 1448 | cases.add("__extension__ cast", | |
| 1449 | \\int foo(void) { | |
| 1450 | \\ return __extension__ 1; | |
| 1451 | \\} | |
| 1452 | , &[_][]const u8{ | |
| 1453 | \\pub export fn foo() c_int { | |
| 1454 | \\ return 1; | |
| 1455 | \\} | |
| 1456 | }); | |
| 1457 | ||
| 1458 | if (builtin.os.tag != .windows) { | |
| 1459 | // sysv_abi not currently supported on windows | |
| 1460 | cases.add("Macro qualified functions", | |
| 1461 | \\void __attribute__((sysv_abi)) foo(void); | |
| 1462 | , &[_][]const u8{ | |
| 1463 | \\pub extern fn foo() void; | |
| 1464 | }); | |
| 1465 | } | |
| 1466 | ||
| 1467 | cases.add("Forward-declared enum", | |
| 1468 | \\extern enum enum_ty my_enum; | |
| 1469 | \\enum enum_ty { FOO }; | |
| 1470 | , &[_][]const u8{ | |
| 1471 | \\pub const FOO: c_int = 0; | |
| 1472 | \\pub const enum_enum_ty = c_int; | |
| 1473 | \\pub extern var my_enum: enum_enum_ty; | |
| 1474 | }); | |
| 1475 | ||
| 1476 | cases.add("Parameterless function pointers", | |
| 1477 | \\typedef void (*fn0)(); | |
| 1478 | \\typedef void (*fn1)(char); | |
| 1479 | , &[_][]const u8{ | |
| 1480 | \\pub const fn0 = ?*const fn (...) callconv(.c) void; | |
| 1481 | \\pub const fn1 = ?*const fn (u8) callconv(.c) void; | |
| 1482 | }); | |
| 1483 | ||
| 1484 | cases.addWithTarget("Calling convention", .{ | |
| 1485 | .cpu_arch = .x86, | |
| 1486 | .os_tag = .linux, | |
| 1487 | .abi = .none, | |
| 1488 | }, | |
| 1489 | \\void __attribute__((fastcall)) foo1(float *a); | |
| 1490 | \\void __attribute__((stdcall)) foo2(float *a); | |
| 1491 | \\void __attribute__((vectorcall)) foo3(float *a); | |
| 1492 | \\void __attribute__((cdecl)) foo4(float *a); | |
| 1493 | \\void __attribute__((thiscall)) foo5(float *a); | |
| 1494 | , &[_][]const u8{ | |
| 1495 | \\pub extern fn foo1(a: [*c]f32) callconv(.{ .x86_fastcall = .{} }) void; | |
| 1496 | \\pub extern fn foo2(a: [*c]f32) callconv(.{ .x86_stdcall = .{} }) void; | |
| 1497 | \\pub extern fn foo3(a: [*c]f32) callconv(.{ .x86_vectorcall = .{} }) void; | |
| 1498 | \\pub extern fn foo4(a: [*c]f32) void; | |
| 1499 | \\pub extern fn foo5(a: [*c]f32) callconv(.{ .x86_thiscall = .{} }) void; | |
| 1500 | }); | |
| 1501 | ||
| 1502 | cases.addWithTarget("Calling convention", std.Target.Query.parse(.{ | |
| 1503 | .arch_os_abi = "arm-linux-none", | |
| 1504 | .cpu_features = "generic+v8_5a", | |
| 1505 | }) catch unreachable, | |
| 1506 | \\void __attribute__((pcs("aapcs"))) foo1(float *a); | |
| 1507 | \\void __attribute__((pcs("aapcs-vfp"))) foo2(float *a); | |
| 1508 | , &[_][]const u8{ | |
| 1509 | \\pub extern fn foo1(a: [*c]f32) callconv(.{ .arm_aapcs = .{} }) void; | |
| 1510 | \\pub extern fn foo2(a: [*c]f32) callconv(.{ .arm_aapcs_vfp = .{} }) void; | |
| 1511 | }); | |
| 1512 | ||
| 1513 | cases.addWithTarget("Calling convention", std.Target.Query.parse(.{ | |
| 1514 | .arch_os_abi = "aarch64-linux-none", | |
| 1515 | .cpu_features = "generic+v8_5a", | |
| 1516 | }) catch unreachable, | |
| 1517 | \\void __attribute__((aarch64_vector_pcs)) foo1(float *a); | |
| 1518 | , &[_][]const u8{ | |
| 1519 | \\pub extern fn foo1(a: [*c]f32) callconv(.{ .aarch64_vfabi = .{} }) void; | |
| 1520 | }); | |
| 1521 | ||
| 1522 | cases.add("Parameterless function prototypes", | |
| 1523 | \\void a() {} | |
| 1524 | \\void b(void) {} | |
| 1525 | \\void c(); | |
| 1526 | \\void d(void); | |
| 1527 | \\static void e() {} | |
| 1528 | \\static void f(void) {} | |
| 1529 | \\static void g(); | |
| 1530 | \\static void h(void); | |
| 1531 | , &[_][]const u8{ | |
| 1532 | \\pub export fn a() void {} | |
| 1533 | \\pub export fn b() void {} | |
| 1534 | \\pub extern fn c(...) void; | |
| 1535 | \\pub extern fn d() void; | |
| 1536 | \\pub fn e() callconv(.c) void {} | |
| 1537 | \\pub fn f() callconv(.c) void {} | |
| 1538 | \\pub extern fn g() void; | |
| 1539 | \\pub extern fn h() void; | |
| 1540 | }); | |
| 1541 | ||
| 1542 | cases.add("variable declarations", | |
| 1543 | \\extern char arr0[] = "hello"; | |
| 1544 | \\static char arr1[] = "hello"; | |
| 1545 | \\char arr2[] = "hello"; | |
| 1546 | , &[_][]const u8{ | |
| 1547 | \\pub export var arr0: [5:0]u8 = "hello".*; | |
| 1548 | \\pub var arr1: [5:0]u8 = "hello".*; | |
| 1549 | \\pub export var arr2: [5:0]u8 = "hello".*; | |
| 1550 | }); | |
| 1551 | ||
| 1552 | cases.add("array initializer expr", | |
| 1553 | \\static void foo(void){ | |
| 1554 | \\ char arr[10] ={1}; | |
| 1555 | \\ char *arr1[10] ={0}; | |
| 1556 | \\} | |
| 1557 | , &[_][]const u8{ | |
| 1558 | \\pub fn foo() callconv(.c) void { | |
| 1559 | \\ var arr: [10]u8 = [1]u8{ | |
| 1560 | \\ 1, | |
| 1561 | \\ } ++ [1]u8{0} ** 9; | |
| 1562 | \\ _ = &arr; | |
| 1563 | \\ var arr1: [10][*c]u8 = [1][*c]u8{ | |
| 1564 | \\ null, | |
| 1565 | \\ } ++ [1][*c]u8{null} ** 9; | |
| 1566 | \\ _ = &arr1; | |
| 1567 | \\} | |
| 1568 | }); | |
| 1569 | ||
| 1570 | cases.add("enums", | |
| 1571 | \\typedef enum { | |
| 1572 | \\ a, | |
| 1573 | \\ b, | |
| 1574 | \\ c, | |
| 1575 | \\} d; | |
| 1576 | \\enum { | |
| 1577 | \\ e, | |
| 1578 | \\ f = 4, | |
| 1579 | \\ g, | |
| 1580 | \\} h = e; | |
| 1581 | \\struct Baz { | |
| 1582 | \\ enum { | |
| 1583 | \\ i, | |
| 1584 | \\ j, | |
| 1585 | \\ k, | |
| 1586 | \\ } l; | |
| 1587 | \\ d m; | |
| 1588 | \\}; | |
| 1589 | \\enum i { | |
| 1590 | \\ n, | |
| 1591 | \\ o, | |
| 1592 | \\ p, | |
| 1593 | \\}; | |
| 1594 | , &[_][]const u8{ | |
| 1595 | \\pub const a: c_int = 0; | |
| 1596 | \\pub const b: c_int = 1; | |
| 1597 | \\pub const c: c_int = 2; | |
| 1598 | \\pub const d = | |
| 1599 | ++ " " ++ default_enum_type ++ | |
| 1600 | \\; | |
| 1601 | \\pub const e: c_int = 0; | |
| 1602 | \\pub const f: c_int = 4; | |
| 1603 | \\pub const g: c_int = 5; | |
| 1604 | \\const enum_unnamed_1 = | |
| 1605 | ++ " " ++ default_enum_type ++ | |
| 1606 | \\; | |
| 1607 | \\pub export var h: enum_unnamed_1 = @as(c_uint, @bitCast(e)); | |
| 1608 | \\pub const i: c_int = 0; | |
| 1609 | \\pub const j: c_int = 1; | |
| 1610 | \\pub const k: c_int = 2; | |
| 1611 | \\const enum_unnamed_2 = | |
| 1612 | ++ " " ++ default_enum_type ++ | |
| 1613 | \\; | |
| 1614 | \\pub const struct_Baz = extern struct { | |
| 1615 | \\ l: enum_unnamed_2 = @import("std").mem.zeroes(enum_unnamed_2), | |
| 1616 | \\ m: d = @import("std").mem.zeroes(d), | |
| 1617 | \\}; | |
| 1618 | \\pub const n: c_int = 0; | |
| 1619 | \\pub const o: c_int = 1; | |
| 1620 | \\pub const p: c_int = 2; | |
| 1621 | \\pub const enum_i = | |
| 1622 | ++ " " ++ default_enum_type ++ | |
| 1623 | \\; | |
| 1624 | , | |
| 1625 | "pub const Baz = struct_Baz;", | |
| 1626 | }); | |
| 1627 | ||
| 1628 | cases.add("#define a char literal", | |
| 1629 | \\#define A_CHAR 'a' | |
| 1630 | , &[_][]const u8{ | |
| 1631 | \\pub const A_CHAR = 'a'; | |
| 1632 | }); | |
| 1633 | ||
| 1634 | cases.add("comment after integer literal", | |
| 1635 | \\#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1636 | , &[_][]const u8{ | |
| 1637 | \\pub const SDL_INIT_VIDEO = @as(c_int, 0x00000020); | |
| 1638 | }); | |
| 1639 | ||
| 1640 | cases.add("u integer suffix after hex literal", | |
| 1641 | \\#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1642 | , &[_][]const u8{ | |
| 1643 | \\pub const SDL_INIT_VIDEO = @as(c_uint, 0x00000020); | |
| 1644 | }); | |
| 1645 | ||
| 1646 | cases.add("l integer suffix after hex literal", | |
| 1647 | \\#define SDL_INIT_VIDEO 0x00000020l /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1648 | , &[_][]const u8{ | |
| 1649 | \\pub const SDL_INIT_VIDEO = @as(c_long, 0x00000020); | |
| 1650 | }); | |
| 1651 | ||
| 1652 | cases.add("ul integer suffix after hex literal", | |
| 1653 | \\#define SDL_INIT_VIDEO 0x00000020ul /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1654 | , &[_][]const u8{ | |
| 1655 | \\pub const SDL_INIT_VIDEO = @as(c_ulong, 0x00000020); | |
| 1656 | }); | |
| 1657 | ||
| 1658 | cases.add("lu integer suffix after hex literal", | |
| 1659 | \\#define SDL_INIT_VIDEO 0x00000020lu /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1660 | , &[_][]const u8{ | |
| 1661 | \\pub const SDL_INIT_VIDEO = @as(c_ulong, 0x00000020); | |
| 1662 | }); | |
| 1663 | ||
| 1664 | cases.add("ll integer suffix after hex literal", | |
| 1665 | \\#define SDL_INIT_VIDEO 0x00000020ll /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1666 | , &[_][]const u8{ | |
| 1667 | \\pub const SDL_INIT_VIDEO = @as(c_longlong, 0x00000020); | |
| 1668 | }); | |
| 1669 | ||
| 1670 | cases.add("ull integer suffix after hex literal", | |
| 1671 | \\#define SDL_INIT_VIDEO 0x00000020ull /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1672 | , &[_][]const u8{ | |
| 1673 | \\pub const SDL_INIT_VIDEO = @as(c_ulonglong, 0x00000020); | |
| 1674 | }); | |
| 1675 | ||
| 1676 | cases.add("llu integer suffix after hex literal", | |
| 1677 | \\#define SDL_INIT_VIDEO 0x00000020llu /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ | |
| 1678 | , &[_][]const u8{ | |
| 1679 | \\pub const SDL_INIT_VIDEO = @as(c_ulonglong, 0x00000020); | |
| 1680 | }); | |
| 1681 | ||
| 1682 | cases.add("generate inline func for #define global extern fn", | |
| 1683 | \\extern void (*fn_ptr)(void); | |
| 1684 | \\#define foo fn_ptr | |
| 1685 | \\ | |
| 1686 | \\extern char (*fn_ptr2)(int, float); | |
| 1687 | \\#define bar fn_ptr2 | |
| 1688 | , &[_][]const u8{ | |
| 1689 | \\pub extern var fn_ptr: ?*const fn () callconv(.c) void; | |
| 1690 | , | |
| 1691 | \\pub inline fn foo() void { | |
| 1692 | \\ return fn_ptr.?(); | |
| 1693 | \\} | |
| 1694 | , | |
| 1695 | \\pub extern var fn_ptr2: ?*const fn (c_int, f32) callconv(.c) u8; | |
| 1696 | , | |
| 1697 | \\pub inline fn bar(arg_1: c_int, arg_2: f32) u8 { | |
| 1698 | \\ return fn_ptr2.?(arg_1, arg_2); | |
| 1699 | \\} | |
| 1700 | }); | |
| 1701 | ||
| 1702 | cases.add("macros with field targets", | |
| 1703 | \\typedef unsigned int GLbitfield; | |
| 1704 | \\typedef void (*PFNGLCLEARPROC) (GLbitfield mask); | |
| 1705 | \\typedef void(*OpenGLProc)(void); | |
| 1706 | \\union OpenGLProcs { | |
| 1707 | \\ OpenGLProc ptr[1]; | |
| 1708 | \\ struct { | |
| 1709 | \\ PFNGLCLEARPROC Clear; | |
| 1710 | \\ } gl; | |
| 1711 | \\}; | |
| 1712 | \\extern union OpenGLProcs glProcs; | |
| 1713 | \\#define glClearUnion glProcs.gl.Clear | |
| 1714 | \\#define glClearPFN PFNGLCLEARPROC | |
| 1715 | , &[_][]const u8{ | |
| 1716 | \\pub const GLbitfield = c_uint; | |
| 1717 | \\pub const PFNGLCLEARPROC = ?*const fn (GLbitfield) callconv(.c) void; | |
| 1718 | \\pub const OpenGLProc = ?*const fn () callconv(.c) void; | |
| 1719 | \\const struct_unnamed_1 = extern struct { | |
| 1720 | \\ Clear: PFNGLCLEARPROC = @import("std").mem.zeroes(PFNGLCLEARPROC), | |
| 1721 | \\}; | |
| 1722 | \\pub const union_OpenGLProcs = extern union { | |
| 1723 | \\ ptr: [1]OpenGLProc, | |
| 1724 | \\ gl: struct_unnamed_1, | |
| 1725 | \\}; | |
| 1726 | \\pub extern var glProcs: union_OpenGLProcs; | |
| 1727 | , | |
| 1728 | \\pub const glClearPFN = PFNGLCLEARPROC; | |
| 1729 | , | |
| 1730 | \\pub inline fn glClearUnion(arg_2: GLbitfield) void { | |
| 1731 | \\ return glProcs.gl.Clear.?(arg_2); | |
| 1732 | \\} | |
| 1733 | , | |
| 1734 | \\pub const OpenGLProcs = union_OpenGLProcs; | |
| 1735 | }); | |
| 1736 | ||
| 1737 | cases.add("macro pointer cast", | |
| 1738 | \\#define NRF_GPIO_BASE 0 | |
| 1739 | \\typedef struct { int dummy; } NRF_GPIO_Type; | |
| 1740 | \\#define NRF_GPIO ((NRF_GPIO_Type *) NRF_GPIO_BASE) | |
| 1741 | , &[_][]const u8{ | |
| 1742 | \\pub const NRF_GPIO = @import("std").zig.c_translation.cast([*c]NRF_GPIO_Type, NRF_GPIO_BASE); | |
| 1743 | }); | |
| 1744 | ||
| 1745 | cases.add("basic macro function", | |
| 1746 | \\extern int c; | |
| 1747 | \\#define BASIC(c) (c*2) | |
| 1748 | \\#define FOO(L,b) (L + b) | |
| 1749 | \\#define BAR() (c*c) | |
| 1750 | , &[_][]const u8{ | |
| 1751 | \\pub extern var c: c_int; | |
| 1752 | , | |
| 1753 | \\pub inline fn BASIC(c_1: anytype) @TypeOf(c_1 * @as(c_int, 2)) { | |
| 1754 | \\ _ = &c_1; | |
| 1755 | \\ return c_1 * @as(c_int, 2); | |
| 1756 | \\} | |
| 1757 | , | |
| 1758 | \\pub inline fn FOO(L: anytype, b: anytype) @TypeOf(L + b) { | |
| 1759 | \\ _ = &L; | |
| 1760 | \\ _ = &b; | |
| 1761 | \\ return L + b; | |
| 1762 | \\} | |
| 1763 | , | |
| 1764 | \\pub inline fn BAR() @TypeOf(c * c) { | |
| 1765 | \\ return c * c; | |
| 1766 | \\} | |
| 1767 | }); | |
| 1768 | ||
| 1769 | cases.add("macro defines string literal with hex", | |
| 1770 | \\#define FOO "aoeu\xab derp" | |
| 1771 | \\#define FOO2 "aoeu\x0007a derp" | |
| 1772 | \\#define FOO_CHAR '\xfF' | |
| 1773 | , &[_][]const u8{ | |
| 1774 | \\pub const FOO = "aoeu\xab derp"; | |
| 1775 | , | |
| 1776 | \\pub const FOO2 = "aoeu\x7a derp"; | |
| 1777 | , | |
| 1778 | \\pub const FOO_CHAR = '\xff'; | |
| 1779 | }); | |
| 1780 | ||
| 1781 | cases.add("macro add", | |
| 1782 | \\#define D3_AHB1PERIPH_BASE 0 | |
| 1783 | \\#define PERIPH_BASE (0x40000000UL) /*!< Base address of : AHB/APB Peripherals */ | |
| 1784 | \\#define D3_APB1PERIPH_BASE (PERIPH_BASE + 0x18000000UL) | |
| 1785 | \\#define RCC_BASE (D3_AHB1PERIPH_BASE + 0x4400UL) | |
| 1786 | , &[_][]const u8{ | |
| 1787 | \\pub const PERIPH_BASE = @as(c_ulong, 0x40000000); | |
| 1788 | , | |
| 1789 | \\pub const D3_APB1PERIPH_BASE = PERIPH_BASE + @as(c_ulong, 0x18000000); | |
| 1790 | , | |
| 1791 | \\pub const RCC_BASE = D3_AHB1PERIPH_BASE + @as(c_ulong, 0x4400); | |
| 1792 | }); | |
| 1793 | ||
| 1794 | cases.add("variable aliasing", | |
| 1795 | \\static long a = 2; | |
| 1796 | \\static long b = 2; | |
| 1797 | \\static int c = 4; | |
| 1798 | \\void foo(char c) { | |
| 1799 | \\ int a; | |
| 1800 | \\ char b = 123; | |
| 1801 | \\ b = (char) a; | |
| 1802 | \\ { | |
| 1803 | \\ int d = 5; | |
| 1804 | \\ } | |
| 1805 | \\ unsigned d = 440; | |
| 1806 | \\} | |
| 1807 | , &[_][]const u8{ | |
| 1808 | \\pub var a: c_long = 2; | |
| 1809 | \\pub var b: c_long = 2; | |
| 1810 | \\pub var c: c_int = 4; | |
| 1811 | \\pub export fn foo(arg_c_1: u8) void { | |
| 1812 | \\ var c_1 = arg_c_1; | |
| 1813 | \\ _ = &c_1; | |
| 1814 | \\ var a_2: c_int = undefined; | |
| 1815 | \\ _ = &a_2; | |
| 1816 | \\ var b_3: u8 = 123; | |
| 1817 | \\ _ = &b_3; | |
| 1818 | \\ b_3 = @as(u8, @bitCast(@as(i8, @truncate(a_2)))); | |
| 1819 | \\ { | |
| 1820 | \\ var d: c_int = 5; | |
| 1821 | \\ _ = &d; | |
| 1822 | \\ } | |
| 1823 | \\ var d: c_uint = @as(c_uint, @bitCast(@as(c_int, 440))); | |
| 1824 | \\ _ = &d; | |
| 1825 | \\} | |
| 1826 | }); | |
| 1827 | ||
| 1828 | cases.add("comma operator", | |
| 1829 | \\int foo() { | |
| 1830 | \\ 2, 4; | |
| 1831 | \\ return 2, 4, 6; | |
| 1832 | \\} | |
| 1833 | , &[_][]const u8{ | |
| 1834 | \\pub export fn foo() c_int { | |
| 1835 | \\ _ = blk: { | |
| 1836 | \\ _ = @as(c_int, 2); | |
| 1837 | \\ break :blk @as(c_int, 4); | |
| 1838 | \\ }; | |
| 1839 | \\ return blk: { | |
| 1840 | \\ _ = blk_1: { | |
| 1841 | \\ _ = @as(c_int, 2); | |
| 1842 | \\ break :blk_1 @as(c_int, 4); | |
| 1843 | \\ }; | |
| 1844 | \\ break :blk @as(c_int, 6); | |
| 1845 | \\ }; | |
| 1846 | \\} | |
| 1847 | }); | |
| 1848 | ||
| 1849 | cases.add("worst-case assign", | |
| 1850 | \\void foo() { | |
| 1851 | \\ int a; | |
| 1852 | \\ int b; | |
| 1853 | \\ a = b = 2; | |
| 1854 | \\} | |
| 1855 | , &[_][]const u8{ | |
| 1856 | \\pub export fn foo() void { | |
| 1857 | \\ var a: c_int = undefined; | |
| 1858 | \\ _ = &a; | |
| 1859 | \\ var b: c_int = undefined; | |
| 1860 | \\ _ = &b; | |
| 1861 | \\ a = blk: { | |
| 1862 | \\ const tmp = @as(c_int, 2); | |
| 1863 | \\ b = tmp; | |
| 1864 | \\ break :blk tmp; | |
| 1865 | \\ }; | |
| 1866 | \\} | |
| 1867 | }); | |
| 1868 | ||
| 1869 | cases.add("while loops", | |
| 1870 | \\int foo() { | |
| 1871 | \\ int a = 5; | |
| 1872 | \\ while (2) | |
| 1873 | \\ a = 2; | |
| 1874 | \\ while (4) { | |
| 1875 | \\ int a = 4; | |
| 1876 | \\ a = 9; | |
| 1877 | \\ return 6, a; | |
| 1878 | \\ } | |
| 1879 | \\ do { | |
| 1880 | \\ int a = 2; | |
| 1881 | \\ a = 12; | |
| 1882 | \\ } while (4); | |
| 1883 | \\ do | |
| 1884 | \\ a = 7; | |
| 1885 | \\ while (4); | |
| 1886 | \\} | |
| 1887 | , &[_][]const u8{ | |
| 1888 | \\pub export fn foo() c_int { | |
| 1889 | \\ var a: c_int = 5; | |
| 1890 | \\ _ = &a; | |
| 1891 | \\ while (true) { | |
| 1892 | \\ a = 2; | |
| 1893 | \\ } | |
| 1894 | \\ while (true) { | |
| 1895 | \\ var a_1: c_int = 4; | |
| 1896 | \\ _ = &a_1; | |
| 1897 | \\ a_1 = 9; | |
| 1898 | \\ return blk: { | |
| 1899 | \\ _ = @as(c_int, 6); | |
| 1900 | \\ break :blk a_1; | |
| 1901 | \\ }; | |
| 1902 | \\ } | |
| 1903 | \\ while (true) { | |
| 1904 | \\ var a_1: c_int = 2; | |
| 1905 | \\ _ = &a_1; | |
| 1906 | \\ a_1 = 12; | |
| 1907 | \\ } | |
| 1908 | \\ while (true) { | |
| 1909 | \\ a = 7; | |
| 1910 | \\ } | |
| 1911 | \\ return 0; | |
| 1912 | \\} | |
| 1913 | }); | |
| 1914 | ||
| 1915 | cases.add("for loops", | |
| 1916 | \\void foo() { | |
| 1917 | \\ for (int i = 2, b = 4; i + 2; i = 2) { | |
| 1918 | \\ int a = 2; | |
| 1919 | \\ a = 6, 5, 7; | |
| 1920 | \\ } | |
| 1921 | \\ char i = 2; | |
| 1922 | \\} | |
| 1923 | , &[_][]const u8{ | |
| 1924 | \\pub export fn foo() void { | |
| 1925 | \\ { | |
| 1926 | \\ var i: c_int = 2; | |
| 1927 | \\ _ = &i; | |
| 1928 | \\ var b: c_int = 4; | |
| 1929 | \\ _ = &b; | |
| 1930 | \\ while ((i + @as(c_int, 2)) != 0) : (i = 2) { | |
| 1931 | \\ var a: c_int = 2; | |
| 1932 | \\ _ = &a; | |
| 1933 | \\ _ = blk: { | |
| 1934 | \\ _ = blk_1: { | |
| 1935 | \\ a = 6; | |
| 1936 | \\ break :blk_1 @as(c_int, 5); | |
| 1937 | \\ }; | |
| 1938 | \\ break :blk @as(c_int, 7); | |
| 1939 | \\ }; | |
| 1940 | \\ } | |
| 1941 | \\ } | |
| 1942 | \\ var i: u8 = 2; | |
| 1943 | \\ _ = &i; | |
| 1944 | \\} | |
| 1945 | }); | |
| 1946 | ||
| 1947 | cases.add("shadowing primitive types", | |
| 1948 | \\unsigned anyerror = 2; | |
| 1949 | \\#define noreturn _Noreturn | |
| 1950 | \\typedef enum { | |
| 1951 | \\ f32, | |
| 1952 | \\ u32, | |
| 1953 | \\} BadEnum; | |
| 1954 | , &[_][]const u8{ | |
| 1955 | \\pub export var @"anyerror": c_uint = 2; | |
| 1956 | , | |
| 1957 | \\pub const @"noreturn" = @compileError("unable to translate C expr: unexpected token '_Noreturn'"); | |
| 1958 | , | |
| 1959 | \\pub const @"f32": c_int = 0; | |
| 1960 | \\pub const @"u32": c_int = 1; | |
| 1961 | \\pub const BadEnum = c_uint; | |
| 1962 | }); | |
| 1963 | ||
| 1964 | cases.add("floats", | |
| 1965 | \\float a = 3.1415; | |
| 1966 | \\double b = 3.1415; | |
| 1967 | \\int c = 3.1415; | |
| 1968 | \\double d = 3; | |
| 1969 | , &[_][]const u8{ | |
| 1970 | \\pub export var a: f32 = @as(f32, @floatCast(3.1415)); | |
| 1971 | \\pub export var b: f64 = 3.1415; | |
| 1972 | \\pub export var c: c_int = @as(c_int, @intFromFloat(3.1415)); | |
| 1973 | \\pub export var d: f64 = 3; | |
| 1974 | }); | |
| 1975 | ||
| 1976 | cases.add("conditional operator", | |
| 1977 | \\int bar(void) { | |
| 1978 | \\ if (2 ? 5 : 5 ? 4 : 6) 2; | |
| 1979 | \\ return 2 ? 5 : 5 ? 4 : 6; | |
| 1980 | \\} | |
| 1981 | , &[_][]const u8{ | |
| 1982 | \\pub export fn bar() c_int { | |
| 1983 | \\ if ((if (true) @as(c_int, 5) else if (true) @as(c_int, 4) else @as(c_int, 6)) != 0) { | |
| 1984 | \\ _ = @as(c_int, 2); | |
| 1985 | \\ } | |
| 1986 | \\ return if (true) @as(c_int, 5) else if (true) @as(c_int, 4) else @as(c_int, 6); | |
| 1987 | \\} | |
| 1988 | }); | |
| 1989 | ||
| 1990 | cases.add("switch on int", | |
| 1991 | \\void switch_fn(int i) { | |
| 1992 | \\ int res = 0; | |
| 1993 | \\ switch (i) { | |
| 1994 | \\ case 0: | |
| 1995 | \\ res = 1; | |
| 1996 | \\ case 1 ... 3: | |
| 1997 | \\ res = 2; | |
| 1998 | \\ default: | |
| 1999 | \\ res = 3 * i; | |
| 2000 | \\ break; | |
| 2001 | \\ break; | |
| 2002 | \\ case 7: { | |
| 2003 | \\ res = 7; | |
| 2004 | \\ break; | |
| 2005 | \\ } | |
| 2006 | \\ case 4: | |
| 2007 | \\ case 5: | |
| 2008 | \\ res = 69; | |
| 2009 | \\ { | |
| 2010 | \\ res = 5; | |
| 2011 | \\ return; | |
| 2012 | \\ } | |
| 2013 | \\ case 6: | |
| 2014 | \\ switch (res) { | |
| 2015 | \\ case 9: break; | |
| 2016 | \\ } | |
| 2017 | \\ res = 1; | |
| 2018 | \\ return; | |
| 2019 | \\ } | |
| 2020 | \\} | |
| 2021 | , &[_][]const u8{ | |
| 2022 | \\pub export fn switch_fn(arg_i: c_int) void { | |
| 2023 | \\ var i = arg_i; | |
| 2024 | \\ _ = &i; | |
| 2025 | \\ var res: c_int = 0; | |
| 2026 | \\ _ = &res; | |
| 2027 | \\ while (true) { | |
| 2028 | \\ switch (i) { | |
| 2029 | \\ @as(c_int, 0) => { | |
| 2030 | \\ res = 1; | |
| 2031 | \\ res = 2; | |
| 2032 | \\ res = @as(c_int, 3) * i; | |
| 2033 | \\ break; | |
| 2034 | \\ }, | |
| 2035 | \\ @as(c_int, 1)...@as(c_int, 3) => { | |
| 2036 | \\ res = 2; | |
| 2037 | \\ res = @as(c_int, 3) * i; | |
| 2038 | \\ break; | |
| 2039 | \\ }, | |
| 2040 | \\ else => { | |
| 2041 | \\ res = @as(c_int, 3) * i; | |
| 2042 | \\ break; | |
| 2043 | \\ }, | |
| 2044 | \\ @as(c_int, 7) => { | |
| 2045 | \\ { | |
| 2046 | \\ res = 7; | |
| 2047 | \\ break; | |
| 2048 | \\ } | |
| 2049 | \\ }, | |
| 2050 | \\ @as(c_int, 4), @as(c_int, 5) => { | |
| 2051 | \\ res = 69; | |
| 2052 | \\ { | |
| 2053 | \\ res = 5; | |
| 2054 | \\ return; | |
| 2055 | \\ } | |
| 2056 | \\ }, | |
| 2057 | \\ @as(c_int, 6) => { | |
| 2058 | \\ while (true) { | |
| 2059 | \\ switch (res) { | |
| 2060 | \\ @as(c_int, 9) => break, | |
| 2061 | \\ else => {}, | |
| 2062 | \\ } | |
| 2063 | \\ break; | |
| 2064 | \\ } | |
| 2065 | \\ res = 1; | |
| 2066 | \\ return; | |
| 2067 | \\ }, | |
| 2068 | \\ } | |
| 2069 | \\ break; | |
| 2070 | \\ } | |
| 2071 | \\} | |
| 2072 | }); | |
| 2073 | cases.add("undefined array global", | |
| 2074 | \\int array[100] = {}; | |
| 2075 | , &[_][]const u8{ | |
| 2076 | \\pub export var array: [100]c_int = [1]c_int{0} ** 100; | |
| 2077 | }); | |
| 2078 | ||
| 2079 | cases.add("restrict -> noalias", | |
| 2080 | \\void foo(void *restrict bar, void *restrict); | |
| 2081 | , &[_][]const u8{ | |
| 2082 | \\pub extern fn foo(noalias bar: ?*anyopaque, noalias ?*anyopaque) void; | |
| 2083 | }); | |
| 2084 | ||
| 2085 | cases.add("assign", | |
| 2086 | \\void max(int a) { | |
| 2087 | \\ int tmp; | |
| 2088 | \\ tmp = a; | |
| 2089 | \\ a = tmp; | |
| 2090 | \\} | |
| 2091 | , &[_][]const u8{ | |
| 2092 | \\pub export fn max(arg_a: c_int) void { | |
| 2093 | \\ var a = arg_a; | |
| 2094 | \\ _ = &a; | |
| 2095 | \\ var tmp: c_int = undefined; | |
| 2096 | \\ _ = &tmp; | |
| 2097 | \\ tmp = a; | |
| 2098 | \\ a = tmp; | |
| 2099 | \\} | |
| 2100 | }); | |
| 2101 | ||
| 2102 | cases.add("chaining assign", | |
| 2103 | \\void max(int a) { | |
| 2104 | \\ int b, c; | |
| 2105 | \\ c = b = a; | |
| 2106 | \\} | |
| 2107 | , &[_][]const u8{ | |
| 2108 | \\pub export fn max(arg_a: c_int) void { | |
| 2109 | \\ var a = arg_a; | |
| 2110 | \\ _ = &a; | |
| 2111 | \\ var b: c_int = undefined; | |
| 2112 | \\ _ = &b; | |
| 2113 | \\ var c: c_int = undefined; | |
| 2114 | \\ _ = &c; | |
| 2115 | \\ c = blk: { | |
| 2116 | \\ const tmp = a; | |
| 2117 | \\ b = tmp; | |
| 2118 | \\ break :blk tmp; | |
| 2119 | \\ }; | |
| 2120 | \\} | |
| 2121 | }); | |
| 2122 | ||
| 2123 | cases.add("anonymous enum", | |
| 2124 | \\enum { | |
| 2125 | \\ One, | |
| 2126 | \\ Two, | |
| 2127 | \\}; | |
| 2128 | , &[_][]const u8{ | |
| 2129 | \\pub const One: c_int = 0; | |
| 2130 | \\pub const Two: c_int = 1; | |
| 2131 | \\const enum_unnamed_1 = | |
| 2132 | ++ " " ++ default_enum_type ++ | |
| 2133 | \\; | |
| 2134 | }); | |
| 2135 | ||
| 2136 | cases.add("c style cast", | |
| 2137 | \\int int_from_float(float a) { | |
| 2138 | \\ return (int)a; | |
| 2139 | \\} | |
| 2140 | , &[_][]const u8{ | |
| 2141 | \\pub export fn int_from_float(arg_a: f32) c_int { | |
| 2142 | \\ var a = arg_a; | |
| 2143 | \\ _ = &a; | |
| 2144 | \\ return @as(c_int, @intFromFloat(a)); | |
| 2145 | \\} | |
| 2146 | }); | |
| 2147 | ||
| 2148 | cases.add("escape sequences", | |
| 2149 | \\const char *escapes() { | |
| 2150 | \\char a = '\'', | |
| 2151 | \\ b = '\\', | |
| 2152 | \\ c = '\a', | |
| 2153 | \\ d = '\b', | |
| 2154 | \\ e = '\f', | |
| 2155 | \\ f = '\n', | |
| 2156 | \\ g = '\r', | |
| 2157 | \\ h = '\t', | |
| 2158 | \\ i = '\v', | |
| 2159 | \\ j = '\0', | |
| 2160 | \\ k = '\"'; | |
| 2161 | \\ return "\'\\\a\b\f\n\r\t\v\0\""; | |
| 2162 | \\} | |
| 2163 | \\ | |
| 2164 | , &[_][]const u8{ | |
| 2165 | \\pub export fn escapes() [*c]const u8 { | |
| 2166 | \\ var a: u8 = '\''; | |
| 2167 | \\ _ = &a; | |
| 2168 | \\ var b: u8 = '\\'; | |
| 2169 | \\ _ = &b; | |
| 2170 | \\ var c: u8 = '\x07'; | |
| 2171 | \\ _ = &c; | |
| 2172 | \\ var d: u8 = '\x08'; | |
| 2173 | \\ _ = &d; | |
| 2174 | \\ var e: u8 = '\x0c'; | |
| 2175 | \\ _ = &e; | |
| 2176 | \\ var f: u8 = '\n'; | |
| 2177 | \\ _ = &f; | |
| 2178 | \\ var g: u8 = '\r'; | |
| 2179 | \\ _ = &g; | |
| 2180 | \\ var h: u8 = '\t'; | |
| 2181 | \\ _ = &h; | |
| 2182 | \\ var i: u8 = '\x0b'; | |
| 2183 | \\ _ = &i; | |
| 2184 | \\ var j: u8 = '\x00'; | |
| 2185 | \\ _ = &j; | |
| 2186 | \\ var k: u8 = '"'; | |
| 2187 | \\ _ = &k; | |
| 2188 | \\ return "'\\\x07\x08\x0c\n\r\t\x0b\x00\""; | |
| 2189 | \\} | |
| 2190 | }); | |
| 2191 | ||
| 2192 | cases.add("do loop", | |
| 2193 | \\void foo(void) { | |
| 2194 | \\ int a = 2; | |
| 2195 | \\ do { | |
| 2196 | \\ a = a - 1; | |
| 2197 | \\ } while (a); | |
| 2198 | \\ | |
| 2199 | \\ int b = 2; | |
| 2200 | \\ do | |
| 2201 | \\ b = b -1; | |
| 2202 | \\ while (b); | |
| 2203 | \\} | |
| 2204 | , &[_][]const u8{ | |
| 2205 | \\pub export fn foo() void { | |
| 2206 | \\ var a: c_int = 2; | |
| 2207 | \\ _ = &a; | |
| 2208 | \\ while (true) { | |
| 2209 | \\ a = a - @as(c_int, 1); | |
| 2210 | \\ if (!(a != 0)) break; | |
| 2211 | \\ } | |
| 2212 | \\ var b: c_int = 2; | |
| 2213 | \\ _ = &b; | |
| 2214 | \\ while (true) { | |
| 2215 | \\ b = b - @as(c_int, 1); | |
| 2216 | \\ if (!(b != 0)) break; | |
| 2217 | \\ } | |
| 2218 | \\} | |
| 2219 | }); | |
| 2220 | ||
| 2221 | cases.add("logical and, logical or, on non-bool values, extra parens", | |
| 2222 | \\enum Foo { | |
| 2223 | \\ FooA, | |
| 2224 | \\ FooB, | |
| 2225 | \\ FooC, | |
| 2226 | \\}; | |
| 2227 | \\typedef int SomeTypedef; | |
| 2228 | \\int and_or_non_bool(int a, float b, void *c) { | |
| 2229 | \\ enum Foo d = FooA; | |
| 2230 | \\ int e = (a && b); | |
| 2231 | \\ int f = (b && c); | |
| 2232 | \\ int g = (a && c); | |
| 2233 | \\ int h = (a || b); | |
| 2234 | \\ int i = (b || c); | |
| 2235 | \\ int j = (a || c); | |
| 2236 | \\ int k = (a || (int)d); | |
| 2237 | \\ int l = ((int)d && b); | |
| 2238 | \\ int m = (c || (unsigned int)d); | |
| 2239 | \\ SomeTypedef td = 44; | |
| 2240 | \\ int o = (td || b); | |
| 2241 | \\ int p = (c && td); | |
| 2242 | \\ return ((((((((((e + f) + g) + h) + i) + j) + k) + l) + m) + o) + p); | |
| 2243 | \\} | |
| 2244 | , &[_][]const u8{ | |
| 2245 | \\pub const FooA: c_int = 0; | |
| 2246 | \\pub const FooB: c_int = 1; | |
| 2247 | \\pub const FooC: c_int = 2; | |
| 2248 | \\pub const enum_Foo = | |
| 2249 | ++ " " ++ default_enum_type ++ | |
| 2250 | \\; | |
| 2251 | \\pub const SomeTypedef = c_int; | |
| 2252 | \\pub export fn and_or_non_bool(arg_a: c_int, arg_b: f32, arg_c: ?*anyopaque) c_int { | |
| 2253 | \\ var a = arg_a; | |
| 2254 | \\ _ = &a; | |
| 2255 | \\ var b = arg_b; | |
| 2256 | \\ _ = &b; | |
| 2257 | \\ var c = arg_c; | |
| 2258 | \\ _ = &c; | |
| 2259 | \\ var d: enum_Foo = @as(c_uint, @bitCast(FooA)); | |
| 2260 | \\ _ = &d; | |
| 2261 | \\ var e: c_int = @intFromBool((a != 0) and (b != 0)); | |
| 2262 | \\ _ = &e; | |
| 2263 | \\ var f: c_int = @intFromBool((b != 0) and (c != null)); | |
| 2264 | \\ _ = &f; | |
| 2265 | \\ var g: c_int = @intFromBool((a != 0) and (c != null)); | |
| 2266 | \\ _ = &g; | |
| 2267 | \\ var h: c_int = @intFromBool((a != 0) or (b != 0)); | |
| 2268 | \\ _ = &h; | |
| 2269 | \\ var i: c_int = @intFromBool((b != 0) or (c != null)); | |
| 2270 | \\ _ = &i; | |
| 2271 | \\ var j: c_int = @intFromBool((a != 0) or (c != null)); | |
| 2272 | \\ _ = &j; | |
| 2273 | \\ var k: c_int = @intFromBool((a != 0) or (@as(c_int, @bitCast(d)) != 0)); | |
| 2274 | \\ _ = &k; | |
| 2275 | \\ var l: c_int = @intFromBool((@as(c_int, @bitCast(d)) != 0) and (b != 0)); | |
| 2276 | \\ _ = &l; | |
| 2277 | \\ var m: c_int = @intFromBool((c != null) or (d != 0)); | |
| 2278 | \\ _ = &m; | |
| 2279 | \\ var td: SomeTypedef = 44; | |
| 2280 | \\ _ = &td; | |
| 2281 | \\ var o: c_int = @intFromBool((td != 0) or (b != 0)); | |
| 2282 | \\ _ = &o; | |
| 2283 | \\ var p: c_int = @intFromBool((c != null) and (td != 0)); | |
| 2284 | \\ _ = &p; | |
| 2285 | \\ return (((((((((e + f) + g) + h) + i) + j) + k) + l) + m) + o) + p; | |
| 2286 | \\} | |
| 2287 | , | |
| 2288 | \\pub const Foo = enum_Foo; | |
| 2289 | }); | |
| 2290 | ||
| 2291 | cases.add("bitwise binary operators, simpler parens", | |
| 2292 | \\int max(int a, int b) { | |
| 2293 | \\ return (a & b) ^ (a | b); | |
| 2294 | \\} | |
| 2295 | , &[_][]const u8{ | |
| 2296 | \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { | |
| 2297 | \\ var a = arg_a; | |
| 2298 | \\ _ = &a; | |
| 2299 | \\ var b = arg_b; | |
| 2300 | \\ _ = &b; | |
| 2301 | \\ return (a & b) ^ (a | b); | |
| 2302 | \\} | |
| 2303 | }); | |
| 2304 | ||
| 2305 | cases.add("comparison operators (no if)", // TODO Come up with less contrived tests? Make sure to cover all these comparisons. | |
| 2306 | \\int test_comparisons(int a, int b) { | |
| 2307 | \\ int c = (a < b); | |
| 2308 | \\ int d = (a > b); | |
| 2309 | \\ int e = (a <= b); | |
| 2310 | \\ int f = (a >= b); | |
| 2311 | \\ int g = (c < d); | |
| 2312 | \\ int h = (e < f); | |
| 2313 | \\ int i = (g < h); | |
| 2314 | \\ return i; | |
| 2315 | \\} | |
| 2316 | , &[_][]const u8{ | |
| 2317 | \\pub export fn test_comparisons(arg_a: c_int, arg_b: c_int) c_int { | |
| 2318 | \\ var a = arg_a; | |
| 2319 | \\ _ = &a; | |
| 2320 | \\ var b = arg_b; | |
| 2321 | \\ _ = &b; | |
| 2322 | \\ var c: c_int = @intFromBool(a < b); | |
| 2323 | \\ _ = &c; | |
| 2324 | \\ var d: c_int = @intFromBool(a > b); | |
| 2325 | \\ _ = &d; | |
| 2326 | \\ var e: c_int = @intFromBool(a <= b); | |
| 2327 | \\ _ = &e; | |
| 2328 | \\ var f: c_int = @intFromBool(a >= b); | |
| 2329 | \\ _ = &f; | |
| 2330 | \\ var g: c_int = @intFromBool(c < d); | |
| 2331 | \\ _ = &g; | |
| 2332 | \\ var h: c_int = @intFromBool(e < f); | |
| 2333 | \\ _ = &h; | |
| 2334 | \\ var i: c_int = @intFromBool(g < h); | |
| 2335 | \\ _ = &i; | |
| 2336 | \\ return i; | |
| 2337 | \\} | |
| 2338 | }); | |
| 2339 | ||
| 2340 | cases.add("==, !=", | |
| 2341 | \\int max(int a, int b) { | |
| 2342 | \\ if (a == b) | |
| 2343 | \\ return a; | |
| 2344 | \\ if (a != b) | |
| 2345 | \\ return b; | |
| 2346 | \\ return a; | |
| 2347 | \\} | |
| 2348 | , &[_][]const u8{ | |
| 2349 | \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { | |
| 2350 | \\ var a = arg_a; | |
| 2351 | \\ _ = &a; | |
| 2352 | \\ var b = arg_b; | |
| 2353 | \\ _ = &b; | |
| 2354 | \\ if (a == b) return a; | |
| 2355 | \\ if (a != b) return b; | |
| 2356 | \\ return a; | |
| 2357 | \\} | |
| 2358 | }); | |
| 2359 | ||
| 2360 | cases.add("typedeffed bool expression", | |
| 2361 | \\typedef char* yes; | |
| 2362 | \\void foo(void) { | |
| 2363 | \\ yes a; | |
| 2364 | \\ if (a) 2; | |
| 2365 | \\} | |
| 2366 | , &[_][]const u8{ | |
| 2367 | \\pub const yes = [*c]u8; | |
| 2368 | \\pub export fn foo() void { | |
| 2369 | \\ var a: yes = undefined; | |
| 2370 | \\ _ = &a; | |
| 2371 | \\ if (a != null) { | |
| 2372 | \\ _ = @as(c_int, 2); | |
| 2373 | \\ } | |
| 2374 | \\} | |
| 2375 | }); | |
| 2376 | ||
| 2377 | cases.add("statement expression", | |
| 2378 | \\int foo(void) { | |
| 2379 | \\ return ({ | |
| 2380 | \\ int a = 1; | |
| 2381 | \\ a; | |
| 2382 | \\ a; | |
| 2383 | \\ }); | |
| 2384 | \\} | |
| 2385 | , &[_][]const u8{ | |
| 2386 | \\pub export fn foo() c_int { | |
| 2387 | \\ return blk: { | |
| 2388 | \\ var a: c_int = 1; | |
| 2389 | \\ _ = &a; | |
| 2390 | \\ _ = &a; | |
| 2391 | \\ break :blk a; | |
| 2392 | \\ }; | |
| 2393 | \\} | |
| 2394 | }); | |
| 2395 | ||
| 2396 | cases.add("field access expression", | |
| 2397 | \\#define ARROW a->b | |
| 2398 | \\#define DOT a.b | |
| 2399 | \\extern struct Foo { | |
| 2400 | \\ int b; | |
| 2401 | \\}a; | |
| 2402 | \\float b = 2.0f; | |
| 2403 | \\void foo(void) { | |
| 2404 | \\ struct Foo *c; | |
| 2405 | \\ a.b; | |
| 2406 | \\ c->b; | |
| 2407 | \\} | |
| 2408 | , &[_][]const u8{ | |
| 2409 | \\pub const struct_Foo = extern struct { | |
| 2410 | \\ b: c_int = @import("std").mem.zeroes(c_int), | |
| 2411 | \\}; | |
| 2412 | \\pub extern var a: struct_Foo; | |
| 2413 | \\pub export var b: f32 = 2.0; | |
| 2414 | \\pub export fn foo() void { | |
| 2415 | \\ var c: [*c]struct_Foo = undefined; | |
| 2416 | \\ _ = &c; | |
| 2417 | \\ _ = a.b; | |
| 2418 | \\ _ = c.*.b; | |
| 2419 | \\} | |
| 2420 | , | |
| 2421 | \\pub inline fn ARROW() @TypeOf(a.*.b) { | |
| 2422 | \\ return a.*.b; | |
| 2423 | \\} | |
| 2424 | , | |
| 2425 | \\pub inline fn DOT() @TypeOf(a.b) { | |
| 2426 | \\ return a.b; | |
| 2427 | \\} | |
| 2428 | }); | |
| 2429 | ||
| 2430 | cases.add("array access", | |
| 2431 | \\#define ACCESS array[2] | |
| 2432 | \\int array[100] = {}; | |
| 2433 | \\int foo(int index) { | |
| 2434 | \\ return array[index]; | |
| 2435 | \\} | |
| 2436 | , &[_][]const u8{ | |
| 2437 | \\pub export var array: [100]c_int = [1]c_int{0} ** 100; | |
| 2438 | \\pub export fn foo(arg_index: c_int) c_int { | |
| 2439 | \\ var index = arg_index; | |
| 2440 | \\ _ = &index; | |
| 2441 | \\ return array[@as(c_uint, @intCast(index))]; | |
| 2442 | \\} | |
| 2443 | , | |
| 2444 | \\pub inline fn ACCESS() @TypeOf(array[@as(usize, @intCast(@as(c_int, 2)))]) { | |
| 2445 | \\ return array[@as(usize, @intCast(@as(c_int, 2)))]; | |
| 2446 | \\} | |
| 2447 | }); | |
| 2448 | ||
| 2449 | cases.add("cast signed array index to unsigned", | |
| 2450 | \\void foo() { | |
| 2451 | \\ int a[10], i = 0; | |
| 2452 | \\ a[i] = 0; | |
| 2453 | \\} | |
| 2454 | , &[_][]const u8{ | |
| 2455 | \\pub export fn foo() void { | |
| 2456 | \\ var a: [10]c_int = undefined; | |
| 2457 | \\ _ = &a; | |
| 2458 | \\ var i: c_int = 0; | |
| 2459 | \\ _ = &i; | |
| 2460 | \\ a[@as(c_uint, @intCast(i))] = 0; | |
| 2461 | \\} | |
| 2462 | }); | |
| 2463 | ||
| 2464 | cases.add("long long array index cast to usize", | |
| 2465 | \\void foo() { | |
| 2466 | \\ long long a[10], i = 0; | |
| 2467 | \\ a[i] = 0; | |
| 2468 | \\} | |
| 2469 | , &[_][]const u8{ | |
| 2470 | \\pub export fn foo() void { | |
| 2471 | \\ var a: [10]c_longlong = undefined; | |
| 2472 | \\ _ = &a; | |
| 2473 | \\ var i: c_longlong = 0; | |
| 2474 | \\ _ = &i; | |
| 2475 | \\ a[@as(usize, @intCast(i))] = 0; | |
| 2476 | \\} | |
| 2477 | }); | |
| 2478 | ||
| 2479 | cases.add("unsigned array index skips cast", | |
| 2480 | \\void foo() { | |
| 2481 | \\ unsigned int a[10], i = 0; | |
| 2482 | \\ a[i] = 0; | |
| 2483 | \\} | |
| 2484 | , &[_][]const u8{ | |
| 2485 | \\pub export fn foo() void { | |
| 2486 | \\ var a: [10]c_uint = undefined; | |
| 2487 | \\ _ = &a; | |
| 2488 | \\ var i: c_uint = 0; | |
| 2489 | \\ _ = &i; | |
| 2490 | \\ a[i] = 0; | |
| 2491 | \\} | |
| 2492 | }); | |
| 2493 | ||
| 2494 | cases.add("macro call", | |
| 2495 | \\#define CALL(arg) bar(arg) | |
| 2496 | \\int bar(int x) { return x; } | |
| 2497 | , &[_][]const u8{ | |
| 2498 | \\pub inline fn CALL(arg: anytype) @TypeOf(bar(arg)) { | |
| 2499 | \\ _ = &arg; | |
| 2500 | \\ return bar(arg); | |
| 2501 | \\} | |
| 2502 | }); | |
| 2503 | ||
| 2504 | cases.add("macro call with no args", | |
| 2505 | \\#define CALL(arg) bar() | |
| 2506 | \\int bar(void) { return 0; } | |
| 2507 | , &[_][]const u8{ | |
| 2508 | \\pub inline fn CALL(arg: anytype) @TypeOf(bar()) { | |
| 2509 | \\ _ = &arg; | |
| 2510 | \\ return bar(); | |
| 2511 | \\} | |
| 2512 | }); | |
| 2513 | ||
| 2514 | cases.add("logical and, logical or", | |
| 2515 | \\int max(int a, int b) { | |
| 2516 | \\ if (a < b || a == b) | |
| 2517 | \\ return b; | |
| 2518 | \\ if (a >= b && a == b) | |
| 2519 | \\ return a; | |
| 2520 | \\ return a; | |
| 2521 | \\} | |
| 2522 | , &[_][]const u8{ | |
| 2523 | \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { | |
| 2524 | \\ var a = arg_a; | |
| 2525 | \\ _ = &a; | |
| 2526 | \\ var b = arg_b; | |
| 2527 | \\ _ = &b; | |
| 2528 | \\ if ((a < b) or (a == b)) return b; | |
| 2529 | \\ if ((a >= b) and (a == b)) return a; | |
| 2530 | \\ return a; | |
| 2531 | \\} | |
| 2532 | }); | |
| 2533 | ||
| 2534 | cases.add("simple if statement", | |
| 2535 | \\int max(int a, int b) { | |
| 2536 | \\ if (a < b) | |
| 2537 | \\ return b; | |
| 2538 | \\ | |
| 2539 | \\ if (a < b) | |
| 2540 | \\ return b; | |
| 2541 | \\ else | |
| 2542 | \\ return a; | |
| 2543 | \\ | |
| 2544 | \\ if (a < b) ; else ; | |
| 2545 | \\} | |
| 2546 | , &[_][]const u8{ | |
| 2547 | \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { | |
| 2548 | \\ var a = arg_a; | |
| 2549 | \\ _ = &a; | |
| 2550 | \\ var b = arg_b; | |
| 2551 | \\ _ = &b; | |
| 2552 | \\ if (a < b) return b; | |
| 2553 | \\ if (a < b) return b else return a; | |
| 2554 | \\ if (a < b) {} else {} | |
| 2555 | \\ return 0; | |
| 2556 | \\} | |
| 2557 | }); | |
| 2558 | ||
| 2559 | cases.add("if statements", | |
| 2560 | \\void foo() { | |
| 2561 | \\ if (2) { | |
| 2562 | \\ int a = 2; | |
| 2563 | \\ } | |
| 2564 | \\ if (2, 5) { | |
| 2565 | \\ int a = 2; | |
| 2566 | \\ } | |
| 2567 | \\} | |
| 2568 | , &[_][]const u8{ | |
| 2569 | \\pub export fn foo() void { | |
| 2570 | \\ if (true) { | |
| 2571 | \\ var a: c_int = 2; | |
| 2572 | \\ _ = &a; | |
| 2573 | \\ } | |
| 2574 | \\ if ((blk: { | |
| 2575 | \\ _ = @as(c_int, 2); | |
| 2576 | \\ break :blk @as(c_int, 5); | |
| 2577 | \\ }) != 0) { | |
| 2578 | \\ var a: c_int = 2; | |
| 2579 | \\ _ = &a; | |
| 2580 | \\ } | |
| 2581 | \\} | |
| 2582 | }); | |
| 2583 | ||
| 2584 | cases.add("if on non-bool", | |
| 2585 | \\enum SomeEnum { A, B, C }; | |
| 2586 | \\int if_none_bool(int a, float b, void *c, enum SomeEnum d) { | |
| 2587 | \\ if (a) return 0; | |
| 2588 | \\ if (b) return 1; | |
| 2589 | \\ if (c) return 2; | |
| 2590 | \\ if (d) return 3; | |
| 2591 | \\ return 4; | |
| 2592 | \\} | |
| 2593 | , &[_][]const u8{ | |
| 2594 | \\pub const A: c_int = 0; | |
| 2595 | \\pub const B: c_int = 1; | |
| 2596 | \\pub const C: c_int = 2; | |
| 2597 | \\pub const enum_SomeEnum = | |
| 2598 | ++ " " ++ default_enum_type ++ | |
| 2599 | \\; | |
| 2600 | \\pub export fn if_none_bool(arg_a: c_int, arg_b: f32, arg_c: ?*anyopaque, arg_d: enum_SomeEnum) c_int { | |
| 2601 | \\ var a = arg_a; | |
| 2602 | \\ _ = &a; | |
| 2603 | \\ var b = arg_b; | |
| 2604 | \\ _ = &b; | |
| 2605 | \\ var c = arg_c; | |
| 2606 | \\ _ = &c; | |
| 2607 | \\ var d = arg_d; | |
| 2608 | \\ _ = &d; | |
| 2609 | \\ if (a != 0) return 0; | |
| 2610 | \\ if (b != 0) return 1; | |
| 2611 | \\ if (c != null) return 2; | |
| 2612 | \\ if (d != 0) return 3; | |
| 2613 | \\ return 4; | |
| 2614 | \\} | |
| 2615 | }); | |
| 2616 | ||
| 2617 | cases.add("simple data types", | |
| 2618 | \\#include <stdint.h> | |
| 2619 | \\int foo(char a, unsigned char b, signed char c); | |
| 2620 | \\int foo(char a, unsigned char b, signed char c); // test a duplicate prototype | |
| 2621 | \\void bar(uint8_t a, uint16_t b, uint32_t c, uint64_t d); | |
| 2622 | \\void baz(int8_t a, int16_t b, int32_t c, int64_t d); | |
| 2623 | , &[_][]const u8{ | |
| 2624 | \\pub extern fn foo(a: u8, b: u8, c: i8) c_int; | |
| 2625 | \\pub extern fn bar(a: u8, b: u16, c: u32, d: u64) void; | |
| 2626 | \\pub extern fn baz(a: i8, b: i16, c: i32, d: i64) void; | |
| 2627 | }); | |
| 2628 | ||
| 2629 | cases.add("simple function", | |
| 2630 | \\int abs(int a) { | |
| 2631 | \\ return a < 0 ? -a : a; | |
| 2632 | \\} | |
| 2633 | , &[_][]const u8{ | |
| 2634 | \\pub export fn abs(arg_a: c_int) c_int { | |
| 2635 | \\ var a = arg_a; | |
| 2636 | \\ _ = &a; | |
| 2637 | \\ return if (a < @as(c_int, 0)) -a else a; | |
| 2638 | \\} | |
| 2639 | }); | |
| 2640 | ||
| 2641 | cases.add("post increment", | |
| 2642 | \\unsigned foo1(unsigned a) { | |
| 2643 | \\ a++; | |
| 2644 | \\ return a; | |
| 2645 | \\} | |
| 2646 | \\int foo2(int a) { | |
| 2647 | \\ a++; | |
| 2648 | \\ return a; | |
| 2649 | \\} | |
| 2650 | \\int *foo3(int *a) { | |
| 2651 | \\ a++; | |
| 2652 | \\ return a; | |
| 2653 | \\} | |
| 2654 | , &[_][]const u8{ | |
| 2655 | \\pub export fn foo1(arg_a: c_uint) c_uint { | |
| 2656 | \\ var a = arg_a; | |
| 2657 | \\ _ = &a; | |
| 2658 | \\ a +%= 1; | |
| 2659 | \\ return a; | |
| 2660 | \\} | |
| 2661 | \\pub export fn foo2(arg_a: c_int) c_int { | |
| 2662 | \\ var a = arg_a; | |
| 2663 | \\ _ = &a; | |
| 2664 | \\ a += 1; | |
| 2665 | \\ return a; | |
| 2666 | \\} | |
| 2667 | \\pub export fn foo3(arg_a: [*c]c_int) [*c]c_int { | |
| 2668 | \\ var a = arg_a; | |
| 2669 | \\ _ = &a; | |
| 2670 | \\ a += 1; | |
| 2671 | \\ return a; | |
| 2672 | \\} | |
| 2673 | }); | |
| 2674 | ||
| 2675 | cases.add("deref function pointer", | |
| 2676 | \\void foo(void) {} | |
| 2677 | \\int baz(void) { return 0; } | |
| 2678 | \\void bar(void) { | |
| 2679 | \\ void(*f)(void) = foo; | |
| 2680 | \\ int(*b)(void) = baz; | |
| 2681 | \\ f(); | |
| 2682 | \\ (*(f))(); | |
| 2683 | \\ foo(); | |
| 2684 | \\ b(); | |
| 2685 | \\ (*(b))(); | |
| 2686 | \\ baz(); | |
| 2687 | \\} | |
| 2688 | , &[_][]const u8{ | |
| 2689 | \\pub export fn foo() void {} | |
| 2690 | \\pub export fn baz() c_int { | |
| 2691 | \\ return 0; | |
| 2692 | \\} | |
| 2693 | \\pub export fn bar() void { | |
| 2694 | \\ var f: ?*const fn () callconv(.c) void = &foo; | |
| 2695 | \\ _ = &f; | |
| 2696 | \\ var b: ?*const fn () callconv(.c) c_int = &baz; | |
| 2697 | \\ _ = &b; | |
| 2698 | \\ f.?(); | |
| 2699 | \\ f.?(); | |
| 2700 | \\ foo(); | |
| 2701 | \\ _ = b.?(); | |
| 2702 | \\ _ = b.?(); | |
| 2703 | \\ _ = baz(); | |
| 2704 | \\} | |
| 2705 | }); | |
| 2706 | ||
| 2707 | cases.add("pre increment/decrement", | |
| 2708 | \\void foo(void) { | |
| 2709 | \\ int i = 0; | |
| 2710 | \\ unsigned u = 0; | |
| 2711 | \\ ++i; | |
| 2712 | \\ --i; | |
| 2713 | \\ ++u; | |
| 2714 | \\ --u; | |
| 2715 | \\ i = ++i; | |
| 2716 | \\ i = --i; | |
| 2717 | \\ u = ++u; | |
| 2718 | \\ u = --u; | |
| 2719 | \\} | |
| 2720 | , &[_][]const u8{ | |
| 2721 | \\pub export fn foo() void { | |
| 2722 | \\ var i: c_int = 0; | |
| 2723 | \\ _ = &i; | |
| 2724 | \\ var u: c_uint = 0; | |
| 2725 | \\ _ = &u; | |
| 2726 | \\ i += 1; | |
| 2727 | \\ i -= 1; | |
| 2728 | \\ u +%= 1; | |
| 2729 | \\ u -%= 1; | |
| 2730 | \\ i = blk: { | |
| 2731 | \\ const ref = &i; | |
| 2732 | \\ ref.* += 1; | |
| 2733 | \\ break :blk ref.*; | |
| 2734 | \\ }; | |
| 2735 | \\ i = blk: { | |
| 2736 | \\ const ref = &i; | |
| 2737 | \\ ref.* -= 1; | |
| 2738 | \\ break :blk ref.*; | |
| 2739 | \\ }; | |
| 2740 | \\ u = blk: { | |
| 2741 | \\ const ref = &u; | |
| 2742 | \\ ref.* +%= 1; | |
| 2743 | \\ break :blk ref.*; | |
| 2744 | \\ }; | |
| 2745 | \\ u = blk: { | |
| 2746 | \\ const ref = &u; | |
| 2747 | \\ ref.* -%= 1; | |
| 2748 | \\ break :blk ref.*; | |
| 2749 | \\ }; | |
| 2750 | \\} | |
| 2751 | }); | |
| 2752 | ||
| 2753 | cases.add("shift right assign", | |
| 2754 | \\int log2(unsigned a) { | |
| 2755 | \\ int i = 0; | |
| 2756 | \\ while (a > 0) { | |
| 2757 | \\ a >>= 1; | |
| 2758 | \\ } | |
| 2759 | \\ return i; | |
| 2760 | \\} | |
| 2761 | , &[_][]const u8{ | |
| 2762 | \\pub export fn log2(arg_a: c_uint) c_int { | |
| 2763 | \\ var a = arg_a; | |
| 2764 | \\ _ = &a; | |
| 2765 | \\ var i: c_int = 0; | |
| 2766 | \\ _ = &i; | |
| 2767 | \\ while (a > @as(c_uint, @bitCast(@as(c_int, 0)))) { | |
| 2768 | \\ a >>= @intCast(@as(c_int, 1)); | |
| 2769 | \\ } | |
| 2770 | \\ return i; | |
| 2771 | \\} | |
| 2772 | }); | |
| 2773 | ||
| 2774 | cases.add("shift right assign with a fixed size type", | |
| 2775 | \\#include <stdint.h> | |
| 2776 | \\int log2(uint32_t a) { | |
| 2777 | \\ int i = 0; | |
| 2778 | \\ while (a > 0) { | |
| 2779 | \\ a >>= 1; | |
| 2780 | \\ } | |
| 2781 | \\ return i; | |
| 2782 | \\} | |
| 2783 | , &[_][]const u8{ | |
| 2784 | \\pub export fn log2(arg_a: u32) c_int { | |
| 2785 | \\ var a = arg_a; | |
| 2786 | \\ _ = &a; | |
| 2787 | \\ var i: c_int = 0; | |
| 2788 | \\ _ = &i; | |
| 2789 | \\ while (a > @as(u32, @bitCast(@as(c_int, 0)))) { | |
| 2790 | \\ a >>= @intCast(@as(c_int, 1)); | |
| 2791 | \\ } | |
| 2792 | \\ return i; | |
| 2793 | \\} | |
| 2794 | }); | |
| 2795 | ||
| 2796 | cases.add("compound assignment operators", | |
| 2797 | \\void foo(void) { | |
| 2798 | \\ int a = 0; | |
| 2799 | \\ unsigned b = 0; | |
| 2800 | \\ a += (a += 1); | |
| 2801 | \\ a -= (a -= 1); | |
| 2802 | \\ a *= (a *= 1); | |
| 2803 | \\ a &= (a &= 1); | |
| 2804 | \\ a |= (a |= 1); | |
| 2805 | \\ a ^= (a ^= 1); | |
| 2806 | \\ a >>= (a >>= 1); | |
| 2807 | \\ a <<= (a <<= 1); | |
| 2808 | \\ a /= (a /= 1); | |
| 2809 | \\ a %= (a %= 1); | |
| 2810 | \\ b /= (b /= 1); | |
| 2811 | \\ b %= (b %= 1); | |
| 2812 | \\} | |
| 2813 | , &[_][]const u8{ | |
| 2814 | \\pub export fn foo() void { | |
| 2815 | \\ var a: c_int = 0; | |
| 2816 | \\ _ = &a; | |
| 2817 | \\ var b: c_uint = 0; | |
| 2818 | \\ _ = &b; | |
| 2819 | \\ a += blk: { | |
| 2820 | \\ const ref = &a; | |
| 2821 | \\ ref.* += @as(c_int, 1); | |
| 2822 | \\ break :blk ref.*; | |
| 2823 | \\ }; | |
| 2824 | \\ a -= blk: { | |
| 2825 | \\ const ref = &a; | |
| 2826 | \\ ref.* -= @as(c_int, 1); | |
| 2827 | \\ break :blk ref.*; | |
| 2828 | \\ }; | |
| 2829 | \\ a *= blk: { | |
| 2830 | \\ const ref = &a; | |
| 2831 | \\ ref.* *= @as(c_int, 1); | |
| 2832 | \\ break :blk ref.*; | |
| 2833 | \\ }; | |
| 2834 | \\ a &= blk: { | |
| 2835 | \\ const ref = &a; | |
| 2836 | \\ ref.* &= @as(c_int, 1); | |
| 2837 | \\ break :blk ref.*; | |
| 2838 | \\ }; | |
| 2839 | \\ a |= blk: { | |
| 2840 | \\ const ref = &a; | |
| 2841 | \\ ref.* |= @as(c_int, 1); | |
| 2842 | \\ break :blk ref.*; | |
| 2843 | \\ }; | |
| 2844 | \\ a ^= blk: { | |
| 2845 | \\ const ref = &a; | |
| 2846 | \\ ref.* ^= @as(c_int, 1); | |
| 2847 | \\ break :blk ref.*; | |
| 2848 | \\ }; | |
| 2849 | \\ a >>= @intCast(blk: { | |
| 2850 | \\ const ref = &a; | |
| 2851 | \\ ref.* >>= @intCast(@as(c_int, 1)); | |
| 2852 | \\ break :blk ref.*; | |
| 2853 | \\ }); | |
| 2854 | \\ a <<= @intCast(blk: { | |
| 2855 | \\ const ref = &a; | |
| 2856 | \\ ref.* <<= @intCast(@as(c_int, 1)); | |
| 2857 | \\ break :blk ref.*; | |
| 2858 | \\ }); | |
| 2859 | \\ a = @divTrunc(a, blk: { | |
| 2860 | \\ const ref = &a; | |
| 2861 | \\ ref.* = @divTrunc(ref.*, @as(c_int, 1)); | |
| 2862 | \\ break :blk ref.*; | |
| 2863 | \\ }); | |
| 2864 | \\ a = @import("std").zig.c_translation.signedRemainder(a, blk: { | |
| 2865 | \\ const ref = &a; | |
| 2866 | \\ ref.* = @import("std").zig.c_translation.signedRemainder(ref.*, @as(c_int, 1)); | |
| 2867 | \\ break :blk ref.*; | |
| 2868 | \\ }); | |
| 2869 | \\ b /= blk: { | |
| 2870 | \\ const ref = &b; | |
| 2871 | \\ ref.* /= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2872 | \\ break :blk ref.*; | |
| 2873 | \\ }; | |
| 2874 | \\ b %= blk: { | |
| 2875 | \\ const ref = &b; | |
| 2876 | \\ ref.* %= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2877 | \\ break :blk ref.*; | |
| 2878 | \\ }; | |
| 2879 | \\} | |
| 2880 | }); | |
| 2881 | ||
| 2882 | cases.add("compound assignment operators unsigned", | |
| 2883 | \\void foo(void) { | |
| 2884 | \\ unsigned a = 0; | |
| 2885 | \\ a += (a += 1); | |
| 2886 | \\ a -= (a -= 1); | |
| 2887 | \\ a *= (a *= 1); | |
| 2888 | \\ a &= (a &= 1); | |
| 2889 | \\ a |= (a |= 1); | |
| 2890 | \\ a ^= (a ^= 1); | |
| 2891 | \\ a >>= (a >>= 1); | |
| 2892 | \\ a <<= (a <<= 1); | |
| 2893 | \\} | |
| 2894 | , &[_][]const u8{ | |
| 2895 | \\pub export fn foo() void { | |
| 2896 | \\ var a: c_uint = 0; | |
| 2897 | \\ _ = &a; | |
| 2898 | \\ a +%= blk: { | |
| 2899 | \\ const ref = &a; | |
| 2900 | \\ ref.* +%= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2901 | \\ break :blk ref.*; | |
| 2902 | \\ }; | |
| 2903 | \\ a -%= blk: { | |
| 2904 | \\ const ref = &a; | |
| 2905 | \\ ref.* -%= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2906 | \\ break :blk ref.*; | |
| 2907 | \\ }; | |
| 2908 | \\ a *%= blk: { | |
| 2909 | \\ const ref = &a; | |
| 2910 | \\ ref.* *%= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2911 | \\ break :blk ref.*; | |
| 2912 | \\ }; | |
| 2913 | \\ a &= blk: { | |
| 2914 | \\ const ref = &a; | |
| 2915 | \\ ref.* &= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2916 | \\ break :blk ref.*; | |
| 2917 | \\ }; | |
| 2918 | \\ a |= blk: { | |
| 2919 | \\ const ref = &a; | |
| 2920 | \\ ref.* |= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2921 | \\ break :blk ref.*; | |
| 2922 | \\ }; | |
| 2923 | \\ a ^= blk: { | |
| 2924 | \\ const ref = &a; | |
| 2925 | \\ ref.* ^= @as(c_uint, @bitCast(@as(c_int, 1))); | |
| 2926 | \\ break :blk ref.*; | |
| 2927 | \\ }; | |
| 2928 | \\ a >>= @intCast(blk: { | |
| 2929 | \\ const ref = &a; | |
| 2930 | \\ ref.* >>= @intCast(@as(c_int, 1)); | |
| 2931 | \\ break :blk ref.*; | |
| 2932 | \\ }); | |
| 2933 | \\ a <<= @intCast(blk: { | |
| 2934 | \\ const ref = &a; | |
| 2935 | \\ ref.* <<= @intCast(@as(c_int, 1)); | |
| 2936 | \\ break :blk ref.*; | |
| 2937 | \\ }); | |
| 2938 | \\} | |
| 2939 | }); | |
| 2940 | ||
| 2941 | cases.add("post increment/decrement", | |
| 2942 | \\void foo(void) { | |
| 2943 | \\ int i = 0; | |
| 2944 | \\ unsigned u = 0; | |
| 2945 | \\ i++; | |
| 2946 | \\ i--; | |
| 2947 | \\ u++; | |
| 2948 | \\ u--; | |
| 2949 | \\ i = i++; | |
| 2950 | \\ i = i--; | |
| 2951 | \\ u = u++; | |
| 2952 | \\ u = u--; | |
| 2953 | \\} | |
| 2954 | , &[_][]const u8{ | |
| 2955 | \\pub export fn foo() void { | |
| 2956 | \\ var i: c_int = 0; | |
| 2957 | \\ _ = &i; | |
| 2958 | \\ var u: c_uint = 0; | |
| 2959 | \\ _ = &u; | |
| 2960 | \\ i += 1; | |
| 2961 | \\ i -= 1; | |
| 2962 | \\ u +%= 1; | |
| 2963 | \\ u -%= 1; | |
| 2964 | \\ i = blk: { | |
| 2965 | \\ const ref = &i; | |
| 2966 | \\ const tmp = ref.*; | |
| 2967 | \\ ref.* += 1; | |
| 2968 | \\ break :blk tmp; | |
| 2969 | \\ }; | |
| 2970 | \\ i = blk: { | |
| 2971 | \\ const ref = &i; | |
| 2972 | \\ const tmp = ref.*; | |
| 2973 | \\ ref.* -= 1; | |
| 2974 | \\ break :blk tmp; | |
| 2975 | \\ }; | |
| 2976 | \\ u = blk: { | |
| 2977 | \\ const ref = &u; | |
| 2978 | \\ const tmp = ref.*; | |
| 2979 | \\ ref.* +%= 1; | |
| 2980 | \\ break :blk tmp; | |
| 2981 | \\ }; | |
| 2982 | \\ u = blk: { | |
| 2983 | \\ const ref = &u; | |
| 2984 | \\ const tmp = ref.*; | |
| 2985 | \\ ref.* -%= 1; | |
| 2986 | \\ break :blk tmp; | |
| 2987 | \\ }; | |
| 2988 | \\} | |
| 2989 | }); | |
| 2990 | ||
| 2991 | cases.add("implicit casts", | |
| 2992 | \\#include <stdbool.h> | |
| 2993 | \\ | |
| 2994 | \\void fn_int(int x); | |
| 2995 | \\void fn_f32(float x); | |
| 2996 | \\void fn_f64(double x); | |
| 2997 | \\void fn_char(char x); | |
| 2998 | \\void fn_bool(bool x); | |
| 2999 | \\void fn_ptr(void *x); | |
| 3000 | \\ | |
| 3001 | \\void call() { | |
| 3002 | \\ fn_int(3.0f); | |
| 3003 | \\ fn_int(3.0); | |
| 3004 | \\ fn_int('ABCD'); | |
| 3005 | \\ fn_f32(3); | |
| 3006 | \\ fn_f64(3); | |
| 3007 | \\ fn_char('3'); | |
| 3008 | \\ fn_char('\x1'); | |
| 3009 | \\ fn_char(0); | |
| 3010 | \\ fn_f32(3.0f); | |
| 3011 | \\ fn_f64(3.0); | |
| 3012 | \\ fn_bool(123); | |
| 3013 | \\ fn_bool(0); | |
| 3014 | \\ fn_bool(&fn_int); | |
| 3015 | \\ fn_int((int)&fn_int); | |
| 3016 | \\ fn_ptr((void *)42); | |
| 3017 | \\} | |
| 3018 | , &[_][]const u8{ | |
| 3019 | \\pub extern fn fn_int(x: c_int) void; | |
| 3020 | \\pub extern fn fn_f32(x: f32) void; | |
| 3021 | \\pub extern fn fn_f64(x: f64) void; | |
| 3022 | \\pub extern fn fn_char(x: u8) void; | |
| 3023 | \\pub extern fn fn_bool(x: bool) void; | |
| 3024 | \\pub extern fn fn_ptr(x: ?*anyopaque) void; | |
| 3025 | \\pub export fn call() void { | |
| 3026 | \\ fn_int(@as(c_int, @intFromFloat(3.0))); | |
| 3027 | \\ fn_int(@as(c_int, @intFromFloat(3.0))); | |
| 3028 | \\ fn_int(@as(c_int, 1094861636)); | |
| 3029 | \\ fn_f32(@as(f32, @floatFromInt(@as(c_int, 3)))); | |
| 3030 | \\ fn_f64(@as(f64, @floatFromInt(@as(c_int, 3)))); | |
| 3031 | \\ fn_char(@as(u8, @bitCast(@as(i8, @truncate(@as(c_int, '3')))))); | |
| 3032 | \\ fn_char(@as(u8, @bitCast(@as(i8, @truncate(@as(c_int, '\x01')))))); | |
| 3033 | \\ fn_char(@as(u8, @bitCast(@as(i8, @truncate(@as(c_int, 0)))))); | |
| 3034 | \\ fn_f32(3.0); | |
| 3035 | \\ fn_f64(3.0); | |
| 3036 | \\ fn_bool(@as(c_int, 123) != 0); | |
| 3037 | \\ fn_bool(@as(c_int, 0) != 0); | |
| 3038 | \\ fn_bool(@intFromPtr(&fn_int) != 0); | |
| 3039 | \\ fn_int(@as(c_int, @intCast(@intFromPtr(&fn_int)))); | |
| 3040 | \\ fn_ptr(@as(?*anyopaque, @ptrFromInt(@as(c_int, 42)))); | |
| 3041 | \\} | |
| 3042 | }); | |
| 3043 | ||
| 3044 | cases.add("function call", | |
| 3045 | \\static void bar(void) { } | |
| 3046 | \\void foo(int *(baz)(void)) { | |
| 3047 | \\ bar(); | |
| 3048 | \\ baz(); | |
| 3049 | \\} | |
| 3050 | , &[_][]const u8{ | |
| 3051 | \\pub fn bar() callconv(.c) void {} | |
| 3052 | \\pub export fn foo(arg_baz: ?*const fn () callconv(.c) [*c]c_int) void { | |
| 3053 | \\ var baz = arg_baz; | |
| 3054 | \\ _ = &baz; | |
| 3055 | \\ bar(); | |
| 3056 | \\ _ = baz.?(); | |
| 3057 | \\} | |
| 3058 | }); | |
| 3059 | ||
| 3060 | cases.add("macro defines string literal with octal", | |
| 3061 | \\#define FOO "aoeu\023 derp" | |
| 3062 | \\#define FOO2 "aoeu\0234 derp" | |
| 3063 | \\#define FOO_CHAR '\077' | |
| 3064 | , &[_][]const u8{ | |
| 3065 | \\pub const FOO = "aoeu\x13 derp"; | |
| 3066 | , | |
| 3067 | \\pub const FOO2 = "aoeu\x134 derp"; | |
| 3068 | , | |
| 3069 | \\pub const FOO_CHAR = '\x3f'; | |
| 3070 | }); | |
| 3071 | ||
| 3072 | cases.add("macro cast", | |
| 3073 | \\#include <stdint.h> | |
| 3074 | \\int baz(void *arg) { return 0; } | |
| 3075 | \\#define FOO(bar) baz((void *)(baz)) | |
| 3076 | \\#define BAR (void*) a | |
| 3077 | \\#define BAZ (uint32_t)(2) | |
| 3078 | \\#define a 2 | |
| 3079 | , &[_][]const u8{ | |
| 3080 | \\pub inline fn FOO(bar: anytype) @TypeOf(baz(@import("std").zig.c_translation.cast(?*anyopaque, baz))) { | |
| 3081 | \\ _ = &bar; | |
| 3082 | \\ return baz(@import("std").zig.c_translation.cast(?*anyopaque, baz)); | |
| 3083 | \\} | |
| 3084 | , | |
| 3085 | \\pub const BAR = @import("std").zig.c_translation.cast(?*anyopaque, a); | |
| 3086 | , | |
| 3087 | \\pub const BAZ = @import("std").zig.c_translation.cast(u32, @as(c_int, 2)); | |
| 3088 | }); | |
| 3089 | ||
| 3090 | cases.add("macro with cast to unsigned short, long, and long long", | |
| 3091 | \\#define CURLAUTH_BASIC_BUT_USHORT ((unsigned short) 1) | |
| 3092 | \\#define CURLAUTH_BASIC ((unsigned long) 1) | |
| 3093 | \\#define CURLAUTH_BASIC_BUT_ULONGLONG ((unsigned long long) 1) | |
| 3094 | , &[_][]const u8{ | |
| 3095 | \\pub const CURLAUTH_BASIC_BUT_USHORT = @import("std").zig.c_translation.cast(c_ushort, @as(c_int, 1)); | |
| 3096 | \\pub const CURLAUTH_BASIC = @import("std").zig.c_translation.cast(c_ulong, @as(c_int, 1)); | |
| 3097 | \\pub const CURLAUTH_BASIC_BUT_ULONGLONG = @import("std").zig.c_translation.cast(c_ulonglong, @as(c_int, 1)); | |
| 3098 | }); | |
| 3099 | ||
| 3100 | cases.add("macro conditional operator", | |
| 3101 | \\ int a, b, c; | |
| 3102 | \\#define FOO a ? b : c | |
| 3103 | , &[_][]const u8{ | |
| 3104 | \\pub inline fn FOO() @TypeOf(if (a) b else c) { | |
| 3105 | \\ return if (a) b else c; | |
| 3106 | \\} | |
| 3107 | }); | |
| 3108 | ||
| 3109 | cases.add("do while as expr", | |
| 3110 | \\static void foo(void) { | |
| 3111 | \\ if (1) | |
| 3112 | \\ do {} while (0); | |
| 3113 | \\} | |
| 3114 | , &[_][]const u8{ | |
| 3115 | \\pub fn foo() callconv(.c) void { | |
| 3116 | \\ if (true) while (true) { | |
| 3117 | \\ if (!false) break; | |
| 3118 | \\ }; | |
| 3119 | \\} | |
| 3120 | }); | |
| 3121 | ||
| 3122 | cases.add("macro comparisons", | |
| 3123 | \\#define MIN(a, b) ((b) < (a) ? (b) : (a)) | |
| 3124 | \\#define MAX(a, b) ((b) > (a) ? (b) : (a)) | |
| 3125 | , &[_][]const u8{ | |
| 3126 | \\pub inline fn MIN(a: anytype, b: anytype) @TypeOf(if (b < a) b else a) { | |
| 3127 | \\ _ = &a; | |
| 3128 | \\ _ = &b; | |
| 3129 | \\ return if (b < a) b else a; | |
| 3130 | \\} | |
| 3131 | , | |
| 3132 | \\pub inline fn MAX(a: anytype, b: anytype) @TypeOf(if (b > a) b else a) { | |
| 3133 | \\ _ = &a; | |
| 3134 | \\ _ = &b; | |
| 3135 | \\ return if (b > a) b else a; | |
| 3136 | \\} | |
| 3137 | }); | |
| 3138 | ||
| 3139 | cases.add("nested assignment", | |
| 3140 | \\int foo(int *p, int x) { | |
| 3141 | \\ return *p++ = x; | |
| 3142 | \\} | |
| 3143 | , &[_][]const u8{ | |
| 3144 | \\pub export fn foo(arg_p: [*c]c_int, arg_x: c_int) c_int { | |
| 3145 | \\ var p = arg_p; | |
| 3146 | \\ _ = &p; | |
| 3147 | \\ var x = arg_x; | |
| 3148 | \\ _ = &x; | |
| 3149 | \\ return blk: { | |
| 3150 | \\ const tmp = x; | |
| 3151 | \\ (blk_1: { | |
| 3152 | \\ const ref = &p; | |
| 3153 | \\ const tmp_2 = ref.*; | |
| 3154 | \\ ref.* += 1; | |
| 3155 | \\ break :blk_1 tmp_2; | |
| 3156 | \\ }).* = tmp; | |
| 3157 | \\ break :blk tmp; | |
| 3158 | \\ }; | |
| 3159 | \\} | |
| 3160 | }); | |
| 3161 | ||
| 3162 | cases.add("widening and truncating integer casting to different signedness", | |
| 3163 | \\unsigned long foo(void) { | |
| 3164 | \\ return -1; | |
| 3165 | \\} | |
| 3166 | \\unsigned short bar(long x) { | |
| 3167 | \\ return x; | |
| 3168 | \\} | |
| 3169 | , &[_][]const u8{ | |
| 3170 | \\pub export fn foo() c_ulong { | |
| 3171 | \\ return @as(c_ulong, @bitCast(@as(c_long, -@as(c_int, 1)))); | |
| 3172 | \\} | |
| 3173 | \\pub export fn bar(arg_x: c_long) c_ushort { | |
| 3174 | \\ var x = arg_x; | |
| 3175 | \\ _ = &x; | |
| 3176 | \\ return @as(c_ushort, @bitCast(@as(c_short, @truncate(x)))); | |
| 3177 | \\} | |
| 3178 | }); | |
| 3179 | ||
| 3180 | cases.add("arg name aliasing decl which comes after", | |
| 3181 | \\void foo(int bar) { | |
| 3182 | \\ bar = 2; | |
| 3183 | \\} | |
| 3184 | \\int bar = 4; | |
| 3185 | , &[_][]const u8{ | |
| 3186 | \\pub export fn foo(arg_bar_1: c_int) void { | |
| 3187 | \\ var bar_1 = arg_bar_1; | |
| 3188 | \\ _ = &bar_1; | |
| 3189 | \\ bar_1 = 2; | |
| 3190 | \\} | |
| 3191 | \\pub export var bar: c_int = 4; | |
| 3192 | }); | |
| 3193 | ||
| 3194 | cases.add("arg name aliasing macro which comes after", | |
| 3195 | \\void foo(int bar) { | |
| 3196 | \\ bar = 2; | |
| 3197 | \\} | |
| 3198 | \\#define bar 4 | |
| 3199 | , &[_][]const u8{ | |
| 3200 | \\pub export fn foo(arg_bar_1: c_int) void { | |
| 3201 | \\ var bar_1 = arg_bar_1; | |
| 3202 | \\ _ = &bar_1; | |
| 3203 | \\ bar_1 = 2; | |
| 3204 | \\} | |
| 3205 | , | |
| 3206 | \\pub const bar = @as(c_int, 4); | |
| 3207 | }); | |
| 3208 | ||
| 3209 | cases.add("don't export inline functions", | |
| 3210 | \\inline void a(void) {} | |
| 3211 | \\static void b(void) {} | |
| 3212 | \\void c(void) {} | |
| 3213 | \\static void foo() {} | |
| 3214 | , &[_][]const u8{ | |
| 3215 | \\pub fn a() callconv(.c) void {} | |
| 3216 | \\pub fn b() callconv(.c) void {} | |
| 3217 | \\pub export fn c() void {} | |
| 3218 | \\pub fn foo() callconv(.c) void {} | |
| 3219 | }); | |
| 3220 | ||
| 3221 | cases.add("casting away const and volatile", | |
| 3222 | \\void foo(int *a) {} | |
| 3223 | \\void bar(const int *a) { | |
| 3224 | \\ foo((int *)a); | |
| 3225 | \\} | |
| 3226 | \\void baz(volatile int *a) { | |
| 3227 | \\ foo((int *)a); | |
| 3228 | \\} | |
| 3229 | , &[_][]const u8{ | |
| 3230 | \\pub export fn foo(arg_a: [*c]c_int) void { | |
| 3231 | \\ var a = arg_a; | |
| 3232 | \\ _ = &a; | |
| 3233 | \\} | |
| 3234 | \\pub export fn bar(arg_a: [*c]const c_int) void { | |
| 3235 | \\ var a = arg_a; | |
| 3236 | \\ _ = &a; | |
| 3237 | \\ foo(@as([*c]c_int, @ptrCast(@constCast(@volatileCast(a))))); | |
| 3238 | \\} | |
| 3239 | \\pub export fn baz(arg_a: [*c]volatile c_int) void { | |
| 3240 | \\ var a = arg_a; | |
| 3241 | \\ _ = &a; | |
| 3242 | \\ foo(@as([*c]c_int, @ptrCast(@constCast(@volatileCast(a))))); | |
| 3243 | \\} | |
| 3244 | }); | |
| 3245 | ||
| 3246 | cases.add("handling of _Bool type", | |
| 3247 | \\_Bool foo(_Bool x) { | |
| 3248 | \\ _Bool a = x != 1; | |
| 3249 | \\ _Bool b = a != 0; | |
| 3250 | \\ _Bool c = foo; | |
| 3251 | \\ return foo(c != b); | |
| 3252 | \\} | |
| 3253 | , &[_][]const u8{ | |
| 3254 | \\pub export fn foo(arg_x: bool) bool { | |
| 3255 | \\ var x = arg_x; | |
| 3256 | \\ _ = &x; | |
| 3257 | \\ var a: bool = @as(c_int, @intFromBool(x)) != @as(c_int, 1); | |
| 3258 | \\ _ = &a; | |
| 3259 | \\ var b: bool = @as(c_int, @intFromBool(a)) != @as(c_int, 0); | |
| 3260 | \\ _ = &b; | |
| 3261 | \\ var c: bool = @intFromPtr(&foo) != 0; | |
| 3262 | \\ _ = &c; | |
| 3263 | \\ return foo(@as(c_int, @intFromBool(c)) != @as(c_int, @intFromBool(b))); | |
| 3264 | \\} | |
| 3265 | }); | |
| 3266 | ||
| 3267 | cases.add("Don't make const parameters mutable", | |
| 3268 | \\int max(const int x, int y) { | |
| 3269 | \\ return (x > y) ? x : y; | |
| 3270 | \\} | |
| 3271 | , &[_][]const u8{ | |
| 3272 | \\pub export fn max(x: c_int, arg_y: c_int) c_int { | |
| 3273 | \\ _ = &x; | |
| 3274 | \\ var y = arg_y; | |
| 3275 | \\ _ = &y; | |
| 3276 | \\ return if (x > y) x else y; | |
| 3277 | \\} | |
| 3278 | }); | |
| 3279 | ||
| 3280 | cases.add("string concatenation in macros", | |
| 3281 | \\#define FOO "hello" | |
| 3282 | \\#define BAR FOO " world" | |
| 3283 | \\#define BAZ "oh, " FOO | |
| 3284 | , &[_][]const u8{ | |
| 3285 | \\pub const FOO = "hello"; | |
| 3286 | , | |
| 3287 | \\pub const BAR = FOO ++ " world"; | |
| 3288 | , | |
| 3289 | \\pub const BAZ = "oh, " ++ FOO; | |
| 3290 | }); | |
| 3291 | ||
| 3292 | cases.add("string concatenation in macros: two defines", | |
| 3293 | \\#define FOO "hello" | |
| 3294 | \\#define BAZ " world" | |
| 3295 | \\#define BAR FOO BAZ | |
| 3296 | , &[_][]const u8{ | |
| 3297 | \\pub const FOO = "hello"; | |
| 3298 | , | |
| 3299 | \\pub const BAZ = " world"; | |
| 3300 | , | |
| 3301 | \\pub const BAR = FOO ++ BAZ; | |
| 3302 | }); | |
| 3303 | ||
| 3304 | cases.add("string concatenation in macros: two strings", | |
| 3305 | \\#define FOO "a" "b" | |
| 3306 | \\#define BAR FOO "c" | |
| 3307 | , &[_][]const u8{ | |
| 3308 | \\pub const FOO = "a" ++ "b"; | |
| 3309 | , | |
| 3310 | \\pub const BAR = FOO ++ "c"; | |
| 3311 | }); | |
| 3312 | ||
| 3313 | cases.add("string concatenation in macros: three strings", | |
| 3314 | \\#define FOO "a" "b" "c" | |
| 3315 | , &[_][]const u8{ | |
| 3316 | \\pub const FOO = "a" ++ "b" ++ "c"; | |
| 3317 | }); | |
| 3318 | ||
| 3319 | cases.add("multibyte character literals", | |
| 3320 | \\#define FOO 'abcd' | |
| 3321 | , &[_][]const u8{ | |
| 3322 | \\pub const FOO = 0x61626364; | |
| 3323 | }); | |
| 3324 | ||
| 3325 | cases.add("Make sure casts are grouped", | |
| 3326 | \\typedef struct | |
| 3327 | \\{ | |
| 3328 | \\ int i; | |
| 3329 | \\} | |
| 3330 | \\*_XPrivDisplay; | |
| 3331 | \\typedef struct _XDisplay Display; | |
| 3332 | \\#define DefaultScreen(dpy) (((_XPrivDisplay)(dpy))->default_screen) | |
| 3333 | \\ | |
| 3334 | , &[_][]const u8{ | |
| 3335 | \\pub inline fn DefaultScreen(dpy: anytype) @TypeOf(@import("std").zig.c_translation.cast(_XPrivDisplay, dpy).*.default_screen) { | |
| 3336 | \\ _ = &dpy; | |
| 3337 | \\ return @import("std").zig.c_translation.cast(_XPrivDisplay, dpy).*.default_screen; | |
| 3338 | \\} | |
| 3339 | }); | |
| 3340 | ||
| 3341 | cases.add("macro integer literal casts", | |
| 3342 | \\#define NULL ((void*)0) | |
| 3343 | \\#define FOO ((int)0x8000) | |
| 3344 | , &[_][]const u8{ | |
| 3345 | \\pub const NULL = @import("std").zig.c_translation.cast(?*anyopaque, @as(c_int, 0)); | |
| 3346 | , | |
| 3347 | \\pub const FOO = @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hex)); | |
| 3348 | }); | |
| 3349 | ||
| 3350 | if (builtin.abi == .msvc) { | |
| 3351 | cases.add("nameless struct fields", | |
| 3352 | \\typedef struct NAMED | |
| 3353 | \\{ | |
| 3354 | \\ long name; | |
| 3355 | \\} NAMED; | |
| 3356 | \\ | |
| 3357 | \\typedef struct ONENAMEWITHSTRUCT | |
| 3358 | \\{ | |
| 3359 | \\ NAMED; | |
| 3360 | \\ long b; | |
| 3361 | \\} ONENAMEWITHSTRUCT; | |
| 3362 | , &[_][]const u8{ | |
| 3363 | \\pub const struct_NAMED = extern struct { | |
| 3364 | \\ name: c_long = @import("std").mem.zeroes(c_long), | |
| 3365 | \\}; | |
| 3366 | \\pub const NAMED = struct_NAMED; | |
| 3367 | \\pub const struct_ONENAMEWITHSTRUCT = extern struct { | |
| 3368 | \\ unnamed_0: struct_NAMED = = @import("std").mem.zeroes(struct_NAMED), | |
| 3369 | \\ b: c_long = @import("std").mem.zeroes(c_long), | |
| 3370 | \\}; | |
| 3371 | }); | |
| 3372 | } else { | |
| 3373 | cases.add("nameless struct fields", | |
| 3374 | \\typedef struct NAMED | |
| 3375 | \\{ | |
| 3376 | \\ long name; | |
| 3377 | \\} NAMED; | |
| 3378 | \\ | |
| 3379 | \\typedef struct ONENAMEWITHSTRUCT | |
| 3380 | \\{ | |
| 3381 | \\ NAMED; | |
| 3382 | \\ long b; | |
| 3383 | \\} ONENAMEWITHSTRUCT; | |
| 3384 | , &[_][]const u8{ | |
| 3385 | \\pub const struct_NAMED = extern struct { | |
| 3386 | \\ name: c_long = @import("std").mem.zeroes(c_long), | |
| 3387 | \\}; | |
| 3388 | \\pub const NAMED = struct_NAMED; | |
| 3389 | \\pub const struct_ONENAMEWITHSTRUCT = extern struct { | |
| 3390 | \\ b: c_long = @import("std").mem.zeroes(c_long), | |
| 3391 | \\}; | |
| 3392 | }); | |
| 3393 | } | |
| 3394 | ||
| 3395 | cases.add("integer literal promotion", | |
| 3396 | \\#define GUARANTEED_TO_FIT_1 1024 | |
| 3397 | \\#define GUARANTEED_TO_FIT_2 10241024L | |
| 3398 | \\#define GUARANTEED_TO_FIT_3 20482048LU | |
| 3399 | \\#define MAY_NEED_PROMOTION_1 10241024 | |
| 3400 | \\#define MAY_NEED_PROMOTION_2 307230723072L | |
| 3401 | \\#define MAY_NEED_PROMOTION_3 819281928192LU | |
| 3402 | \\#define MAY_NEED_PROMOTION_HEX 0x80000000 | |
| 3403 | \\#define MAY_NEED_PROMOTION_OCT 020000000000 | |
| 3404 | , &[_][]const u8{ | |
| 3405 | \\pub const GUARANTEED_TO_FIT_1 = @as(c_int, 1024); | |
| 3406 | \\pub const GUARANTEED_TO_FIT_2 = @as(c_long, 10241024); | |
| 3407 | \\pub const GUARANTEED_TO_FIT_3 = @as(c_ulong, 20482048); | |
| 3408 | \\pub const MAY_NEED_PROMOTION_1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 10241024, .decimal); | |
| 3409 | \\pub const MAY_NEED_PROMOTION_2 = @import("std").zig.c_translation.promoteIntLiteral(c_long, 307230723072, .decimal); | |
| 3410 | \\pub const MAY_NEED_PROMOTION_3 = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 819281928192, .decimal); | |
| 3411 | \\pub const MAY_NEED_PROMOTION_HEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80000000, .hex); | |
| 3412 | \\pub const MAY_NEED_PROMOTION_OCT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0o20000000000, .octal); | |
| 3413 | }); | |
| 3414 | ||
| 3415 | cases.add("demote un-implemented builtins", | |
| 3416 | \\#define FOO(X) __builtin_alloca_with_align((X), 8) | |
| 3417 | , &[_][]const u8{ | |
| 3418 | \\pub const FOO = @compileError("unable to translate macro: undefined identifier `__builtin_alloca_with_align`"); | |
| 3419 | }); | |
| 3420 | ||
| 3421 | cases.add("null sentinel arrays when initialized from string literal. Issue #8256", | |
| 3422 | \\#include <stdint.h> | |
| 3423 | \\char zero[0] = "abc"; | |
| 3424 | \\uint32_t zero_w[0] = U"💯💯💯"; | |
| 3425 | \\char empty_incomplete[] = ""; | |
| 3426 | \\uint32_t empty_incomplete_w[] = U""; | |
| 3427 | \\char empty_constant[100] = ""; | |
| 3428 | \\uint32_t empty_constant_w[100] = U""; | |
| 3429 | \\char incomplete[] = "abc"; | |
| 3430 | \\uint32_t incomplete_w[] = U"💯💯💯"; | |
| 3431 | \\char truncated[1] = "abc"; | |
| 3432 | \\uint32_t truncated_w[1] = U"💯💯💯"; | |
| 3433 | \\char extend[5] = "a"; | |
| 3434 | \\uint32_t extend_w[5] = U"💯"; | |
| 3435 | \\char no_null[3] = "abc"; | |
| 3436 | \\uint32_t no_null_w[3] = U"💯💯💯"; | |
| 3437 | , &[_][]const u8{ | |
| 3438 | \\pub export var zero: [0]u8 = [0]u8{}; | |
| 3439 | \\pub export var zero_w: [0]u32 = [0]u32{}; | |
| 3440 | \\pub export var empty_incomplete: [1]u8 = [1]u8{0} ** 1; | |
| 3441 | \\pub export var empty_incomplete_w: [1]u32 = [1]u32{0} ** 1; | |
| 3442 | \\pub export var empty_constant: [100]u8 = [1]u8{0} ** 100; | |
| 3443 | \\pub export var empty_constant_w: [100]u32 = [1]u32{0} ** 100; | |
| 3444 | \\pub export var incomplete: [3:0]u8 = "abc".*; | |
| 3445 | \\pub export var incomplete_w: [3:0]u32 = [3:0]u32{ | |
| 3446 | \\ '\u{1f4af}', | |
| 3447 | \\ '\u{1f4af}', | |
| 3448 | \\ '\u{1f4af}', | |
| 3449 | \\}; | |
| 3450 | \\pub export var truncated: [1]u8 = "abc"[0..1].*; | |
| 3451 | \\pub export var truncated_w: [1]u32 = [1]u32{ | |
| 3452 | \\ '\u{1f4af}', | |
| 3453 | \\}; | |
| 3454 | \\pub export var extend: [5]u8 = "a"[0..1].* ++ [1]u8{0} ** 4; | |
| 3455 | \\pub export var extend_w: [5]u32 = [1]u32{ | |
| 3456 | \\ '\u{1f4af}', | |
| 3457 | \\} ++ [1]u32{0} ** 4; | |
| 3458 | \\pub export var no_null: [3]u8 = "abc".*; | |
| 3459 | \\pub export var no_null_w: [3]u32 = [3]u32{ | |
| 3460 | \\ '\u{1f4af}', | |
| 3461 | \\ '\u{1f4af}', | |
| 3462 | \\ '\u{1f4af}', | |
| 3463 | \\}; | |
| 3464 | }); | |
| 3465 | ||
| 3466 | cases.add("global assembly", | |
| 3467 | \\__asm__(".globl func\n\t" | |
| 3468 | \\ ".type func, @function\n\t" | |
| 3469 | \\ "func:\n\t" | |
| 3470 | \\ ".cfi_startproc\n\t" | |
| 3471 | \\ "movl $42, %eax\n\t" | |
| 3472 | \\ "ret\n\t" | |
| 3473 | \\ ".cfi_endproc"); | |
| 3474 | , &[_][]const u8{ | |
| 3475 | \\comptime { | |
| 3476 | \\ asm (".globl func\n\t.type func, @function\n\tfunc:\n\t.cfi_startproc\n\tmovl $42, %eax\n\tret\n\t.cfi_endproc"); | |
| 3477 | \\} | |
| 3478 | }); | |
| 3479 | ||
| 3480 | cases.add("Demote function that initializes opaque struct", | |
| 3481 | \\struct my_struct { | |
| 3482 | \\ unsigned a: 15; | |
| 3483 | \\ unsigned: 2; | |
| 3484 | \\ unsigned b: 15; | |
| 3485 | \\}; | |
| 3486 | \\void initialize(void) { | |
| 3487 | \\ struct my_struct S = {.a = 1, .b = 2}; | |
| 3488 | \\} | |
| 3489 | , &[_][]const u8{ | |
| 3490 | \\warning: local variable has opaque type | |
| 3491 | , | |
| 3492 | \\warning: unable to translate function, demoted to extern | |
| 3493 | \\pub extern fn initialize() void; | |
| 3494 | }); | |
| 3495 | ||
| 3496 | cases.add("Demote function that dereferences opaque type", | |
| 3497 | \\struct my_struct { | |
| 3498 | \\ unsigned a: 1; | |
| 3499 | \\}; | |
| 3500 | \\void deref(struct my_struct *s) { | |
| 3501 | \\ *s; | |
| 3502 | \\} | |
| 3503 | , &[_][]const u8{ | |
| 3504 | \\warning: cannot dereference opaque type | |
| 3505 | , | |
| 3506 | \\warning: unable to translate function, demoted to extern | |
| 3507 | \\pub extern fn deref(arg_s: ?*struct_my_struct) void; | |
| 3508 | }); | |
| 3509 | ||
| 3510 | cases.add("Demote function that dereference types that contain opaque type", | |
| 3511 | \\struct inner { | |
| 3512 | \\ _Atomic int a; | |
| 3513 | \\}; | |
| 3514 | \\struct outer { | |
| 3515 | \\ int thing; | |
| 3516 | \\ struct inner sub_struct; | |
| 3517 | \\}; | |
| 3518 | \\void deref(struct outer *s) { | |
| 3519 | \\ *s; | |
| 3520 | \\} | |
| 3521 | , &[_][]const u8{ | |
| 3522 | \\pub const struct_inner = opaque {}; | |
| 3523 | , | |
| 3524 | \\pub const struct_outer = extern struct { | |
| 3525 | \\ thing: c_int = @import("std").mem.zeroes(c_int), | |
| 3526 | \\ sub_struct: struct_inner = @import("std").mem.zeroes(struct_inner), | |
| 3527 | \\}; | |
| 3528 | , | |
| 3529 | \\warning: unable to translate function, demoted to extern | |
| 3530 | , | |
| 3531 | \\pub extern fn deref(arg_s: ?*struct_outer) void; | |
| 3532 | }); | |
| 3533 | ||
| 3534 | cases.add("Function prototype declared within function", | |
| 3535 | \\int foo(void) { | |
| 3536 | \\ extern int bar(int, int); | |
| 3537 | \\ return bar(1, 2); | |
| 3538 | \\} | |
| 3539 | , &[_][]const u8{ | |
| 3540 | \\pub export fn foo() c_int { | |
| 3541 | \\ const ExternLocal_bar = struct { | |
| 3542 | \\ pub extern fn bar(c_int, c_int) c_int; | |
| 3543 | \\ }; | |
| 3544 | \\ _ = &ExternLocal_bar; | |
| 3545 | \\ return ExternLocal_bar.bar(@as(c_int, 1), @as(c_int, 2)); | |
| 3546 | \\} | |
| 3547 | }); | |
| 3548 | ||
| 3549 | cases.add("static local variable zero-initialized if no initializer", | |
| 3550 | \\struct FOO {int x; int y;}; | |
| 3551 | \\int bar(void) { | |
| 3552 | \\ static struct FOO foo; | |
| 3553 | \\ return foo.x; | |
| 3554 | \\} | |
| 3555 | , &[_][]const u8{ | |
| 3556 | \\pub const struct_FOO = extern struct { | |
| 3557 | \\ x: c_int = @import("std").mem.zeroes(c_int), | |
| 3558 | \\ y: c_int = @import("std").mem.zeroes(c_int), | |
| 3559 | \\}; | |
| 3560 | \\pub export fn bar() c_int { | |
| 3561 | \\ const foo = struct { | |
| 3562 | \\ var static: struct_FOO = @import("std").mem.zeroes(struct_FOO); | |
| 3563 | \\ }; | |
| 3564 | \\ _ = &foo; | |
| 3565 | \\ return foo.static.x; | |
| 3566 | \\} | |
| 3567 | }); | |
| 3568 | ||
| 3569 | cases.add("macro with nontrivial cast", | |
| 3570 | \\#define MAP_FAILED ((void *) -1) | |
| 3571 | \\typedef long long LONG_PTR; | |
| 3572 | \\#define INVALID_HANDLE_VALUE ((void *)(LONG_PTR)-1) | |
| 3573 | , &[_][]const u8{ | |
| 3574 | \\pub const MAP_FAILED = @import("std").zig.c_translation.cast(?*anyopaque, -@as(c_int, 1)); | |
| 3575 | \\pub const INVALID_HANDLE_VALUE = @import("std").zig.c_translation.cast(?*anyopaque, @import("std").zig.c_translation.cast(LONG_PTR, -@as(c_int, 1))); | |
| 3576 | }); | |
| 3577 | ||
| 3578 | cases.add("discard unused local variables and function parameters", | |
| 3579 | \\#define FOO(A, B) (A) | |
| 3580 | \\int bar(int x, int y) { | |
| 3581 | \\ return x; | |
| 3582 | \\} | |
| 3583 | , &[_][]const u8{ | |
| 3584 | \\pub export fn bar(arg_x: c_int, arg_y: c_int) c_int { | |
| 3585 | \\ var x = arg_x; | |
| 3586 | \\ _ = &x; | |
| 3587 | \\ var y = arg_y; | |
| 3588 | \\ _ = &y; | |
| 3589 | \\ return x; | |
| 3590 | \\} | |
| 3591 | , | |
| 3592 | \\pub inline fn FOO(A: anytype, B: anytype) @TypeOf(A) { | |
| 3593 | \\ _ = &A; | |
| 3594 | \\ _ = &B; | |
| 3595 | \\ return A; | |
| 3596 | \\} | |
| 3597 | }); | |
| 3598 | ||
| 3599 | cases.add("Use @ syntax for bare underscore identifier in macro or public symbol", | |
| 3600 | \\#define FOO _ | |
| 3601 | \\int _ = 42; | |
| 3602 | , &[_][]const u8{ | |
| 3603 | \\pub inline fn FOO() @TypeOf(@"_") { | |
| 3604 | \\ return @"_"; | |
| 3605 | \\} | |
| 3606 | , | |
| 3607 | \\pub export var @"_": c_int = 42; | |
| 3608 | }); | |
| 3609 | ||
| 3610 | cases.add("Macro matching", | |
| 3611 | \\#define FOO(X) (X ## U) | |
| 3612 | , &[_][]const u8{ | |
| 3613 | \\pub const FOO = @import("std").zig.c_translation.Macros.U_SUFFIX; | |
| 3614 | }); | |
| 3615 | ||
| 3616 | cases.add("Simple array access of pointer with non-negative integer constant", | |
| 3617 | \\void foo(int *p) { | |
| 3618 | \\ p[0]; | |
| 3619 | \\ p[1]; | |
| 3620 | \\} | |
| 3621 | , &[_][]const u8{ | |
| 3622 | \\_ = p[@as(c_uint, @intCast(@as(c_int, 0)))]; | |
| 3623 | , | |
| 3624 | \\_ = p[@as(c_uint, @intCast(@as(c_int, 1)))]; | |
| 3625 | }); | |
| 3626 | ||
| 3627 | cases.add("Undefined macro identifier", | |
| 3628 | \\#define FOO BAR | |
| 3629 | , &[_][]const u8{ | |
| 3630 | \\pub const FOO = @compileError("unable to translate macro: undefined identifier `BAR`"); | |
| 3631 | }); | |
| 3632 | ||
| 3633 | cases.add("Macro redefines builtin", | |
| 3634 | \\#define FOO __builtin_popcount | |
| 3635 | , &[_][]const u8{ | |
| 3636 | \\pub const FOO = __builtin_popcount; | |
| 3637 | }); | |
| 3638 | ||
| 3639 | cases.add("Only consider public decls in `isBuiltinDefined`", | |
| 3640 | \\#define FOO std | |
| 3641 | , &[_][]const u8{ | |
| 3642 | \\pub const FOO = @compileError("unable to translate macro: undefined identifier `std`"); | |
| 3643 | }); | |
| 3644 | ||
| 3645 | cases.add("Macro without a value", | |
| 3646 | \\#define FOO | |
| 3647 | , &[_][]const u8{ | |
| 3648 | \\pub const FOO = ""; | |
| 3649 | }); | |
| 3650 | ||
| 3651 | cases.add("leading zeroes", | |
| 3652 | \\#define O_RDONLY 00 | |
| 3653 | \\#define HELLO 000 | |
| 3654 | \\#define ZERO 0 | |
| 3655 | \\#define WORLD 00000123 | |
| 3656 | , &[_][]const u8{ | |
| 3657 | \\pub const O_RDONLY = @as(c_int, 0o0); | |
| 3658 | \\pub const HELLO = @as(c_int, 0o00); | |
| 3659 | \\pub const ZERO = @as(c_int, 0); | |
| 3660 | \\pub const WORLD = @as(c_int, 0o0000123); | |
| 3661 | }); | |
| 3662 | ||
| 3663 | cases.add("Assign expression from bool to int", | |
| 3664 | \\void foo(void) { | |
| 3665 | \\ int a; | |
| 3666 | \\ if (a = 1 > 0) {} | |
| 3667 | \\} | |
| 3668 | , &[_][]const u8{ | |
| 3669 | \\pub export fn foo() void { | |
| 3670 | \\ var a: c_int = undefined; | |
| 3671 | \\ _ = &a; | |
| 3672 | \\ if ((blk: { | |
| 3673 | \\ const tmp = @intFromBool(@as(c_int, 1) > @as(c_int, 0)); | |
| 3674 | \\ a = tmp; | |
| 3675 | \\ break :blk tmp; | |
| 3676 | \\ }) != 0) {} | |
| 3677 | \\} | |
| 3678 | }); | |
| 3679 | ||
| 3680 | if (builtin.os.tag == .windows) { | |
| 3681 | cases.add("Pointer subtraction with typedef", | |
| 3682 | \\typedef char* S; | |
| 3683 | \\void foo() { | |
| 3684 | \\ S a, b; | |
| 3685 | \\ long long c = a - b; | |
| 3686 | \\} | |
| 3687 | , &[_][]const u8{ | |
| 3688 | \\pub export fn foo() void { | |
| 3689 | \\ var a: S = undefined; | |
| 3690 | \\ _ = &a; | |
| 3691 | \\ var b: S = undefined; | |
| 3692 | \\ _ = &b; | |
| 3693 | \\ var c: c_longlong = @divExact(@as(c_longlong, @bitCast(@intFromPtr(a) -% @intFromPtr(b))), @sizeOf(u8)); | |
| 3694 | \\ _ = &c; | |
| 3695 | \\} | |
| 3696 | }); | |
| 3697 | } else { | |
| 3698 | cases.add("Pointer subtraction with typedef", | |
| 3699 | \\typedef char* S; | |
| 3700 | \\void foo() { | |
| 3701 | \\ S a, b; | |
| 3702 | \\ long c = a - b; | |
| 3703 | \\} | |
| 3704 | , &[_][]const u8{ | |
| 3705 | \\pub export fn foo() void { | |
| 3706 | \\ var a: S = undefined; | |
| 3707 | \\ _ = &a; | |
| 3708 | \\ var b: S = undefined; | |
| 3709 | \\ _ = &b; | |
| 3710 | \\ var c: c_long = @divExact(@as(c_long, @bitCast(@intFromPtr(a) -% @intFromPtr(b))), @sizeOf(u8)); | |
| 3711 | \\ _ = &c; | |
| 3712 | \\} | |
| 3713 | }); | |
| 3714 | } | |
| 3715 | ||
| 3716 | cases.add("extern array of unknown length", | |
| 3717 | \\extern int foo[]; | |
| 3718 | , &[_][]const u8{ | |
| 3719 | \\const foo: [*c]c_int = @extern([*c]c_int, .{ | |
| 3720 | \\ .name = "foo", | |
| 3721 | \\}); | |
| 3722 | }); | |
| 3723 | ||
| 3724 | cases.add("string array initializer", | |
| 3725 | \\static const char foo[] = {"bar"}; | |
| 3726 | , &[_][]const u8{ | |
| 3727 | \\pub const foo: [3:0]u8 = "bar"; | |
| 3728 | }); | |
| 3729 | ||
| 3730 | cases.add("worst-case assign from mangle prefix", | |
| 3731 | \\void foo() { | |
| 3732 | \\ int n, tmp = 1; | |
| 3733 | \\ if (n = tmp) {} | |
| 3734 | \\} | |
| 3735 | , &[_][]const u8{ | |
| 3736 | \\pub export fn foo() void { | |
| 3737 | \\ var n: c_int = undefined; | |
| 3738 | \\ _ = &n; | |
| 3739 | \\ var tmp: c_int = 1; | |
| 3740 | \\ _ = &tmp; | |
| 3741 | \\ if ((blk: { | |
| 3742 | \\ const tmp_1 = tmp; | |
| 3743 | \\ n = tmp_1; | |
| 3744 | \\ break :blk tmp_1; | |
| 3745 | \\ }) != 0) {} | |
| 3746 | \\} | |
| 3747 | }); | |
| 3748 | ||
| 3749 | cases.add("worst-case assign to mangle prefix", | |
| 3750 | \\void foo() { | |
| 3751 | \\ int tmp, n = 1; | |
| 3752 | \\ if (tmp = n) {} | |
| 3753 | \\} | |
| 3754 | , &[_][]const u8{ | |
| 3755 | \\pub export fn foo() void { | |
| 3756 | \\ var tmp: c_int = undefined; | |
| 3757 | \\ _ = &tmp; | |
| 3758 | \\ var n: c_int = 1; | |
| 3759 | \\ _ = &n; | |
| 3760 | \\ if ((blk: { | |
| 3761 | \\ const tmp_1 = n; | |
| 3762 | \\ tmp = tmp_1; | |
| 3763 | \\ break :blk tmp_1; | |
| 3764 | \\ }) != 0) {} | |
| 3765 | \\} | |
| 3766 | }); | |
| 3767 | ||
| 3768 | cases.add("worst-case precrement mangle prefix", | |
| 3769 | \\void foo() { | |
| 3770 | \\ int n, ref = 1; | |
| 3771 | \\ if (n = ++ref) {} | |
| 3772 | \\} | |
| 3773 | , &[_][]const u8{ | |
| 3774 | \\pub export fn foo() void { | |
| 3775 | \\ var n: c_int = undefined; | |
| 3776 | \\ _ = &n; | |
| 3777 | \\ var ref: c_int = 1; | |
| 3778 | \\ _ = &ref; | |
| 3779 | \\ if ((blk: { | |
| 3780 | \\ const tmp = blk_1: { | |
| 3781 | \\ const ref_2 = &ref; | |
| 3782 | \\ ref_2.* += 1; | |
| 3783 | \\ break :blk_1 ref_2.*; | |
| 3784 | \\ }; | |
| 3785 | \\ n = tmp; | |
| 3786 | \\ break :blk tmp; | |
| 3787 | \\ }) != 0) {} | |
| 3788 | \\} | |
| 3789 | }); | |
| 3790 | ||
| 3791 | cases.add("worst-case postcrement mangle prefix", | |
| 3792 | \\void foo() { | |
| 3793 | \\ int n, ref = 1; | |
| 3794 | \\ if (n = ref++) {} | |
| 3795 | \\} | |
| 3796 | , &[_][]const u8{ | |
| 3797 | \\pub export fn foo() void { | |
| 3798 | \\ var n: c_int = undefined; | |
| 3799 | \\ _ = &n; | |
| 3800 | \\ var ref: c_int = 1; | |
| 3801 | \\ _ = &ref; | |
| 3802 | \\ if ((blk: { | |
| 3803 | \\ const tmp = blk_1: { | |
| 3804 | \\ const ref_2 = &ref; | |
| 3805 | \\ const tmp_3 = ref_2.*; | |
| 3806 | \\ ref_2.* += 1; | |
| 3807 | \\ break :blk_1 tmp_3; | |
| 3808 | \\ }; | |
| 3809 | \\ n = tmp; | |
| 3810 | \\ break :blk tmp; | |
| 3811 | \\ }) != 0) {} | |
| 3812 | \\} | |
| 3813 | }); | |
| 3814 | ||
| 3815 | cases.add("worst-case compound assign from mangle prefix", | |
| 3816 | \\void foo() { | |
| 3817 | \\ int n, ref = 1; | |
| 3818 | \\ if (n += ref) {} | |
| 3819 | \\} | |
| 3820 | , &[_][]const u8{ | |
| 3821 | \\pub export fn foo() void { | |
| 3822 | \\ var n: c_int = undefined; | |
| 3823 | \\ _ = &n; | |
| 3824 | \\ var ref: c_int = 1; | |
| 3825 | \\ _ = &ref; | |
| 3826 | \\ if ((blk: { | |
| 3827 | \\ const ref_1 = &n; | |
| 3828 | \\ ref_1.* += ref; | |
| 3829 | \\ break :blk ref_1.*; | |
| 3830 | \\ }) != 0) {} | |
| 3831 | \\} | |
| 3832 | }); | |
| 3833 | ||
| 3834 | cases.add("worst-case compound assign to mangle prefix", | |
| 3835 | \\void foo() { | |
| 3836 | \\ int ref, n = 1; | |
| 3837 | \\ if (ref += n) {} | |
| 3838 | \\} | |
| 3839 | , &[_][]const u8{ | |
| 3840 | \\pub export fn foo() void { | |
| 3841 | \\ var ref: c_int = undefined; | |
| 3842 | \\ _ = &ref; | |
| 3843 | \\ var n: c_int = 1; | |
| 3844 | \\ _ = &n; | |
| 3845 | \\ if ((blk: { | |
| 3846 | \\ const ref_1 = &ref; | |
| 3847 | \\ ref_1.* += n; | |
| 3848 | \\ break :blk ref_1.*; | |
| 3849 | \\ }) != 0) {} | |
| 3850 | \\} | |
| 3851 | }); | |
| 3852 | ||
| 3853 | cases.add("binary conditional operator where condition is the mangle prefix", | |
| 3854 | \\void foo() { | |
| 3855 | \\ int f = 1; | |
| 3856 | \\ int n, cond_temp = 1; | |
| 3857 | \\ if (n = (cond_temp)?:(f)) {} | |
| 3858 | \\} | |
| 3859 | , &[_][]const u8{ | |
| 3860 | \\pub export fn foo() void { | |
| 3861 | \\ var f: c_int = 1; | |
| 3862 | \\ _ = &f; | |
| 3863 | \\ var n: c_int = undefined; | |
| 3864 | \\ _ = &n; | |
| 3865 | \\ var cond_temp: c_int = 1; | |
| 3866 | \\ _ = &cond_temp; | |
| 3867 | \\ if ((blk: { | |
| 3868 | \\ const tmp = blk_1: { | |
| 3869 | \\ const cond_temp_2 = cond_temp; | |
| 3870 | \\ break :blk_1 if (cond_temp_2 != 0) cond_temp_2 else f; | |
| 3871 | \\ }; | |
| 3872 | \\ n = tmp; | |
| 3873 | \\ break :blk tmp; | |
| 3874 | \\ }) != 0) {} | |
| 3875 | \\} | |
| 3876 | }); | |
| 3877 | ||
| 3878 | cases.add("binary conditional operator where false_expr is the mangle prefix", | |
| 3879 | \\void foo() { | |
| 3880 | \\ int cond_temp = 1; | |
| 3881 | \\ int n, f = 1; | |
| 3882 | \\ if (n = (f)?:(cond_temp)) {} | |
| 3883 | \\} | |
| 3884 | , &[_][]const u8{ | |
| 3885 | \\pub export fn foo() void { | |
| 3886 | \\ var cond_temp: c_int = 1; | |
| 3887 | \\ _ = &cond_temp; | |
| 3888 | \\ var n: c_int = undefined; | |
| 3889 | \\ _ = &n; | |
| 3890 | \\ var f: c_int = 1; | |
| 3891 | \\ _ = &f; | |
| 3892 | \\ if ((blk: { | |
| 3893 | \\ const tmp = blk_1: { | |
| 3894 | \\ const cond_temp_2 = f; | |
| 3895 | \\ break :blk_1 if (cond_temp_2 != 0) cond_temp_2 else cond_temp; | |
| 3896 | \\ }; | |
| 3897 | \\ n = tmp; | |
| 3898 | \\ break :blk tmp; | |
| 3899 | \\ }) != 0) {} | |
| 3900 | \\} | |
| 3901 | }); | |
| 3902 | ||
| 3903 | cases.add("macro using argument as struct name is not translated", | |
| 3904 | \\#define FOO(x) struct x | |
| 3905 | , &[_][]const u8{ | |
| 3906 | \\pub const FOO = @compileError("unable to translate macro: untranslatable usage of arg `x`"); | |
| 3907 | }); | |
| 3908 | ||
| 3909 | cases.add("unsupport declare statement at the last of a compound statement which belongs to a statement expr", | |
| 3910 | \\void somefunc(void) { | |
| 3911 | \\ int y; | |
| 3912 | \\ (void)({y=1; _Static_assert(1);}); | |
| 3913 | \\} | |
| 3914 | , &[_][]const u8{ | |
| 3915 | \\pub export fn somefunc() void { | |
| 3916 | \\ var y: c_int = undefined; | |
| 3917 | \\ _ = &y; | |
| 3918 | \\ _ = blk: { | |
| 3919 | \\ y = 1; | |
| 3920 | \\ }; | |
| 3921 | \\} | |
| 3922 | }); | |
| 3923 | } |