diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-06 18:13:44 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-06 18:13:44 +0000 |
commit | b9de9f07d611823ea3371b65f87035f482ace2ad (patch) | |
tree | b314e17b0444f33dc3be37eaeaeaa8ea7dd1d17e /lib/CodeGen/MachOWriter.cpp | |
parent | 6d2c506cce46d4edcc314ca363b5e4ec4584cc38 (diff) | |
download | external_llvm-b9de9f07d611823ea3371b65f87035f482ace2ad.zip external_llvm-b9de9f07d611823ea3371b65f87035f482ace2ad.tar.gz external_llvm-b9de9f07d611823ea3371b65f87035f482ace2ad.tar.bz2 |
Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachOWriter.cpp')
-rw-r--r-- | lib/CodeGen/MachOWriter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp index 36060e1..af2555d 100644 --- a/lib/CodeGen/MachOWriter.cpp +++ b/lib/CodeGen/MachOWriter.cpp @@ -861,7 +861,8 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset, break; } case Type::FloatTyID: { - uint64_t val = FloatToBits(cast<ConstantFP>(PC)->getValue()); + uint64_t val = FloatToBits(cast<ConstantFP>(PC)-> + getValueAPF().convertToFloat()); if (TD->isBigEndian()) val = ByteSwap_32(val); ptr[0] = val; @@ -871,7 +872,8 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset, break; } case Type::DoubleTyID: { - uint64_t val = DoubleToBits(cast<ConstantFP>(PC)->getValue()); + uint64_t val = DoubleToBits(cast<ConstantFP>(PC)-> + getValueAPF().convertToDouble()); if (TD->isBigEndian()) val = ByteSwap_64(val); ptr[0] = val; |