v.pref: support a `-show-callgraph` option

pull/10922/head
Delyan Angelov 2021-07-24 08:49:50 +03:00
parent a4c9aeab14
commit c8e671d88c
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 4 additions and 0 deletions

View File

@ -120,6 +120,7 @@ pub mut:
is_vlines bool // turned on by -g, false by default (it slows down .tmp.c generation slightly).
show_cc bool // -showcc, print cc command
show_c_output bool // -show-c-output, print all cc output even if the code was compiled correctly
show_callgraph bool // -show-callgraph, print the program callgraph, in a Graphviz DOT format to stdout
// NB: passing -cg instead of -g will set is_vlines to false and is_debug to true, thus making v generate cleaner C files,
// which are sometimes easier to debug / inspect manually than the .tmp.c files by plain -g (when/if v line number generation breaks).
// use cached modules to speed up compilation.
@ -440,6 +441,9 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences
'-show-c-output' {
res.show_c_output = true
}
'-show-callgraph' {
res.show_callgraph = true
}
'-dump-c-flags' {
res.dump_c_flags = cmdline.option(current_args, arg, '-')
i++