Changes in directory llvm/lib/Target/CBackend:
Writer.cpp updated: 1.272 -> 1.273 --- Log message: For PR950: http://llvm.org/PR950 : This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. --- Diffs of the changes: (+11 -11) Writer.cpp | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.272 llvm/lib/Target/CBackend/Writer.cpp:1.273 --- llvm/lib/Target/CBackend/Writer.cpp:1.272 Thu Sep 28 18:19:29 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Fri Oct 20 02:07:24 2006 @@ -460,7 +460,7 @@ // Do not include the last character, which we know is null for (unsigned i = 0, e = CPA->getNumOperands()-1; i != e; ++i) { - unsigned char C = cast<ConstantInt>(CPA->getOperand(i))->getRawValue(); + unsigned char C = cast<ConstantInt>(CPA->getOperand(i))->getZExtValue(); // Print it out literally if it is a printable character. The only thing // to be careful about is when the last letter output was a hex escape @@ -642,31 +642,31 @@ break; case Type::SByteTyID: case Type::ShortTyID: - Out << cast<ConstantSInt>(CPV)->getValue(); + Out << cast<ConstantInt>(CPV)->getSExtValue(); break; case Type::IntTyID: - if ((int)cast<ConstantSInt>(CPV)->getValue() == (int)0x80000000) + if ((int)cast<ConstantInt>(CPV)->getSExtValue() == (int)0x80000000) Out << "((int)0x80000000U)"; // Handle MININT specially to avoid warning else - Out << cast<ConstantSInt>(CPV)->getValue(); + Out << cast<ConstantInt>(CPV)->getSExtValue(); break; case Type::LongTyID: - if (cast<ConstantSInt>(CPV)->isMinValue()) + if (cast<ConstantInt>(CPV)->isMinValue()) Out << "(/*INT64_MIN*/(-9223372036854775807LL)-1)"; else - Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; + Out << cast<ConstantInt>(CPV)->getSExtValue() << "ll"; break; case Type::UByteTyID: case Type::UShortTyID: - Out << cast<ConstantUInt>(CPV)->getValue(); + Out << cast<ConstantInt>(CPV)->getZExtValue(); break; case Type::UIntTyID: - Out << cast<ConstantUInt>(CPV)->getValue() << 'u'; + Out << cast<ConstantInt>(CPV)->getZExtValue() << 'u'; break; case Type::ULongTyID: - Out << cast<ConstantUInt>(CPV)->getValue() << "ull"; + Out << cast<ConstantInt>(CPV)->getZExtValue() << "ull"; break; case Type::FloatTyID: @@ -2002,14 +2002,14 @@ // Print out the -> operator if possible... if (TmpI != E && isa<StructType>(*TmpI)) { Out << (HasImplicitAddress ? "." : "->"); - Out << "field" << cast<ConstantUInt>(TmpI.getOperand())->getValue(); + Out << "field" << cast<ConstantInt>(TmpI.getOperand())->getZExtValue(); I = ++TmpI; } } for (; I != E; ++I) if (isa<StructType>(*I)) { - Out << ".field" << cast<ConstantUInt>(I.getOperand())->getValue(); + Out << ".field" << cast<ConstantInt>(I.getOperand())->getZExtValue(); } else { Out << '['; writeOperand(I.getOperand()); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits