authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-06-25 10:53:29+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-06-25 19:47:31+02:00
log2808d9a8788bb1b1495b0424d71393ad7674dde9
tree9da195eb24bc20a108acab9c8510f0511c0d2ea8
parentcd3288a3f6e48ee381196a6d6437309472c513fe

llvm: remove modified types from `type_map`


2 files changed, 32 insertions(+), 0 deletions(-)

src/codegen/llvm.zig+1
...@@ -1717,6 +1717,7 @@ pub const Object = struct {...@@ -1717,6 +1717,7 @@ pub const Object = struct {
1717 }1717 }
17181718
1719 pub fn updateContainerType(o: *Object, pt: Zcu.PerThread, ty: InternPool.Index, success: bool) Allocator.Error!void {1719 pub fn updateContainerType(o: *Object, pt: Zcu.PerThread, ty: InternPool.Index, success: bool) Allocator.Error!void {
1720 _ = o.type_map.remove(ty);
1720 try o.type_pool.updateContainerType(pt, .{ .llvm = o }, ty, success);1721 try o.type_pool.updateContainerType(pt, .{ .llvm = o }, ty, success);
1721 if (o.named_enum_map.get(ty)) |function_index| {1722 if (o.named_enum_map.get(ty)) |function_index| {
1722 try o.updateIsNamedEnumValueFunction(.fromInterned(ty), function_index);1723 try o.updateIsNamedEnumValueFunction(.fromInterned(ty), function_index);
test/incremental/increase_array_field_length created+31
...@@ -0,0 +1,31 @@
1#update=initial version
2#file=main.zig
3const Big = struct { arr: [10]u8 };
4pub fn main(init: std.process.Init) !void {
5 var big: Big = undefined;
6 big = .{ .arr = @splat(123) };
7 var stdout_writer = std.Io.File.stdout().writerStreaming(init.io, &.{});
8 const index = big.arr.len - 1;
9 big.arr[index] = 234;
10 stdout_writer.interface.print("arr[{d}] = {d}\n", .{ index, big.arr[index] }) catch |err| switch (err) {
11 error.WriteFailed => return stdout_writer.err.?,
12 };
13}
14const std = @import("std");
15#expect_stdout="arr[9] = 234\n"
16
17#update=increase array length
18#file=main.zig
19const Big = struct { arr: [1000]u8 };
20pub fn main(init: std.process.Init) !void {
21 var big: Big = undefined;
22 big = .{ .arr = @splat(123) };
23 var stdout_writer = std.Io.File.stdout().writerStreaming(init.io, &.{});
24 const index = big.arr.len - 1;
25 big.arr[index] = 234;
26 stdout_writer.interface.print("arr[{d}] = {d}\n", .{ index, big.arr[index] }) catch |err| switch (err) {
27 error.WriteFailed => return stdout_writer.err.?,
28 };
29}
30const std = @import("std");
31#expect_stdout="arr[999] = 234\n"