1 //===-- BPFFrameLowering.h - Define frame lowering for BPF -----*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class implements BPF-specific bits of TargetFrameLowering class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
15 #define LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
17 #include "llvm/Target/TargetFrameLowering.h"
22 class BPFFrameLowering : public TargetFrameLowering {
24 explicit BPFFrameLowering(const BPFSubtarget &sti)
25 : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0) {}
27 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
28 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
30 bool hasFP(const MachineFunction &MF) const override;
31 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
32 RegScavenger *RS) const override;
35 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
36 MachineBasicBlock::iterator MI) const override {