summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-17 18:19:28 +0000
committerChris Lattner <sabre@nondot.org>2004-06-17 18:19:28 +0000
commit6b7275996c78e50ca8b7d13625296b92d74b86c7 (patch)
tree75817e19a6f0bb380bf1a9ba39f0664076fb5705 /llvm/lib/Target
parent97bfcea262bbdeba8f8d468ff999008a4c448474 (diff)
downloadbcm5719-llvm-6b7275996c78e50ca8b7d13625296b92d74b86c7.tar.gz
bcm5719-llvm-6b7275996c78e50ca8b7d13625296b92d74b86c7.zip
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/CBackend/Writer.cpp6
-rw-r--r--llvm/lib/Target/SparcV8/InstSelectSimple.cpp2
-rw-r--r--llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp4
-rw-r--r--llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp2
-rw-r--r--llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp2
-rw-r--r--llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp3
-rw-r--r--llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp8
-rw-r--r--llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h6
-rw-r--r--llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp2
-rw-r--r--llvm/lib/Target/TargetData.cpp2
-rw-r--r--llvm/lib/Target/X86/InstSelectSimple.cpp8
-rw-r--r--llvm/lib/Target/X86/Printer.cpp4
-rw-r--r--llvm/lib/Target/X86/X86RegisterInfo.cpp2
-rw-r--r--llvm/lib/Target/X86/X86SimpInstrSelector.cpp8
14 files changed, 29 insertions, 30 deletions
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp
index d993919f8b1..05be7706b33 100644
--- a/llvm/lib/Target/CBackend/Writer.cpp
+++ b/llvm/lib/Target/CBackend/Writer.cpp
@@ -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:
diff --git a/llvm/lib/Target/SparcV8/InstSelectSimple.cpp b/llvm/lib/Target/SparcV8/InstSelectSimple.cpp
index fac772b65cf..8d308edbd8c 100644
--- a/llvm/lib/Target/SparcV8/InstSelectSimple.cpp
+++ b/llvm/lib/Target/SparcV8/InstSelectSimple.cpp
@@ -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:
diff --git a/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp b/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
index 226f972b59d..342b72065b9 100644
--- a/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
+++ b/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
@@ -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;
diff --git a/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp b/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp
index c5034d57ad6..83896f89a20 100644
--- a/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp
+++ b/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp
@@ -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:
diff --git a/llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
index d7409d896b3..ee172fdd0c8 100644
--- a/llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
+++ b/llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
@@ -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;
diff --git a/llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index 6898704191a..aa183452553 100644
--- a/llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -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:
diff --git a/llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index dbe40acad33..f53f856feaf 100644
--- a/llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -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;
diff --git a/llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h b/llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
index a59045fe05d..bf5617a21a2 100644
--- a/llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
+++ b/llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
@@ -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;
diff --git a/llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp b/llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp
index 2483ca8c366..a7e1dbdcb91 100644
--- a/llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -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...
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 4b69f103a83..caa66fe0915 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -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:
diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp
index 9cf4b60bd52..0c8b0a45667 100644
--- a/llvm/lib/Target/X86/InstSelectSimple.cpp
+++ b/llvm/lib/Target/X86/InstSelectSimple.cpp
@@ -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!");
diff --git a/llvm/lib/Target/X86/Printer.cpp b/llvm/lib/Target/X86/Printer.cpp
index cbc4aeacf56..2a9ba83b4ed 100644
--- a/llvm/lib/Target/X86/Printer.cpp
+++ b/llvm/lib/Target/X86/Printer.cpp
@@ -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;
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 02d9fc5d17f..03fe5505aed 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -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!");
diff --git a/llvm/lib/Target/X86/X86SimpInstrSelector.cpp b/llvm/lib/Target/X86/X86SimpInstrSelector.cpp
index 3c02acb4044..7a6115e3ec7 100644
--- a/llvm/lib/Target/X86/X86SimpInstrSelector.cpp
+++ b/llvm/lib/Target/X86/X86SimpInstrSelector.cpp
@@ -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!");
OpenPOWER on IntegriCloud