1 //===-- BPFFrameLowering.h - Define frame lowering for BPF -----*- 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 class implements BPF-specific bits of TargetFrameLowering class.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
16 #include "llvm/CodeGen/TargetFrameLowering.h"
21 class BPFFrameLowering : public TargetFrameLowering {
23 explicit BPFFrameLowering(const BPFSubtarget &sti)
24 : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0) {}
26 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
27 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
29 bool hasFP(const MachineFunction &MF) const override;
30 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
31 RegScavenger *RS) const override;
33 MachineBasicBlock::iterator
34 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator MI) const override {