cgen: do not generate `_vinit()` for translated .o code

master
Alexander Medvednikov 2022-05-20 19:28:18 +03:00
parent 17bba712bd
commit 53c217fe5e
2 changed files with 2 additions and 1 deletions

View File

@ -4717,7 +4717,7 @@ fn (g &Gen) checker_bug(s string, pos token.Pos) {
} }
fn (mut g Gen) write_init_function() { fn (mut g Gen) write_init_function() {
if g.pref.no_builtin { if g.pref.no_builtin || (g.pref.translated && g.pref.is_o) {
return return
} }
util.timing_start(@METHOD) util.timing_start(@METHOD)

View File

@ -13,6 +13,7 @@ pub fn mark_used(mut table ast.Table, pref &pref.Preferences, ast_files []&ast.F
defer { defer {
util.timing_measure(@METHOD) util.timing_measure(@METHOD)
} }
// Functions that must be generated and can't be skipped
mut all_fn_root_names := [ mut all_fn_root_names := [
'main.main', 'main.main',
'__new_array', '__new_array',