markused: fix `v -gc boehm -skip-unused cmd/vls`

pull/13200/head
Delyan Angelov 2022-01-17 16:32:37 +02:00
parent 727c9fb4a1
commit 4597c74d1a
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 12 additions and 23 deletions

View File

@ -829,6 +829,8 @@ jobs:
run: pushd vls; v cmd/vls ; popd
- name: Build VLS with -prod
run: pushd vls; v -prod cmd/vls; popd
- name: Build VLS with -gc boehm -skip-unused
run: pushd vls; v -gc boehm -skip-unused cmd/vls; popd
## vsl
- name: Clone VSL
@ -863,6 +865,8 @@ jobs:
run: git clone --depth 1 https://github.com/vlang/vab
- name: Build vab
run: cd vab; ../v ./vab.v ; cd ..
- name: Build vab with -gc boehm -skip-unused
run: cd vab; ../v -gc boehm -skip-unused ./vab.v ; cd ..
## gitly
- name: Install markdown
@ -885,6 +889,8 @@ jobs:
run: mkdir -p ~/.vmodules/nedpals; git clone https://github.com/nedpals/vex ~/.vmodules/nedpals/vex
- name: Compile the simple Vex example
run: ./v ~/.vmodules/nedpals/vex/examples/simple_example.v
- name: Compile the simple Vex example with -gc boehm -skip-unused
run: ./v -gc boehm -skip-unused ~/.vmodules/nedpals/vex/examples/simple_example.v
- name: Run Vex Tests
run: ./v test ~/.vmodules/nedpals/vex

View File

@ -131,34 +131,17 @@ pub fn mark_used(mut table ast.Table, pref &pref.Preferences, ast_files []&ast.F
]
}
if pref.gc_mode in [.boehm_full_opt, .boehm_incr_opt] {
all_fn_root_names << [
'memdup_noscan',
'__new_array_noscan',
'__new_array_with_default_noscan',
'__new_array_with_array_default_noscan',
'new_array_from_c_array_noscan',
'22.clone_static_to_depth_noscan',
'22.clone_to_depth_noscan',
'22.reverse_noscan',
'22.repeat_to_depth_noscan',
'65558.pop_noscan',
'65558.push_noscan',
'65558.push_many_noscan',
'65558.insert_noscan',
'65558.insert_many_noscan',
'65558.prepend_noscan',
'65558.prepend_many_noscan',
'65558.reverse_noscan',
'65558.grow_cap_noscan',
'65558.grow_len_noscan',
]
}
is_noscan_whitelisted := pref.gc_mode in [.boehm_full_opt, .boehm_incr_opt]
for k, mut mfn in all_fns {
$if trace_skip_unused_all_fns ? {
println('k: $k | mfn: $mfn.name')
}
// _noscan functions/methods are selected when the `-gc boehm` is on:
if is_noscan_whitelisted && mfn.name.ends_with('_noscan') {
all_fn_root_names << k
continue
}
mut method_receiver_typename := ''
if mfn.is_method {
method_receiver_typename = table.type_to_str(mfn.receiver.typ)