store typeinfo also in local hash table to prevent multiple 'extern' declarations in the generated C code

This commit is contained in:
Araq
2016-12-10 02:28:54 +01:00
parent 4d22cff8ea
commit 94e1488c24

View File

@@ -1089,6 +1089,10 @@ proc genTypeInfo(m: BModule, t: PType): Rope =
discard cgsym(m, "TNimNode")
addf(m.s[cfsVars], "extern TNimType $1; /* $2 */$n",
[result, rope(typeToString(t))])
#return "(&".rope & result & ")".rope
#result = "NTI$1" % [rope($sig)]
# also store in local type section:
m.typeInfoMarker[sig] = result
return "(&".rope & result & ")".rope
result = "NTI$1" % [rope($sig)]