aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-13 22:18:28 +0000
committerOwen Anderson <resistor@mac.com>2009-07-13 22:18:28 +0000
commitfa82b6eba4e1584d7dba291c28fe908272e1e002 (patch)
tree033b1e9a873ad04863a5c5849ab515ba31d17e60 /lib/VMCore/Instructions.cpp
parent0c39e3839a7d7e0dbd49b6b2d3e1bdc735b2b3aa (diff)
downloadexternal_llvm-fa82b6eba4e1584d7dba291c28fe908272e1e002.zip
external_llvm-fa82b6eba4e1584d7dba291c28fe908272e1e002.tar.gz
external_llvm-fa82b6eba4e1584d7dba291c28fe908272e1e002.tar.bz2
These don't really need contexts either.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 7c98d21..9a49bfc 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -1711,19 +1711,19 @@ static inline bool isConstantAllOnes(const Value *V) {
return false;
}
-bool BinaryOperator::isNeg(LLVMContext &Context, const Value *V) {
+bool BinaryOperator::isNeg(const Value *V) {
if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
if (Bop->getOpcode() == Instruction::Sub)
- return Bop->getOperand(0) ==
- Context.getZeroValueForNegation(Bop->getType());
+ if (Constant* C = dyn_cast<Constant>(Bop->getOperand(0)))
+ return C->isNegativeZeroValue();
return false;
}
-bool BinaryOperator::isFNeg(LLVMContext &Context, const Value *V) {
+bool BinaryOperator::isFNeg(const Value *V) {
if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
if (Bop->getOpcode() == Instruction::FSub)
- return Bop->getOperand(0) ==
- Context.getZeroValueForNegation(Bop->getType());
+ if (Constant* C = dyn_cast<Constant>(Bop->getOperand(0)))
+ return C->isNegativeZeroValue();
return false;
}