import foo {.all.} reboot (#17706)

This commit is contained in:
Timothee Cour 2021-04-16 00:16:39 -07:00 • committed by GitHub
commit 8161b02897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 584 additions and 76 deletions

View file

@ -75,7 +75,7 @@ proc closeScope*(c: PContext) =
ensureNoMissingOrUnusedSymbols(c, c.currentScope)
rawCloseScope(c)
iterator allScopes(scope: PScope): PScope =
iterator allScopes*(scope: PScope): PScope =
var current = scope
while current != nil:
yield current
@ -311,11 +311,17 @@ proc addDeclAt*(c: PContext; scope: PScope, sym: PSym) =
if conflict != nil:
wrongRedefinition(c, sym.info, sym.name.s, conflict.info)
proc addInterfaceDeclAux(c: PContext, sym: PSym) =
if sfExported in sym.flags:
from ic / ic import addHidden
proc addInterfaceDeclAux*(c: PContext, sym: PSym, forceExport = false) =
if sfExported in sym.flags or forceExport:
# add to interface:
if c.module != nil: exportSym(c, sym)
else: internalError(c.config, sym.info, "addInterfaceDeclAux")
elif sym.kind in ExportableSymKinds and c.module != nil and isTopLevelInsideDeclaration(c, sym):
strTableAdd(semtabAll(c.graph, c.module), sym)
if c.config.symbolFiles != disabledSf:
addHidden(c.encoder, c.packedRepr, sym)
proc addInterfaceDeclAt*(c: PContext, scope: PScope, sym: PSym) =
addDeclAt(c, scope, sym)