| author | |
| committer | |
| log | 0b768cd9ddc4dde512647cd60617db23ed6ec434 |
| tree | f60e4bd2294d602f49ca3d69ae36d61db3a1f602 |
| parent | 3ea77badf94d996740337f6ce6e6612178627dd1 |
fixes #31926
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31930
Reviewed-by: Andrew Kelley <andrew@ziglang.org>4 files changed, 17 insertions(+), 7 deletions(-)
ci/aarch64-macos-release.sh+3| ... | @@ -55,6 +55,9 @@ stage3-release/bin/zig build test docs \ | ... | @@ -55,6 +55,9 @@ stage3-release/bin/zig build test docs \ |
| 55 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe | 55 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe |
| 56 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug | 56 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug |
| 57 | 57 | ||
| 58 | # Ensure that reduce compiles | ||
| 59 | stage3-release/bin/zig reduce -h | ||
| 60 | |||
| 58 | # Ensure that stage3 and stage4 are byte-for-byte identical. | 61 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 59 | stage3-release/bin/zig build \ | 62 | stage3-release/bin/zig build \ |
| 60 | --maxrss ${ZSF_MAX_RSS:-0} \ | 63 | --maxrss ${ZSF_MAX_RSS:-0} \ |
ci/x86_64-linux-release.sh+3| ... | @@ -77,6 +77,9 @@ stage3-release/bin/zig build test docs \ | ... | @@ -77,6 +77,9 @@ stage3-release/bin/zig build test docs \ |
| 77 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe | 77 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe |
| 78 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug | 78 | stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug |
| 79 | 79 | ||
| 80 | # Ensure that reduce compiles | ||
| 81 | stage3-release/bin/zig reduce -h | ||
| 82 | |||
| 80 | # Ensure that stage3 and stage4 are byte-for-byte identical. | 83 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 81 | stage3-release/bin/zig build \ | 84 | stage3-release/bin/zig build \ |
| 82 | --prefix stage4-release \ | 85 | --prefix stage4-release \ |
ci/x86_64-windows-release.ps1+4| ... | @@ -61,6 +61,10 @@ CheckLastExitCode | ... | @@ -61,6 +61,10 @@ CheckLastExitCode |
| 61 | # stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug | 61 | # stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug |
| 62 | # CheckLastExitCode | 62 | # CheckLastExitCode |
| 63 | 63 | ||
| 64 | # Ensure that reduce compiles | ||
| 65 | stage3-release\bin\zig.exe build reduce -h | ||
| 66 | CheckLastExitCode | ||
| 67 | |||
| 64 | # Ensure that stage3 and stage4 are byte-for-byte identical. | 68 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 65 | Write-Output "Build and compare stage4..." | 69 | Write-Output "Build and compare stage4..." |
| 66 | stage3-release\bin\zig.exe build ` | 70 | stage3-release\bin\zig.exe build ` |
lib/compiler/reduce/Walk.zig+7-7| ... | @@ -6,9 +6,9 @@ const BuiltinFn = std.zig.BuiltinFn; | ... | @@ -6,9 +6,9 @@ const BuiltinFn = std.zig.BuiltinFn; |
| 6 | 6 | ||
| 7 | ast: *const Ast, | 7 | ast: *const Ast, |
| 8 | transformations: *std.array_list.Managed(Transformation), | 8 | transformations: *std.array_list.Managed(Transformation), |
| 9 | unreferenced_globals: std.StringArrayHashMapUnmanaged(Ast.Node.Index), | 9 | unreferenced_globals: std.array_hash_map.String(Ast.Node.Index), |
| 10 | in_scope_names: std.StringArrayHashMapUnmanaged(u32), | 10 | in_scope_names: std.array_hash_map.String(u32), |
| 11 | replace_names: std.StringArrayHashMapUnmanaged(u32), | 11 | replace_names: std.array_hash_map.String(u32), |
| 12 | gpa: std.mem.Allocator, | 12 | gpa: std.mem.Allocator, |
| 13 | arena: std.mem.Allocator, | 13 | arena: std.mem.Allocator, |
| 14 | 14 | ||
| ... | @@ -63,9 +63,9 @@ pub fn findTransformations( | ... | @@ -63,9 +63,9 @@ pub fn findTransformations( |
| 63 | .transformations = transformations, | 63 | .transformations = transformations, |
| 64 | .gpa = transformations.allocator, | 64 | .gpa = transformations.allocator, |
| 65 | .arena = arena, | 65 | .arena = arena, |
| 66 | .unreferenced_globals = .{}, | 66 | .unreferenced_globals = .empty, |
| 67 | .in_scope_names = .{}, | 67 | .in_scope_names = .empty, |
| 68 | .replace_names = .{}, | 68 | .replace_names = .empty, |
| 69 | }; | 69 | }; |
| 70 | defer { | 70 | defer { |
| 71 | walk.unreferenced_globals.deinit(walk.gpa); | 71 | walk.unreferenced_globals.deinit(walk.gpa); |
| ... | @@ -607,7 +607,7 @@ fn walkBlock( | ... | @@ -607,7 +607,7 @@ fn walkBlock( |
| 607 | { | 607 | { |
| 608 | try w.transformations.append(.{ .delete_var_decl = .{ | 608 | try w.transformations.append(.{ .delete_var_decl = .{ |
| 609 | .var_decl_node = stmt, | 609 | .var_decl_node = stmt, |
| 610 | .references = .{}, | 610 | .references = .empty, |
| 611 | } }); | 611 | } }); |
| 612 | const name_tok = var_decl.ast.mut_token + 1; | 612 | const name_tok = var_decl.ast.mut_token + 1; |
| 613 | const name_bytes = ast.tokenSlice(name_tok); | 613 | const name_bytes = ast.tokenSlice(name_tok); |