Fix NegExp not to use substraction.

This commit is contained in:
Christian Kamm
2008-09-21 19:28:57 +02:00
parent 2f479df1b2
commit 9ce414c174

View File

@@ -2024,18 +2024,8 @@ DValue* NegExp::toElem(IRState* p)
}
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);
}