From c8e671d88c5ef383c4e16090fd4786c13374ee0b Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 24 Jul 2021 08:49:50 +0300 Subject: [PATCH] v.pref: support a `-show-callgraph` option --- vlib/v/pref/pref.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 07ad5ed296..a8c17d48a2 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -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++