From af909f6c93f06e409e98cb90a9896aa5216f1563 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 8 Jun 2022 12:55:24 -0700 Subject: std.debug.Trace: improve API Now `std.debug.Trace` is a concrete type with pre-chosen defaults. `std.debug.ConfigurableTrace` can be used for more advanced cases. --- src/Module.zig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 724fa2ebc4..602b91a5ba 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -2529,11 +2529,9 @@ pub const SrcLoc = struct { /// where in semantic analysis the value got set. const TracedOffset = struct { x: i32, - trace: Trace = trace_init, + trace: std.debug.Trace = .{}, - const want_tracing = builtin.mode == .Debug; - const trace_init = if (want_tracing) std.debug.Trace(1, 3){} else {}; - const Trace = @TypeOf(trace_init); + const want_tracing = std.debug.Trace.enabled; }; /// Resolving a source location into a byte offset may require doing work -- cgit v1.2.3