mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 12:40:11 +03:00
use OPpair instead of OPadd to form complex type
This commit is contained in:
parent
4aa543a2a2
commit
4379255e45
1 changed files with 6 additions and 1 deletions
|
@ -1671,6 +1671,7 @@ elem* toElem(Expression e, ref IRState irs)
|
|||
|
||||
elem* el = toElem(be.e1, irs);
|
||||
elem* er = toElem(be.e2, irs);
|
||||
|
||||
elem* e = el_bin(op,tym,el,er);
|
||||
|
||||
elem_setLoc(e,be.loc);
|
||||
|
@ -1752,7 +1753,11 @@ elem* toElem(Expression e, ref IRState irs)
|
|||
|
||||
elem* visitAdd(AddExp e)
|
||||
{
|
||||
return toElemBin(e, OPadd);
|
||||
int op = OPadd;
|
||||
if (e.type.ty == Tcomplex64 && e.e1.type.ty == Tfloat64 && e.e2.type.ty == Timaginary64)
|
||||
op = OPpair;
|
||||
|
||||
return toElemBin(e, op);
|
||||
}
|
||||
|
||||
/***************************************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue