Fix nasty bug in ::isNeg()

llvm-svn: 4470
This commit is contained in:
Chris Lattner 2002-10-31 17:09:06 +00:00
parent 8c7b93f7e3
commit 4d2997f25d
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ static inline bool isConstantAllOnes(const Value *V) {
bool BinaryOperator::isNeg(const Value *V) {
if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
return Bop->getOpcode() == Instruction::Sub &&
isa<Constant>(Bop->getOperand(0)) && cast<Constant>(V)->isNullValue();
Bop->getOperand(0) == Constant::getNullValue(Bop->getType());
return false;
}