From 303b65c0b9e0f257a72ee98acd17d8c3e6636a41 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 20 Jul 2020 22:51:17 +0200 Subject: [PATCH] roadmap: io streams --- 0.3_roadmap.txt | 1 + vlib/v/gen/cgen.v | 2 ++ vlib/v/gen/fn.v | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/0.3_roadmap.txt b/0.3_roadmap.txt index 1a4e4c01bb..6b62fe18ae 100644 --- a/0.3_roadmap.txt +++ b/0.3_roadmap.txt @@ -12,6 +12,7 @@ - make `-autofree` the default - parallel parser (and maybe checker/gen?) - `recover()` from panics +- IO streams diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 4945392907..70a2995145 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -742,6 +742,8 @@ fn (mut g Gen) stmt(node ast.Stmt) { } } if g.pref.use_cache { + // We are using prebuilt modules, we do not need to generate + // their functions in main.c. if node.mod != 'main' { skip = true } diff --git a/vlib/v/gen/fn.v b/vlib/v/gen/fn.v index 40cfa4fcde..6a0adb5592 100644 --- a/vlib/v/gen/fn.v +++ b/vlib/v/gen/fn.v @@ -107,7 +107,7 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl, skip bool) { fargs, fargtypes := g.fn_args(it.args, it.is_variadic) if it.no_body || (g.pref.use_cache && it.is_builtin) || skip { // Just a function header. Builtin function bodies are defined in builtin.o - g.definitions.writeln('); // NO BODY') + g.definitions.writeln(');') // // NO BODY') g.writeln(');') return } @@ -142,11 +142,11 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl, skip bool) { g.profile_fn(it.name) } g.stmts(it.stmts) - // //////////// + // if it.return_type == table.void_type { 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.autofree_scope_vars(it.body_pos.pos)