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

v.pref: support a -show-callgraph option

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

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). 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_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_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, // 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). // 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. // 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' { '-show-c-output' {
res.show_c_output = true res.show_c_output = true
} }
'-show-callgraph' {
res.show_callgraph = true
}
'-dump-c-flags' { '-dump-c-flags' {
res.dump_c_flags = cmdline.option(current_args, arg, '-') res.dump_c_flags = cmdline.option(current_args, arg, '-')
i++ i++