aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachOWriter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-11 18:32:33 +0000
committerDale Johannesen <dalej@apple.com>2007-09-11 18:32:33 +0000
commit3f6eb7419de437436265831fce92f62498556e08 (patch)
treecb752d4a86ec5c5dd783cfc421e30d0cf7600e87 /lib/CodeGen/MachOWriter.cpp
parent6320260e060ce4fc5d199d757b15a0f43be66029 (diff)
downloadexternal_llvm-3f6eb7419de437436265831fce92f62498556e08.zip
external_llvm-3f6eb7419de437436265831fce92f62498556e08.tar.gz
external_llvm-3f6eb7419de437436265831fce92f62498556e08.tar.bz2
Add APInt interfaces to APFloat (allows directly
access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachOWriter.cpp')
-rw-r--r--lib/CodeGen/MachOWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp
index af2555d..1c9b0fe 100644
--- a/lib/CodeGen/MachOWriter.cpp
+++ b/lib/CodeGen/MachOWriter.cpp
@@ -861,8 +861,8 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
break;
}
case Type::FloatTyID: {
- uint64_t val = FloatToBits(cast<ConstantFP>(PC)->
- getValueAPF().convertToFloat());
+ uint32_t val = (uint32_t)*cast<ConstantFP>(PC)->
+ getValueAPF().convertToAPInt().getRawData();
if (TD->isBigEndian())
val = ByteSwap_32(val);
ptr[0] = val;
@@ -872,8 +872,8 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
break;
}
case Type::DoubleTyID: {
- uint64_t val = DoubleToBits(cast<ConstantFP>(PC)->
- getValueAPF().convertToDouble());
+ uint64_t val = *cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
+ getRawData();
if (TD->isBigEndian())
val = ByteSwap_64(val);
ptr[0] = val;