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 | |
parent | 66ed1099ff3591c61e008198bb5a30862e778fc0 (diff) |
Adjust to changes in the APInt interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34681 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 739c52129e..7c851f78fa 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -464,7 +464,7 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV, if (CI->getType() == Type::Int1Ty) Out << (CI->getZExtValue() ? "true" : "false"); else - Out << CI->getValue().toString(10,/*wantSigned=*/true); + Out << CI->getValue().toStringSigned(10); } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) { // We would like to output the FP constant value in exponential notation, // but we cannot do this if doing so will lose precision. Check here to 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)) { |