diff options
author | Jim Laskey <jlaskey@mac.com> | 2005-08-17 20:06:22 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2005-08-17 20:06:22 +0000 |
commit | 3a1eff732b36a663cdb9f07f4a9ccae6452eadcb (patch) | |
tree | a234ed0b089f91f3468b7ede6853feec5b06840c /lib | |
parent | b8df7c22131368abd3e7d6e0e4b0fc6ee74f8427 (diff) |
Move code dependency for MathExtras.h out of Constants.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Constants.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index a14b690313..d250002441 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -812,6 +812,15 @@ namespace llvm { static ValueMap<uint64_t, Type, ConstantFP> DoubleConstants; static ValueMap<uint32_t, Type, ConstantFP> FloatConstants; +bool ConstantFP::isNullValue() const { + return DoubleToBits(Val) == 0; +} + +bool ConstantFP::isExactlyValue(double V) const { + return DoubleToBits(V) == DoubleToBits(Val); +} + + ConstantFP *ConstantFP::get(const Type *Ty, double V) { if (Ty == Type::FloatTy) { // Force the value through memory to normalize it. |