Merge branch 'master' into msp430
[llvm/msp430.git] / lib / Target / PIC16 / PIC16RegisterInfo.cpp
blobeb758d8543d078ccbbc48360c810824ffe571f3e
1 //===- PIC16RegisterInfo.cpp - PIC16 Register Information -----------------===//
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 PIC16 implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "pic16-reg-info"
16 #include "PIC16.h"
17 #include "PIC16RegisterInfo.h"
18 #include "llvm/ADT/BitVector.h"
21 using namespace llvm;
23 PIC16RegisterInfo::PIC16RegisterInfo(const TargetInstrInfo &tii,
24 const PIC16Subtarget &st)
25 : PIC16GenRegisterInfo(PIC16::ADJCALLSTACKDOWN, PIC16::ADJCALLSTACKUP),
26 TII(tii),
27 ST(st) {}
29 #include "PIC16GenRegisterInfo.inc"
31 /// PIC16 Callee Saved Registers
32 const unsigned* PIC16RegisterInfo::
33 getCalleeSavedRegs(const MachineFunction *MF) const {
34 static const unsigned CalleeSavedRegs[] = { 0 };
35 return CalleeSavedRegs;
38 // PIC16 Callee Saved Reg Classes
39 const TargetRegisterClass* const*
40 PIC16RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
41 static const TargetRegisterClass * const CalleeSavedRegClasses[] = { 0 };
42 return CalleeSavedRegClasses;
45 BitVector PIC16RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
46 BitVector Reserved(getNumRegs());
47 return Reserved;
50 bool PIC16RegisterInfo::hasFP(const MachineFunction &MF) const {
51 return false;
54 void PIC16RegisterInfo::
55 eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
56 RegScavenger *RS) const
57 { /* NOT YET IMPLEMENTED */ }
59 void PIC16RegisterInfo::emitPrologue(MachineFunction &MF) const
60 { /* NOT YET IMPLEMENTED */ }
62 void PIC16RegisterInfo::
63 emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const
64 { /* NOT YET IMPLEMENTED */ }
66 int PIC16RegisterInfo::
67 getDwarfRegNum(unsigned RegNum, bool isEH) const {
68 assert(0 && "Not keeping track of debug information yet!!");
69 return -1;
72 unsigned PIC16RegisterInfo::getFrameRegister(MachineFunction &MF) const {
73 assert(0 && "PIC16 Does not have any frame register");
74 return 0;
77 unsigned PIC16RegisterInfo::getRARegister() const {
78 assert(0 && "PIC16 Does not have any return address register");
79 return 0;
82 // This function eliminates ADJCALLSTACKDOWN,
83 // ADJCALLSTACKUP pseudo instructions
84 void PIC16RegisterInfo::
85 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
86 MachineBasicBlock::iterator I) const {
87 // Simply discard ADJCALLSTACKDOWN,
88 // ADJCALLSTACKUP instructions.
89 MBB.erase(I);