LLVM API Documentation

SparcRegisterInfo.h

Go to the documentation of this file.
00001 //===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the Sparc implementation of the MRegisterInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef SPARCREGISTERINFO_H
00015 #define SPARCREGISTERINFO_H
00016 
00017 #include "llvm/Target/MRegisterInfo.h"
00018 #include "SparcGenRegisterInfo.h.inc"
00019 
00020 namespace llvm {
00021 
00022 class SparcSubtarget;
00023 class Type;
00024 
00025 struct SparcRegisterInfo : public SparcGenRegisterInfo {
00026   SparcSubtarget &Subtarget;
00027   
00028   SparcRegisterInfo(SparcSubtarget &st);
00029 
00030   /// Code Generation virtual methods...
00031   void storeRegToStackSlot(MachineBasicBlock &MBB,
00032                            MachineBasicBlock::iterator MBBI,
00033                            unsigned SrcReg, int FrameIndex,
00034                            const TargetRegisterClass *RC) const;
00035 
00036   void loadRegFromStackSlot(MachineBasicBlock &MBB,
00037                             MachineBasicBlock::iterator MBBI,
00038                             unsigned DestReg, int FrameIndex,
00039                             const TargetRegisterClass *RC) const;
00040 
00041   void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
00042                     unsigned DestReg, unsigned SrcReg,
00043                     const TargetRegisterClass *RC) const;
00044   
00045   virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
00046                                           unsigned OpNum,
00047                                           int FrameIndex) const;
00048 
00049   void eliminateCallFramePseudoInstr(MachineFunction &MF,
00050                                      MachineBasicBlock &MBB,
00051                                      MachineBasicBlock::iterator I) const;
00052 
00053   void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
00054 
00055   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
00056 
00057   void emitPrologue(MachineFunction &MF) const;
00058   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
00059   
00060   // Debug information queries.
00061   unsigned getRARegister() const;
00062   unsigned getFrameRegister(MachineFunction &MF) const;
00063 };
00064 
00065 } // end namespace llvm
00066 
00067 #endif