aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-05-29 12:26:47 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-05-29 12:26:47 +0000
commit0aa32d5d0ff6cd65b6cff957858a79e2d2a614bd (patch)
treeb35a3334dc0afe235eacc28725ff35d6388dc7ba /lib
parentb34d3aa35b199969168f41a12e92e5d2f0e9367f (diff)
downloadexternal_llvm-0aa32d5d0ff6cd65b6cff957858a79e2d2a614bd.zip
external_llvm-0aa32d5d0ff6cd65b6cff957858a79e2d2a614bd.tar.gz
external_llvm-0aa32d5d0ff6cd65b6cff957858a79e2d2a614bd.tar.bz2
ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp10
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp4
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp4
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp2
-rw-r--r--lib/Transforms/Utils/Local.cpp6
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp10
-rw-r--r--lib/VMCore/Instructions.cpp10
-rw-r--r--lib/VMCore/Verifier.cpp16
9 files changed, 33 insertions, 33 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index e58af0e..83756da 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2234,7 +2234,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
unsigned CurIdx = 5;
for (unsigned i = 0; i != NumCases; ++i) {
- CRSBuilder CaseBuilder;
+ IntegersSubsetToBB CaseBuilder;
unsigned NumItems = Record[CurIdx++];
for (unsigned ci = 0; ci != NumItems; ++ci) {
bool isSingleNumber = Record[CurIdx++];
@@ -2262,7 +2262,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
CaseBuilder.add(IntItem::fromType(OpTy, Low));
}
BasicBlock *DestBB = getBasicBlock(Record[CurIdx++]);
- ConstantRangesSet Case = CaseBuilder.getCase();
+ IntegersSubset Case = CaseBuilder.getCase();
SI->addCase(Case, DestBB);
}
uint16_t Hash = SI->hash();
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index d454964..7dd18c8 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1157,12 +1157,12 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
Vals64.push_back(SI.getNumCases());
for (SwitchInst::CaseIt i = SI.case_begin(), e = SI.case_end();
i != e; ++i) {
- ConstantRangesSet CRS = i.getCaseValueEx();
- Vals64.push_back(CRS.getNumItems());
- for (unsigned ri = 0, rn = CRS.getNumItems(); ri != rn; ++ri) {
- ConstantRangesSet::Range r = CRS.getItem(ri);
+ IntegersSubset CaseRanges = i.getCaseValueEx();
+ Vals64.push_back(CaseRanges.getNumItems());
+ for (unsigned ri = 0, rn = CaseRanges.getNumItems(); ri != rn; ++ri) {
+ IntegersSubset::Range r = CaseRanges.getItem(ri);
- Vals64.push_back(CRS.isSingleNumber(ri));
+ Vals64.push_back(CaseRanges.isSingleNumber(ri));
const APInt &Low = r.Low;
const APInt &High = r.High;
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index b7a6ec2..15c4258 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -51,7 +51,7 @@
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/CRSBuilder.h"
+#include "llvm/Support/IntegersSubsetMapping.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
@@ -2427,7 +2427,7 @@ size_t SelectionDAGBuilder::Clusterify(CaseVector& Cases,
/// Use a shorter form of declaration, and also
/// show the we want to use CRSBuilder as Clusterifier.
- typedef CRSBuilderBase<MachineBasicBlock> Clusterifier;
+ typedef IntegersSubsetMapping<MachineBasicBlock> Clusterifier;
Clusterifier TheClusterifier;
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 46ed6fd..d540101 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -651,9 +651,9 @@ void Interpreter::visitSwitchInst(SwitchInst &I) {
// Check to see if any of the cases match...
BasicBlock *Dest = 0;
for (SwitchInst::CaseIt i = I.case_begin(), e = I.case_end(); i != e; ++i) {
- ConstantRangesSet Case = i.getCaseValueEx();
+ IntegersSubset Case = i.getCaseValueEx();
for (unsigned n = 0, en = Case.getNumItems(); n != en; ++n) {
- ConstantRangesSet::Range r = Case.getItem(n);
+ IntegersSubset::Range r = Case.getItem(n);
// FIXME: Currently work with ConstantInt based numbers.
const ConstantInt *LowCI = r.Low.getImplementation();
const ConstantInt *HighCI = r.High.getImplementation();
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 9f95455..2ac9fe7 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -1105,7 +1105,7 @@ void CppWriter::printInstruction(const Instruction *I,
nl(Out);
for (SwitchInst::ConstCaseIt i = SI->case_begin(), e = SI->case_end();
i != e; ++i) {
- const ConstantRangesSet CaseVal = i.getCaseValueEx();
+ const IntegersSubset CaseVal = i.getCaseValueEx();
const BasicBlock *BB = i.getCaseSuccessor();
Out << iName << "->addCase("
<< getOpName(CaseVal) << ", "
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 130b876..a4ddfa5 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/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/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp
index 2362037..a4cf773 100644
--- a/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/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.
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 42a92d9..26cc632 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -3169,16 +3169,16 @@ SwitchInst::~SwitchInst() {
/// addCase - Add an entry to the switch instruction...
///
void SwitchInst::addCase(ConstantInt *OnVal, BasicBlock *Dest) {
- CRSBuilder CB;
+ IntegersSubsetToBB Mapping;
// FIXME: Currently we work with ConstantInt based cases.
// So inititalize IntItem container directly from ConstantInt.
- CB.add(IntItem::fromConstantInt(OnVal));
- ConstantRangesSet CRS = CB.getCase();
- addCase(CRS, Dest);
+ Mapping.add(IntItem::fromConstantInt(OnVal));
+ IntegersSubset CaseRanges = Mapping.getCase();
+ addCase(CaseRanges, Dest);
}
-void SwitchInst::addCase(ConstantRangesSet& OnVal, BasicBlock *Dest) {
+void SwitchInst::addCase(IntegersSubset& OnVal, BasicBlock *Dest) {
unsigned NewCaseIdx = getNumCases();
unsigned OpNo = NumOperands;
if (OpNo+2 > ReservedSpace)
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index c546e41..cae3bc8 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -806,23 +806,23 @@ void Verifier::visitSwitchInst(SwitchInst &SI) {
// have the same type as the switched-on value.
Type *SwitchTy = SI.getCondition()->getType();
IntegerType *IntTy = cast<IntegerType>(SwitchTy);
- CRSBuilder Builder;
- std::map<ConstantRangesSet::Range, unsigned> RangeSetMap;
+ IntegersSubsetToBB Mapping;
+ std::map<IntegersSubset::Range, unsigned> RangeSetMap;
for (SwitchInst::CaseIt i = SI.case_begin(), e = SI.case_end(); i != e; ++i) {
- ConstantRangesSet RS = i.getCaseValueEx();
- for (unsigned ri = 0, rie = RS.getNumItems(); ri < rie; ++ri) {
- ConstantRangesSet::Range r = RS.getItem(ri);
+ IntegersSubset CaseRanges = i.getCaseValueEx();
+ for (unsigned ri = 0, rie = CaseRanges.getNumItems(); ri < rie; ++ri) {
+ IntegersSubset::Range r = CaseRanges.getItem(ri);
Assert1(r.Low->getBitWidth() == IntTy->getBitWidth(),
"Switch constants must all be same type as switch value!", &SI);
Assert1(r.High->getBitWidth() == IntTy->getBitWidth(),
"Switch constants must all be same type as switch value!", &SI);
- Builder.add(r);
+ Mapping.add(r);
RangeSetMap[r] = i.getCaseIndex();
}
}
- CRSBuilder::RangeIterator errItem;
- if (!Builder.verify(errItem)) {
+ IntegersSubsetToBB::RangeIterator errItem;
+ if (!Mapping.verify(errItem)) {
unsigned CaseIndex = RangeSetMap[errItem->first];
SwitchInst::CaseIt i(&SI, CaseIndex);
Assert2(false, "Duplicate integer as switch case", &SI, i.getCaseValueEx());