2012-02-18 20:03:15 +08:00
|
|
|
//===-- SparcFrameLowering.h - Define frame lowering for Sparc --*- C++ -*-===//
|
2010-11-15 08:06:54 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
#include "Sparc.h"
|
2011-01-10 20:39:04 +08:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2014-06-27 06:33:50 +08:00
|
|
|
class SparcSubtarget;
|
2011-01-10 20:39:04 +08:00
|
|
|
class SparcFrameLowering : public TargetFrameLowering {
|
2010-11-15 08:06:54 +08:00
|
|
|
public:
|
2014-06-27 06:33:50 +08:00
|
|
|
explicit SparcFrameLowering(const SparcSubtarget &ST);
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
|
|
/// the function.
|
2014-04-29 15:57:13 +08:00
|
|
|
void emitPrologue(MachineFunction &MF) const override;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
|
2010-11-19 05:19:35 +08:00
|
|
|
|
2014-04-29 15:57:13 +08:00
|
|
|
void
|
|
|
|
eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const override;
|
2013-02-22 04:05:00 +08:00
|
|
|
|
2014-04-29 15:57:13 +08:00
|
|
|
bool hasReservedCallFrame(const MachineFunction &MF) const override;
|
|
|
|
bool hasFP(const MachineFunction &MF) const override;
|
2013-05-29 12:46:31 +08:00
|
|
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
2014-04-29 15:57:13 +08:00
|
|
|
RegScavenger *RS = nullptr) const override;
|
2013-05-29 12:46:31 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-05 02:33:25 +08:00
|
|
|
// Remap input registers to output registers for leaf procedure.
|
2013-05-29 12:46:31 +08:00
|
|
|
void remapRegsForLeafProc(MachineFunction &MF) const;
|
|
|
|
|
2013-06-05 02:33:25 +08:00
|
|
|
// Returns true if MF is a leaf procedure.
|
2013-05-29 12:46:31 +08:00
|
|
|
bool isLeafProc(MachineFunction &MF) const;
|
2013-11-25 04:23:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
// Emits code for adjusting SP in function prologue/epilogue.
|
|
|
|
void emitSPAdjustment(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
int NumBytes, unsigned ADDrr, unsigned ADDri) const;
|
|
|
|
|
2010-11-15 08:06:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|