aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/IntegersSubsetMapping.h
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-06-01 10:06:14 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-06-01 10:06:14 +0000
commitf8d14c4ca3874890cfd8867d9557efca9511c98f (patch)
tree21b0099b59128b3823d22eac911a39896fdc530e /include/llvm/Support/IntegersSubsetMapping.h
parent14f094bb2b1d72266d8d29daddb27ec3b1be5e14 (diff)
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
Diffstat (limited to 'include/llvm/Support/IntegersSubsetMapping.h')
-rw-r--r--include/llvm/Support/IntegersSubsetMapping.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/IntegersSubsetMapping.h b/include/llvm/Support/IntegersSubsetMapping.h
index eaa2f5be2f..374a68772e 100644
--- a/include/llvm/Support/IntegersSubsetMapping.h
+++ b/include/llvm/Support/IntegersSubsetMapping.h
@@ -67,7 +67,7 @@ protected:
bool Sorted;
bool isIntersected(CaseItemIt& LItem, CaseItemIt& RItem) {
- return LItem->first.High->uge(RItem->first.Low);
+ return LItem->first.High >= RItem->first.Low;
}
bool isJoinable(CaseItemIt& LItem, CaseItemIt& RItem) {
@@ -79,7 +79,7 @@ protected:
APInt RLow = RItem->first.Low;
if (RLow != APInt::getNullValue(RLow.getBitWidth()))
--RLow;
- return LItem->first.High->uge(RLow);
+ return LItem->first.High >= RLow;
}
void sort() {
@@ -159,7 +159,7 @@ public:
if (isJoinable(i, j)) {
IntItem *CurHigh = &j->first.High;
++Weight;
- if ((*CurHigh)->ugt(*High))
+ if (*CurHigh > *High)
High = CurHigh;
} else {
RangeEx R(*Low, *High, Weight);