e491a9531043f1c37a5f96d1aa6b70e230f2a1f2
[oota-llvm.git] / lib / Target / Mips / MipsRegisterInfo.h
1 //===- MipsRegisterInfo.h - Mips 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 Mips implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef MIPSREGISTERINFO_H
15 #define MIPSREGISTERINFO_H
16
17 #include "llvm/Target/TargetRegisterInfo.h"
18 #include "MipsGenRegisterInfo.h.inc"
19
20 namespace llvm {
21
22 class TargetInstrInfo;
23 class Type;
24
25 struct MipsRegisterInfo : public MipsGenRegisterInfo {
26   const TargetInstrInfo &TII;
27   
28   MipsRegisterInfo(const TargetInstrInfo &tii);
29
30   /// getRegisterNumbering - Given the enum value for some register, e.g.
31   /// Mips::RA, return the number that it corresponds to (e.g. 31).
32   static unsigned getRegisterNumbering(unsigned RegEnum);
33
34   /// Code Generation virtual methods...
35   void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
36                      unsigned DestReg, const MachineInstr *Orig) const;
37
38   const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
39
40   const TargetRegisterClass* const*
41   getCalleeSavedRegClasses(const MachineFunction* MF = 0) const;
42
43   BitVector getReservedRegs(const MachineFunction &MF) const;
44
45   bool hasFP(const MachineFunction &MF) const;
46
47   void eliminateCallFramePseudoInstr(MachineFunction &MF,
48                                      MachineBasicBlock &MBB,
49                                      MachineBasicBlock::iterator I) const;
50
51   /// Stack Frame Processing Methods
52   void eliminateFrameIndex(MachineBasicBlock::iterator II,
53                            int SPAdj, RegScavenger *RS = NULL) const;
54
55   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
56
57   void emitPrologue(MachineFunction &MF) const;
58   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
59   
60   /// Debug information queries.
61   unsigned getRARegister() const;
62   unsigned getFrameRegister(MachineFunction &MF) const;
63
64   /// Exception handling queries.
65   unsigned getEHExceptionRegister() const;
66   unsigned getEHHandlerRegister() const;
67
68   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
69 };
70
71 } // end namespace llvm
72
73 #endif