builtin: implement -d exit_after_panic_message (speeds up `v test-parser` with gcc/clang)

pull/7163/head
Delyan Angelov 2020-12-06 14:20:22 +02:00
parent 5931b26737
commit 2be0c6af47
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,9 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
eprintln(' file: $file') eprintln(' file: $file')
eprintln(' line: ' + line_no.str()) eprintln(' line: ' + line_no.str())
eprintln('=========================================') eprintln('=========================================')
$if exit_after_panic_message ? {
C.exit(1)
}
// recent versions of tcc print better backtraces automatically // recent versions of tcc print better backtraces automatically
$if !tinyc { $if !tinyc {
print_backtrace_skipping_top_frames(1) print_backtrace_skipping_top_frames(1)
@ -58,6 +61,9 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
pub fn panic(s string) { pub fn panic(s string) {
eprintln('V panic: $s') eprintln('V panic: $s')
$if exit_after_panic_message ? {
C.exit(1)
}
// recent versions of tcc print better backtraces automatically // recent versions of tcc print better backtraces automatically
$if !tinyc { $if !tinyc {
print_backtrace() print_backtrace()