diff --git a/cmd/v/v.v b/cmd/v/v.v index 8acf88f62f..c5eb59fdf4 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -53,6 +53,7 @@ fn main() { } timers.start('v start') timers.show('v start') + timers.start('parse_CLI_args') args := os.args[1..] // args = 123 if args.len == 0 || args[0] in ['-', 'repl'] { @@ -71,16 +72,11 @@ fn main() { } args_and_flags := util.join_env_vflags_and_os_args()[1..] prefs, command := pref.parse_args(external_tools, args_and_flags) - if prefs.is_verbose { - // println('args= ') - // println(args) // QTODO - // println('prefs= ') - // println(prefs) // QTODO - } if prefs.use_cache && os.user_os() == 'windows' { eprintln('-usecache is currently disabled on windows') exit(1) } + timers.show('parse_CLI_args') // Start calling the correct functions/external tools // Note for future contributors: Please add new subcommands in the `match` block below. if command in external_tools { diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 5148d0a4d1..ec3e4d50a3 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -458,8 +458,7 @@ fn (mut v Builder) setup_output_name() { fn (mut v Builder) vjs_cc() bool { vexe := pref.vexe_path() vdir := os.dir(vexe) - // Just create a C/JavaScript file and exit - // for example: `v -o v.c compiler` + // Just create a .c/.js file and exit, for example: `v -o v.c compiler` ends_with_c := v.pref.out_name.ends_with('.c') ends_with_js := v.pref.out_name.ends_with('.js') if ends_with_c || ends_with_js { @@ -489,8 +488,11 @@ fn (mut v Builder) vjs_cc() bool { } } } + msg_mv := 'os.mv_by_cp $v.out_name_c => $v.pref.out_name' + util.timing_start(msg_mv) // v.out_name_c may be on a different partition than v.out_name os.mv_by_cp(v.out_name_c, v.pref.out_name) or { panic(err) } + util.timing_measure(msg_mv) return true } return false