xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYFrameLowering.h (revision 349cc55c9796c4596a5b9904cd3281af295f878f)
1*349cc55cSDimitry Andric //===-- CSKYFrameLowering.h - Define frame lowering for CSKY -*- C++ -*--===//
2*349cc55cSDimitry Andric //
3*349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*349cc55cSDimitry Andric //
7*349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
8*349cc55cSDimitry Andric //
9*349cc55cSDimitry Andric // This class implements CSKY-specific bits of TargetFrameLowering class.
10*349cc55cSDimitry Andric //
11*349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
12*349cc55cSDimitry Andric 
13*349cc55cSDimitry Andric #ifndef LLVM_LIB_TARGET_CSKY_CSKYFRAMELOWERING_H
14*349cc55cSDimitry Andric #define LLVM_LIB_TARGET_CSKY_CSKYFRAMELOWERING_H
15*349cc55cSDimitry Andric 
16*349cc55cSDimitry Andric #include "llvm/CodeGen/TargetFrameLowering.h"
17*349cc55cSDimitry Andric 
18*349cc55cSDimitry Andric namespace llvm {
19*349cc55cSDimitry Andric class CSKYSubtarget;
20*349cc55cSDimitry Andric 
21*349cc55cSDimitry Andric class CSKYFrameLowering : public TargetFrameLowering {
22*349cc55cSDimitry Andric   const CSKYSubtarget &STI;
23*349cc55cSDimitry Andric 
24*349cc55cSDimitry Andric public:
25*349cc55cSDimitry Andric   explicit CSKYFrameLowering(const CSKYSubtarget &STI)
26*349cc55cSDimitry Andric       : TargetFrameLowering(StackGrowsDown,
27*349cc55cSDimitry Andric                             /*StackAlignment=*/Align(4),
28*349cc55cSDimitry Andric                             /*LocalAreaOffset=*/0),
29*349cc55cSDimitry Andric         STI(STI) {}
30*349cc55cSDimitry Andric 
31*349cc55cSDimitry Andric   void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
32*349cc55cSDimitry Andric   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
33*349cc55cSDimitry Andric 
34*349cc55cSDimitry Andric   bool hasFP(const MachineFunction &MF) const override;
35*349cc55cSDimitry Andric   bool hasBP(const MachineFunction &MF) const;
36*349cc55cSDimitry Andric };
37*349cc55cSDimitry Andric } // namespace llvm
38*349cc55cSDimitry Andric #endif
39