1 //===-- XCoreFrameLowering.h - Frame info for XCore Target ------*- 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 file contains XCore frame information that doesn't fit anywhere else
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H
16 #define LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H
18 #include "llvm/Target/TargetFrameLowering.h"
19 #include "llvm/Target/TargetMachine.h"
24 class XCoreFrameLowering: public TargetFrameLowering {
26 XCoreFrameLowering(const XCoreSubtarget &STI);
28 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
30 void emitPrologue(MachineFunction &MF,
31 MachineBasicBlock &MBB) const override;
32 void emitEpilogue(MachineFunction &MF,
33 MachineBasicBlock &MBB) const override;
35 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
36 MachineBasicBlock::iterator MI,
37 const std::vector<CalleeSavedInfo> &CSI,
38 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 void eliminateCallFramePseudoInstr(MachineFunction &MF,
45 MachineBasicBlock &MBB,
46 MachineBasicBlock::iterator I) const override;
48 bool hasFP(const MachineFunction &MF) const override;
50 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
51 RegScavenger *RS = nullptr) const override;
53 void processFunctionBeforeFrameFinalized(MachineFunction &MF,
54 RegScavenger *RS = nullptr) const override;
56 //! Stack slot size (4 bytes)
57 static int stackSlotSize() {