[svn r296] Removed: the 'suite' dir, it never took off!

Fixed: foreach statement, key-type checks were buggy.
Fixed: setting LLVMDC versions on the command line is now an error.
Fixed: array compare runtime had incorrect param attrs on call.
Fixed: index expressions on dynamic array slices w/o storage was broken.
Fixed: scope classes had incorrect finalization in some cases.
Fixed: when outputting !ClassInfoS !OffsetTypeInfoS, static class members were trying to be included, crashing the compiler.
Fixed: calling LLVMDC with -inline but not any -O option caused assertion failure.
Changed: the runtime now uses a single interface to "get" to !TypeInfoS, part of eliminating duplicate !TypeInfo codegen.
This commit is contained in:
Tomas Lindquist Olsen
2008-06-19 17:30:32 +02:00
parent f235b71c7b
commit 928f7d4de5
19 changed files with 76 additions and 177 deletions

View File

@@ -383,19 +383,8 @@ void TypeInfoTypedefDeclaration::llvmDefine()
TypedefDeclaration *sd = tc->sym;
// TypeInfo base
//const LLPointerType* basept = isaPointer(initZ->getOperand(1)->getType());
//sinits.push_back(llvm::ConstantPointerNull::get(basept));
Logger::println("generating base typeinfo");
//sd->basetype = sd->basetype->merge();
sd->basetype->getTypeInfo(NULL); // generate vtinfo
assert(sd->basetype->vtinfo);
DtoForceDeclareDsymbol(sd->basetype->vtinfo);
assert(sd->basetype->vtinfo->ir.irGlobal->value);
assert(llvm::isa<llvm::Constant>(sd->basetype->vtinfo->ir.irGlobal->value));
LLConstant* castbase = llvm::cast<llvm::Constant>(sd->basetype->vtinfo->ir.irGlobal->value);
castbase = llvm::ConstantExpr::getBitCast(castbase, stype->getElementType(2));
LLConstant* castbase = DtoTypeInfoOf(sd->basetype, true);
assert(castbase->getType() == stype->getElementType(2));
sinits.push_back(castbase);
// char[] name
@@ -468,18 +457,8 @@ void TypeInfoEnumDeclaration::llvmDefine()
EnumDeclaration *sd = tc->sym;
// TypeInfo base
//const LLPointerType* basept = isaPointer(initZ->getOperand(1)->getType());
//sinits.push_back(llvm::ConstantPointerNull::get(basept));
Logger::println("generating base typeinfo");
//sd->basetype = sd->basetype->merge();
sd->memtype->getTypeInfo(NULL); // generate vtinfo
assert(sd->memtype->vtinfo);
DtoForceDeclareDsymbol(sd->memtype->vtinfo);
assert(llvm::isa<llvm::Constant>(sd->memtype->vtinfo->ir.irGlobal->value));
LLConstant* castbase = llvm::cast<llvm::Constant>(sd->memtype->vtinfo->ir.irGlobal->value);
castbase = llvm::ConstantExpr::getBitCast(castbase, stype->getElementType(2));
LLConstant* castbase = DtoTypeInfoOf(sd->memtype, true);
assert(castbase->getType() == stype->getElementType(2));
sinits.push_back(castbase);
// char[] name
@@ -543,13 +522,8 @@ static LLConstant* LLVM_D_Define_TypeInfoBase(Type* basetype, TypeInfoDeclaratio
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
// TypeInfo base
Logger::println("generating base typeinfo");
basetype->getTypeInfo(NULL);
assert(basetype->vtinfo);
DtoForceDeclareDsymbol(basetype->vtinfo);
assert(llvm::isa<llvm::Constant>(basetype->vtinfo->ir.irGlobal->value));
LLConstant* castbase = llvm::cast<llvm::Constant>(basetype->vtinfo->ir.irGlobal->value);
castbase = llvm::ConstantExpr::getBitCast(castbase, stype->getElementType(2));
LLConstant* castbase = DtoTypeInfoOf(basetype, true);
assert(castbase->getType() == stype->getElementType(2));
sinits.push_back(castbase);
// create the symbol
@@ -656,13 +630,8 @@ void TypeInfoStaticArrayDeclaration::llvmDefine()
// value typeinfo
assert(tinfo->ty == Tsarray);
TypeSArray *tc = (TypeSArray *)tinfo;
tc->next->getTypeInfo(NULL);
// get symbol
assert(tc->next->vtinfo);
DtoForceDeclareDsymbol(tc->next->vtinfo);
LLConstant* castbase = isaConstant(tc->next->vtinfo->ir.irGlobal->value);
castbase = llvm::ConstantExpr::getBitCast(castbase, stype->getElementType(2));
LLConstant* castbase = DtoTypeInfoOf(tc->next, true);
assert(castbase->getType() == stype->getElementType(2));
sinits.push_back(castbase);
// length
@@ -721,23 +690,13 @@ void TypeInfoAssociativeArrayDeclaration::llvmDefine()
TypeAArray *tc = (TypeAArray *)tinfo;
// value typeinfo
tc->next->getTypeInfo(NULL);
// get symbol
assert(tc->next->vtinfo);
DtoForceDeclareDsymbol(tc->next->vtinfo);
LLConstant* castbase = isaConstant(tc->next->vtinfo->ir.irGlobal->value);
castbase = llvm::ConstantExpr::getBitCast(castbase, stype->getElementType(2));
LLConstant* castbase = DtoTypeInfoOf(tc->next, true);
assert(castbase->getType() == stype->getElementType(2));
sinits.push_back(castbase);
// key typeinfo
tc->index->getTypeInfo(NULL);
// get symbol
assert(tc->index->vtinfo);
DtoForceDeclareDsymbol(tc->index->vtinfo);
castbase = isaConstant(tc->index->vtinfo->ir.irGlobal->value);
castbase = llvm::ConstantExpr::getBitCast(castbase, stype->getElementType(3));
castbase = DtoTypeInfoOf(tc->index, true);
assert(castbase->getType() == stype->getElementType(3));
sinits.push_back(castbase);
// create the symbol
@@ -1179,12 +1138,9 @@ void TypeInfoTupleDeclaration::llvmDefine()
for (size_t i = 0; i < dim; i++)
{
Argument *arg = (Argument *)tu->arguments->data[i];
arg->type->getTypeInfo(NULL);
DtoForceDeclareDsymbol(arg->type->vtinfo);
assert(arg->type->vtinfo->ir.irGlobal->value);
LLConstant* c = isaConstant(arg->type->vtinfo->ir.irGlobal->value);
c = llvm::ConstantExpr::getBitCast(c, tiTy);
arrInits.push_back(c);
LLConstant* castbase = DtoTypeInfoOf(arg->type, true);
assert(castbase->getType() == tiTy);
arrInits.push_back(castbase);
}
// build array type