authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-08-22 13:10:44-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-08-22 20:08:04-04:00
log4a132d4bce75aa9d81b5af0e8c2180ce1e0a3c60
tree37cb894b2473acb838f8102b7d99282a0d13913b
parentcbaff43b2a3697a168fcf9d5c022f2193d1fc9a0

Type: fix inconsistency between `zig fmt` and `@typeName`


4 files changed, 21 insertions(+), 21 deletions(-)

ci/x86_64-linux-debug.sh+1-1
...@@ -64,7 +64,7 @@ stage3-debug/bin/zig build \...@@ -64,7 +64,7 @@ stage3-debug/bin/zig build \
6464
65stage3-debug/bin/zig build test docs \65stage3-debug/bin/zig build test docs \
66 --maxrss 21000000000 \66 --maxrss 21000000000 \
67 -Dlldb=$HOME/deps/lldb-zig/Debug-f96d3e6fc/bin/lldb \67 -Dlldb=$HOME/deps/lldb-zig/Debug-62538077d/bin/lldb \
68 -fqemu \68 -fqemu \
69 -fwasmtime \69 -fwasmtime \
70 -Dstatic-llvm \70 -Dstatic-llvm \
ci/x86_64-linux-release.sh+1-1
...@@ -64,7 +64,7 @@ stage3-release/bin/zig build \...@@ -64,7 +64,7 @@ stage3-release/bin/zig build \
6464
65stage3-release/bin/zig build test docs \65stage3-release/bin/zig build test docs \
66 --maxrss 21000000000 \66 --maxrss 21000000000 \
67 -Dlldb=$HOME/deps/lldb-zig/Release-f96d3e6fc/bin/lldb \67 -Dlldb=$HOME/deps/lldb-zig/Release-62538077d/bin/lldb \
68 -fqemu \68 -fqemu \
69 -fwasmtime \69 -fwasmtime \
70 -Dstatic-llvm \70 -Dstatic-llvm \
src/Type.zig+1-1
...@@ -202,6 +202,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error...@@ -202,6 +202,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
202 .C => try writer.writeAll("[*c]"),202 .C => try writer.writeAll("[*c]"),
203 .Slice => try writer.writeAll("[]"),203 .Slice => try writer.writeAll("[]"),
204 }204 }
205 if (info.flags.is_allowzero and info.flags.size != .C) try writer.writeAll("allowzero ");
205 if (info.flags.alignment != .none or206 if (info.flags.alignment != .none or
206 info.packed_offset.host_size != 0 or207 info.packed_offset.host_size != 0 or
207 info.flags.vector_index != .none)208 info.flags.vector_index != .none)
...@@ -229,7 +230,6 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error...@@ -229,7 +230,6 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
229 }230 }
230 if (info.flags.is_const) try writer.writeAll("const ");231 if (info.flags.is_const) try writer.writeAll("const ");
231 if (info.flags.is_volatile) try writer.writeAll("volatile ");232 if (info.flags.is_volatile) try writer.writeAll("volatile ");
232 if (info.flags.is_allowzero and info.flags.size != .C) try writer.writeAll("allowzero ");
233233
234 try print(Type.fromInterned(info.child), writer, pt);234 try print(Type.fromInterned(info.child), writer, pt);
235 return;235 return;
test/src/Debugger.zig+18-18
...@@ -205,26 +205,26 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {...@@ -205,26 +205,26 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {
205 \\ single_volatile: *volatile u32 = @ptrFromInt(0x1018),205 \\ single_volatile: *volatile u32 = @ptrFromInt(0x1018),
206 \\ single_const_volatile: *const volatile u32 = @ptrFromInt(0x101c),206 \\ single_const_volatile: *const volatile u32 = @ptrFromInt(0x101c),
207 \\ single_allowzero: *allowzero u32 = @ptrFromInt(0x1020),207 \\ single_allowzero: *allowzero u32 = @ptrFromInt(0x1020),
208 \\ single_const_allowzero: *const allowzero u32 = @ptrFromInt(0x1024),208 \\ single_allowzero_const: *allowzero const u32 = @ptrFromInt(0x1024),
209 \\ single_volatile_allowzero: *volatile allowzero u32 = @ptrFromInt(0x1028),209 \\ single_allowzero_volatile: *allowzero volatile u32 = @ptrFromInt(0x1028),
210 \\ single_const_volatile_allowzero: *const volatile allowzero u32 = @ptrFromInt(0x102c),210 \\ single_allowzero_const_volatile: *allowzero const volatile u32 = @ptrFromInt(0x102c),
211 \\211 \\
212 \\ many: [*]u32 = @ptrFromInt(0x2010),212 \\ many: [*]u32 = @ptrFromInt(0x2010),
213 \\ many_const: [*]const u32 = @ptrFromInt(0x2014),213 \\ many_const: [*]const u32 = @ptrFromInt(0x2014),
214 \\ many_volatile: [*]volatile u32 = @ptrFromInt(0x2018),214 \\ many_volatile: [*]volatile u32 = @ptrFromInt(0x2018),
215 \\ many_const_volatile: [*]const volatile u32 = @ptrFromInt(0x201c),215 \\ many_const_volatile: [*]const volatile u32 = @ptrFromInt(0x201c),
216 \\ many_allowzero: [*]allowzero u32 = @ptrFromInt(0x2020),216 \\ many_allowzero: [*]allowzero u32 = @ptrFromInt(0x2020),
217 \\ many_const_allowzero: [*]const allowzero u32 = @ptrFromInt(0x2024),217 \\ many_allowzero_const: [*]allowzero const u32 = @ptrFromInt(0x2024),
218 \\ many_volatile_allowzero: [*]volatile allowzero u32 = @ptrFromInt(0x2028),218 \\ many_allowzero_volatile: [*]allowzero volatile u32 = @ptrFromInt(0x2028),
219 \\ many_const_volatile_allowzero: [*]const volatile allowzero u32 = @ptrFromInt(0x202c),219 \\ many_allowzero_const_volatile: [*]allowzero const volatile u32 = @ptrFromInt(0x202c),
220 \\ slice: []u32 = array[0..1],220 \\ slice: []u32 = array[0..1],
221 \\ slice_const: []const u32 = array[0..2],221 \\ slice_const: []const u32 = array[0..2],
222 \\ slice_volatile: []volatile u32 = array[0..3],222 \\ slice_volatile: []volatile u32 = array[0..3],
223 \\ slice_const_volatile: []const volatile u32 = array[0..4],223 \\ slice_const_volatile: []const volatile u32 = array[0..4],
224 \\ slice_allowzero: []allowzero u32 = array[4..4],224 \\ slice_allowzero: []allowzero u32 = array[4..4],
225 \\ slice_const_allowzero: []const allowzero u32 = array[4..5],225 \\ slice_allowzero_const: []allowzero const u32 = array[4..5],
226 \\ slice_volatile_allowzero: []volatile allowzero u32 = array[4..6],226 \\ slice_allowzero_volatile: []allowzero volatile u32 = array[4..6],
227 \\ slice_const_volatile_allowzero: []const volatile allowzero u32 = array[4..7],227 \\ slice_allowzero_const_volatile: []allowzero const volatile u32 = array[4..7],
228 \\228 \\
229 \\ c: [*c]u32 = @ptrFromInt(0x4010),229 \\ c: [*c]u32 = @ptrFromInt(0x4010),
230 \\ c_const: [*c]const u32 = @ptrFromInt(0x4014),230 \\ c_const: [*c]const u32 = @ptrFromInt(0x4014),
...@@ -254,17 +254,17 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {...@@ -254,17 +254,17 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {
254 \\ (*volatile u32) single_volatile = 0x0000000000001018254 \\ (*volatile u32) single_volatile = 0x0000000000001018
255 \\ (*const volatile u32) single_const_volatile = 0x000000000000101c255 \\ (*const volatile u32) single_const_volatile = 0x000000000000101c
256 \\ (*allowzero u32) single_allowzero = 0x0000000000001020256 \\ (*allowzero u32) single_allowzero = 0x0000000000001020
257 \\ (*const allowzero u32) single_const_allowzero = 0x0000000000001024257 \\ (*allowzero const u32) single_allowzero_const = 0x0000000000001024
258 \\ (*volatile allowzero u32) single_volatile_allowzero = 0x0000000000001028258 \\ (*allowzero volatile u32) single_allowzero_volatile = 0x0000000000001028
259 \\ (*const volatile allowzero u32) single_const_volatile_allowzero = 0x000000000000102c259 \\ (*allowzero const volatile u32) single_allowzero_const_volatile = 0x000000000000102c
260 \\ ([*]u32) many = 0x0000000000002010260 \\ ([*]u32) many = 0x0000000000002010
261 \\ ([*]const u32) many_const = 0x0000000000002014261 \\ ([*]const u32) many_const = 0x0000000000002014
262 \\ ([*]volatile u32) many_volatile = 0x0000000000002018262 \\ ([*]volatile u32) many_volatile = 0x0000000000002018
263 \\ ([*]const volatile u32) many_const_volatile = 0x000000000000201c263 \\ ([*]const volatile u32) many_const_volatile = 0x000000000000201c
264 \\ ([*]allowzero u32) many_allowzero = 0x0000000000002020264 \\ ([*]allowzero u32) many_allowzero = 0x0000000000002020
265 \\ ([*]const allowzero u32) many_const_allowzero = 0x0000000000002024265 \\ ([*]allowzero const u32) many_allowzero_const = 0x0000000000002024
266 \\ ([*]volatile allowzero u32) many_volatile_allowzero = 0x0000000000002028266 \\ ([*]allowzero volatile u32) many_allowzero_volatile = 0x0000000000002028
267 \\ ([*]const volatile allowzero u32) many_const_volatile_allowzero = 0x000000000000202c267 \\ ([*]allowzero const volatile u32) many_allowzero_const_volatile = 0x000000000000202c
268 \\ ([]u32) slice = len=1 {268 \\ ([]u32) slice = len=1 {
269 \\ (u32) [0] = 3010269 \\ (u32) [0] = 3010
270 \\ }270 \\ }
...@@ -284,14 +284,14 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {...@@ -284,14 +284,14 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {
284 \\ (u32) [3] = 3022284 \\ (u32) [3] = 3022
285 \\ }285 \\ }
286 \\ ([]allowzero u32) slice_allowzero = len=0 {}286 \\ ([]allowzero u32) slice_allowzero = len=0 {}
287 \\ ([]const allowzero u32) slice_const_allowzero = len=1 {287 \\ ([]allowzero const u32) slice_allowzero_const = len=1 {
288 \\ (u32) [0] = 3026288 \\ (u32) [0] = 3026
289 \\ }289 \\ }
290 \\ ([]volatile allowzero u32) slice_volatile_allowzero = len=2 {290 \\ ([]allowzero volatile u32) slice_allowzero_volatile = len=2 {
291 \\ (u32) [0] = 3026291 \\ (u32) [0] = 3026
292 \\ (u32) [1] = 3030292 \\ (u32) [1] = 3030
293 \\ }293 \\ }
294 \\ ([]const volatile allowzero u32) slice_const_volatile_allowzero = len=3 {294 \\ ([]allowzero const volatile u32) slice_allowzero_const_volatile = len=3 {
295 \\ (u32) [0] = 3026295 \\ (u32) [0] = 3026
296 \\ (u32) [1] = 3030296 \\ (u32) [1] = 3030
297 \\ (u32) [2] = 3034297 \\ (u32) [2] = 3034