diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-05 20:32:03 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-05 20:32:03 +0000 |
commit | b390921e55db36ee0ab1ca203c166f0f8c96f631 (patch) | |
tree | 34ae070223adab173fc20f31337498454dab9cd2 | |
parent | 22807868ad852806fd19e005945a910d3e9ab9ef (diff) |
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
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |