Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
authorChris Lattner <sabre@nondot.org>
Thu, 17 Jun 2004 18:19:28 +0000 (18:19 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Jun 2004 18:19:28 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8

52 files changed:
include/llvm/DerivedTypes.h
include/llvm/Type.h
lib/Analysis/DataStructure/DataStructure.cpp
lib/AsmParser/ParserInternals.h
lib/AsmParser/llvmAsmParser.y
lib/Bytecode/Analyzer/Parser.cpp
lib/Bytecode/Analyzer/Parser.h
lib/Bytecode/Reader/ConstantReader.cpp
lib/Bytecode/Reader/Parser.cpp
lib/Bytecode/Reader/Parser.h
lib/Bytecode/Reader/Reader.cpp
lib/Bytecode/Reader/ReaderInternals.h
lib/Bytecode/Writer/ConstantWriter.cpp
lib/Bytecode/Writer/InstructionWriter.cpp
lib/Bytecode/Writer/SlotCalculator.cpp
lib/Bytecode/Writer/SlotTable.cpp
lib/Bytecode/Writer/SlotTable.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
lib/Linker/LinkModules.cpp
lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp
lib/Target/Sparc/InstSelectSimple.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/Sparc/SparcRegisterInfo.cpp
lib/Target/Sparc/SparcV8ISelSimple.cpp
lib/Target/SparcV8/InstSelectSimple.cpp
lib/Target/SparcV8/SparcV8AsmPrinter.cpp
lib/Target/SparcV8/SparcV8ISelSimple.cpp
lib/Target/SparcV8/SparcV8RegisterInfo.cpp
lib/Target/SparcV9/InstrSelection/InstrForest.cpp
lib/Target/SparcV9/SparcV9AsmPrinter.cpp
lib/Target/SparcV9/SparcV9InstrSelection.cpp
lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
lib/Target/SparcV9/SparcV9RegInfo.cpp
lib/Target/TargetData.cpp
lib/Target/X86/InstSelectSimple.cpp
lib/Target/X86/Printer.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86ISelSimple.cpp
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86SimpInstrSelector.cpp
lib/Transforms/IPO/FunctionResolution.cpp
lib/Transforms/IPO/MutateStructTypes.cpp
lib/Transforms/Utils/Linker.cpp
lib/VMCore/AsmWriter.cpp
lib/VMCore/ConstantFold.cpp
lib/VMCore/Constants.cpp
lib/VMCore/Linker.cpp
lib/VMCore/Type.cpp

index 58a08960279badeffee685b1be110d8874b81aee..f720562990f70b7cf3f69a6a3e3a979aca4f0104 100644 (file)
@@ -35,7 +35,7 @@ class DerivedType : public Type, public AbstractTypeUser {
   mutable std::vector<AbstractTypeUser *> AbstractTypeUsers;
 
 protected:
-  DerivedType(PrimitiveID id) : Type("", id) {}
+  DerivedType(TypeID id) : Type("", id) {}
   ~DerivedType() {
     assert(AbstractTypeUsers.empty());
   }
@@ -149,7 +149,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const FunctionType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == FunctionTyID;
+    return T->getTypeID() == FunctionTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
@@ -161,7 +161,7 @@ public:
 ///
 class CompositeType : public DerivedType {
 protected:
-  inline CompositeType(PrimitiveID id) : DerivedType(id) { }
+  inline CompositeType(TypeID id) : DerivedType(id) { }
 public:
 
   /// getTypeAtIndex - Given an index value into the type, return the type of
@@ -173,9 +173,9 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const CompositeType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == ArrayTyID || 
-           T->getPrimitiveID() == StructTyID ||
-           T->getPrimitiveID() == PointerTyID;
+    return T->getTypeID() == ArrayTyID || 
+           T->getTypeID() == StructTyID ||
+           T->getTypeID() == PointerTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
@@ -230,7 +230,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const StructType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == StructTyID;
+    return T->getTypeID() == StructTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
@@ -248,7 +248,7 @@ class SequentialType : public CompositeType {
   SequentialType(const SequentialType &);                  // Do not implement!
   const SequentialType &operator=(const SequentialType &); // Do not implement!
 protected:
-  SequentialType(PrimitiveID TID, const Type *ElType) : CompositeType(TID) {
+  SequentialType(TypeID TID, const Type *ElType) : CompositeType(TID) {
     ContainedTys.reserve(1);
     ContainedTys.push_back(PATypeHandle(ElType, this));
   }
@@ -264,7 +264,7 @@ public:
   }
   virtual bool indexValid(const Value *V) const {
     const Type *Ty = V->getType();
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::IntTyID:
     case Type::UIntTyID:
     case Type::LongTyID:
@@ -278,8 +278,8 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const SequentialType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == ArrayTyID ||
-           T->getPrimitiveID() == PointerTyID;
+    return T->getTypeID() == ArrayTyID ||
+           T->getTypeID() == PointerTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
@@ -319,7 +319,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ArrayType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == ArrayTyID;
+    return T->getTypeID() == ArrayTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
@@ -352,7 +352,7 @@ public:
   // Implement support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const PointerType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == PointerTyID;
+    return T->getTypeID() == PointerTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
@@ -391,7 +391,7 @@ public:
   // Implement support for type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const OpaqueType *T) { return true; }
   static inline bool classof(const Type *T) {
-    return T->getPrimitiveID() == OpaqueTyID;
+    return T->getTypeID() == OpaqueTyID;
   }
   static inline bool classof(const Value *V) {
     return isa<Type>(V) && classof(cast<Type>(V));
index f35506b319d875f85f588b562c34005a5ed18313..e25bfe1e0ff22fd80a2168524d353bb86bbc6795 100644 (file)
@@ -54,7 +54,7 @@ struct Type : public Value {
   /// Note: If you add an element to this, you need to add an element to the 
   /// Type::getPrimitiveType function, or else things will break!
   ///
-  enum PrimitiveID {
+  enum TypeID {
     VoidTyID = 0  , BoolTyID,           //  0, 1: Basics...
     UByteTyID     , SByteTyID,          //  2, 3: 8 bit types...
     UShortTyID    , ShortTyID,          //  4, 5: 16 bit types...
@@ -74,14 +74,14 @@ struct Type : public Value {
     //PackedTyID  ,                     // SIMD 'packed' format... TODO
     //...
 
-    NumPrimitiveIDs,                    // Must remain as last defined ID
+    NumTypeIDs,                         // Must remain as last defined ID
     FirstDerivedTyID = FunctionTyID,
   };
 
 private:
-  PrimitiveID ID;        // The current base type of this type...
-  unsigned    UID;       // The unique ID number for this class
-  bool        Abstract;  // True if type contains an OpaqueType
+  TypeID   ID;        // The current base type of this type...
+  unsigned UID;       // The unique ID number for this class
+  bool     Abstract;  // True if type contains an OpaqueType
 
   /// RefCount - This counts the number of PATypeHolders that are pointing to
   /// this type.  When this number falls to zero, if the type is abstract and
@@ -93,7 +93,7 @@ private:
   const Type *getForwardedTypeInternal() const;
 protected:
   /// ctor is protected, so only subclasses can create Type objects...
-  Type(const std::string &Name, PrimitiveID id);
+  Type(const std::string &Name, TypeID id);
   virtual ~Type() {}
 
 
@@ -137,10 +137,10 @@ public:
   // are defined in private classes defined in Type.cpp for primitive types.
   //
 
-  /// getPrimitiveID - Return the base type of the type.  This will return one
-  /// of the PrimitiveID enum elements defined above.
+  /// getTypeID - Return the type id for the type.  This will return one
+  /// of the TypeID enum elements defined above.
   ///
-  inline PrimitiveID getPrimitiveID() const { return ID; }
+  inline TypeID getTypeID() const { return ID; }
 
   /// getUniqueID - Returns the UID of the type.  This can be thought of as a
   /// small integer version of the pointer to the type class.  Two types that
@@ -259,7 +259,7 @@ public:
   //
 
   /// getPrimitiveType/getUniqueIDType - Return a type based on an identifier.
-  static const Type *getPrimitiveType(PrimitiveID IDNumber);
+  static const Type *getPrimitiveType(TypeID IDNumber);
   static const Type *getUniqueIDType(unsigned UID);
 
   //===--------------------------------------------------------------------===//
@@ -394,7 +394,7 @@ template <> struct GraphTraits<const Type*> {
 };
 
 template <> inline bool isa_impl<PointerType, Type>(const Type &Ty) { 
-  return Ty.getPrimitiveID() == Type::PointerTyID;
+  return Ty.getTypeID() == Type::PointerTyID;
 }
 
 } // End llvm namespace
index f88c3629436f54ba7bc35e333ef8c9441d2bf04f..a15f3743d8337e047a6a5c09e8b9b6e066c9663b 100644 (file)
@@ -432,7 +432,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
   while (O < Offset) {
     assert(Offset-O < TD.getTypeSize(SubType) && "Offset out of range!");
 
-    switch (SubType->getPrimitiveID()) {
+    switch (SubType->getTypeID()) {
     case Type::StructTyID: {
       const StructType *STy = cast<StructType>(SubType);
       const StructLayout &SL = *TD.getStructLayout(STy);
@@ -488,7 +488,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
     const Type *NextSubType = 0;
     unsigned NextSubTypeSize = 0;
     unsigned NextPadSize = 0;
-    switch (SubType->getPrimitiveID()) {
+    switch (SubType->getTypeID()) {
     case Type::StructTyID: {
       const StructType *STy = cast<StructType>(SubType);
       const StructLayout &SL = *TD.getStructLayout(STy);
index bb248c34ed1ac5dde74bf815a126446f2e6297a4..56852ab1f38d513546503a6389f5edc5ee0fe7c1 100644 (file)
@@ -194,7 +194,7 @@ static inline ValID &getValIDFromPlaceHolder(const Value *Val) {
       isa<FunctionType>(cast<PointerType>(Ty)->getElementType()))
     Ty = cast<PointerType>(Ty)->getElementType();
 
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::LabelTyID:  return ((BBPlaceHolder*)Val)->getDef();
   default:               return ((ValuePlaceHolder*)Val)->getDef();
   }
@@ -206,7 +206,7 @@ static inline int getLineNumFromPlaceHolder(const Value *Val) {
       isa<FunctionType>(cast<PointerType>(Ty)->getElementType()))
     Ty = cast<PointerType>(Ty)->getElementType();
 
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::LabelTyID:  return ((BBPlaceHolder*)Val)->getLineNum();
   default:               return ((ValuePlaceHolder*)Val)->getLineNum();
   }
index f06b5b02e944b999bddcd178d7a466b4aaad79b3..042680ba16e159ded71ebc169bdb266a7522e325 100644 (file)
@@ -387,7 +387,7 @@ static Value *getVal(const Type *Ty, const ValID &D) {
   // forward, so just create an entry to be resolved later and get to it...
   //
   Value *d = 0;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::LabelTyID:  d = new   BBPlaceHolder(Ty, D); break;
   default:               d = new ValuePlaceHolder(Ty, D); break;
   }
index a784811f861e195b0cce0b37a0370e7d7fe01bbb..c79318a02c9675a4ccee67689b9804bc2a4c21c5 100644 (file)
@@ -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) 
index 7856fc5447f464aa72bcfd8da7e2ede5ef86da07..59023980b69d25c74235385480a5c30e1f3f2da6 100644 (file)
@@ -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())
index 8691b26544b3876ee325377fd10b26e6e202d2f5..72d8caed67302d329c529c7a7f4c047381e97e5d 100644 (file)
@@ -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.");
index a784811f861e195b0cce0b37a0370e7d7fe01bbb..c79318a02c9675a4ccee67689b9804bc2a4c21c5 100644 (file)
@@ -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) 
index 7856fc5447f464aa72bcfd8da7e2ede5ef86da07..59023980b69d25c74235385480a5c30e1f3f2da6 100644 (file)
@@ -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())
index 2f0879ba3943323c4e83899d7a23b3ca05ff7259..2ca8a99f4cdc019cf41897080d0837dfa72d9876 100644 (file)
@@ -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...
index 9e0ffc2c3632c7d9b876a6db4b748f8bfe5e8e6e..36bf2f6f0e25de5df7d5f3688e636e2c059b9ab4 100644 (file)
@@ -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())
index bb8d286899ac4e1a22c2c4d81b553cf7a10c95cd..3234a35f5881923760e8ec25a76b30ec077b2a35 100644 (file)
 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);
index 9e063510dfe5c39f33161686a2156ed3eabdcdba..188136718d8178ba30e24ba60204fdabfc95571b 100644 (file)
@@ -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;
index 3408982c8d5fd11027160972c5645074eaaad02f..97d336e2db29d1e7487c47c188513210d113cbb0 100644 (file)
@@ -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...
index 358a6ea21e0b6df20cccb168c78d36f40b941985..42b0b5adb89661f5b37ad55c62f4bccdf2603580 100644 (file)
@@ -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");
index 1d10babfe62e416ddf66168e2978120fbe8eb74a..60e0c1fbfd083069bebabc92e118d98f1ab6d8fd 100644 (file)
@@ -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.
index 76d7bb99463807f0222de8360e2d35ac21d6062d..7dac9b3773eb0f442bff953e0d2c9ebc8f16b4ad 100644 (file)
@@ -31,7 +31,7 @@ void SelectionDAG::dump() const {
 /// method works on all scalar LLVM types.
 ///
 MVT::ValueType SelectionDAG::getValueType(const Type *Ty) const {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::VoidTyID: assert(0 && "Void type object in getValueType!");
   default: assert(0 && "Unknown type in DAGBuilder!\n");
   case Type::BoolTyID:    return MVT::i1;
index a4383e02c8f0831dda8d27e29eef201aa175ad09..253e9540d1ebc900f6f75de33ba9b1c1bbf55f58 100644 (file)
@@ -181,7 +181,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
       GenericValue GV = getConstantValue(Op);
 
       // Handle cast of pointer to pointer...
-      if (Op->getType()->getPrimitiveID() == C->getType()->getPrimitiveID())
+      if (Op->getType()->getTypeID() == C->getType()->getTypeID())
         return GV;
 
       // Handle a cast of pointer to any integral type...
@@ -190,7 +190,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
         
       // Handle cast of integer to a pointer...
       if (isa<PointerType>(C->getType()) && Op->getType()->isIntegral())
-        switch (Op->getType()->getPrimitiveID()) {
+        switch (Op->getType()->getTypeID()) {
         case Type::BoolTyID:    return PTOGV((void*)(uintptr_t)GV.BoolVal);
         case Type::SByteTyID:   return PTOGV((void*)( intptr_t)GV.SByteVal);
         case Type::UByteTyID:   return PTOGV((void*)(uintptr_t)GV.UByteVal);
@@ -221,7 +221,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
     abort();
   }
   
-  switch (C->getType()->getPrimitiveID()) {
+  switch (C->getType()->getTypeID()) {
 #define GET_CONST_VAL(TY, CLASS) \
   case Type::TY##TyID: Result.TY##Val = cast<CLASS>(C)->getValue(); break
     GET_CONST_VAL(Bool   , ConstantBool);
@@ -263,7 +263,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
 void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
                                          const Type *Ty) {
   if (getTargetData().isLittleEndian()) {
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::BoolTyID:
     case Type::UByteTyID:
     case Type::SByteTyID:   Ptr->Untyped[0] = Val.UByteVal; break;
@@ -296,7 +296,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
       std::cout << "Cannot store value of type " << Ty << "!\n";
     }
   } else {
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::BoolTyID:
     case Type::UByteTyID:
     case Type::SByteTyID:   Ptr->Untyped[0] = Val.UByteVal; break;
@@ -337,7 +337,7 @@ GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr,
                                                   const Type *Ty) {
   GenericValue Result;
   if (getTargetData().isLittleEndian()) {
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::BoolTyID:
     case Type::UByteTyID:
     case Type::SByteTyID:   Result.UByteVal = Ptr->Untyped[0]; break;
@@ -371,7 +371,7 @@ GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr,
       abort();
     }
   } else {
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::BoolTyID:
     case Type::UByteTyID:
     case Type::SByteTyID:   Result.UByteVal = Ptr->Untyped[0]; break;
@@ -422,7 +422,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
     return;
   }
 
-  switch (Init->getType()->getPrimitiveID()) {
+  switch (Init->getType()->getTypeID()) {
   case Type::ArrayTyID: {
     const ConstantArray *CPA = cast<ConstantArray>(Init);
     const std::vector<Use> &Val = CPA->getValues();
index 769d0e6e96f43a635bbbe9aa439980843b983991..3348ab48826d276ed14ad7d634c155a6534327ff 100644 (file)
@@ -182,7 +182,7 @@ void Interpreter::initializeExecutionEngine() {
 static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(+, UByte);
     IMPLEMENT_BINARY_OPERATOR(+, SByte);
     IMPLEMENT_BINARY_OPERATOR(+, UShort);
@@ -203,7 +203,7 @@ static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSubInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(-, UByte);
     IMPLEMENT_BINARY_OPERATOR(-, SByte);
     IMPLEMENT_BINARY_OPERATOR(-, UShort);
@@ -224,7 +224,7 @@ static GenericValue executeSubInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeMulInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(*, UByte);
     IMPLEMENT_BINARY_OPERATOR(*, SByte);
     IMPLEMENT_BINARY_OPERATOR(*, UShort);
@@ -245,7 +245,7 @@ static GenericValue executeMulInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeDivInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(/, UByte);
     IMPLEMENT_BINARY_OPERATOR(/, SByte);
     IMPLEMENT_BINARY_OPERATOR(/, UShort);
@@ -266,7 +266,7 @@ static GenericValue executeDivInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeRemInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(%, UByte);
     IMPLEMENT_BINARY_OPERATOR(%, SByte);
     IMPLEMENT_BINARY_OPERATOR(%, UShort);
@@ -291,7 +291,7 @@ static GenericValue executeRemInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeAndInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(&, Bool);
     IMPLEMENT_BINARY_OPERATOR(&, UByte);
     IMPLEMENT_BINARY_OPERATOR(&, SByte);
@@ -311,7 +311,7 @@ static GenericValue executeAndInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeOrInst(GenericValue Src1, GenericValue Src2, 
                                   const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(|, Bool);
     IMPLEMENT_BINARY_OPERATOR(|, UByte);
     IMPLEMENT_BINARY_OPERATOR(|, SByte);
@@ -331,7 +331,7 @@ static GenericValue executeOrInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeXorInst(GenericValue Src1, GenericValue Src2, 
                                    const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_BINARY_OPERATOR(^, Bool);
     IMPLEMENT_BINARY_OPERATOR(^, UByte);
     IMPLEMENT_BINARY_OPERATOR(^, SByte);
@@ -363,7 +363,7 @@ static GenericValue executeXorInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSetEQInst(GenericValue Src1, GenericValue Src2, 
                                     const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SETCC(==, UByte);
     IMPLEMENT_SETCC(==, SByte);
     IMPLEMENT_SETCC(==, UShort);
@@ -385,7 +385,7 @@ static GenericValue executeSetEQInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSetNEInst(GenericValue Src1, GenericValue Src2, 
                                     const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SETCC(!=, UByte);
     IMPLEMENT_SETCC(!=, SByte);
     IMPLEMENT_SETCC(!=, UShort);
@@ -408,7 +408,7 @@ static GenericValue executeSetNEInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSetLEInst(GenericValue Src1, GenericValue Src2, 
                                     const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SETCC(<=, UByte);
     IMPLEMENT_SETCC(<=, SByte);
     IMPLEMENT_SETCC(<=, UShort);
@@ -430,7 +430,7 @@ static GenericValue executeSetLEInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSetGEInst(GenericValue Src1, GenericValue Src2, 
                                     const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SETCC(>=, UByte);
     IMPLEMENT_SETCC(>=, SByte);
     IMPLEMENT_SETCC(>=, UShort);
@@ -452,7 +452,7 @@ static GenericValue executeSetGEInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSetLTInst(GenericValue Src1, GenericValue Src2, 
                                     const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SETCC(<, UByte);
     IMPLEMENT_SETCC(<, SByte);
     IMPLEMENT_SETCC(<, UShort);
@@ -474,7 +474,7 @@ static GenericValue executeSetLTInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeSetGTInst(GenericValue Src1, GenericValue Src2, 
                                     const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SETCC(>, UByte);
     IMPLEMENT_SETCC(>, SByte);
     IMPLEMENT_SETCC(>, UShort);
@@ -739,7 +739,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
       GenericValue IdxGV = getOperandValue(I.getOperand(), SF);
 
       uint64_t Idx;
-      switch (I.getOperand()->getType()->getPrimitiveID()) {
+      switch (I.getOperand()->getType()->getTypeID()) {
       default: assert(0 && "Illegal getelementptr index for sequential type!");
       case Type::SByteTyID:  Idx = IdxGV.SByteVal; break;
       case Type::ShortTyID:  Idx = IdxGV.ShortVal; break;
@@ -865,7 +865,7 @@ void Interpreter::visitCallSite(CallSite CS) {
 static GenericValue executeShlInst(GenericValue Src1, GenericValue Src2,
                                    const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SHIFT(<<, UByte);
     IMPLEMENT_SHIFT(<<, SByte);
     IMPLEMENT_SHIFT(<<, UShort);
@@ -883,7 +883,7 @@ static GenericValue executeShlInst(GenericValue Src1, GenericValue Src2,
 static GenericValue executeShrInst(GenericValue Src1, GenericValue Src2,
                                    const Type *Ty) {
   GenericValue Dest;
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_SHIFT(>>, UByte);
     IMPLEMENT_SHIFT(>>, SByte);
     IMPLEMENT_SHIFT(>>, UShort);
@@ -924,7 +924,7 @@ void Interpreter::visitShr(ShiftInst &I) {
 
 #define IMPLEMENT_CAST_CASE_START(DESTTY, DESTCTY)    \
   case Type::DESTTY##TyID:                      \
-    switch (SrcTy->getPrimitiveID()) {          \
+    switch (SrcTy->getTypeID()) {          \
       IMPLEMENT_CAST(DESTTY, DESTCTY, Bool);    \
       IMPLEMENT_CAST(DESTTY, DESTCTY, UByte);   \
       IMPLEMENT_CAST(DESTTY, DESTCTY, SByte);   \
@@ -956,7 +956,7 @@ GenericValue Interpreter::executeCastOperation(Value *SrcVal, const Type *Ty,
   const Type *SrcTy = SrcVal->getType();
   GenericValue Dest, Src = getOperandValue(SrcVal, SF);
 
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_CAST_CASE(UByte  , (unsigned char));
     IMPLEMENT_CAST_CASE(SByte  , (  signed char));
     IMPLEMENT_CAST_CASE(UShort , (unsigned short));
@@ -1007,7 +1007,7 @@ void Interpreter::visitVAArgInst(VAArgInst &I) {
   GenericValue Src = ECStack[VAList.UIntPairVal.first]
        .VarArgs[VAList.UIntPairVal.second];
   const Type *Ty = I.getType();
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
     IMPLEMENT_VAARG(UByte);
     IMPLEMENT_VAARG(SByte);
     IMPLEMENT_VAARG(UShort);
index 2299874f532d847a39f6c875e74dd0cec3fdbacd..83da7551b0a23baa66ea7aadb9c8619c2f1bee9f 100644 (file)
@@ -38,7 +38,7 @@ static std::map<std::string, ExFunc> FuncNames;
 static Interpreter *TheInterpreter;
 
 static char getTypeID(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::VoidTyID:    return 'V';
   case Type::BoolTyID:    return 'o';
   case Type::UByteTyID:   return 'B';
index 6220140afe372e85c7e5c7e9301015e1c9c3c1b4..00906a46a260c5981b79bf3b5b4f1d7db3da201a 100644 (file)
@@ -97,10 +97,10 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
   
   // Two types cannot be resolved together if they are of different primitive
   // type.  For example, we cannot resolve an int to a float.
-  if (DestTyT->getPrimitiveID() != SrcTyT->getPrimitiveID()) return true;
+  if (DestTyT->getTypeID() != SrcTyT->getTypeID()) return true;
 
   // Otherwise, resolve the used type used by this derived type...
-  switch (DestTyT->getPrimitiveID()) {
+  switch (DestTyT->getTypeID()) {
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
         cast<FunctionType>(SrcTyT)->isVarArg() ||
index d993919f8b1064d2aea82a70105f921ec4e743c4..05be7706b3306a6f3448a55a26f6d9b578e0b9c0 100644 (file)
@@ -255,7 +255,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
                                  const std::string &NameSoFar,
                                  bool IgnoreName) {
   if (Ty->isPrimitiveType())
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::VoidTyID:   return Out << "void "               << NameSoFar;
     case Type::BoolTyID:   return Out << "bool "               << NameSoFar;
     case Type::UByteTyID:  return Out << "unsigned char "      << NameSoFar;
@@ -279,7 +279,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
     if (I != TypeNames.end()) return Out << I->second << " " << NameSoFar;
   }
 
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FunctionTyID: {
     const FunctionType *MTy = cast<FunctionType>(Ty);
     std::stringstream FunctionInnards; 
@@ -518,7 +518,7 @@ void CWriter::printConstant(Constant *CPV) {
     }
   }
 
-  switch (CPV->getType()->getPrimitiveID()) {
+  switch (CPV->getType()->getTypeID()) {
   case Type::BoolTyID:
     Out << (CPV == ConstantBool::False ? "0" : "1"); break;
   case Type::SByteTyID:
index d993919f8b1064d2aea82a70105f921ec4e743c4..05be7706b3306a6f3448a55a26f6d9b578e0b9c0 100644 (file)
@@ -255,7 +255,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
                                  const std::string &NameSoFar,
                                  bool IgnoreName) {
   if (Ty->isPrimitiveType())
-    switch (Ty->getPrimitiveID()) {
+    switch (Ty->getTypeID()) {
     case Type::VoidTyID:   return Out << "void "               << NameSoFar;
     case Type::BoolTyID:   return Out << "bool "               << NameSoFar;
     case Type::UByteTyID:  return Out << "unsigned char "      << NameSoFar;
@@ -279,7 +279,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
     if (I != TypeNames.end()) return Out << I->second << " " << NameSoFar;
   }
 
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FunctionTyID: {
     const FunctionType *MTy = cast<FunctionType>(Ty);
     std::stringstream FunctionInnards; 
@@ -518,7 +518,7 @@ void CWriter::printConstant(Constant *CPV) {
     }
   }
 
-  switch (CPV->getType()->getPrimitiveID()) {
+  switch (CPV->getType()->getTypeID()) {
   case Type::BoolTyID:
     Out << (CPV == ConstantBool::False ? "0" : "1"); break;
   case Type::SByteTyID:
index fac772b65cf3ad0c9d11020359f60aadd919701d..8d308edbd8c8fdb52a243ebc1a09785e10f11182 100644 (file)
@@ -168,7 +168,7 @@ enum TypeClass {
 };
 
 static TypeClass getClass (const Type *T) {
-  switch (T->getPrimitiveID ()) {
+  switch (T->getTypeID()) {
     case Type::UByteTyID:  case Type::SByteTyID:  return cByte;
     case Type::UShortTyID: case Type::ShortTyID:  return cShort;
     case Type::PointerTyID:
index 226f972b59d9bde64f276309efc72d46415677c9..342b72065b98f3fd1c4862c9797094146dc0ded4 100644 (file)
@@ -249,7 +249,7 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
     // FP Constants are printed as integer constants to avoid losing
     // precision...
     double Val = CFP->getValue();
-    switch (CFP->getType()->getPrimitiveID()) {
+    switch (CFP->getType()->getTypeID()) {
     default: assert(0 && "Unknown floating point type!");
     case Type::FloatTyID: {
       union FU {                            // Abide by C TBAA rules
@@ -274,7 +274,7 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
 
   const Type *type = CV->getType();
   O << "\t";
-  switch (type->getPrimitiveID()) {
+  switch (type->getTypeID()) {
   case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID:
     O << ".byte";
     break;
index c5034d57ad67c72d78cf0555bb9a509e38efb51b..83896f89a20adbe3242d01cd230ffaefccb07573 100644 (file)
@@ -127,7 +127,7 @@ void SparcV8RegisterInfo::emitEpilogue(MachineFunction &MF,
 
 const TargetRegisterClass*
 SparcV8RegisterInfo::getRegClassForType(const Type* Ty) const {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FloatTyID:  return &FPRegsInstance;
   case Type::DoubleTyID: return &DFPRegsInstance;
   case Type::LongTyID:
index fac772b65cf3ad0c9d11020359f60aadd919701d..8d308edbd8c8fdb52a243ebc1a09785e10f11182 100644 (file)
@@ -168,7 +168,7 @@ enum TypeClass {
 };
 
 static TypeClass getClass (const Type *T) {
-  switch (T->getPrimitiveID ()) {
+  switch (T->getTypeID()) {
     case Type::UByteTyID:  case Type::SByteTyID:  return cByte;
     case Type::UShortTyID: case Type::ShortTyID:  return cShort;
     case Type::PointerTyID:
index fac772b65cf3ad0c9d11020359f60aadd919701d..8d308edbd8c8fdb52a243ebc1a09785e10f11182 100644 (file)
@@ -168,7 +168,7 @@ enum TypeClass {
 };
 
 static TypeClass getClass (const Type *T) {
-  switch (T->getPrimitiveID ()) {
+  switch (T->getTypeID()) {
     case Type::UByteTyID:  case Type::SByteTyID:  return cByte;
     case Type::UShortTyID: case Type::ShortTyID:  return cShort;
     case Type::PointerTyID:
index 226f972b59d9bde64f276309efc72d46415677c9..342b72065b98f3fd1c4862c9797094146dc0ded4 100644 (file)
@@ -249,7 +249,7 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
     // FP Constants are printed as integer constants to avoid losing
     // precision...
     double Val = CFP->getValue();
-    switch (CFP->getType()->getPrimitiveID()) {
+    switch (CFP->getType()->getTypeID()) {
     default: assert(0 && "Unknown floating point type!");
     case Type::FloatTyID: {
       union FU {                            // Abide by C TBAA rules
@@ -274,7 +274,7 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
 
   const Type *type = CV->getType();
   O << "\t";
-  switch (type->getPrimitiveID()) {
+  switch (type->getTypeID()) {
   case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID:
     O << ".byte";
     break;
index fac772b65cf3ad0c9d11020359f60aadd919701d..8d308edbd8c8fdb52a243ebc1a09785e10f11182 100644 (file)
@@ -168,7 +168,7 @@ enum TypeClass {
 };
 
 static TypeClass getClass (const Type *T) {
-  switch (T->getPrimitiveID ()) {
+  switch (T->getTypeID()) {
     case Type::UByteTyID:  case Type::SByteTyID:  return cByte;
     case Type::UShortTyID: case Type::ShortTyID:  return cShort;
     case Type::PointerTyID:
index c5034d57ad67c72d78cf0555bb9a509e38efb51b..83896f89a20adbe3242d01cd230ffaefccb07573 100644 (file)
@@ -127,7 +127,7 @@ void SparcV8RegisterInfo::emitEpilogue(MachineFunction &MF,
 
 const TargetRegisterClass*
 SparcV8RegisterInfo::getRegClassForType(const Type* Ty) const {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FloatTyID:  return &FPRegsInstance;
   case Type::DoubleTyID: return &DFPRegsInstance;
   case Type::LongTyID:
index d7409d896b3761bc237ff0d4b2f6b2478273d990..ee172fdd0c81be06913bf05e355f25cfa4966258 100644 (file)
@@ -79,7 +79,7 @@ InstructionNode::InstructionNode(Instruction* I)
       opLabel = opLabel + 100;  // bitwise operator
   } else if (opLabel == Instruction::Cast) {
     const Type *ITy = I->getType();
-    switch(ITy->getPrimitiveID())
+    switch(ITy->getTypeID())
     {
     case Type::BoolTyID:    opLabel = ToBoolTy;    break;
     case Type::UByteTyID:   opLabel = ToUByteTy;   break;
index 6898704191ade720f15c7b1f7a82fa872ac29cb9..aa183452553090aa62ff8e66b87ebee72d0df556 100644 (file)
@@ -85,8 +85,7 @@ namespace {
 
   inline const std::string
   TypeToDataDirective(const Type* type) {
-    switch(type->getPrimitiveID())
-    {
+    switch(type->getTypeID()) {
     case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID:
       return ".byte";
     case Type::UShortTyID: case Type::ShortTyID:
index dbe40acad333591d6d6ca1da8ef8120108ad4e16..f53f856feaf31774f2105f6c613f5a6ba1050abf 100644 (file)
@@ -650,7 +650,7 @@ ChooseSubInstructionByType(const Type* resultType)
   if (resultType->isInteger() || isa<PointerType>(resultType)) {
       opCode = V9::SUBr;
   } else {
-    switch(resultType->getPrimitiveID())
+    switch(resultType->getTypeID())
     {
     case Type::FloatTyID:  opCode = V9::FSUBS; break;
     case Type::DoubleTyID: opCode = V9::FSUBD; break;
@@ -691,7 +691,7 @@ ChooseFcmpInstruction(const InstructionNode* instrNode)
   MachineOpCode opCode = V9::INVALID_OPCODE;
   
   Value* operand = ((InstrTreeNode*) instrNode->leftChild())->getValue();
-  switch(operand->getType()->getPrimitiveID()) {
+  switch(operand->getType()->getTypeID()) {
   case Type::FloatTyID:  opCode = V9::FCMPS; break;
   case Type::DoubleTyID: opCode = V9::FCMPD; break;
   default: assert(0 && "Invalid type for FCMP instruction"); break; 
@@ -727,7 +727,7 @@ ChooseMulInstructionByType(const Type* resultType)
   if (resultType->isInteger())
     opCode = V9::MULXr;
   else
-    switch(resultType->getPrimitiveID())
+    switch(resultType->getTypeID())
     {
     case Type::FloatTyID:  opCode = V9::FMULS; break;
     case Type::DoubleTyID: opCode = V9::FMULD; break;
@@ -946,7 +946,7 @@ ChooseDivInstruction(TargetMachine &target,
   if (resultType->isInteger())
     opCode = resultType->isSigned()? V9::SDIVXr : V9::UDIVXr;
   else
-    switch(resultType->getPrimitiveID())
+    switch(resultType->getTypeID())
       {
       case Type::FloatTyID:  opCode = V9::FDIVS; break;
       case Type::DoubleTyID: opCode = V9::FDIVD; break;
index a59045fe05db0b2fb05e6e9333a317502380329e..bf5617a21a2fb14a389acd222ad4c7e2453420fb 100644 (file)
@@ -23,7 +23,7 @@ namespace llvm {
 inline MachineOpCode
 ChooseLoadInstruction(const Type *DestTy)
 {
-  switch (DestTy->getPrimitiveID()) {
+  switch (DestTy->getTypeID()) {
   case Type::BoolTyID:
   case Type::UByteTyID:   return V9::LDUBr;
   case Type::SByteTyID:   return V9::LDSBr;
@@ -46,7 +46,7 @@ ChooseLoadInstruction(const Type *DestTy)
 inline MachineOpCode
 ChooseStoreInstruction(const Type *DestTy)
 {
-  switch (DestTy->getPrimitiveID()) {
+  switch (DestTy->getTypeID()) {
   case Type::BoolTyID:
   case Type::UByteTyID:
   case Type::SByteTyID:   return V9::STBr;
@@ -79,7 +79,7 @@ ChooseAddInstructionByType(const Type* resultType)
     opCode = V9::ADDr;
   }
   else
-    switch(resultType->getPrimitiveID())
+    switch(resultType->getTypeID())
     {
     case Type::FloatTyID:  opCode = V9::FADDS; break;
     case Type::DoubleTyID: opCode = V9::FADDD; break;
index 2483ca8c36670b186da3f09f757a32be2a466405..a7e1dbdcb9100a225b52f94a0c2e9d55dc95b4b4 100644 (file)
@@ -272,7 +272,7 @@ int SparcV9RegInfo::getRegType(int unifiedRegNum) const
 //
 unsigned SparcV9RegInfo::getRegClassIDOfType(const Type *type,
                                                 bool isCCReg) const {
-  Type::PrimitiveID ty = type->getPrimitiveID();
+  Type::TypeID ty = type->getTypeID();
   unsigned res;
     
   // FIXME: Comparing types like this isn't very safe...
index 4b69f103a83851debb7b740e1fc2f6a2a54806e6..caa66fe09156aa17b04c7c0f0382991f8241f0c1 100644 (file)
@@ -150,7 +150,7 @@ const StructLayout *TargetData::getStructLayout(const StructType *Ty) const {
 static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
                               uint64_t &Size, unsigned char &Alignment) {
   assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::VoidTyID:
   case Type::BoolTyID:
   case Type::UByteTyID:
index 9cf4b60bd521e0bd0b6452e6125c8d8eb9bd7991..0c8b0a456677a6e462129c8de3b892e4b6c6e2d6 100644 (file)
@@ -47,7 +47,7 @@ namespace {
 /// size of the type, and whether or not it is floating point.
 ///
 static inline TypeClass getClass(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::SByteTyID:
   case Type::UByteTyID:   return cByte;      // Byte operands are class #0
   case Type::ShortTyID:
@@ -3258,7 +3258,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB,
     const Type *PromoteType = 0;
     unsigned PromoteOpcode = 0;
     unsigned RealDestReg = DestReg;
-    switch (SrcTy->getPrimitiveID()) {
+    switch (SrcTy->getTypeID()) {
     case Type::BoolTyID:
     case Type::SByteTyID:
       // We don't have the facilities for directly loading byte sized data from
@@ -3429,7 +3429,7 @@ void ISel::visitVANextInst(VANextInst &I) {
   unsigned DestReg = getReg(I);
 
   unsigned Size;
-  switch (I.getArgType()->getPrimitiveID()) {
+  switch (I.getArgType()->getTypeID()) {
   default:
     std::cerr << I;
     assert(0 && "Error: bad type for va_next instruction!");
@@ -3454,7 +3454,7 @@ void ISel::visitVAArgInst(VAArgInst &I) {
   unsigned VAList = getReg(I.getOperand(0));
   unsigned DestReg = getReg(I);
 
-  switch (I.getType()->getPrimitiveID()) {
+  switch (I.getType()->getTypeID()) {
   default:
     std::cerr << I;
     assert(0 && "Error: bad type for va_next instruction!");
index cbc4aeacf568c698d8831a28f20448cf33e9aeae..2a9ba83b4edcf8aec76b21e67d4df898f0847614 100644 (file)
@@ -285,7 +285,7 @@ void Printer::emitGlobalConstant(const Constant *CV) {
     // FP Constants are printed as integer constants to avoid losing
     // precision...
     double Val = CFP->getValue();
-    switch (CFP->getType()->getPrimitiveID()) {
+    switch (CFP->getType()->getTypeID()) {
     default: assert(0 && "Unknown floating point type!");
     case Type::FloatTyID: {
       union FU {                            // Abide by C TBAA rules
@@ -310,7 +310,7 @@ void Printer::emitGlobalConstant(const Constant *CV) {
 
   const Type *type = CV->getType();
   O << "\t";
-  switch (type->getPrimitiveID()) {
+  switch (type->getTypeID()) {
   case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID:
     O << ".byte";
     break;
index cbc4aeacf568c698d8831a28f20448cf33e9aeae..2a9ba83b4edcf8aec76b21e67d4df898f0847614 100644 (file)
@@ -285,7 +285,7 @@ void Printer::emitGlobalConstant(const Constant *CV) {
     // FP Constants are printed as integer constants to avoid losing
     // precision...
     double Val = CFP->getValue();
-    switch (CFP->getType()->getPrimitiveID()) {
+    switch (CFP->getType()->getTypeID()) {
     default: assert(0 && "Unknown floating point type!");
     case Type::FloatTyID: {
       union FU {                            // Abide by C TBAA rules
@@ -310,7 +310,7 @@ void Printer::emitGlobalConstant(const Constant *CV) {
 
   const Type *type = CV->getType();
   O << "\t";
-  switch (type->getPrimitiveID()) {
+  switch (type->getTypeID()) {
   case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID:
     O << ".byte";
     break;
index 9cf4b60bd521e0bd0b6452e6125c8d8eb9bd7991..0c8b0a456677a6e462129c8de3b892e4b6c6e2d6 100644 (file)
@@ -47,7 +47,7 @@ namespace {
 /// size of the type, and whether or not it is floating point.
 ///
 static inline TypeClass getClass(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::SByteTyID:
   case Type::UByteTyID:   return cByte;      // Byte operands are class #0
   case Type::ShortTyID:
@@ -3258,7 +3258,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB,
     const Type *PromoteType = 0;
     unsigned PromoteOpcode = 0;
     unsigned RealDestReg = DestReg;
-    switch (SrcTy->getPrimitiveID()) {
+    switch (SrcTy->getTypeID()) {
     case Type::BoolTyID:
     case Type::SByteTyID:
       // We don't have the facilities for directly loading byte sized data from
@@ -3429,7 +3429,7 @@ void ISel::visitVANextInst(VANextInst &I) {
   unsigned DestReg = getReg(I);
 
   unsigned Size;
-  switch (I.getArgType()->getPrimitiveID()) {
+  switch (I.getArgType()->getTypeID()) {
   default:
     std::cerr << I;
     assert(0 && "Error: bad type for va_next instruction!");
@@ -3454,7 +3454,7 @@ void ISel::visitVAArgInst(VAArgInst &I) {
   unsigned VAList = getReg(I.getOperand(0));
   unsigned DestReg = getReg(I);
 
-  switch (I.getType()->getPrimitiveID()) {
+  switch (I.getType()->getTypeID()) {
   default:
     std::cerr << I;
     assert(0 && "Error: bad type for va_next instruction!");
index 02d9fc5d17f684ece05d6e9264d7297fcf4e4a25..03fe5505aed8fa6c1b5c396ad91517ea9c6fd07a 100644 (file)
@@ -503,7 +503,7 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
 
 const TargetRegisterClass*
 X86RegisterInfo::getRegClassForType(const Type* Ty) const {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::LongTyID:
   case Type::ULongTyID: assert(0 && "Long values can't fit in registers!");
   default:              assert(0 && "Invalid type to getClass!");
index 3c02acb404463e08e22df9ffe312c53c12da2132..7a6115e3ec79ecc11cf84ac85a54c1c366477ac4 100644 (file)
@@ -347,7 +347,7 @@ enum Subclasses {
 /// size of the type, and whether or not it is floating point.
 ///
 static inline TypeClass getClass(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::SByteTyID:
   case Type::UByteTyID:   return cByte;      // Byte operands are class #0
   case Type::ShortTyID:
@@ -2246,7 +2246,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB,
     const Type *PromoteType = 0;
     unsigned PromoteOpcode;
     unsigned RealDestReg = DestReg;
-    switch (SrcTy->getPrimitiveID()) {
+    switch (SrcTy->getTypeID()) {
     case Type::BoolTyID:
     case Type::SByteTyID:
       // We don't have the facilities for directly loading byte sized data from
@@ -2418,7 +2418,7 @@ void ISel::visitVANextInst(VANextInst &I) {
   unsigned DestReg = getReg(I);
 
   unsigned Size;
-  switch (I.getArgType()->getPrimitiveID()) {
+  switch (I.getArgType()->getTypeID()) {
   default:
     std::cerr << I;
     assert(0 && "Error: bad type for va_next instruction!");
@@ -2443,7 +2443,7 @@ void ISel::visitVAArgInst(VAArgInst &I) {
   unsigned VAList = getReg(I.getOperand(0));
   unsigned DestReg = getReg(I);
 
-  switch (I.getType()->getPrimitiveID()) {
+  switch (I.getType()->getTypeID()) {
   default:
     std::cerr << I;
     assert(0 && "Error: bad type for va_next instruction!");
index d0179809b98d9a7beb19b28769180a39811f174c..528c8acce1802f5c72eced4c95d691b19d5301fe 100644 (file)
@@ -79,8 +79,8 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
       if (!Old->use_empty() && !Concrete->use_empty())
         for (unsigned i = 0; i < NumArguments; ++i)
           if (OldMT->getParamType(i) != ConcreteMT->getParamType(i))
-            if (OldMT->getParamType(i)->getPrimitiveID() != 
-                ConcreteMT->getParamType(i)->getPrimitiveID()) {
+            if (OldMT->getParamType(i)->getTypeID() != 
+                ConcreteMT->getParamType(i)->getTypeID()) {
               std::cerr << "WARNING: Function [" << Old->getName()
                         << "]: Parameter types conflict for: '";
               WriteTypeSymbolic(std::cerr, OldMT, &M);
index 38f9445218c32bf1361b30f4108900e29a30800e..d68967312912570326abc107bc185092ca762475 100644 (file)
@@ -54,7 +54,7 @@ const Type *MutateStructTypes::ConvertType(const Type *Ty) {
   PATypeHolder PlaceHolder = OpaqueType::get();
   TypeMap.insert(std::make_pair(Ty, PlaceHolder.get()));
 
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FunctionTyID: {
     const FunctionType *FT = cast<FunctionType>(Ty);
     const Type *RetTy = ConvertType(FT->getReturnType());
index 6220140afe372e85c7e5c7e9301015e1c9c3c1b4..00906a46a260c5981b79bf3b5b4f1d7db3da201a 100644 (file)
@@ -97,10 +97,10 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
   
   // Two types cannot be resolved together if they are of different primitive
   // type.  For example, we cannot resolve an int to a float.
-  if (DestTyT->getPrimitiveID() != SrcTyT->getPrimitiveID()) return true;
+  if (DestTyT->getTypeID() != SrcTyT->getTypeID()) return true;
 
   // Otherwise, resolve the used type used by this derived type...
-  switch (DestTyT->getPrimitiveID()) {
+  switch (DestTyT->getTypeID()) {
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
         cast<FunctionType>(SrcTyT)->isVarArg() ||
index 570d5b3d4f30454eff3a7f3d87674b92b12487ca..976cdd5b7fd9b3d5b22fba3b7c5db10e93055910 100644 (file)
@@ -262,7 +262,7 @@ static void calcTypeName(const Type *Ty,
 
   TypeStack.push_back(Ty);    // Recursive case: Add us to the stack..
   
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FunctionTyID: {
     const FunctionType *FTy = cast<FunctionType>(Ty);
     calcTypeName(FTy->getReturnType(), TypeStack, TypeNames, Result);
index 70984cd0a634daef58ae411267a1ed4026efe976..a57606669d3fa02ae6d6d552b9f9c068d0cf5b45 100644 (file)
@@ -489,7 +489,7 @@ ConstRules &ConstRules::get(const Constant *V1, const Constant *V2) {
       isa<ConstantPointerRef>(V1) || isa<ConstantPointerRef>(V2))
     return EmptyR;
 
-  switch (V1->getType()->getPrimitiveID()) {
+  switch (V1->getType()->getTypeID()) {
   default: assert(0 && "Unknown value type for constant folding!");
   case Type::BoolTyID:    return BoolR;
   case Type::PointerTyID: return NullPointerR;
@@ -564,7 +564,7 @@ Constant *llvm::ConstantFoldCastInstruction(const Constant *V,
 
   ConstRules &Rules = ConstRules::get(V, V);
 
-  switch (DestTy->getPrimitiveID()) {
+  switch (DestTy->getTypeID()) {
   case Type::BoolTyID:    return Rules.castToBool(V);
   case Type::UByteTyID:   return Rules.castToUByte(V);
   case Type::SByteTyID:   return Rules.castToSByte(V);
index 3e5cd78d44203fba8c3fd392bd782e1844a9c8f0..e18f9b2e543f57094ddf9f67328a263c03da1266 100644 (file)
@@ -66,7 +66,7 @@ void Constant::destroyConstantImpl() {
 
 // Static constructor to create a '0' constant of arbitrary type...
 Constant *Constant::getNullValue(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::BoolTyID: {
     static Constant *NullBool = ConstantBool::get(false);
     return NullBool;
@@ -128,7 +128,7 @@ Constant *Constant::getNullValue(const Type *Ty) {
 
 // Static constructor to create the maximum constant of an integral type...
 ConstantIntegral *ConstantIntegral::getMaxValue(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::BoolTyID:   return ConstantBool::True;
   case Type::SByteTyID:
   case Type::ShortTyID:
@@ -152,7 +152,7 @@ ConstantIntegral *ConstantIntegral::getMaxValue(const Type *Ty) {
 
 // Static constructor to create the minimum constant for an integral type...
 ConstantIntegral *ConstantIntegral::getMinValue(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::BoolTyID:   return ConstantBool::False;
   case Type::SByteTyID:
   case Type::ShortTyID:
@@ -176,7 +176,7 @@ ConstantIntegral *ConstantIntegral::getMinValue(const Type *Ty) {
 
 // Static constructor to create an integral constant with all bits set
 ConstantIntegral *ConstantIntegral::getAllOnesValue(const Type *Ty) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::BoolTyID:   return ConstantBool::True;
   case Type::SByteTyID:
   case Type::ShortTyID:
@@ -243,8 +243,7 @@ ConstantArray::ConstantArray(const ArrayType *T,
   for (unsigned i = 0, e = V.size(); i != e; ++i) {
     assert(V[i]->getType() == T->getElementType() ||
            (T->isAbstract() &&
-            V[i]->getType()->getPrimitiveID() ==
-            T->getElementType()->getPrimitiveID()));
+            V[i]->getType()->getTypeID() == T->getElementType()->getTypeID()));
     Operands.push_back(Use(V[i], this));
   }
 }
@@ -258,8 +257,7 @@ ConstantStruct::ConstantStruct(const StructType *T,
     assert((V[i]->getType() == T->getElementType(i) ||
             ((T->getElementType(i)->isAbstract() ||
               V[i]->getType()->isAbstract()) &&
-             T->getElementType(i)->getPrimitiveID() == 
-                      V[i]->getType()->getPrimitiveID())) &&
+             T->getElementType(i)->getTypeID() == V[i]->getType()->getTypeID())) &&
            "Initializer for struct element doesn't match struct element type!");
     Operands.push_back(Use(V[i], this));
   }
@@ -433,7 +431,7 @@ bool ConstantPointerRef::classof(const Constant *CPV) {
 //                      isValueValidForType implementations
 
 bool ConstantSInt::isValueValidForType(const Type *Ty, int64_t Val) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   default:
     return false;         // These can't be represented as integers!!!
     // Signed types...
@@ -449,7 +447,7 @@ bool ConstantSInt::isValueValidForType(const Type *Ty, int64_t Val) {
 }
 
 bool ConstantUInt::isValueValidForType(const Type *Ty, uint64_t Val) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   default:
     return false;         // These can't be represented as integers!!!
 
@@ -466,7 +464,7 @@ bool ConstantUInt::isValueValidForType(const Type *Ty, uint64_t Val) {
 }
 
 bool ConstantFP::isValueValidForType(const Type *Ty, double Val) {
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   default:
     return false;         // These can't be represented as floating point!
 
index 6220140afe372e85c7e5c7e9301015e1c9c3c1b4..00906a46a260c5981b79bf3b5b4f1d7db3da201a 100644 (file)
@@ -97,10 +97,10 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
   
   // Two types cannot be resolved together if they are of different primitive
   // type.  For example, we cannot resolve an int to a float.
-  if (DestTyT->getPrimitiveID() != SrcTyT->getPrimitiveID()) return true;
+  if (DestTyT->getTypeID() != SrcTyT->getTypeID()) return true;
 
   // Otherwise, resolve the used type used by this derived type...
-  switch (DestTyT->getPrimitiveID()) {
+  switch (DestTyT->getTypeID()) {
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
         cast<FunctionType>(SrcTyT)->isVarArg() ||
index 9d98bd9f1ac02827322ad6cdd9343b072f775e36..779848924247e3d15773da0480106cab843692bf 100644 (file)
@@ -42,7 +42,7 @@ static std::vector<const Type *> UIDMappings;
 static std::map<const Type*, std::string> ConcreteTypeDescriptions;
 static std::map<const Type*, std::string> AbstractTypeDescriptions;
 
-Type::Type(const std::string &name, PrimitiveID id)
+Type::Type(const std::string &name, TypeID id)
   : Value(Type::TypeTy, Value::TypeVal), RefCount(0), ForwardType(0) {
   if (!name.empty())
     ConcreteTypeDescriptions[this] = name;
@@ -64,7 +64,7 @@ const Type *Type::getUniqueIDType(unsigned UID) {
   return UIDMappings[UID];
 }
 
-const Type *Type::getPrimitiveType(PrimitiveID IDNumber) {
+const Type *Type::getPrimitiveType(TypeID IDNumber) {
   switch (IDNumber) {
   case VoidTyID  : return VoidTy;
   case BoolTyID  : return BoolTy;
@@ -93,11 +93,11 @@ bool Type::isLosslesslyConvertibleTo(const Type *Ty) const {
   if ((!isPrimitiveType()    && !isa<PointerType>(this)) ||
       (!isa<PointerType>(Ty) && !Ty->isPrimitiveType())) return false;
 
-  if (getPrimitiveID() == Ty->getPrimitiveID())
+  if (getTypeID() == Ty->getTypeID())
     return true;  // Handles identity cast, and cast of differing pointer types
 
   // Now we know that they are two differing primitive or pointer types
-  switch (getPrimitiveID()) {
+  switch (getTypeID()) {
   case Type::UByteTyID:   return Ty == Type::SByteTy;
   case Type::SByteTyID:   return Ty == Type::UByteTy;
   case Type::UShortTyID:  return Ty == Type::ShortTy;
@@ -115,7 +115,7 @@ bool Type::isLosslesslyConvertibleTo(const Type *Ty) const {
 /// getUnsignedVersion - If this is an integer type, return the unsigned
 /// variant of this type.  For example int -> uint.
 const Type *Type::getUnsignedVersion() const {
-  switch (getPrimitiveID()) {
+  switch (getTypeID()) {
   default:
     assert(isInteger()&&"Type::getUnsignedVersion is only valid for integers!");
   case Type::UByteTyID:   
@@ -132,7 +132,7 @@ const Type *Type::getUnsignedVersion() const {
 /// getSignedVersion - If this is an integer type, return the signed variant
 /// of this type.  For example uint -> int.
 const Type *Type::getSignedVersion() const {
-  switch (getPrimitiveID()) {
+  switch (getTypeID()) {
   default:
     assert(isInteger() && "Type::getSignedVersion is only valid for integers!");
   case Type::UByteTyID:   
@@ -152,7 +152,7 @@ const Type *Type::getSignedVersion() const {
 // return zero if the type does not have a size or is not a primitive type.
 //
 unsigned Type::getPrimitiveSize() const {
-  switch (getPrimitiveID()) {
+  switch (getTypeID()) {
 #define HANDLE_PRIM_TYPE(TY,SIZE)  case TY##TyID: return SIZE;
 #include "llvm/Type.def"
   default: return 0;
@@ -220,7 +220,7 @@ static std::string getTypeDescription(const Type *Ty,
   std::string Result;
   TypeStack.push_back(Ty);    // Add us to the stack..
       
-  switch (Ty->getPrimitiveID()) {
+  switch (Ty->getTypeID()) {
   case Type::FunctionTyID: {
     const FunctionType *FTy = cast<FunctionType>(Ty);
     Result = getTypeDescription(FTy->getReturnType(), TypeStack) + " (";
@@ -318,7 +318,7 @@ const Type *StructType::getTypeAtIndex(const Value *V) const {
 // type.
 //
 struct SignedIntType : public Type {
-  SignedIntType(const std::string &Name, PrimitiveID id) : Type(Name, id) {}
+  SignedIntType(const std::string &Name, TypeID id) : Type(Name, id) {}
 
   // isSigned - Return whether a numeric type is signed.
   virtual bool isSigned() const { return 1; }
@@ -330,7 +330,7 @@ struct SignedIntType : public Type {
 };
 
 struct UnsignedIntType : public Type {
-  UnsignedIntType(const std::string &N, PrimitiveID id) : Type(N, id) {}
+  UnsignedIntType(const std::string &N, TypeID id) : Type(N, id) {}
 
   // isUnsigned - Return whether a numeric type is signed.
   virtual bool isUnsigned() const { return 1; }
@@ -342,7 +342,7 @@ struct UnsignedIntType : public Type {
 };
 
 struct OtherType : public Type {
-  OtherType(const std::string &N, PrimitiveID id) : Type(N, id) {}
+  OtherType(const std::string &N, TypeID id) : Type(N, id) {}
 };
 
 static struct TypeType : public Type {
@@ -503,7 +503,7 @@ bool Type::isTypeAbstract() {
 static bool TypesEqual(const Type *Ty, const Type *Ty2,
                       std::map<const Type *, const Type *> &EqTypes) {
   if (Ty == Ty2) return true;
-  if (Ty->getPrimitiveID() != Ty2->getPrimitiveID()) return false;
+  if (Ty->getTypeID() != Ty2->getTypeID()) return false;
   if (isa<OpaqueType>(Ty))
     return false;  // Two unequal opaque types are never equal