LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ARMFrameLowering.h
Go to the documentation of this file.
1 //==-- ARMTargetFrameLowering.h - Define frame lowering for ARM --*- 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 //
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef ARM_FRAMEINFO_H
15 #define ARM_FRAMEINFO_H
16 
17 #include "ARM.h"
18 #include "ARMSubtarget.h"
20 
21 namespace llvm {
22  class ARMSubtarget;
23 
25 protected:
26  const ARMSubtarget &STI;
27 
28 public:
29  explicit ARMFrameLowering(const ARMSubtarget &sti)
31  STI(sti) {
32  }
33 
34  /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
35  /// the function.
36  void emitPrologue(MachineFunction &MF) const;
37  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
38 
41  const std::vector<CalleeSavedInfo> &CSI,
42  const TargetRegisterInfo *TRI) const;
43 
46  const std::vector<CalleeSavedInfo> &CSI,
47  const TargetRegisterInfo *TRI) const;
48 
49  bool hasFP(const MachineFunction &MF) const;
50  bool hasReservedCallFrame(const MachineFunction &MF) const;
51  bool canSimplifyCallFramePseudos(const MachineFunction &MF) const;
52  int getFrameIndexReference(const MachineFunction &MF, int FI,
53  unsigned &FrameReg) const;
55  int FI,
56  unsigned &FrameReg, int SPAdj) const;
57  int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
58 
60  RegScavenger *RS) const;
61 
62  private:
63  void emitPushInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
64  const std::vector<CalleeSavedInfo> &CSI, unsigned StmOpc,
65  unsigned StrOpc, bool NoGap,
66  bool(*Func)(unsigned, bool), unsigned NumAlignedDPRCS2Regs,
67  unsigned MIFlags = 0) const;
68  void emitPopInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
69  const std::vector<CalleeSavedInfo> &CSI, unsigned LdmOpc,
70  unsigned LdrOpc, bool isVarArg, bool NoGap,
71  bool(*Func)(unsigned, bool),
72  unsigned NumAlignedDPRCS2Regs) const;
73 
74  virtual void eliminateCallFramePseudoInstr(
75  MachineFunction &MF,
76  MachineBasicBlock &MBB,
78 };
79 
80 } // End llvm namespace
81 
82 #endif
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
unsigned getStackAlignment() const
bool hasReservedCallFrame(const MachineFunction &MF) const
int getFrameIndexOffset(const MachineFunction &MF, int FI) const
int ResolveFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg, int SPAdj) const
bool canSimplifyCallFramePseudos(const MachineFunction &MF) const
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
bool hasFP(const MachineFunction &MF) const
ARMFrameLowering(const ARMSubtarget &sti)
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS) const
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const
void emitPrologue(MachineFunction &MF) const
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const
const ARMSubtarget & STI