implements --hint[globalvar]:on switch for quickly finding global variables

This commit is contained in:
Andreas Rumpf 2018-05-27 14:00:44 +02:00
commit dd8a6ef3a2
2 changed files with 7 additions and 3 deletions

View file

@ -569,6 +569,8 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
b.sons[j] = newSymNode(v)
checkNilable(c, v)
if sfCompileTime in v.flags: hasCompileTime = true
if v.flags * {sfGlobal, sfThread} == {sfGlobal}:
message(c.config, v.info, hintGlobalVar)
if hasCompileTime:
vm.setupCompileTimeVar(c.module, c.cache, c.graph, result)