profile: measure defer{} statements too

pull/4618/head
Delyan Angelov 2020-04-27 13:18:20 +03:00
parent fde929ee30
commit 73106b5f5e
1 changed files with 3 additions and 3 deletions

View File

@ -130,15 +130,15 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl) {
} }
fn (mut g Gen) write_defer_stmts_when_needed() { fn (mut g Gen) write_defer_stmts_when_needed() {
if g.defer_stmts.len > 0 {
g.write_defer_stmts()
}
if g.defer_profile_code.len > 0 { if g.defer_profile_code.len > 0 {
g.writeln('') g.writeln('')
g.writeln('\t// defer_profile_code') g.writeln('\t// defer_profile_code')
g.writeln(g.defer_profile_code) g.writeln(g.defer_profile_code)
g.writeln('') g.writeln('')
} }
if g.defer_stmts.len > 0 {
g.write_defer_stmts()
}
} }
fn (mut g Gen) fn_args(args []table.Arg, is_variadic bool) { fn (mut g Gen) fn_args(args []table.Arg, is_variadic bool) {