| ... | ... | @@ -13,11 +13,23 @@ const Sema = @import("Sema.zig"); |
| 13 | 13 | const InternPool = @import("InternPool.zig"); |
| 14 | 14 | const Zir = std.zig.Zir; |
| 15 | 15 | const Decl = Zcu.Decl; |
| 16 | const dev = @import("dev.zig"); |
| 16 | 17 | |
| 17 | 18 | /// To use these crash report diagnostics, publish this panic in your main file |
| 18 | 19 | /// and add `pub const enable_segfault_handler = false;` to your `std_options`. |
| 19 | 20 | /// You will also need to call initialize() on startup, preferably as the very first operation in your program. |
| 20 | | pub const panic = if (build_options.enable_debug_extensions) compilerPanic else std.debug.defaultPanic; |
| 21 | pub const Panic = if (build_options.enable_debug_extensions) struct { |
| 22 | pub const call = compilerPanic; |
| 23 | pub const sentinelMismatch = std.debug.FormattedPanic.sentinelMismatch; |
| 24 | pub const unwrapError = std.debug.FormattedPanic.unwrapError; |
| 25 | pub const outOfBounds = std.debug.FormattedPanic.outOfBounds; |
| 26 | pub const startGreaterThanEnd = std.debug.FormattedPanic.startGreaterThanEnd; |
| 27 | pub const inactiveUnionField = std.debug.FormattedPanic.inactiveUnionField; |
| 28 | pub const messages = std.debug.FormattedPanic.messages; |
| 29 | } else if (dev.env == .bootstrap) |
| 30 | std.debug.SimplePanic |
| 31 | else |
| 32 | std.debug.FormattedPanic; |
| 21 | 33 | |
| 22 | 34 | /// Install signal handlers to identify crashes and report diagnostics. |
| 23 | 35 | pub fn initialize() void { |