Eliminate some extraneous code in SlotCalculator::insertVal().
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9190 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bytecode/Writer/InstructionWriter.cpp b/lib/Bytecode/Writer/InstructionWriter.cpp
index e3a8ffd..d5a2abf 100644
--- a/lib/Bytecode/Writer/InstructionWriter.cpp
+++ b/lib/Bytecode/Writer/InstructionWriter.cpp
@@ -33,13 +33,13 @@
output_vbr(NumArgs + (isa<CastInst>(I) || isa<VarArgInst>(I)), Out);
for (unsigned i = 0; i < NumArgs; ++i) {
- int Slot = Table.getValSlot(I->getOperand(i));
+ int Slot = Table.getSlot(I->getOperand(i));
assert(Slot >= 0 && "No slot number for value!?!?");
output_vbr((unsigned)Slot, Out);
}
if (isa<CastInst>(I) || isa<VarArgInst>(I)) {
- int Slot = Table.getValSlot(I->getType());
+ int Slot = Table.getSlot(I->getType());
assert(Slot != -1 && "Cast/VarArg return type unknown?");
output_vbr((unsigned)Slot, Out);
}
@@ -72,7 +72,7 @@
// The type for the function has already been emitted in the type field of the
// instruction. Just emit the slot # now.
- int Slot = Table.getValSlot(I->getOperand(0));
+ int Slot = Table.getSlot(I->getOperand(0));
assert(Slot >= 0 && "No slot number for value!?!?");
output_vbr((unsigned)Slot, Out);
@@ -84,12 +84,12 @@
for (unsigned i = 1; i < NumArgs; ++i) {
// Output Arg Type ID
- Slot = Table.getValSlot(I->getOperand(i)->getType());
+ Slot = Table.getSlot(I->getOperand(i)->getType());
assert(Slot >= 0 && "No slot number for value!?!?");
output_vbr((unsigned)Slot, Out);
// Output arg ID itself
- Slot = Table.getValSlot(I->getOperand(i));
+ Slot = Table.getSlot(I->getOperand(i));
assert(Slot >= 0 && "No slot number for value!?!?");
output_vbr((unsigned)Slot, Out);
}
@@ -176,7 +176,7 @@
for (unsigned i = 0; i < NumOperands; ++i) {
const Value *Def = I.getOperand(i);
- int slot = Table.getValSlot(Def);
+ int slot = Table.getSlot(Def);
assert(slot != -1 && "Broken bytecode!");
if (slot > MaxOpSlot) MaxOpSlot = slot;
if (i < 3) Slots[i] = slot;
@@ -204,7 +204,7 @@
}
unsigned Type;
- int Slot = Table.getValSlot(Ty);
+ int Slot = Table.getSlot(Ty);
assert(Slot != -1 && "Type not available!!?!");
Type = (unsigned)Slot;
@@ -217,7 +217,7 @@
if (isa<CastInst>(I) || isa<VarArgInst>(I)) {
// Cast has to encode the destination type as the second argument in the
// packet, or else we won't know what type to cast to!
- Slots[1] = Table.getValSlot(I.getType());
+ Slots[1] = Table.getSlot(I.getType());
assert(Slots[1] != -1 && "Cast return type unknown?");
if (Slots[1] > MaxOpSlot) MaxOpSlot = Slots[1];
NumOperands++;