Fix uninitialized variable
[llvm-core.git] / lib / Target / Sparc / SparcFrameLowering.h
blob6098afa6898528e7f4cbf0d761469147693aef55
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 //
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
15 #define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
17 #include "Sparc.h"
18 #include "llvm/CodeGen/TargetFrameLowering.h"
20 namespace llvm {
22 class SparcSubtarget;
23 class SparcFrameLowering : public TargetFrameLowering {
24 public:
25 explicit SparcFrameLowering(const SparcSubtarget &ST);
27 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
28 /// the function.
29 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
30 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
32 MachineBasicBlock::iterator
33 eliminateCallFramePseudoInstr(MachineFunction &MF,
34 MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator I) const override;
37 bool hasReservedCallFrame(const MachineFunction &MF) const override;
38 bool hasFP(const MachineFunction &MF) const override;
39 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
40 RegScavenger *RS = nullptr) const override;
42 int getFrameIndexReference(const MachineFunction &MF, int FI,
43 unsigned &FrameReg) const override;
45 /// targetHandlesStackFrameRounding - Returns true if the target is
46 /// responsible for rounding up the stack frame (probably at emitPrologue
47 /// time).
48 bool targetHandlesStackFrameRounding() const override { return true; }
50 private:
51 // Remap input registers to output registers for leaf procedure.
52 void remapRegsForLeafProc(MachineFunction &MF) const;
54 // Returns true if MF is a leaf procedure.
55 bool isLeafProc(MachineFunction &MF) const;
58 // Emits code for adjusting SP in function prologue/epilogue.
59 void emitSPAdjustment(MachineFunction &MF,
60 MachineBasicBlock &MBB,
61 MachineBasicBlock::iterator MBBI,
62 int NumBytes, unsigned ADDrr, unsigned ADDri) const;
66 } // End llvm namespace
68 #endif