LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
X86FrameLowering.h
Go to the documentation of this file.
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 "X86Subtarget.h"
18 #include "llvm/MC/MCDwarf.h"
20 
21 namespace llvm {
22 
23 class MCSymbol;
24 class X86TargetMachine;
25 
27  const X86TargetMachine &TM;
28  const X86Subtarget &STI;
29 public:
30  explicit X86FrameLowering(const X86TargetMachine &tm, const X86Subtarget &sti)
32  sti.getStackAlignment(),
33  (sti.is64Bit() ? -8 : -4)),
34  TM(tm), STI(sti) {
35  }
36 
38  unsigned FramePtr) const;
39 
40  /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
41  /// the function.
42  void emitPrologue(MachineFunction &MF) const;
43  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
44 
46 
47  void adjustForHiPEPrologue(MachineFunction &MF) const;
48 
50  RegScavenger *RS = NULL) const;
51 
54  const std::vector<CalleeSavedInfo> &CSI,
55  const TargetRegisterInfo *TRI) const;
56 
59  const std::vector<CalleeSavedInfo> &CSI,
60  const TargetRegisterInfo *TRI) const;
61 
62  bool hasFP(const MachineFunction &MF) const;
63  bool hasReservedCallFrame(const MachineFunction &MF) const;
64 
65  int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
66  int getFrameIndexReference(const MachineFunction &MF, int FI,
67  unsigned &FrameReg) const;
68 
70  MachineBasicBlock &MBB,
72 };
73 
74 } // End llvm namespace
75 
76 #endif
unsigned getStackAlignment() const
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const
X86FrameLowering(const X86TargetMachine &tm, const X86Subtarget &sti)
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS=NULL) const
void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
void adjustForHiPEPrologue(MachineFunction &MF) const
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
void adjustForSegmentedStacks(MachineFunction &MF) const
int getFrameIndexOffset(const MachineFunction &MF, int FI) const
bool hasFP(const MachineFunction &MF) const
void emitCalleeSavedFrameMoves(MachineFunction &MF, MCSymbol *Label, unsigned FramePtr) const
void emitPrologue(MachineFunction &MF) const
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const
bool hasReservedCallFrame(const MachineFunction &MF) const
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const