diff --git a/lib/Target/X86/X86RegisterClasses.cpp b/lib/Target/X86/X86RegisterClasses.cpp index e8739a4339c..c9d0aa46f2c 100644 --- a/lib/Target/X86/X86RegisterClasses.cpp +++ b/lib/Target/X86/X86RegisterClasses.cpp @@ -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(); -} - diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 909a79cee70..9fcec8ce2e3 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -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; diff --git a/lib/Target/X86/X86RegisterInfo.h b/lib/Target/X86/X86RegisterInfo.h index be45f307e0c..52e530e302b 100644 --- a/lib/Target/X86/X86RegisterInfo.h +++ b/lib/Target/X86/X86RegisterInfo.h @@ -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