Added support for callee- and caller-save registers.
[oota-llvm.git] / lib / Target / X86 / X86RegisterInfo.h
1 //===- X86RegisterInfo.h - X86 Register Information Impl ----------*-C++-*-===//
2 //
3 // This file contains the X86 implementation of the MRegisterInfo class.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #ifndef X86REGISTERINFO_H
8 #define X86REGISTERINFO_H
9
10 #include "llvm/Target/MRegisterInfo.h"
11
12 class Type;
13
14 struct X86RegisterInfo : public MRegisterInfo {
15   X86RegisterInfo();
16
17   MRegisterInfo::const_iterator const_regclass_begin() const;
18   MRegisterInfo::const_iterator const_regclass_end() const;
19
20   MachineBasicBlock::iterator
21   storeReg2RegOffset(MachineBasicBlock *MBB,
22                      MachineBasicBlock::iterator &MBBI,
23                      unsigned DestReg, unsigned SrcReg, 
24                      unsigned ImmOffset, unsigned dataSize) const;
25
26   MachineBasicBlock::iterator
27   loadRegOffset2Reg(MachineBasicBlock *MBB,
28                     MachineBasicBlock::iterator &MBBI,
29                     unsigned DestReg, unsigned SrcReg,
30                     unsigned ImmOffset, unsigned dataSize) const;
31
32   unsigned getFramePointer() const;
33   unsigned getStackPointer() const;
34
35   const unsigned* getCalleeSaveRegs() const;
36   const unsigned* getCallerSaveRegs() const;
37
38   /// Returns register class appropriate for input SSA register
39   /// 
40   const TargetRegisterClass *getClassForReg(unsigned Reg) const;
41
42   const TargetRegisterClass* getRegClassForType(const Type* Ty) const;
43
44   unsigned getNumRegClasses() const;
45
46   void buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
47                             Reg2RegClassMap) const;
48
49 };
50
51 #endif