comparison gen/complex.cpp @ 1151:3cf0066e6faf

- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM. - Eliminated the DLRValue DValue. - Implemented proactive handling of l-value CastExpS. - Minor tweak in runtime memory.d .
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Sat, 28 Mar 2009 05:00:43 +0100
parents 4adf0f742896
children ae70c438b281
comparison
equal deleted inserted replaced
1150:2a687353c84d 1151:3cf0066e6faf
427 re = gIR->ir->CreateFPExt(re, toty, "tmp"); 427 re = gIR->ir->CreateFPExt(re, toty, "tmp");
428 im = gIR->ir->CreateFPExt(im, toty, "tmp"); 428 im = gIR->ir->CreateFPExt(im, toty, "tmp");
429 } 429 }
430 430
431 LLValue* pair = DtoAggrPair(DtoType(_to), re, im); 431 LLValue* pair = DtoAggrPair(DtoType(_to), re, im);
432 DValue* rval = new DImValue(_to, pair); 432 return new DImValue(_to, pair);
433
434 // if the value we're casting is not a lvalue, the cast value can't be either
435 if (!val->isLVal()) {
436 return rval;
437 }
438
439 // unfortunately at this point, the cast value can show up as the lvalue for += and similar expressions.
440 // so we need to maintain the storage
441 return new DLRValue(val, rval);
442 } 433 }
443 else if (to->isimaginary()) { 434 else if (to->isimaginary()) {
444 // FIXME: this loads both values, even when we only need one 435 // FIXME: this loads both values, even when we only need one
445 LLValue* v = val->getRVal(); 436 LLValue* v = val->getRVal();
446 LLValue* impart = gIR->ir->CreateExtractValue(v, 1, ".im_part"); 437 LLValue* impart = gIR->ir->CreateExtractValue(v, 1, ".im_part");