1 //===- MSP430RegisterInfo.h - MSP430 Register Information Impl --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the MSP430 implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TARGET_MSP430REGISTERINFO_H
15 #define LLVM_TARGET_MSP430REGISTERINFO_H
17 #include "llvm/Target/TargetRegisterInfo.h"
18 #include "MSP430GenRegisterInfo.h.inc"
22 class TargetInstrInfo
;
23 class MSP430TargetMachine
;
25 struct MSP430RegisterInfo
: public MSP430GenRegisterInfo
{
27 MSP430TargetMachine
&TM
;
28 const TargetInstrInfo
&TII
;
30 /// StackAlign - Default stack alignment.
34 MSP430RegisterInfo(MSP430TargetMachine
&tm
, const TargetInstrInfo
&tii
);
36 /// Code Generation virtual methods...
37 const unsigned *getCalleeSavedRegs(const MachineFunction
*MF
= 0) const;
39 const TargetRegisterClass
* const*
40 getCalleeSavedRegClasses(const MachineFunction
*MF
= 0) const;
42 BitVector
getReservedRegs(const MachineFunction
&MF
) const;
43 const TargetRegisterClass
* getPointerRegClass() const;
45 bool hasFP(const MachineFunction
&MF
) const;
46 bool hasReservedCallFrame(MachineFunction
&MF
) const;
48 void eliminateCallFramePseudoInstr(MachineFunction
&MF
,
49 MachineBasicBlock
&MBB
,
50 MachineBasicBlock::iterator I
) const;
52 void eliminateFrameIndex(MachineBasicBlock::iterator II
,
53 int SPAdj
, RegScavenger
*RS
= NULL
) const;
55 void emitPrologue(MachineFunction
&MF
) const;
56 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const;
58 void processFunctionBeforeFrameFinalized(MachineFunction
&MF
) const;
60 // Debug information queries.
61 unsigned getRARegister() const;
62 unsigned getFrameRegister(MachineFunction
&MF
) const;
64 //! Get DWARF debugging register number
65 int getDwarfRegNum(unsigned RegNum
, bool isEH
) const;
68 } // end namespace llvm
70 #endif // LLVM_TARGET_MSP430REGISTERINFO_H