1 //===-- X86TargetFrameLowering.h - Define frame lowering for X86 -*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class implements X86-specific bits of TargetFrameLowering class.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86_FRAMELOWERING_H
15 #define X86_FRAMELOWERING_H
17 #include "llvm/Target/TargetFrameLowering.h"
22 class X86TargetMachine;
24 class X86FrameLowering : public TargetFrameLowering {
26 explicit X86FrameLowering(StackDirection D, unsigned StackAl, int LAO)
27 : TargetFrameLowering(StackGrowsDown, StackAl, LAO) {}
29 void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
30 MachineBasicBlock::iterator MBBI, DebugLoc DL,
31 unsigned FramePtr) const;
33 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
35 void emitPrologue(MachineFunction &MF) const override;
36 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
38 void adjustForSegmentedStacks(MachineFunction &MF) const override;
40 void adjustForHiPEPrologue(MachineFunction &MF) const override;
42 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
43 RegScavenger *RS = nullptr) const override;
45 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
46 MachineBasicBlock::iterator MI,
47 const std::vector<CalleeSavedInfo> &CSI,
48 const TargetRegisterInfo *TRI) const override;
50 bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
51 MachineBasicBlock::iterator MI,
52 const std::vector<CalleeSavedInfo> &CSI,
53 const TargetRegisterInfo *TRI) const override;
55 bool hasFP(const MachineFunction &MF) const override;
56 bool hasReservedCallFrame(const MachineFunction &MF) const override;
58 int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
59 int getFrameIndexReference(const MachineFunction &MF, int FI,
60 unsigned &FrameReg) const override;
62 void eliminateCallFramePseudoInstr(MachineFunction &MF,
63 MachineBasicBlock &MBB,
64 MachineBasicBlock::iterator MI) const override;
67 } // End llvm namespace