diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-06-02 09:42:43 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-06-02 09:42:43 +0000 |
commit | 0e46d8a08c4c50519bd3c5688d0bb21f57edb075 (patch) | |
tree | dfbc28d82597dd7cccac348c8c637d424adad38f /llvm/lib/Transforms/Utils | |
parent | 539df9ef0a208802ebff95db0c87f574e806848a (diff) | |
download | bcm5719-llvm-0e46d8a08c4c50519bd3c5688d0bb21f57edb075.tar.gz bcm5719-llvm-0e46d8a08c4c50519bd3c5688d0bb21f57edb075.zip |
PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()"
llvm-svn: 157884
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerSwitch.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index a4ddfa5de3c..3c6793f3ad0 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -173,7 +173,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions) { if (CaseRanges.getNumItems() == 1 && CaseRanges.isSingleNumber(0)) { // FIXME: Currently work with ConstantInt based numbers. Value *Cond = Builder.CreateICmpEQ(SI->getCondition(), - CaseRanges.getItem(0).Low.toConstantInt(), + CaseRanges.getItem(0).getLow().toConstantInt(), "cond"); // Insert the new branch. diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp index a4cf7732928..1547439b5c6 100644 --- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp +++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp @@ -242,9 +242,9 @@ unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) { // 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.Low.toConstantInt(), - C.first.High.toConstantInt(), C.second)); - if (C.first.Low != C.first.High) + Cases.push_back(CaseRange(C.first.getLow().toConstantInt(), + C.first.getHigh().toConstantInt(), C.second)); + if (C.first.isSingleNumber()) // A range counts double, since it requires two compares. ++numCmps; } |