summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CBackend
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
commite0fc4dfc2275a2c36583e5800854e64d5f5e3255 (patch)
tree6a3d057b6742055ed3a3592e58421a7b41b42f1e /llvm/lib/Target/CBackend
parent5d417e35bc36094f2e6519866fd25f4d0db6c551 (diff)
downloadbcm5719-llvm-e0fc4dfc2275a2c36583e5800854e64d5f5e3255.tar.gz
bcm5719-llvm-e0fc4dfc2275a2c36583e5800854e64d5f5e3255.zip
For 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. llvm-svn: 31063
Diffstat (limited to 'llvm/lib/Target/CBackend')
-rw-r--r--llvm/lib/Target/CBackend/Writer.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp
index 88113a0347a..f31f92018b8 100644
--- a/llvm/lib/Target/CBackend/Writer.cpp
+++ b/llvm/lib/Target/CBackend/Writer.cpp
@@ -460,7 +460,7 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
// 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 @@ void CWriter::printConstant(Constant *CPV) {
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 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I,
// 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());
OpenPOWER on IntegriCloud