Binary ops had the wrong result type for real op imaginary.

Fixes:
run/creal_03
This commit is contained in:
Christian Kamm
2008-08-17 12:21:53 +02:00
parent d0fec06c7d
commit 521a988e43
3 changed files with 17 additions and 15 deletions

View File

@@ -24,15 +24,15 @@ DValue* DtoBinSub(DValue* lhs, DValue* rhs)
//////////////////////////////////////////////////////////////////////////////
DValue* DtoBinMul(DValue* lhs, DValue* rhs)
DValue* DtoBinMul(Type* targettype, DValue* lhs, DValue* rhs)
{
LLValue* v = gIR->ir->CreateMul(lhs->getRVal(), rhs->getRVal(), "tmp");
return new DImValue( lhs->getType(), v );
return new DImValue( targettype, v );
}
//////////////////////////////////////////////////////////////////////////////
DValue* DtoBinDiv(DValue* lhs, DValue* rhs)
DValue* DtoBinDiv(Type* targettype, DValue* lhs, DValue* rhs)
{
Type* t = lhs->getType();
LLValue *l, *r;
@@ -45,12 +45,12 @@ DValue* DtoBinDiv(DValue* lhs, DValue* rhs)
res = gIR->ir->CreateSDiv(l, r, "tmp");
else
res = gIR->ir->CreateUDiv(l, r, "tmp");
return new DImValue( lhs->getType(), res );
return new DImValue( targettype, res );
}
//////////////////////////////////////////////////////////////////////////////
DValue* DtoBinRem(DValue* lhs, DValue* rhs)
DValue* DtoBinRem(Type* targettype, DValue* lhs, DValue* rhs)
{
Type* t = lhs->getType();
LLValue *l, *r;
@@ -63,5 +63,5 @@ DValue* DtoBinRem(DValue* lhs, DValue* rhs)
res = gIR->ir->CreateSRem(l, r, "tmp");
else
res = gIR->ir->CreateURem(l, r, "tmp");
return new DImValue( lhs->getType(), res );
return new DImValue( targettype, res );
}