diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-05-29 12:26:47 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-05-29 12:26:47 +0000 |
commit | 58107dd547a883927c9be9a92b8396a7700685d9 (patch) | |
tree | 3845bda77e342cee5ecbfcd9c0499fb92be5fd53 /llvm/lib/Transforms | |
parent | 458b4006b2cfdc2364be92913b77ca6abc866899 (diff) | |
download | bcm5719-llvm-58107dd547a883927c9be9a92b8396a7700685d9.tar.gz bcm5719-llvm-58107dd547a883927c9be9a92b8396a7700685d9.zip |
ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
llvm-svn: 157612
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerSwitch.cpp | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 130b876ee96..a4ddfa5de3c 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -169,11 +169,11 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions) { // Otherwise, we can fold this switch into a conditional branch // instruction if it has only one non-default destination. SwitchInst::CaseIt FirstCase = SI->case_begin(); - ConstantRangesSet CRS = FirstCase.getCaseValueEx(); - if (CRS.getNumItems() == 1 && CRS.isSingleNumber(0)) { + IntegersSubset CaseRanges = FirstCase.getCaseValueEx(); + if (CaseRanges.getNumItems() == 1 && CaseRanges.isSingleNumber(0)) { // FIXME: Currently work with ConstantInt based numbers. Value *Cond = Builder.CreateICmpEQ(SI->getCondition(), - CRS.getItem(0).Low.toConstantInt(), + CaseRanges.getItem(0).Low.toConstantInt(), "cond"); // Insert the new branch. diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp index 23620373a06..a4cf7732928 100644 --- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp +++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp @@ -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. |