forked from OSchip/llvm-project
Added support for callee- and caller-save registers.
llvm-svn: 4897
This commit is contained in:
parent
9e4163539f
commit
d9522256d3
|
@ -56,3 +56,28 @@ unsigned X86RegisterInfo::getFramePointer() const {
|
|||
unsigned X86RegisterInfo::getStackPointer() const {
|
||||
return X86::ESP;
|
||||
}
|
||||
|
||||
const unsigned* X86RegisterInfo::getCalleeSaveRegs() const {
|
||||
static const unsigned CalleeSaveRegs[] = { X86::ESI, X86::EDI, X86::EBX, X86::EBP,
|
||||
MRegisterInfo::NoRegister };
|
||||
return CalleeSaveRegs;
|
||||
}
|
||||
|
||||
|
||||
const unsigned* X86RegisterInfo::getCallerSaveRegs() const {
|
||||
static const unsigned CallerSaveRegs[] = { X86::EAX, X86::ECX, X86::EDX,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ struct X86RegisterInfo : public MRegisterInfo {
|
|||
unsigned getFramePointer() const;
|
||||
unsigned getStackPointer() const;
|
||||
|
||||
const unsigned* getCalleeSaveRegs() const;
|
||||
const unsigned* getCallerSaveRegs() const;
|
||||
|
||||
/// Returns register class appropriate for input SSA register
|
||||
///
|
||||
const TargetRegisterClass *getClassForReg(unsigned Reg) const;
|
||||
|
@ -40,6 +43,8 @@ struct X86RegisterInfo : public MRegisterInfo {
|
|||
|
||||
unsigned getNumRegClasses() const;
|
||||
|
||||
void buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
|
||||
Reg2RegClassMap) const;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue