diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-25 03:05:33 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-25 03:05:33 +0000 |
commit | e99f4cf4ac380cfeb235fbae6d418c165a76f556 (patch) | |
tree | 6cf49f6922f918026e413915d87ab6485426509d /lib/Target/CBackend/CBackend.cpp | |
parent | 484147db9c8386e8e6840475b7911d7dbf8bd109 (diff) |
It seems likely that floats would need a cast too, because they are
ordinarily promoted to doubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 9e10d5bc78..61072d1340 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.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); |