blob: 251cda965ff5bb266251812065f1d60afca70718 [file] [log] [blame]
Alexei Starovoitove4c8c802015-01-24 17:51:26 +00001//===-- BPFFrameLowering.h - Define frame lowering for BPF -----*- C++ -*--===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This class implements BPF-specific bits of TargetFrameLowering class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
15#define LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
16
17#include "llvm/Target/TargetFrameLowering.h"
18
19namespace llvm {
20class BPFSubtarget;
21
22class BPFFrameLowering : public TargetFrameLowering {
23public:
24 explicit BPFFrameLowering(const BPFSubtarget &sti)
25 : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0) {}
26
Quentin Colombet61b305e2015-05-05 17:38:16 +000027 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000028 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
29
30 bool hasFP(const MachineFunction &MF) const override;
Matthias Braun02564862015-07-14 17:17:13 +000031 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
32 RegScavenger *RS) const override;
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000033
34 void
35 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
36 MachineBasicBlock::iterator MI) const override {
37 MBB.erase(MI);
38 }
39};
Alexander Kornienkof00654e2015-06-23 09:49:53 +000040}
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000041#endif