2012-02-18 12:03:15 +00:00
|
|
|
//===-- SparcFrameLowering.h - Define frame lowering for Sparc --*- C++ -*-===//
|
2010-11-15 00:06:54 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPARC_FRAMEINFO_H
|
|
|
|
#define SPARC_FRAMEINFO_H
|
|
|
|
|
|
|
|
#include "Sparc.h"
|
|
|
|
#include "SparcSubtarget.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-11-15 00:06:54 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class SparcSubtarget;
|
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
class SparcFrameLowering : public TargetFrameLowering {
|
2013-04-09 04:37:47 +00:00
|
|
|
const SparcSubtarget &SubTarget;
|
2010-11-15 00:06:54 +00:00
|
|
|
public:
|
2013-04-09 04:37:47 +00:00
|
|
|
explicit SparcFrameLowering(const SparcSubtarget &ST)
|
|
|
|
: TargetFrameLowering(TargetFrameLowering::StackGrowsDown,
|
|
|
|
ST.is64Bit() ? 16 : 8, 0, ST.is64Bit() ? 16 : 8),
|
|
|
|
SubTarget(ST) {}
|
2010-11-15 00:06:54 +00:00
|
|
|
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
|
|
/// the function.
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2010-11-18 21:19:35 +00:00
|
|
|
|
2013-02-21 20:05:00 +00:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
2013-05-17 15:14:34 +00:00
|
|
|
bool hasReservedCallFrame(const MachineFunction &MF) const;
|
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
2013-05-29 04:46:31 +00:00
|
|
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|
|
|
RegScavenger *RS = NULL) const;
|
|
|
|
|
|
|
|
private:
|
2013-06-04 18:33:25 +00:00
|
|
|
// Remap input registers to output registers for leaf procedure.
|
2013-05-29 04:46:31 +00:00
|
|
|
void remapRegsForLeafProc(MachineFunction &MF) const;
|
|
|
|
|
2013-06-04 18:33:25 +00:00
|
|
|
// Returns true if MF is a leaf procedure.
|
2013-05-29 04:46:31 +00:00
|
|
|
bool isLeafProc(MachineFunction &MF) const;
|
2013-11-24 20:23:25 +00: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 00:06:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|