BPFFrameLowering.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //===-- BPFFrameLowering.h - Define frame lowering for BPF -----*- C++ -*--===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This class implements BPF-specific bits of TargetFrameLowering class.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
  13. #define LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
  14. #include "llvm/CodeGen/TargetFrameLowering.h"
  15. namespace llvm {
  16. class BPFSubtarget;
  17. class BPFFrameLowering : public TargetFrameLowering {
  18. public:
  19. explicit BPFFrameLowering(const BPFSubtarget &sti)
  20. : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(8), 0) {}
  21. void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
  22. void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
  23. bool hasFP(const MachineFunction &MF) const override;
  24. void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
  25. RegScavenger *RS) const override;
  26. MachineBasicBlock::iterator
  27. eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
  28. MachineBasicBlock::iterator MI) const override {
  29. return MBB.erase(MI);
  30. }
  31. };
  32. }
  33. #endif