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
18 #include "llvm/Target/TargetRegisterInfo.h"
20 #define GET_REGINFO_HEADER
21 #include "MipsGenRegisterInfo.inc"
25 class TargetInstrInfo;
28 struct MipsRegisterInfo : public MipsGenRegisterInfo {
29 const MipsSubtarget &Subtarget;
30 const TargetInstrInfo &TII;
32 MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii);
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);
38 /// Get PIC indirect call register
39 static unsigned getPICCallReg();
41 /// Adjust the Mips stack frame.
42 void adjustMipsStackFrame(MachineFunction &MF) const;
44 /// Code Generation virtual methods...
45 const uint16_t *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
46 const uint32_t *getCallPreservedMask(CallingConv::ID) const;
48 BitVector getReservedRegs(const MachineFunction &MF) const;
50 void eliminateCallFramePseudoInstr(MachineFunction &MF,
51 MachineBasicBlock &MBB,
52 MachineBasicBlock::iterator I) const;
54 /// Stack Frame Processing Methods
55 void eliminateFrameIndex(MachineBasicBlock::iterator II,
56 int SPAdj, RegScavenger *RS = NULL) const;
58 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
60 /// Debug information queries.
61 unsigned getFrameRegister(const MachineFunction &MF) const;
63 /// Exception handling queries.
64 unsigned getEHExceptionRegister() const;
65 unsigned getEHHandlerRegister() const;
68 } // end namespace llvm