2011-01-10 20:39:04 +08:00
|
|
|
//==- MSP430FrameLowering.h - Define frame lowering for MSP430 --*- 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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef MSP430_FRAMEINFO_H
|
|
|
|
#define MSP430_FRAMEINFO_H
|
|
|
|
|
|
|
|
#include "MSP430.h"
|
2011-01-10 20:39:04 +08:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2011-01-10 20:39:04 +08:00
|
|
|
class MSP430FrameLowering : public TargetFrameLowering {
|
2010-11-15 08:06:54 +08:00
|
|
|
protected:
|
|
|
|
|
|
|
|
public:
|
2014-06-27 08:52:11 +08:00
|
|
|
explicit MSP430FrameLowering()
|
|
|
|
: TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2, 2) {}
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
|
|
/// the function.
|
2014-04-29 15:58:09 +08:00
|
|
|
void emitPrologue(MachineFunction &MF) const override;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
|
2010-11-19 05:19:35 +08:00
|
|
|
|
2013-02-22 04:05:00 +08:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
2014-04-29 15:58:09 +08:00
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const override;
|
2013-02-22 04:05:00 +08:00
|
|
|
|
2010-11-28 07:05:03 +08:00
|
|
|
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
2014-04-29 15:58:09 +08:00
|
|
|
const TargetRegisterInfo *TRI) const override;
|
2010-11-28 07:05:03 +08:00
|
|
|
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
2014-04-29 15:58:09 +08:00
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
|
|
|
const TargetRegisterInfo *TRI) const override;
|
2010-11-28 07:05:03 +08:00
|
|
|
|
2014-04-29 15:58:09 +08:00
|
|
|
bool hasFP(const MachineFunction &MF) const override;
|
|
|
|
bool hasReservedCallFrame(const MachineFunction &MF) const override;
|
2013-03-15 04:33:40 +08:00
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
2014-04-29 15:58:09 +08:00
|
|
|
RegScavenger *RS = nullptr) const override;
|
2010-11-15 08:06:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|