zpu: managed to compile program that writes constant to global variable
[llvm/zpu.git] / lib / Target / ZPU / ZPURegisterInfo.h
blob072790c129354cd7c4b4f95b5f046c84f1a01366
1 //===- ZPURegisterInfo.h - ZPU 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 ZPU implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef ZPUREGISTERINFO_H
15 #define ZPUREGISTERINFO_H
17 #include "ZPU.h"
18 #include "llvm/Target/TargetRegisterInfo.h"
19 #include "ZPUGenRegisterInfo.h.inc"
21 namespace llvm {
22 class TargetInstrInfo;
23 class Type;
25 class ZPURegisterInfo : public ZPUGenRegisterInfo {
26 public:
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
74 #endif