v.pref: support a `-show-callgraph` option
							parent
							
								
									a4c9aeab14
								
							
						
					
					
						commit
						c8e671d88c
					
				|  | @ -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++ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue