On Thu, Aug 09, 2012 at 12:39:16PM +0200, Olaf Krzikalla wrote:
> Index: lib/AST/StmtPrinter.cpp
> ===================================================================
> --- lib/AST/StmtPrinter.cpp   (revision 160546)
> +++ lib/AST/StmtPrinter.cpp   (working copy)
> @@ -735,6 +740,19 @@
>    SmallString<16> Str;
>    Node->getValue().toString(Str);
>    OS << Str;
> +  if (Str.find_first_not_of("-0123456789") == std::string::npos)
> +  {
> +    OS << ".";  // trailing dot in order to separate from ints
> +  } 
> +
> +  // Emit suffixes.  Float literals are always a builtin float type.
> +  switch (Node->getType()->getAs<BuiltinType>()->getKind()) {
> +  default: llvm_unreachable("Unexpected type for float literal!");
> +  case BuiltinType::Half:       break; // FIXME: suffix?
> +  case BuiltinType::Double:     break; // no suffix.
> +  case BuiltinType::Float:      OS << 'F'; break;
> +  case BuiltinType::LongDouble: OS << 'L'; break;
> +  }
>  }
>  
>  void StmtPrinter::VisitImaginaryLiteral(ImaginaryLiteral *Node) {

LGTM
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to