LLVM API Documentation

AArch64FrameLowering.h
Go to the documentation of this file.
00001 //==-- AArch64FrameLowering.h - TargetFrameLowering for AArch64 --*- C++ -*-==//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 //
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
00015 #define LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
00016 
00017 #include "llvm/Target/TargetFrameLowering.h"
00018 
00019 namespace llvm {
00020 
00021 class AArch64FrameLowering : public TargetFrameLowering {
00022 public:
00023   explicit AArch64FrameLowering()
00024       : TargetFrameLowering(StackGrowsDown, 16, 0, 16,
00025                             false /*StackRealignable*/) {}
00026 
00027   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
00028                                  MachineBasicBlock::iterator MBBI,
00029                                  unsigned FramePtr) const;
00030 
00031   void eliminateCallFramePseudoInstr(MachineFunction &MF,
00032                                   MachineBasicBlock &MBB,
00033                                   MachineBasicBlock::iterator I) const override;
00034 
00035   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
00036   /// the function.
00037   void emitPrologue(MachineFunction &MF) const override;
00038   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
00039 
00040   int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
00041   int getFrameIndexReference(const MachineFunction &MF, int FI,
00042                              unsigned &FrameReg) const override;
00043   int resolveFrameIndexReference(const MachineFunction &MF, int FI,
00044                                  unsigned &FrameReg,
00045                                  bool PreferFP = false) const;
00046   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
00047                                  MachineBasicBlock::iterator MI,
00048                                  const std::vector<CalleeSavedInfo> &CSI,
00049                                  const TargetRegisterInfo *TRI) const override;
00050 
00051   bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
00052                                   MachineBasicBlock::iterator MI,
00053                                   const std::vector<CalleeSavedInfo> &CSI,
00054                                   const TargetRegisterInfo *TRI) const override;
00055 
00056   /// \brief Can this function use the red zone for local allocations.
00057   bool canUseRedZone(const MachineFunction &MF) const;
00058 
00059   bool hasFP(const MachineFunction &MF) const override;
00060   bool hasReservedCallFrame(const MachineFunction &MF) const override;
00061 
00062   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
00063                                             RegScavenger *RS) const override;
00064 };
00065 
00066 } // End llvm namespace
00067 
00068 #endif