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

compiler: optimize mark_var_used() etc

This commit is contained in:
Alexander Medvednikov
2019-09-23 22:47:09 +03:00
parent 8d52d877fb
commit f27f3515ae
4 changed files with 26 additions and 19 deletions

View File

@ -62,6 +62,7 @@ struct Var {
mut:
typ string
name string
idx int // index in the local_vars array
is_arg bool
is_const bool
args []Var // function args
@ -288,6 +289,7 @@ fn (t mut Table) register_const(name, typ, mod string) {
typ: typ
is_const: true
mod: mod
idx: -1
}
}
@ -300,6 +302,7 @@ fn (p mut Parser) register_global(name, typ string) {
is_global: true
mod: p.mod
is_mut: true
idx: -1
}
}