| ... | @@ -66,10 +66,15 @@ pub const Type = extern union { | ... | @@ -66,10 +66,15 @@ pub const Type = extern union { |
| 66 | .function => return .Fn, | 66 | .function => return .Fn, |
| 67 | | 67 | |
| 68 | .array, .array_u8_sentinel_0, .array_u8, .array_sentinel => return .Array, | 68 | .array, .array_u8_sentinel_0, .array_u8, .array_sentinel => return .Array, |
| 69 | .single_const_pointer => return .Pointer, | 69 | .single_const_pointer_to_comptime_int, |
| 70 | .single_mut_pointer => return .Pointer, | 70 | .const_slice_u8, |
| 71 | .single_const_pointer_to_comptime_int => return .Pointer, | 71 | .single_const_pointer, |
| 72 | .const_slice_u8 => return .Pointer, | 72 | .single_mut_pointer, |
| | 73 | .many_const_pointer, |
| | 74 | .many_mut_pointer, |
| | 75 | .c_const_pointer, |
| | 76 | .c_mut_pointer, |
| | 77 | => return .Pointer, |
| 73 | | 78 | |
| 74 | .optional, | 79 | .optional, |
| 75 | .optional_single_const_pointer, | 80 | .optional_single_const_pointer, |
| ... | @@ -108,13 +113,17 @@ pub const Type = extern union { | ... | @@ -108,13 +113,17 @@ pub const Type = extern union { |
| 108 | return @fieldParentPtr(T, "base", self.ptr_otherwise); | 113 | return @fieldParentPtr(T, "base", self.ptr_otherwise); |
| 109 | } | 114 | } |
| 110 | | 115 | |
| 111 | pub fn castPointer(self: Type) ?*Payload.Pointer { | 116 | pub fn castPointer(self: Type) ?*Payload.PointerSimple { |
| 112 | return switch (self.tag()) { | 117 | return switch (self.tag()) { |
| 113 | .single_const_pointer, | 118 | .single_const_pointer, |
| 114 | .single_mut_pointer, | 119 | .single_mut_pointer, |
| | 120 | .many_const_pointer, |
| | 121 | .many_mut_pointer, |
| | 122 | .c_const_pointer, |
| | 123 | .c_mut_pointer, |
| 115 | .optional_single_const_pointer, | 124 | .optional_single_const_pointer, |
| 116 | .optional_single_mut_pointer, | 125 | .optional_single_mut_pointer, |
| 117 | => @fieldParentPtr(Payload.Pointer, "base", self.ptr_otherwise), | 126 | => @fieldParentPtr(Payload.PointerSimple, "base", self.ptr_otherwise), |
| 118 | else => null, | 127 | else => null, |
| 119 | }; | 128 | }; |
| 120 | } | 129 | } |
| ... | @@ -198,8 +207,8 @@ pub const Type = extern union { | ... | @@ -198,8 +207,8 @@ pub const Type = extern union { |
| 198 | return true; | 207 | return true; |
| 199 | }, | 208 | }, |
| 200 | .Optional => { | 209 | .Optional => { |
| 201 | var buf_a: Payload.Pointer = undefined; | 210 | var buf_a: Payload.PointerSimple = undefined; |
| 202 | var buf_b: Payload.Pointer = undefined; | 211 | var buf_b: Payload.PointerSimple = undefined; |
| 203 | return a.optionalChild(&buf_a).eql(b.optionalChild(&buf_b)); | 212 | return a.optionalChild(&buf_a).eql(b.optionalChild(&buf_b)); |
| 204 | }, | 213 | }, |
| 205 | .Float, | 214 | .Float, |
| ... | @@ -263,7 +272,7 @@ pub const Type = extern union { | ... | @@ -263,7 +272,7 @@ pub const Type = extern union { |
| 263 | } | 272 | } |
| 264 | }, | 273 | }, |
| 265 | .Optional => { | 274 | .Optional => { |
| 266 | var buf: Payload.Pointer = undefined; | 275 | var buf: Payload.PointerSimple = undefined; |
| 267 | std.hash.autoHash(&hasher, self.optionalChild(&buf).hash()); | 276 | std.hash.autoHash(&hasher, self.optionalChild(&buf).hash()); |
| 268 | }, | 277 | }, |
| 269 | .Float, | 278 | .Float, |
| ... | @@ -374,9 +383,13 @@ pub const Type = extern union { | ... | @@ -374,9 +383,13 @@ pub const Type = extern union { |
| 374 | .optional => return self.copyPayloadSingleField(allocator, Payload.Optional, "child_type"), | 383 | .optional => return self.copyPayloadSingleField(allocator, Payload.Optional, "child_type"), |
| 375 | .single_const_pointer, | 384 | .single_const_pointer, |
| 376 | .single_mut_pointer, | 385 | .single_mut_pointer, |
| | 386 | .many_const_pointer, |
| | 387 | .many_mut_pointer, |
| | 388 | .c_const_pointer, |
| | 389 | .c_mut_pointer, |
| 377 | .optional_single_mut_pointer, | 390 | .optional_single_mut_pointer, |
| 378 | .optional_single_const_pointer, | 391 | .optional_single_const_pointer, |
| 379 | => return self.copyPayloadSingleField(allocator, Payload.Pointer, "pointee_type"), | 392 | => return self.copyPayloadSingleField(allocator, Payload.PointerSimple, "pointee_type"), |
| 380 | } | 393 | } |
| 381 | } | 394 | } |
| 382 | | 395 | |
| ... | @@ -482,17 +495,41 @@ pub const Type = extern union { | ... | @@ -482,17 +495,41 @@ pub const Type = extern union { |
| 482 | continue; | 495 | continue; |
| 483 | }, | 496 | }, |
| 484 | .single_const_pointer => { | 497 | .single_const_pointer => { |
| 485 | const payload = @fieldParentPtr(Payload.Pointer, "base", ty.ptr_otherwise); | 498 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| 486 | try out_stream.writeAll("*const "); | 499 | try out_stream.writeAll("*const "); |
| 487 | ty = payload.pointee_type; | 500 | ty = payload.pointee_type; |
| 488 | continue; | 501 | continue; |
| 489 | }, | 502 | }, |
| 490 | .single_mut_pointer => { | 503 | .single_mut_pointer => { |
| 491 | const payload = @fieldParentPtr(Payload.Pointer, "base", ty.ptr_otherwise); | 504 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| 492 | try out_stream.writeAll("*"); | 505 | try out_stream.writeAll("*"); |
| 493 | ty = payload.pointee_type; | 506 | ty = payload.pointee_type; |
| 494 | continue; | 507 | continue; |
| 495 | }, | 508 | }, |
| | 509 | .many_const_pointer => { |
| | 510 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| | 511 | try out_stream.writeAll("[*]const "); |
| | 512 | ty = payload.pointee_type; |
| | 513 | continue; |
| | 514 | }, |
| | 515 | .many_mut_pointer => { |
| | 516 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| | 517 | try out_stream.writeAll("[*]"); |
| | 518 | ty = payload.pointee_type; |
| | 519 | continue; |
| | 520 | }, |
| | 521 | .c_const_pointer => { |
| | 522 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| | 523 | try out_stream.writeAll("[*c]const "); |
| | 524 | ty = payload.pointee_type; |
| | 525 | continue; |
| | 526 | }, |
| | 527 | .c_mut_pointer => { |
| | 528 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| | 529 | try out_stream.writeAll("[*c]"); |
| | 530 | ty = payload.pointee_type; |
| | 531 | continue; |
| | 532 | }, |
| 496 | .int_signed => { | 533 | .int_signed => { |
| 497 | const payload = @fieldParentPtr(Payload.IntSigned, "base", ty.ptr_otherwise); | 534 | const payload = @fieldParentPtr(Payload.IntSigned, "base", ty.ptr_otherwise); |
| 498 | return out_stream.print("i{}", .{payload.bits}); | 535 | return out_stream.print("i{}", .{payload.bits}); |
| ... | @@ -508,13 +545,13 @@ pub const Type = extern union { | ... | @@ -508,13 +545,13 @@ pub const Type = extern union { |
| 508 | continue; | 545 | continue; |
| 509 | }, | 546 | }, |
| 510 | .optional_single_const_pointer => { | 547 | .optional_single_const_pointer => { |
| 511 | const payload = @fieldParentPtr(Payload.Pointer, "base", ty.ptr_otherwise); | 548 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| 512 | try out_stream.writeAll("?*const "); | 549 | try out_stream.writeAll("?*const "); |
| 513 | ty = payload.pointee_type; | 550 | ty = payload.pointee_type; |
| 514 | continue; | 551 | continue; |
| 515 | }, | 552 | }, |
| 516 | .optional_single_mut_pointer => { | 553 | .optional_single_mut_pointer => { |
| 517 | const payload = @fieldParentPtr(Payload.Pointer, "base", ty.ptr_otherwise); | 554 | const payload = @fieldParentPtr(Payload.PointerSimple, "base", ty.ptr_otherwise); |
| 518 | try out_stream.writeAll("?*"); | 555 | try out_stream.writeAll("?*"); |
| 519 | ty = payload.pointee_type; | 556 | ty = payload.pointee_type; |
| 520 | continue; | 557 | continue; |
| ... | @@ -619,6 +656,10 @@ pub const Type = extern union { | ... | @@ -619,6 +656,10 @@ pub const Type = extern union { |
| 619 | .array_sentinel => self.elemType().hasCodeGenBits(), | 656 | .array_sentinel => self.elemType().hasCodeGenBits(), |
| 620 | .single_const_pointer => self.elemType().hasCodeGenBits(), | 657 | .single_const_pointer => self.elemType().hasCodeGenBits(), |
| 621 | .single_mut_pointer => self.elemType().hasCodeGenBits(), | 658 | .single_mut_pointer => self.elemType().hasCodeGenBits(), |
| | 659 | .many_const_pointer => self.elemType().hasCodeGenBits(), |
| | 660 | .many_mut_pointer => self.elemType().hasCodeGenBits(), |
| | 661 | .c_const_pointer => self.elemType().hasCodeGenBits(), |
| | 662 | .c_mut_pointer => self.elemType().hasCodeGenBits(), |
| 622 | .int_signed => self.cast(Payload.IntSigned).?.bits == 0, | 663 | .int_signed => self.cast(Payload.IntSigned).?.bits == 0, |
| 623 | .int_unsigned => self.cast(Payload.IntUnsigned).?.bits == 0, | 664 | .int_unsigned => self.cast(Payload.IntUnsigned).?.bits == 0, |
| 624 | | 665 | |
| ... | @@ -669,6 +710,10 @@ pub const Type = extern union { | ... | @@ -669,6 +710,10 @@ pub const Type = extern union { |
| 669 | .const_slice_u8, | 710 | .const_slice_u8, |
| 670 | .single_const_pointer, | 711 | .single_const_pointer, |
| 671 | .single_mut_pointer, | 712 | .single_mut_pointer, |
| | 713 | .many_const_pointer, |
| | 714 | .many_mut_pointer, |
| | 715 | .c_const_pointer, |
| | 716 | .c_mut_pointer, |
| 672 | .optional_single_const_pointer, | 717 | .optional_single_const_pointer, |
| 673 | .optional_single_mut_pointer, | 718 | .optional_single_mut_pointer, |
| 674 | => return @divExact(target.cpu.arch.ptrBitWidth(), 8), | 719 | => return @divExact(target.cpu.arch.ptrBitWidth(), 8), |
| ... | @@ -704,7 +749,7 @@ pub const Type = extern union { | ... | @@ -704,7 +749,7 @@ pub const Type = extern union { |
| 704 | }, | 749 | }, |
| 705 | | 750 | |
| 706 | .optional => { | 751 | .optional => { |
| 707 | var buf: Payload.Pointer = undefined; | 752 | var buf: Payload.PointerSimple = undefined; |
| 708 | const child_type = self.optionalChild(&buf); | 753 | const child_type = self.optionalChild(&buf); |
| 709 | if (!child_type.hasCodeGenBits()) return 1; | 754 | if (!child_type.hasCodeGenBits()) return 1; |
| 710 | | 755 | |
| ... | @@ -772,6 +817,10 @@ pub const Type = extern union { | ... | @@ -772,6 +817,10 @@ pub const Type = extern union { |
| 772 | .const_slice_u8, | 817 | .const_slice_u8, |
| 773 | .single_const_pointer, | 818 | .single_const_pointer, |
| 774 | .single_mut_pointer, | 819 | .single_mut_pointer, |
| | 820 | .many_const_pointer, |
| | 821 | .many_mut_pointer, |
| | 822 | .c_const_pointer, |
| | 823 | .c_mut_pointer, |
| 775 | .optional_single_const_pointer, | 824 | .optional_single_const_pointer, |
| 776 | .optional_single_mut_pointer, | 825 | .optional_single_mut_pointer, |
| 777 | => return @divExact(target.cpu.arch.ptrBitWidth(), 8), | 826 | => return @divExact(target.cpu.arch.ptrBitWidth(), 8), |
| ... | @@ -805,7 +854,7 @@ pub const Type = extern union { | ... | @@ -805,7 +854,7 @@ pub const Type = extern union { |
| 805 | }, | 854 | }, |
| 806 | | 855 | |
| 807 | .optional => { | 856 | .optional => { |
| 808 | var buf: Payload.Pointer = undefined; | 857 | var buf: Payload.PointerSimple = undefined; |
| 809 | const child_type = self.optionalChild(&buf); | 858 | const child_type = self.optionalChild(&buf); |
| 810 | if (!child_type.hasCodeGenBits()) return 1; | 859 | if (!child_type.hasCodeGenBits()) return 1; |
| 811 | | 860 | |
| ... | @@ -872,6 +921,10 @@ pub const Type = extern union { | ... | @@ -872,6 +921,10 @@ pub const Type = extern union { |
| 872 | .optional_single_mut_pointer, | 921 | .optional_single_mut_pointer, |
| 873 | .optional_single_const_pointer, | 922 | .optional_single_const_pointer, |
| 874 | .enum_literal, | 923 | .enum_literal, |
| | 924 | .many_const_pointer, |
| | 925 | .many_mut_pointer, |
| | 926 | .c_const_pointer, |
| | 927 | .c_mut_pointer, |
| 875 | => false, | 928 | => false, |
| 876 | | 929 | |
| 877 | .single_const_pointer, | 930 | .single_const_pointer, |
| ... | @@ -922,6 +975,10 @@ pub const Type = extern union { | ... | @@ -922,6 +975,10 @@ pub const Type = extern union { |
| 922 | .array_u8_sentinel_0, | 975 | .array_u8_sentinel_0, |
| 923 | .single_const_pointer, | 976 | .single_const_pointer, |
| 924 | .single_mut_pointer, | 977 | .single_mut_pointer, |
| | 978 | .many_const_pointer, |
| | 979 | .many_mut_pointer, |
| | 980 | .c_const_pointer, |
| | 981 | .c_mut_pointer, |
| 925 | .single_const_pointer_to_comptime_int, | 982 | .single_const_pointer_to_comptime_int, |
| 926 | .fn_noreturn_no_args, | 983 | .fn_noreturn_no_args, |
| 927 | .fn_void_no_args, | 984 | .fn_void_no_args, |
| ... | @@ -987,6 +1044,8 @@ pub const Type = extern union { | ... | @@ -987,6 +1044,8 @@ pub const Type = extern union { |
| 987 | .int_unsigned, | 1044 | .int_unsigned, |
| 988 | .int_signed, | 1045 | .int_signed, |
| 989 | .single_mut_pointer, | 1046 | .single_mut_pointer, |
| | 1047 | .many_mut_pointer, |
| | 1048 | .c_mut_pointer, |
| 990 | .optional, | 1049 | .optional, |
| 991 | .optional_single_mut_pointer, | 1050 | .optional_single_mut_pointer, |
| 992 | .optional_single_const_pointer, | 1051 | .optional_single_const_pointer, |
| ... | @@ -994,6 +1053,8 @@ pub const Type = extern union { | ... | @@ -994,6 +1053,8 @@ pub const Type = extern union { |
| 994 | => false, | 1053 | => false, |
| 995 | | 1054 | |
| 996 | .single_const_pointer, | 1055 | .single_const_pointer, |
| | 1056 | .many_const_pointer, |
| | 1057 | .c_const_pointer, |
| 997 | .single_const_pointer_to_comptime_int, | 1058 | .single_const_pointer_to_comptime_int, |
| 998 | .const_slice_u8, | 1059 | .const_slice_u8, |
| 999 | => true, | 1060 | => true, |
| ... | @@ -1048,6 +1109,10 @@ pub const Type = extern union { | ... | @@ -1048,6 +1109,10 @@ pub const Type = extern union { |
| 1048 | .int_signed, | 1109 | .int_signed, |
| 1049 | .single_mut_pointer, | 1110 | .single_mut_pointer, |
| 1050 | .single_const_pointer, | 1111 | .single_const_pointer, |
| | 1112 | .many_const_pointer, |
| | 1113 | .many_mut_pointer, |
| | 1114 | .c_const_pointer, |
| | 1115 | .c_mut_pointer, |
| 1051 | .single_const_pointer_to_comptime_int, | 1116 | .single_const_pointer_to_comptime_int, |
| 1052 | .const_slice_u8, | 1117 | .const_slice_u8, |
| 1053 | .optional, | 1118 | .optional, |
| ... | @@ -1063,7 +1128,7 @@ pub const Type = extern union { | ... | @@ -1063,7 +1128,7 @@ pub const Type = extern union { |
| 1063 | switch (self.tag()) { | 1128 | switch (self.tag()) { |
| 1064 | .optional_single_const_pointer, .optional_single_mut_pointer => return true, | 1129 | .optional_single_const_pointer, .optional_single_mut_pointer => return true, |
| 1065 | .optional => { | 1130 | .optional => { |
| 1066 | var buf: Payload.Pointer = undefined; | 1131 | var buf: Payload.PointerSimple = undefined; |
| 1067 | const child_type = self.optionalChild(&buf); | 1132 | const child_type = self.optionalChild(&buf); |
| 1068 | // optionals of zero sized pointers behave like bools | 1133 | // optionals of zero sized pointers behave like bools |
| 1069 | if (!child_type.hasCodeGenBits()) return false; | 1134 | if (!child_type.hasCodeGenBits()) return false; |
| ... | @@ -1101,7 +1166,7 @@ pub const Type = extern union { | ... | @@ -1101,7 +1166,7 @@ pub const Type = extern union { |
| 1101 | => return false, | 1166 | => return false, |
| 1102 | | 1167 | |
| 1103 | .Optional => { | 1168 | .Optional => { |
| 1104 | var buf: Payload.Pointer = undefined; | 1169 | var buf: Payload.PointerSimple = undefined; |
| 1105 | return ty.optionalChild(&buf).isValidVarType(is_extern); | 1170 | return ty.optionalChild(&buf).isValidVarType(is_extern); |
| 1106 | }, | 1171 | }, |
| 1107 | .Pointer, .Array => ty = ty.elemType(), | 1172 | .Pointer, .Array => ty = ty.elemType(), |
| ... | @@ -1166,13 +1231,17 @@ pub const Type = extern union { | ... | @@ -1166,13 +1231,17 @@ pub const Type = extern union { |
| 1166 | .array_sentinel => self.cast(Payload.ArraySentinel).?.elem_type, | 1231 | .array_sentinel => self.cast(Payload.ArraySentinel).?.elem_type, |
| 1167 | .single_const_pointer => self.castPointer().?.pointee_type, | 1232 | .single_const_pointer => self.castPointer().?.pointee_type, |
| 1168 | .single_mut_pointer => self.castPointer().?.pointee_type, | 1233 | .single_mut_pointer => self.castPointer().?.pointee_type, |
| | 1234 | .many_const_pointer => self.castPointer().?.pointee_type, |
| | 1235 | .many_mut_pointer => self.castPointer().?.pointee_type, |
| | 1236 | .c_const_pointer => self.castPointer().?.pointee_type, |
| | 1237 | .c_mut_pointer => self.castPointer().?.pointee_type, |
| 1169 | .array_u8, .array_u8_sentinel_0, .const_slice_u8 => Type.initTag(.u8), | 1238 | .array_u8, .array_u8_sentinel_0, .const_slice_u8 => Type.initTag(.u8), |
| 1170 | .single_const_pointer_to_comptime_int => Type.initTag(.comptime_int), | 1239 | .single_const_pointer_to_comptime_int => Type.initTag(.comptime_int), |
| 1171 | }; | 1240 | }; |
| 1172 | } | 1241 | } |
| 1173 | | 1242 | |
| 1174 | /// Asserts that the type is an optional. | 1243 | /// Asserts that the type is an optional. |
| 1175 | pub fn optionalChild(self: Type, buf: *Payload.Pointer) Type { | 1244 | pub fn optionalChild(self: Type, buf: *Payload.PointerSimple) Type { |
| 1176 | return switch (self.tag()) { | 1245 | return switch (self.tag()) { |
| 1177 | .optional => self.cast(Payload.Optional).?.child_type, | 1246 | .optional => self.cast(Payload.Optional).?.child_type, |
| 1178 | .optional_single_mut_pointer => { | 1247 | .optional_single_mut_pointer => { |
| ... | @@ -1199,7 +1268,7 @@ pub const Type = extern union { | ... | @@ -1199,7 +1268,7 @@ pub const Type = extern union { |
| 1199 | return switch (self.tag()) { | 1268 | return switch (self.tag()) { |
| 1200 | .optional => self.cast(Payload.Optional).?.child_type, | 1269 | .optional => self.cast(Payload.Optional).?.child_type, |
| 1201 | .optional_single_mut_pointer, .optional_single_const_pointer => { | 1270 | .optional_single_mut_pointer, .optional_single_const_pointer => { |
| 1202 | const payload = try allocator.create(Payload.Pointer); | 1271 | const payload = try allocator.create(Payload.PointerSimple); |
| 1203 | payload.* = .{ | 1272 | payload.* = .{ |
| 1204 | .base = .{ | 1273 | .base = .{ |
| 1205 | .tag = if (self.tag() == .optional_single_const_pointer) | 1274 | .tag = if (self.tag() == .optional_single_const_pointer) |
| ... | @@ -1258,6 +1327,10 @@ pub const Type = extern union { | ... | @@ -1258,6 +1327,10 @@ pub const Type = extern union { |
| 1258 | .function, | 1327 | .function, |
| 1259 | .single_const_pointer, | 1328 | .single_const_pointer, |
| 1260 | .single_mut_pointer, | 1329 | .single_mut_pointer, |
| | 1330 | .many_const_pointer, |
| | 1331 | .many_mut_pointer, |
| | 1332 | .c_const_pointer, |
| | 1333 | .c_mut_pointer, |
| 1261 | .single_const_pointer_to_comptime_int, | 1334 | .single_const_pointer_to_comptime_int, |
| 1262 | .const_slice_u8, | 1335 | .const_slice_u8, |
| 1263 | .int_unsigned, | 1336 | .int_unsigned, |
| ... | @@ -1318,6 +1391,10 @@ pub const Type = extern union { | ... | @@ -1318,6 +1391,10 @@ pub const Type = extern union { |
| 1318 | .function, | 1391 | .function, |
| 1319 | .single_const_pointer, | 1392 | .single_const_pointer, |
| 1320 | .single_mut_pointer, | 1393 | .single_mut_pointer, |
| | 1394 | .many_const_pointer, |
| | 1395 | .many_mut_pointer, |
| | 1396 | .c_const_pointer, |
| | 1397 | .c_mut_pointer, |
| 1321 | .single_const_pointer_to_comptime_int, | 1398 | .single_const_pointer_to_comptime_int, |
| 1322 | .const_slice_u8, | 1399 | .const_slice_u8, |
| 1323 | .int_unsigned, | 1400 | .int_unsigned, |
| ... | @@ -1368,6 +1445,10 @@ pub const Type = extern union { | ... | @@ -1368,6 +1445,10 @@ pub const Type = extern union { |
| 1368 | .array_u8_sentinel_0, | 1445 | .array_u8_sentinel_0, |
| 1369 | .single_const_pointer, | 1446 | .single_const_pointer, |
| 1370 | .single_mut_pointer, | 1447 | .single_mut_pointer, |
| | 1448 | .many_const_pointer, |
| | 1449 | .many_mut_pointer, |
| | 1450 | .c_const_pointer, |
| | 1451 | .c_mut_pointer, |
| 1371 | .single_const_pointer_to_comptime_int, | 1452 | .single_const_pointer_to_comptime_int, |
| 1372 | .const_slice_u8, | 1453 | .const_slice_u8, |
| 1373 | .int_unsigned, | 1454 | .int_unsigned, |
| ... | @@ -1429,6 +1510,10 @@ pub const Type = extern union { | ... | @@ -1429,6 +1510,10 @@ pub const Type = extern union { |
| 1429 | .array_u8_sentinel_0, | 1510 | .array_u8_sentinel_0, |
| 1430 | .single_const_pointer, | 1511 | .single_const_pointer, |
| 1431 | .single_mut_pointer, | 1512 | .single_mut_pointer, |
| | 1513 | .many_const_pointer, |
| | 1514 | .many_mut_pointer, |
| | 1515 | .c_const_pointer, |
| | 1516 | .c_mut_pointer, |
| 1432 | .single_const_pointer_to_comptime_int, | 1517 | .single_const_pointer_to_comptime_int, |
| 1433 | .const_slice_u8, | 1518 | .const_slice_u8, |
| 1434 | .int_signed, | 1519 | .int_signed, |
| ... | @@ -1490,6 +1575,10 @@ pub const Type = extern union { | ... | @@ -1490,6 +1575,10 @@ pub const Type = extern union { |
| 1490 | .array_u8_sentinel_0, | 1575 | .array_u8_sentinel_0, |
| 1491 | .single_const_pointer, | 1576 | .single_const_pointer, |
| 1492 | .single_mut_pointer, | 1577 | .single_mut_pointer, |
| | 1578 | .many_const_pointer, |
| | 1579 | .many_mut_pointer, |
| | 1580 | .c_const_pointer, |
| | 1581 | .c_mut_pointer, |
| 1493 | .single_const_pointer_to_comptime_int, | 1582 | .single_const_pointer_to_comptime_int, |
| 1494 | .const_slice_u8, | 1583 | .const_slice_u8, |
| 1495 | .optional, | 1584 | .optional, |
| ... | @@ -1549,6 +1638,10 @@ pub const Type = extern union { | ... | @@ -1549,6 +1638,10 @@ pub const Type = extern union { |
| 1549 | .array_u8_sentinel_0, | 1638 | .array_u8_sentinel_0, |
| 1550 | .single_const_pointer, | 1639 | .single_const_pointer, |
| 1551 | .single_mut_pointer, | 1640 | .single_mut_pointer, |
| | 1641 | .many_const_pointer, |
| | 1642 | .many_mut_pointer, |
| | 1643 | .c_const_pointer, |
| | 1644 | .c_mut_pointer, |
| 1552 | .single_const_pointer_to_comptime_int, | 1645 | .single_const_pointer_to_comptime_int, |
| 1553 | .const_slice_u8, | 1646 | .const_slice_u8, |
| 1554 | .int_unsigned, | 1647 | .int_unsigned, |
| ... | @@ -1637,6 +1730,10 @@ pub const Type = extern union { | ... | @@ -1637,6 +1730,10 @@ pub const Type = extern union { |
| 1637 | .array_u8_sentinel_0, | 1730 | .array_u8_sentinel_0, |
| 1638 | .single_const_pointer, | 1731 | .single_const_pointer, |
| 1639 | .single_mut_pointer, | 1732 | .single_mut_pointer, |
| | 1733 | .many_const_pointer, |
| | 1734 | .many_mut_pointer, |
| | 1735 | .c_const_pointer, |
| | 1736 | .c_mut_pointer, |
| 1640 | .single_const_pointer_to_comptime_int, | 1737 | .single_const_pointer_to_comptime_int, |
| 1641 | .const_slice_u8, | 1738 | .const_slice_u8, |
| 1642 | .u8, | 1739 | .u8, |
| ... | @@ -1701,6 +1798,10 @@ pub const Type = extern union { | ... | @@ -1701,6 +1798,10 @@ pub const Type = extern union { |
| 1701 | .array_u8_sentinel_0, | 1798 | .array_u8_sentinel_0, |
| 1702 | .single_const_pointer, | 1799 | .single_const_pointer, |
| 1703 | .single_mut_pointer, | 1800 | .single_mut_pointer, |
| | 1801 | .many_const_pointer, |
| | 1802 | .many_mut_pointer, |
| | 1803 | .c_const_pointer, |
| | 1804 | .c_mut_pointer, |
| 1704 | .single_const_pointer_to_comptime_int, | 1805 | .single_const_pointer_to_comptime_int, |
| 1705 | .const_slice_u8, | 1806 | .const_slice_u8, |
| 1706 | .u8, | 1807 | .u8, |
| ... | @@ -1764,6 +1865,10 @@ pub const Type = extern union { | ... | @@ -1764,6 +1865,10 @@ pub const Type = extern union { |
| 1764 | .array_u8_sentinel_0, | 1865 | .array_u8_sentinel_0, |
| 1765 | .single_const_pointer, | 1866 | .single_const_pointer, |
| 1766 | .single_mut_pointer, | 1867 | .single_mut_pointer, |
| | 1868 | .many_const_pointer, |
| | 1869 | .many_mut_pointer, |
| | 1870 | .c_const_pointer, |
| | 1871 | .c_mut_pointer, |
| 1767 | .single_const_pointer_to_comptime_int, | 1872 | .single_const_pointer_to_comptime_int, |
| 1768 | .const_slice_u8, | 1873 | .const_slice_u8, |
| 1769 | .u8, | 1874 | .u8, |
| ... | @@ -1827,6 +1932,10 @@ pub const Type = extern union { | ... | @@ -1827,6 +1932,10 @@ pub const Type = extern union { |
| 1827 | .array_u8_sentinel_0, | 1932 | .array_u8_sentinel_0, |
| 1828 | .single_const_pointer, | 1933 | .single_const_pointer, |
| 1829 | .single_mut_pointer, | 1934 | .single_mut_pointer, |
| | 1935 | .many_const_pointer, |
| | 1936 | .many_mut_pointer, |
| | 1937 | .c_const_pointer, |
| | 1938 | .c_mut_pointer, |
| 1830 | .single_const_pointer_to_comptime_int, | 1939 | .single_const_pointer_to_comptime_int, |
| 1831 | .const_slice_u8, | 1940 | .const_slice_u8, |
| 1832 | .u8, | 1941 | .u8, |
| ... | @@ -1887,6 +1996,10 @@ pub const Type = extern union { | ... | @@ -1887,6 +1996,10 @@ pub const Type = extern union { |
| 1887 | .array_u8_sentinel_0, | 1996 | .array_u8_sentinel_0, |
| 1888 | .single_const_pointer, | 1997 | .single_const_pointer, |
| 1889 | .single_mut_pointer, | 1998 | .single_mut_pointer, |
| | 1999 | .many_const_pointer, |
| | 2000 | .many_mut_pointer, |
| | 2001 | .c_const_pointer, |
| | 2002 | .c_mut_pointer, |
| 1890 | .single_const_pointer_to_comptime_int, | 2003 | .single_const_pointer_to_comptime_int, |
| 1891 | .const_slice_u8, | 2004 | .const_slice_u8, |
| 1892 | .u8, | 2005 | .u8, |
| ... | @@ -1947,6 +2060,10 @@ pub const Type = extern union { | ... | @@ -1947,6 +2060,10 @@ pub const Type = extern union { |
| 1947 | .array_u8_sentinel_0, | 2060 | .array_u8_sentinel_0, |
| 1948 | .single_const_pointer, | 2061 | .single_const_pointer, |
| 1949 | .single_mut_pointer, | 2062 | .single_mut_pointer, |
| | 2063 | .many_const_pointer, |
| | 2064 | .many_mut_pointer, |
| | 2065 | .c_const_pointer, |
| | 2066 | .c_mut_pointer, |
| 1950 | .single_const_pointer_to_comptime_int, | 2067 | .single_const_pointer_to_comptime_int, |
| 1951 | .const_slice_u8, | 2068 | .const_slice_u8, |
| 1952 | .u8, | 2069 | .u8, |
| ... | @@ -2027,6 +2144,10 @@ pub const Type = extern union { | ... | @@ -2027,6 +2144,10 @@ pub const Type = extern union { |
| 2027 | .array_u8_sentinel_0, | 2144 | .array_u8_sentinel_0, |
| 2028 | .single_const_pointer, | 2145 | .single_const_pointer, |
| 2029 | .single_mut_pointer, | 2146 | .single_mut_pointer, |
| | 2147 | .many_const_pointer, |
| | 2148 | .many_mut_pointer, |
| | 2149 | .c_const_pointer, |
| | 2150 | .c_mut_pointer, |
| 2030 | .single_const_pointer_to_comptime_int, | 2151 | .single_const_pointer_to_comptime_int, |
| 2031 | .const_slice_u8, | 2152 | .const_slice_u8, |
| 2032 | .optional, | 2153 | .optional, |
| ... | @@ -2109,7 +2230,13 @@ pub const Type = extern union { | ... | @@ -2109,7 +2230,13 @@ pub const Type = extern union { |
| 2109 | ty = ty.elemType(); | 2230 | ty = ty.elemType(); |
| 2110 | continue; | 2231 | continue; |
| 2111 | }, | 2232 | }, |
| 2112 | .single_const_pointer, .single_mut_pointer => { | 2233 | .many_const_pointer, |
| | 2234 | .many_mut_pointer, |
| | 2235 | .c_const_pointer, |
| | 2236 | .c_mut_pointer, |
| | 2237 | .single_const_pointer, |
| | 2238 | .single_mut_pointer, |
| | 2239 | => { |
| 2113 | const ptr = ty.castPointer().?; | 2240 | const ptr = ty.castPointer().?; |
| 2114 | ty = ptr.pointee_type; | 2241 | ty = ptr.pointee_type; |
| 2115 | continue; | 2242 | continue; |
| ... | @@ -2167,11 +2294,17 @@ pub const Type = extern union { | ... | @@ -2167,11 +2294,17 @@ pub const Type = extern union { |
| 2167 | .array_u8_sentinel_0, | 2294 | .array_u8_sentinel_0, |
| 2168 | .single_const_pointer, | 2295 | .single_const_pointer, |
| 2169 | .single_mut_pointer, | 2296 | .single_mut_pointer, |
| | 2297 | .many_const_pointer, |
| | 2298 | .many_mut_pointer, |
| 2170 | .optional, | 2299 | .optional, |
| 2171 | .optional_single_mut_pointer, | 2300 | .optional_single_mut_pointer, |
| 2172 | .optional_single_const_pointer, | 2301 | .optional_single_const_pointer, |
| 2173 | .enum_literal, | 2302 | .enum_literal, |
| 2174 | => return false, | 2303 | => return false, |
| | 2304 | |
| | 2305 | .c_const_pointer, |
| | 2306 | .c_mut_pointer, |
| | 2307 | => return true, |
| 2175 | }; | 2308 | }; |
| 2176 | } | 2309 | } |
| 2177 | | 2310 | |
| ... | @@ -2231,6 +2364,10 @@ pub const Type = extern union { | ... | @@ -2231,6 +2364,10 @@ pub const Type = extern union { |
| 2231 | array_sentinel, | 2364 | array_sentinel, |
| 2232 | single_const_pointer, | 2365 | single_const_pointer, |
| 2233 | single_mut_pointer, | 2366 | single_mut_pointer, |
| | 2367 | many_const_pointer, |
| | 2368 | many_mut_pointer, |
| | 2369 | c_const_pointer, |
| | 2370 | c_mut_pointer, |
| 2234 | int_signed, | 2371 | int_signed, |
| 2235 | int_unsigned, | 2372 | int_unsigned, |
| 2236 | function, | 2373 | function, |
| ... | @@ -2272,7 +2409,7 @@ pub const Type = extern union { | ... | @@ -2272,7 +2409,7 @@ pub const Type = extern union { |
| 2272 | elem_type: Type, | 2409 | elem_type: Type, |
| 2273 | }; | 2410 | }; |
| 2274 | | 2411 | |
| 2275 | pub const Pointer = struct { | 2412 | pub const PointerSimple = struct { |
| 2276 | base: Payload, | 2413 | base: Payload, |
| 2277 | | 2414 | |
| 2278 | pointee_type: Type, | 2415 | pointee_type: Type, |