]> granicus.if.org Git - llvm/commit
Fix APFloat from string conversion for Inf
authorSerguei Katkov <serguei.katkov@azul.com>
Tue, 19 Dec 2017 04:27:39 +0000 (04:27 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Tue, 19 Dec 2017 04:27:39 +0000 (04:27 +0000)
commit643edab2b0ae598f4790b997e8eec5721bd00155
treef51d15e564d550940ba1fcc51c5880b74a61ffaa
parent4bebdd961c6413b15e46c3fecadcbe756580360e
Fix APFloat from string conversion for Inf

The method IEEEFloat::convertFromStringSpecials() does not recognize
the "+Inf" and "-Inf" strings but these strings are printed for
the double Infinities by the IEEEFloat::toString().

This patch adds the "+Inf" and "-Inf" strings to the list of recognized
patterns in IEEEFloat::convertFromStringSpecials().

Re-landing after fix.

Reviewers: sberg, bogner, majnemer, timshen, rnk, skatkov, gottesmm, bkramer, scanon, anna
Reviewed By: anna
Subscribers: mkazantsev, FlameTop, llvm-commits, reames, apilipenko
Differential Revision: https://reviews.llvm.org/D38030

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321054 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APFloat.cpp
lib/Support/StringRef.cpp
unittests/ADT/APFloatTest.cpp
unittests/ADT/StringRefTest.cpp