| ... | @@ -10,6 +10,7 @@ const codegen = @import("codegen.zig"); | ... | @@ -10,6 +10,7 @@ const codegen = @import("codegen.zig"); |
| 10 | const c_codegen = @import("codegen/c.zig"); | 10 | const c_codegen = @import("codegen/c.zig"); |
| 11 | const log = std.log; | 11 | const log = std.log; |
| 12 | const DW = std.dwarf; | 12 | const DW = std.dwarf; |
| | 13 | const trace = @import("tracy.zig").trace; |
| 13 | | 14 | |
| 14 | // TODO Turn back on zig fmt when https://github.com/ziglang/zig/issues/5948 is implemented. | 15 | // TODO Turn back on zig fmt when https://github.com/ziglang/zig/issues/5948 is implemented. |
| 15 | // zig fmt: off | 16 | // zig fmt: off |
| ... | @@ -186,6 +187,9 @@ pub const File = struct { | ... | @@ -186,6 +187,9 @@ pub const File = struct { |
| 186 | } | 187 | } |
| 187 | | 188 | |
| 188 | pub fn flush(base: *File) !void { | 189 | pub fn flush(base: *File) !void { |
| | 190 | const tracy = trace(@src()); |
| | 191 | defer tracy.end(); |
| | 192 | |
| 189 | try switch (base.tag) { | 193 | try switch (base.tag) { |
| 190 | .elf => @fieldParentPtr(Elf, "base", base).flush(), | 194 | .elf => @fieldParentPtr(Elf, "base", base).flush(), |
| 191 | .c => @fieldParentPtr(C, "base", base).flush(), | 195 | .c => @fieldParentPtr(C, "base", base).flush(), |
| ... | @@ -1464,6 +1468,9 @@ pub const File = struct { | ... | @@ -1464,6 +1468,9 @@ pub const File = struct { |
| 1464 | } | 1468 | } |
| 1465 | | 1469 | |
| 1466 | pub fn updateDecl(self: *Elf, module: *Module, decl: *Module.Decl) !void { | 1470 | pub fn updateDecl(self: *Elf, module: *Module, decl: *Module.Decl) !void { |
| | 1471 | const tracy = trace(@src()); |
| | 1472 | defer tracy.end(); |
| | 1473 | |
| 1467 | var code_buffer = std.ArrayList(u8).init(self.allocator); | 1474 | var code_buffer = std.ArrayList(u8).init(self.allocator); |
| 1468 | defer code_buffer.deinit(); | 1475 | defer code_buffer.deinit(); |
| 1469 | | 1476 | |
| ... | @@ -1548,6 +1555,9 @@ pub const File = struct { | ... | @@ -1548,6 +1555,9 @@ pub const File = struct { |
| 1548 | decl: *const Module.Decl, | 1555 | decl: *const Module.Decl, |
| 1549 | exports: []const *Module.Export, | 1556 | exports: []const *Module.Export, |
| 1550 | ) !void { | 1557 | ) !void { |
| | 1558 | const tracy = trace(@src()); |
| | 1559 | defer tracy.end(); |
| | 1560 | |
| 1551 | // In addition to ensuring capacity for global_symbols, we also ensure capacity for freeing all of | 1561 | // In addition to ensuring capacity for global_symbols, we also ensure capacity for freeing all of |
| 1552 | // them, so that deleting exports is guaranteed to succeed. | 1562 | // them, so that deleting exports is guaranteed to succeed. |
| 1553 | try self.global_symbols.ensureCapacity(self.allocator, self.global_symbols.items.len + exports.len); | 1563 | try self.global_symbols.ensureCapacity(self.allocator, self.global_symbols.items.len + exports.len); |