2235de1a6e58fecaeae22f430d9cdfdfc7252570
[oota-llvm.git] / lib / Target / Sparc / SparcRegisterInfo.h
1 //===- SparcRegisterInfo.h - Sparc 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 Sparc implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SPARCREGISTERINFO_H
15 #define SPARCREGISTERINFO_H
16
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "SparcGenRegisterInfo.h.inc"
19
20 namespace llvm {
21
22 class SparcSubtarget;
23 class TargetInstrInfo;
24 class Type;
25
26 struct SparcRegisterInfo : public SparcGenRegisterInfo {
27   SparcSubtarget &Subtarget;
28   const TargetInstrInfo &TII;
29   
30   SparcRegisterInfo(SparcSubtarget &st, const TargetInstrInfo &tii);
31
32   /// Code Generation virtual methods...  
33   void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
34                      unsigned DestReg, const MachineInstr *Orig) const;
35
36   const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
37
38   const TargetRegisterClass* const* getCalleeSavedRegClasses(
39                                      const MachineFunction *MF = 0) const;
40
41   BitVector getReservedRegs(const MachineFunction &MF) const;
42
43   bool hasFP(const MachineFunction &MF) const;
44
45   void eliminateCallFramePseudoInstr(MachineFunction &MF,
46                                      MachineBasicBlock &MBB,
47                                      MachineBasicBlock::iterator I) const;
48
49   void eliminateFrameIndex(MachineBasicBlock::iterator II,
50                            int SPAdj, RegScavenger *RS = NULL) const;
51
52   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
53
54   void emitPrologue(MachineFunction &MF) const;
55   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
56   
57   // Debug information queries.
58   unsigned getRARegister() const;
59   unsigned getFrameRegister(MachineFunction &MF) const;
60
61   // Exception handling queries.
62   unsigned getEHExceptionRegister() const;
63   unsigned getEHHandlerRegister() const;
64
65   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
66 };
67
68 } // end namespace llvm
69
70 #endif