summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-06-19 21:00:17 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-06-19 21:00:17 +0000
commit7032c883cdf8da579fbf9bf499d36a711eef676f (patch)
tree6864217019cdb7d6def9efa578d959a11df56e44 /include
parentea44281d5da5096de50ce1cb358ff0c6f20e1a2a (diff)
downloadllvm-7032c883cdf8da579fbf9bf499d36a711eef676f.tar.gz
llvm-7032c883cdf8da579fbf9bf499d36a711eef676f.tar.bz2
llvm-7032c883cdf8da579fbf9bf499d36a711eef676f.tar.xz
[APFloat] Added isFiniteNonZero predicate.
This is the first patch in a series of patches to rename isNormal => isFiniteNonZero and isIEEENormal => isNormal. In order to prevent careless errors on my part the overall plan is: 1. Add the isFiniteNonZero predicate with tests. I can do this in a method independent of isNormal. (This step is this patch). 2. Convert all references to isNormal with isFiniteNonZero. My plan is to comment out isNormal locally and continually convert isNormal references => isFiniteNonZero until llvm/clang compiles. 3. Remove old isNormal and rename isIEEENormal to isNormal. 4. Look through all of said references from patch 2 and see if we can simplify them by using the new isNormal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/APFloat.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/llvm/ADT/APFloat.h b/include/llvm/ADT/APFloat.h
index 712cf91f6d..d104343844 100644
--- a/include/llvm/ADT/APFloat.h
+++ b/include/llvm/ADT/APFloat.h
@@ -395,6 +395,7 @@ public:
const fltSemantics &getSemantics() const { return *semantics; }
bool isNonZero() const { return category != fcZero; }
bool isNormal() const { return category == fcNormal; }
+ bool isFiniteNonZero() const { return isFinite() && !isZero(); }
bool isPosZero() const { return isZero() && !isNegative(); }
bool isNegZero() const { return isZero() && isNegative(); }