brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 25adc33 Raw
62 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9//10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H14#define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H15 16#include "Mips.h"17#include "llvm/CodeGen/TargetFrameLowering.h"18 19namespace llvm {20  class MipsSubtarget;21 22class MipsFrameLowering : public TargetFrameLowering {23protected:24  const MipsSubtarget &STI;25 26  bool hasFPImpl(const MachineFunction &MF) const override;27 28public:29  explicit MipsFrameLowering(const MipsSubtarget &sti, Align Alignment)30      : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {31  }32 33  static const MipsFrameLowering *create(const MipsSubtarget &ST);34 35  bool hasBP(const MachineFunction &MF) const;36 37  bool allocateScavengingFrameIndexesNearIncomingSP(38    const MachineFunction &MF) const override {39    return false;40  }41 42  bool enableShrinkWrapping(const MachineFunction &MF) const override {43    return true;44  }45 46  MachineBasicBlock::iterator47  eliminateCallFramePseudoInstr(MachineFunction &MF,48                                MachineBasicBlock &MBB,49                                MachineBasicBlock::iterator I) const override;50 51protected:52  uint64_t estimateStackSize(const MachineFunction &MF) const;53};54 55/// Create MipsFrameLowering objects.56const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST);57const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST);58 59} // End llvm namespace60 61#endif62