refactoring: C codegen with fewer global variables

This commit is contained in:
Araq 2016-12-05 12:14:24 +01:00
commit ba38b83dd5
6 changed files with 79 additions and 78 deletions

View file

@ -1084,7 +1084,7 @@ proc genTypeInfo(m: BModule, t: PType): Rope =
let owner = t.skipTypes(typedescPtrs).owner.getModule
if owner != m.module:
# make sure the type info is created in the owner module
discard genTypeInfo(owner.bmod, origType)
discard genTypeInfo(m.g.modules[owner.position], origType)
# reference the type info as extern here
discard cgsym(m, "TNimType")
discard cgsym(m, "TNimNode")