From 76109717595f9fb8958c1a3a22e47fdbfb7132c9 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Wed, 25 Jun 2003 03:05:33 +0000 Subject: [PATCH] It seems likely that floats would need a cast too, because they are ordinarily promoted to doubles. llvm-svn: 6894 --- llvm/lib/CWriter/Writer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index 9e10d5bc7827..61072d13402b 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -1033,7 +1033,8 @@ void CWriter::visitBinaryOperator(Instruction &I) { // We must cast the results of binary operations which might be promoted. bool needsCast = false; if ((I.getType() == Type::UByteTy) || (I.getType() == Type::SByteTy) - || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)) { + || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy) + || (I.getType() == Type::FloatTy)) { needsCast = true; Out << "(("; printType(Out, I.getType(), "", false, false);