1 //===- MSP430RegisterInfo.cpp - MSP430 Register Information ---------------===//
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 TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "msp430-reg-info"
17 #include "MSP430RegisterInfo.h"
18 #include "llvm/CodeGen/MachineFrameInfo.h"
19 #include "llvm/CodeGen/MachineFunction.h"
20 #include "llvm/Target/TargetMachine.h"
21 #include "llvm/Target/TargetOptions.h"
22 #include "llvm/ADT/BitVector.h"
26 // FIXME: Provide proper call frame setup / destroy opcodes.
27 MSP430RegisterInfo::MSP430RegisterInfo(const TargetInstrInfo &tii)
28 : MSP430GenRegisterInfo(MSP430::NOP, MSP430::NOP),
32 MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
33 assert(0 && "Not implemented yet!");
36 const TargetRegisterClass* const*
37 MSP430RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
38 assert(0 && "Not implemented yet!");
42 MSP430RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
43 BitVector Reserved(getNumRegs());
45 // Mark 4 special registers as reserved.
46 Reserved.set(MSP430::PC);
47 Reserved.set(MSP430::SP);
48 Reserved.set(MSP430::SR);
49 Reserved.set(MSP430::CG);
51 // Mark frame pointer as reserved if needed.
53 Reserved.set(MSP430::FP);
58 bool MSP430RegisterInfo::hasFP(const MachineFunction &MF) const {
59 return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects();
63 MSP430RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
64 int SPAdj, RegScavenger *RS) const {
65 assert(0 && "Not implemented yet!");
68 void MSP430RegisterInfo::emitPrologue(MachineFunction &MF) const {
69 assert(0 && "Not implemented yet!");
72 void MSP430RegisterInfo::emitEpilogue(MachineFunction &MF,
73 MachineBasicBlock &MBB) const {
74 assert(0 && "Not implemented yet!");
77 unsigned MSP430RegisterInfo::getRARegister() const {
78 assert(0 && "Not implemented yet!");
81 unsigned MSP430RegisterInfo::getFrameRegister(MachineFunction &MF) const {
82 assert(0 && "Not implemented yet!");
85 int MSP430RegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
86 assert(0 && "Not implemented yet!");
89 #include "MSP430GenRegisterInfo.inc"