v.gen.c: enable again parallel cgen for `-g`, make `-g` more robust

pull/12077/head
Delyan Angelov 2021-10-05 21:44:26 +03:00
parent 7cf9c198fe
commit 6d2c1f7e2c
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 9 additions and 1 deletions

View File

@ -527,7 +527,10 @@ pub fn (mut g Gen) gen_file() {
if g.pref.is_vlines { if g.pref.is_vlines {
g.vlines_path = util.vlines_escape_path(g.file.path, g.pref.ccompiler) g.vlines_path = util.vlines_escape_path(g.file.path, g.pref.ccompiler)
g.is_vlines_enabled = true
g.inside_ternary = 0
} }
g.stmts(g.file.stmts) g.stmts(g.file.stmts)
// Transfer embedded files // Transfer embedded files
for path in g.file.embedded_files { for path in g.file.embedded_files {

View File

@ -111,6 +111,12 @@ fn (mut g Gen) gen_fn_decl(node &ast.FnDecl, skip bool) {
return return
} }
old_is_vlines_enabled := g.is_vlines_enabled
g.is_vlines_enabled = true
defer {
g.is_vlines_enabled = old_is_vlines_enabled
}
tmp_defer_vars := g.defer_vars // must be here because of workflow tmp_defer_vars := g.defer_vars // must be here because of workflow
if !g.anon_fn { if !g.anon_fn {
g.defer_vars = []string{} g.defer_vars = []string{}

View File

@ -338,7 +338,6 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences
'-g' { '-g' {
res.is_debug = true res.is_debug = true
res.is_vlines = true res.is_vlines = true
res.no_parallel = true // TODO: fix `-g` with the parallel backend (line numbers are wrong)
res.build_options << arg res.build_options << arg
} }
'-cg' { '-cg' {