diff options
author | Dale Johannesen <dalej@apple.com> | 2008-10-09 23:00:39 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-10-09 23:00:39 +0000 |
commit | 23a98551ab65eeb8fe5019df8b7db4891582a4bd (patch) | |
tree | 90d6731fd446c04df49383b8a23da0461337ba09 /lib/Target/CppBackend/CPPBackend.cpp | |
parent | 7111b02c734c992b8c97d9918118768026dad79e (diff) |
Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger. Restore return value to
IEEE754. Adjust all users accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 21e6735b32..fb836638e5 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -218,9 +218,10 @@ namespace { // This makes sure that conversion to/from floating yields the same binary // result so that we don't lose precision. void CppWriter::printCFP(const ConstantFP *CFP) { + bool ignored; APFloat APF = APFloat(CFP->getValueAPF()); // copy if (CFP->getType() == Type::FloatTy) - APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven); + APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); Out << "ConstantFP::get("; Out << "APFloat("; #if HAVE_PRINTF_A |