ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stepan Dyatkovskiy
2012-05-29 12:26:47 +00:00
parent b34d3aa35b
commit 0aa32d5d0f
13 changed files with 95 additions and 109 deletions

View File

@@ -223,22 +223,22 @@ BasicBlock* LowerSwitch::newLeafBlock(CaseRange& Leaf, Value* Val,
// Clusterify - Transform simple list of Cases into list of CaseRange's
unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) {
CRSBuilder TheClusterifier;
IntegersSubsetToBB TheClusterifier;
// Start with "simple" cases
for (SwitchInst::CaseIt i = SI->case_begin(), e = SI->case_end();
i != e; ++i) {
BasicBlock *SuccBB = i.getCaseSuccessor();
ConstantRangesSet CRS = i.getCaseValueEx();
TheClusterifier.add(CRS, SuccBB);
IntegersSubset CaseRanges = i.getCaseValueEx();
TheClusterifier.add(CaseRanges, SuccBB);
}
TheClusterifier.optimize();
size_t numCmps = 0;
for (CRSBuilder::RangeIterator i = TheClusterifier.begin(),
for (IntegersSubsetToBB::RangeIterator i = TheClusterifier.begin(),
e = TheClusterifier.end(); i != e; ++i, ++numCmps) {
CRSBuilder::Cluster &C = *i;
IntegersSubsetToBB::Cluster &C = *i;
// FIXME: Currently work with ConstantInt based numbers.
// Changing it to APInt based is a pretty heavy for this commit.