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/Module.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/Module.zig')
| -rw-r--r-- | src/Module.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Module.zig b/src/Module.zig index ad6487b1eb..9c8fc01bf4 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -3203,8 +3203,8 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError const comp = zcu.comp; - const dump_air = builtin.mode == .Debug and comp.verbose_air; - const dump_llvm_ir = builtin.mode == .Debug and (comp.verbose_llvm_ir != null or comp.verbose_llvm_bc != null); + const dump_air = build_options.enable_debug_extensions and comp.verbose_air; + const dump_llvm_ir = build_options.enable_debug_extensions and (comp.verbose_llvm_ir != null or comp.verbose_llvm_bc != null); if (comp.bin_file == null and zcu.llvm_object == null and !dump_air and !dump_llvm_ir) { return; |
