# HG changeset patch # User Christian Kamm # Date 1222018137 -7200 # Node ID 5ced42a55aa907f1944fcf24b0f2cc3b328e7909 # Parent c60e122f4adad805f97ac78b7ef3faf104633779 Fix NegExp not to use substraction. diff -r c60e122f4ada -r 5ced42a55aa9 gen/toir.cpp --- 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); }