Fix APFloat from string conversion for Inf
authorSerguei Katkov <serguei.katkov@azul.com>
Thu, 19 Oct 2017 11:16:03 +0000 (11:16 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Thu, 19 Oct 2017 11:16:03 +0000 (11:16 +0000)
commit4f7d5ef2260f20f9773810b05eb085d97ddfc7c1
tree21be2bbc08addbefcae9d6610b7cc6de73a4c15a
parent7bf71008aa69e035832d610d6a658f8f09e1f97d
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().

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

llvm-svn: 316156
llvm/lib/Support/APFloat.cpp
llvm/unittests/ADT/APFloatTest.cpp