Update to use new interface for register info

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-12-17 04:19:17 +00:00
parent 9208bbf5c9
commit 79de6319b1
3 changed files with 24 additions and 39 deletions

View File

@ -48,6 +48,30 @@ namespace {
};
}
// Create static lists to contain register alias sets...
#define ALIASLIST(NAME, ...) \
static const unsigned NAME[] = { __VA_ARGS__ };
#include "X86RegisterInfo.def"
// X86Regs - Turn the X86RegisterInfo.def file into a bunch of register
// descriptors
//
static const MRegisterDesc X86Regs[] = {
#define R(ENUM, NAME, FLAGS, TSFLAGS, ALIAS_SET) \
{ NAME, ALIAS_SET, FLAGS, TSFLAGS },
#include "X86RegisterInfo.def"
};
X86RegisterInfo::X86RegisterInfo()
: MRegisterInfo(X86Regs, sizeof(X86Regs)/sizeof(X86Regs[0]),
X86RegClasses,
X86RegClasses+sizeof(X86RegClasses)/sizeof(X86RegClasses[0])){
}
const TargetRegisterClass* X86RegisterInfo::getRegClassForType(const Type* Ty)
const {
switch (Ty->getPrimitiveID()) {
@ -71,17 +95,3 @@ const TargetRegisterClass* X86RegisterInfo::getRegClassForType(const Type* Ty)
return 0; // not reached
}
}
MRegisterInfo::const_iterator X86RegisterInfo::regclass_begin() const {
return X86RegClasses;
}
unsigned X86RegisterInfo::getNumRegClasses() const {
return sizeof(X86RegClasses)/sizeof(X86RegClasses[0]);
}
MRegisterInfo::const_iterator X86RegisterInfo::regclass_end() const {
return X86RegClasses+getNumRegClasses();
}

View File

@ -12,25 +12,6 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
// Create static lists to contain register alias sets...
#define ALIASLIST(NAME, ...) \
static const unsigned NAME[] = { __VA_ARGS__ };
#include "X86RegisterInfo.def"
// X86Regs - Turn the X86RegisterInfo.def file into a bunch of register
// descriptors
//
static const MRegisterDesc X86Regs[] = {
#define R(ENUM, NAME, FLAGS, TSFLAGS, ALIAS_SET) \
{ NAME, ALIAS_SET, FLAGS, TSFLAGS },
#include "X86RegisterInfo.def"
};
X86RegisterInfo::X86RegisterInfo()
: MRegisterInfo(X86Regs, sizeof(X86Regs)/sizeof(X86Regs[0])) {
}
unsigned getIdx(unsigned dataSize) {
switch (dataSize) {
case 1: return 0;

View File

@ -14,9 +14,6 @@ class Type;
struct X86RegisterInfo : public MRegisterInfo {
X86RegisterInfo();
MRegisterInfo::const_iterator regclass_begin() const;
MRegisterInfo::const_iterator regclass_end() const;
MachineBasicBlock::iterator
storeReg2RegOffset(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
@ -53,9 +50,6 @@ struct X86RegisterInfo : public MRegisterInfo {
const TargetRegisterClass *getClassForReg(unsigned Reg) const;
const TargetRegisterClass* getRegClassForType(const Type* Ty) const;
unsigned getNumRegClasses() const;
};
#endif