[llvm-commits] CVS: llvm/lib/Bytecode/Writer/ConstantWriter.cpp InstructionWriter.cpp SlotCalculator.cpp SlotTable.cpp SlotTable.h
Chris Lattner
lattner at cs.uiuc.edu
Thu Jun 17 13:25:17 PDT 2004
Changes in directory llvm/lib/Bytecode/Writer:
ConstantWriter.cpp updated: 1.36 -> 1.37
InstructionWriter.cpp updated: 1.41 -> 1.42
SlotCalculator.cpp updated: 1.55 -> 1.56
SlotTable.cpp updated: 1.4 -> 1.5
SlotTable.h updated: 1.2 -> 1.3
---
Log message:
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
---
Diffs of the changes: (+17 -17)
Index: llvm/lib/Bytecode/Writer/ConstantWriter.cpp
diff -u llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.36 llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.37
--- llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.36 Sun Feb 8 22:37:29 2004
+++ llvm/lib/Bytecode/Writer/ConstantWriter.cpp Thu Jun 17 13:17:59 2004
@@ -20,14 +20,14 @@
using namespace llvm;
void BytecodeWriter::outputType(const Type *T) {
- output_vbr((unsigned)T->getPrimitiveID(), Out);
+ output_vbr((unsigned)T->getTypeID(), Out);
// That's all there is to handling primitive types...
if (T->isPrimitiveType()) {
return; // We might do this if we alias a prim type: %x = type int
}
- switch (T->getPrimitiveID()) { // Handle derived types now.
+ switch (T->getTypeID()) { // Handle derived types now.
case Type::FunctionTyID: {
const FunctionType *MT = cast<FunctionType>(T);
int Slot = Table.getSlot(MT->getReturnType());
@@ -47,7 +47,7 @@
// Terminate list with VoidTy if we are a varargs function...
if (MT->isVarArg())
- output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out);
+ output_vbr((unsigned)Type::VoidTyID, Out);
break;
}
@@ -74,7 +74,7 @@
}
// Terminate list with VoidTy
- output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out);
+ output_vbr((unsigned)Type::VoidTyID, Out);
break;
}
@@ -124,7 +124,7 @@
output_vbr(0U, Out); // flag as not a ConstantExpr
}
- switch (CPV->getType()->getPrimitiveID()) {
+ switch (CPV->getType()->getTypeID()) {
case Type::BoolTyID: // Boolean Types
if (cast<ConstantBool>(CPV)->getValue())
output_vbr(1U, Out);
Index: llvm/lib/Bytecode/Writer/InstructionWriter.cpp
diff -u llvm/lib/Bytecode/Writer/InstructionWriter.cpp:1.41 llvm/lib/Bytecode/Writer/InstructionWriter.cpp:1.42
--- llvm/lib/Bytecode/Writer/InstructionWriter.cpp:1.41 Sun Apr 4 20:27:26 2004
+++ llvm/lib/Bytecode/Writer/InstructionWriter.cpp Thu Jun 17 13:17:59 2004
@@ -70,7 +70,7 @@
if (isa<SequentialType>(*TI)) {
unsigned IdxId;
- switch (I->getOperand(Idx)->getType()->getPrimitiveID()) {
+ switch (I->getOperand(Idx)->getType()->getTypeID()) {
default: assert(0 && "Unknown index type!");
case Type::UIntTyID: IdxId = 0; break;
case Type::IntTyID: IdxId = 1; break;
@@ -298,7 +298,7 @@
I != E; ++I, ++Idx)
if (isa<SequentialType>(*I)) {
unsigned IdxId;
- switch (GEP->getOperand(Idx)->getType()->getPrimitiveID()) {
+ switch (GEP->getOperand(Idx)->getType()->getTypeID()) {
default: assert(0 && "Unknown index type!");
case Type::UIntTyID: IdxId = 0; break;
case Type::IntTyID: IdxId = 1; break;
Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp
diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.55 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.56
--- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.55 Wed May 26 02:37:11 2004
+++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Thu Jun 17 13:17:59 2004
@@ -41,8 +41,8 @@
//
SC_DEBUG("Inserting primitive types:\n");
for (unsigned i = 0; i < Type::FirstDerivedTyID; ++i) {
- assert(Type::getPrimitiveType((Type::PrimitiveID)i));
- insertValue(Type::getPrimitiveType((Type::PrimitiveID)i), true);
+ assert(Type::getPrimitiveType((Type::TypeID)i));
+ insertValue(Type::getPrimitiveType((Type::TypeID)i), true);
}
if (M == 0) return; // Empty table...
@@ -58,8 +58,8 @@
//
SC_DEBUG("Inserting primitive types:\n");
for (unsigned i = 0; i < Type::FirstDerivedTyID; ++i) {
- assert(Type::getPrimitiveType((Type::PrimitiveID)i));
- insertValue(Type::getPrimitiveType((Type::PrimitiveID)i), true);
+ assert(Type::getPrimitiveType((Type::TypeID)i));
+ insertValue(Type::getPrimitiveType((Type::TypeID)i), true);
}
if (TheModule == 0) return; // Empty table...
@@ -408,7 +408,7 @@
// Make sure to insert the null entry if the thing we are inserting is not a
// null constant.
- if (TyPlane.empty() && hasNullValue(V->getType()->getPrimitiveID())) {
+ if (TyPlane.empty() && hasNullValue(V->getType()->getTypeID())) {
Value *ZeroInitializer = Constant::getNullValue(V->getType());
if (V != ZeroInitializer) {
TyPlane.push_back(ZeroInitializer);
@@ -435,7 +435,7 @@
// First step, insert the primitive types.
CompactionTable.resize(Type::TypeTyID+1);
for (unsigned i = 0; i != Type::FirstDerivedTyID; ++i) {
- const Type *PrimTy = Type::getPrimitiveType((Type::PrimitiveID)i);
+ const Type *PrimTy = Type::getPrimitiveType((Type::TypeID)i);
CompactionTable[Type::TypeTyID].push_back(PrimTy);
CompactionNodeMap[PrimTy] = i;
}
@@ -754,7 +754,7 @@
}
Ty = (unsigned)ValSlot;
} else {
- Ty = Typ->getPrimitiveID();
+ Ty = Typ->getTypeID();
}
if (Table.size() <= Ty) // Make sure we have the type plane allocated...
Index: llvm/lib/Bytecode/Writer/SlotTable.cpp
diff -u llvm/lib/Bytecode/Writer/SlotTable.cpp:1.4 llvm/lib/Bytecode/Writer/SlotTable.cpp:1.5
--- llvm/lib/Bytecode/Writer/SlotTable.cpp:1.4 Tue Jun 8 23:38:34 2004
+++ llvm/lib/Bytecode/Writer/SlotTable.cpp Thu Jun 17 13:17:59 2004
@@ -106,7 +106,7 @@
// and that their Primitive ID is equal to their slot #
void SlotTable::insertPrimitives() {
for (PlaneNum plane = 0; plane < Type::FirstDerivedTyID; ++plane) {
- const Type* Ty = Type::getPrimitiveType((Type::PrimitiveID) plane);
+ const Type* Ty = Type::getPrimitiveType((Type::TypeID) plane);
assert(Ty && "Couldn't get primitive type id");
SlotNum slot = this->insert(Ty);
assert(slot == plane && "Type slot didn't match plane number");
Index: llvm/lib/Bytecode/Writer/SlotTable.h
diff -u llvm/lib/Bytecode/Writer/SlotTable.h:1.2 llvm/lib/Bytecode/Writer/SlotTable.h:1.3
--- llvm/lib/Bytecode/Writer/SlotTable.h:1.2 Tue May 25 14:09:25 2004
+++ llvm/lib/Bytecode/Writer/SlotTable.h Thu Jun 17 13:17:59 2004
@@ -46,7 +46,7 @@
/// This type is used throughout the code to make it clear that an
/// unsigned value refers to a type plane number and not something else.
- /// @brief The type of a plane number (corresponds to Type::PrimitiveID).
+ /// @brief The type of a plane number (corresponds to Type::TypeID).
typedef unsigned PlaneNum;
/// @brief Some constants used as flags instead of actual slot numbers
@@ -58,7 +58,7 @@
/// @brief A single plane of Values. Intended index is slot number.
typedef std::vector<const Value*> ValuePlane;
- /// @brief A table of Values. Intended index is Type::PrimitiveID.
+ /// @brief A table of Values. Intended index is Type::TypeID.
typedef std::vector<ValuePlane> ValueTable;
/// @brief A map of values to slot numbers.
More information about the llvm-commits
mailing list