1 //===- ZPURegisterInfo.h - ZPU 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 ZPU implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef ZPUREGISTERINFO_H
15 #define ZPUREGISTERINFO_H
18 #include "llvm/Target/TargetRegisterInfo.h"
19 #include "ZPUGenRegisterInfo.h.inc"
22 class TargetInstrInfo
;
25 class ZPURegisterInfo
: public ZPUGenRegisterInfo
{
27 ZPURegisterInfo(const TargetInstrInfo
&tii
);
29 virtual ~ZPURegisterInfo();
31 /// getRegisterNumbering - Given the enum value for some register, e.g.
32 /// ZPU::RA, return the number that it corresponds to (e.g. 31).
33 static unsigned getRegisterNumbering(unsigned RegEnum
);
35 /// Get PIC indirect call register
36 static unsigned getPICCallReg();
38 // /// Adjust the ZPU stack frame.
39 // void adjustZPUStackFrame(MachineFunction &MF) const;
41 /// Code Generation virtual methods...
42 const unsigned *getCalleeSavedRegs(const MachineFunction
* MF
= 0) const;
44 BitVector
getReservedRegs(const MachineFunction
&MF
) const;
46 bool hasFP(const MachineFunction
&MF
) const;
48 // void eliminateCallFramePseudoInstr(MachineFunction &MF,
49 // MachineBasicBlock &MBB,
50 // MachineBasicBlock::iterator I) const;
52 /// Stack Frame Processing Methods
53 void eliminateFrameIndex(MachineBasicBlock::iterator II
,
54 int SPAdj
, RegScavenger
*RS
= NULL
) const;
56 // void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
58 void emitPrologue(MachineFunction
&MF
) const;
59 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const;
61 /// Debug information queries.
62 virtual unsigned getRARegister() const;
63 unsigned getFrameRegister(const MachineFunction
&MF
) const;
65 /// Exception handling queries.
66 unsigned getEHExceptionRegister() const;
67 unsigned getEHHandlerRegister() const;
69 int getDwarfRegNum(unsigned RegNum
, bool isEH
) const;
72 } // end namespace llvm