aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SelectionDAGNodes.h
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2005-08-17 19:34:49 +0000
committerJim Laskey <jlaskey@mac.com>2005-08-17 19:34:49 +0000
commitcb6682fa44e13262bdef7dd22b4ba90f8c2e7b97 (patch)
tree7007ebf49e8bf80c2f04c0df03980f65ddd88077 /include/llvm/CodeGen/SelectionDAGNodes.h
parent8482dd894d7d64134f999d8e62bc9adf5cb239a9 (diff)
Culling out use of unions for converting FP to bits and vice versa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 3606c430ee..eb634a627c 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -25,6 +25,7 @@
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/MathExtras.h"
#include <cassert>
#include <vector>
@@ -742,17 +743,7 @@ public:
/// As such, this method can be used to do an exact bit-for-bit comparison of
/// two floating point values.
bool isExactlyValue(double V) const {
- union {
- double V;
- uint64_t I;
- } T1;
- T1.V = Value;
- union {
- double V;
- uint64_t I;
- } T2;
- T2.V = V;
- return T1.I == T2.I;
+ return DoubleToBits(V) == DoubleToBits(Value);
}
static bool classof(const ConstantFPSDNode *) { return true; }