Complex number should now follow the D ABI on x86. They're also treated as first class values now. Big change.

This commit is contained in:
Tomas Lindquist Olsen
2008-09-09 16:49:47 -07:00
parent 4e0b6b4bf0
commit 8e9b957bce
21 changed files with 179 additions and 229 deletions

View File

@@ -25,14 +25,14 @@ bool DtoIsPassedByRef(Type* type)
{
Type* typ = type->toBasetype();
TY t = typ->ty;
return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray || typ->iscomplex());
return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray);
}
bool DtoIsReturnedInArg(Type* type)
{
Type* typ = type->toBasetype();
TY t = typ->ty;
return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray || typ->iscomplex());
return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray);
}
unsigned DtoShouldExtend(Type* type)
@@ -541,15 +541,6 @@ void DtoStore(LLValue* src, LLValue* dst)
//st->setVolatile(gIR->func()->inVolatile);
}
bool DtoCanLoad(LLValue* ptr)
{
if (isaPointer(ptr->getType())) {
const LLType* data = ptr->getType()->getContainedType(0);
return data->isFirstClassType() && !(isaStruct(data) || isaArray(data));
}
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////
LLValue* DtoBitCast(LLValue* v, const LLType* t, const char* name)
@@ -770,3 +761,12 @@ const LLStructType* DtoModuleReferenceType()
gIR->module->addTypeName("ModuleReference", st);
return st;
}
//////////////////////////////////////////////////////////////////////////////////////////
LLValue* DtoAggrPair(const LLType* type, LLValue* V1, LLValue* V2, const char* name)
{
LLValue* res = llvm::UndefValue::get(type);
res = gIR->ir->CreateInsertValue(res, V1, 0, "tmp");
return gIR->ir->CreateInsertValue(res, V2, 1, name?name:"tmp");
}