mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user