Moved buildReg2RegClassMap() into from X86RegisterInfo to MRegisterInfo, since

it is target-independent.

llvm-svn: 4911
This commit is contained in:
Misha Brukman 2002-12-04 16:47:04 +00:00
parent 7b1ec5ed3a
commit 0d28502c32
3 changed files with 8 additions and 17 deletions

View File

@ -61,7 +61,7 @@ public:
virtual unsigned getDataSize() const { return 0; }
virtual void
void
buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
Reg2RegClassMap) const
{
@ -146,7 +146,13 @@ public:
virtual void
buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
Reg2RegClassMap) const=0;
Reg2RegClassMap) const {
for (MRegisterInfo::const_iterator I = const_regclass_begin(),
E = const_regclass_end(); I != E; ++I) {
I->buildReg2RegClassMap(Reg2RegClassMap);
}
}
};
#endif

View File

@ -69,15 +69,3 @@ const unsigned* X86RegisterInfo::getCallerSaveRegs() const {
MRegisterInfo::NoRegister };
return CallerSaveRegs;
}
void
X86RegisterInfo::buildReg2RegClassMap
(std::map<unsigned,
const TargetRegisterClass*>& Reg2RegClassMap) const
{
for (MRegisterInfo::const_iterator I = const_regclass_begin(),
E = const_regclass_end(); I != E; ++I)
{
I->buildReg2RegClassMap(Reg2RegClassMap);
}
}

View File

@ -43,9 +43,6 @@ struct X86RegisterInfo : public MRegisterInfo {
unsigned getNumRegClasses() const;
void buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
Reg2RegClassMap) const;
};
#endif