LLVM API Documentation
00001 //===- MipsRegisterInfo.h - Mips Register Information Impl ------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains the Mips implementation of the TargetRegisterInfo class. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef MIPSREGISTERINFO_H 00015 #define MIPSREGISTERINFO_H 00016 00017 #include "Mips.h" 00018 #include "llvm/Target/TargetRegisterInfo.h" 00019 #include "MipsGenRegisterInfo.h.inc" 00020 00021 namespace llvm { 00022 class MipsSubtarget; 00023 class TargetInstrInfo; 00024 class Type; 00025 00026 struct MipsRegisterInfo : public MipsGenRegisterInfo { 00027 const MipsSubtarget &Subtarget; 00028 const TargetInstrInfo &TII; 00029 00030 MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii); 00031 00032 /// getRegisterNumbering - Given the enum value for some register, e.g. 00033 /// Mips::RA, return the number that it corresponds to (e.g. 31). 00034 static unsigned getRegisterNumbering(unsigned RegEnum); 00035 00036 /// Get PIC indirect call register 00037 static unsigned getPICCallReg(void); 00038 00039 /// Adjust the Mips stack frame. 00040 void adjustMipsStackFrame(MachineFunction &MF) const; 00041 00042 /// Code Generation virtual methods... 00043 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const; 00044 00045 const TargetRegisterClass* const* 00046 getCalleeSavedRegClasses(const MachineFunction* MF = 0) const; 00047 00048 BitVector getReservedRegs(const MachineFunction &MF) const; 00049 00050 bool hasFP(const MachineFunction &MF) const; 00051 00052 void eliminateCallFramePseudoInstr(MachineFunction &MF, 00053 MachineBasicBlock &MBB, 00054 MachineBasicBlock::iterator I) const; 00055 00056 /// Stack Frame Processing Methods 00057 void eliminateFrameIndex(MachineBasicBlock::iterator II, 00058 int SPAdj, RegScavenger *RS = NULL) const; 00059 00060 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; 00061 00062 void emitPrologue(MachineFunction &MF) const; 00063 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 00064 00065 /// Debug information queries. 00066 unsigned getRARegister() const; 00067 unsigned getFrameRegister(MachineFunction &MF) const; 00068 00069 /// Exception handling queries. 00070 unsigned getEHExceptionRegister() const; 00071 unsigned getEHHandlerRegister() const; 00072 00073 int getDwarfRegNum(unsigned RegNum, bool isEH) const; 00074 }; 00075 00076 } // end namespace llvm 00077 00078 #endif