e97608323a7b5ca701a99a2011a1b5a72a9c06ba
[oota-llvm.git] / lib / Target / MSP430 / MSP430RegisterInfo.h
1 //===- MSP430RegisterInfo.h - MSP430 Register Information Impl --*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the MSP430 implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_TARGET_MSP430REGISTERINFO_H
15 #define LLVM_TARGET_MSP430REGISTERINFO_H
16
17 #include "llvm/Target/TargetRegisterInfo.h"
18 #include "MSP430GenRegisterInfo.h.inc"
19
20 namespace llvm {
21
22 class TargetInstrInfo;
23 class MSP430TargetMachine;
24
25 struct MSP430RegisterInfo : public MSP430GenRegisterInfo {
26 private:
27   MSP430TargetMachine &TM;
28   const TargetInstrInfo &TII;
29
30   /// StackAlign - Default stack alignment.
31   ///
32   unsigned StackAlign;
33 public:
34   MSP430RegisterInfo(MSP430TargetMachine &tm, const TargetInstrInfo &tii);
35
36   /// Code Generation virtual methods...
37   const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
38
39   BitVector getReservedRegs(const MachineFunction &MF) const;
40   const TargetRegisterClass* getPointerRegClass(unsigned Kind = 0) const;
41
42   const TargetRegisterClass *
43   getMatchingSuperRegClass(const TargetRegisterClass *A,
44                            const TargetRegisterClass *B, unsigned Idx) const {
45     // No sub-classes makes this really easy.
46     return A;
47   }
48
49   void eliminateCallFramePseudoInstr(MachineFunction &MF,
50                                      MachineBasicBlock &MBB,
51                                      MachineBasicBlock::iterator I) const;
52
53   void eliminateFrameIndex(MachineBasicBlock::iterator II,
54                            int SPAdj, RegScavenger *RS = NULL) const;
55
56   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
57
58   // Debug information queries.
59   unsigned getRARegister() const;
60   unsigned getFrameRegister(const MachineFunction &MF) const;
61
62   //! Get DWARF debugging register number
63   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
64 };
65
66 } // end namespace llvm
67
68 #endif // LLVM_TARGET_MSP430REGISTERINFO_H