1 //===-- XCoreFrameLowering.h - Frame info for XCore Target ------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains XCore frame information that doesn't fit anywhere else
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H
15 #define LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H
17 #include "llvm/CodeGen/TargetFrameLowering.h"
18 #include "llvm/Target/TargetMachine.h"
23 class XCoreFrameLowering: public TargetFrameLowering {
25 XCoreFrameLowering(const XCoreSubtarget &STI);
27 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
29 void emitPrologue(MachineFunction &MF,
30 MachineBasicBlock &MBB) const override;
31 void emitEpilogue(MachineFunction &MF,
32 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;
38 bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
39 MachineBasicBlock::iterator MI,
40 std::vector<CalleeSavedInfo> &CSI,
41 const TargetRegisterInfo *TRI) const override;
43 MachineBasicBlock::iterator
44 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
45 MachineBasicBlock::iterator I) const override;
47 bool hasFP(const MachineFunction &MF) const override;
49 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
50 RegScavenger *RS = nullptr) const override;
52 void processFunctionBeforeFrameFinalized(MachineFunction &MF,
53 RegScavenger *RS = nullptr) const override;
55 //! Stack slot size (4 bytes)
56 static int stackSlotSize() {