diff options
| author | Owen Anderson <resistor@mac.com> | 2009-07-13 22:18:28 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-07-13 22:18:28 +0000 |
| commit | 76f49257ade1d702f831b4e21d616fe0c67b9d8f (patch) | |
| tree | 033b1e9a873ad04863a5c5849ab515ba31d17e60 /include | |
| parent | d3ecefe581feec837f2aa6f831d20d860cfb0e63 (diff) | |
| download | external_llvm-76f49257ade1d702f831b4e21d616fe0c67b9d8f.zip external_llvm-76f49257ade1d702f831b4e21d616fe0c67b9d8f.tar.gz external_llvm-76f49257ade1d702f831b4e21d616fe0c67b9d8f.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 'include')
| -rw-r--r-- | include/llvm/Constant.h | 4 | ||||
| -rw-r--r-- | include/llvm/Constants.h | 6 | ||||
| -rw-r--r-- | include/llvm/InstrTypes.h | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h index bccd417..3dc5881 100644 --- a/include/llvm/Constant.h +++ b/include/llvm/Constant.h @@ -64,6 +64,10 @@ public: /// getNullValue. virtual bool isNullValue() const = 0; + /// isNegativeZeroValue - Return true if the value is what would be returned + /// by getZeroValueForNegation. + virtual bool isNegativeZeroValue() const { return isNullValue(); } + /// canTrap - Return true if evaluation of this constant could trap. This is /// true for things like constant expressions that could divide by zero. bool canTrap() const; diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index b727de3..143f3ad 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -270,6 +270,12 @@ public: /// getNullValue. Don't depend on == for doubles to tell us it's zero, it /// considers -0.0 to be null as well as 0.0. :( 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(); + } /// isExactlyValue - We don't rely on operator== working on double values, as /// it returns true for things that are clearly not equal, like -0.0 and 0.0. diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index eb0b7b6..1ee2a4b 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -224,8 +224,8 @@ public: /// isNeg, isFNeg, isNot - Check if the given Value is a /// NEG, FNeg, or NOT instruction. /// - static bool isNeg(LLVMContext &Context, const Value *V); - static bool isFNeg(LLVMContext &Context, const Value *V); + static bool isNeg(const Value *V); + static bool isFNeg(const Value *V); static bool isNot(const Value *V); /// getNegArgument, getNotArgument - Helper functions to extract the |
