mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
PR1255: case ranges.
IntItem cleanup. IntItemBase, IntItemConstantIntImp and IntItem merged into IntItem. All arithmetic operators was propogated from APInt. Also added comparison operators <,>,<=,>=. Currently you will find set of macros that propogates operators from APInt to IntItem in the beginning of IntegerSubset. Note that THESE MACROS WILL REMOVED after all passes will case-ranges compatible. Also note that these macros much smaller pain that something like this: if (V->getValue().ugt(AnotherV->getValue()) { ... } These changes made IntItem full featured integer object. It allows to make IntegerSubset class generic (move out all ConstantInt references inside and add unit-tests) in next commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157810 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -655,8 +655,8 @@ void Interpreter::visitSwitchInst(SwitchInst &I) {
|
||||
for (unsigned n = 0, en = Case.getNumItems(); n != en; ++n) {
|
||||
IntegersSubset::Range r = Case.getItem(n);
|
||||
// FIXME: Currently work with ConstantInt based numbers.
|
||||
const ConstantInt *LowCI = r.Low.getImplementation();
|
||||
const ConstantInt *HighCI = r.High.getImplementation();
|
||||
const ConstantInt *LowCI = r.Low.toConstantInt();
|
||||
const ConstantInt *HighCI = r.High.toConstantInt();
|
||||
GenericValue Low = getOperandValue(const_cast<ConstantInt*>(LowCI), SF);
|
||||
GenericValue High = getOperandValue(const_cast<ConstantInt*>(HighCI), SF);
|
||||
if (executeICMP_ULE(Low, CondVal, ElTy).IntVal != 0 &&
|
||||
|
Reference in New Issue
Block a user