[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp ConstantFold.cpp
Reid Spencer
reid at x10sys.com
Tue Feb 27 12:25:41 PST 2007
Changes in directory llvm/lib/VMCore:
AsmWriter.cpp updated: 1.262 -> 1.263
ConstantFold.cpp updated: 1.141 -> 1.142
---
Log message:
Adjust to changes in the APInt interface.
---
Diffs of the changes: (+5 -5)
AsmWriter.cpp | 2 +-
ConstantFold.cpp | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.262 llvm/lib/VMCore/AsmWriter.cpp:1.263
--- llvm/lib/VMCore/AsmWriter.cpp:1.262 Tue Feb 27 02:34:09 2007
+++ llvm/lib/VMCore/AsmWriter.cpp Tue Feb 27 14:25:25 2007
@@ -464,7 +464,7 @@
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
Index: llvm/lib/VMCore/ConstantFold.cpp
diff -u llvm/lib/VMCore/ConstantFold.cpp:1.141 llvm/lib/VMCore/ConstantFold.cpp:1.142
--- llvm/lib/VMCore/ConstantFold.cpp:1.141 Tue Feb 27 13:29:54 2007
+++ llvm/lib/VMCore/ConstantFold.cpp Tue Feb 27 14:25:25 2007
@@ -198,13 +198,13 @@
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)) {
More information about the llvm-commits
mailing list