diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-03 13:46:45 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-03 13:46:45 +0000 |
commit | 8b0c97e0ddc683c109bb1fea88e447e0fd77eb09 (patch) | |
tree | 62703a1a99bb569b88c2d7973032a2d6be43a1f0 /llvm/lib/Transforms/Utils/LowerSwitch.cpp | |
parent | 438ba5f0bda1fdbdd40ba7920b8c8cd8e178815b (diff) | |
download | llvm-8b0c97e0ddc683c109bb1fea88e447e0fd77eb09.zip llvm-8b0c97e0ddc683c109bb1fea88e447e0fd77eb09.tar.gz llvm-8b0c97e0ddc683c109bb1fea88e447e0fd77eb09.tar.bz2 |
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.
llvm-svn: 159659
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerSwitch.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerSwitch.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp index 1547439..d2bd9d0 100644 --- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp +++ b/llvm/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; } |