From 94e35b710cb2910fdecd37d04f97826a86162fd6 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 11 Jul 2022 10:56:13 +0300 Subject: [PATCH] markused: fix C compilation failures on `-skip-unused -profile` --- vlib/v/markused/markused.v | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vlib/v/markused/markused.v b/vlib/v/markused/markused.v index 02cfa15fcc..e7197bf836 100644 --- a/vlib/v/markused/markused.v +++ b/vlib/v/markused/markused.v @@ -186,6 +186,14 @@ pub fn mark_used(mut table ast.Table, pref &pref.Preferences, ast_files []&ast.F all_fn_root_names << k continue } + if pref.is_prof { + if k.starts_with('time.vpc_now') || k.starts_with('v.profile.') { + // needed for -profile + all_fn_root_names << k + continue + } + } + if method_receiver_typename == '&sync.Channel' { all_fn_root_names << k continue