summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2016-12-10 02:28:54 +0100
committerAraq <rumpf_a@web.de>2016-12-10 02:28:54 +0100
commit94e1488c242e8507beddf669b6ba776d016af0a6 (patch)
treeb3999f01aea9154a1d8eeca749175fe10174eb00
parent4d22cff8ea4cdce9ef874a940a79ace482d503f1 (diff)
downloadNim-94e1488c242e8507beddf669b6ba776d016af0a6.tar.gz
store typeinfo also in local hash table to prevent multiple 'extern' declarations in the generated C code
-rw-r--r--compiler/ccgtypes.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 91086e642..b7e547528 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -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)]