llvm.org GIT mirror llvm / 03c6faf
Added support for callee- and caller-save registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4897 91177308-0d34-0410-b5e6-96231b3b80d8 Misha Brukman 17 years ago
2 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
5555 unsigned X86RegisterInfo::getStackPointer() const {
5656 return X86::ESP;
5757 }
58
59 const unsigned* X86RegisterInfo::getCalleeSaveRegs() const {
60 static const unsigned CalleeSaveRegs[] = { X86::ESI, X86::EDI, X86::EBX, X86::EBP,
61 MRegisterInfo::NoRegister };
62 return CalleeSaveRegs;
63 }
64
65
66 const unsigned* X86RegisterInfo::getCallerSaveRegs() const {
67 static const unsigned CallerSaveRegs[] = { X86::EAX, X86::ECX, X86::EDX,
68 MRegisterInfo::NoRegister };
69 return CallerSaveRegs;
70 }
71
72 void
73 X86RegisterInfo::buildReg2RegClassMap
74 (std::map
75 const TargetRegisterClass*>& Reg2RegClassMap) const
76 {
77 for (MRegisterInfo::const_iterator I = const_regclass_begin(),
78 E = const_regclass_end(); I != E; ++I)
79 {
80 I->buildReg2RegClassMap(Reg2RegClassMap);
81 }
82 }
3131 unsigned getFramePointer() const;
3232 unsigned getStackPointer() const;
3333
34 const unsigned* getCalleeSaveRegs() const;
35 const unsigned* getCallerSaveRegs() const;
36
3437 /// Returns register class appropriate for input SSA register
3538 ///
3639 const TargetRegisterClass *getClassForReg(unsigned Reg) const;
3942
4043 unsigned getNumRegClasses() const;
4144
45 void buildReg2RegClassMap(std::map&
46 Reg2RegClassMap) const;
4247
4348 };
4449