@@ -3347,16 +3347,23 @@ pub fn intInfo(ip: *InternPool, ty: Index, target: std.Target) std.builtin.Type.
33473347/// Asserts the type is an integer or vector of integers.
33483348pub fn toUnsigned (ip : * InternPool , gpa : Allocator , ty : Index , target : std.Target ) Allocator.Error ! Index {
33493349 const tag = ip .zigTypeTag (ty ) orelse unreachable ;
3350- return switch (tag ) {
3351- .int = > try ip .get (gpa , .{ .int_type = .{
3352- .signedness = .unsigned ,
3353- .bits = ip .intInfo (ty , target ).bits ,
3354- } }),
3355- .vector = > try ip .get (gpa , .{ .vector_type = .{
3356- .len = ip .vectorLen (ty ),
3357- .child = try ip .toUnsigned (gpa , ip .childType (ty ), target ),
3358- } }),
3359- else = > unreachable ,
3350+ return switch (ty ) {
3351+ .usize_type , .isize_type = > .usize_type ,
3352+ .c_ushort_type , .c_short_type = > .c_ushort_type ,
3353+ .c_uint_type , .c_int_type = > .c_uint_type ,
3354+ .c_ulong_type , .c_long_type = > .c_ulong_type ,
3355+ .c_ulonglong_type , .c_longlong_type = > .c_ulonglong_type ,
3356+ else = > switch (tag ) {
3357+ .int = > try ip .get (gpa , .{ .int_type = .{
3358+ .signedness = .unsigned ,
3359+ .bits = ip .intInfo (ty , target ).bits ,
3360+ } }),
3361+ .vector = > try ip .get (gpa , .{ .vector_type = .{
3362+ .len = ip .vectorLen (ty ),
3363+ .child = try ip .toUnsigned (gpa , ip .childType (ty ), target ),
3364+ } }),
3365+ else = > unreachable ,
3366+ },
33603367 };
33613368}
33623369
0 commit comments