<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div><br></div><div>I'm playing with llvm/clang and I have a problem when I try to use the -ast-print options for a file that uses long double.</div><div><br></div><div>The Basic/Targets.cpp file defined the x86 (and x86_64) long double type as <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><span style="color: rgb(92, 38, 153); ">APFloat</span>::x87DoubleExtended.</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><font class="Apple-style-span" color="#000000" face="Helvetica" size="3">Then, when the AST printer try to write a long double literal value (using</font> VisitFloatingLiteral()<font class="Apple-style-span" color="#000000" face="Helvetica" size="3">), it call <span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 10px; ">FloatingLiteral-><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">getValueAsDouble() </span><font class="Apple-style-span" color="#000000" face="Helvetica" size="3">and the later does not support long double, so it try to call <font class="Apple-style-span" color="#000000">convertToDouble() as a fallback and crash due to an invalid assertion. <span class="Apple-style-span" style="font-family: Courier; font-weight: bold; ">APFloat.cpp:2631: failed assertion `semantics == (const llvm::fltSemantics*)&IEEEdouble'</span></font></font></span></font></font></div><div><font class="Apple-style-span" face="Courier"><b><br></b></font></div><div>This is a know issue as some there is some comments like "<span class="Apple-style-span" style="color: rgb(0, 116, 0); font-family: Monaco; font-size: 10px; ">// FIXME: We need something for long double here." </span><font class="Apple-style-span" color="#000000">in <span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 10px; ">FloatingLiteral-><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">getValueAsDouble()</span><font class="Apple-style-span" color="#000000" face="Helvetica" size="3">, and "<span class="Apple-style-span" style="color: rgb(0, 116, 0); font-family: Monaco; font-size: 10px; ">// FIXME: print value more precisely." </span><font class="Apple-style-span" color="#000000">in <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">VisitFloatingLiteral()<span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">. </span></span></font></font></span></font></div><div><br></div><div>I wonder what will be the best way to solve those both issue.  Has somebody planned to add support for long double to APInt and APFloat ?</div></div></body></html>