diff --git a/ci/aarch64-macos-release.sh b/ci/aarch64-macos-release.sh index e22b9ab9a01395b349b40936b70424e85abec3b7..4c4c240786ad05742f567db33ad9252bfffa7a9d 100755 --- a/ci/aarch64-macos-release.sh +++ b/ci/aarch64-macos-release.sh @@ -55,6 +55,9 @@ stage3-release/bin/zig build test docs \ stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug +# Ensure that reduce compiles +stage3-release/bin/zig reduce -h + # Ensure that stage3 and stage4 are byte-for-byte identical. stage3-release/bin/zig build \ --maxrss ${ZSF_MAX_RSS:-0} \ diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index b5701a1c93adc369e400a207924728805ec989dc..07e6678d10b20345cbfcd61472753435efd3bf66 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -77,6 +77,9 @@ stage3-release/bin/zig build test docs \ stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug +# Ensure that reduce compiles +stage3-release/bin/zig reduce -h + # Ensure that stage3 and stage4 are byte-for-byte identical. stage3-release/bin/zig build \ --prefix stage4-release \ diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1 index 7a606dbac4892c4045c40e0100a7bb755731b788..a16e2ddea58bf1075681b08736602076ff250d8a 100644 --- a/ci/x86_64-windows-release.ps1 +++ b/ci/x86_64-windows-release.ps1 @@ -61,6 +61,10 @@ CheckLastExitCode # stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug # CheckLastExitCode +# Ensure that reduce compiles +stage3-release\bin\zig.exe build reduce -h +CheckLastExitCode + # Ensure that stage3 and stage4 are byte-for-byte identical. Write-Output "Build and compare stage4..." stage3-release\bin\zig.exe build ` diff --git a/lib/compiler/reduce/Walk.zig b/lib/compiler/reduce/Walk.zig index 230354fee5eaf1e53916de525f3cfb4fe3d967c4..0234213c47db196a1ea47e4481f24f5d8a14cd51 100644 --- a/lib/compiler/reduce/Walk.zig +++ b/lib/compiler/reduce/Walk.zig @@ -6,9 +6,9 @@ const BuiltinFn = std.zig.BuiltinFn; ast: *const Ast, transformations: *std.array_list.Managed(Transformation), -unreferenced_globals: std.StringArrayHashMapUnmanaged(Ast.Node.Index), -in_scope_names: std.StringArrayHashMapUnmanaged(u32), -replace_names: std.StringArrayHashMapUnmanaged(u32), +unreferenced_globals: std.array_hash_map.String(Ast.Node.Index), +in_scope_names: std.array_hash_map.String(u32), +replace_names: std.array_hash_map.String(u32), gpa: std.mem.Allocator, arena: std.mem.Allocator, @@ -63,9 +63,9 @@ pub fn findTransformations( .transformations = transformations, .gpa = transformations.allocator, .arena = arena, - .unreferenced_globals = .{}, - .in_scope_names = .{}, - .replace_names = .{}, + .unreferenced_globals = .empty, + .in_scope_names = .empty, + .replace_names = .empty, }; defer { walk.unreferenced_globals.deinit(walk.gpa); @@ -607,7 +607,7 @@ fn walkBlock( { try w.transformations.append(.{ .delete_var_decl = .{ .var_decl_node = stmt, - .references = .{}, + .references = .empty, } }); const name_tok = var_decl.ast.mut_token + 1; const name_bytes = ast.tokenSlice(name_tok);