diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-22 11:06:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-22 11:06:13 -0500 |
| commit | c9e02d3e69f909a6eb215286c6109f2b3f1e68a2 (patch) | |
| tree | 2cd77390db945adb9b54ca9cdb5356bc66bb381d /src/Compilation.zig | |
| parent | 436e99d13ba188412b8a431b69cc9ff29c6bec4a (diff) | |
| parent | 248fb40dcc5eb50cf19e711197c5d1b210abf1b3 (diff) | |
| download | zig-c9e02d3e69f909a6eb215286c6109f2b3f1e68a2.tar.gz zig-c9e02d3e69f909a6eb215286c6109f2b3f1e68a2.zip | |
Merge pull request #14691 from jacobly0/ctype
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 717a396870..de433a6800 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3325,24 +3325,20 @@ fn processOneJob(comp: *Compilation, job: Job) !void { const decl_emit_h = emit_h.declPtr(decl_index); const fwd_decl = &decl_emit_h.fwd_decl; fwd_decl.shrinkRetainingCapacity(0); - var typedefs_arena = std.heap.ArenaAllocator.init(gpa); - defer typedefs_arena.deinit(); + var ctypes_arena = std.heap.ArenaAllocator.init(gpa); + defer ctypes_arena.deinit(); var dg: c_codegen.DeclGen = .{ .gpa = gpa, .module = module, .error_msg = null, - .decl_index = decl_index, + .decl_index = decl_index.toOptional(), .decl = decl, .fwd_decl = fwd_decl.toManaged(gpa), - .typedefs = c_codegen.TypedefMap.initContext(gpa, .{ .mod = module }), - .typedefs_arena = typedefs_arena.allocator(), + .ctypes = .{}, }; defer { - for (dg.typedefs.values()) |typedef| { - module.gpa.free(typedef.rendered); - } - dg.typedefs.deinit(); + dg.ctypes.deinit(gpa); dg.fwd_decl.deinit(); } |
