aboutsummaryrefslogtreecommitdiff
path: root/src/reduce
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-11-04 17:57:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-11-04 17:57:43 -0700
commit212aa717d73866863c593033a1c8bd3c853150ed (patch)
treed7c88acc5138c7a4146c8e3f55d6566aa0129378 /src/reduce
parent75efb736ce704fc43bdbe2410989c2b275d855e6 (diff)
downloadzig-212aa717d73866863c593033a1c8bd3c853150ed.tar.gz
zig-212aa717d73866863c593033a1c8bd3c853150ed.zip
zig reduce: add transformation for removing container fields
Diffstat (limited to 'src/reduce')
-rw-r--r--src/reduce/Walk.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/reduce/Walk.zig b/src/reduce/Walk.zig
index c740ac4f0b..fc64b0541c 100644
--- a/src/reduce/Walk.zig
+++ b/src/reduce/Walk.zig
@@ -165,7 +165,10 @@ fn walkMember(w: *Walk, decl: Ast.Node.Index) Error!void {
.container_field_init,
.container_field_align,
.container_field,
- => try walkContainerField(w, ast.fullContainerField(decl).?),
+ => {
+ try w.transformations.append(.{ .delete_node = decl });
+ try walkContainerField(w, ast.fullContainerField(decl).?);
+ },
.@"comptime" => {
try w.transformations.append(.{ .delete_node = decl });