1 //==-- ARMTargetFrameLowering.h - Define frame lowering for ARM --*- 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 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_ARM_ARMFRAMELOWERING_H
15 #define LLVM_LIB_TARGET_ARM_ARMFRAMELOWERING_H
17 #include "llvm/Target/TargetFrameLowering.h"
22 class ARMFrameLowering : public TargetFrameLowering {
24 const ARMSubtarget &STI;
27 explicit ARMFrameLowering(const ARMSubtarget &sti);
29 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
31 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
32 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
34 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator MI,
36 const std::vector<CalleeSavedInfo> &CSI,
37 const TargetRegisterInfo *TRI) const override;
39 bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
40 MachineBasicBlock::iterator MI,
41 const std::vector<CalleeSavedInfo> &CSI,
42 const TargetRegisterInfo *TRI) const override;
44 bool noFramePointerElim(const MachineFunction &MF) const override;
46 bool hasFP(const MachineFunction &MF) const override;
47 bool hasReservedCallFrame(const MachineFunction &MF) const override;
48 bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override;
49 int getFrameIndexReference(const MachineFunction &MF, int FI,
50 unsigned &FrameReg) const override;
51 int ResolveFrameIndexReference(const MachineFunction &MF, int FI,
52 unsigned &FrameReg, int SPAdj) const;
53 int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
55 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
56 RegScavenger *RS) const override;
58 void adjustForSegmentedStacks(MachineFunction &MF,
59 MachineBasicBlock &MBB) const override;
62 void emitPushInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
63 const std::vector<CalleeSavedInfo> &CSI, unsigned StmOpc,
64 unsigned StrOpc, bool NoGap,
65 bool(*Func)(unsigned, bool), unsigned NumAlignedDPRCS2Regs,
66 unsigned MIFlags = 0) const;
67 void emitPopInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
68 const std::vector<CalleeSavedInfo> &CSI, unsigned LdmOpc,
69 unsigned LdrOpc, bool isVarArg, bool NoGap,
70 bool(*Func)(unsigned, bool),
71 unsigned NumAlignedDPRCS2Regs) const;
74 eliminateCallFramePseudoInstr(MachineFunction &MF,
75 MachineBasicBlock &MBB,
76 MachineBasicBlock::iterator MI) const override;
79 } // End llvm namespace