| ... | ... | @@ -301,6 +301,7 @@ pub const File = struct { |
| 301 | 301 | /// May be called before or after updateDeclExports but must be called |
| 302 | 302 | /// after allocateDeclIndexes for any given Decl. |
| 303 | 303 | pub fn updateDecl(base: *File, module: *Module, decl: *Module.Decl) !void { |
| 304 | log.debug("updateDecl {*} ({s}), type={}", .{ decl, decl.name, decl.ty }); |
| 304 | 305 | assert(decl.has_tv); |
| 305 | 306 | switch (base.tag) { |
| 306 | 307 | .coff => return @fieldParentPtr(Coff, "base", base).updateDecl(module, decl), |
| ... | ... | @@ -313,6 +314,9 @@ pub const File = struct { |
| 313 | 314 | } |
| 314 | 315 | |
| 315 | 316 | pub fn updateDeclLineNumber(base: *File, module: *Module, decl: *Module.Decl) !void { |
| 317 | log.debug("updateDeclLineNumber {*} ({s}), line={}", .{ |
| 318 | decl, decl.name, decl.src_line + 1, |
| 319 | }); |
| 316 | 320 | assert(decl.has_tv); |
| 317 | 321 | switch (base.tag) { |
| 318 | 322 | .coff => return @fieldParentPtr(Coff, "base", base).updateDeclLineNumber(module, decl), |
| ... | ... | @@ -326,6 +330,7 @@ pub const File = struct { |
| 326 | 330 | /// Must be called before any call to updateDecl or updateDeclExports for |
| 327 | 331 | /// any given Decl. |
| 328 | 332 | pub fn allocateDeclIndexes(base: *File, decl: *Module.Decl) !void { |
| 333 | log.debug("allocateDeclIndexes {*} ({s})", .{ decl, decl.name }); |
| 329 | 334 | switch (base.tag) { |
| 330 | 335 | .coff => return @fieldParentPtr(Coff, "base", base).allocateDeclIndexes(decl), |
| 331 | 336 | .elf => return @fieldParentPtr(Elf, "base", base).allocateDeclIndexes(decl), |
| ... | ... | @@ -437,6 +442,7 @@ pub const File = struct { |
| 437 | 442 | |
| 438 | 443 | /// Called when a Decl is deleted from the Module. |
| 439 | 444 | pub fn freeDecl(base: *File, decl: *Module.Decl) void { |
| 445 | log.debug("freeDecl {*} ({s})", .{ decl, decl.name }); |
| 440 | 446 | switch (base.tag) { |
| 441 | 447 | .coff => @fieldParentPtr(Coff, "base", base).freeDecl(decl), |
| 442 | 448 | .elf => @fieldParentPtr(Elf, "base", base).freeDecl(decl), |
| ... | ... | @@ -465,6 +471,7 @@ pub const File = struct { |
| 465 | 471 | decl: *Module.Decl, |
| 466 | 472 | exports: []const *Module.Export, |
| 467 | 473 | ) !void { |
| 474 | log.debug("updateDeclExports {*} ({s})", .{ decl, decl.name }); |
| 468 | 475 | assert(decl.has_tv); |
| 469 | 476 | switch (base.tag) { |
| 470 | 477 | .coff => return @fieldParentPtr(Coff, "base", base).updateDeclExports(module, decl, exports), |