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 19 #define GET_REGINFO_HEADER 20 #include "MSP430GenRegisterInfo.inc" 21 22 namespace llvm { 23 24 class TargetInstrInfo; 25 class MSP430TargetMachine; 26 27 struct MSP430RegisterInfo : public MSP430GenRegisterInfo { 28 private: 29 MSP430TargetMachine &TM; 30 const TargetInstrInfo &TII; 31 32 /// StackAlign - Default stack alignment. 33 /// 34 unsigned StackAlign; 35 public: 36 MSP430RegisterInfo(MSP430TargetMachine &tm, const TargetInstrInfo &tii); 37 38 /// Code Generation virtual methods... 39 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const; 40 41 BitVector getReservedRegs(const MachineFunction &MF) const; 42 const TargetRegisterClass* getPointerRegClass(unsigned Kind = 0) const; 43 44 const TargetRegisterClass * getMatchingSuperRegClassMSP430RegisterInfo45 getMatchingSuperRegClass(const TargetRegisterClass *A, 46 const TargetRegisterClass *B, unsigned Idx) const { 47 // No sub-classes makes this really easy. 48 return A; 49 } 50 51 void eliminateCallFramePseudoInstr(MachineFunction &MF, 52 MachineBasicBlock &MBB, 53 MachineBasicBlock::iterator I) const; 54 55 void eliminateFrameIndex(MachineBasicBlock::iterator II, 56 int SPAdj, RegScavenger *RS = NULL) const; 57 58 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; 59 60 // Debug information queries. 61 unsigned getFrameRegister(const MachineFunction &MF) const; 62 }; 63 64 } // end namespace llvm 65 66 #endif // LLVM_TARGET_MSP430REGISTERINFO_H 67