]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / 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 "Mips.h"
18 #include "llvm/Target/TargetRegisterInfo.h"
19
20 #define GET_REGINFO_HEADER
21 #include "MipsGenRegisterInfo.inc"
22
23 namespace llvm {
24 class MipsSubtarget;
25 class Type;
26
27 class MipsRegisterInfo : public MipsGenRegisterInfo {
28 protected:
29   const MipsSubtarget &Subtarget;
30
31 public:
32   MipsRegisterInfo(const MipsSubtarget &Subtarget);
33
34   /// getRegisterNumbering - Given the enum value for some register, e.g.
35   /// Mips::RA, return the number that it corresponds to (e.g. 31).
36   static unsigned getRegisterNumbering(unsigned RegEnum);
37
38   /// Get PIC indirect call register
39   static unsigned getPICCallReg();
40
41   /// Adjust the Mips stack frame.
42   void adjustMipsStackFrame(MachineFunction &MF) const;
43
44   /// Code Generation virtual methods...
45   unsigned getRegPressureLimit(const TargetRegisterClass *RC,
46                                MachineFunction &MF) const;
47   const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
48   const uint32_t *getCallPreservedMask(CallingConv::ID) const;
49
50   BitVector getReservedRegs(const MachineFunction &MF) const;
51
52   virtual bool requiresRegisterScavenging(const MachineFunction &MF) const;
53
54   virtual bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const;
55
56   /// Stack Frame Processing Methods
57   void eliminateFrameIndex(MachineBasicBlock::iterator II,
58                            int SPAdj, unsigned FIOperandNum,
59                            RegScavenger *RS = NULL) const;
60
61   void processFunctionBeforeFrameFinalized(MachineFunction &MF,
62                                        RegScavenger *RS = NULL) const;
63
64   /// Debug information queries.
65   unsigned getFrameRegister(const MachineFunction &MF) const;
66
67   /// Exception handling queries.
68   unsigned getEHExceptionRegister() const;
69   unsigned getEHHandlerRegister() const;
70
71   /// \brief Return GPR register class.
72   virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
73
74 private:
75   virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
76                            int FrameIndex, uint64_t StackSize,
77                            int64_t SPOffset) const = 0;
78 };
79
80 } // end namespace llvm
81
82 #endif