1 //===- PIC16RegisterInfo.cpp - PIC16 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 PIC16 implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "pic16-reg-info"
17 #include "PIC16RegisterInfo.h"
18 #include "llvm/ADT/BitVector.h"
23 PIC16RegisterInfo::PIC16RegisterInfo(const TargetInstrInfo
&tii
,
24 const PIC16Subtarget
&st
)
25 : PIC16GenRegisterInfo(PIC16::ADJCALLSTACKDOWN
, PIC16::ADJCALLSTACKUP
),
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());
50 bool PIC16RegisterInfo::hasFP(const MachineFunction
&MF
) const {
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!!");
72 unsigned PIC16RegisterInfo::getFrameRegister(MachineFunction
&MF
) const {
73 assert(0 && "PIC16 Does not have any frame register");
77 unsigned PIC16RegisterInfo::getRARegister() const {
78 assert(0 && "PIC16 Does not have any return address register");
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.