aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-17 11:33:21 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-17 11:33:21 -0700
commitd83983527323201c44f90a2f57ff58c746116e11 (patch)
tree3d021b9e778543056b34cf4f5fc8274abfea7885 /src
parent751bb12a9612c092541a63db72eb9ecc5eb1c4bd (diff)
downloadzig-d83983527323201c44f90a2f57ff58c746116e11.tar.gz
zig-d83983527323201c44f90a2f57ff58c746116e11.zip
stage2: add some debug logs for when link functions are called
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig3
-rw-r--r--src/link.zig7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 0f1cfd13c6..e792a9e6b6 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1944,9 +1944,6 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
}
}
- log.debug("calling updateDecl on '{s}', type={}", .{
- decl.name, decl.ty,
- });
assert(decl.ty.hasCodeGenBits());
self.bin_file.updateDecl(module, decl) catch |err| switch (err) {
diff --git a/src/link.zig b/src/link.zig
index ebf67048ae..33b73a3360 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -301,6 +301,7 @@ pub const File = struct {
/// May be called before or after updateDeclExports but must be called
/// after allocateDeclIndexes for any given Decl.
pub fn updateDecl(base: *File, module: *Module, decl: *Module.Decl) !void {
+ log.debug("updateDecl {*} ({s}), type={}", .{ decl, decl.name, decl.ty });
assert(decl.has_tv);
switch (base.tag) {
.coff => return @fieldParentPtr(Coff, "base", base).updateDecl(module, decl),
@@ -313,6 +314,9 @@ pub const File = struct {
}
pub fn updateDeclLineNumber(base: *File, module: *Module, decl: *Module.Decl) !void {
+ log.debug("updateDeclLineNumber {*} ({s}), line={}", .{
+ decl, decl.name, decl.src_line + 1,
+ });
assert(decl.has_tv);
switch (base.tag) {
.coff => return @fieldParentPtr(Coff, "base", base).updateDeclLineNumber(module, decl),
@@ -326,6 +330,7 @@ pub const File = struct {
/// Must be called before any call to updateDecl or updateDeclExports for
/// any given Decl.
pub fn allocateDeclIndexes(base: *File, decl: *Module.Decl) !void {
+ log.debug("allocateDeclIndexes {*} ({s})", .{ decl, decl.name });
switch (base.tag) {
.coff => return @fieldParentPtr(Coff, "base", base).allocateDeclIndexes(decl),
.elf => return @fieldParentPtr(Elf, "base", base).allocateDeclIndexes(decl),
@@ -437,6 +442,7 @@ pub const File = struct {
/// Called when a Decl is deleted from the Module.
pub fn freeDecl(base: *File, decl: *Module.Decl) void {
+ log.debug("freeDecl {*} ({s})", .{ decl, decl.name });
switch (base.tag) {
.coff => @fieldParentPtr(Coff, "base", base).freeDecl(decl),
.elf => @fieldParentPtr(Elf, "base", base).freeDecl(decl),
@@ -465,6 +471,7 @@ pub const File = struct {
decl: *Module.Decl,
exports: []const *Module.Export,
) !void {
+ log.debug("updateDeclExports {*} ({s})", .{ decl, decl.name });
assert(decl.has_tv);
switch (base.tag) {
.coff => return @fieldParentPtr(Coff, "base", base).updateDeclExports(module, decl, exports),