aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2007-10-07 11:45:55 +0000
committerNeil Booth <neil@daikokuya.co.uk>2007-10-07 11:45:55 +0000
commitccf596a53e16ea221a9bf8b3874a7d6afa71f1f4 (patch)
tree8323d17a395d8dbbb4d9c91239fc92e1ebb439fa /lib/VMCore/ConstantFold.cpp
parent33d4c92e78a32a8e07ab3ebc1487b07304875ddd (diff)
downloadexternal_llvm-ccf596a53e16ea221a9bf8b3874a7d6afa71f1f4.zip
external_llvm-ccf596a53e16ea221a9bf8b3874a7d6afa71f1f4.tar.gz
external_llvm-ccf596a53e16ea221a9bf8b3874a7d6afa71f1f4.tar.bz2
convertFromInteger, as originally written, expected sign-extended
input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 72077db..8234900 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -216,7 +216,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
uint32_t BitWidth = cast<IntegerType>(SrcTy)->getBitWidth();
APFloat apf = APFloat(APInt(DestTy->getPrimitiveSizeInBits(),
2, zero));
- (void)apf.convertFromInteger(api.getRawData(), BitWidth,
+ (void)apf.convertFromZeroExtendedInteger(api.getRawData(), BitWidth,
opc==Instruction::SIToFP,
APFloat::rmNearestTiesToEven);
return ConstantFP::get(DestTy, apf);