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