From 1af31baf0ba447b6ea5a1456df5ba2d82dc26e56 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 19 Jan 2021 15:49:08 -0700 Subject: stage2: -Dlog enables all logging, log scopes can be set at runtime Previously you had to recompile if you wanted to change the log scopes that get printed. Now, log scopes can be set at runtime, and -Dlog controls whether all logging is available at runtime. Purpose here is a nicer development experience. Most likely stage2 developers will always want -Dlog enabled and then pass --debug-log scopes when debugging particular issues. --- src/Compilation.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index ad99e40541..7700fcdc4a 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1560,6 +1560,9 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor } } + log.debug("calling updateDecl on '{s}', type={}", .{ + decl.name, decl.typed_value.most_recent.typed_value.ty, + }); assert(decl.typed_value.most_recent.typed_value.ty.hasCodeGenBits()); self.bin_file.updateDecl(module, decl) catch |err| switch (err) { -- cgit v1.2.3