diff gen/typinf.cpp @ 1156:19d4ded7204a

Fixed issue with runtime supplied typeinfo generating multiple symbols. Added new ldc.llvmasm import in runtime cmake file.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Sat, 28 Mar 2009 09:45:33 +0100
parents 3d1b16dabd25
children 79758fd2f48a
line wrap: on
line diff
--- a/gen/typinf.cpp	Sat Mar 28 09:00:32 2009 +0100
+++ b/gen/typinf.cpp	Sat Mar 28 09:45:33 2009 +0100
@@ -289,8 +289,13 @@
     LOG_SCOPE;
 
     IrGlobal* irg = new IrGlobal(tid);
-    irg->value = new llvm::GlobalVariable(irg->type.get(), true,
-        TYPEINFO_LINKAGE_TYPE, NULL, tid->mangle(), gIR->module);
+
+    std::string mangle(tid->mangle());
+
+    irg->value = gIR->module->getGlobalVariable(mangle);
+    if (!irg->value)
+        irg->value = new llvm::GlobalVariable(irg->type.get(), true,
+        TYPEINFO_LINKAGE_TYPE, NULL, mangle, gIR->module);
 
     tid->ir.irGlobal = irg;