]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/Target/AArch64/AArch64FrameLowering.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / Target / AArch64 / AArch64FrameLowering.h
CommitLineData
1a4d82fc 1//==-- AArch64FrameLowering.h - TargetFrameLowering for AArch64 --*- C++ -*-==//
970d7e83
LB
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//
1a4d82fc 10//
970d7e83
LB
11//
12//===----------------------------------------------------------------------===//
13
1a4d82fc
JJ
14#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
15#define LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
970d7e83 16
970d7e83
LB
17#include "llvm/Target/TargetFrameLowering.h"
18
19namespace llvm {
970d7e83
LB
20
21class AArch64FrameLowering : public TargetFrameLowering {
970d7e83 22public:
1a4d82fc
JJ
23 explicit AArch64FrameLowering()
24 : TargetFrameLowering(StackGrowsDown, 16, 0, 16,
25 false /*StackRealignable*/) {}
970d7e83 26
1a4d82fc
JJ
27 void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
28 MachineBasicBlock::iterator MBBI,
29 unsigned FramePtr) const;
970d7e83
LB
30
31 void eliminateCallFramePseudoInstr(MachineFunction &MF,
1a4d82fc
JJ
32 MachineBasicBlock &MBB,
33 MachineBasicBlock::iterator I) const override;
970d7e83 34
1a4d82fc
JJ
35 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
36 /// the function.
37 void emitPrologue(MachineFunction &MF) const override;
38 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
39
40 int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
41 int getFrameIndexReference(const MachineFunction &MF, int FI,
42 unsigned &FrameReg) const override;
43 int resolveFrameIndexReference(const MachineFunction &MF, int FI,
44 unsigned &FrameReg,
45 bool PreferFP = false) const;
46 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
47 MachineBasicBlock::iterator MI,
48 const std::vector<CalleeSavedInfo> &CSI,
49 const TargetRegisterInfo *TRI) const override;
50
51 bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
52 MachineBasicBlock::iterator MI,
53 const std::vector<CalleeSavedInfo> &CSI,
54 const TargetRegisterInfo *TRI) const override;
55
56 /// \brief Can this function use the red zone for local allocations.
57 bool canUseRedZone(const MachineFunction &MF) const;
58
59 bool hasFP(const MachineFunction &MF) const override;
60 bool hasReservedCallFrame(const MachineFunction &MF) const override;
61
62 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
63 RegScavenger *RS) const override;
970d7e83
LB
64};
65
66} // End llvm namespace
67
68#endif