mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-25 13:21:49 +01:00
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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user