]>
git.proxmox.com Git - rustc.git/blob - src/llvm/lib/Target/X86/X86FrameLowering.h
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 LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
15 #define LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
17 #include "llvm/Target/TargetFrameLowering.h"
22 class X86TargetMachine
;
25 class X86FrameLowering
: public TargetFrameLowering
{
27 explicit X86FrameLowering(StackDirection D
, unsigned StackAl
, int LAO
)
28 : TargetFrameLowering(StackGrowsDown
, StackAl
, LAO
) {}
30 static void getStackProbeFunction(const X86Subtarget
&STI
,
34 void emitCalleeSavedFrameMoves(MachineBasicBlock
&MBB
,
35 MachineBasicBlock::iterator MBBI
,
38 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
40 void emitPrologue(MachineFunction
&MF
) const override
;
41 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const override
;
43 void adjustForSegmentedStacks(MachineFunction
&MF
) const override
;
45 void adjustForHiPEPrologue(MachineFunction
&MF
) const override
;
47 void processFunctionBeforeCalleeSavedScan(MachineFunction
&MF
,
48 RegScavenger
*RS
= nullptr) const override
;
51 assignCalleeSavedSpillSlots(MachineFunction
&MF
,
52 const TargetRegisterInfo
*TRI
,
53 std::vector
<CalleeSavedInfo
> &CSI
) const override
;
55 bool spillCalleeSavedRegisters(MachineBasicBlock
&MBB
,
56 MachineBasicBlock::iterator MI
,
57 const std::vector
<CalleeSavedInfo
> &CSI
,
58 const TargetRegisterInfo
*TRI
) const override
;
60 bool restoreCalleeSavedRegisters(MachineBasicBlock
&MBB
,
61 MachineBasicBlock::iterator MI
,
62 const std::vector
<CalleeSavedInfo
> &CSI
,
63 const TargetRegisterInfo
*TRI
) const override
;
65 bool hasFP(const MachineFunction
&MF
) const override
;
66 bool hasReservedCallFrame(const MachineFunction
&MF
) const override
;
68 int getFrameIndexOffset(const MachineFunction
&MF
, int FI
) const override
;
69 int getFrameIndexReference(const MachineFunction
&MF
, int FI
,
70 unsigned &FrameReg
) const override
;
72 int getFrameIndexOffsetFromSP(const MachineFunction
&MF
, int FI
) const;
73 int getFrameIndexReferenceFromSP(const MachineFunction
&MF
, int FI
,
74 unsigned &FrameReg
) const override
;
76 void eliminateCallFramePseudoInstr(MachineFunction
&MF
,
77 MachineBasicBlock
&MBB
,
78 MachineBasicBlock::iterator MI
) const override
;
81 /// convertArgMovsToPushes - This method tries to convert a call sequence
82 /// that uses sub and mov instructions to put the argument onto the stack
83 /// into a series of pushes.
84 /// Returns true if the transformation succeeded, false if not.
85 bool convertArgMovsToPushes(MachineFunction
&MF
,
86 MachineBasicBlock
&MBB
,
87 MachineBasicBlock::iterator I
,
88 uint64_t Amount
) const;
91 } // End llvm namespace