summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 462d7f01b0..e6ead6d96d 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -156,6 +156,8 @@ public:
virtual bool isNullValue() const {
return Val == 0;
}
+
+ bool isNegative() const { return Val.isNegative(); }
/// This is just a convenience method to make client code smaller for a
/// common code. It also correctly performs the comparison without the
@@ -263,22 +265,19 @@ public:
/// isValueValidForType - return true if Ty is big enough to represent V.
static bool isValueValidForType(const Type *Ty, const APFloat &V);
- inline const APFloat& getValueAPF() const { return Val; }
+ inline const APFloat &getValueAPF() const { return Val; }
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue. For ConstantFP, this is +0.0, but not -0.0. To handle the
/// two the same, use isZero().
virtual bool isNullValue() const;
- /// isNegativeZeroValue - Return true if the value is what would be returned
- /// by getZeroValueForNegation.
- virtual bool isNegativeZeroValue() const {
- return Val.isZero() && Val.isNegative();
- }
-
/// isZero - Return true if the value is positive or negative zero.
bool isZero() const { return Val.isZero(); }
+ /// isNegative - Return true if the sign bit is set.
+ bool isNegative() const { return Val.isNegative(); }
+
/// isNaN - Return true if the value is a NaN.
bool isNaN() const { return Val.isNaN(); }