]> granicus.if.org Git - clang/commitdiff
Use APFloat::toString to print APFloats more precisely in the AST printer. Patch...
authorEli Friedman <eli.friedman@gmail.com>
Wed, 5 Oct 2011 20:32:03 +0000 (20:32 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Wed, 5 Oct 2011 20:32:03 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141208 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/StmtPrinter.cpp

index 57a3e61e543569b08d052048dbbb598e4e83f3f7..dfa2612152e172c824685a741870762945743028 100644 (file)
@@ -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) {