blob: b4ffa0713fa6a8ec63ea14b6679123b3682d8997 [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
David Blaikie1be62f02017-11-03 22:32:11 +000017#include "llvm/CodeGen/TargetFrameLowering.h"
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000018
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
Hans Wennborge1a2e902016-03-31 18:33:38 +000034 MachineBasicBlock::iterator
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000035 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
36 MachineBasicBlock::iterator MI) const override {
Hans Wennborge1a2e902016-03-31 18:33:38 +000037 return MBB.erase(MI);
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000038 }
39};
Alexander Kornienkof00654e2015-06-23 09:49:53 +000040}
Alexei Starovoitove4c8c802015-01-24 17:51:26 +000041#endif