[LLVMdev] StmtPrinter long double support.

Jean-Daniel Dupas devlists at shadowlab.org
Fri Jun 6 08:51:30 PDT 2008


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.

The Basic/Targets.cpp file defined the x86 (and x86_64) long double  
type as APFloat::x87DoubleExtended.
Then, when the AST printer try to write a long double literal value  
(using VisitFloatingLiteral()), it call FloatingLiteral- 
 >getValueAsDouble() and the later does not support long double, so it  
try to call convertToDouble() as a fallback and crash due to an  
invalid assertion. APFloat.cpp:2631: failed assertion `semantics ==  
(const llvm::fltSemantics*)&IEEEdouble'

This is a know issue as some there is some comments like "// FIXME: We  
need something for long double here." in FloatingLiteral- 
 >getValueAsDouble(), and "// FIXME: print value more precisely." in  

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 ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080606/c23706bc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080606/c23706bc/attachment.bin>

More information about the llvm-dev mailing list