1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

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(' line: ' + line_no.str())
eprintln('=========================================')
$if exit_after_panic_message ? {
C.exit(1)
}
// recent versions of tcc print better backtraces automatically
$if !tinyc {
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) {
eprintln('V panic: $s')
$if exit_after_panic_message ? {
C.exit(1)
}
// recent versions of tcc print better backtraces automatically
$if !tinyc {
print_backtrace()