fix disappearing printf when compiling with

pull/1082/head
Alexander Medvednikov 2019-07-10 22:07:56 +02:00
parent 4a8ba9756f
commit da51fea605
1 changed files with 0 additions and 10 deletions

View File

@ -509,13 +509,6 @@ fn (p mut Parser) fn_call(f Fn, method_ph int, receiver_var, receiver_type strin
p.error('function `$f.name` is private') p.error('function `$f.name` is private')
} }
p.calling_c = f.is_c p.calling_c = f.is_c
is_print := p.pref.is_prod &&// Hide prints only in prod
!p.pref.is_test &&
!p.builtin_pkg &&// Allow prints in builtin pkgs
f.is_c && f.name == 'printf'
if !p.cgen.nogen {
p.cgen.nogen = is_print
}
cgen_name := p.table.cgen_name(f) cgen_name := p.table.cgen_name(f)
// if p.pref.is_prof { // if p.pref.is_prof {
// p.cur_fn.called_fns << cgen_name // p.cur_fn.called_fns << cgen_name
@ -557,9 +550,6 @@ fn (p mut Parser) fn_call(f Fn, method_ph int, receiver_var, receiver_type strin
p.fn_call_args(f) p.fn_call_args(f)
p.gen(')') p.gen(')')
p.calling_c = false p.calling_c = false
if is_print {
p.cgen.nogen = false
}
// println('end of fn call typ=$f.typ') // println('end of fn call typ=$f.typ')
} }