1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

autofree: remove old logic

This commit is contained in:
Alexander Medvednikov 2020-11-16 17:31:34 +01:00
parent 68077b7dbf
commit 8e473181ed

View File

@ -152,12 +152,6 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl, skip bool) {
if it.return_type == table.void_type { if it.return_type == table.void_type {
g.write_defer_stmts_when_needed() g.write_defer_stmts_when_needed()
} }
//
if g.autofree && !g.pref.experimental {
// TODO: remove this, when g.write_autofree_stmts_when_needed works properly
g.writeln('// af scope_vars (fn decl)')
g.autofree_scope_vars(it.body_pos.pos, it.body_pos.line_nr)
}
if it.return_type != table.void_type && it.stmts.len > 0 && it.stmts.last() !is ast.Return { if it.return_type != table.void_type && it.stmts.len > 0 && it.stmts.last() !is ast.Return {
default_expr := g.type_default(it.return_type) default_expr := g.type_default(it.return_type)
// TODO: perf? // TODO: perf?