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