From: Eli Friedman Date: Wed, 5 Oct 2011 20:32:03 +0000 (+0000) Subject: Use APFloat::toString to print APFloats more precisely in the AST printer. Patch... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b390921e55db36ee0ab1ca203c166f0f8c96f631;p=clang Use APFloat::toString to print APFloats more precisely in the AST printer. Patch by Olaf Krzikalla. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141208 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 57a3e61e54..dfa2612152 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -668,8 +668,9 @@ void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) { } } void StmtPrinter::VisitFloatingLiteral(FloatingLiteral *Node) { - // FIXME: print value more precisely. - OS << Node->getValueAsApproximateDouble(); + llvm::SmallString<16> Str; + Node->getValue().toString(Str); + OS << Str; } void StmtPrinter::VisitImaginaryLiteral(ImaginaryLiteral *Node) {