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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-10-20 07:07:24 +00:00
parent 6e7dd9db6b
commit b83eb6447b
70 changed files with 5043 additions and 4090 deletions

View File

@@ -60,11 +60,12 @@ namespace {
struct CaseCmp {
bool operator () (const LowerSwitch::Case& C1,
const LowerSwitch::Case& C2) {
if (const ConstantUInt* U1 = dyn_cast<const ConstantUInt>(C1.first))
return U1->getValue() < cast<const ConstantUInt>(C2.first)->getValue();
const ConstantSInt* S1 = dyn_cast<const ConstantSInt>(C1.first);
return S1->getValue() < cast<const ConstantSInt>(C2.first)->getValue();
const ConstantInt* CI1 = cast<const ConstantInt>(C1.first);
const ConstantInt* CI2 = cast<const ConstantInt>(C2.first);
if (CI1->getType()->isUnsigned())
return CI1->getZExtValue() < CI2->getZExtValue();
return CI1->getSExtValue() < CI2->getSExtValue();
}
};
@@ -129,7 +130,7 @@ BasicBlock* LowerSwitch::switchConvert(CaseItr Begin, CaseItr End,
Case& Pivot = *(Begin + Mid);
DEBUG(std::cerr << "Pivot ==> "
<< (int64_t)cast<ConstantInt>(Pivot.first)->getRawValue()
<< cast<ConstantInt>(Pivot.first)->getSExtValue()
<< "\n");
BasicBlock* LBranch = switchConvert(LHS.begin(), LHS.end(), Val,