mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-22 19:49:49 +00:00
Adjust to changes in the APInt interface.
llvm-svn: 34681
This commit is contained in:
parent
9e66d0921a
commit
8178fd7bd5
@ -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
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user