xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYFrameLowering.h (revision 5e801ac66d24704442eba426ed13c3effb8a34e7)
1 //===-- CSKYFrameLowering.h - Define frame lowering for CSKY -*- 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 // This class implements CSKY-specific bits of TargetFrameLowering class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_CSKY_CSKYFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_CSKY_CSKYFRAMELOWERING_H
15 
16 #include "llvm/CodeGen/TargetFrameLowering.h"
17 
18 namespace llvm {
19 class CSKYSubtarget;
20 
21 class CSKYFrameLowering : public TargetFrameLowering {
22   const CSKYSubtarget &STI;
23 
24 public:
25   explicit CSKYFrameLowering(const CSKYSubtarget &STI)
26       : TargetFrameLowering(StackGrowsDown,
27                             /*StackAlignment=*/Align(4),
28                             /*LocalAreaOffset=*/0),
29         STI(STI) {}
30 
31   void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
32   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
33 
34   bool hasFP(const MachineFunction &MF) const override;
35   bool hasBP(const MachineFunction &MF) const;
36 };
37 } // namespace llvm
38 #endif
39