Skip to content

Commit 0e3c6fa

Browse files
committed
Refactor CIR regions to be in a separate array
1 parent 5e4eed9 commit 0e3c6fa

File tree

4 files changed

+265
-230
lines changed

4 files changed

+265
-230
lines changed

src/cache.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,11 @@ test "NodeStore cache round-trip" {
284284
.data_1 = 42,
285285
.data_2 = 100,
286286
.data_3 = 200,
287-
.region = .{ .start = .{ .offset = 0 }, .end = .{ .offset = 10 } },
288287
.tag = .expr_string,
289288
};
290289
const expr_idx = store.nodes.append(store.gpa, expr_node);
290+
const region = base.Region{ .start = .{ .offset = 0 }, .end = .{ .offset = 10 } };
291+
_ = store.regions.append(store.gpa, region);
291292

292293
try store.extra_data.append(store.gpa, 1234);
293294
try store.extra_data.append(store.gpa, 5678);

src/check/canonicalize/CIR.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ fn formatPatternIdxNode(gpa: std.mem.Allocator, pattern_idx: Pattern.Idx) SExpr
466466
return node;
467467
}
468468

469-
test "Node is 24 bytes" {
470-
try testing.expectEqual(24, @sizeOf(Node));
469+
test "Node is 16 bytes" {
470+
try testing.expectEqual(16, @sizeOf(Node));
471471
}
472472

473473
/// A working representation of a record field

src/check/canonicalize/Node.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const collections = @import("../../collections.zig");
1212
data_1: u32,
1313
data_2: u32,
1414
data_3: u32,
15-
region: base.Region,
1615
tag: Tag,
1716

1817
/// A list of nodes.

0 commit comments

Comments
 (0)