diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-02 13:02:18 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-02 13:02:18 +0000 |
commit | b2833d9dcba88c6f0520cad760619200adc0442c (patch) | |
tree | b793a8e3721adbc47bcc70fd848aea4ff6b47e1a /unittests | |
parent | 4177e6fff50552908bab510f1e896fa974a6f155 (diff) | |
download | external_llvm-b2833d9dcba88c6f0520cad760619200adc0442c.zip external_llvm-b2833d9dcba88c6f0520cad760619200adc0442c.tar.gz external_llvm-b2833d9dcba88c6f0520cad760619200adc0442c.tar.bz2 |
IntRange:
- Changed isSingleNumber method behaviour. Now this flag is calculated on demand.
IntegersSubsetMapping
- Optimized diff operation.
- Replaced type of Items field from std::list with std::map.
- Added new methods:
bool isOverlapped(self &RHS)
void add(self& RHS, SuccessorClass *S)
void detachCase(self& NewMapping, SuccessorClass *Succ)
void removeCase(SuccessorClass *Succ)
SuccessorClass *findSuccessor(const IntTy& Val)
const IntTy* getCaseSingleNumber(SuccessorClass *Succ)
IntegersSubsetTest
- DiffTest: Added checks for successors.
SimplifyCFG
Updated SwitchInst usage (now it is case-ragnes compatible) for
- SimplifyEqualityComparisonWithOnlyPredecessor
- FoldValueComparisonIntoPredecessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/IntegersSubsetTest.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/unittests/Support/IntegersSubsetTest.cpp b/unittests/Support/IntegersSubsetTest.cpp index 5d1dde4..a103161 100644 --- a/unittests/Support/IntegersSubsetTest.cpp +++ b/unittests/Support/IntegersSubsetTest.cpp @@ -193,20 +193,20 @@ namespace { const unsigned_ranges IntersectRes, unsigned IntersectResSize ) { - + unsigned successors[2] = {0, 1}; Mapping::RangesCollection Ranges; Mapping LHSMapping; for (unsigned i = 0; i < LSize; ++i) Ranges.push_back(Range(Int(LHS[i][0]), Int(LHS[i][1]))); - LHSMapping.add(Ranges); + LHSMapping.add(Ranges, &successors[0]); Ranges.clear(); Mapping RHSMapping; for (unsigned i = 0; i < RSize; ++i) Ranges.push_back(Range(Int(RHS[i][0]), Int(RHS[i][1]))); - RHSMapping.add(Ranges); + RHSMapping.add(Ranges, &successors[1]); Mapping LExclude, Intersection; @@ -217,8 +217,10 @@ namespace { unsigned i = 0; for (Mapping::RangeIterator rei = LExclude.begin(), - e = LExclude.end(); rei != e; ++rei, ++i) + e = LExclude.end(); rei != e; ++rei, ++i) { EXPECT_EQ(rei->first, Range(ExcludeRes[i][0], ExcludeRes[i][1])); + EXPECT_EQ(rei->second, &successors[0]); + } } else EXPECT_TRUE(LExclude.empty()); @@ -227,8 +229,10 @@ namespace { unsigned i = 0; for (Mapping::RangeIterator ii = Intersection.begin(), - e = Intersection.end(); ii != e; ++ii, ++i) + e = Intersection.end(); ii != e; ++ii, ++i) { EXPECT_EQ(ii->first, Range(IntersectRes[i][0], IntersectRes[i][1])); + EXPECT_EQ(ii->second, &successors[0]); + } } else EXPECT_TRUE(Intersection.empty()); @@ -241,9 +245,11 @@ namespace { EXPECT_EQ(LExclude.size(), ExcludeResSize); unsigned i = 0; - for (Mapping::RangeIterator rei = LExclude.begin(), - e = LExclude.end(); rei != e; ++rei, ++i) - EXPECT_EQ(rei->first, Range(ExcludeRes[i][0], ExcludeRes[i][1])); + for (Mapping::RangeIterator lei = LExclude.begin(), + e = LExclude.end(); lei != e; ++lei, ++i) { + EXPECT_EQ(lei->first, Range(ExcludeRes[i][0], ExcludeRes[i][1])); + EXPECT_EQ(lei->second, &successors[0]); + } } else EXPECT_TRUE(LExclude.empty()); } |