Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 26, 2024
1 parent 4ebd26f commit 34f4ffc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions vlib/v/markused/markused.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
$if debug_used_features ? {
dump(table.used_features)
}
panic_deps := ['__new_array_with_default', 'str_intp', ref_array_idx_str + '.push',
string_idx_str + '.substr', array_idx_str + '.slice', array_idx_str + '.get',
panic_deps := ['__new_array_with_default', '__new_array_with_default_noscan', 'str_intp',
ref_array_idx_str + '.push', ref_array_idx_str + '.push_noscan',
string_idx_str +
'.substr', array_idx_str + '.slice', array_idx_str + '.get',
'v_fixed_index']
// real world apps
if table.used_features.builtin_types || table.used_features.as_cast
Expand Down Expand Up @@ -113,15 +115,13 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
// hello world apps
if pref_.ccompiler_type != .tinyc && 'no_backtrace' !in pref_.compile_defines {
// with backtrace on gcc/clang more code needs be generated
allow_noscan = true
core_fns << panic_deps
} else {
allow_noscan = false
}
}
if table.used_features.interpolation {
core_fns << panic_deps
allow_noscan = true
}
if table.used_features.dump {
core_fns << panic_deps
Expand All @@ -131,7 +131,6 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
'${builderptr_idx}.free',
'${builderptr_idx}.write_rune',
]
allow_noscan = true
}
if table.used_features.arr_init {
core_fns << 'new_array_from_c_array'
Expand All @@ -143,7 +142,6 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
core_fns << charptr_idx_str + '.vstring_literal'
if !allow_noscan {
core_fns << panic_deps
allow_noscan = true
}
}
if table.used_features.as_cast {
Expand Down

0 comments on commit 34f4ffc

Please sign in to comment.