diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-03-01 16:46:48 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-03-01 17:42:54 -0800 |
| commit | b60fc16b4f6b973ce2207fb28b77606d45961972 (patch) | |
| tree | eb90eb7d6cfcfa8d90f821b34c4e6d17e7159e1a /src/Compilation.zig | |
| parent | 155f5274ff4db3bc6e75ae5660cabab5bab22f42 (diff) | |
| download | zig-b60fc16b4f6b973ce2207fb28b77606d45961972.tar.gz zig-b60fc16b4f6b973ce2207fb28b77606d45961972.zip | |
compiler: audit debug mode checks
* Introduce `-Ddebug-extensions` for enabling compiler debug helpers
* Replace safety mode checks with `std.debug.runtime_safety`
* Replace debugger helper checks with `!builtin.strip_debug_info`
Sometimes, you just have to debug optimized compilers...
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 5e6ccf6c81..539a11faa0 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2191,14 +2191,14 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void try comp.performAllTheWork(main_progress_node); if (comp.module) |module| { - if (builtin.mode == .Debug and comp.verbose_intern_pool) { + if (build_options.enable_debug_extensions and comp.verbose_intern_pool) { std.debug.print("intern pool stats for '{s}':\n", .{ comp.root_name, }); module.intern_pool.dump(); } - if (builtin.mode == .Debug and comp.verbose_generic_instances) { + if (build_options.enable_debug_extensions and comp.verbose_generic_instances) { std.debug.print("generic instances for '{s}:0x{x}':\n", .{ comp.root_name, @as(usize, @intFromPtr(module)), |
