]>
Commit | Line | Data |
---|---|---|
223e47cc LB |
1 | //===-- SparcFrameLowering.h - Define frame lowering for Sparc --*- 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 | // | |
11 | // | |
12 | //===----------------------------------------------------------------------===// | |
13 | ||
1a4d82fc JJ |
14 | #ifndef LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H |
15 | #define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H | |
223e47cc LB |
16 | |
17 | #include "Sparc.h" | |
223e47cc LB |
18 | #include "llvm/Target/TargetFrameLowering.h" |
19 | ||
20 | namespace llvm { | |
223e47cc | 21 | |
1a4d82fc | 22 | class SparcSubtarget; |
223e47cc LB |
23 | class SparcFrameLowering : public TargetFrameLowering { |
24 | public: | |
1a4d82fc | 25 | explicit SparcFrameLowering(const SparcSubtarget &ST); |
223e47cc LB |
26 | |
27 | /// emitProlog/emitEpilog - These methods insert prolog and epilog code into | |
28 | /// the function. | |
1a4d82fc JJ |
29 | void emitPrologue(MachineFunction &MF) const override; |
30 | void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; | |
223e47cc | 31 | |
1a4d82fc JJ |
32 | void |
33 | eliminateCallFramePseudoInstr(MachineFunction &MF, | |
34 | MachineBasicBlock &MBB, | |
35 | MachineBasicBlock::iterator I) const override; | |
36 | ||
37 | bool hasReservedCallFrame(const MachineFunction &MF) const override; | |
38 | bool hasFP(const MachineFunction &MF) const override; | |
39 | void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, | |
40 | RegScavenger *RS = nullptr) const override; | |
41 | ||
42 | private: | |
43 | // Remap input registers to output registers for leaf procedure. | |
44 | void remapRegsForLeafProc(MachineFunction &MF) const; | |
45 | ||
46 | // Returns true if MF is a leaf procedure. | |
47 | bool isLeafProc(MachineFunction &MF) const; | |
48 | ||
49 | ||
50 | // Emits code for adjusting SP in function prologue/epilogue. | |
51 | void emitSPAdjustment(MachineFunction &MF, | |
52 | MachineBasicBlock &MBB, | |
53 | MachineBasicBlock::iterator MBBI, | |
54 | int NumBytes, unsigned ADDrr, unsigned ADDri) const; | |
970d7e83 | 55 | |
223e47cc LB |
56 | }; |
57 | ||
58 | } // End llvm namespace | |
59 | ||
60 | #endif |