diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-17 18:19:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-17 18:19:28 +0000 |
commit | f70c22b019494723d0e706f93d6542dfaa6e73a5 (patch) | |
tree | 6f881c08a706deb8e6f0954a8e5ed53756b24167 /lib/Bytecode | |
parent | 5dd04027c7133c358c16e8ec9a4bfca8788e3f90 (diff) |
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Analyzer/Parser.cpp | 6 | ||||
-rw-r--r-- | lib/Bytecode/Analyzer/Parser.h | 4 | ||||
-rw-r--r-- | lib/Bytecode/Reader/ConstantReader.cpp | 4 | ||||
-rw-r--r-- | lib/Bytecode/Reader/Parser.cpp | 6 | ||||
-rw-r--r-- | lib/Bytecode/Reader/Parser.h | 4 | ||||
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 4 | ||||
-rw-r--r-- | lib/Bytecode/Reader/ReaderInternals.h | 4 | ||||
-rw-r--r-- | lib/Bytecode/Writer/ConstantWriter.cpp | 10 | ||||
-rw-r--r-- | lib/Bytecode/Writer/InstructionWriter.cpp | 4 | ||||
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.cpp | 14 | ||||
-rw-r--r-- | lib/Bytecode/Writer/SlotTable.cpp | 2 | ||||
-rw-r--r-- | lib/Bytecode/Writer/SlotTable.h | 4 |
12 files changed, 33 insertions, 33 deletions
diff --git a/lib/Bytecode/Analyzer/Parser.cpp b/lib/Bytecode/Analyzer/Parser.cpp index a784811f86..c79318a02c 100644 --- a/lib/Bytecode/Analyzer/Parser.cpp +++ b/lib/Bytecode/Analyzer/Parser.cpp @@ -145,7 +145,7 @@ const Type *AbstractBytecodeParser::getType(unsigned ID) { //cerr << "Looking up Type ID: " << ID << "\n"; if (ID < Type::FirstDerivedTyID) - if (const Type *T = Type::getPrimitiveType((Type::PrimitiveID)ID)) + if (const Type *T = Type::getPrimitiveType((Type::TypeID)ID)) return T; // Asked for a primitive type... // Otherwise, derived types need offset... @@ -467,7 +467,7 @@ const Type *AbstractBytecodeParser::ParseTypeConstant() { unsigned PrimType = read_vbr_uint(); const Type *Val = 0; - if ((Val = Type::getPrimitiveType((Type::PrimitiveID)PrimType))) + if ((Val = Type::getPrimitiveType((Type::TypeID)PrimType))) return Val; switch (PrimType) { @@ -615,7 +615,7 @@ void AbstractBytecodeParser::ParseConstantValue(unsigned TypeID) { // Ok, not an ConstantExpr. We now know how to read the given type... const Type *Ty = getType(TypeID); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: { unsigned Val = read_vbr_uint(); if (Val != 0 && Val != 1) diff --git a/lib/Bytecode/Analyzer/Parser.h b/lib/Bytecode/Analyzer/Parser.h index 7856fc5447..59023980b6 100644 --- a/lib/Bytecode/Analyzer/Parser.h +++ b/lib/Bytecode/Analyzer/Parser.h @@ -264,7 +264,7 @@ private: /// fancy features are supported. const Type *getGlobalTableType(unsigned Slot) { if (Slot < Type::FirstDerivedTyID) { - const Type *Ty = Type::getPrimitiveType((Type::PrimitiveID)Slot); + const Type *Ty = Type::getPrimitiveType((Type::TypeID)Slot); assert(Ty && "Not a primitive type ID?"); return Ty; } @@ -276,7 +276,7 @@ private: unsigned getGlobalTableTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); TypeListTy::iterator I = find(ModuleTypes.begin(), ModuleTypes.end(), Ty); if (I == ModuleTypes.end()) diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp index 8691b26544..72d8caed67 100644 --- a/lib/Bytecode/Reader/ConstantReader.cpp +++ b/lib/Bytecode/Reader/ConstantReader.cpp @@ -24,7 +24,7 @@ const Type *BytecodeParser::parseTypeConstant(const unsigned char *&Buf, unsigned PrimType = read_vbr_uint(Buf, EndBuf); const Type *Val = 0; - if ((Val = Type::getPrimitiveType((Type::PrimitiveID)PrimType))) + if ((Val = Type::getPrimitiveType((Type::TypeID)PrimType))) return Val; switch (PrimType) { @@ -190,7 +190,7 @@ Constant *BytecodeParser::parseConstantValue(const unsigned char *&Buf, // Ok, not an ConstantExpr. We now know how to read the given type... const Type *Ty = getType(TypeID); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: { unsigned Val = read_vbr_uint(Buf, EndBuf); if (Val != 0 && Val != 1) throw std::string("Invalid boolean value read."); diff --git a/lib/Bytecode/Reader/Parser.cpp b/lib/Bytecode/Reader/Parser.cpp index a784811f86..c79318a02c 100644 --- a/lib/Bytecode/Reader/Parser.cpp +++ b/lib/Bytecode/Reader/Parser.cpp @@ -145,7 +145,7 @@ const Type *AbstractBytecodeParser::getType(unsigned ID) { //cerr << "Looking up Type ID: " << ID << "\n"; if (ID < Type::FirstDerivedTyID) - if (const Type *T = Type::getPrimitiveType((Type::PrimitiveID)ID)) + if (const Type *T = Type::getPrimitiveType((Type::TypeID)ID)) return T; // Asked for a primitive type... // Otherwise, derived types need offset... @@ -467,7 +467,7 @@ const Type *AbstractBytecodeParser::ParseTypeConstant() { unsigned PrimType = read_vbr_uint(); const Type *Val = 0; - if ((Val = Type::getPrimitiveType((Type::PrimitiveID)PrimType))) + if ((Val = Type::getPrimitiveType((Type::TypeID)PrimType))) return Val; switch (PrimType) { @@ -615,7 +615,7 @@ void AbstractBytecodeParser::ParseConstantValue(unsigned TypeID) { // Ok, not an ConstantExpr. We now know how to read the given type... const Type *Ty = getType(TypeID); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: { unsigned Val = read_vbr_uint(); if (Val != 0 && Val != 1) diff --git a/lib/Bytecode/Reader/Parser.h b/lib/Bytecode/Reader/Parser.h index 7856fc5447..59023980b6 100644 --- a/lib/Bytecode/Reader/Parser.h +++ b/lib/Bytecode/Reader/Parser.h @@ -264,7 +264,7 @@ private: /// fancy features are supported. const Type *getGlobalTableType(unsigned Slot) { if (Slot < Type::FirstDerivedTyID) { - const Type *Ty = Type::getPrimitiveType((Type::PrimitiveID)Slot); + const Type *Ty = Type::getPrimitiveType((Type::TypeID)Slot); assert(Ty && "Not a primitive type ID?"); return Ty; } @@ -276,7 +276,7 @@ private: unsigned getGlobalTableTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); TypeListTy::iterator I = find(ModuleTypes.begin(), ModuleTypes.end(), Ty); if (I == ModuleTypes.end()) diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index 2f0879ba39..2ca8a99f4c 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/lib/Bytecode/Reader/Reader.cpp @@ -25,7 +25,7 @@ using namespace llvm; unsigned BytecodeParser::getTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); // Scan the compaction table for the type if needed. if (CompactionTable.size() > Type::TypeTyID) { @@ -56,7 +56,7 @@ const Type *BytecodeParser::getType(unsigned ID) { //cerr << "Looking up Type ID: " << ID << "\n"; if (ID < Type::FirstDerivedTyID) - if (const Type *T = Type::getPrimitiveType((Type::PrimitiveID)ID)) + if (const Type *T = Type::getPrimitiveType((Type::TypeID)ID)) return T; // Asked for a primitive type... // Otherwise, derived types need offset... diff --git a/lib/Bytecode/Reader/ReaderInternals.h b/lib/Bytecode/Reader/ReaderInternals.h index 9e0ffc2c36..36bf2f6f0e 100644 --- a/lib/Bytecode/Reader/ReaderInternals.h +++ b/lib/Bytecode/Reader/ReaderInternals.h @@ -173,7 +173,7 @@ private: /// fancy features are supported. const Type *getGlobalTableType(unsigned Slot) { if (Slot < Type::FirstDerivedTyID) { - const Type *Ty = Type::getPrimitiveType((Type::PrimitiveID)Slot); + const Type *Ty = Type::getPrimitiveType((Type::TypeID)Slot); assert(Ty && "Not a primitive type ID?"); return Ty; } @@ -185,7 +185,7 @@ private: unsigned getGlobalTableTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); TypeValuesListTy::iterator I = find(ModuleTypeValues.begin(), ModuleTypeValues.end(), Ty); if (I == ModuleTypeValues.end()) diff --git a/lib/Bytecode/Writer/ConstantWriter.cpp b/lib/Bytecode/Writer/ConstantWriter.cpp index bb8d286899..3234a35f58 100644 --- a/lib/Bytecode/Writer/ConstantWriter.cpp +++ b/lib/Bytecode/Writer/ConstantWriter.cpp @@ -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 @@ void BytecodeWriter::outputType(const Type *T) { // 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 @@ void BytecodeWriter::outputType(const Type *T) { } // Terminate list with VoidTy - output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out); + output_vbr((unsigned)Type::VoidTyID, Out); break; } @@ -124,7 +124,7 @@ void BytecodeWriter::outputConstant(const Constant *CPV) { 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); diff --git a/lib/Bytecode/Writer/InstructionWriter.cpp b/lib/Bytecode/Writer/InstructionWriter.cpp index 9e063510df..188136718d 100644 --- a/lib/Bytecode/Writer/InstructionWriter.cpp +++ b/lib/Bytecode/Writer/InstructionWriter.cpp @@ -70,7 +70,7 @@ static void outputInstructionFormat0(const Instruction *I, unsigned Opcode, 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 @@ void BytecodeWriter::outputInstruction(const Instruction &I) { 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; diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index 3408982c8d..97d336e2db 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/lib/Bytecode/Writer/SlotCalculator.cpp @@ -41,8 +41,8 @@ SlotCalculator::SlotCalculator(const Module *M ) { // 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 @@ SlotCalculator::SlotCalculator(const Function *M ) { // 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 @@ unsigned SlotCalculator::getOrCreateCompactionTableSlot(const Value *V) { // 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 @@ void SlotCalculator::buildCompactionTable(const Function *F) { // 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 @@ int SlotCalculator::doInsertValue(const Value *D) { } Ty = (unsigned)ValSlot; } else { - Ty = Typ->getPrimitiveID(); + Ty = Typ->getTypeID(); } if (Table.size() <= Ty) // Make sure we have the type plane allocated... diff --git a/lib/Bytecode/Writer/SlotTable.cpp b/lib/Bytecode/Writer/SlotTable.cpp index 358a6ea21e..42b0b5adb8 100644 --- a/lib/Bytecode/Writer/SlotTable.cpp +++ b/lib/Bytecode/Writer/SlotTable.cpp @@ -106,7 +106,7 @@ SlotTable::SlotNum SlotTable::remove( const Type* Typ ) { // 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"); diff --git a/lib/Bytecode/Writer/SlotTable.h b/lib/Bytecode/Writer/SlotTable.h index 1d10babfe6..60e0c1fbfd 100644 --- a/lib/Bytecode/Writer/SlotTable.h +++ b/lib/Bytecode/Writer/SlotTable.h @@ -46,7 +46,7 @@ public: /// 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 @@ public: /// @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. |