1 //===- MipsRegisterInfo.h - Mips Register Information Impl ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Mips implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSREGISTERINFO_H
15 #define MIPSREGISTERINFO_H
17 #include "llvm/Target/TargetRegisterInfo.h"
18 #include "MipsGenRegisterInfo.h.inc"
22 class TargetInstrInfo;
25 struct MipsRegisterInfo : public MipsGenRegisterInfo {
26 const TargetInstrInfo &TII;
28 MipsRegisterInfo(const TargetInstrInfo &tii);
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);
34 /// Code Generation virtual methods...
35 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
37 const TargetRegisterClass* const*
38 getCalleeSavedRegClasses(const MachineFunction* MF = 0) const;
40 BitVector getReservedRegs(const MachineFunction &MF) const;
42 bool hasFP(const MachineFunction &MF) const;
44 void eliminateCallFramePseudoInstr(MachineFunction &MF,
45 MachineBasicBlock &MBB,
46 MachineBasicBlock::iterator I) const;
48 /// Stack Frame Processing Methods
49 void eliminateFrameIndex(MachineBasicBlock::iterator II,
50 int SPAdj, RegScavenger *RS = NULL) const;
52 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
54 void emitPrologue(MachineFunction &MF) const;
55 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
57 /// Debug information queries.
58 unsigned getRARegister() const;
59 unsigned getFrameRegister(MachineFunction &MF) const;
61 /// Exception handling queries.
62 unsigned getEHExceptionRegister() const;
63 unsigned getEHHandlerRegister() const;
65 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
68 } // end namespace llvm