summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerSwitch.cpp
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-07-03 13:46:45 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-07-03 13:46:45 +0000
commit6a590737355e82d83729198715e3fff11b0c6f9e (patch)
tree5b89e2a9b4334923d19cb19898e79d5d7440f531 /lib/Transforms/Utils/LowerSwitch.cpp
parent181e0bdafaf33524a9a7f082caf5459615f4ab30 (diff)
downloadllvm-6a590737355e82d83729198715e3fff11b0c6f9e.tar.gz
llvm-6a590737355e82d83729198715e3fff11b0c6f9e.tar.bz2
llvm-6a590737355e82d83729198715e3fff11b0c6f9e.tar.xz
Part of r159527. Splitted into series of patches and gone with fixed PR13256:
IntegersSubsetMapping - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerSwitch.cpp')
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp
index 1547439b5c..d2bd9d0284 100644
--- a/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/lib/Transforms/Utils/LowerSwitch.cpp
@@ -238,13 +238,14 @@ unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) {
size_t numCmps = 0;
for (IntegersSubsetToBB::RangeIterator i = TheClusterifier.begin(),
e = TheClusterifier.end(); i != e; ++i, ++numCmps) {
- IntegersSubsetToBB::Cluster &C = *i;
+ const IntegersSubsetToBB::RangeTy &R = i->first;
+ BasicBlock *S = i->second;
// FIXME: Currently work with ConstantInt based numbers.
// Changing it to APInt based is a pretty heavy for this commit.
- Cases.push_back(CaseRange(C.first.getLow().toConstantInt(),
- C.first.getHigh().toConstantInt(), C.second));
- if (C.first.isSingleNumber())
+ Cases.push_back(CaseRange(R.getLow().toConstantInt(),
+ R.getHigh().toConstantInt(), S));
+ if (R.isSingleNumber())
// A range counts double, since it requires two compares.
++numCmps;
}