10b57cec5SDimitry Andric //===-- BPFFrameLowering.h - Define frame lowering for BPF -----*- C++ -*--===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // This class implements BPF-specific bits of TargetFrameLowering class. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H 140b57cec5SDimitry Andric #define LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric #include "llvm/CodeGen/TargetFrameLowering.h" 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric namespace llvm { 190b57cec5SDimitry Andric class BPFSubtarget; 200b57cec5SDimitry Andric 210b57cec5SDimitry Andric class BPFFrameLowering : public TargetFrameLowering { 220b57cec5SDimitry Andric public: BPFFrameLowering(const BPFSubtarget & sti)230b57cec5SDimitry Andric explicit BPFFrameLowering(const BPFSubtarget &sti) 24*8bcb0991SDimitry Andric : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(8), 0) {} 250b57cec5SDimitry Andric 260b57cec5SDimitry Andric void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override; 270b57cec5SDimitry Andric void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; 280b57cec5SDimitry Andric 290b57cec5SDimitry Andric bool hasFP(const MachineFunction &MF) const override; 300b57cec5SDimitry Andric void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, 310b57cec5SDimitry Andric RegScavenger *RS) const override; 320b57cec5SDimitry Andric 330b57cec5SDimitry Andric MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction & MF,MachineBasicBlock & MBB,MachineBasicBlock::iterator MI)340b57cec5SDimitry Andric eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, 350b57cec5SDimitry Andric MachineBasicBlock::iterator MI) const override { 360b57cec5SDimitry Andric return MBB.erase(MI); 370b57cec5SDimitry Andric } 380b57cec5SDimitry Andric }; 390b57cec5SDimitry Andric } 400b57cec5SDimitry Andric #endif 41