LLVM API Documentation

SystemZRegisterInfo.h

Go to the documentation of this file.
00001 //===- SystemZRegisterInfo.h - SystemZ 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 SystemZ implementation of the TargetRegisterInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef SystemZREGISTERINFO_H
00015 #define SystemZREGISTERINFO_H
00016 
00017 #include "llvm/Target/TargetRegisterInfo.h"
00018 #include "SystemZGenRegisterInfo.h.inc"
00019 
00020 namespace llvm {
00021 
00022 namespace SystemZ {
00023   /// SubregIndex - The index of various sized subregister classes. Note that
00024   /// these indices must be kept in sync with the class indices in the
00025   /// SystemZRegisterInfo.td file.
00026   enum SubregIndex {
00027     SUBREG_32BIT = 1, SUBREG_EVEN = 1, SUBREG_ODD = 2
00028   };
00029 }
00030 
00031 class SystemZSubtarget;
00032 class SystemZInstrInfo;
00033 class Type;
00034 
00035 struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
00036   SystemZTargetMachine &TM;
00037   const SystemZInstrInfo &TII;
00038 
00039   SystemZRegisterInfo(SystemZTargetMachine &tm, const SystemZInstrInfo &tii);
00040 
00041   /// Code Generation virtual methods...
00042   const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
00043 
00044   const TargetRegisterClass* const* getCalleeSavedRegClasses(
00045                                      const MachineFunction *MF = 0) const;
00046 
00047   BitVector getReservedRegs(const MachineFunction &MF) const;
00048 
00049   bool hasReservedCallFrame(MachineFunction &MF) const { return true; }
00050   bool hasFP(const MachineFunction &MF) const;
00051 
00052   int getFrameIndexOffset(MachineFunction &MF, int FI) const;
00053 
00054   void eliminateCallFramePseudoInstr(MachineFunction &MF,
00055                                      MachineBasicBlock &MBB,
00056                                      MachineBasicBlock::iterator I) const;
00057 
00058   void eliminateFrameIndex(MachineBasicBlock::iterator II,
00059                            int SPAdj, RegScavenger *RS = NULL) const;
00060 
00061 
00062   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
00063                                             RegScavenger *RS) const;
00064 
00065   void emitPrologue(MachineFunction &MF) const;
00066   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
00067 
00068   // Debug information queries.
00069   unsigned getRARegister() const;
00070   unsigned getFrameRegister(MachineFunction &MF) const;
00071 
00072   // Exception handling queries.
00073   unsigned getEHExceptionRegister() const;
00074   unsigned getEHHandlerRegister() const;
00075 
00076   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
00077 };
00078 
00079 } // end namespace llvm
00080 
00081 #endif