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/Sema.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/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 8976848bef..d47a016eb1 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -2505,7 +2505,7 @@ fn failWithOwnedErrorMsg(sema: *Sema, block: ?*Block, err_msg: *Module.ErrorMsg) ref: { errdefer err_msg.destroy(gpa); - if (crash_report.is_enabled and mod.comp.debug_compile_errors) { + if (build_options.enable_debug_extensions and mod.comp.debug_compile_errors) { var wip_errors: std.zig.ErrorBundle.Wip = undefined; wip_errors.init(gpa) catch unreachable; Compilation.addModuleErrorMsg(mod, &wip_errors, err_msg.*) catch unreachable; @@ -5758,7 +5758,7 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr const body = sema.code.bodySlice(extra.end, extra.data.body_len); // we check this here to avoid undefined symbols - if (!@import("build_options").have_llvm) + if (!build_options.have_llvm) return sema.fail(parent_block, src, "C import unavailable; Zig compiler built without LLVM extensions", .{}); var c_import_buf = std.ArrayList(u8).init(gpa); |
