xref: /freebsd/contrib/llvm-project/llvm/lib/Target/Mips/MipsSEFrameLowering.h (revision 0d8fe2373503aeac48492f28073049a8bfa4feb5)
1 //===- MipsSEFrameLowering.h - Mips32/64 frame lowering ---------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_MIPS_MIPSSEFRAMELOWERING_H
10 #define LLVM_LIB_TARGET_MIPS_MIPSSEFRAMELOWERING_H
11 
12 #include "MipsFrameLowering.h"
13 #include "llvm/Support/TypeSize.h"
14 #include <vector>
15 
16 namespace llvm {
17 
18 class MachineBasicBlock;
19 class MachineFunction;
20 class MipsSubtarget;
21 
22 class MipsSEFrameLowering : public MipsFrameLowering {
23 public:
24   explicit MipsSEFrameLowering(const MipsSubtarget &STI);
25 
26   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
27   /// the function.
28   void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
29   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
30 
31   StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,
32                                      Register &FrameReg) const override;
33 
34   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
35                                  MachineBasicBlock::iterator MI,
36                                  ArrayRef<CalleeSavedInfo> CSI,
37                                  const TargetRegisterInfo *TRI) const override;
38 
39   bool hasReservedCallFrame(const MachineFunction &MF) const override;
40 
41   void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
42                             RegScavenger *RS) const override;
43 
44 private:
45   void emitInterruptEpilogueStub(MachineFunction &MF,
46                                  MachineBasicBlock &MBB) const;
47   void emitInterruptPrologueStub(MachineFunction &MF,
48                                  MachineBasicBlock &MBB) const;
49 };
50 
51 } // end namespace llvm
52 
53 #endif // LLVM_LIB_TARGET_MIPS_MIPSSEFRAMELOWERING_H
54