changeset 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 ba9d6292572a
children ee8db0b7bb62
files gen/typinf.cpp runtime/CMakeLists.txt
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
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;
 
--- a/runtime/CMakeLists.txt	Sat Mar 28 09:00:32 2009 +0100
+++ b/runtime/CMakeLists.txt	Sat Mar 28 09:45:33 2009 +0100
@@ -44,6 +44,7 @@
 	endmacro(imports_file)
 	imports_file(import/ldc/cstdarg.di)
 	imports_file(import/ldc/intrinsics.di)
+	imports_file(internal/ldc/llvmasm.di)
 	imports_file(internal/ldc/bitmanip.d)
 	imports_file(internal/ldc/vararg.d)
 	# library names