Merge branch 'master' into msp430
[llvm/msp430.git] / lib / Target / Mips / MipsRegisterInfo.h
blob808e995b4ed3d61198d522eeaac45d6ba676abe5
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.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSREGISTERINFO_H
15 #define MIPSREGISTERINFO_H
17 #include "Mips.h"
18 #include "llvm/Target/TargetRegisterInfo.h"
19 #include "MipsGenRegisterInfo.h.inc"
21 namespace llvm {
22 class MipsSubtarget;
23 class TargetInstrInfo;
24 class Type;
26 struct MipsRegisterInfo : public MipsGenRegisterInfo {
27 const MipsSubtarget &Subtarget;
28 const TargetInstrInfo &TII;
30 MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii);
32 /// getRegisterNumbering - Given the enum value for some register, e.g.
33 /// Mips::RA, return the number that it corresponds to (e.g. 31).
34 static unsigned getRegisterNumbering(unsigned RegEnum);
36 /// Get PIC indirect call register
37 static unsigned getPICCallReg(void);
39 /// Adjust the Mips stack frame.
40 void adjustMipsStackFrame(MachineFunction &MF) const;
42 /// Code Generation virtual methods...
43 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
45 const TargetRegisterClass* const*
46 getCalleeSavedRegClasses(const MachineFunction* MF = 0) const;
48 BitVector getReservedRegs(const MachineFunction &MF) const;
50 bool hasFP(const MachineFunction &MF) const;
52 void eliminateCallFramePseudoInstr(MachineFunction &MF,
53 MachineBasicBlock &MBB,
54 MachineBasicBlock::iterator I) const;
56 /// Stack Frame Processing Methods
57 void eliminateFrameIndex(MachineBasicBlock::iterator II,
58 int SPAdj, RegScavenger *RS = NULL) const;
60 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
62 void emitPrologue(MachineFunction &MF) const;
63 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
65 /// Debug information queries.
66 unsigned getRARegister() const;
67 unsigned getFrameRegister(MachineFunction &MF) const;
69 /// Exception handling queries.
70 unsigned getEHExceptionRegister() const;
71 unsigned getEHHandlerRegister() const;
73 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
76 } // end namespace llvm
78 #endif