mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user