diff gen/typinf.cpp @ 290:ebaf65fc4726 trunk

[svn r311] Fixed: structs no longer output two static typeinfos. Updated the DtoTypeInfoOf helper a bit after figuring out how it worked.
author lindquist
date Sat, 21 Jun 2008 17:57:36 +0200
parents 665b81613475
children aaade6ded589
line wrap: on
line diff
--- a/gen/typinf.cpp	Sat Jun 21 16:22:29 2008 +0200
+++ b/gen/typinf.cpp	Sat Jun 21 17:57:36 2008 +0200
@@ -383,6 +383,7 @@
     TypedefDeclaration *sd = tc->sym;
 
     // TypeInfo base
+    sd->basetype = sd->basetype->merge(); // DMD does this!
     LLConstant* castbase = DtoTypeInfoOf(sd->basetype, true);
     assert(castbase->getType() == stype->getElementType(2));
     sinits.push_back(castbase);
@@ -962,8 +963,6 @@
 
     // create the symbol
     LLConstant* tiInit = llvm::ConstantStruct::get(stype, sinits);
-    llvm::GlobalVariable* gvar = new llvm::GlobalVariable(stype,true,llvm::GlobalValue::WeakLinkage,tiInit,toChars(),gIR->module);
-
     isaGlobalVar(this->ir.irGlobal->value)->setInitializer(tiInit);
 }