diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-06-24 09:58:02 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-06-24 09:58:02 +0000 |
commit | fdec0c7a7302702d08f1221609221018af8085ec (patch) | |
tree | 322c301ab9e6ba9963310adf2fd4df04d3f30602 /include | |
parent | fb25071a18ef24949f2f422c919b85340d6c6e2a (diff) | |
download | external_llvm-fdec0c7a7302702d08f1221609221018af8085ec.zip external_llvm-fdec0c7a7302702d08f1221609221018af8085ec.tar.gz external_llvm-fdec0c7a7302702d08f1221609221018af8085ec.tar.bz2 |
[APFloat] Added make{Zero,Inf} methods and implemented get{Zero,Inf} on top of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/APFloat.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/ADT/APFloat.h b/include/llvm/ADT/APFloat.h index e3b26f6..3d4a632 100644 --- a/include/llvm/ADT/APFloat.h +++ b/include/llvm/ADT/APFloat.h @@ -211,14 +211,18 @@ public: /// /// \param Negative True iff the number should be negative. static APFloat getZero(const fltSemantics &Sem, bool Negative = false) { - return APFloat(Sem, fcZero, Negative); + APFloat Val(Sem, uninitialized); + Val.makeZero(Negative); + return Val; } /// Factory for Positive and Negative Infinity. /// /// \param Negative True iff the number should be negative. static APFloat getInf(const fltSemantics &Sem, bool Negative = false) { - return APFloat(Sem, fcInfinity, Negative); + APFloat Val(Sem, uninitialized); + Val.makeInf(Negative); + return Val; } /// Factory for QNaN values. @@ -498,6 +502,8 @@ private: void makeNaN(bool SNaN = false, bool Neg = false, const APInt *fill = 0); static APFloat makeNaN(const fltSemantics &Sem, bool SNaN, bool Negative, const APInt *fill); + void makeInf(bool Neg = false); + void makeZero(bool Neg = false); /// @} |