Switch all uses of LLVM_OVERRIDE to just use 'override' directly.
[oota-llvm.git] / lib / Target / SystemZ / SystemZFrameLowering.h
1 //===-- SystemZFrameLowering.h - Frame lowering for SystemZ -----*- C++ -*-===//
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
10 #ifndef SYSTEMZFRAMELOWERING_H
11 #define SYSTEMZFRAMELOWERING_H
12
13 #include "SystemZSubtarget.h"
14 #include "llvm/ADT/IndexedMap.h"
15 #include "llvm/Target/TargetFrameLowering.h"
16
17 namespace llvm {
18 class SystemZTargetMachine;
19 class SystemZSubtarget;
20
21 class SystemZFrameLowering : public TargetFrameLowering {
22   IndexedMap<unsigned> RegSpillOffsets;
23
24 protected:
25   const SystemZTargetMachine &TM;
26   const SystemZSubtarget &STI;
27
28 public:
29   SystemZFrameLowering(const SystemZTargetMachine &tm,
30                        const SystemZSubtarget &sti);
31
32   // Override TargetFrameLowering.
33   virtual bool isFPCloseToIncomingSP() const override { return false; }
34   virtual const SpillSlot *
35     getCalleeSavedSpillSlots(unsigned &NumEntries) const override;
36   virtual void
37     processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
38                                          RegScavenger *RS) const override;
39   virtual bool
40     spillCalleeSavedRegisters(MachineBasicBlock &MBB,
41                               MachineBasicBlock::iterator MBBI,
42                               const std::vector<CalleeSavedInfo> &CSI,
43                               const TargetRegisterInfo *TRI) const
44     override;
45   virtual bool
46     restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
47                                 MachineBasicBlock::iterator MBBII,
48                                 const std::vector<CalleeSavedInfo> &CSI,
49                                 const TargetRegisterInfo *TRI) const override;
50   virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF,
51                                                    RegScavenger *RS) const;
52   virtual void emitPrologue(MachineFunction &MF) const override;
53   virtual void emitEpilogue(MachineFunction &MF,
54                             MachineBasicBlock &MBB) const override;
55   virtual bool hasFP(const MachineFunction &MF) const override;
56   virtual int getFrameIndexOffset(const MachineFunction &MF,
57                                   int FI) const override;
58   virtual bool hasReservedCallFrame(const MachineFunction &MF) const override;
59   virtual void
60   eliminateCallFramePseudoInstr(MachineFunction &MF,
61                                 MachineBasicBlock &MBB,
62                                 MachineBasicBlock::iterator MI) const override;
63
64   // Return the number of bytes in the callee-allocated part of the frame.
65   uint64_t getAllocatedStackSize(const MachineFunction &MF) const;
66
67   // Return the byte offset from the incoming stack pointer of Reg's
68   // ABI-defined save slot.  Return 0 if no slot is defined for Reg.
69   unsigned getRegSpillOffset(unsigned Reg) const {
70     return RegSpillOffsets[Reg];
71   }
72 };
73 } // end namespace llvm
74
75 #endif