| ... | ... | @@ -413,6 +413,8 @@ pub fn createEmpty(gpa: *Allocator, options: link.Options) !*Coff { |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | pub fn allocateDeclIndexes(self: *Coff, decl: *Module.Decl) !void { |
| 416 | if (self.llvm_ir_module) |_| return; |
| 417 | |
| 416 | 418 | try self.offset_table.ensureCapacity(self.base.allocator, self.offset_table.items.len + 1); |
| 417 | 419 | |
| 418 | 420 | if (self.offset_table_free_list.popOrNull()) |i| { |
| ... | ... | @@ -710,6 +712,8 @@ pub fn updateDecl(self: *Coff, module: *Module, decl: *Module.Decl) !void { |
| 710 | 712 | } |
| 711 | 713 | |
| 712 | 714 | pub fn freeDecl(self: *Coff, decl: *Module.Decl) void { |
| 715 | if (self.llvm_ir_module) |_| return; |
| 716 | |
| 713 | 717 | // Appending to free lists is allowed to fail because the free lists are heuristics based anyway. |
| 714 | 718 | self.freeTextBlock(&decl.link.coff); |
| 715 | 719 | self.offset_table_free_list.append(self.base.allocator, decl.link.coff.offset_table_index) catch {}; |
| ... | ... | @@ -1245,6 +1249,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void { |
| 1245 | 1249 | } |
| 1246 | 1250 | |
| 1247 | 1251 | pub fn getDeclVAddr(self: *Coff, decl: *const Module.Decl) u64 { |
| 1252 | assert(self.llvm_ir_module == null); |
| 1248 | 1253 | return self.text_section_virtual_address + decl.link.coff.text_offset; |
| 1249 | 1254 | } |
| 1250 | 1255 | |