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
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index d993919..05be770 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -255,7 +255,7 @@
                                  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 @@
     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 @@
     }
   }
 
-  switch (CPV->getType()->getPrimitiveID()) {
+  switch (CPV->getType()->getTypeID()) {
   case Type::BoolTyID:
     Out << (CPV == ConstantBool::False ? "0" : "1"); break;
   case Type::SByteTyID:
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index d993919..05be770 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -255,7 +255,7 @@
                                  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 @@
     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 @@
     }
   }
 
-  switch (CPV->getType()->getPrimitiveID()) {
+  switch (CPV->getType()->getTypeID()) {
   case Type::BoolTyID:
     Out << (CPV == ConstantBool::False ? "0" : "1"); break;
   case Type::SByteTyID:
diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp
index fac772b..8d308ed 100644
--- a/lib/Target/Sparc/InstSelectSimple.cpp
+++ b/lib/Target/Sparc/InstSelectSimple.cpp
@@ -168,7 +168,7 @@
 };
 
 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:
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp
index 226f972..342b720 100644
--- a/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/SparcAsmPrinter.cpp
@@ -249,7 +249,7 @@
     // 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 @@
 
   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;
diff --git a/lib/Target/Sparc/SparcRegisterInfo.cpp b/lib/Target/Sparc/SparcRegisterInfo.cpp
index c5034d5..83896f8 100644
--- a/lib/Target/Sparc/SparcRegisterInfo.cpp
+++ b/lib/Target/Sparc/SparcRegisterInfo.cpp
@@ -127,7 +127,7 @@
 
 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:
diff --git a/lib/Target/Sparc/SparcV8ISelSimple.cpp b/lib/Target/Sparc/SparcV8ISelSimple.cpp
index fac772b..8d308ed 100644
--- a/lib/Target/Sparc/SparcV8ISelSimple.cpp
+++ b/lib/Target/Sparc/SparcV8ISelSimple.cpp
@@ -168,7 +168,7 @@
 };
 
 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:
diff --git a/lib/Target/SparcV8/InstSelectSimple.cpp b/lib/Target/SparcV8/InstSelectSimple.cpp
index fac772b..8d308ed 100644
--- a/lib/Target/SparcV8/InstSelectSimple.cpp
+++ b/lib/Target/SparcV8/InstSelectSimple.cpp
@@ -168,7 +168,7 @@
 };
 
 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:
diff --git a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
index 226f972..342b720 100644
--- a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
+++ b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
@@ -249,7 +249,7 @@
     // 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 @@
 
   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;
diff --git a/lib/Target/SparcV8/SparcV8ISelSimple.cpp b/lib/Target/SparcV8/SparcV8ISelSimple.cpp
index fac772b..8d308ed 100644
--- a/lib/Target/SparcV8/SparcV8ISelSimple.cpp
+++ b/lib/Target/SparcV8/SparcV8ISelSimple.cpp
@@ -168,7 +168,7 @@
 };
 
 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:
diff --git a/lib/Target/SparcV8/SparcV8RegisterInfo.cpp b/lib/Target/SparcV8/SparcV8RegisterInfo.cpp
index c5034d5..83896f8 100644
--- a/lib/Target/SparcV8/SparcV8RegisterInfo.cpp
+++ b/lib/Target/SparcV8/SparcV8RegisterInfo.cpp
@@ -127,7 +127,7 @@
 
 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:
diff --git a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
index d7409d8..ee172fd 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
@@ -79,7 +79,7 @@
       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;
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index 6898704..aa18345 100644
--- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -85,8 +85,7 @@
 
   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:
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index dbe40ac..f53f856 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -650,7 +650,7 @@
   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 @@
   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 @@
   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 @@
   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;
diff --git a/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h b/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
index a59045f..bf5617a 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
+++ b/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
@@ -23,7 +23,7 @@
 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 @@
 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 @@
     opCode = V9::ADDr;
   }
   else
-    switch(resultType->getPrimitiveID())
+    switch(resultType->getTypeID())
     {
     case Type::FloatTyID:  opCode = V9::FADDS; break;
     case Type::DoubleTyID: opCode = V9::FADDD; break;
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp
index 2483ca8..a7e1dbd 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -272,7 +272,7 @@
 //
 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...
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 4b69f10..caa66fe 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -150,7 +150,7 @@
 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:
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index 9cf4b60..0c8b0a4 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/lib/Target/X86/InstSelectSimple.cpp
@@ -47,7 +47,7 @@
 /// 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 @@
     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 @@
   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 @@
   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!");
diff --git a/lib/Target/X86/Printer.cpp b/lib/Target/X86/Printer.cpp
index cbc4aea..2a9ba83 100644
--- a/lib/Target/X86/Printer.cpp
+++ b/lib/Target/X86/Printer.cpp
@@ -285,7 +285,7 @@
     // 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 @@
 
   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;
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index cbc4aea..2a9ba83 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -285,7 +285,7 @@
     // 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 @@
 
   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;
diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp
index 9cf4b60..0c8b0a4 100644
--- a/lib/Target/X86/X86ISelSimple.cpp
+++ b/lib/Target/X86/X86ISelSimple.cpp
@@ -47,7 +47,7 @@
 /// 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 @@
     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 @@
   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 @@
   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!");
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 02d9fc5..03fe550 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -503,7 +503,7 @@
 
 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!");
diff --git a/lib/Target/X86/X86SimpInstrSelector.cpp b/lib/Target/X86/X86SimpInstrSelector.cpp
index 3c02acb..7a6115e 100644
--- a/lib/Target/X86/X86SimpInstrSelector.cpp
+++ b/lib/Target/X86/X86SimpInstrSelector.cpp
@@ -347,7 +347,7 @@
 /// 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 @@
     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 @@
   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 @@
   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!");