summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
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
commitb74c66618677ec27bc749c70b61d9b723c2e51c5 (patch)
treeaa4a194f382cf242fd704399685090e7b8aca85c /llvm/lib/VMCore/AsmWriter.cpp
parentc6aa80668e67972e9c8d4b4a3cdfc285def7c246 (diff)
downloadbcm5719-llvm-b74c66618677ec27bc749c70b61d9b723c2e51c5.tar.gz
bcm5719-llvm-b74c66618677ec27bc749c70b61d9b723c2e51c5.zip
Culling out use of unions for converting FP to bits and vice versa.
llvm-svn: 22838
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index e06bf50a9d1..eb049654608 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -29,6 +29,7 @@
#include "llvm/Support/CFG.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/MathExtras.h"
#include <algorithm>
using namespace llvm;
@@ -431,18 +432,9 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
// Otherwise we could not reparse it to exactly the same value, so we must
// output the string in hexadecimal format!
- //
- // Behave nicely in the face of C TBAA rules... see:
- // http://www.nullstone.com/htmls/category/aliastyp.htm
- //
- union {
- double D;
- uint64_t U;
- } V;
- V.D = CFP->getValue();
assert(sizeof(double) == sizeof(uint64_t) &&
"assuming that double is 64 bits!");
- Out << "0x" << utohexstr(V.U);
+ Out << "0x" << utohexstr(DoubleToBits(CFP->getValue()));
} else if (isa<ConstantAggregateZero>(CV)) {
Out << "zeroinitializer";
OpenPOWER on IntegriCloud