Yea, it's fine as is, lgtm<br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 23, 2017 at 3:34 AM Pavel Labath via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D34518#788213" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34518#788213</a>, @efriedma wrote:<br>
<br>
> > it looks like it doesn't easily support long double<br>
><br>
> APFloat::convertFromString works for every floating-point type supported by APFloat; clang uses it to parse floating-point literals.  There isn't any convenient way to convert an APFloat to a long double, but that's mostly because there hasn't been any demand for it; the format of long double is platform-dependent.<br>
<br>
<br>
I don't actually need long double support right now -- I just added it because it was easy.<br>
<br>
So the lack of long double would not be a show-stopper for using an APFloat-based solution. However, the convertFromString seems to assume that the input string has already been checked for correctness, as it is full of asserts. This means it's impossible to use it as a drop in replacement for the "parse me this string I got from the user" type of functionality, which is what the existing users of strtod do, and what I intended to use it for. That could of course be fixed, but given that we don't need the fancy features of APFloat here, and strtod is readily available everywhere, I am not sure if it's really worth it.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D34518" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34518</a><br>
<br>
<br>
<br>
</blockquote></div>