diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-27 20:25:25 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-27 20:25:25 +0000 |
commit | 914c3bca870e448731b210b528a6a2f450ece772 (patch) | |
tree | 049749269f4c039dbade3f551e6e281dfc87c2aa /lib/VMCore/ConstantFold.cpp | |
parent | 66ed1099ff3591c61e008198bb5a30862e778fc0 (diff) | |
download | llvm-914c3bca870e448731b210b528a6a2f450ece772.tar.gz llvm-914c3bca870e448731b210b528a6a2f450ece772.tar.bz2 llvm-914c3bca870e448731b210b528a6a2f450ece772.tar.xz |
Adjust to changes in the APInt interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index d4b02d9915..106bf5f6a1 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -198,13 +198,13 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V, return 0; // Other pointer types cannot be casted case Instruction::UIToFP: if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) - if (CI->getType()->getBitWidth() <= APInt::APINT_BITS_PER_WORD) - return ConstantFP::get(DestTy, CI->getValue().roundToDouble(false)); + if (CI->getType()->getBitWidth() <= 64) + return ConstantFP::get(DestTy, CI->getValue().roundToDouble()); return 0; case Instruction::SIToFP: if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) - if (CI->getType()->getBitWidth() <= APInt::APINT_BITS_PER_WORD) - return ConstantFP::get(DestTy, CI->getValue().roundToDouble(true)); + if (CI->getType()->getBitWidth() <= 64) + return ConstantFP::get(DestTy, CI->getValue().signedRoundToDouble()); return 0; case Instruction::ZExt: if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) { |