LLVM API Documentation

X86FrameLowering.h
Go to the documentation of this file.
00001 //===-- X86TargetFrameLowering.h - Define frame lowering for X86 -*- 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 class implements X86-specific bits of TargetFrameLowering class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
00015 #define LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
00016 
00017 #include "llvm/Target/TargetFrameLowering.h"
00018 
00019 namespace llvm {
00020 
00021 class MCSymbol;
00022 class X86TargetMachine;
00023 class X86Subtarget;
00024 
00025 class X86FrameLowering : public TargetFrameLowering {
00026 public:
00027   explicit X86FrameLowering(StackDirection D, unsigned StackAl, int LAO)
00028     : TargetFrameLowering(StackGrowsDown, StackAl, LAO) {}
00029 
00030   static void getStackProbeFunction(const X86Subtarget &STI,
00031                                     unsigned &CallOp,
00032                                     const char *&Symbol);
00033 
00034   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
00035                                  MachineBasicBlock::iterator MBBI,
00036                                  DebugLoc DL) const;
00037 
00038   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
00039   /// the function.
00040   void emitPrologue(MachineFunction &MF) const override;
00041   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
00042 
00043   void adjustForSegmentedStacks(MachineFunction &MF) const override;
00044 
00045   void adjustForHiPEPrologue(MachineFunction &MF) const override;
00046 
00047   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
00048                                      RegScavenger *RS = nullptr) const override;
00049 
00050   bool
00051   assignCalleeSavedSpillSlots(MachineFunction &MF,
00052                               const TargetRegisterInfo *TRI,
00053                               std::vector<CalleeSavedInfo> &CSI) const override;
00054 
00055   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
00056                                  MachineBasicBlock::iterator MI,
00057                                  const std::vector<CalleeSavedInfo> &CSI,
00058                                  const TargetRegisterInfo *TRI) const override;
00059 
00060   bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
00061                                   MachineBasicBlock::iterator MI,
00062                                   const std::vector<CalleeSavedInfo> &CSI,
00063                                   const TargetRegisterInfo *TRI) const override;
00064 
00065   bool hasFP(const MachineFunction &MF) const override;
00066   bool hasReservedCallFrame(const MachineFunction &MF) const override;
00067 
00068   int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
00069   int getFrameIndexReference(const MachineFunction &MF, int FI,
00070                              unsigned &FrameReg) const override;
00071 
00072   void eliminateCallFramePseudoInstr(MachineFunction &MF,
00073                                  MachineBasicBlock &MBB,
00074                                  MachineBasicBlock::iterator MI) const override;
00075 };
00076 
00077 } // End llvm namespace
00078 
00079 #endif