mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
1. Sort switch cases using APInt safe comparison.
2. Make sure debug output of APInt values is safe for all bit widths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34855 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,7 +59,7 @@ namespace {
|
||||
|
||||
const ConstantInt* CI1 = cast<const ConstantInt>(C1.first);
|
||||
const ConstantInt* CI2 = cast<const ConstantInt>(C2.first);
|
||||
return CI1->getZExtValue() < CI2->getZExtValue();
|
||||
return CI1->getValue().ult(CI2->getValue());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ BasicBlock* LowerSwitch::switchConvert(CaseItr Begin, CaseItr End,
|
||||
|
||||
Case& Pivot = *(Begin + Mid);
|
||||
DOUT << "Pivot ==> "
|
||||
<< cast<ConstantInt>(Pivot.first)->getSExtValue() << "\n";
|
||||
<< cast<ConstantInt>(Pivot.first)->getValue().toStringSigned(10) << "\n";
|
||||
|
||||
BasicBlock* LBranch = switchConvert(LHS.begin(), LHS.end(), Val,
|
||||
OrigBlock, Default);
|
||||
|
||||
Reference in New Issue
Block a user