Home | History | Annotate | Download | only in X86
      1 //===-- X86TargetFrameLowering.h - Define frame lowering for X86 -*- 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 class implements X86-specific bits of TargetFrameLowering class.
     11 //
     12 //===----------------------------------------------------------------------===//
     13 
     14 #ifndef X86_FRAMELOWERING_H
     15 #define X86_FRAMELOWERING_H
     16 
     17 #include "llvm/Target/TargetFrameLowering.h"
     18 
     19 namespace llvm {
     20 
     21 class MCSymbol;
     22 class X86TargetMachine;
     23 
     24 class X86FrameLowering : public TargetFrameLowering {
     25 public:
     26   explicit X86FrameLowering(StackDirection D, unsigned StackAl, int LAO)
     27     : TargetFrameLowering(StackGrowsDown, StackAl, LAO) {}
     28 
     29   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
     30                                  MachineBasicBlock::iterator MBBI,
     31                                  DebugLoc DL) const;
     32 
     33   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
     34   /// the function.
     35   void emitPrologue(MachineFunction &MF) const override;
     36   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
     37 
     38   void adjustForSegmentedStacks(MachineFunction &MF) const override;
     39 
     40   void adjustForHiPEPrologue(MachineFunction &MF) const override;
     41 
     42   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
     43                                      RegScavenger *RS = nullptr) const override;
     44 
     45   bool
     46   assignCalleeSavedSpillSlots(MachineFunction &MF,
     47                               const TargetRegisterInfo *TRI,
     48                               std::vector<CalleeSavedInfo> &CSI) const override;
     49 
     50   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
     51                                  MachineBasicBlock::iterator MI,
     52                                  const std::vector<CalleeSavedInfo> &CSI,
     53                                  const TargetRegisterInfo *TRI) const override;
     54 
     55   bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
     56                                   MachineBasicBlock::iterator MI,
     57                                   const std::vector<CalleeSavedInfo> &CSI,
     58                                   const TargetRegisterInfo *TRI) const override;
     59 
     60   bool hasFP(const MachineFunction &MF) const override;
     61   bool hasReservedCallFrame(const MachineFunction &MF) const override;
     62 
     63   int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
     64   int getFrameIndexReference(const MachineFunction &MF, int FI,
     65                              unsigned &FrameReg) const override;
     66 
     67   void eliminateCallFramePseudoInstr(MachineFunction &MF,
     68                                  MachineBasicBlock &MBB,
     69                                  MachineBasicBlock::iterator MI) const override;
     70 };
     71 
     72 } // End llvm namespace
     73 
     74 #endif
     75