Mercurial > projects > ldc
changeset 616:5ced42a55aa9
Fix NegExp not to use substraction.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 21 Sep 2008 19:28:57 +0200 |
parents | c60e122f4ada |
children | 634fbbdec390 |
files | gen/toir.cpp |
diffstat | 1 files changed, 2 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/toir.cpp Sun Sep 21 18:41:27 2008 +0200 +++ b/gen/toir.cpp Sun Sep 21 19:28:57 2008 +0200 @@ -2024,18 +2024,8 @@ } LLValue* val = l->getRVal(); - Type* t = type->toBasetype(); - - LLValue* zero = 0; - if (t->isintegral()) - zero = llvm::ConstantInt::get(val->getType(), 0, true); - else if (t->isfloating()) { - zero = DtoConstFP(type, 0.0); - } - else - assert(0); - - val = llvm::BinaryOperator::createSub(zero,val,"tmp",p->scopebb()); + + val = gIR->ir->CreateNeg(val,"negval"); return new DImValue(type, val); }