[svn r311] Fixed: structs no longer output two static typeinfos.

Updated the DtoTypeInfoOf helper a bit after figuring out how it worked.
This commit is contained in:
Tomas Lindquist Olsen
2008-06-21 17:57:36 +02:00
parent 5f247bb394
commit f3ea671ed6
2 changed files with 5 additions and 7 deletions

View File

@@ -383,6 +383,7 @@ void TypeInfoTypedefDeclaration::llvmDefine()
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 @@ void TypeInfoStructDeclaration::llvmDefine()
// 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);
}