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#include "MipsGenRegisterInfo.h.inc" 20 21namespace llvm { 22class MipsSubtarget; 23class TargetInstrInfo; 24class Type; 25
| 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#include "MipsGenRegisterInfo.h.inc" 20 21namespace llvm { 22class MipsSubtarget; 23class TargetInstrInfo; 24class Type; 25
|
26struct MipsRegisterInfo : public MipsGenRegisterInfo { 27 const MipsSubtarget &Subtarget; 28 const TargetInstrInfo &TII; 29 30 MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii); 31 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); 35 36 /// Get PIC indirect call register 37 static unsigned getPICCallReg(); 38 39 /// Adjust the Mips stack frame. 40 void adjustMipsStackFrame(MachineFunction &MF) const; 41 42 /// Code Generation virtual methods... 43 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const; 44 45 const TargetRegisterClass* const* 46 getCalleeSavedRegClasses(const MachineFunction* MF = 0) const; 47 48 BitVector getReservedRegs(const MachineFunction &MF) const; 49 50 bool hasFP(const MachineFunction &MF) const; 51 52 void eliminateCallFramePseudoInstr(MachineFunction &MF, 53 MachineBasicBlock &MBB, 54 MachineBasicBlock::iterator I) const; 55 56 /// Stack Frame Processing Methods 57 unsigned eliminateFrameIndex(MachineBasicBlock::iterator II, 58 int SPAdj, int *Value = NULL, 59 RegScavenger *RS = NULL) const; 60 61 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; 62 63 void emitPrologue(MachineFunction &MF) const; 64 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 65 66 /// Debug information queries. 67 unsigned getRARegister() const; 68 unsigned getFrameRegister(const MachineFunction &MF) const; 69 70 /// Exception handling queries. 71 unsigned getEHExceptionRegister() const; 72 unsigned getEHHandlerRegister() const; 73 74 int getDwarfRegNum(unsigned RegNum, bool isEH) const; 75}; 76 77} // end namespace llvm 78 79#endif
| 35struct MipsRegisterInfo : public MipsGenRegisterInfo { 36 const MipsSubtarget &Subtarget; 37 const TargetInstrInfo &TII; 38 39 MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii); 40 41 /// getRegisterNumbering - Given the enum value for some register, e.g. 42 /// Mips::RA, return the number that it corresponds to (e.g. 31). 43 static unsigned getRegisterNumbering(unsigned RegEnum); 44 45 /// Get PIC indirect call register 46 static unsigned getPICCallReg(); 47 48 /// Adjust the Mips stack frame. 49 void adjustMipsStackFrame(MachineFunction &MF) const; 50 51 /// Code Generation virtual methods... 52 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const; 53 54 const TargetRegisterClass* const* 55 getCalleeSavedRegClasses(const MachineFunction* MF = 0) const; 56 57 BitVector getReservedRegs(const MachineFunction &MF) const; 58 59 bool hasFP(const MachineFunction &MF) const; 60 61 void eliminateCallFramePseudoInstr(MachineFunction &MF, 62 MachineBasicBlock &MBB, 63 MachineBasicBlock::iterator I) const; 64 65 /// Stack Frame Processing Methods 66 unsigned eliminateFrameIndex(MachineBasicBlock::iterator II, 67 int SPAdj, int *Value = NULL, 68 RegScavenger *RS = NULL) const; 69 70 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; 71 72 void emitPrologue(MachineFunction &MF) const; 73 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 74 75 /// Debug information queries. 76 unsigned getRARegister() const; 77 unsigned getFrameRegister(const MachineFunction &MF) const; 78 79 /// Exception handling queries. 80 unsigned getEHExceptionRegister() const; 81 unsigned getEHHandlerRegister() const; 82 83 int getDwarfRegNum(unsigned RegNum, bool isEH) const; 84}; 85 86} // end namespace llvm 87 88#endif
|