[Alignment] Move OffsetToAlignment to Alignment.h
[llvm-complete.git] / lib / Target / Mips / MipsFrameLowering.h
blob0537cfd1cb307ea2e0bc6a0b8a0293e6d3a19bf8
1 //===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- 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 //
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
16 #include "Mips.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
19 namespace llvm {
20 class MipsSubtarget;
22 class MipsFrameLowering : public TargetFrameLowering {
23 protected:
24 const MipsSubtarget &STI;
26 public:
27 explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment)
28 : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {}
30 static const MipsFrameLowering *create(const MipsSubtarget &ST);
32 bool hasFP(const MachineFunction &MF) const override;
34 bool hasBP(const MachineFunction &MF) const;
36 bool isFPCloseToIncomingSP() const override { return false; }
38 bool enableShrinkWrapping(const MachineFunction &MF) const override {
39 return true;
42 MachineBasicBlock::iterator
43 eliminateCallFramePseudoInstr(MachineFunction &MF,
44 MachineBasicBlock &MBB,
45 MachineBasicBlock::iterator I) const override;
47 protected:
48 uint64_t estimateStackSize(const MachineFunction &MF) const;
51 /// Create MipsFrameLowering objects.
52 const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST);
53 const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST);
55 } // End llvm namespace
57 #endif